...
Code Block |
---|
( isWizard & ( hasSpellSlots | hasWand)) |
Maybe expressions Expressions would also have access to some context such as the current user group and role, so that some fields would only be visible or enabled to certain user roles. (TODO add an example of that.)
2. Consider Provide ways to augment fields, potentially with Java, that do not require creating brand new fieldTypes. Creating fieldTypes is harder, slower & less transparent then augmenting a fieldType with some custom behaviour.
...
Question
Is there a nice way that, for any thing that can take an inline expression, it could also take a "link" to an external javascript function, or to a java class?
ie enabled, visible, label, buttonLabel, options
Would we need to add additional properties like enabledClass, visibleClass....?
...
Dynamic Label & Dynamic Button Labels
TODO.
Use expression, Javascript or Java, to determine which hardcoded string is displayed, or which i18n key is retrieved.
...
"This combination of herbs soothes your mind and promotes concentration".
Code Block |
---|
fields: herbMessage: fieldType: static label: (info....DynamicHerbMessages) |
Dynamic Options
Populate the options of a selectbox, set of radiobuttons, or twincolumn select or link field (with chooser), based on the value of other fields.
...
Code Block |
---|
fields: country: fieldType: select path: / repository: countries state: fieldType: dynamicSelect optionModelArguments - country #references 'country' field. optionModel: org.dandelion......StatesPerCountry postalCode: fieldType: dynamicSelect optionModelArguments - state #references 'state' field. optionModel: org.dandelion......PostalCodesPerState |
...
Out-of-the-box fields based on a heirarchy of nodes. (Possibly Probably JCR bound.)
introduce two new dynamic field types:
...
Code Block |
---|
fields: myWorkspace: fieldType: workspace myParentNode: #lists items based on the workspace chosen in 'myWorkspace' field. fieldType: dynamicNodeLink workspace: myWorkspace nodeTypes: - mgnl:folder assets: #lists items based on the node chosen in 'myParentNode' field. fieldType: dynamicNodeSelect parentNode: myParentNode includeAllDecendants: true nodeTypes: - mgnl:asset |
NoteQuestion: Can we make this ContentType-centric instead of JCR-centric so that it is usable OOTB on external content sources?
REST Item Chooser
Out-of-the-box fields based on a getting items via REST from external content sources.
(Maybe we dont need new field types, we can just leverage what is supplied in EasyREST epic. See comment:
Jira | ||||||
---|---|---|---|---|---|---|
|
introduce two new dynamic field types:
dynamicRESTLink:
A link field which uses a REST client to populate it's chooser.
Importantly, the field can use expressions to specify OTHER FIELDS as parameters to the REST client, or as the restClient or the restCall to use, dynamically.
dynamicRESTSelect:
A selectbox which uses a REST client to populate its options.
By default it only returns the immediate children.
Importantly, the field can use expressions to specify OTHER FIELDS as parameters to the REST client, or as the restClient or the restCall to use, dynamically.
Code Block |
---|
fields:
ecommerceSystem:
fieldType: select
options:
- elasticPath
- shopify
category:
fieldType: dynamicRESTSelect
datasource:
$type: jsonDatasource
restClient: (ecommerceSystem) #dynamic based on value in 'ecommerceSystem' field.
restCall: categories
assets:
fieldType: dynamicRESTLink
datasource:
$type: jsonDatasource
restClient: (ecommerceSystem) #dynamic based on value in 'ecommerceSystem' field.
restCall: products
restCallParameters:
- category: (category) #dynamic based on value in 'category' field. |
Notes
Take a look at linked tickets on:
Jira | ||||||
---|---|---|---|---|---|---|
|
...