dbUtil.rollbackTransaction();
}
}
private void addMetadateInFolder(ThesisMetadata thesisMetadata, Folder thesisFolder) {
EtdmsMetadata etdmsMetadata = thesisMetadata.getEtdmsMetadata();
Metadata metadata = new MetadataImpl(thesisFolder);
metadata.setName(NodesTypes.ETDMS_PREFIX + NodesTypes.ETDMS_METADATA_NAME);
Element rootElement = new DefaultElementImpl(metadata, null);
rootElement.setName("etdms:thesis");
List etdmsElements = new ArrayList();
for (Iterator it = etdmsMetadata.getTitles().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:title", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getCreators().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:creator", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getSubjects().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:subject", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getDescriptions().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:description", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getPublishers().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:publisher", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getContributors().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:contributor", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getDates().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:date", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getTypes().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:type", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getFormats().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:format", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getIdentifiers().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:identifier", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getLanguages().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:language", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getCoverages().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:coverage", value, metadata, rootElement);
etdmsElements.add(element);
}
for (Iterator it = etdmsMetadata.getRights().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:rights", value, metadata, rootElement);
etdmsElements.add(element);
}
Element degreeElement = new DefaultElementImpl(metadata, rootElement);
degreeElement.setName("etdms:degree");
List degreeElements = new ArrayList();
for (Iterator it = etdmsMetadata.getDegreeElement().getNames().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:name", value, metadata, rootElement);
degreeElements.add(element);
}
for (Iterator it = etdmsMetadata.getDegreeElement().getLevels().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:level", value, metadata, rootElement);
degreeElements.add(element);
}
for (Iterator it = etdmsMetadata.getDegreeElement().getDisciplines().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:discipline", value, metadata, rootElement);
degreeElements.add(element);
}
for (Iterator it = etdmsMetadata.getDegreeElement().getGrantors().iterator(); it.hasNext(); ) {
String value = (String) it.next();
if (value == null || value.trim().equals("")) {
continue;
}
Element element = ConversionUtil.createValueElement("etdms:grantor", value, metadata, rootElement);