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: <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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the name of the configuration entity
    List<jakarta.faces.model.SelectItem>
    SelectItem getter Method provides a getter method to an ArrayList of objects for a specific param stored in the configuration entity.
    org.imixs.workflow.ItemCollection
     
    void
    This method load the config entity after postContstruct.
    void
    Refresh the configItemCollection.
    void
    save method updates the txtname property and save the config entity
    void
    Sets the name of the configuration entity

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      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<jakarta.faces.model.SelectItem> getSelectItems(String param) throws Exception
      SelectItem getter Method provides a getter method to an ArrayList of objects 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.AccessDeniedException
      save method updates the txtname property and save the config entity
      Throws:
      org.imixs.workflow.exceptions.AccessDeniedException