Configurable menu

Last modified 19 Jan 2023 22:10 +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>
            <action>
                <action>
                    <action>
                        <display>
                            <!-- type of DisplayType -->
                        </display>
                        <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 -->
                        </badge>
                        <handler>
                            <pageClass>com.example.PageSomething</pageClass>
                            <pageParameter>
                                <!-- choice of index or name -->
                                <index>1</index>
                                <name>some_name</name>
                                <expression>
                                    <!-- ExpressionType -->
                                </expression>
                            </pageParameter>
                        </handler>
                    </action>
                </action>
            </action>
            <divider>
                <!-- TODO: is this needed? -->
            </divider>

            <!-- special menu items to simplify customization -->
            <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