Class UserPortalViewModel
java.lang.Object
de.xima.fc.gui.model.portal.UserPortalViewModel
- All Implemented Interfaces:
ILocalizationsViewModelProviding<LocalizationsViewModelWithFiles>, ILocalizationsViewModelProviding.ILocalizationsViewModelProvidingWithFiles, Serializable
public class UserPortalViewModel
extends Object
implements ILocalizationsViewModelProviding.ILocalizationsViewModelProvidingWithFiles, Serializable
View model for editing a single
UserPortal.- Since:
- 8.2.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ILocalizationsViewModelProviding
ILocalizationsViewModelProviding.ILocalizationsViewModelProvidingWithFiles -
Constructor Summary
ConstructorsConstructorDescriptionUserPortalViewModel(UUID portalUuid, boolean persisted) Creates a new view model for a given user portal. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new custom portal message row.Gets the tab that is currently active, i.e. selected and visible to the user.intThe index of the tab that is currently active, i.e. selected and visible to the user.getAlias()Gets the portal's alias.Gets the available locales for the portal.Gets the available tags that can be set on individual projects.Gets the client frontend servers that use the given frontend server.Gets the view model for the datatable of the custom portal messages.Gets the localized values of the currently selected authenticator config, if any, using the default locale.Gets the default language of the portal.getDefaultLocaleValue(PortalProperty property) Gets the custom portal messages for the default locale.Gets the localized values of the portal for the currently selected language.Gets the localized values of the currently selected project (from the project tree), if any, using the default locale.Gets the localized values of the currently selected tag, if any, for the default locale.Gets the portal's description.Gets the tabs that are enabled for the portal.Gets the localized texts and files for the portal.getLocalizations(Locale locale) Gets the localized texts and files for the portal in a specific language.getLocalizedFiles(Locale locale) Gets the localized files for the portal in a specific language.getLocalizedMessage(Locale locale, String i18nKey) Gets the localized message for the given key with the given locale.getLocalizedMessages(Locale locale) Gets the localized messages for the portal in a specific language.Gets the login configuration for the portal.getName()Gets the portal's name.Gets the name of a new tag to create.Gets the name of a new tag to create.Gets the UUID of the portal.Gets the project configurations for the portal.A map with all properties related to the portal, indexed by the locale.Gets the configuration of the currently selected authenticator config, if any.Gets the key of the currently selected authenticator config, if any.Gets the localized values of the currently selected authenticator config, if any, using the currently selected locale.Gets the localized values of the currently selected authenticator config, if any, grouped by locale.Gets the custom portal messages for the currently selected locale.Gets the language being edited.Gets the localized values of the portal for the currently selected language.Gets the configuration of the currently selected project (from the project tree), if any.Gets the key of the currently selected project (from the project tree), if any.Gets the localized values of the currently selected project (from the project tree), if any, using the currently selected locale.Gets the localized values of the currently selected project (from the project tree), if any, gropued by locale.Gets the properties of the portal for the currently selected language, see alsogetProperties().Gets the tag that is currently selected, if any.Gets the ID of the selected tag, if any.Gets the localized values of the currently selected tag, if any, for the currently selected locale.Gets the localized values of the currently selected tag, if any, grouped by locale.Gets the servers (master or frontend servers) options that are available.Gets the servers (master or frontend servers) on which the portal is available.A list of well-known locales that the user can choose from, e.g. when adding a new language to the portal.getTags()Gets the tags defined for the portal that are available and can be set on individual projects.Gets warnings for the portal if there are any.booleanisActive()Gets whether the portal is active.booleanbooleanGets whether the portal has warnings.booleanCheck if any client portal config has projects.booleanGets whether the portal is persisted in the database (or a new, unsaved portal).booleanGets whether the advanced configuration tab is enabled and can be selected.booleanbooleanGets whether any tab is enabled and can be selected.booleanGets whether the base configuration tab is enabled and can be selected.booleanGets whether the customization configuration tab is enabled and can be selected.booleanGets whether the forms configuration tab is enabled and can be selected.booleanGets whether the given tab is enabled and can be selected.voidvoidremoveCustomPortalMessageRow(int idx) Removes a custom portal message row.voidsetActive(boolean active) Sets whether the portal is active.voidGets the tab that is currently active, i.e. selected and visible to the user.voidsetActiveTabIndex(int activeTabIndex) The index of the tab that is currently active, i.e. selected and visible to the user.voidSets the portal's alias.voidsetAvailableLocales(List<Locale> availableLocales) Sets the available locales for the portal.voidsetClients(List<Mandant> clients) voidsetCustomProperties(List<UserPortalCustomPortalMessagesViewModel> customProperties) Sets the view model for the datatable of the custom portal messages.voidsetCustomPropertiesForLocale(Locale locale) Sets the localized values of the portal for the currently selected language.voidsetDefaultLocale(Locale defaultLocale) Sets the default language of the portal.voidsetDescription(String description) Sets the portal's description.voidsetDisablePublicForms(boolean disablePublicForms) voidsetEnabledTabs(Set<EUserPortalViewTab> enabledTabs) Sets the tabs that are enabled for the portal.voidsetLocalizations(Map<Locale, LocalizationsViewModelWithFiles> localizations) Sets the localized texts and files for the portal.voidSets the portal's name.voidsetNewCustomKey(String newCustomKey) voidsetNewLanguageName(String newLanguageName) Sets the name of a new tag to create.voidsetNewTagName(String newTagName) Sets the name of a new tag to create.voidsetProperties(Map<Locale, PortalProperties> properties) A map with all properties related to the portal, indexed by the locale.voidsetSelectedAuthenticatorConfigKey(Serializable authConfigKey) Sets the key of the currently selected authenticator config.voidsetSelectedLocale(Locale selectedLocale) Sets the language being edited.voidsetSelectedProjectByKey(ProjectConfigKey projectConfigKey) Sets the project configuration that is currently selected.voidsetSelectedProjectConfig(EndUserProjectConfigViewModel selectedProjectConfig) voidsetSelectedTagId(Serializable selectedTagId) Sets the ID of the selected tag, if any.voidsetServerOptions(List<SelectableServerOption> serverOptions) Sets the servers (master or frontend servers) options that are available.voidsetShowAllFormRecords(boolean showAllFormRecords) voidsetStandardLocales(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.voidsetTags(List<ProjectPortalTagViewModel> tags) Sets the tags defined for the portal that are available and can be set on individual projects.voidsetWarnings(ArrayList<String> warnings) Sets warnings for the portal.
-
Constructor Details
-
UserPortalViewModel
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 Details
-
addCustomPortalMessageRow
public void addCustomPortalMessageRow()Adds a new custom portal message row. -
getActiveTab
Gets the tab that is currently active, i.e. selected and visible to the user.- Returns:
- The currently active tab.
-
setActiveTab
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
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
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
-
setAvailableLocales
-
getAvailableTags
Gets the available tags that can be set on individual projects.- Returns:
- The available tags.
-
getClientFrontendServers
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.
-
getClientPortalConfigs
-
getClients
-
setClients
-
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.
-
setCustomProperties
Sets the view model for the datatable of the custom portal messages.- Parameters:
customProperties- The view model for the datatable of the custom portal messages.
-
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
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
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.
-
getDefaultLocaleValue
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.
-
getDefaultLocalizations
Gets the localized values of the portal for the currently selected language.- Returns:
- The localized values for the currently selected language.
-
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
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
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
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
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
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.
-
getLocalizations
Gets the localized texts and files for the portal. Each portal may have different texts and files for different languages.- Specified by:
getLocalizationsin interfaceILocalizationsViewModelProviding<LocalizationsViewModelWithFiles>- Returns:
- The localized texts and files for the portal.
-
setLocalizations
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.
-
getLocalizations
Gets the localized texts and files for the portal in a specific language.- Specified by:
getLocalizationsin interfaceILocalizationsViewModelProviding<LocalizationsViewModelWithFiles>- Parameters:
locale- The language to get the localized texts and files for.- Returns:
- The localized texts and files for the portal in the specified language.
-
getLocalizedFiles
Gets the localized files for the portal in a specific language.- Specified by:
getLocalizedFilesin interfaceILocalizationsViewModelProviding.ILocalizationsViewModelProvidingWithFiles- Parameters:
locale- The language to get the localized files for.- Returns:
- The localized files for the portal in the specified language.
-
getLocalizedMessage
Gets the localized message for the given key with the given locale.- Specified by:
getLocalizedMessagein interfaceILocalizationsViewModelProviding<LocalizationsViewModelWithFiles>- Returns:
- The portal's localized message for the given key.
-
getLocalizedMessages
Gets the localized messages for the portal in a specific language.- Specified by:
getLocalizedMessagesin interfaceILocalizationsViewModelProviding<LocalizationsViewModelWithFiles>- Parameters:
locale- The language to get the localized messages for.- Returns:
- The localized messages for the portal in the specified language.
-
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
Gets the portal's name. The name is a human-readable text that identifies the portal.- Returns:
- The portal's name.
-
setName
Sets the portal's name. The name is a human-readable text that identifies the portal.- Parameters:
name- The portal's name.
-
getNewCustomKey
-
setNewCustomKey
-
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
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
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
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
Gets the UUID of the portal. The UUID is a globally unique identifier for the portal.- Returns:
- The UUID of the portal.
-
getProjectConfigs
Gets the project configurations for the portal. Each portal may have a different configuration for eachform.- Returns:
- The project configurations for the portal.
-
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
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
Gets the configuration of the currently selected authenticator config, if any.- Returns:
- The configuration of the currently selected authenticator config, or
nullif no authenticator is selected.
-
getSelectedAuthenticatorConfigKey
Gets the key of the currently selected authenticator config, if any.- Returns:
- The key of the currently selected authenticator config, or
nullif no authenticator is selected.
-
setSelectedAuthenticatorConfigKey
Sets the key of the currently selected authenticator config.- Parameters:
authConfigKey- The key of the currently selected authenticator config, ornullif no authenticator is selected.
-
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
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.
-
getSelectedCustomPortalMessages
Gets the custom portal messages for the currently selected locale.- Returns:
- The custom portal messages for the currently selected locale.
-
getSelectedLocale
Gets the language being edited. Each portal may have different texts and files for different languages.- Returns:
- The language being edited.
-
setSelectedLocale
Sets the language being edited. Each portal may have different texts and files for different languages.- Parameters:
selectedLocale- The language being edited.
-
getSelectedLocalizations
Gets the localized values of the portal for the currently selected language.- Returns:
- The localized values for the currently selected language.
-
getSelectedProjectConfig
Gets the configuration of the currently selected project (from the project tree), if any.- Returns:
- The configuration of the currently selected project, or
nullif no project is selected.
-
setSelectedProjectConfig
-
getSelectedProjectKey
Gets the key of the currently selected project (from the project tree), if any.- Returns:
- The key of the currently selected project, or
nullif no project is selected.
-
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
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.
-
getSelectedProperties
Gets the properties of the portal for the currently selected language, see alsogetProperties().- Returns:
- The properties of the portal for the currently selected language.
-
getSelectedTag
Gets the tag that is currently selected, if any. The selected tag can be edited by the user.- Returns:
- The selected tag, or
nullif no tag is selected.
-
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
nullif no tag is selected.
-
setSelectedTagId
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
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
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
Gets the servers (master or frontend servers) options that are available.- Returns:
- The server options.
-
setServerOptions
Sets the servers (master or frontend servers) options that are available.- Parameters:
serverOptions- The server options.
-
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.
-
getStandardLocales
-
setStandardLocales
-
getTagModel
-
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
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.
-
getWarnings
-
setWarnings
-
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.
-
isDisablePublicForms
public boolean isDisablePublicForms() -
setDisablePublicForms
public void setDisablePublicForms(boolean disablePublicForms) -
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.
-
isNoProjectsFound
public boolean isNoProjectsFound()Check if any client portal config has projects.- Returns:
- true if no projects found, false otherwise
-
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.
-
isShowAllFormRecords
public boolean isShowAllFormRecords() -
setShowAllFormRecords
public void setShowAllFormRecords(boolean showAllFormRecords) -
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
Gets whether the given tab is enabled and can be selected.- Parameters:
tab- The tab to check.- Returns:
- Whether the given tab is enabled.
-
onTagsChangeEvent
-
removeCustomPortalMessageRow
public void removeCustomPortalMessageRow(int idx) Removes a custom portal message row.- Parameters:
idx- The index of the row to remove.
-
setCustomPropertiesForLocale
Sets the localized values of the portal for the currently selected language.- Parameters:
locale- The language to set the localized values for.
-
setSelectedProjectByKey
Sets the project configuration that is currently selected.- Parameters:
projectConfigKey- The key of the currently selected project.
-