Class UserPortalConfigBean

    • Constructor Detail

      • UserPortalConfigBean

        public UserPortalConfigBean()
    • Method Detail

      • init

        @PostConstruct
        public void init()
      • setSelectedUserPortalContent

        public void setSelectedUserPortalContent​(UserPortalContentViewModel selectedUserPortalContent)
      • isCanUserEditTenantResources

        public boolean isCanUserEditTenantResources()
      • isCanUserEditTenantTemplateUrls

        public boolean isCanUserEditTenantTemplateUrls()
      • 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.
      • getUserPortalUrls

        public List<org.apache.commons.lang3.tuple.Pair<String,​String>> getUserPortalUrls​(IServerModel server)
        Gets the URL to the user portal for the given server (with additional client information if the server is a client frontend server).
        Parameters:
        server - Server to get the URL for.
        Returns:
        URL to the user portal.
      • getConnectionStatus

        public EConnectionStatus getConnectionStatus​(IServerModel server)
        Gets the connection status of the given server.
        Parameters:
        server - Server to get the connection status for.
        Returns:
        Connection status of the server.
      • showConnectionStatus

        public boolean showConnectionStatus​(IServerModel server)
        Returns whether the connection status should be shown for the given server.
        Parameters:
        server - Server to check.
        Returns:
        true if the connection status should be shown, false otherwise.
      • isConnected

        public boolean isConnected​(IServerModel server)
        Returns whether the given server is connected.
        Parameters:
        server - Server to check.
        Returns:
        true if the server is connected, false otherwise.
      • 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.
      • 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.
      • 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()
      • 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.
      • onEditTagClicked

        public void onEditTagClicked​(UserPortalContentTagViewModel 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 (user portal content or user 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.
      • 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​(UserPortalContentTagViewModel 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.
      • resolveTagTextColor

        public String resolveTagTextColor​(UserPortalContentTagViewModel 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()
      • evaluateSelectedContentEditPermissions

        public void evaluateSelectedContentEditPermissions()
      • getFormDesignerUriOfSelectedFormContent

        public String getFormDesignerUriOfSelectedFormContent()
      • onPropertyKeyChange

        public void onPropertyKeyChange​(javax.faces.event.ValueChangeEvent event)
        Called when the user changes the key of a custom message. Updates the key in the model and in all properties of every locale.
        Parameters:
        event - Value change event with the old and new key.
      • getDefaultPortalFileTextContent

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

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

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

        public Map<String,​String> getUserPortalContentFileTextContent()
      • getLocaleBean

        public LocaleBean getLocaleBean()
      • isCanUserEditSelectedFormContent

        public boolean isCanUserEditSelectedFormContent()
      • getPermissionEvaluationCache

        public de.xima.fc.gui.bean.portal.UserPortalConfigBean.PermissionEvaluationCache getPermissionEvaluationCache()
      • setRequestedDefaultLocale

        public void setRequestedDefaultLocale​(Locale requestedDefaultLocale)
        Gets the requested default locale for the user portal configuration. The view should just use, 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.
      • setRequestedLocale

        public void setRequestedLocale​(Locale requestedLocale)
        Sets the requested locale for the user portal configuration. The view should just use, 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.