Package org.dlese.dpc.suggest
Class SuggestHelper
java.lang.Object
org.dlese.dpc.suggest.SuggestHelper
- Direct Known Subclasses:
SuggestCommentHelper,SuggestResourceHelper
Provides functionality to help Suggestor clients collection suggestions and
write them to DCS instances.
- newRecord - produces a SuggestionRecord for the nativeFormat of this Suggestor
- repositoryService - writes SuggestionRecords to a DCS instance
- Dup checking - to make sure a suggestion is received only once
- Search Service - to extract information from a record to be annotated
- Author:
- Jonathan Ostwald
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringDcsStatus given to SuggestionRecordsprotected StringdcsStatusNote given to SuggestionRecordsprotected FileXML File from which suggestionRecords are createdprotected SchemaHelperHelper providing schema-related functionalities for the framework of the suggestions -
Constructor Summary
ConstructorsConstructorDescriptionSuggestHelper(File recordTemplate, SchemaHelper schemaHelper) SuggestHelper Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringReturn a string for the current time and date, sutiable for display in log files and output to standout:Gets the destCollection attribute of the SuggestHelper objectGets the emailFrom attribute of the SuggestHelper objectString[]Gets the emailTo attribute of the SuggestHelper objectGets the mailServer attribute of the SuggestHelper objectGets the repositoryServiceClient attribute of the SuggestHelper object, used to place suggestions in a DCS instance.Gets the schemaHelper attribute of the SuggestHelper objectGets the baseUrl of the DCS instance in which suggestions are put.abstract StringGets the native framework of the suggestionRecords produced by this Suggestor.abstract SuggestionRecordCreates a newinstance from the recordTemplate file.invalid reference
ResourceRecordprotected static final voidOutput a line of text to error out, with datestamp.abstract StringInsert a suggested record into the DCS specified by Suggestor's configuration.voidsetDcsStatus(String status) The dcsStatus that is given to suggested records.voidsetDcsStatusNote(String statusNote) The dcsStatusNote that is given to suggested records.static voidsetDebug(boolean db) Sets the debug attribute of the SuggestHelper objectvoidsetDestCollection(String collection) The collection of the DCS in which suggestions are placed.voidsetEmailFrom(String address) Sets the emailFrom attribute of the SuggestHelper objectvoidsetEmailTo(String[] addresses) Sets the emailTo attribute of the SuggestHelper objectvoidsetMailServer(String mailServer) Sets the mailServer attribute of the SuggestHelper objectvoidThe repositoryServiceClient is used to place suggestions in a DCS instance.
-
Field Details
-
schemaHelper
Helper providing schema-related functionalities for the framework of the suggestions -
recordTemplate
XML File from which suggestionRecords are created -
dcsStatus
DcsStatus given to SuggestionRecords -
dcsStatusNote
dcsStatusNote given to SuggestionRecords
-
-
Constructor Details
-
SuggestHelper
SuggestHelper Constructor- Parameters:
recordTemplate- template used to create new SuggestRecord instancesschemaHelper- schemaHelper instance for this SuggestHelper's native framework
-
-
Method Details
-
getXmlFormat
Gets the native framework of the suggestionRecords produced by this Suggestor.- Returns:
- The xmlFormat value
-
getSchemaHelper
Gets the schemaHelper attribute of the SuggestHelper object- Returns:
- The schemaHelper value
-
setDcsStatus
The dcsStatus that is given to suggested records.- Parameters:
status- The new dcsStatus value
-
setDcsStatusNote
The dcsStatusNote that is given to suggested records.- Parameters:
statusNote- The new dcsStatusNote value
-
setDestCollection
The collection of the DCS in which suggestions are placed.- Parameters:
collection- The new destCollection value
-
getDestCollection
Gets the destCollection attribute of the SuggestHelper object- Returns:
- The destCollection value
-
getRepositoryServiceClient
Gets the repositoryServiceClient attribute of the SuggestHelper object, used to place suggestions in a DCS instance.- Returns:
- The repositoryServiceClient value
-
setRepositoryServiceClient
The repositoryServiceClient is used to place suggestions in a DCS instance.- Parameters:
wsc- The new repositoryServiceClient value
-
setMailServer
Sets the mailServer attribute of the SuggestHelper object- Parameters:
mailServer- The new mailServer value
-
getMailServer
Gets the mailServer attribute of the SuggestHelper object- Returns:
- The mailServer value
-
setEmailTo
Sets the emailTo attribute of the SuggestHelper object- Parameters:
addresses- The new emailTo value
-
getEmailTo
Gets the emailTo attribute of the SuggestHelper object- Returns:
- The emailTo value
-
setEmailFrom
Sets the emailFrom attribute of the SuggestHelper object- Parameters:
address- The new emailFrom value
-
getEmailFrom
Gets the emailFrom attribute of the SuggestHelper object- Returns:
- The emailFrom value
-
newRecord
Creates a newinstance from the recordTemplate file.invalid reference
ResourceRecord- Returns:
- Description of the Return Value
- Throws:
Exception- NOT YET DOCUMENTED
-
putRecordToDCS
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
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
Return a string for the current time and date, sutiable for display in log files and output to standout:- Returns:
- The dateStamp value
-
prtlnErr
Output a line of text to error out, with datestamp.- Parameters:
s- The text that will be output to error out.
-