public static void copyTags(Registry registry, String newPath, String path) throws RegistryException { Tag[] tags = registry.getTags(path); for (Tag tag : tags) { registry.applyTag(newPath, tag.getTagName()); } }
@Override public Set<Tag> getAllTags(String appType, String appId) throws AppManagementException { Set<Tag> tagSet = new HashSet<>(); try { org.wso2.carbon.registry.core.Tag[] tags = null; PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(this.username); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(this.tenantDomain, true); GenericArtifactManager artifactManager = AppManagerUtil.getArtifactManager(registry, appType); GenericArtifact appArtifact = artifactManager.getGenericArtifact(appId); if (appArtifact != null) { String artifactPath = appArtifact.getPath(); tags = registry.getTags(artifactPath); for(org.wso2.carbon.registry.core.Tag tag : tags){ tagSet.add(new Tag(tag.getTagName())); } } else { handleResourceNotFoundException("Failed to get " + appType + " artifact corresponding to artifactId " + appId + ". Artifact does not exist"); } } catch (RegistryException e) { handleException("Error occurred while retrieving tags from " + appType +" with id : " + appId, e); } finally { PrivilegedCarbonContext.endTenantFlow(); } return tagSet; }
org.wso2.carbon.registry.core.Tag[] tag = registry.getTags(artifactPath); for (org.wso2.carbon.registry.core.Tag tag1 : tag) { tags.add(tag1.getTagName());
org.wso2.carbon.registry.core.Tag[] tag = registry.getTags(artifactPath); for (Tag tag1 : tag) { tags.add(tag1.getTagName());
org.wso2.carbon.registry.core.Tag[] tag = registry.getTags(artifactPath); for (org.wso2.carbon.registry.core.Tag tag1 : tag) { tags.add(tag1.getTagName());
org.wso2.carbon.registry.core.Tag[] tag = registry.getTags(artifactPath); for (Tag tag1 : tag) { tags.add(tag1.getTagName());
org.wso2.carbon.registry.core.Tag[] tag = registry.getTags(artifactPath); for (Tag tag1 : tag) { tags.add(tag1.getTagName());
GenericArtifact updateApiArtifact = AppManagerUtil.createAPIArtifactContent(artifact, api); String artifactPath = GovernanceUtils.getArtifactPath(registry, updateApiArtifact.getId()); org.wso2.carbon.registry.core.Tag[] oldTags = registry.getTags(artifactPath); if (oldTags != null) { for (org.wso2.carbon.registry.core.Tag tag : oldTags) {