Package org.imixs.workflow.office.config
Class ConfigController
java.lang.Object
org.imixs.workflow.office.config.ConfigController
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SetupController
This ConfigController acts as a frontend controller for a Config Entity. The
entity (itemCollection) holds config params. The entity is stored with the
type "configuration" and a configurable name (txtname). The property
'txtname' is used to select the config entity by a query.
The bean interacts with the marty ConfigService EJB which is responsible for
creation, loading and saving the entity. This singleton ejb can manage
multiple config entities. The ConfigController bean is also
ApplicationScoped, so it can be shared in one application. From the backend
it is possible to use the ConfigControler or also directly the ConfigService
EJB.
The Bean can be overwritten to add additional busines logic (e.g. converting
params or providing additional custom getter methods).
Use multiple instances in one application, bean can be decleared in the
faces-config.xml file. The managed-ban-name as the manged property 'name' can
be set to custom values:
<managed-bean>
<managed-bean-name>myConfigController</managed-bean-name>
<managed-bean-class>org.imixs.marty.config.ConfigController</managed-bean-class>
<managed-property>
<property-name>name</property-name>
REPORT_CONFIGURATION
</managed-property>
</managed-bean>
The Bean provides easy access to the config params from a JSF Page. Example:
<h:inputText value="#{configController.workitem.item['myParam1']}" >
</h:inputText>
- Author:
- rsoika
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()Returns the name of the configuration entityList<jakarta.faces.model.SelectItem>getSelectItems(String param) SelectItem getter Method provides a getter method to an ArrayList ofobjects for a specific param stored in the configuration entity. org.imixs.workflow.ItemCollectionvoidinit()This method load the config entity after postContstruct.voidRefresh the configItemCollection.voidsave()save method updates the txtname property and save the config entityvoidSets the name of the configuration entity
-
Constructor Details
-
ConfigController
public ConfigController()
-
-
Method Details
-
init
@PostConstruct public void init()This method load the config entity after postContstruct. If no Entity exists than the ConfigService EJB creates a new config entity. -
loadConfiguration
public void loadConfiguration()Refresh the configItemCollection. The method can be called by a client to get an updated version of the config entity. The method discards the internal cache! -
getName
Returns the name of the configuration entity- Returns:
-
setName
Sets the name of the configuration entity- Parameters:
name-
-
getWorkitem
public org.imixs.workflow.ItemCollection getWorkitem() -
getSelectItems
SelectItem getter Method provides a getter method to an ArrayList ofobjects for a specific param stored in the configuration entity. A param entry can be devided by a | into a label and a value component. Example: Important | 1 Unimportant | 0<f:selectItems value="#{configMB.selectItems['txtMyParam2']}" />- Returns:
- Throws:
Exception
-
save
public void save() throws org.imixs.workflow.exceptions.AccessDeniedExceptionsave method updates the txtname property and save the config entity- Throws:
org.imixs.workflow.exceptions.AccessDeniedException
-