/** * @see java.util.LinkedList#add(java.lang.Object) */ @Override public boolean add(BaseArtifactType artifact) { // Pre-set the UUIDs for all the derived artifacts. This is useful // if something downstream needs to reference them. if (StringUtils.isBlank(artifact.getUuid())) { artifact.setUuid(UUID.randomUUID().toString()); } indexArtifact(artifact); return super.add(artifact); }
/** * Process the entire schema for all derived content. * @param derivedArtifacts * @param artifact * @param schema * @param xpath * @throws XPathExpressionException */ public void processSchema(Collection<BaseArtifactType> derivedArtifacts, BaseArtifactType artifact, Element schema, XPath xpath) throws XPathExpressionException { String targetNS = schema.getAttribute("targetNamespace"); //$NON-NLS-1$ if (artifact instanceof XsdDocument) ((XsdDocument) artifact).setTargetNamespace(targetNS); processElementDeclarations(derivedArtifacts, artifact, schema, xpath); processAttributeDeclarations(derivedArtifacts, artifact, schema, xpath); processSimpleTypeDeclarations(derivedArtifacts, artifact, schema, xpath); processComplexTypeDeclarations(derivedArtifacts, artifact, schema, xpath); // Pre-set the UUIDs for all the derived artifacts. This is useful // if something downstream needs to reference them. for (BaseArtifactType derivedArtifact : derivedArtifacts) { derivedArtifact.setUuid(UUID.randomUUID().toString()); } }
/** * Adds some standard meta-data properties to the artifact instance. * @param discoveredArtifact * @param artifact */ protected void addStandardMetaData(DiscoveredArtifact discoveredArtifact, BaseArtifactType artifact) { artifact.setUuid(UUID.randomUUID().toString()); artifact.setName(discoveredArtifact.getName()); SrampModelUtils.setCustomProperty(artifact, "batch.archive-path", discoveredArtifact.getArchivePath()); //$NON-NLS-1$ if (this.context != null) { String parentUUID = (String) this.context.get(PARENT_UUID); if (parentUUID != null) SrampModelUtils.addGenericRelationship(artifact, "expandedFromDocument", parentUUID); //$NON-NLS-1$ } }
@Override public Collection<BaseArtifactType> findArtifacts(String model, String type, Map<String, String> criteria) { BaseArtifactType doc = new Document(); doc.setArtifactType(BaseArtifactEnum.DOCUMENT); doc.setName("Mock Artifact"); //$NON-NLS-1$ doc.setUuid(UUID.randomUUID().toString()); return Collections.singletonList(doc); } };
@Override public BaseArtifactType createMetaData(DiscoveredArtifact artifact) { BaseArtifactType md = new Document(); md.setUuid(UUID.randomUUID().toString()); md.setName("custom-" + artifact.getName()); //$NON-NLS-1$ return md; } });
metaData.setLastModifiedBy(propValArg); } else if ("uuid".equals(propNameArg)) { metaData.setUuid(propValArg); } else if ("createdTimestamp".equals(propNameArg)) { } else if ("lastModifiedTimestamp".equals(propNameArg)) {
artifact.setLastModifiedTimestamp(modifiedTS); artifact.setName(getProperty(jcrNode, "sramp:name")); //$NON-NLS-1$ artifact.setUuid(getProperty(jcrNode, "sramp:uuid")); //$NON-NLS-1$ artifact.setVersion(getProperty(jcrNode, "version")); //$NON-NLS-1$
srampArtifact.setUuid(UUID.randomUUID().toString()); } else {
JCRUtils tools = new JCRUtils(); if (metaData.getUuid() == null) { metaData.setUuid(UUID.randomUUID().toString());
srampArtifact.setLastModifiedTimestamp(modifiedTimestamp); srampArtifact.setName(artificerArtifact.getName()); srampArtifact.setUuid(artificerArtifact.getUuid()); srampArtifact.setVersion(artificerArtifact.getVersion());