DLESE Tools
v1.6.0

org.dlese.dpc.suggest.resource
Class SuggestResourceHelper

java.lang.Object
  extended by org.dlese.dpc.suggest.SuggestHelper
      extended by org.dlese.dpc.suggest.resource.SuggestResourceHelper

public class SuggestResourceHelper
extends SuggestHelper

SuggestUrlManger - provides services for suggestor Client.

Author:
Jonathan Ostwald

Field Summary
 
Fields inherited from class org.dlese.dpc.suggest.SuggestHelper
dcsStatus, dcsStatusNote, recordTemplate, schemaHelper
 
Constructor Summary
SuggestResourceHelper(File recordTemplate, SchemaHelper schemaHelper)
          SuggestResourceHelper Constructor.
 
Method Summary
 UrlValidator getUrlValidator()
           
 String getXmlFormat()
          Gets the native framework of the suggestionRecords produced by this Suggestor.
 ResourceRecord newRecord()
          Creates a new ResourceRecord instance by reading from the recordTemplate.
 String putRecordToDCS(SuggestionRecord rec)
          Insert a suggested record into the DCS specified by Suggestor's configuration.
 String putRecordToDCS(SuggestionRecord rec, ValidatorResults validatorResults)
          Insert a suggested record into the DCS specified by client configuration.
static void setDebug(boolean db)
          Sets the debug attribute of the SuggestResourceHelper object
 void setUrlValidator(UrlValidator validator)
           
 
Methods inherited from class org.dlese.dpc.suggest.SuggestHelper
getDateStamp, getDestCollection, getEmailFrom, getEmailTo, getMailServer, getRepositoryServiceClient, getSchemaHelper, getViewBaseUrl, prtlnErr, setDcsStatus, setDcsStatusNote, setDestCollection, setEmailFrom, setEmailTo, setMailServer, setRepositoryServiceClient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuggestResourceHelper

public SuggestResourceHelper(File recordTemplate,
                             SchemaHelper schemaHelper)
SuggestResourceHelper Constructor. The repositoryDir param points to a directory that contains a default record (used for making new records), and a records directory (where suggested urls are stored). This stuff is all hard coded for now, but properties can be used to supply defaults (see org.dlese.dpc.suggest.SuggestResourceHelper).

Parameters:
repositoryDir - directory holding default record and records directory
Method Detail

getXmlFormat

public String getXmlFormat()
Description copied from class: SuggestHelper
Gets the native framework of the suggestionRecords produced by this Suggestor.

Specified by:
getXmlFormat in class SuggestHelper
Returns:
The xmlFormat value

getUrlValidator

public UrlValidator getUrlValidator()

setUrlValidator

public void setUrlValidator(UrlValidator validator)

newRecord

public ResourceRecord newRecord()
                         throws Exception
Creates a new ResourceRecord instance by reading from the recordTemplate. We don't call readRecord (file) because we don't want the id to be set for the new record

Specified by:
newRecord in class SuggestHelper
Returns:
Description of the Return Value
Throws:
Exception - NOT YET DOCUMENTED

putRecordToDCS

public String putRecordToDCS(SuggestionRecord rec)
                      throws Exception
Description copied from class: SuggestHelper
Insert a suggested record into the DCS specified by Suggestor's configuration.

Specified by:
putRecordToDCS in class SuggestHelper
Parameters:
rec - NOT YET DOCUMENTED
Returns:
ID of record in destination DCS
Throws:
Exception - Description of the Exception

putRecordToDCS

public String putRecordToDCS(SuggestionRecord rec,
                             ValidatorResults validatorResults)
                      throws Exception
Insert a suggested record into the DCS specified by client configuration.

Parameters:
sm - Description of the Parameter
Returns:
ID of record in destination DCS
Throws:
Exception - Description of the Exception

setDebug

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

Parameters:
db - The new debug value

DLESE Tools
v1.6.0