com.groiss.wf
Class DefaultApplicationAdapter

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

public class DefaultApplicationAdapter
extends java.lang.Object
implements ApplicationAdapter, Service

Default implementation for ApplicationAdapter


Field Summary
protected  Application appl
           
protected  Resource applres
           
static java.lang.String idPrefix
           
protected  boolean localize
           
protected  boolean running
           
protected  java.util.List<org.jdom.Element> userprops
           
 
Constructor Summary
DefaultApplicationAdapter()
           
 
Method Summary
static java.net.URL getDescFile(Application appl)
           
 Right getFinishRight(ActivityInstance ai)
          Returns the right which is needed for sending the process to next agent The system checks if the sending user has this right for the agent and org.-unit of the given ai.
 java.util.List<Right> getFinishRights()
          Return the list of finish rights used in this application.
 java.lang.String getNewProcessId(ProcessInstance pi)
          The method is called whenever a new process Id is needed
 com.groiss.wf.distri.Packer getPacker()
          Return the Packer used for distributing activities of this application.
 Resource getResource()
           
 java.util.List<org.jdom.Element> getUserProperties(User u)
          Returns the user properties a user can set.
 java.lang.String getVersion()
          Returns the version of the application code.
 boolean isRunning()
          Ask the object if it has been started
 boolean localizeNames()
          returns true if the application is the default application or the configuration has a resource file configured.
 void modifyDetailLinks(KeyedList<java.lang.String,Link> links, java.lang.StringBuilder title, ProcessInstance pi, ActivityInstance ai)
          You can modify the title and links in the detail view of the process.
 int nextNum(java.lang.String id)
           
 void notifyUser(User u, ActivityInstance ai)
          The method is called when an email-notification about a new worklist entry is sent.
 void onAbort(ProcessInstance pi)
          A process is aborted
 void onAddDocument(ProcessInstance pi, DMSFolder f, DMSObject o)
          Called when a document is added to a process of this application.
 void onChangeAgent(ActivityInstance oldAi, ActivityInstance newAi)
          An ActivityInstance is taken out of the suspension list.
 void onReactivate(ProcessInstance pi)
          A process is reactivated
 void onRemoveDocument(ProcessInstance pi, DMSFolder f, DMSObject o)
          Called when a document is removed from a process of this application.
 void onSeeAgain(ActivityInstance ai)
          An ActivityInstance is taken out of the suspension list.
 void onSeeLater(ActivityInstance ai)
          An ActivityInstance is put into the suspension list.
 void reconfigure()
          This method is called when the application properties are changed and calls the startup function
 void setApplication(Application appl)
           
 void shutdown()
          This method is called on shutdown.
 void startup()
          Called on @enterprise startup.
 java.lang.String upgrade(Application appl)
          The method is called when the application server detects that the version of the application in the database is different from the version of the code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

appl

protected Application appl

userprops

protected java.util.List<org.jdom.Element> userprops

localize

protected boolean localize

applres

protected Resource applres

running

protected boolean running

idPrefix

public static final java.lang.String idPrefix
See Also:
Constant Field Values
Constructor Detail

DefaultApplicationAdapter

public DefaultApplicationAdapter()
Method Detail

setApplication

public void setApplication(Application appl)
Specified by:
setApplication in interface HasResource

getNewProcessId

public java.lang.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(java.lang.String id)

onSeeLater

public void onSeeLater(ActivityInstance ai)
Description copied from interface: ApplicationAdapter
An ActivityInstance is put into the suspension list.

Specified by:
onSeeLater in interface ApplicationAdapter
Parameters:
ai - an activity instance

onSeeAgain

public void onSeeAgain(ActivityInstance ai)
Description copied from interface: ApplicationAdapter
An ActivityInstance is taken out of the suspension list.

Specified by:
onSeeAgain in interface ApplicationAdapter
Parameters:
ai - an activity instance

onChangeAgent

public void onChangeAgent(ActivityInstance oldAi,
                          ActivityInstance newAi)
Description copied from interface: ApplicationAdapter
An ActivityInstance is taken out of the suspension list.

Specified by:
onChangeAgent in interface ApplicationAdapter
Parameters:
oldAi - the old activity instance
newAi - the new activity instance

onAbort

public void onAbort(ProcessInstance pi)
Description copied from interface: ApplicationAdapter
A process is aborted

Specified by:
onAbort in interface ApplicationAdapter
Parameters:
pi - the process instance

onReactivate

public void onReactivate(ProcessInstance pi)
Description copied from interface: ApplicationAdapter
A process is reactivated

Specified by:
onReactivate in interface ApplicationAdapter
Parameters:
pi - the process instance

onAddDocument

public void onAddDocument(ProcessInstance pi,
                          DMSFolder f,
                          DMSObject o)
Description copied from interface: ApplicationAdapter
Called when a document is added to a process of this application.

Specified by:
onAddDocument in interface ApplicationAdapter
Parameters:
pi - the process instance
f - the folder where the object will be added
o - the object to add

onRemoveDocument

public void onRemoveDocument(ProcessInstance pi,
                             DMSFolder f,
                             DMSObject o)
Description copied from interface: ApplicationAdapter
Called when a document is removed from a process of this application.

Specified by:
onRemoveDocument in interface ApplicationAdapter
Parameters:
pi - the process instance
f - the folder
o - the object to add

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 java.util.List<org.jdom.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

getFinishRight

public Right getFinishRight(ActivityInstance ai)
Description copied from interface: ApplicationAdapter
Returns the right which is needed for sending the process to next agent The system checks if the sending user has this right for the agent and org.-unit of the given ai.

Specified by:
getFinishRight in interface ApplicationAdapter
Parameters:
ai - the new ActivityInstance

getFinishRights

public java.util.List<Right> getFinishRights()
Description copied from interface: ApplicationAdapter
Return the list of finish rights used in this application.

Specified by:
getFinishRights in interface ApplicationAdapter
Returns:
a List of rights

getPacker

public com.groiss.wf.distri.Packer getPacker()
Description copied from interface: ApplicationAdapter
Return the Packer used for distributing activities of this application.

Specified by:
getPacker in interface ApplicationAdapter
Returns:
a Packer object

modifyDetailLinks

public void modifyDetailLinks(KeyedList<java.lang.String,Link> links,
                              java.lang.StringBuilder title,
                              ProcessInstance pi,
                              ActivityInstance ai)
Description copied from interface: ApplicationAdapter
You can modify the title and links in the detail view of the process.

Specified by:
modifyDetailLinks in interface ApplicationAdapter
Parameters:
links - a keyed list of Link objects, keys are form{i}, documents, notes, history, process
pi - the process instance
ai - the activity instance, may be null (for example when called from search)

startup

public void startup()
Called on @enterprise startup. Read the properties in the application directory for the application configuration, the application specific user properties and the resource bundle user for translating the application resources.

Specified by:
startup in interface Lifecycle

shutdown

public void shutdown()
Description copied from interface: Lifecycle
This method is called on shutdown.

Specified by:
shutdown in interface Lifecycle

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.

reconfigure

public void reconfigure()
This method is called when the application properties are changed and calls the startup function

Specified by:
reconfigure in interface Service

getVersion

public java.lang.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 java.lang.String upgrade(Application appl)
                         throws java.lang.Exception
Description copied from interface: ApplicationAdapter
The method is called when the application server detects that the version of the application in the database is different from the version of the code.

Specified by:
upgrade in interface ApplicationAdapter
Throws:
java.lang.Exception

getDescFile

public static java.net.URL getDescFile(Application appl)
                                throws java.io.FileNotFoundException,
                                       java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.