Attributes attrs) throws SAXException {
if (namespaceURI.equalsIgnoreCase(BATCH_MODIFY.uri)
&& localName.equalsIgnoreCase("addObject")) {
addObject = false;
m_obj = new DigitalObject();
// Get required attributes
m_obj.pid = attrs.getValue("pid");
m_obj.label = attrs.getValue("label");
m_obj.logMessage = attrs.getValue("logMessage");
try {
if (m_obj.label.equals("")) {
failedCount++;
logFailedDirective(m_obj.pid,
localName,
null,
"Object Label must be non-empty.");
return;
}
if (!m_obj.pid.equals("")) {
if (m_obj.pid.indexOf(":") < 1) {
failedCount++;
logFailedDirective(m_obj.pid,
localName,
null,
"Custom PID should be of the form \"namespace:1234\"");
return;
}
}
addObject = true;
} catch (Exception e) {
failedCount++;
logFailedDirective(m_obj.pid, localName, e, "");
}
} else if (namespaceURI.equalsIgnoreCase(BATCH_MODIFY.uri)
&& localName.equalsIgnoreCase("modifyObject")) {
modifyObject = false;
m_obj = new DigitalObject();
// Get required attributes
m_obj.pid = attrs.getValue("pid");
m_obj.logMessage = attrs.getValue("logMessage");
try {
if (!m_obj.pid.equals("")) {
if (m_obj.pid.indexOf(":") < 1) {
failedCount++;
logFailedDirective(m_obj.pid,
localName,
null,
"Custom PID should be of the form \"namespace:1234\"");
return;
}
}
// Get optional attributes
if (attrs.getValue("label") != null) {
m_obj.label = attrs.getValue("label");
} else {
m_obj.label = null;
}
if (attrs.getValue("state") != null) {
m_obj.state = attrs.getValue("state");
} else {
m_obj.state = null;
}
if (attrs.getValue("ownerId") != null) {
m_obj.ownerId = attrs.getValue("ownerId");
} else {
m_obj.ownerId = null;
}
modifyObject = true;
} catch (Exception e) {
failedCount++;
logFailedDirective(m_obj.pid, localName, e, "");
}
} else if (namespaceURI.equalsIgnoreCase(BATCH_MODIFY.uri)
&& localName.equalsIgnoreCase("purgeObject")) {
purgeObject = false;
m_obj = new DigitalObject();
// Get required attributes
m_obj.pid = attrs.getValue("pid");
m_obj.logMessage = attrs.getValue("logMessage");