Class PromptConnectionBean
java.lang.Object
de.xima.fc.prompt.mgmt.gui.bean.PromptConnectionBean
- All Implemented Interfaces:
Serializable
Controller bean for the UI that lets the user manage prompt connections.
- Since:
- 8.5.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPromptConnectionBean(LocaleBean localeBean, PromptServicePluginLocator pluginLocator, IPromptTypeService typeService, IPromptManagementService managementService, SessionUserManager userManager, ViewContextBean viewContext) -
Method Summary
Modifier and TypeMethodDescriptionGets the bean instance needed by the custom GUI of the prompt service handler.Gets the icon for the currently selected prompt connection type.Gets the resource bundle containing the GUI messages for the currently selected prompt connection.Gets the configuration object with the properties of the currently selected prompt connection.Gets the URL to the XHTML file that defines the custom GUI for the currently selected prompt connection.getModel()Gets the model that contains the list of prompt connections.Gets a list of all available prompt connection types.getScope()Gets the scope of the prompt connections being edited, i.e. whether we are editing system connections, tenant connections, or project connections.If theselect item has an error, returns the error message.booleanisHasGui()Checks if a custom GUI is available for the currently selected prompt connection.booleanChecks whether a prompt connection is selected, but it could not be loaded correctly.Returns a numeric ID for the given connection UUID.voidCallback when the user clicks on the button to test the connection.voidCalled when clicks the plus button to add a new prompt connection and then selects one of available prompt connection types from the type selection menu.
-
Constructor Details
-
PromptConnectionBean
@Inject public PromptConnectionBean(LocaleBean localeBean, PromptServicePluginLocator pluginLocator, IPromptTypeService typeService, IPromptManagementService managementService, SessionUserManager userManager, ViewContextBean viewContext)
-
-
Method Details
-
getGuiBean
Gets the bean instance needed by the custom GUI of the prompt service handler. Returns null if the handler does not define a custom bean.- Returns:
- The GUI bean for the prompt connection, or null if not available.
-
getGuiIcon
Gets the icon for the currently selected prompt connection type. The icon is used in the UI to visually represent the type of prompt connection.- Returns:
- The GUI icon for the selected prompt connection type, or null if not available.
-
getGuiMessages
Gets the resource bundle containing the GUI messages for the currently selected prompt connection.- Returns:
- The resource bundle for the selected prompt connection, or null if not available.
-
getGuiModel
Gets the configuration object with the properties of the currently selected prompt connection.- Returns:
- The configuration object of the selected prompt connection, or null if unavailable.
-
getGuiXhtml
Gets the URL to the XHTML file that defines the custom GUI for the currently selected prompt connection.- Returns:
- The URL to the custom GUI XHTML, or null if no custom GUI is defined.
-
getModel
Gets the model that contains the list of prompt connections.- Returns:
- The model containing prompt connections, never null.
-
getPromptConnectionTypes
Gets a list of all available prompt connection types. This is used for the type selection menu when the user creates a new prompt connection.- Returns:
- A list of available prompt connection types, never null
-
getScope
Gets the scope of the prompt connections being edited, i.e. whether we are editing system connections, tenant connections, or project connections.- Returns:
- The prompt scope.
-
getSelectedError
If theselect item has an error, returns the error message. Otherwise, returns null.- Returns:
- The error if present, null otherwise.
-
isHasGui
public boolean isHasGui()Checks if a custom GUI is available for the currently selected prompt connection.- Returns:
- true if a custom GUI is available, false otherwise.
-
isHasSelectedError
public boolean isHasSelectedError()Checks whether a prompt connection is selected, but it could not be loaded correctly. This usually happens when the plugin that handles the prompt connection is unavailable or has issues.- Returns:
- true if there is a selected prompt connection with an error, false otherwise.
-
numericId
Returns a numeric ID for the given connection UUID. This is used for the row key attribute of PrimeFaces components. Even though the documentation says it can be any string, the data table component breaks in subtle ways if the row key is not numeric. For example, the selections / marked rows are not displayed and synchronized with the server correctly. (This happens with PrimeFaces 13.x, may have been fixed in later versions.)- Parameters:
uuid- The UUID of a connection for which to retrieve a numeric UUID.- Returns:
- A numeric string for the UUID.
-
onCheckConnection
public void onCheckConnection()Callback when the user clicks on the button to test the connection. Retrieves the handler of the currently selected prompt connection and invokes its test connection method. Shows a success message if the test succeeds, or an error message if it fails. -
onTypeSelected
Called when clicks the plus button to add a new prompt connection and then selects one of available prompt connection types from the type selection menu.- Parameters:
item- The item that was selected.
-