Class UserPortalContentBean

    • Constructor Detail

      • UserPortalContentBean

        public UserPortalContentBean()
    • Method Detail

      • hasUserClientAccessForTenantResourceView

        public boolean hasUserClientAccessForTenantResourceView()
      • hasUserClientAccessForTenantTemplateUrlView

        public boolean hasUserClientAccessForTenantTemplateUrlView()
      • startAddUserPortalContentWithType

        public void startAddUserPortalContentWithType​(EUserPortalContentConfigType contentType)
        Starts the add-content flow for the given content type.

        This initializes a temporary content model, resolves the tenant context for the new entry, reloads the tenant-dependent selection data, and optionally triggers the create-entity dialog for content types that support creating linked entities directly from the selection flow.

        Parameters:
        contentType - content type to create
      • onChangeTenantTemplateEntity

        public void onChangeTenantTemplateEntity()
      • onChangeTenantResourceEntity

        public void onChangeTenantResourceEntity()
      • onChangeFormEntity

        public void onChangeFormEntity()
      • handleContentEntityFileUpload

        public void handleContentEntityFileUpload​(org.primefaces.event.FileUploadEvent event)
      • removeSelectedContentEntityFile

        public void removeSelectedContentEntityFile​(javax.faces.event.ActionEvent event)
      • setSelectedUserPortalContent

        public void setSelectedUserPortalContent​(UserPortalContentViewModel selectedUserPortalContent)
      • discardTemporaryUserPortalContent

        public void discardTemporaryUserPortalContent()
      • isLinkedEntitySelectionVisible

        public boolean isLinkedEntitySelectionVisible()
      • hasUnexistingTenantResources

        public boolean hasUnexistingTenantResources()
      • hasUnexistingTenantUrls

        public boolean hasUnexistingTenantUrls()
      • hasUnexistingForms

        public boolean hasUnexistingForms()
      • getAvailableFormSelectItems

        public List<javax.faces.model.SelectItem> getAvailableFormSelectItems()
      • getAvailableClientResourceSelectItems

        public List<javax.faces.model.SelectItem> getAvailableClientResourceSelectItems()
      • getAvailableClientUrlSelectItems

        public List<javax.faces.model.SelectItem> getAvailableClientUrlSelectItems()
      • getAvailableClientSelectItems

        public List<javax.faces.model.SelectItem> getAvailableClientSelectItems()
      • getSelectedResourceEntityMetaLabel

        public String getSelectedResourceEntityMetaLabel()
      • getSelectedTemplateEntityMetaLabel

        public String getSelectedTemplateEntityMetaLabel()
      • onChangeTenantSelection

        public void onChangeTenantSelection()
      • refreshAvailableContentSelection

        public void refreshAvailableContentSelection()
      • showNoAvailableContentWarning

        public boolean showNoAvailableContentWarning()
        Returns whether the warning for missing available content should be shown.

        The warning is only visible when the linked entity selection is shown, no create-new selection is active, the current tenant has neither unassigned nor available content for the selected type, and the portal is not in create mode.

        Returns:
        true if the "no available content" warning should be rendered, false otherwise.
      • hasNoPermissionToCreateContent

        public boolean hasNoPermissionToCreateContent()
        Returns whether a warning for missing create permissions should be shown.

        The warning is shown when the entity selection is visible, no unused linked entity is available for the selected type and tenant, and the current user is not allowed to create a new entity of that type.

        Returns:
        true if the missing-permission warning should be rendered, false otherwise.
      • showSelectedContentEntityDialogButton

        public boolean showSelectedContentEntityDialogButton​(EUserPortalContentConfigType contentType)
      • prepareContentEntityDialog

        public void prepareContentEntityDialog​(EUserPortalContentConfigType contentType)
        Stores a snapshot of the current entity-related fields before a dialog is opened.

        The snapshot is used to restore the previous values when the user cancels the dialog without applying the changes.

        Parameters:
        contentType - content type of the dialog to prepare
      • cancelContentEntityDialog

        public void cancelContentEntityDialog()
        Cancels the currently open content-entity dialog.

        Depending on the current mode, this either restores the previous selected content before the temporary selection change or re-applies the last dialog snapshot to the currently selected content.

      • applyContentEntityDialog

        public void applyContentEntityDialog()
        Applies the changes from the currently open content-entity dialog.

        This validates the dialog state, normalizes entity names where required, and stores a temporary display-name override so that the selection label stays consistent until the entity is persisted.

      • getNoCreatePermissionWarningMessage

        public String getNoCreatePermissionWarningMessage()
        Returns the warning text that explains why no new linked entity can be created for the selected content type.
        Returns:
        Localized warning text for the selected content type, or an empty string if no content type is selected.
      • getNoCreatePermissionWarningMessage

        public String getNoCreatePermissionWarningMessage​(EUserPortalContentConfigType contentType)
        Returns the warning text that explains why no new linked entity can be created for the given content type.
        Parameters:
        contentType - The content type for which the warning text should be returned.
        Returns:
        Localized warning text for the given content type, or an empty string if no content type is selected.
      • addContentTypeMenuItemDisabled

        public boolean addContentTypeMenuItemDisabled​(EUserPortalContentConfigType contentType)
        Returns whether the add-menu entry for the given content type should be disabled.

        This evaluation is only done in a client portal because only there the tenant is fixed and permissions plus remaining unlinked entities can be evaluated reliably.

        Parameters:
        contentType - The content type to evaluate.
        Returns:
        true if no additional content of the given type can be created in the current client portal, false otherwise.
      • getSelectedFormEntityUuid

        public UUID getSelectedFormEntityUuid()
      • setSelectedFormEntityUuid

        public void setSelectedFormEntityUuid​(UUID selectedFormEntityUuid)
      • getSelectedTenantResourceEntityUuid

        public UUID getSelectedTenantResourceEntityUuid()
      • setSelectedTenantResourceEntityUuid

        public void setSelectedTenantResourceEntityUuid​(UUID selectedTenantResourceEntityUuid)
      • getSelectedTenantTemplateEntityUuid

        public UUID getSelectedTenantTemplateEntityUuid()
      • setSelectedTenantTemplateEntityUuid

        public void setSelectedTenantTemplateEntityUuid​(UUID selectedTenantTemplateEntityUuid)
      • isSelectedContentSaveBlocked

        public boolean isSelectedContentSaveBlocked()
        Returns whether saving the currently selected temporary portal content must be blocked.

        This is the case when the bean is in create mode, the selected content has not been persisted yet, no linked entity is currently selected, and either the user lacks permission to create a new entity or no selectable content is available.

        Returns:
        true if saving must be blocked, false otherwise.
      • getSelectedContentSaveBlockedMessage

        public String getSelectedContentSaveBlockedMessage()
        Returns the localized message that explains why saving the current temporary content is blocked.

        Depending on the current state, this returns either the missing-permission warning or the warning that no selectable content is available.

        Returns:
        localized blocking message, or an empty string if saving is not blocked.
      • isContentSelectionDisabled

        public boolean isContentSelectionDisabled​(EUserPortalContentConfigType contentType)
        Returns whether the selection component for the given content type should be disabled.

        The selection is disabled when there is currently no enabled existing entity that can be selected for the given content type.

        Parameters:
        contentType - the content type whose selection component should be evaluated.
        Returns:
        true if the selection should be disabled, false otherwise.
      • isSelectedContentConfigurationVisible

        public boolean isSelectedContentConfigurationVisible()
        Returns whether the lower configuration area for the selected content should be shown.

        The configuration area is only visible when a content is selected, no missing-permission warning is active, and either an existing entity can be selected or the create-new flow is currently active.

        Returns:
        true if the configuration area should be rendered, false otherwise.
      • getLocaleBean

        public LocaleBean getLocaleBean()
      • getAvailableClientsForNewPortalContent

        public Map<UUID,​String> getAvailableClientsForNewPortalContent()
      • getLoadedTenantUuid

        public UUID getLoadedTenantUuid()
      • getLoadedTenant

        public Mandant getLoadedTenant()
      • isHasLoadedTenantAvailableContent

        public boolean isHasLoadedTenantAvailableContent()
      • isHasLoadedTenantUnexistingContent

        public boolean isHasLoadedTenantUnexistingContent()
      • isHasTenantResourceViewAccess

        public boolean isHasTenantResourceViewAccess()
      • isHasTenantTemplateUrlViewAccess

        public boolean isHasTenantTemplateUrlViewAccess()
      • getContentEntityDialogSnapshot

        public UserPortalContentDialogHelper.ContentEntityDialogSnapshot getContentEntityDialogSnapshot()
        This field is used to temporarily store the state of the selected content's entity-related properties when opening the edit dialog for an existing content entity or preparing the create-new-content dialog, in order to be able to restore this state when canceling the dialog.
      • getSelectedContentTenantResourceFileToRemove

        public UserPortalFileViewModel getSelectedContentTenantResourceFileToRemove()
      • setViewContextBean

        public void setViewContextBean​(ViewContextBean viewContextBean)
      • setResourceBundleBean

        public void setResourceBundleBean​(ResourceBundleBean resourceBundleBean)
      • setLocaleBean

        public void setLocaleBean​(LocaleBean localeBean)
      • setUserPortalConfigBean

        public void setUserPortalConfigBean​(UserPortalConfigBean userPortalConfigBean)
      • setAvailableClientsForNewPortalContent

        public void setAvailableClientsForNewPortalContent​(Map<UUID,​String> availableClientsForNewPortalContent)
      • setLoadedTenantUuid

        public void setLoadedTenantUuid​(UUID loadedTenantUuid)
      • setLoadedTenant

        public void setLoadedTenant​(Mandant loadedTenant)
      • setHasLoadedTenantAvailableContent

        public void setHasLoadedTenantAvailableContent​(boolean hasLoadedTenantAvailableContent)
      • setHasLoadedTenantUnexistingContent

        public void setHasLoadedTenantUnexistingContent​(boolean hasLoadedTenantUnexistingContent)
      • setHasTenantResourceViewAccess

        public void setHasTenantResourceViewAccess​(boolean hasTenantResourceViewAccess)
      • setHasTenantTemplateUrlViewAccess

        public void setHasTenantTemplateUrlViewAccess​(boolean hasTenantTemplateUrlViewAccess)
      • setSelectedContentBeforeSelectionChange

        public void setSelectedContentBeforeSelectionChange​(UserPortalContentViewModel selectedContentBeforeSelectionChange)
      • setContentEntityDialogSnapshot

        public void setContentEntityDialogSnapshot​(UserPortalContentDialogHelper.ContentEntityDialogSnapshot contentEntityDialogSnapshot)
        This field is used to temporarily store the state of the selected content's entity-related properties when opening the edit dialog for an existing content entity or preparing the create-new-content dialog, in order to be able to restore this state when canceling the dialog.
      • setSelectedContentTenantResourceFileToRemove

        public void setSelectedContentTenantResourceFileToRemove​(UserPortalFileViewModel selectedContentTenantResourceFileToRemove)