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
@ApplicationScoped public class ConfigController extends Object implements Serializable
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:The Bean provides easy access to the config params from a JSF Page. Example:myConfigController org.imixs.marty.config.ConfigController name REPORT_CONFIGURATION - Author:
- rsoika
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConfigController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Returns the name of the configuration entityList<javax.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.ItemCollectiongetWorkitem()voidinit()This method load the config entity after postContstruct.voidloadConfiguration()Refresh the configItemCollection.voidsave()save method updates the txtname property and save the config entityvoidsetName(String name)Sets the name of the configuration entity
-
-
-
Method Detail
-
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
public String getName()
Returns the name of the configuration entity- Returns:
-
setName
public void setName(String name)
Sets the name of the configuration entity- Parameters:
name-
-
getWorkitem
public org.imixs.workflow.ItemCollection getWorkitem()
-
getSelectItems
public List<javax.faces.model.SelectItem> getSelectItems(String param) throws Exception
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- 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
-
-