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

      • addCustomPortalMessageRow

        public void addCustomPortalMessageRow()
        Adds a new custom portal message row.
      • 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.
      • updateUserPortalContents

        public void updateUserPortalContents​(IEntityContext ec)
      • getAvailableTags

        public List<javax.faces.model.SelectItem> getAvailableTags()
        Gets the available tags that can be set on individual user portal contents.
        Returns:
        The available tags.
      • getDefaultAuthenticatorConfigLocalizations

        public LocalizationsViewModel getDefaultAuthenticatorConfigLocalizations()
        Gets the localized values of the currently selected authenticator config, if any, using the default locale. Returns an empty model if no user portal content is selected.
        Returns:
        The localized values of the currently selected authenticator config, with the currently selected locale.
      • getDefaultLocalizations

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

        public LocalizationsViewModelWithFiles getDefaultUserPortalContentLocalizations()
        Gets the localized values of the currently selected user portal content (from the user portal content tree), if any, using the default locale. Returns an empty model if no user portal content is selected.
        Returns:
        The localized values of the currently selected user portal content, with the default locale.
      • getDefaultTagLocalizations

        public LocalizationsViewModel 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.
      • getSelectedAuthenticatorConfig

        public AuthenticatorConfigViewModel 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 LocalizationsViewModel getSelectedAuthenticatorConfigLocalizations()
        Gets the localized values of the currently selected authenticator config, if any, using the currently selected locale. Returns an empty model if no user portal content is selected.
        Returns:
        The localized values of the currently selected authenticator config, with the currently selected locale.
      • getSelectedAuthenticatorConfigLocalizationsByLocale

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

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

        public UserPortalContentKey getSelectedUserPortalContentKey()
        Gets the key of the currently selected user portal content (from the user portal content tree), if any.
        Returns:
        The key of the currently selected user portal content, or null if no user portal content is selected.
      • getSelectedUserPortalContentLocalizations

        public LocalizationsViewModelWithFiles getSelectedUserPortalContentLocalizations()
        Gets the localized values of the currently selected user portal content (from the user portal content tree), if any, using the currently selected locale. Returns an empty model if no user portal content is selected.
        Returns:
        The localized values of the currently selected user portal content, with the currently selected locale.
      • getSelectedUserPortalContentLocalizationsByLocale

        public Map<Locale,​LocalizationsViewModelWithFiles> getSelectedUserPortalContentLocalizationsByLocale()
        Gets the localized values of the currently selected user portal content (from the user portal content tree), if any, gropued by locale. Returns an empty map if no user portal content is selected.
        Returns:
        The localized values of the currently selected user portal content, grouped by locale.
      • 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 UserPortalContentTagViewModel 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.
      • getSelectedTagLocalizations

        public LocalizationsViewModel 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,​LocalizationsViewModel> 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.
      • 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.
      • setWarnings

        public void setWarnings​(ArrayList<String> warnings)
        Sets warnings for the portal. Warnings are displayed to the user to inform them about potential issues.
        Parameters:
        warnings - The warnings for the portal.
      • isHasWarnings

        public boolean isHasWarnings()
        Gets whether the portal has warnings. If the portal has warnings, the user should be informed about potential issues.
        Returns:
        Whether the portal has warnings.
      • 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.
      • isShowUserPortalContents

        public boolean isShowUserPortalContents()
        Gets whether the user portal contents tab is enabled and can be selected.
        Returns:
        Whether the user portal contents tab is enabled.
      • setSelectedUserPortalContentByKey

        public void setSelectedUserPortalContentByKey​(UserPortalContentKey userPortalContentKey)
        Sets the user portal content configuration that is currently selected.
        Parameters:
        userPortalContentKey - The key of the currently selected user portal content.
      • getClientFrontendServers

        public List<MandantFrontendServer> getClientFrontendServers​(IEntityContext ec,
                                                                    FrontendServer fs)
        Gets the client frontend servers that use the given frontend server.
        Parameters:
        ec - The entity context.
        fs - The frontend server.
        Returns:
        The client frontend servers that use the given frontend server.
      • 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.
      • setCustomPropertiesForLocale

        public void setCustomPropertiesForLocale​(Locale locale)
        Sets the localized values of the portal for the currently selected language.
        Parameters:
        locale - The language to set the localized values for.
      • removeCustomPortalMessageRow

        public void removeCustomPortalMessageRow​(int idx)
        Removes a custom portal message row.
        Parameters:
        idx - The index of the row to remove.
      • getSelectedCustomPortalMessages

        public List<PortalProperty> getSelectedCustomPortalMessages()
        Gets the custom portal messages for the currently selected locale.
        Returns:
        The custom portal messages for the currently selected locale.
      • getDefaultLocaleValue

        public String getDefaultLocaleValue​(PortalProperty property)
        Gets the custom portal messages for the default locale.
        Parameters:
        property - The property to get the value for.
        Returns:
        The value of the property for the default locale.
      • getCustomProperties

        public List<UserPortalCustomPortalMessagesViewModel> getCustomProperties()
        Gets the view model for the datatable of the custom portal messages.
        Returns:
        The view model for the datatable of the custom portal messages.
      • getSelectedContentDisplayNamePlaceholder

        public String getSelectedContentDisplayNamePlaceholder()
        Placeholder for the display name input of the selected content, depending on the currently selected locale.

        For the default locale the entity's internal name is shown. For other locales the display name entered for the default locale is shown as a translation hint, falling back to the internal name.

        Returns:
        The display name placeholder, never null (the internal name is always set).
      • getSelectedContentShortDescriptionPlaceholder

        public String getSelectedContentShortDescriptionPlaceholder()
        Placeholder for the short description input of the selected content.
        Returns:
        The short description placeholder, or an empty string.
        See Also:
        resolveSelectedContentDescriptionPlaceholder(String)
      • getSelectedContentDescriptionPlaceholder

        public String getSelectedContentDescriptionPlaceholder()
        Placeholder for the description input of the selected content.
        Returns:
        The description placeholder, or an empty string.
        See Also:
        resolveSelectedContentDescriptionPlaceholder(String)
      • isPersisted

        public boolean isPersisted()
      • getPortalUuid

        public UUID getPortalUuid()
      • isActive

        public boolean isActive()
      • isShowAllFormRecords

        public boolean isShowAllFormRecords()
      • isDisablePublicForms

        public boolean isDisablePublicForms()
      • isUseUserPortalContentEntityDescriptionAsFallback

        public boolean isUseUserPortalContentEntityDescriptionAsFallback()
      • getActiveTabIndex

        public int getActiveTabIndex()
      • getAlias

        public String getAlias()
      • getAvailableLocales

        public List<Locale> getAvailableLocales()
      • getDefaultLocale

        public Locale getDefaultLocale()
      • getDescription

        public String getDescription()
      • getName

        public String getName()
      • getNewCustomKey

        public String getNewCustomKey()
      • getNewLanguageName

        public String getNewLanguageName()
      • getNewTagName

        public String getNewTagName()
      • getSelectedLocale

        public Locale getSelectedLocale()
      • getSelectedTagId

        public UUID getSelectedTagId()
      • getStandardLocales

        public List<Locale> getStandardLocales()
      • isCreateMode

        public boolean isCreateMode()
      • setActive

        public void setActive​(boolean active)
      • setShowAllFormRecords

        public void setShowAllFormRecords​(boolean showAllFormRecords)
      • setDisablePublicForms

        public void setDisablePublicForms​(boolean disablePublicForms)
      • setUseUserPortalContentEntityDescriptionAsFallback

        public void setUseUserPortalContentEntityDescriptionAsFallback​(boolean useUserPortalContentEntityDescriptionAsFallback)
      • setActiveTabIndex

        public void setActiveTabIndex​(int activeTabIndex)
      • setAlias

        public void setAlias​(String alias)
      • setAvailableLocales

        public void setAvailableLocales​(List<Locale> availableLocales)
      • setDefaultLocale

        public void setDefaultLocale​(Locale defaultLocale)
      • setDescription

        public void setDescription​(String description)
      • setName

        public void setName​(String name)
      • setNewCustomKey

        public void setNewCustomKey​(String newCustomKey)
      • setNewLanguageName

        public void setNewLanguageName​(String newLanguageName)
      • setNewTagName

        public void setNewTagName​(String newTagName)
      • setSelectedAuthenticatorConfig

        public void setSelectedAuthenticatorConfig​(Serializable selectedAuthenticatorConfig)
      • setSelectedLocale

        public void setSelectedLocale​(Locale selectedLocale)
      • setSelectedUserPortalContent

        public void setSelectedUserPortalContent​(UserPortalContentViewModel selectedUserPortalContent)
      • setSelectedTagId

        public void setSelectedTagId​(UUID selectedTagId)
      • setStandardLocales

        public void setStandardLocales​(List<Locale> standardLocales)
      • setSelectedCustomPortalMessages

        public void setSelectedCustomPortalMessages​(List<PortalProperty> selectedCustomPortalMessages)
      • setCreateMode

        public void setCreateMode​(boolean isCreateMode)