Package org.dlese.dpc.suggest.resource
Class ResourceRecord
java.lang.Object
org.dlese.dpc.suggest.SuggestionRecord
org.dlese.dpc.suggest.resource.ResourceRecord
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
ConstructorsConstructorDescriptionResourceRecord(org.dom4j.Document doc, SchemaHelper schemaHelper) Constructor - creates a new ResourceRecord but doesn't assign an id -
Method Summary
Modifier and TypeMethodDescriptionSets the creation date for this ResourceRecord.Gets the description attribute of the ResourceRecord objectGets the emailPrimary attribute of the ResourceRecord objectString[]we want to collect all the gradeRange Values and return them as an Arrayreturn a pretty-printed list of gradeRanges as a stringGets the instName attribute of the ResourceRecord objectGets the lastModified attribute of the ResourceRecord objectGets the nameFirst attribute of the ResourceRecord objectGets the nameLast attribute of the ResourceRecord objectgetTitle()Gets the title attribute of the ResourceRecord objectgetUrl()Gets the url attribute of the ResourceRecord objectvoidsetCreationDate(String dateStr) writes a String representaton of the date to both contributor and metaMetadata/dateInfo nodes.static voidsetDebug(boolean db) Sets the debug attribute of the Emailer objectvoidsetDescription(String val) Sets the description attribute of the ResourceRecord objectvoidsetEmailPrimary(String val) Sets the emailPrimary attribute of the ResourceRecord objectvoidsetGradeRanges(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 onesvoidsetInstName(String val) Sets the instName attribute of the ResourceRecord objectvoidsetLastModified(String dateStr) Sets the lastModified attribute of the ResourceRecord objectvoidsetNameFirst(String val) Sets the nameFirst attribute of the ResourceRecord objectvoidsetNameLast(String val) Sets the nameLast attribute of the ResourceRecord objectvoidSets the title attribute of the ResourceRecord objectvoidSets the url attribute of the ResourceRecord objecttoString()Print selected fields of this object for debugging purposesMethods inherited from class org.dlese.dpc.suggest.SuggestionRecord
get, getDoc, getDocMap, put
-
Constructor Details
-
ResourceRecord
Constructor - creates a new ResourceRecord but doesn't assign an id- Parameters:
doc-Document
-
-
Method Details
-
getTitle
Gets the title attribute of the ResourceRecord object- Returns:
- The title value
- Throws:
Exception- Description of the Exception
-
setTitle
Sets the title attribute of the ResourceRecord object- Parameters:
val- The new title value- Throws:
Exception- Description of the Exception
-
getUrl
Gets the url attribute of the ResourceRecord object- Returns:
- The url value
- Throws:
Exception- Description of the Exception
-
setUrl
Sets the url attribute of the ResourceRecord object- Parameters:
val- The new url value- Throws:
Exception- Description of the Exception
-
getDescription
Gets the description attribute of the ResourceRecord object- Returns:
- The description value
- Throws:
Exception- Description of the Exception
-
setDescription
Sets the description attribute of the ResourceRecord object- Parameters:
val- The new description value- Throws:
Exception- Description of the Exception
-
getGradeRanges
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
return a pretty-printed list of gradeRanges as a string- Returns:
- The gradeRangesDisplay value
- Throws:
Exception- Description of the Exception
-
setGradeRanges
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
Sets the creation date for this ResourceRecord. MetaMetadata/dateInfo and contributor elements should have same date value (since they are set together - seesetCreationDate(java.lang.String)we use metaMetadata/dateInfo here- Returns:
- The creationDate value
- Throws:
Exception- Description of the Exception
-
setCreationDate
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
Gets the lastModified attribute of the ResourceRecord object- Returns:
- The lastModified value
- Throws:
Exception- Description of the Exception
-
setLastModified
Sets the lastModified attribute of the ResourceRecord object- Parameters:
dateStr- The new lastModified value- Throws:
Exception- Description of the Exception
-
getNameFirst
Gets the nameFirst attribute of the ResourceRecord object- Returns:
- The nameFirst value
- Throws:
Exception- Description of the Exception
-
setNameFirst
Sets the nameFirst attribute of the ResourceRecord object- Parameters:
val- The new nameFirst value- Throws:
Exception- Description of the Exception
-
getNameLast
Gets the nameLast attribute of the ResourceRecord object- Returns:
- The nameLast value
- Throws:
Exception- Description of the Exception
-
setNameLast
Sets the nameLast attribute of the ResourceRecord object- Parameters:
val- The new nameLast value- Throws:
Exception- Description of the Exception
-
getEmailPrimary
Gets the emailPrimary attribute of the ResourceRecord object- Returns:
- The emailPrimary value
- Throws:
Exception- Description of the Exception
-
setEmailPrimary
Sets the emailPrimary attribute of the ResourceRecord object- Parameters:
val- The new emailPrimary value- Throws:
Exception- Description of the Exception
-
getInstName
Gets the instName attribute of the ResourceRecord object- Returns:
- The instName value
- Throws:
Exception- Description of the Exception
-
setInstName
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
Print selected fields of this object for debugging purposes
-