Package com.groiss.wf

Class DefaultApplicationAdapter

java.lang.Object
com.groiss.wf.DefaultApplicationAdapter
All Implemented Interfaces:
Lifecycle, Service, HasResource, ApplicationAdapter

public class DefaultApplicationAdapter extends Object implements ApplicationAdapter
Default implementation for ApplicationAdapter
  • Field Details

    • appl

      protected Application appl
    • userprops

      protected List<Element> userprops
    • localize

      protected boolean localize
    • applres

      protected Resource applres
    • running

      protected boolean running
  • Constructor Details

    • DefaultApplicationAdapter

      public DefaultApplicationAdapter()
  • Method Details

    • setApplication

      public void setApplication(Application appl)
      Specified by:
      setApplication in interface ApplicationAdapter
    • getNewProcessId

      public String getNewProcessId(ProcessInstance pi)
      Description copied from interface: ApplicationAdapter
      The method is called whenever a new process Id is needed
      Specified by:
      getNewProcessId in interface ApplicationAdapter
      Parameters:
      pi - the process instance for which the id should be generated
    • nextNum

      public int nextNum(String id)
    • getNotificationMail

      protected Page getNotificationMail(User user, ActivityInstance ai)
      Build the notification mail (default notification strategy for notifyUser(User, ActivityInstance))
      Parameters:
      user - the user who will be notified
      ai - the ActivityInstance which triggered the notification
      Returns:
    • notifyUser

      public void notifyUser(User u, ActivityInstance ai)
      Description copied from interface: ApplicationAdapter
      The method is called when an email-notification about a new worklist entry is sent.
      Specified by:
      notifyUser in interface ApplicationAdapter
      Parameters:
      u - the recipient
      ai - an activity instance
    • getUserProperties

      public List<Element> getUserProperties(User u)
      Description copied from interface: ApplicationAdapter
      Returns the user properties a user can set. It is normally read from the application configuration.
      Specified by:
      getUserProperties in interface ApplicationAdapter
      Parameters:
      u - The user whose properties should be returned
      Returns:
      a list of jdom elements describing the property.
    • localizeNames

      public boolean localizeNames()
      returns true if the application is the default application or the configuration has a resource file configured.
      Specified by:
      localizeNames in interface HasResource
    • getResource

      public Resource getResource()
      Specified by:
      getResource in interface HasResource
    • internalStartupComplete

      public final void internalStartupComplete()
      Signals that startup is finished. The method is called by the ApplicationLoader immediately after the call to startup() has completed.
    • internalStartup

      public final void internalStartup()
      Sets up the UserProperties and the resources for proper i18n. The method is called by the ApplicationLoader immediately before the call to startup().
    • isRunning

      public boolean isRunning()
      Description copied from interface: Service
      Ask the object if it has been started
      Specified by:
      isRunning in interface Service
      Returns:
      true if running.
    • getVersion

      public String getVersion()
      Description copied from interface: ApplicationAdapter
      Returns the version of the application code. The returning string is compared to the version in the database when the system starts up in restricted mode.
      Specified by:
      getVersion in interface ApplicationAdapter
      Returns:
      the version string
    • upgrade

      public String upgrade(Application app) throws Exception
      The default implementation of the upgrade method checks the upgrade information in the properties.xml file of the application. The methods of the upgrade steps are performed for each entry where "to" is greater than the current version of the application.
      Specified by:
      upgrade in interface ApplicationAdapter
      Parameters:
      app - the application object
      Throws:
      Exception
    • getDescFile

      public static URL getDescFile(Application appl) throws IOException
      Throws:
      IOException
    • getNotificationMail

      protected static HTMLPage getNotificationMail(User u, ActivityInstance ai, String template)
      Builds the default notification mail
      Parameters:
      u - the user who is going to receive this notification
      ai - the new ai which triggered the notification
      template - the message template path. if the template is null, contrib/NotificationMask.html will be used
      Returns: