/** * Constructor * * @param version Descriptor of the node version information */ public VersionHistoryNode(Version version, TemplateNode parent, ServiceRegistry services) { if (version == null) { throw new IllegalArgumentException("Version history descriptor is mandatory."); } if (parent == null) { throw new IllegalArgumentException("Parent TemplateNode is mandatory."); } if (services == null) { throw new IllegalArgumentException("The ServiceRegistry must be supplied."); } this.version = version; this.parent = parent; this.services = services; this.properties = new QNameMap<String, Serializable>(this); }
/** * Override to support clone of a QNameNodeMap object */ protected Map copyMap(Map map) { if (map instanceof QNameMap) { return (Map)((QNameMap)map).clone(); } else { return super.copyMap(map); } } }
/** * @return A map of properties for the workflow task, includes all appropriate bpm model properties. */ public Map<String, Serializable> getProperties() { if (this.properties == null) { // convert properties to a QName accessable Map with TemplateNode objects as required PropertyConverter converter = new PropertyConverter(); this.properties = new QNameMap<String, Serializable>(this); for (QName qname : this.task.properties.keySet()) { Serializable value = converter.convertProperty( this.task.properties.get(qname), qname, this.services, this.resolver); this.properties.put(qname.toString(), value); } } return this.properties; }
/** * @return All the properties known about this node. */ public Map<String, Serializable> getProperties() { if (this.propsRetrieved == false) { Map<QName, Serializable> props = this.services.getNodeService().getProperties(this.nodeRef); for (QName qname : props.keySet()) { Serializable value = this.propertyConverter.convertProperty( props.get(qname), qname, this.services, getImageResolver()); this.properties.put(qname.toString(), value); } this.propsRetrieved = true; } return this.properties; }
/** * @return All the properties known about this node. */ public Map<String, Serializable> getProperties() { if (this.propsRetrieved == false) { Map<QName, Serializable> props = this.services.getNodeService().getProperties(this.nodeRef); for (QName qname : props.keySet()) { Serializable value = this.propertyConverter.convertProperty( props.get(qname), qname, this.services, getImageResolver()); this.properties.put(qname.toString(), value); } this.propsRetrieved = true; } return this.properties; }
/** * Constructor * * @param version Descriptor of the node version information */ public VersionHistoryNode(Version version, TemplateNode parent, ServiceRegistry services) { if (version == null) { throw new IllegalArgumentException("Version history descriptor is mandatory."); } if (parent == null) { throw new IllegalArgumentException("Parent TemplateNode is mandatory."); } if (services == null) { throw new IllegalArgumentException("The ServiceRegistry must be supplied."); } this.version = version; this.parent = parent; this.services = services; this.properties = new QNameMap<String, Serializable>(this); }
/** * @return A map of properties for the workflow task, includes all appropriate bpm model properties. */ public Map<String, Serializable> getProperties() { if (this.properties == null) { // convert properties to a QName accessable Map with TemplateNode objects as required PropertyConverter converter = new PropertyConverter(); this.properties = new QNameMap<String, Serializable>(this); for (QName qname : this.task.properties.keySet()) { Serializable value = converter.convertProperty( this.task.properties.get(qname), qname, this.services, this.resolver); this.properties.put(qname.toString(), value); } } return this.properties; }
/** * Get the map containing the version property values. * * @return the map containing the version properties */ public Map<String, Serializable> getProperties() { if (propsRetrieved == false) { Map<QName, Serializable> props = parent.services.getNodeService().getProperties( this.version.getFrozenStateNodeRef()); for (QName qname : props.keySet()) { Serializable propValue = parent.new TemplatePropertyConverter().convertProperty(props.get(qname), qname, parent.services, parent.imageResolver); this.properties.put(qname.toString(), propValue); } propsRetrieved = true; } return this.properties; }
/** * Override to support clone of a QNameNodeMap object */ protected Map copyMap(Map map) { if (map instanceof QNameMap) { return (Map)((QNameMap)map).clone(); } else { return super.copyMap(map); } } }
/** * Constructor * * @param nodeRef The NodeRef this Node wrapper represents * @param services The ServiceRegistry the TemplateNode can use to access services * @param resolver Image resolver to use to retrieve icons */ public TemplateNode(NodeRef nodeRef, ServiceRegistry services, TemplateImageResolver resolver) { if (nodeRef == null) { throw new IllegalArgumentException("NodeRef must be supplied."); } if (services == null) { throw new IllegalArgumentException("The ServiceRegistry must be supplied."); } this.nodeRef = nodeRef; this.id = nodeRef.getId(); this.services = services; this.imageResolver = resolver; this.properties = new QNameMap<String, Serializable>(this); }
/** * Get the map containing the version property values. * * @return the map containing the version properties */ public Map<String, Serializable> getProperties() { if (propsRetrieved == false) { Map<QName, Serializable> props = parent.services.getNodeService().getProperties( this.version.getFrozenStateNodeRef()); for (QName qname : props.keySet()) { Serializable propValue = parent.new TemplatePropertyConverter().convertProperty(props.get(qname), qname, parent.services, parent.imageResolver); this.properties.put(qname.toString(), propValue); } propsRetrieved = true; } return this.properties; }
/** * Constructor * * @param nodeRef The NodeRef this Node wrapper represents * @param services The ServiceRegistry the TemplateNode can use to access services * @param resolver Image resolver to use to retrieve icons */ public TemplateNode(NodeRef nodeRef, ServiceRegistry services, TemplateImageResolver resolver) { if (nodeRef == null) { throw new IllegalArgumentException("NodeRef must be supplied."); } if (services == null) { throw new IllegalArgumentException("The ServiceRegistry must be supplied."); } this.nodeRef = nodeRef; this.id = nodeRef.getId(); this.services = services; this.imageResolver = resolver; this.properties = new QNameMap<String, Serializable>(this); }
/** * @return Target associations for this Node. As a Map of assoc name to a List of TemplateNodes. */ public Map<String, List<TemplateNode>> getAssocs() { if (this.targetAssocs == null) { List<AssociationRef> refs = this.services.getNodeService().getTargetAssocs(this.nodeRef, RegexQNamePattern.MATCH_ALL); this.targetAssocs = new QNameMap<String, List<TemplateNode>>(this); for (AssociationRef ref : refs) { String qname = ref.getTypeQName().toString(); List<TemplateNode> nodes = this.targetAssocs.get(qname); if (nodes == null) { // first access for the list for this qname nodes = new ArrayList<TemplateNode>(4); this.targetAssocs.put(ref.getTypeQName().toString(), nodes); } nodes.add( new TemplateNode(ref.getTargetRef(), this.services, this.imageResolver) ); } } return this.targetAssocs; }
/** * @return Source associations for this Node. As a Map of assoc name to a List of TemplateNodes. */ public Map<String, List<TemplateNode>> getSourceAssocs() { if (this.sourceAssocs == null) { List<AssociationRef> refs = this.services.getNodeService().getSourceAssocs(this.nodeRef, RegexQNamePattern.MATCH_ALL); this.sourceAssocs = new QNameMap<String, List<TemplateNode>>(this); for (AssociationRef ref : refs) { String qname = ref.getTypeQName().toString(); List<TemplateNode> nodes = this.sourceAssocs.get(qname); if (nodes == null) { // first access for the list for this qname nodes = new ArrayList<TemplateNode>(4); this.sourceAssocs.put(ref.getTypeQName().toString(), nodes); } nodes.add( new TemplateNode(ref.getSourceRef(), this.services, this.imageResolver) ); } } return this.sourceAssocs; }
/** * @return The child associations for this Node. As a Map of assoc name to a List of TemplateNodes. */ public Map<String, List<TemplateNode>> getChildAssocs() { if (this.childAssocs == null) { List<ChildAssociationRef> refs = this.services.getNodeService().getChildAssocs(this.nodeRef); this.childAssocs = new QNameMap<String, List<TemplateNode>>(this); for (ChildAssociationRef ref : refs) { String qname = ref.getTypeQName().toString(); List<TemplateNode> nodes = this.childAssocs.get(qname); if (nodes == null) { // first access for the list for this qname nodes = new ArrayList<TemplateNode>(4); this.childAssocs.put(ref.getTypeQName().toString(), nodes); } nodes.add( new TemplateNode(ref.getChildRef(), this.services, this.imageResolver) ); } } return this.childAssocs; }
/** * @return Target associations for this Node. As a Map of assoc name to a List of TemplateNodes. */ public Map<String, List<TemplateNode>> getAssocs() { if (this.targetAssocs == null) { List<AssociationRef> refs = this.services.getNodeService().getTargetAssocs(this.nodeRef, RegexQNamePattern.MATCH_ALL); this.targetAssocs = new QNameMap<String, List<TemplateNode>>(this); for (AssociationRef ref : refs) { String qname = ref.getTypeQName().toString(); List<TemplateNode> nodes = this.targetAssocs.get(qname); if (nodes == null) { // first access for the list for this qname nodes = new ArrayList<TemplateNode>(4); this.targetAssocs.put(ref.getTypeQName().toString(), nodes); } nodes.add( new TemplateNode(ref.getTargetRef(), this.services, this.imageResolver) ); } } return this.targetAssocs; }
/** * @return The child associations for this Node. As a Map of assoc name to a List of TemplateNodes. */ public Map<String, List<TemplateNode>> getChildAssocs() { if (this.childAssocs == null) { List<ChildAssociationRef> refs = this.services.getNodeService().getChildAssocs(this.nodeRef); this.childAssocs = new QNameMap<String, List<TemplateNode>>(this); for (ChildAssociationRef ref : refs) { String qname = ref.getTypeQName().toString(); List<TemplateNode> nodes = this.childAssocs.get(qname); if (nodes == null) { // first access for the list for this qname nodes = new ArrayList<TemplateNode>(4); this.childAssocs.put(ref.getTypeQName().toString(), nodes); } nodes.add( new TemplateNode(ref.getChildRef(), this.services, this.imageResolver) ); } } return this.childAssocs; }
/** * @return Source associations for this Node. As a Map of assoc name to a List of TemplateNodes. */ public Map<String, List<TemplateNode>> getSourceAssocs() { if (this.sourceAssocs == null) { List<AssociationRef> refs = this.services.getNodeService().getSourceAssocs(this.nodeRef, RegexQNamePattern.MATCH_ALL); this.sourceAssocs = new QNameMap<String, List<TemplateNode>>(this); for (AssociationRef ref : refs) { String qname = ref.getTypeQName().toString(); List<TemplateNode> nodes = this.sourceAssocs.get(qname); if (nodes == null) { // first access for the list for this qname nodes = new ArrayList<TemplateNode>(4); this.sourceAssocs.put(ref.getTypeQName().toString(), nodes); } nodes.add( new TemplateNode(ref.getSourceRef(), this.services, this.imageResolver) ); } } return this.sourceAssocs; }