protected void setProperties(Map<QName, Serializable> byQname) { for (QName qname : byQname.keySet()) { Serializable value = byQname.get(qname); properties.put(qname.toString(), value); } }
/** * Constructor */ public AspectMissingException(QName missingAspect, NodeRef nodeRef) { super(MessageFormat.format(ERROR_MESSAGE, new Object[]{missingAspect.toString(), nodeRef.getId()})); this.missingAspect = missingAspect; this.nodeRef = nodeRef; }
/** * Create a new Node of the specified type as a child of this node. * * @param name Name of the node to create (can be null for a node without a 'cm:name' property) * @param type QName type (fully qualified or short form such as 'cm:content') * * @return Newly created Node or null if failed to create. */ public ScriptNode createNode(String name, String type) { return createNode(name, type, null, ContentModel.ASSOC_CONTAINS.toString()); }
/** * @return Returns the type. */ public String getType() { return getQNameType().toString(); }
/** * @return Returns the type. */ public String getType() { return getQNameType().toString(); }
/** * Given a short-form QName string, this method returns the fully qualified QName string. * * @param s Short form QName string, e.g. "cm:content" * @return Fully qualified QName string */ public String longQName(String s) { return createQName(s).toString(); }
/** * Given a QName this method returns the long-form String with the braces * escaped. */ private String getLongNameWithEscapedBraces(QName qn) { String longName = qn.toString(); String escapedBraces = longName.replace("{", "\\{").replace("}", "\\}"); return escapedBraces; }
@Override public Event prepareEvent(String user, String networkId, String transactionId) { return new ActivityEvent("favorite.added", transactionId, networkId, user, finalRef, null, nodeType==null?null:nodeType.toString(), Client.asType(ClientType.script), null, name, null, 0l, null); } });
@Override public Event prepareEvent(String user, String networkId, String transactionId) { return new ActivityEvent("favorite.added", transactionId, networkId, user, finalRef, null, nodeType==null?null:nodeType.toString(), Client.asType(ClientType.script), null, name, null, 0l, null); } });
@Override public Event prepareEvent(String user, String networkId, String transactionId) { return new ActivityEvent("favorite.removed", transactionId, networkId, user, finalRef, null, nodeType==null?null:nodeType.toString(), Client.asType(ClientType.script), null, null, null, 0l, null); } });
@Override public Event prepareEvent(String user, String networkId, String transactionId) { return new ActivityEvent("quickshare", transactionId, networkId, user, nodeRef.getId(), null, typeQName.toString(), Client.asType(ClientType.webclient), sb.toString(), null, null, 0l, null); } });
public void onRestoreNode(ChildAssociationRef childAssocRef) { if (logger.isDebugEnabled()) { logger.debug( "Restore node rule trigger fired for parent node " + this.nodeService.getType(childAssocRef.getParentRef()).toString() + " " + childAssocRef.getParentRef() + " and child node " + this.nodeService.getType(childAssocRef.getChildRef()).toString() + " " + childAssocRef.getChildRef()); } triggerRules(childAssocRef.getParentRef(), childAssocRef.getChildRef()); }
public void onRestoreNode(ChildAssociationRef childAssocRef) { if (logger.isDebugEnabled()) { logger.debug( "Restore node rule trigger fired for parent node " + this.nodeService.getType(childAssocRef.getParentRef()).toString() + " " + childAssocRef.getParentRef() + " and child node " + this.nodeService.getType(childAssocRef.getChildRef()).toString() + " " + childAssocRef.getChildRef()); } triggerRules(childAssocRef.getParentRef(), childAssocRef.getChildRef()); }
/** * @deprecated Uses search and does not report on ephemeral locks. */ @Deprecated public List<NodeRef> getLocks(StoreRef storeRef, LockType lockType) { return getLocks( storeRef, "ASPECT:\"" + ContentModel.ASPECT_LOCKABLE.toString() + "\" +@\\{http\\://www.alfresco.org/model/content/1.0\\}" + ContentModel.PROP_LOCK_OWNER.getLocalName() + ":\"" + getUserName() + "\"" + " +@\\{http\\://www.alfresco.org/model/content/1.0\\}" + ContentModel.PROP_LOCK_TYPE.getLocalName() + ":\"" + lockType.toString() + "\""); }
private void updateTagProperty() { Serializable tags = this.services.getNodeService().getProperty(this.nodeRef, ContentModel.PROP_TAGS); if (this.properties != null) { this.properties.put(ContentModel.PROP_TAGS.toString(), getValueConverter().convertValueForScript(ContentModel.PROP_TAGS, tags)); } }
private void updateTagProperty() { Serializable tags = this.services.getNodeService().getProperty(this.nodeRef, ContentModel.PROP_TAGS); if (this.properties != null) { this.properties.put(ContentModel.PROP_TAGS.toString(), getValueConverter().convertValueForScript(ContentModel.PROP_TAGS, tags)); } }
/** * @return download URL to the content */ public String getUrl() { return MessageFormat.format(CONTENT_PROP_URL, new Object[] { nodeRef.getStoreRef().getProtocol(), nodeRef.getStoreRef().getIdentifier(), nodeRef.getId(), URLEncoder.encode(getName()), URLEncoder.encode(property.toString()) }); }
private PermissionDefinition createPermissionDefinition(PermissionReference pr) { PermissionDefinitionDataImpl permission = new PermissionDefinitionDataImpl(); permission.setId(pr.getQName().toString() + "." + pr.getName()); permission.setDescription(permission.getId()); return permission; }
private PermissionDefinition createPermissionDefinition(PermissionReference pr) { PermissionDefinitionDataImpl permission = new PermissionDefinitionDataImpl(); permission.setId(pr.getQName().toString() + "." + pr.getName()); permission.setDescription(permission.getId()); return permission; }
private String buildPropUrl(String pformat) { return MessageFormat.format(pformat, new Object[] { getNodeRef().getStoreRef().getProtocol(), getNodeRef().getStoreRef().getIdentifier(), getNodeRef().getId(), URLEncoder.encode(getName()), URLEncoder.encode(property.toString()) } ); }