org.greenstone.gs3client.data
Class CollectionData

java.lang.Object
  extended by org.greenstone.gs3client.data.CollectionData

public class CollectionData
extends java.lang.Object

CollectionData represents a Greenstone 3 collection and contains the data stored in a <collection></collection> element returned from a MessageRouter's desribe response XML and a Collection describe response XML. A CollectionData object can therefore contain services (represented by ServiceData), a list of collection-level metadata (represented by MetaData) and a list of plugins (represented by PluginData). ServiceData and PluginData are static inner classes of CollectionData. To declare variables of these inner class types in other java files/classes, import each one: e.g. "import gs3client.CollectionData.ServiceData". Then they can be used without the outerclass' name for qualification: i.e. can then use Servicedata sv = new ServiceData(...) instead of CollectionData.ServiceData sv = new CollectionData.ServiceData(...).

Author:
ak19

Nested Class Summary
static class CollectionData.MetaData
          Static inner class MetaData: can import it into other files as "import gs3client.CollectionData.MetaData;" In this way, can use it as if it were a regular class (a.o.t.
static class CollectionData.PluginData
          PluginData inner class of CollectionData, represents the data stored in a <plugin></plugin> element.
static class CollectionData.ServiceData
          Only the name and type of a <service></service> element is stored, since this is all the service data available inside a collection's response message to a describe request.
 
Field Summary
protected  java.lang.String description
          Description of the Greenstone collection represented by this CollectionData
protected  java.lang.String displayName
          Display name for the Greenstone collection represented by this CollectionData
protected  java.lang.String icon
           
protected  CollectionData.MetaData[] metadataList
          Collection level metadata
 java.lang.String name
          The basic field of a collection: the name of the collection.
protected  CollectionData.PluginData[] pluginList
          Greenstone plugins used to build this collection with
protected  CollectionData.ServiceData[] serviceList
          List of services supported by this collection
protected  java.lang.String smallIcon
           
protected  java.lang.String url
          Stores the location of images and stuff.
 
Constructor Summary
CollectionData(org.w3c.dom.Element mrCollectionTag)
          Gets a <collection></collection> element as returned by the MessageRouter's describe response, with only the name field set.
 
Method Summary
 java.lang.String getDescription()
           
 java.lang.String getDisplayName()
           
 java.lang.String getIcon()
           
 CollectionData.MetaData[] getMetadataList()
           
 java.lang.String getName()
           
 CollectionData.PluginData[] getPluginList()
           
 CollectionData.ServiceData[] getServiceList(boolean executableServicesOnly)
           
 java.lang.String getSmallIcon()
           
 java.lang.String getUrl()
           
 java.lang.String info()
           
 void setFields(org.w3c.dom.Element collectionTag)
          Gets a <collection></collection> element - as returned by a describe response from a Collection - and sets the member vars using the data in there.
 java.lang.String show()
           
 java.lang.String toString()
          Useful when adding CollectionData objects to a JList or JCombobox.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

url

protected java.lang.String url
Stores the location of images and stuff. Not really used at present


name

public final java.lang.String name
The basic field of a collection: the name of the collection. This is present for collection elements in all describe response messages, whether sent from the MessageRouter or from Greenstone collections.


displayName

protected java.lang.String displayName
Display name for the Greenstone collection represented by this CollectionData


description

protected java.lang.String description
Description of the Greenstone collection represented by this CollectionData


smallIcon

protected java.lang.String smallIcon

icon

protected java.lang.String icon

serviceList

protected CollectionData.ServiceData[] serviceList
List of services supported by this collection


metadataList

protected CollectionData.MetaData[] metadataList
Collection level metadata


pluginList

protected CollectionData.PluginData[] pluginList
Greenstone plugins used to build this collection with

Constructor Detail

CollectionData

public CollectionData(org.w3c.dom.Element mrCollectionTag)
Gets a <collection></collection> element as returned by the MessageRouter's describe response, with only the name field set.

Parameters:
mrCollectionTag - the <collection></collection> element as returned by a describe response from the MessageRouter.
Method Detail

setFields

public void setFields(org.w3c.dom.Element collectionTag)
Gets a <collection></collection> element - as returned by a describe response from a Collection - and sets the member vars using the data in there.

Parameters:
collectionTag - is the <collection></collection> element as returned by a describe response from a Collection.

toString

public java.lang.String toString()
Useful when adding CollectionData objects to a JList or JCombobox.

Overrides:
toString in class java.lang.Object
Returns:
the name of the collection represented by this CollectionData

show

public java.lang.String show()
Returns:
a String displaying the contents of this CollectionData object. Useful for debugging purposes.

info

public java.lang.String info()
Returns:
the Info string for the collection reprsented by this CollectionData object.

getName

public java.lang.String getName()

getDisplayName

public java.lang.String getDisplayName()

getDescription

public java.lang.String getDescription()

getSmallIcon

public java.lang.String getSmallIcon()

getIcon

public java.lang.String getIcon()

getUrl

public java.lang.String getUrl()

getMetadataList

public CollectionData.MetaData[] getMetadataList()

getPluginList

public CollectionData.PluginData[] getPluginList()

getServiceList

public CollectionData.ServiceData[] getServiceList(boolean executableServicesOnly)
Parameters:
executableServicesOnly - - if true, only the list of supported query and browse services are returned. Otherwise, all the services in the collection are returned.
Returns:
the list of services supported by this collection.