Class UserPortalViewModel

    • Constructor Detail

      • UserPortalViewModel

        public UserPortalViewModel​(UUID portalUuid,
                                   boolean persisted)
        Creates a new view model for a given user portal.
        Parameters:
        portalUuid - The UUID of the portal.
        persisted - Whether the portal is persisted in the database (or a new, unsaved portal).
    • Method Detail

      • getActiveTab

        public EUserPortalViewTab getActiveTab()
        Gets the tab that is currently active, i.e. selected and visible to the user.
        Returns:
        The currently active tab.
      • setActiveTab

        public void setActiveTab​(EUserPortalViewTab tab)
        Gets the tab that is currently active, i.e. selected and visible to the user.
        Parameters:
        tab - The currently active tab.
      • getActiveTabIndex

        public int getActiveTabIndex()
        The index of the tab that is currently active, i.e. selected and visible to the user.
        Returns:
        The index of the currently active tab.
      • setActiveTabIndex

        public void setActiveTabIndex​(int activeTabIndex)
        The index of the tab that is currently active, i.e. selected and visible to the user.
        Parameters:
        activeTabIndex - The index of the currently active tab.
      • getAlias

        public String getAlias()
        Gets the portal's alias. The alias is a custom technical name that is used to identify the portal.
        Returns:
        The portal's alias.
      • setAlias

        public void setAlias​(String alias)
        Sets the portal's alias. The alias is a custom technical name that is used to identify the portal.
        Parameters:
        alias - The portal's alias.
      • getAvailableLocales

        public List<Locale> getAvailableLocales()
        Gets the available locales for the portal. Users can add arbitrary locales to translate the portal into different languages.
        Returns:
        The available locales for the portal.
      • setAvailableLocales

        public void setAvailableLocales​(List<Locale> availableLocales)
        Sets the available locales for the portal. Users can add arbitrary locales to translate the portal into different languages.
        Parameters:
        availableLocales - The available locales for the portal.
      • getDefaultAuthenticatorConfigLocalizations

        public UserPortalLocalizationsViewModel getDefaultAuthenticatorConfigLocalizations()
        Gets the localized values of the currently selected authenticator config, if any, using the default locale. Returns an empty model if no project is selected.
        Returns:
        The localized values of the currently selected authenticator config, with the currently selected locale.
      • getDefaultLocale

        public Locale getDefaultLocale()
        Gets the default language of the portal. The default language is used as a fallback if no translation is available.
        Returns:
        The default language of the portal.
      • setDefaultLocale

        public void setDefaultLocale​(Locale defaultLocale)
        Sets the default language of the portal. The default language is used as a fallback if no translation is available.
        Parameters:
        defaultLocale - The default language of the portal.
      • getDefaultLocalizations

        public UserPortalLocalizationsViewModelWithFiles getDefaultLocalizations()
        Gets the localized values of the portal for the currently selected language.
        Returns:
        The localized values for the currently selected language.
      • getDefaultProjectLocalizations

        public UserPortalLocalizationsViewModelWithFiles getDefaultProjectLocalizations()
        Gets the localized values of the currently selected project (from the project tree), if any, using the default locale. Returns an empty model if no project is selected.
        Returns:
        The localized values of the currently selected project, with the default locale.
      • getDefaultTagLocalizations

        public UserPortalLocalizationsViewModel getDefaultTagLocalizations()
        Gets the localized values of the currently selected tag, if any, for the default locale. Returns an empty model if no tag is selected.
        Returns:
        The localized values of the currently selected tag.
      • getDescription

        public String getDescription()
        Gets the portal's description. This is an HTML string. The description is a human-readable text that describes the portal.
        Returns:
        The portal's description.
      • setDescription

        public void setDescription​(String description)
        Sets the portal's description. This is an HTML string. The description is a human-readable text that describes the portal.
        Parameters:
        description - The portal's description.
      • getEnabledTabs

        public Set<EUserPortalViewTab> getEnabledTabs()
        Gets the tabs that are enabled for the portal. As the portal's configuration is complex, it is split into different tabs.
        Returns:
        The tabs that are enabled for the portal.
      • setEnabledTabs

        public void setEnabledTabs​(Set<EUserPortalViewTab> enabledTabs)
        Sets the tabs that are enabled for the portal. As the portal's configuration is complex, it is split into different tabs.
        Parameters:
        enabledTabs - The tabs that are enabled for the portal.
      • setLocalizations

        public void setLocalizations​(Map<Locale,​UserPortalLocalizationsViewModelWithFiles> localizations)
        Sets the localized texts and files for the portal. Each portal may have different texts and files for different languages.
        Parameters:
        localizations - The localized texts and files for the portal.
      • getLoginConfig

        public UserPortalLoginConfigViewModel getLoginConfig()
        Gets the login configuration for the portal. The login configuration defines which users can log in to the portal.
        Returns:
        The login configuration for the portal.
      • getName

        public String getName()
        Gets the portal's name. The name is a human-readable text that identifies the portal.
        Returns:
        The portal's name.
      • setName

        public void setName​(String name)
        Sets the portal's name. The name is a human-readable text that identifies the portal.
        Parameters:
        name - The portal's name.
      • getNewCustomKey

        public String getNewCustomKey()
      • setNewCustomKey

        public void setNewCustomKey​(String newCustomKey)
      • getNewLanguageName

        public String getNewLanguageName()
        Gets the name of a new tag to create. When the user clicks the "Add" button, an overlay with an input field will be shown. Once the user confirms the new tag, this field will be used to create the new tag.
        Returns:
        Name of the new tag.
      • setNewLanguageName

        public void setNewLanguageName​(String newLanguageName)
        Sets the name of a new tag to create. When the user clicks the "Add" button, an overlay with an input field will be shown. Once the user confirms the new tag, this field will be used to create the new tag.
        Parameters:
        newLanguageName - Name of the new tag.
      • getNewTagName

        public String getNewTagName()
        Gets the name of a new tag to create. When the user clicks the "Add" button, an overlay with an input field will be shown. Once the user confirms the new tag, this field will be used to create the new tag.
        Returns:
        Name of the new tag.
      • setNewTagName

        public void setNewTagName​(String newTagName)
        Sets the name of a new tag to create. When the user clicks the "Add" button, an overlay with an input field will be shown. Once the user confirms the new tag, this field will be used to create the new tag.
        Parameters:
        newTagName - Name of the new tag.
      • getPortalUuid

        public UUID getPortalUuid()
        Gets the UUID of the portal. The UUID is a globally unique identifier for the portal.
        Returns:
        The UUID of the portal.
      • setProjectConfigs

        public void setProjectConfigs​(Map<ProjectConfigKey,​UserPortalProjectConfigViewModel> projectConfigs)
        Sets the project configurations for the portal. Each portal may have a different configuration for each form.
        Parameters:
        projectConfigs - The project configurations for the portal.
      • getProjectTreeRoot

        public org.primefaces.model.TreeNode<de.xima.cmn.dao.interfaces.IEntity<Long>> getProjectTreeRoot()
        Gets the root node for the PrimeFaces tree view that contains the available clients and projects for each client.
        Returns:
        The root node for the PrimeFaces tree view.
      • setProjectTreeRoot

        public void setProjectTreeRoot​(org.primefaces.model.TreeNode<de.xima.cmn.dao.interfaces.IEntity<Long>> projectTreeRoot)
        Sets the root node for the PrimeFaces tree view that contains the available clients and projects for each client.
        Parameters:
        projectTreeRoot - The root node for the PrimeFaces tree view.
      • getProperties

        public Map<Locale,​PortalProperties> getProperties()
        A map with all properties related to the portal, indexed by the locale. Each property contains localized info regarding a localized message that can be edited, such as the label of the property or its default value.
        Returns:
        The properties of the portal.
      • setProperties

        public void setProperties​(Map<Locale,​PortalProperties> properties)
        A map with all properties related to the portal, indexed by the locale. Each property contains localized info regarding a localized message that can be edited, such as the label of the property or its default value.
        Parameters:
        properties - The properties of the portal.
      • getSelectedAuthenticatorConfig

        public UserPortalAuthenticatorViewModel getSelectedAuthenticatorConfig()
        Gets the configuration of the currently selected authenticator config, if any.
        Returns:
        The configuration of the currently selected authenticator config, or null if no authenticator is selected.
      • getSelectedAuthenticatorConfigKey

        public Serializable getSelectedAuthenticatorConfigKey()
        Gets the key of the currently selected authenticator config, if any.
        Returns:
        The key of the currently selected authenticator config, or null if no authenticator is selected.
      • setSelectedAuthenticatorConfigKey

        public void setSelectedAuthenticatorConfigKey​(Serializable authConfigKey)
        Sets the key of the currently selected authenticator config.
        Parameters:
        authConfigKey - The key of the currently selected authenticator config, or null if no authenticator is selected.
      • getSelectedAuthenticatorConfigLocalizations

        public UserPortalLocalizationsViewModel getSelectedAuthenticatorConfigLocalizations()
        Gets the localized values of the currently selected authenticator config, if any, using the currently selected locale. Returns an empty model if no project is selected.
        Returns:
        The localized values of the currently selected authenticator config, with the currently selected locale.
      • getSelectedAuthenticatorConfigLocalizationsByLocale

        public Map<Locale,​UserPortalLocalizationsViewModel> getSelectedAuthenticatorConfigLocalizationsByLocale()
        Gets the localized values of the currently selected authenticator config, if any, grouped by locale. Returns an empty map if no project is selected.
        Returns:
        The localized values of the currently selected authenticator config, grouped by locale.
      • getSelectedLocale

        public Locale getSelectedLocale()
        Gets the language being edited. Each portal may have different texts and files for different languages.
        Returns:
        The language being edited.
      • setSelectedLocale

        public void setSelectedLocale​(Locale selectedLocale)
        Sets the language being edited. Each portal may have different texts and files for different languages.
        Parameters:
        selectedLocale - The language being edited.
      • getSelectedLocalizations

        public UserPortalLocalizationsViewModelWithFiles getSelectedLocalizations()
        Gets the localized values of the portal for the currently selected language.
        Returns:
        The localized values for the currently selected language.
      • getSelectedProjectConfig

        public UserPortalProjectConfigViewModel getSelectedProjectConfig()
        Gets the configuration of the currently selected project (from the project tree), if any.
        Returns:
        The configuration of the currently selected project, or null if no project is selected.
      • getSelectedProjectKey

        public ProjectConfigKey getSelectedProjectKey()
        Gets the key of the currently selected project (from the project tree), if any.
        Returns:
        The key of the currently selected project, or null if no project is selected.
      • setSelectedProjectKey

        public void setSelectedProjectKey​(ProjectConfigKey selectedProjectKey)
        Sets the key of the currently selected project (from the project tree).
        Parameters:
        selectedProjectKey - The key of the currently selected project.
      • getSelectedProjectLocalizations

        public UserPortalLocalizationsViewModelWithFiles getSelectedProjectLocalizations()
        Gets the localized values of the currently selected project (from the project tree), if any, using the currently selected locale. Returns an empty model if no project is selected.
        Returns:
        The localized values of the currently selected project, with the currently selected locale.
      • getSelectedProjectLocalizationsByLocale

        public Map<Locale,​UserPortalLocalizationsViewModelWithFiles> getSelectedProjectLocalizationsByLocale()
        Gets the localized values of the currently selected project (from the project tree), if any, gropued by locale. Returns an empty map if no project is selected.
        Returns:
        The localized values of the currently selected project, grouped by locale.
      • getSelectedProjects

        public List<org.primefaces.model.TreeNode<de.xima.cmn.dao.interfaces.IEntity<Long>>> getSelectedProjects()
        Gets the selected projects from the project tree view.
        Returns:
        The selected projects.
      • setSelectedProjects

        public void setSelectedProjects​(List<org.primefaces.model.TreeNode<de.xima.cmn.dao.interfaces.IEntity<Long>>> selectedProjects)
        Sets the selected projects from the project tree view.
        Parameters:
        selectedProjects - The selected projects.
      • getSelectedProperties

        public PortalProperties getSelectedProperties()
        Gets the properties of the portal for the currently selected language, see also getProperties().
        Returns:
        The properties of the portal for the currently selected language.
      • getSelectedTag

        public UserPortalProjectTagViewModel getSelectedTag()
        Gets the tag that is currently selected, if any. The selected tag can be edited by the user.
        Returns:
        The selected tag, or null if no tag is selected.
      • getSelectedTagId

        public Serializable getSelectedTagId()
        Gets the ID of the selected tag, if any. The selected tag can be edited by the user.
        Returns:
        The ID of the selected tag, or null if no tag is selected.
      • setSelectedTagId

        public void setSelectedTagId​(Serializable selectedTagId)
        Sets the ID of the selected tag, if any. The selected tag can be edited by the user.
        Parameters:
        selectedTagId - The ID of the selected tag.
      • getSelectedTagLocalizations

        public UserPortalLocalizationsViewModel getSelectedTagLocalizations()
        Gets the localized values of the currently selected tag, if any, for the currently selected locale. Returns an empty model if no tag is selected.
        Returns:
        The localized values of the currently selected tag.
      • getSelectedTagLocalizationsByLocale

        public Map<Locale,​UserPortalLocalizationsViewModel> getSelectedTagLocalizationsByLocale()
        Gets the localized values of the currently selected tag, if any, grouped by locale. Returns an empty map if no tag is selected.
        Returns:
        The localized values of the currently selected tag.
      • getServerOptions

        public List<IServerModel> getServerOptions()
        Gets the servers (master or frontend servers) options that are available for getServers().
        Returns:
        The server options.
      • setServerOptions

        public void setServerOptions​(List<IServerModel> serverOptions)
        Sets the servers (master or frontend servers) options that are available for getServers().
        Parameters:
        serverOptions - The server options.
      • getServers

        public List<IServerModel> getServers()
        Gets the servers (master or frontend servers) on which the portal is available. Each portal may be available on different servers.
        Returns:
        The servers on which the portal is available.
      • setServers

        public void setServers​(List<IServerModel> servers)
        Sets the servers (master or frontend servers) on which the portal is available. Each portal may be available on different servers.
        Parameters:
        servers - The servers on which the portal is available.
      • getStandardLocales

        public List<Locale> getStandardLocales()
        A list of well-known locales that the user can choose from, e.g. when adding a new language to the portal.
        Returns:
        A list of well-known locales.
      • setStandardLocales

        public void setStandardLocales​(List<Locale> standardLocales)
        A list of well-known locales that the user can choose from, e.g. when adding a new language to the portal.
        Parameters:
        standardLocales - A list of well-known locales.
      • getTags

        public List<UserPortalProjectTagViewModel> getTags()
        Gets the tags defined for the portal that are available and can be set on individual projects. Note that the list of tags is the same for all locales, but the display name may be different.
        Returns:
        The tags defined for the portal.
      • setTags

        public void setTags​(List<UserPortalProjectTagViewModel> tags)
        Sets the tags defined for the portal that are available and can be set on individual projects. Note that the list of tags is the same for all locales, but the display name may be different.
        Parameters:
        tags - The tags defined for the portal.
      • isActive

        public boolean isActive()
        Gets whether the portal is active. An active portal is accessible to users, while an inactive portal cannot be used or accessed.
        Returns:
        Whether the portal is active.
      • setActive

        public void setActive​(boolean active)
        Sets whether the portal is active. An active portal is accessible to users, while an inactive portal cannot be used or accessed.
        Parameters:
        active - Whether the portal is active.
      • isPersisted

        public boolean isPersisted()
        Gets whether the portal is persisted in the database (or a new, unsaved portal).
        Returns:
        Whether the portal is persisted.
      • isShowAdvancedConfig

        public boolean isShowAdvancedConfig()
        Gets whether the advanced configuration tab is enabled and can be selected.
        Returns:
        Whether the advanced configuration tab is enabled.
      • isShowAnyTab

        public boolean isShowAnyTab()
        Gets whether any tab is enabled and can be selected.
        Returns:
        Whether any tab is enabled.
      • isShowBaseConfig

        public boolean isShowBaseConfig()
        Gets whether the base configuration tab is enabled and can be selected.
        Returns:
        Whether the base configuration tab is enabled.
      • isShowCustomizationConfig

        public boolean isShowCustomizationConfig()
        Gets whether the customization configuration tab is enabled and can be selected.
        Returns:
        Whether the customization configuration tab is enabled.
      • isShowFormsConfig

        public boolean isShowFormsConfig()
        Gets whether the forms configuration tab is enabled and can be selected.
        Returns:
        Whether the forms configuration tab is enabled.
      • isShowTab

        public boolean isShowTab​(EUserPortalViewTab tab)
        Gets whether the given tab is enabled and can be selected.
        Parameters:
        tab - The tab to check.
        Returns:
        Whether the given tab is enabled.