Class ResourceRecord

java.lang.Object
org.dlese.dpc.suggest.SuggestionRecord
org.dlese.dpc.suggest.resource.ResourceRecord

public class ResourceRecord extends SuggestionRecord
Wrapper for a suggested resource record, which is in ADN item-level format and represented as a Document.
Author:
Jonathan Ostwald
  • Field Summary

    Fields inherited from class org.dlese.dpc.suggest.SuggestionRecord

    doc, docMap
  • Constructor Summary

    Constructors
    Constructor
    Description
    ResourceRecord(org.dom4j.Document doc, SchemaHelper schemaHelper)
    Constructor - creates a new ResourceRecord but doesn't assign an id
  • Method Summary

    Modifier and Type
    Method
    Description
    Sets the creation date for this ResourceRecord.
    Gets the description attribute of the ResourceRecord object
    Gets the emailPrimary attribute of the ResourceRecord object
    we want to collect all the gradeRange Values and return them as an Array
    return a pretty-printed list of gradeRanges as a string
    Gets the instName attribute of the ResourceRecord object
    Gets the lastModified attribute of the ResourceRecord object
    Gets the nameFirst attribute of the ResourceRecord object
    Gets the nameLast attribute of the ResourceRecord object
    Gets the title attribute of the ResourceRecord object
    Gets the url attribute of the ResourceRecord object
    void
    writes a String representaton of the date to both contributor and metaMetadata/dateInfo nodes.
    static void
    setDebug(boolean db)
    Sets the debug attribute of the Emailer object
    void
    Sets the description attribute of the ResourceRecord object
    void
    Sets the emailPrimary attribute of the ResourceRecord object
    void
    GradeRange xpath is //educational/audiences/audience/gradeRange to set a gradeRange we have to be concerned with the entire AUDIENCE element at this point (Suggest-a-url), none of the other fields have meaningful values, so we can simply wipe out the existing audiences and add new ones
    void
    Sets the instName attribute of the ResourceRecord object
    void
    Sets the lastModified attribute of the ResourceRecord object
    void
    Sets the nameFirst attribute of the ResourceRecord object
    void
    Sets the nameLast attribute of the ResourceRecord object
    void
    Sets the title attribute of the ResourceRecord object
    void
    Sets the url attribute of the ResourceRecord object
    Print selected fields of this object for debugging purposes

    Methods inherited from class org.dlese.dpc.suggest.SuggestionRecord

    get, getDoc, getDocMap, put

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ResourceRecord

      public ResourceRecord(org.dom4j.Document doc, SchemaHelper schemaHelper)
      Constructor - creates a new ResourceRecord but doesn't assign an id
      Parameters:
      doc - Document
  • Method Details

    • getTitle

      public String getTitle()
      Gets the title attribute of the ResourceRecord object
      Returns:
      The title value
      Throws:
      Exception - Description of the Exception
    • setTitle

      public void setTitle(String val) throws Exception
      Sets the title attribute of the ResourceRecord object
      Parameters:
      val - The new title value
      Throws:
      Exception - Description of the Exception
    • getUrl

      public String getUrl()
      Gets the url attribute of the ResourceRecord object
      Returns:
      The url value
      Throws:
      Exception - Description of the Exception
    • setUrl

      public void setUrl(String val) throws Exception
      Sets the url attribute of the ResourceRecord object
      Parameters:
      val - The new url value
      Throws:
      Exception - Description of the Exception
    • getDescription

      public String getDescription()
      Gets the description attribute of the ResourceRecord object
      Returns:
      The description value
      Throws:
      Exception - Description of the Exception
    • setDescription

      public void setDescription(String val) throws Exception
      Sets the description attribute of the ResourceRecord object
      Parameters:
      val - The new description value
      Throws:
      Exception - Description of the Exception
    • getGradeRanges

      public String[] getGradeRanges() throws Exception
      we want to collect all the gradeRange Values and return them as an Array
      Returns:
      The gradeRanges value
      Throws:
      Exception - Description of the Exception
    • getGradeRangesDisplay

      public String getGradeRangesDisplay() throws Exception
      return a pretty-printed list of gradeRanges as a string
      Returns:
      The gradeRangesDisplay value
      Throws:
      Exception - Description of the Exception
    • setGradeRanges

      public void setGradeRanges(String[] vals) throws Exception
      GradeRange xpath is //educational/audiences/audience/gradeRange to set a gradeRange we have to be concerned with the entire AUDIENCE element at this point (Suggest-a-url), none of the other fields have meaningful values, so we can simply wipe out the existing audiences and add new ones
      Parameters:
      vals - The new gradeRanges value
      Throws:
      Exception - Description of the Exception
    • getCreationDate

      public String getCreationDate()
      Sets the creation date for this ResourceRecord. MetaMetadata/dateInfo and contributor elements should have same date value (since they are set together - see setCreationDate(java.lang.String) we use metaMetadata/dateInfo here
      Returns:
      The creationDate value
      Throws:
      Exception - Description of the Exception
    • setCreationDate

      public void setCreationDate(String dateStr) throws Exception
      writes a String representaton of the date to both contributor and metaMetadata/dateInfo nodes.

      issue: is it okay to use the same string representation for these nodes (they have different type definitions)

      Parameters:
      dateStr - The new creationDate value
      Throws:
      Exception - Description of the Exception
    • getLastModified

      public String getLastModified()
      Gets the lastModified attribute of the ResourceRecord object
      Returns:
      The lastModified value
      Throws:
      Exception - Description of the Exception
    • setLastModified

      public void setLastModified(String dateStr) throws Exception
      Sets the lastModified attribute of the ResourceRecord object
      Parameters:
      dateStr - The new lastModified value
      Throws:
      Exception - Description of the Exception
    • getNameFirst

      public String getNameFirst()
      Gets the nameFirst attribute of the ResourceRecord object
      Returns:
      The nameFirst value
      Throws:
      Exception - Description of the Exception
    • setNameFirst

      public void setNameFirst(String val) throws Exception
      Sets the nameFirst attribute of the ResourceRecord object
      Parameters:
      val - The new nameFirst value
      Throws:
      Exception - Description of the Exception
    • getNameLast

      public String getNameLast()
      Gets the nameLast attribute of the ResourceRecord object
      Returns:
      The nameLast value
      Throws:
      Exception - Description of the Exception
    • setNameLast

      public void setNameLast(String val) throws Exception
      Sets the nameLast attribute of the ResourceRecord object
      Parameters:
      val - The new nameLast value
      Throws:
      Exception - Description of the Exception
    • getEmailPrimary

      public String getEmailPrimary()
      Gets the emailPrimary attribute of the ResourceRecord object
      Returns:
      The emailPrimary value
      Throws:
      Exception - Description of the Exception
    • setEmailPrimary

      public void setEmailPrimary(String val) throws Exception
      Sets the emailPrimary attribute of the ResourceRecord object
      Parameters:
      val - The new emailPrimary value
      Throws:
      Exception - Description of the Exception
    • getInstName

      public String getInstName()
      Gets the instName attribute of the ResourceRecord object
      Returns:
      The instName value
      Throws:
      Exception - Description of the Exception
    • setInstName

      public void setInstName(String val) throws Exception
      Sets the instName attribute of the ResourceRecord object
      Parameters:
      val - The new instName value
      Throws:
      Exception - Description of the Exception
    • setDebug

      public static void setDebug(boolean db)
      Sets the debug attribute of the Emailer object
      Parameters:
      db - The new debug value
    • toString

      public String toString()
      Print selected fields of this object for debugging purposes
      Overrides:
      toString in class Object
      Returns:
      String representation of this ResourceRecord