DLESE Tools
v1.6.0

org.dlese.dpc.suggest
Class SuggestHelper

java.lang.Object
  extended by org.dlese.dpc.suggest.SuggestHelper
Direct Known Subclasses:
SuggestCommentHelper, SuggestResourceHelper

public abstract class SuggestHelper
extends Object

Provides functionality to help Suggestor clients collection suggestions and write them to DCS instances.

Subclasses may provide additional functionality, such as

Author:
Jonathan Ostwald

Field Summary
protected  String dcsStatus
          DcsStatus given to SuggestionRecords
protected  String dcsStatusNote
          dcsStatusNote given to SuggestionRecords
protected  File recordTemplate
          XML File from which suggestionRecords are created
protected  SchemaHelper schemaHelper
          Helper providing schema-related functionalities for the framework of the suggestions
 
Constructor Summary
SuggestHelper(File recordTemplate, SchemaHelper schemaHelper)
          SuggestHelper Constructor
 
Method Summary
protected static String getDateStamp()
          Return a string for the current time and date, sutiable for display in log files and output to standout:
 String getDestCollection()
          Gets the destCollection attribute of the SuggestHelper object
 String getEmailFrom()
          Gets the emailFrom attribute of the SuggestHelper object
 String[] getEmailTo()
          Gets the emailTo attribute of the SuggestHelper object
 String getMailServer()
          Gets the mailServer attribute of the SuggestHelper object
 WebServiceClient getRepositoryServiceClient()
          Gets the repositoryServiceClient attribute of the SuggestHelper object, used to place suggestions in a DCS instance.
 SchemaHelper getSchemaHelper()
          Gets the schemaHelper attribute of the SuggestHelper object
 String getViewBaseUrl()
          Gets the baseUrl of the DCS instance in which suggestions are put.
abstract  String getXmlFormat()
          Gets the native framework of the suggestionRecords produced by this Suggestor.
abstract  SuggestionRecord newRecord()
          Creates a new ResourceRecord instance from the recordTemplate file.
protected static void prtlnErr(String s)
          Output a line of text to error out, with datestamp.
abstract  String putRecordToDCS(SuggestionRecord rec)
          Insert a suggested record into the DCS specified by Suggestor's configuration.
 void setDcsStatus(String status)
          The dcsStatus that is given to suggested records.
 void setDcsStatusNote(String statusNote)
          The dcsStatusNote that is given to suggested records.
static void setDebug(boolean db)
          Sets the debug attribute of the SuggestHelper object
 void setDestCollection(String collection)
          The collection of the DCS in which suggestions are placed.
 void setEmailFrom(String address)
          Sets the emailFrom attribute of the SuggestHelper object
 void setEmailTo(String[] addresses)
          Sets the emailTo attribute of the SuggestHelper object
 void setMailServer(String mailServer)
          Sets the mailServer attribute of the SuggestHelper object
 void setRepositoryServiceClient(WebServiceClient wsc)
          The repositoryServiceClient is used to place suggestions in a DCS instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schemaHelper

protected SchemaHelper schemaHelper
Helper providing schema-related functionalities for the framework of the suggestions


recordTemplate

protected File recordTemplate
XML File from which suggestionRecords are created


dcsStatus

protected String dcsStatus
DcsStatus given to SuggestionRecords


dcsStatusNote

protected String dcsStatusNote
dcsStatusNote given to SuggestionRecords

Constructor Detail

SuggestHelper

public SuggestHelper(File recordTemplate,
                     SchemaHelper schemaHelper)
SuggestHelper Constructor

Parameters:
recordTemplate - template used to create new SuggestRecord instances
schemaHelper - schemaHelper instance for this SuggestHelper's native framework
Method Detail

getXmlFormat

public abstract String getXmlFormat()
Gets the native framework of the suggestionRecords produced by this Suggestor.

Returns:
The xmlFormat value

getSchemaHelper

public SchemaHelper getSchemaHelper()
Gets the schemaHelper attribute of the SuggestHelper object

Returns:
The schemaHelper value

setDcsStatus

public void setDcsStatus(String status)
The dcsStatus that is given to suggested records.

Parameters:
status - The new dcsStatus value

setDcsStatusNote

public void setDcsStatusNote(String statusNote)
The dcsStatusNote that is given to suggested records.

Parameters:
statusNote - The new dcsStatusNote value

setDestCollection

public void setDestCollection(String collection)
The collection of the DCS in which suggestions are placed.

Parameters:
collection - The new destCollection value

getDestCollection

public String getDestCollection()
Gets the destCollection attribute of the SuggestHelper object

Returns:
The destCollection value

getRepositoryServiceClient

public WebServiceClient getRepositoryServiceClient()
Gets the repositoryServiceClient attribute of the SuggestHelper object, used to place suggestions in a DCS instance.

Returns:
The repositoryServiceClient value

setRepositoryServiceClient

public void setRepositoryServiceClient(WebServiceClient wsc)
The repositoryServiceClient is used to place suggestions in a DCS instance.

Parameters:
wsc - The new repositoryServiceClient value

setMailServer

public void setMailServer(String mailServer)
Sets the mailServer attribute of the SuggestHelper object

Parameters:
mailServer - The new mailServer value

getMailServer

public String getMailServer()
Gets the mailServer attribute of the SuggestHelper object

Returns:
The mailServer value

setEmailTo

public void setEmailTo(String[] addresses)
Sets the emailTo attribute of the SuggestHelper object

Parameters:
addresses - The new emailTo value

getEmailTo

public String[] getEmailTo()
Gets the emailTo attribute of the SuggestHelper object

Returns:
The emailTo value

setEmailFrom

public void setEmailFrom(String address)
Sets the emailFrom attribute of the SuggestHelper object

Parameters:
address - The new emailFrom value

getEmailFrom

public String getEmailFrom()
Gets the emailFrom attribute of the SuggestHelper object

Returns:
The emailFrom value

newRecord

public abstract SuggestionRecord newRecord()
                                    throws Exception
Creates a new ResourceRecord instance from the recordTemplate file.

Returns:
Description of the Return Value
Throws:
Exception - NOT YET DOCUMENTED

putRecordToDCS

public abstract String putRecordToDCS(SuggestionRecord rec)
                               throws Exception
Insert a suggested record into the DCS specified by Suggestor's configuration.

Parameters:
rec - NOT YET DOCUMENTED
Returns:
ID of record in destination DCS
Throws:
Exception - Description of the Exception

getViewBaseUrl

public String getViewBaseUrl()
Gets the baseUrl of the DCS instance in which suggestions are put. Used to construct a URL to view the suggestion in the destination DCS.

Returns:
The viewBaseUrl value

setDebug

public static void setDebug(boolean db)
Sets the debug attribute of the SuggestHelper object

Parameters:
db - The new debug value

getDateStamp

protected static String getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout:

Returns:
The dateStamp value

prtlnErr

protected static final void prtlnErr(String s)
Output a line of text to error out, with datestamp.

Parameters:
s - The text that will be output to error out.

DLESE Tools
v1.6.0