Package com.groiss.server
Interface Admin
public interface Admin
Interface for administrative actions. Use Admin.getInstance() to create an
instance of this interface.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdminLinks
(String name, Resource resource, Link[] actions) Deprecated, for removal: This API element is subject to removal in a future version.Use appl_id/admin_tasks_fragment.xml files for extending the admin interface.void
addToLogEntryTable
(String formClassname) Adds the passed form class to the list of available classes for which objects the historic data may be listed using the according admin task in the Administration UI.changeIdOfFormType
(FormType ft, String newid, boolean keep, PrintWriter pw) Change the id of the passed formtype.Create a new, empty message template.void
createSysEvent
(String id, String description) Write a record to the system event log in the database.void
executeTimer
(String id) Execute the timer with the given idExecute db-upgrades in @enterprise, if db-version is out-of-date.exportXML
(String mainclass, String condition, List<Object> params, String clustername, String description, Set<String> skipclasses, boolean mapusers, OutputStream os, PrintWriter pw) Perform an XML Export.exportXML
(String mainclass, String condition, List<Object> params, String clustername, String description, Set<String> skipclasses, OutputStream os, PrintWriter pw) Perform an XML Export.exportXML
(List<Exportable> objects, String clustername, String description, Set<String> skipclasses, OutputStream os, PrintWriter pw) Perform an XML Export.fileImport
(File fs, String key) Method for importing a text file into a database table.void
Generate the classes for the given form type.static Admin
Get the Admin to make administrative actions on the server.Read the message template with the given id from the database.Returns the objects referenced by the given object, including the object itself.returns the url to the admin connector of the web server, the information is maintained in the server object in the administration.returns the url to the web server, the information is maintained in the server object in the administration.getUserSessionId
(String httpSessionId) Get the user session id from http-session id.Perform an XML-Import.void
Initialize the log file (start writing a new one)installApplication
(String destdir, File source) Method for installing an application.boolean
Is login to @enterprise allowed?void
Logout a user.void
Refresh the activities in the worklist cachevoid
Refresh the organizational data in the worklist cachevoid
Marks all Database Connections as old.void
removeFieldModes
(ProcessDefinition pd, String stepid, String formid, String subformids) Remove the field modes of a form in a process.void
replaceHTML
(FormType ft, String htmlpage) Regenerate a form.void
Restart the @enterprise servervoid
sendToAdmin
(String subject, String message) Send a message with mime-type text/plain to the system administrator.void
sendToAdmin
(String subject, String message, MailSender.MailAction action) Send a message with mime-type text/plain to the system administrator.Print out the server information.void
setFieldModes
(ProcessDefinition pd, String stepid, String formid, String subformids, Map<String, Short> modes) Set the field mode for a step in a process.void
setLoginAllowed
(String nodeid, boolean allowed, String message) Allow or deny the login on the given node.void
setLoginAllowed
(String nodeid, boolean allowed, String message, int currentSessions, String successorNodeId) Allow or deny the login on the given node.Search the resource in the classpath.void
Stop the @enterprise serverView the current log file
-
Method Details
-
getInstance
Get the Admin to make administrative actions on the server.- Returns:
- an Admin object
-
stopServer
void stopServer()Stop the @enterprise server -
restartServer
void restartServer()Restart the @enterprise server -
generateFormClass
Generate the classes for the given form type.- Throws:
Exception
-
replaceHTML
Regenerate a form. In case of HTML forms the second argument contains the HTML text for this form, in case of XHTML forms the second argument is ignored. The functions recreates the form classes and adds or drop fields to the form table if necessary. Note that the type of new form fields must be provided in the html text (attributes dbtype and dblength). NOTE: Import/Export functionality should be used instead of this method for transporting ALL aspects of form types.
NOTE 2: The method MAY make an implicit commit of the database transaction, when an alter table statement is executed. Be careful using this method in one transaction with other database operations.- Throws:
Exception
-
changeIdOfFormType
FormType changeIdOfFormType(FormType ft, String newid, boolean keep, PrintWriter pw) throws Exception Change the id of the passed formtype. Note: the current user must have ADMIN permissions to execute this function.- Parameters:
ft
- the formtype which id shall be changednewid
- the new id for the formtypekeep
- if true a copy of the original formtype will be made and kept in the system before changing the idpw
- used to log information about the steps performed during this operation- Returns:
- the formtype with the old id if keep was true else null
- Throws:
Exception
-
serverInfo
Print out the server information.- Throws:
Exception
-
executeTimer
Execute the timer with the given id- Throws:
Exception
-
refreshWorklistCacheOrgData
void refreshWorklistCacheOrgData()Refresh the organizational data in the worklist cache -
refreshWorklistCacheInstances
void refreshWorklistCacheInstances()Refresh the activities in the worklist cache -
initLogFile
void initLogFile()Initialize the log file (start writing a new one) -
viewLogFile
View the current log file- Throws:
IOException
-
isLoginAllowed
boolean isLoginAllowed()Is login to @enterprise allowed? -
logout
Logout a user.- Parameters:
sessionId
- the id of the user session.
-
getUserSessionId
Get the user session id from http-session id.- Returns:
-
setLoginAllowed
Allow or deny the login on the given node.- Parameters:
nodeid
- id of cluster node, ignored in non-cluster modeallowed
- if true login is allowedmessage
- a message for the users trying to login.- Throws:
Exception
-
setLoginAllowed
void setLoginAllowed(String nodeid, boolean allowed, String message, int currentSessions, String successorNodeId) throws Exception Allow or deny the login on the given node.- Throws:
Exception
-
executeUpgrade
Execute db-upgrades in @enterprise, if db-version is out-of-date.- Throws:
Exception
-
showClassLocation
Search the resource in the classpath. -
createSysEvent
Write a record to the system event log in the database.- Parameters:
id
- an iddescription
- description of the event
-
importXML
Perform an XML-Import.- Parameters:
resource
- a resource in the classpath- Returns:
- the log information is returned
- Throws:
Exception
-
installApplication
Method for installing an application.- Parameters:
destdir
- destination directorysource
- the zip file containing the application- Returns:
- log output of the install process (mainly from the import)
- Throws:
Exception
-
fileImport
Method for importing a text file into a database table.- Parameters:
fs
- the file to importkey
- the key referencing the import description. This key has the following syntax: applid:descname The applid is the id of an application, an import description is searched in the classpath using the path applid/import.xml, the descname is the name of an import declaration in the file.- Returns:
- log output of the import process
- Throws:
Exception
-
exportXML
String exportXML(String mainclass, String condition, List<Object> params, String clustername, String description, Set<String> skipclasses, OutputStream os, PrintWriter pw) throws Exception Perform an XML Export.- Parameters:
mainclass
- export elements of this classcondition
- restriction for mainclassparams
- parameter of the conditionclustername
- refers to a cluster in SchemaDescription contains a list of classes to exportdescription
- description for export fileskipclasses
- do not export member of these classesos
- write the export to this streampw
- write the log to this writer- Returns:
- a name of the export file
- Throws:
Exception
-
exportXML
String exportXML(String mainclass, String condition, List<Object> params, String clustername, String description, Set<String> skipclasses, boolean mapusers, OutputStream os, PrintWriter pw) throws Exception Perform an XML Export.- Parameters:
mainclass
- export elements of this classcondition
- restriction for mainclassparams
- parameter of the conditionclustername
- refers to a cluster in SchemaDescription contains a list of classes to exportdescription
- description for export fileskipclasses
- do not export member of these classesmapusers
- map users tro sysadmos
- write the export to this streampw
- write the log to this writer- Returns:
- a name of the export file
- Throws:
Exception
-
exportXML
String exportXML(List<Exportable> objects, String clustername, String description, Set<String> skipclasses, OutputStream os, PrintWriter pw) throws Exception Perform an XML Export.- Parameters:
objects
- a homogenous list of objects of an exportable classclustername
- refers to a cluster in SchemaDescription contains a list of classes to exportdescription
- description for export fileskipclasses
- do not export member of these classesos
- write the export to this streampw
- write the log to this writer- Returns:
- a name of the export file
- Throws:
Exception
-
getReferencedObjects
Returns the objects referenced by the given object, including the object itself. The functionality is similar to the XML-Export, where the export of an object contains all components of this object. For example, if the argument is a user, the method returns a list of user-role-relations, user-properties, etc. The method can be used to copy such an object with all its components.- Parameters:
e
- an Exportable (User, Role, ProcessDefinition)- Returns:
- a list of Exportables
- Throws:
Exception
-
getServerURL
String getServerURL()returns the url to the web server, the information is maintained in the server object in the administration. The context path is the actual deployment path.- Returns:
- an url string, for example: http://hostname:port/wf/
-
getServerAdminURL
String getServerAdminURL()returns the url to the admin connector of the web server, the information is maintained in the server object in the administration. The context path is taken from the configuration. If no separate admin connector has been specified, getServerURL() is returned.- Returns:
- an url string, for example: http://hostname:port/wf/
-
reloadDBConnections
void reloadDBConnections()Marks all Database Connections as old. Old connections are refreshed before binding them to a thread. Refreshing means to close the connection and to open a new one. Can be used to redistribute database connections among nodes of a clustered DBMS. -
setFieldModes
void setFieldModes(ProcessDefinition pd, String stepid, String formid, String subformids, Map<String, Short> modes) Set the field mode for a step in a process. The parameter subformids specifies the subform.- Parameters:
pd
- the process definition object, mandatorystepid
- the id of the step, mandatoryformid
- the id of the form, mandatorysubformids
- the key for subforms: If the modes of a subform are set, this parameter contains the subforms id(s) separated be a slash. Example: the form f has a subform g with id 1, g has a subform h with id 3, the parameter subformids should have the value "1/3" if setting the field values of form h. If the modes of a mainform are set the parameters is either "0" or may be null.modes
- The modes map is a map of fieldnames and mode values. See the constants in WfEngine for the value range. The field names are either the java field names of the form class of the classname and id of the subform, separated by a space.
-
removeFieldModes
Remove the field modes of a form in a process.- Parameters:
pd
- the process definition object, mandatorystepid
- the stepid, may be nullformid
- id of the form in the process, mandatorysubformids
- syntax as in setFieldModes, null means all form fields of the form (and step) are deleted.
-
addAdminLinks
@Deprecated(since="10.0", forRemoval=true) void addAdminLinks(String name, Resource resource, Link[] actions) Deprecated, for removal: This API element is subject to removal in a future version.Use appl_id/admin_tasks_fragment.xml files for extending the admin interface.Add a group of links to the administration / admin tasks. If the name of the group is already there, the entries are replaced.- Parameters:
name
- the name of the admin groupresource
- the resource to use for i18nactions
- the admin actions to add
-
addToLogEntryTable
Adds the passed form class to the list of available classes for which objects the historic data may be listed using the according admin task in the Administration UI.- Parameters:
formClassname
- the full qualified name of the class. Must be a class of typeDMSForm
, otherwise if will not be added and a log message will inform about this situation.
-
getMessageTemplate
Read the message template with the given id from the database. Subject and body replacement is performed by default!- Parameters:
id
- id of a message template- Returns:
- a message template
-
createMessageTemplate
MessageTemplate createMessageTemplate()Create a new, empty message template. Please note that subject/body replacement is not performed by default! -
sendToAdmin
Send a message with mime-type text/plain to the system administrator.- Parameters:
subject
- the subjectmessage
- the message
-
sendToAdmin
Send a message with mime-type text/plain to the system administrator.- Parameters:
subject
- the subjectmessage
- the messageaction
- theMailSender.MailAction
, ifnull
the configured setting of property "ep.mail.queue.usage" is taken
-