DLESE Tools
v1.6.0

org.dlese.dpc.suggest.resource
Class ResourceRecord

java.lang.Object
  extended by org.dlese.dpc.suggest.SuggestionRecord
      extended by 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
ResourceRecord(Document doc, SchemaHelper schemaHelper)
          Constructor - creates a new ResourceRecord but doesn't assign an id
 
Method Summary
 String getCreationDate()
          Sets the creation date for this ResourceRecord.
 String getDescription()
          Gets the description attribute of the ResourceRecord object
 String getEmailPrimary()
          Gets the emailPrimary attribute of the ResourceRecord object
 String[] getGradeRanges()
          we want to collect all the gradeRange Values and return them as an Array
 String getGradeRangesDisplay()
          return a pretty-printed list of gradeRanges as a string
 String getInstName()
          Gets the instName attribute of the ResourceRecord object
 String getLastModified()
          Gets the lastModified attribute of the ResourceRecord object
 String getNameFirst()
          Gets the nameFirst attribute of the ResourceRecord object
 String getNameLast()
          Gets the nameLast attribute of the ResourceRecord object
 String getTitle()
          Gets the title attribute of the ResourceRecord object
 String getUrl()
          Gets the url attribute of the ResourceRecord object
 void setCreationDate(String dateStr)
          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 setDescription(String val)
          Sets the description attribute of the ResourceRecord object
 void setEmailPrimary(String val)
          Sets the emailPrimary attribute of the ResourceRecord object
 void setGradeRanges(String[] vals)
          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 setInstName(String val)
          Sets the instName attribute of the ResourceRecord object
 void setLastModified(String dateStr)
          Sets the lastModified attribute of the ResourceRecord object
 void setNameFirst(String val)
          Sets the nameFirst attribute of the ResourceRecord object
 void setNameLast(String val)
          Sets the nameLast attribute of the ResourceRecord object
 void setTitle(String val)
          Sets the title attribute of the ResourceRecord object
 void setUrl(String val)
          Sets the url attribute of the ResourceRecord object
 String toString()
          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 Detail

ResourceRecord

public ResourceRecord(Document doc,
                      SchemaHelper schemaHelper)
Constructor - creates a new ResourceRecord but doesn't assign an id

Parameters:
doc - Document
Method Detail

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

DLESE Tools
v1.6.0