/** * Translate a textual DSpace Object type name into an event subject-type * mask. NOTE: This returns a BIT-MASK, not a numeric type value; the mask * is only used within the event system. * * @param s text name of object type. * @return numeric value of object type or 0 for error. */ public static int parseObjectType(String s) { if ("*".equals(s) || "all".equalsIgnoreCase(s)) { return ALL_OBJECTS_MASK; } else { int id = Constants.getTypeID(s.toUpperCase()); if (id >= 0) { return 1 << id; } } return 0; }
/** * Return the type of DSpaceObject in this package; it is * in the TYPE attribute of the mets:mets element. * * @return type * @throws PackageValidationException if package validation error */ @Override public int getObjectType(METSManifest manifest) throws PackageValidationException { Element mets = manifest.getMets(); String typeStr = mets.getAttributeValue("TYPE"); if (typeStr == null || typeStr.length() == 0) { throw new PackageValidationException("Manifest is missing the required mets@TYPE attribute."); } if (typeStr.startsWith("DSpace ")) { typeStr = typeStr.substring(7); } int type = Constants.getTypeID(typeStr); if (type < 0) { throw new PackageValidationException("Manifest has unrecognized value in mets@TYPE attribute: " + typeStr); } return type; }
if (Constants.getTypeID(objType) != dso.getType()) { throw new PackageValidationException( "DSpace Object referenced by handle '" + objID + "' does not correspond to the object type " +
String groupType = matcher.group(3); int objType = Constants.getTypeID(objTypeText); if (objID == null || objType == -1) { return groupName;