Class ConfigurableMenuService

    • Constructor Detail

      • ConfigurableMenuService

        public ConfigurableMenuService()
    • Method Detail

      • getNetsByAuthorAsMapOptions

        public java.util.Map<java.lang.String,​I18nString> getNetsByAuthorAsMapOptions​(User author,
                                                                                            java.util.Locale locale)
        Constructs a map that can be used as a value for any MapOptionsField. The map will contain strings related to process nets authored by the provided user. A key of the map is a string of the form "<net identifier>:<net version>". The version portion of the string uses the dash (-) character to separate the major, minor a patch version numbers instead of the traditional dot character. A value of the map is an I18nString with no translations of the form "<net identifier> : <net version>". The default value of the net title is used.
        Specified by:
        getNetsByAuthorAsMapOptions in interface IConfigurableMenuService
        Parameters:
        author - currently logged user
        Returns:
        an options map containing the identifiers and version of nets authored by the provided user as keys and their titles and versions as values
      • getAvailableRolesFromNet

        public java.util.Map<java.lang.String,​I18nString> getAvailableRolesFromNet​(EnumerationMapField processField,
                                                                                         MultichoiceMapField permittedRoles,
                                                                                         MultichoiceMapField bannedRoles)
        Constructs a map that can be used as a value for any MapOptionsField. The map will contain roles from the net selected in the provided field, that are not present in either of the provided multichoice fields. A key of the map is a string of the form "<role identifier>:<net identifier>" A value of the map is the role title.
        Specified by:
        getAvailableRolesFromNet in interface IConfigurableMenuService
        Parameters:
        processField - the value of the field determines the process whose roles are put into the result. The options key must match the format generated by the getNetsByAuthorAsMapOptions(User, Locale) method
        permittedRoles - the roles selected in this multichoice will not be present in the result. The option keys of this multichoice must match the format returned by this method
        bannedRoles - the roles selected in this multichoice will not be present in the result. The option keys of this multichoice must match the format returned by this method
        Returns:
        an options map containing the role and net identifiers as keys and the role titles as values
      • removeSelectedRoles

        public java.util.Map<java.lang.String,​I18nString> removeSelectedRoles​(MultichoiceMapField mapField)
        Constructs a map that can be used as a value for any MapOptionsField. The map will contain all the options from the input field except for those that are selected in the input field.
        Specified by:
        removeSelectedRoles in interface IConfigurableMenuService
        Parameters:
        mapField - a map field whose value complement we want to get
        Returns:
        a map containing all the deselected options of the provided field
      • addSelectedRoles

        public java.util.Map<java.lang.String,​I18nString> addSelectedRoles​(MultichoiceMapField addedRoles,
                                                                                 EnumerationMapField processField,
                                                                                 MultichoiceMapField rolesAvailable)
        Constructs a map that can be used as a value for any MapOptionsField. The map will contain a union of the options that are already present in the addedRoles field with the options selected in the rolesAvailable field. The keys remain unchanged. The values of the map are a combination of the options from the addedRoles field (they remain unchanged) and new values corresponding to the new keys from the rolesAvailable field. The new values are of the form "<original value> (<net title>)"
        Specified by:
        addSelectedRoles in interface IConfigurableMenuService
        Parameters:
        addedRoles - a field containing the preexisting options. The options of this field are assumed to be generated by this method.
        processField - a field containing the information about the selected process. The options of this field are assumed to be generated by the getNetsByAuthorAsMapOptions(User, Locale) method
        rolesAvailable - a field containing the selection of the new roles. The options of this field are assumed to be generated by the getAvailableRolesFromNet(EnumerationMapField, MultichoiceMapField, MultichoiceMapField) method
        Returns:
        a map containing a quasi-union of the options from the addedRoles and rolesAvailable fields