org.greenstone.gs3services
Class AdminSOAPServer

java.lang.Object
  extended by org.greenstone.gs3services.AdminSOAPServer

public class AdminSOAPServer
extends java.lang.Object

A beginning to the AdminSOAPServer class which will contain management/admin related web services such as adding new documents, creating, building and importing collections and configuring Greenstone modules. NOTE: to run this class, the folder containing this web service class' properties helpFile should be on the classpath.


Field Summary
protected  org.greenstone.gsdl3.util.XMLConverter converter
          A converter class to parse XML and create Docs
protected  org.w3c.dom.Document doc
          Container Document to create XML Nodes
protected static java.lang.String helpErrormessage
          Error message loading helpFile.
protected static java.lang.String helpFile
          The help properties file describing the web service operations
protected  org.greenstone.gsdl3.core.MessageRouter mr
          Message Router object to pass requests messages to and which will process them.
protected static java.util.Properties properties
          Properties map with mappings from methodname to help description string
protected  java.lang.String site_name
          site_name the MessageRouter works with, here set to "localsite"
 
Constructor Summary
AdminSOAPServer()
          Constructor that initializes the web services' MessageRouter object Reads from GlobalProperties to get gsdl3_home and set the sitename.
 
Method Summary
 java.lang.String activate(java.lang.String systemModuleType, java.lang.String systemModuleName)
          Sends a (re-)activate system-type message to activate a Greenstone module.
 java.lang.String deactivate(java.lang.String systemModuleType, java.lang.String systemModuleName)
          Sends a deactivate system-type message to activate a Greenstone module.
protected  java.lang.String error(java.lang.String errorMessage)
          Creates a String response message to represent an XML error response message using the error specified in the message parameter.
 java.lang.String format(java.lang.String collection, java.lang.String service, java.lang.String language)
          Sends a format-type message to a Service containing format (Greenstone Format, GSF) XSLT statements to specify how a collection looks.
static java.lang.String help()
           
static java.lang.String helpWithMethod(java.lang.String methodname)
           
static void main(java.lang.String[] args)
           
protected  java.lang.String processInternal(org.w3c.dom.Element message)
          Called by most other methods in order to send the constructed message to the Greenstone's MessageRouter, intercept the response and return it.
 java.lang.String reconfigure(java.lang.String subset)
          Sends a configure system-type message to configure the Message Router.
 java.lang.String reconfigureMessageRouter()
          Sends a configure system-type message to configure all of the Message Router.
 java.lang.String status(java.lang.String to, java.lang.String language, java.lang.String pid)
          Sends a status-type message to poll the status of a process that was initiated but which may not yet have terminated.
protected  java.lang.String system(java.lang.String type, java.lang.String subset, java.lang.String systemModuleType, java.lang.String systemModuleName)
          For sending system-type messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

helpErrormessage

protected static java.lang.String helpErrormessage
Error message loading helpFile. Remains at "" if everything is fine


properties

protected static java.util.Properties properties
Properties map with mappings from methodname to help description string


helpFile

protected static java.lang.String helpFile
The help properties file describing the web service operations


site_name

protected java.lang.String site_name
site_name the MessageRouter works with, here set to "localsite"


mr

protected org.greenstone.gsdl3.core.MessageRouter mr
Message Router object to pass requests messages to and which will process them.


doc

protected org.w3c.dom.Document doc
Container Document to create XML Nodes


converter

protected org.greenstone.gsdl3.util.XMLConverter converter
A converter class to parse XML and create Docs

Constructor Detail

AdminSOAPServer

public AdminSOAPServer()
Constructor that initializes the web services' MessageRouter object Reads from GlobalProperties to get gsdl3_home and set the sitename.

Method Detail

status

public java.lang.String status(java.lang.String to,
                               java.lang.String language,
                               java.lang.String pid)
Sends a status-type message to poll the status of a process that was initiated but which may not yet have terminated.

