protected long getVersion(Document doc, String prop) { Object propVal = doc.getPropertyValue(prop); if (propVal instanceof Long) { return ((Long) propVal).longValue(); } else { return 0; } }
@Override public Serializable getPropertyValue(String name) { if (isPropertyForProxy(name)) { return proxy.getPropertyValue(name); } else { return target.getPropertyValue(name); } }
/** * Checks if principal is creator of document. * * @param doc * @param principal * @return true if principal is creator of document * @throws DocumentException */ protected boolean isCreator(Document doc, Principal principal) throws DocumentException { String creator = (String) doc.getPropertyValue("dc:creator"); return StringUtils.equals(principal.getName(), creator); }
protected Object getDataModelField(DocumentRef docRef, String schema, String field) { Document doc = resolveReference(docRef); if (doc != null) { checkPermission(doc, READ); Schema docSchema = doc.getType().getSchema(schema); if (docSchema != null) { String prefix = docSchema.getNamespace().prefix; if (prefix != null && prefix.length() > 0) { field = prefix + ':' + field; } return doc.getPropertyValue(field); } else { log.warn("Cannot find schema with name=" + schema); } } else { log.warn("Cannot resolve docRef=" + docRef); } return null; }
} catch (PropertyNotFoundException e) { try { value = doc.getPropertyValue(xpath); } catch (PropertyNotFoundException e2) { allClausesMatch = false;
try { boolean shareable = BooleanUtils.isTrue((Boolean) doc.getPropertyValue(ModelConstants.UNUM_XPATH_SHAREABLE_PROP)); if (shareable) {
final Long majorVer = (Long) doc.getPropertyValue("major_version"); final Long minorVer = (Long) doc.getPropertyValue("minor_version"); if (majorVer != null || minorVer != null) { options.put(VersioningDocument.CURRENT_DOCUMENT_MAJOR_VERSION_KEY, majorVer);