Configurable menu

Last modified 03 Feb 2023 20:33 +01:00
Example of how menu configuration could look like
<ui>
    <menu>
        <user> <!-- represents photo/username, content optional -->
            <photo>true/false</photo>
            <label>
                <!-- ExpressionType -->
            </label>
        </user>
        <group>
            <display>
                <!-- type of DisplayType -->
            </display>
            <action>
                <action>
                    <action>
                        <display>
                            <!-- type of DisplayType -->
                        </display>
                        <authorization>
                            <!-- type of AuthorizationType, represents list of authorizations that user has to have to display this action -->
                        </authorization>
                        <visible>   <!-- type of BehaviourType -->
                            <!-- implements java.util.Function<Menu, Boolean> -->
                            <implementation>some.package.ClassName</implementation>
                            <expression>
                                <!-- ExpressionType -->
                            </expression>
                        </visible>
                        <enabled>   <!-- type of BehaviourType -->
                            <!-- implements java.util.Function<Menu, Boolean> -->
                            <implementation>some.package.ClassName</implementation>
                            <expression>
                                <!-- ExpressionType -->
                            </expression>
                        </enabled>
                        <badge>
                            <!-- TODO: badge configuration -->
                            <cssClass></cssClass>
                            <cssClassExpression>
                                <!-- ExpressionType, can be instead of cssClass -->
                            </cssClassExpression>
                            <valueExpression>
                                <!-- ExpressionType -->
                            </valueExpression>
                        </badge>
                        <handler>
                            <pageClass>com.example.PageSomething</pageClass>
                            <!--
                                string, can be used instead of pageClass element. Page class will be
                                searched on classpath for annotation @PageIdentifier
                            -->
                            <pageIdentifier></pageIdentifier>
                            <pageParameter>
                                <!-- choice of index or name -->
                                <index>1</index>
                                <name>some_name</name>
                                <expression>
                                    <!-- ExpressionType -->
                                </expression>
                            </pageParameter>
                            <pageExpression>
                                <!-- ExpressionType, for totally dynamic setup of Page used as next page for navigation -->
                            </pageExpression>
                        </handler>
                    </action>
                </action>
            </action>
            <divider>
                <!-- TODO: is this needed? -->
            </divider>

            <!-- special menus items to simplify customization -->
            <defaultAssignmentHolderActions/>
            <compiledCollections>
                <type><!-- QName --></type>
                <visible></visible>
                <enabled></enabled>
            </compiledCollections>
        </group>
    </menu>
</ui>

TODO

  • Possible type hierarchy for menu items:

    • MenuItemType

      • TODO

  • How do create menu items for collections and archetypes based on compiled GUI profile?

    • Possible solution see <compiledCollections> example.

  • How to implement new/edit menu items?

  • Probably add <dynamic> flag to <action> to simply mark action as enabled=false

  • Authorizations

Was this page helpful?
YES NO
Thanks for your feedback