Class UserPortalConfigBean

    • Constructor Detail

      • UserPortalConfigBean

        public UserPortalConfigBean()
    • Method Detail

      • getCustomPortalFileKeys

        public List<String> getCustomPortalFileKeys()
        A list of custom file keys that can be configured on the advanced tab of a user portal.
        Returns:
        List of custom file keys.
      • getCustomPortalMessageKeys

        public List<String> getCustomPortalMessageKeys()
        A list of custom message keys that can be configured on the advanced tab of a user portal.
        Returns:
        List of custom message keys.
      • getDefaultPortalFileTextContent

        public Map<String,​String> getDefaultPortalFileTextContent()
      • getDefaultProjectFileTextContent

        public Map<String,​String> getDefaultProjectFileTextContent()
      • getModel

        public UserPortalViewModel getModel()
        Gets the view model for editing the selected user portal.
        Returns:
        View model for the selected user portal.
      • getPortalFileTextContent

        public Map<String,​String> getPortalFileTextContent()
      • getProjectFileTextContent

        public Map<String,​String> getProjectFileTextContent()
      • getRequestedDefaultLocale

        public Locale getRequestedDefaultLocale()
        Gets the requested default locale for the user portal configuration. The view should just use UserPortalViewModel.getDefaultLocale() ()}, but then we run into issues when the user changes the locale. The data for the current locale needs to be applied first, then the locale needs to be changed. Otherwise, the data is applied to the wrong locale.
        Returns:
        Requested default locale for the user portal configuration.
      • setRequestedDefaultLocale

        public void setRequestedDefaultLocale​(Locale requestedDefaultLocale)
        Gets the requested default locale for the user portal configuration. The view should just use UserPortalViewModel.getDefaultLocale() ()}, but then we run into issues when the user changes the locale. The data for the current locale needs to be applied first, then the locale needs to be changed. Otherwise, the data is applied to the wrong locale.
        Parameters:
        requestedDefaultLocale - Requested default locale for the user portal configuration.
      • getRequestedLocale

        public Locale getRequestedLocale()
        Gets the requested locale for the user portal configuration. The view should just use UserPortalViewModel.getSelectedLocale(), but then we run into issues when the user changes the locale. The data for the current locale needs to be applied first, then the locale needs to be changed. Otherwise, the data is applied to the wrong locale.
        Returns:
        Requested locale for the user portal configuration.
      • setRequestedLocale

        public void setRequestedLocale​(Locale requestedLocale)
        Sets the requested locale for the user portal configuration. The view should just use UserPortalViewModel.getSelectedLocale(), but then we run into issues when the user changes the locale. The data for the current locale needs to be applied first, then the locale needs to be changed. Otherwise, the data is applied to the wrong locale.
        Parameters:
        requestedLocale - Requested locale for the user portal configuration.
      • setFirstPortalFromList

        public void setFirstPortalFromList​(List<UserPortal> portals)
        Selects the first portal from the given list of portals.
        Parameters:
        portals - List of portals to select from.
      • completeLanguageTag

        public List<String> completeLanguageTag​(String query)
        When the user triggers an autocomplete for a language tag input. Searches the well-known locales for a match, either by language tag or by display name.
        Parameters:
        query - The query to complete.
        Returns:
        List of language tags that match the query.
      • newUserPortal

        public void newUserPortal()
        Creates a new user portal and prepares it for editing.
      • onAddCustomPortalFileKeyClicked

        public void onAddCustomPortalFileKeyClicked()
      • onAddCustomPortalMessageKeyClicked

        public void onAddCustomPortalMessageKeyClicked()
      • onAddNewTagClicked

        public void onAddNewTagClicked()
        When the user clicks the "Add" button to create a new tag, this method will be called. It will create a new tag with the given name and add it to the list of tags.
      • onAfterPortalDeleted

        public void onAfterPortalDeleted()
        Called when a portal deleted. Checks if the currently edited portal still exists. If not, finds a new portal to edit and loads its configuration.
      • onDefaultLocaleChanged

        public void onDefaultLocaleChanged()
        When the default locale of the portal was changed, usually when the user selected a different locale in the backend UI.
      • onDeleteTagClicked

        public void onDeleteTagClicked​(UserPortalProjectTagViewModel tag)
        Called when the user clicks the "Delete" button for a tag. Removes the tag from the list of tags.
        Parameters:
        tag - Tag to delete.
      • onEditAuthClicked

        public void onEditAuthClicked​(UserPortalAuthenticatorViewModel config)
        Called when the user clicks the "Edit" button for a login server configuration. Prepares the model so that it can be edited.
        Parameters:
        config - Login service configuration to edit.
      • onEditTagClicked

        public void onEditTagClicked​(UserPortalProjectTagViewModel tag)
        Called when the user clicks the "Edit" button for a tag. Prepares the model so that the tag can be edited.
        Parameters:
        tag - Tag to edit.
      • onFileDeleted

        public void onFileDeleted​(String type,
                                  String fileKey)
        Called when the user click on the button to delete an existing file.
        Parameters:
        type - The type of the file (project or portal)
        fileKey - The key of the file to delete.
      • onFileUploaded

        public void onFileUploaded​(org.primefaces.event.FileUploadEvent event)
        Called when the user uploads a file in the backend UI.
        Parameters:
        event - File upload event with the file.
      • onLocaleAdded

        public void onLocaleAdded()
        When the user added a new locale, such as by clicking on the add button in the language selector. Adds the locale to the list of available locales, selects the new locale, and updates the model so that the new locale can be edited.
      • onLocaleChanged

        public void onLocaleChanged​(String languageTag)
        Called when the user changes the locale in the UI. This will prepare the view model so that the data for that locale can be edited.
      • onLocaleDeleted

        public void onLocaleDeleted​(String languageTag)
        When the user deleted an available locale, such as by clicking on the delete button in the language selector. Removes the locale from the list of available locales, and, if the deleted locale was the currently selected locale, changes the locale to the default locale and updates the model.
        Parameters:
        languageTag - The language tag of the deleted locale.
      • onProjectSelected

        public void onProjectSelected()
        Called when the user selects a project from the project list. This will prepare the project for editing.
      • onRemoveCustomPortalFileKeyClicked

        public void onRemoveCustomPortalFileKeyClicked​(String key)
      • onRemoveCustomPortalMessageKeyClicked

        public void onRemoveCustomPortalMessageKeyClicked​(String key)
      • onReorderInputAuthenticators

        public void onReorderInputAuthenticators​(org.primefaces.event.ReorderEvent event)
        When the user reordered input login services via the UI. Updates the model with the new order.
        Parameters:
        event - Reorder event with the new order.
      • onReorderRedirectAuthenticators

        public void onReorderRedirectAuthenticators​(org.primefaces.event.ReorderEvent event)
        When the user reordered redirect login services via the UI. Updates the model with the new order.
        Parameters:
        event - Reorder event with the new order.
      • resolveTagBackgroundColor

        public String resolveTagBackgroundColor​(UserPortalProjectTagViewModel tag)
        Resolves the color for the background of a given tag, used to display the tag on the UI. Uses the configured color first, falling back to the default color.
        Parameters:
        tag - Tag to resolve the background color for.
        Returns:
        Background color for the tag.
      • resolveTagDisplayName

        public String resolveTagDisplayName​(UserPortalProjectTagViewModel tag)
        Resolves the display name for the given tag, used to display the tag on the UI. Uses the current language first, falling back to the default language. When no display name is found, the tag's ID is used.
        Parameters:
        tag - Tag to resolve the display name for.
        Returns:
        Display name for the tag.
      • resolveTagTextColor

        public String resolveTagTextColor​(UserPortalProjectTagViewModel tag)
        Resolves the text color for the background of a given tag, used to display the tag on the UI. Uses the configured color, falling back to the default color.
        Parameters:
        tag - Tag to resolve the background color for.
        Returns:
        Background color for the tag.
      • reconnectFrontendServers

        public void reconnectFrontendServers()