Dropdown should to be populated by the document values not the document name - skyve

as you may be able to see from my image below, my drop-down is populated by the display name not the value from the table bindings. Did I miss something or did I get the Document definition wrong?
<association type="aggregation" name="noteType">
<displayName>NoteType</displayName>
<documentName>NoteType</documentName>
</association>
is it missing something to tell it to use the binding?
Any assistance would be greatly appreciated.

good question.
In the situation where you are associating an object instance from another object instance (in this case perhaps from a Note to a NoteType), the default widget Skyve will propose for the view will be a lookupDescription (the drop down in your screenshot). NoteType is a document which may have many attributes - the lookupDescription widget has a descriptionBinding - this is usually set to bizKey but can also be set directly to one of the attributes of NoteType. The bizKey in a document defaults to be the same as the document's singular alias until you set it, resulting in what you see above.
Take for example that NoteType has 3 attributes, an code (text), a typeName (text) and a description (memo).
e.g., Note Types:
code
typeName
description
NWS
news
a news item for the team
ALT
alert
an urgent alert
COM
comment
a general comment
RAN
random
a fun item not related to work
in this case it is not obvious what to show in the drop down or lookupDescription. Perhaps you may want to use the code attribute ("NWS", "ALT" ...) or the typeName attribute (e.g. "news", "alert" ... ) in the drop down, or a mashup of several of the attributes of NoteType like typeName and code (e.g. "NWS (news)", "ALT (alert)" ...).
Whereas in Java you can specify a .toString() method, in Skyve you specify a bizKey - see https://skyvers.github.io/skyve-dev-guide/documents/#bizkey.
For this example, I could specify the NoteType document bizKey attribute like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<document name="NoteType" ...>
<persistent name="NoteType"/>
<singularAlias>Note Type</singularAlias>
<pluralAlias>Note Types</pluralAlias>
<bizKey expression="{code} ({name})" />
<attributes>
<text name="code" >
<displayName>Code</displayName>
<length>3</length>
</text>
<text name="typeName" >
<displayName>Type Name</displayName>
<length>50</length>
</text>
<memo name="description" >
<displayName>Description</displayName>
</memo>
</attributes>
</document>
where bizKey has the expression "{code} ({name})" yielding "NWS (news)", "ALT (alert)" ... this uses Skyve expressions which will be re-evaluated as part of the bean lifecycle and saved as the special database field bizKey.
You can also define the bizKey in Java - for an example of this, check the Contact document (Contact.xml file) in the admin module in your project.
The bizKey attribute is required by Skyve - so when you create a project in Skyve Foundry, the bizKey attribute in the project xml is generated to default to the singular alias (or document name) - in your case "NoteType" to make sure it will have a value.
The bizKey is required by Skyve so that there is always a way for the application to refer to an instance of a document. This is especially important for no-code situations where the developer may not yet have got around to specifying things precisely but wants to be able to start to use the application as a proof of concept.
The bizKey attribute is persisted (saved) in the database for performance reasons - so that Skyve can rapidly retrieve and filter rows based on bizKey values, rather than attempting to calculate them as a derived expression (which would require conversion of expressions or Java code to dialect-specific SQL and also add extra processing every time bizKey values were retrieved).
This means that if you have created data with a different bizKey definition, you'll need to resave your NoteType records. You can do this easily by:
signing in to your Skyve application as an administrator (or the setup/bootstrap user if you have one)
navigate to admin->Devops->Data Maintenance and choose the Data Refresh tab
select the NoteType document, choose the Option "Save" and press "Refresh Persisted Document Data"
For reference:
https://skyvers.github.io/skyve-dev-guide/documents/#documentxml-sections
https://skyvers.github.io/skyve-dev-guide/expressions/
https://skyvers.github.io/skyve-dev-guide/skyve-persistence-mechanisms/

Related

Model object properties identification

We are using SQLite property database to get information about object's properties. The problem we are facing with is property identification. For each property we have:
id: looks like it is just an autoincremental id and it can be used to
identify property between two versions of the same model
name: for .rvt models it is mostly unique, but there are some duplications
sometimes (for example the same property with different flags,
readonly and not); for .ifc files it is not unique at all
category + displayName: the problem with this
fields is that after using design automation API (to change and
re-save model) category/displayName can be translated into English
(but initially they can be, for example, in German)
Now we are using the combination of 'name + category + displayName' to identify the property, but it is not the solution, because this combination still is not unique in some rare cases (it is data lost for us) and it doesn't solve the problem with property names translation using Design Automation API.
Any ideas how to identify properties will be helpful! Thanks
For a given element, the externalId should be unique within that model (at the model level, the urn is unique). There is no unique identification for properties.
I'm interested in understand this workflow better, are you able to have a quick talk? Please use this link to book a time.

How to identify period end contexts in xbrl filings?