Parameters:
to - - the processing service to send this status message to.
language - - the preferred language of the display content in the response.
pid - - the process id of the process whose status is requested.
See Also:
The Greenstone 3 Developer's Manual - pages 42, 43

reconfigureMessageRouter

public java.lang.String reconfigureMessageRouter()
Sends a configure system-type message to configure all of the Message Router.

See Also:
The Greenstone 3 Developer's Manual - pp. 13, 41, 42

reconfigure

public java.lang.String reconfigure(java.lang.String subset)
Sends a configure system-type message to configure the Message Router.

Parameters:
subset - - the particular subset of the module which is to be reconfigured. For a collection/serviceRack it can be metadataList, serviceList. For the MessageRouter this can be siteList, collectionList, clusterList, serviceList
See Also:
The Greenstone 3 Developer's Manual - pp. 13, 41, 42

activate

public java.lang.String activate(java.lang.String systemModuleType,
                                 java.lang.String systemModuleName)
Sends a (re-)activate system-type message to activate a Greenstone module.

Parameters:
systemModuleName - - name of the module to be (re-)activated.
systemModuleType - - type of the module. For instance, this may be site or collection.
See Also:
The Greenstone 3 Developer's Manual - pp. 13, 41, 42

deactivate

public java.lang.String deactivate(java.lang.String systemModuleType,
                                   java.lang.String systemModuleName)
Sends a deactivate system-type message to activate a Greenstone module.

Parameters:
systemModuleName - - name of the module to be deactivated.
systemModuleType - - type of the module. For instance, this may be site or collection.
See Also:
The Greenstone 3 Developer's Manual - pp. 13, 41, 42

system

protected java.lang.String system(java.lang.String type,
                                  java.lang.String subset,
                                  java.lang.String systemModuleType,
                                  java.lang.String systemModuleName)
For sending system-type messages. For parameter type=configure, the subset value is set (or ""). For parameter type=(de)activate, the systemModuleName and systemModuleType are set.

Parameters:
type - - one of GSXML.SYSTEM_TYPE_CONFIGURE, GSXML.SYSTEM_TYPE_ACTIVATE, GSXML.SYSTEM_TYPE_DEACTIVATE (configure, activate or deactivate, respectively).
subset - - for system type configure, this can specify the To module's subset that needs to be reconfigured.
systemModuleName - - for system type (de)activate, this specifies the name of the module to be (de)activated.
systemModuleType - - for system type (de)activate, this specifies the type of the module to be (de)activated. For instance, this may be site or collection.

format

public java.lang.String format(java.lang.String collection,
                               java.lang.String service,
                               java.lang.String language)
Sends a format-type message to a Service containing format (Greenstone Format, GSF) XSLT statements to specify how a collection looks.

Parameters:
collection - - the name of the collection this message is sent to.
service - - name of the service this format message is to be sent to.
language - - the preferred language of the display content in the response.
See Also:
The Greenstone 3 Developer's Manual - page 42

processInternal

protected java.lang.String processInternal(org.w3c.dom.Element message)
Called by most other methods in order to send the constructed message to the Greenstone's MessageRouter, intercept the response and return it.

Parameters:
message - is the XML message Element to send to GS3's MessageRouter.
Returns:
the XML response in String format.

error

protected java.lang.String error(java.lang.String errorMessage)
Creates a String response message to represent an XML error response message using the error specified in the message parameter. A String is created because this method ensures that a response message is reliably constructed (no exceptions are thrown) that can be sent to clients.

Parameters:
errorMessage - - the errormessage to be conveyed
Returns:
an XML response message containing an GS3 error element.

help

public static java.lang.String help()
Returns:
a help string for listing all the web service methods.

helpWithMethod

public static java.lang.String helpWithMethod(java.lang.String methodname)
Parameters:
methodname - is the name of the method to be described.
Returns:
a help string for the given method, explaining what the method does, what parameters it expects and their types and what it returns.

main

public static void main(java.lang.String[] args)