Class SuggestHelper

java.lang.Object
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.
  • newRecord - produces a SuggestionRecord for the nativeFormat of this Suggestor
  • repositoryService - writes SuggestionRecords to a DCS instance
Subclasses may provide additional functionality, such as
  • 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 Details

    • 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 Details

    • 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 Details

    • 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
      invalid reference
      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.