I am trying to find only the current period concepts and facts for the three main financial statements. The goal is to be able to iterate through filings of different companies in different periods.
Using Ebay 2017 10-k as an example.
For concepts that capture YoY change, like those in income statement and statement of cash flows, I can use context found in any of the dei tags, for example:
<dei:DocumentFiscalYearFocus contextRef="FD2017Q4YTD" id="Fact-2E3E1FD4D81352F693510AE035FDC862-wk-Fact-2E3E1FD4D81352F693510AE035FDC862">2017</dei:DocumentFiscalYearFocus>
dei:DocumentFiscalYearFocus tag is required, and its context "FD2017Q4YTD" is also found in all IS and SCF period end concepts, so that's easy.
However, balance sheet concepts use a different context:
<us-gaap:CashAndCashEquivalentsAtCarryingValue contextRef="FI2017Q4" decimals="-6" id="d15135667e874-wk-Fact-3E4A0A2B272B59DE9DAF004097ECF968" unitRef="usd">2120000000</us-gaap:CashAndCashEquivalentsAtCarryingValue>
Any idea how to identify the "FI2017Q4" context (or otherwise find current period balance sheet concepts)?
The XBRL document instance you are viewing contains one or more schemaRef elements, each of which loads an XBRL taxonomy, or data dictionary, for the XBRL instance. Somewhere, within that reference graph of files (and there could be several files), is the definition of each context. The definition will look something like this:
<context id="CONTEXT_ID_NAME">
<!-- ... child elements appear here ... -->
</context>
If you can find the <context> element with an attribute of id that matches the contextRef you're interested in, then you've found what you're looking for. In your case, you're looking in the related XBRL taxonomy files for something that says <context ID="FD2017Q4YTD"> and <context ID="FI2017Q4">.
The child elements of the <context> element describes the dates for the context. There are two types of XBRL contexts:
instant, which specifies a context with a single date
period, which specifies a context with a start date and an end date
The child elements of the <context> element will describe which type of context being described.
This work is all manually doable, but it might be best to use XBRL processing software, which will perform all of this work for you.
The value of the contextRef attribute is purely an identifier that references a context definition elsewhere in the document. Using the eBay example, you'll find this context definition:
<context id="FI2017Q4">
<entity>
<identifier scheme="http://www.sec.gov/CIK">0001065088</identifier>
</entity>
<period>
<instant>2017-12-31</instant>
</period>
</context>
The value in the "instant" element is what tells you what date facts associated with this context relate to.
In order to properly understand the XBRL facts, you need to fully understand the associated contexts. There may be other information, such as additional dimensions, defined here.
I'd strongly recommend working with an existing XBRL processor that will resolve the contextual information for you, such as the open source Arelle processor, or the API provided by XBRL US.
One possible approach to working with XBRL data is to use a processor that converts data to the newer xBRL-JSON format, which provides fact objects with all contextual information fully resolved.

Difference between #If and someText#If jwcid in Tapestry 4.1

This may be a long shot, considering Tapestry 4.1 hasn't been updated whatsoever since 2007 or '08 or something.. But at work they have an old legacy application which uses Tapestry 4.1.
I was wondering, what is the difference between
<span jwcid="something#If" condition="ognl:something">
and
<span jwcid="#If" condition="ognl:something">
if any? Or has the something before the #If no additional purpose than to make it an unique id, which can perhaps be references elsewhere?
Here is some documentation that I've been able to find for Tapestry 4.1, but I'm unable to find an answer for my question:
http://tapestry.apache.org/tapestry4.1/
http://dev.bjmaxinfo.com/docs/tapestry/4.0.2/tapestry/apidocs/index.html
https://wiki.apache.org/tapestry/
EDIT: Ok, I've found a partial answer in the documentation I've linked above.
Understanding DirectLink URLs
The URLs generated by the DirectLink component are more complex than those generated by the PageLink component. Let's look at one:
http://localhost:8080/directlink/app?component=%24DirectLink&page=Home&service=direct&session=T
The first query parameter, component, identifies the component within the page. That %24 is "URL-ese" for a dollar sign. In Tapestry, every component ends up with a unique id within its page. If you don't provide one, Tapestry creates one from the component type, prefixed with a dollar sign. Here, our annoynmous DirectLink component was given the id $DirectLink. If you had many different DirectLinks on a page, you'd start seeing component ids such as $DirectLink_0, $DirectLink_1, etc.
You can give a component a shorter and more mneumonic id by putting the desired id before the "#" sign:
increment counter
After making that change to the template, the URL for the DirectLink component is just a bit easier to read:
http://localhost:8080/directlink/app?component=inc&page=Home&service=direct&session=T
But how does this apply to the #If, which doesn't show up in URLs?
As you said, this is just an identifier which Tapestry uses in its component model.
Here's relevant documentation from user guide: Component IDs

