* </mdWrap>
* </dmdSec
*/
protected void renderDescriptiveSection() throws WingException, SAXException, CrosswalkException, IOException, SQLException
{
AttributeMap attributes;
String groupID = getGenericID("group_dmd_");
dmdSecIDS = new StringBuffer();
// Add DIM descriptive metadata if it was requested or if no metadata types
// were specified. Furthermore, since this is the default type we also use a
// faster rendering method that the crosswalk API.
if(dmdTypes.size() == 0 || dmdTypes.contains("DIM"))
{
// Metadata element's ID
String dmdID = getGenericID("dmd_");
// Keep track of all descriptive sections
dmdSecIDS.append(dmdID);
// ////////////////////////////////
// Start a new dmdSec for each crosswalk.
attributes = new AttributeMap();
attributes.put("ID", dmdID);
attributes.put("GROUPID", groupID);
startElement(METS,"dmdSec",attributes);
// ////////////////////////////////
// Start metadata wrapper
attributes = new AttributeMap();
attributes.put("MDTYPE", "OTHER");
attributes.put("OTHERMDTYPE", "DIM");
startElement(METS,"mdWrap",attributes);
// ////////////////////////////////
// Start the xml data
startElement(METS,"xmlData");
// ///////////////////////////////
// Start the DIM element
attributes = new AttributeMap();
attributes.put("dspaceType", Constants.typeText[dso.getType()]);
startElement(DIM,"dim",attributes);
// Add each field for this collection
if (dso.getType() == Constants.COLLECTION)
{
Collection collection = (Collection) dso;
String description = collection.getMetadata("introductory_text");
String description_abstract = collection.getMetadata("short_description");
String description_table = collection.getMetadata("side_bar_text");
String identifier_uri = "http://hdl.handle.net/" + collection.getHandle();
String provenance = collection.getMetadata("provenance_description");
String rights = collection.getMetadata("copyright_text");
String rights_license = collection.getMetadata("license");
String title = collection.getMetadata("name");
createField("dc","description",null,null,description);
createField("dc","description","abstract",null,description_abstract);
createField("dc","description","tableofcontents",null,description_table);
createField("dc","identifier","uri",null,identifier_uri);
createField("dc","provenance",null,null,provenance);
createField("dc","rights",null,null,rights);
createField("dc","rights","license",null,rights_license);
createField("dc","title",null,null,title);
boolean showCount = ConfigurationManager.getBooleanProperty("webui.strengths.show");
if (showCount)
{
try
{ // try to determine Collection size (i.e. # of items)
int size = new ItemCounter(this.dspaceContext).getCount(collection);
createField("dc","format","extent",null, String.valueOf(size));
}
catch (ItemCountException e)
{
throw new IOException("Could not obtain Collection item count", e);
}
}
}
else if (dso.getType() == Constants.COMMUNITY)
{
Community community = (Community) dso;
String description = community.getMetadata("introductory_text");
String description_abstract = community.getMetadata("short_description");
String description_table = community.getMetadata("side_bar_text");
String identifier_uri = "http://hdl.handle.net/" + community.getHandle();
String rights = community.getMetadata("copyright_text");
String title = community.getMetadata("name");
createField("dc","description",null,null,description);
createField("dc","description","abstract",null,description_abstract);
createField("dc","description","tableofcontents",null,description_table);
createField("dc","identifier","uri",null,identifier_uri);
createField("dc","rights",null,null,rights);
createField("dc","title",null,null,title);
boolean showCount = ConfigurationManager.getBooleanProperty("webui.strengths.show");
if (showCount)
{
try
{ // try to determine Community size (i.e. # of items)
int size = new ItemCounter(this.dspaceContext).getCount(community);
createField("dc","format","extent",null, String.valueOf(size));
}
catch (ItemCountException e)
{
throw new IOException("Could not obtain Collection item count", e);
}
}
}
// ///////////////////////////////
// End the DIM element
endElement(DIM,"dim");
// ////////////////////////////////
// End elements
endElement(METS,"xmlData");
endElement(METS,"mdWrap");
endElement(METS, "dmdSec");
}
for (String dmdType : dmdTypes)
{
// If DIM was requested then it was generated above without using
// the crosswalk API. So we can skip this one.
if ("DIM".equals(dmdType))
{
continue;
}
DisseminationCrosswalk crosswalk = getDisseminationCrosswalk(dmdType);
if (crosswalk == null)
{
continue;
}
String dmdID = getGenericID("dmd_");
// Add our id to the list.
dmdSecIDS.append(" ").append(dmdID);
// ////////////////////////////////
// Start a new dmdSec for each crosswalk.
attributes = new AttributeMap();
attributes.put("ID", dmdID);
attributes.put("GROUPID", groupID);
startElement(METS,"dmdSec",attributes);
// ////////////////////////////////
// Start metadata wrapper
attributes = new AttributeMap();
if (isDefinedMETStype(dmdType))
{
attributes.put("MDTYPE", dmdType);
}
else
{
attributes.put("MDTYPE", "OTHER");
attributes.put("OTHERMDTYPE", dmdType);
}
startElement(METS,"mdWrap",attributes);
// ////////////////////////////////
// Start the xml data