This concept is based on a working prototype. You can download and try the prototype by following these instructions.
Introduction
Make the Configuration App easier to use by making suggestions when the user is editing the tree and by flagging potential mistakes.
Try It
Download the latest tomcat bundle with autosuggest from Nexus
Try out the features by following these instructions
- You can also find additional resources here:
Features
Make suggestions for in-place editing
Suggestions for adding nodes or properties
- Suggest node and property names when creating new nodes and properties
Suggestions for referencing a dialog
- Suggest dialog references when entering values for the dialog property of a template configuration
Suggestions for boolean property values
- Suggest true and false when entering the value of a boolean property
Suggestions for class property value
- Suggest possible class names when entering value of class property for nodes
Suggestions for extends property value
- Suggest paths to other nodes when entering value of extends in special circumstances, such as when extending a template, app, or dialog
Suggestions for enum property value
- Suggest values of enum when entering value of property that is an enum
Suggestions for property type
- Suggest the type of a property when entering the type
Suggestions for icon names
- Suggest the names of icons available in the system when entering value of icon property
Suggestion box behavior details
Add multiple suggested nodes and properties using a dialog
- Add an action to the action bar which brings up a light dialog containing all the nodes and properties that can be added under the currently selected node
- The light dialog should have a display similar to the Move Dialog, with the styling matching the styling of the tree
- However, we only show the parent node or folder and the existing/potential sub-nodes and sub-properties underneath, indented (we only show one level)
- There are no expansion triangles
- After adding, JCR type should be automatically set if only one is suggested, otherwise set as String
Reuse the autosuggest tree in any content app
- The autosuggest tree is reusable in any content app
All the user has to do is implement the
AutoSuggester
interface which takes the cell of the tree and calculates a list of suggestionsThen by telling the content app to use the
AutoSuggestTree
and the user's ownAutoSuggester
, the user automatically has a tree that displays the suggestions in a pop-up and marks potential errorsDetailed instructions:
Set the tree definition class in the workbench of the content app (ex. /modules/ui-admincentral/apps/configuration/subApps/browser/workbench/contentViews/tree@class) to
info.magnolia.ui.workbench.autosuggest.AutoSuggestTreePresenterDefinition
Create a suggester class that calculates suggestions given the cell in the tree by implementing
info.magnolia.ui.api.AutoSuggester
- Tell the autosuggest tree to use the custom suggester by setting the autoSuggesterClass property (ex. /modules/ui-admincentral/apps/configuration/subApps/browser/workbench/contentViews/tree@autoSuggesterClass)
Questions
Icon for action to add nodes to the tree with auto-suggest?
Future Improvements
Highlight mandatory and recommended node and property suggestions (Andreas)
- Sometimes there are many potential nodes and properties to create. In specific instances, we can highlight the ones that are mandatory or common when making suggestions to the user.
Make suggestions based on similar node structures
- Similar to the way Excel for example suggests values for a cell in a column based on what has been entered in other cells of the same column, we can suggest values based on values entered for the property in similar node structures.
Automatically set the type of a property when setting its name (Federico)
- For example, set the type of the property to to boolean in the tree if its corresponding bean member is of type boolean
Use tree in dialog for adding multiple suggested nodes and properties
- Use a tree rather than a list which would allow creating suggested nodes and properties in subtrees as well
Display help text about nodes and properties that can be added
- Help text explaining what a node or property represents can be fetched online from JavaDoc and displayed alongside the suggestion
Autosuggest in dialog box fields
- For example, the edit property dialog is a natural place to have fields with auto-suggest that suggest the same as the tree; this would also make it easier to work on a tablet where in-place tree editing is not available
3 Comments
Federico Grilli
First of all, congrats - really cool stuff! I quickly tested the autosuggest feature on latest Chrome and Mac OS X 10.8.5. Here's my report
ERRORS
REMARKS
IMPROVEMENTS
Cheng Hu
Thanks very much for your feedback. I added many of these points into the concept.
contentType
node in the bean classinfo.magnolia.voting.voters.VoterSet
or its subclasses for the node. Is there some other way to tell thatcontentType
is a legitimate subnodeREMARKS
IMPROVEMENTS
Federico Grilli
Currently suggestions are based on Content2Bean, and there is indeed no
contentType
node in the bean classinfo.magnolia.voting.voters.VoterSet
or its subclasses for the node. Is there some other way to tell thatcontentType
is a legitimate submode ?I guess that if a node has a class property it can be safely assumed that any name for that node is valid.