IBM Websphere scripting ID 'containment paths' explained (I.e. AdminConfig.getid(...) )

I have been digging through IBM knowledge center and have returned frustrated at the lack of definition to some of their scripting interfaces.
IBM keeps talking about a containment path used in their id definitions and I am only assuming that it corresponds to an xml element within file in the websphere config folder hierachy, but that's only from observation. I haven't found this declared in any documentation as yet.
Also, to find an ID, there is a syntax that needs to be used that will retrieve it, yet I cannot find a reference to the possible values of 'types' used in the AdminConfig.getid(...) function call.
So to summarize I have a couple questions:
What is the correct definition of the id "heirachy" both for fetching an id and for the id itself?
e.g. to get an Id of the server I would say something like: AdminConfig.getid('/Cell:MYCOMPUTERNode01Cell/Node:MYCOMPUTERNode01/Server:server1'), which would give me an id something like: server1(cells/MYCOMPUTERNode01Cell/nodes/MYCOMPUTERNode01/servers/server1|server.xml#server_1873491723429)
What are the possible /type values in retrieving the id from the websphere server?
e.g. in the above example, /Cell, /Node and /Server are examples of type values used in queries.
UPDATE: I have discovered this document that outlines the locations of various configuration files in the configuration directory.
UPDATE: I am starting to think that the configuration files represent complex objects with attributes and nested attributes. not every object with an 'id' is query-able through the AdminConfig.getid(<containment_path>). Object attributes (and this is not attributes in the strict xml sense as 'attributes' could be nested nodes with a simple structure within the parent node) may be queried using AdminConfig.showAttribute(<element_id>, <attribute_name>). This function will either return the string value of the inline attribute of the element itself or a string list representation of the ids of the nested attribute node(s).
UPDATE: I have discovered the AdminConfig.types() function that will display a list of all manipulatible object types in the configuration files and the AdminConfig.parent() function that displays what nodes are considered parents of the specified node.
Note: The AdminConfig.parent() function does not reveal the parents in order of their hierachy, rather it seems to just present a list of parents. e.g. AdminConfig.parent('JDBCProvider') gives us this exact list: 'Cell\nDeployment\nNode\nServer\nServerCluster' and even though Server comes before ServerCluster , running AdminConfig.parent('Server') reveals it's parents as: 'Node\nServerCluster'. Although some elements can have no parents - e.g. Cell - Some elements produce an error when running the parent function - e.g. Deployment.
Due to the apparent lack of a reciprocal AdminConfig.children() function, It appears as though obtaining a full hierachical tree of parents/children lies in calling this function on each of the elements returned from the AdminConfig.parent(<>) call and combining the results. That being said, a trial and error approach is mostly fruitful due to the sometimes obvious ordering.

Validate DataGridColumn cells individually

How can I validate the cells in a DataGridColumn individually? (ActionScript 3.5) The validation is configured per-cell, based on fields in the given row. For example
FIELD VALUE TYPE
age 13 Integer
height 13x3 Integer
registered true Boolean
temperature 98.G6 Float
In this case, of course 13x3 and 98.G6 would be invalid.
It's easy to write a Validator ; and to access the data provider objects.
But how do I get individual access to the GUI cell objects so I can set the errorString on an individual cell, either directly or through a Validator?
The itemRenderer/ TextInput control is re-used across the cells for performance reasons, so accessing the GUI-level objects is tricky.
Edit
Answers:
One way to validate and display the invalidation markings, but not per-cell, is to validate all data-provider objects and then set the errorString on the entire grid.
One way to validate per-cell is on the itemEditEnd event handler. (See these pages A B C D). One disadvantage is that it only allows access to the cells from the "inside", not in an action that validates the grid on command.
A custom itemRenderer is another possibility, as in the answer below, but like 3 above, it only allows access to the cells from the "inside", not in an action that validates the grid on command.
See Richard Haven's answer below.
And here's how to access the GUI objects: The list of relevant GUI objects is a protected field; so you can access it by subclassing, then iterate over the GUI-components which represent the cells and set the errorString on each one.
This website at BigResource asks how to access an individual cell. The third post answers there question and provides a link to a better resource than this. Figured you would want both. Hopefully this helps.
If you are looking for arbitrary validation (e.g. on a button or page navigation) rather than immediate navigation (e.g. on cell exit or end-of-edit), then the data is in the underlying dataProvider. I would do validations there rather than dig around inside the grid.
You can add a flag to the data item so the item renderer displays it as an error (or use an external list to flag it).
Cheers
Are you sure you actually want to access the individual cells' DisplayObjects? The component manages instances so that it only creates as many as it needs to display (so that huge datasets don't require a huge number of DisplayObjects on screen).
I think a better alternative would be to provide your DataGridColumn with a custom itemRenderer. You can write this class to accept a validator and update its appearance, and there are a bunch of great tutorials around about that.