/** * @see org.overlord.sramp.atom.archive.expand.ArtifactFilter#setContext(org.overlord.sramp.atom.archive.expand.ZipToSrampArchiveContext) */ @Override public void setContext(ZipToSrampArchiveContext context) { syIndex = (SwitchYardAppIndex) context.get("switchyard.index"); //$NON-NLS-1$ if (syIndex == null) { File switchyardXmlFile = context.getJarEntry("META-INF/switchyard.xml"); //$NON-NLS-1$ if (switchyardXmlFile == null) { switchyardXmlFile = context.getJarEntry("WEB-INF/switchyard.xml"); //$NON-NLS-1$ } if (switchyardXmlFile != null) { syIndex = new SwitchYardAppIndex(switchyardXmlFile); context.put("switchyard.index", switchyardXmlFile); //$NON-NLS-1$ } } }
/** * 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$ } }