RAMClient: Creating new version contains bad content
Currently, I am using the RAM Client against a v7.2.0.2 server. I am attempting to do the following:
The existingAsset is "1.0" and has one file: testv1.pdf. The newAsset has one or more files in "./newContent" none of them are testv1.pdf. This code is successful as a new asset v1.1 is created with all of the expected attributes and categories. However, when I look at the content of v1.1, there is also a testv1.pdf. When I click on testv1.pdf from the web client, I get the following: "Artifact testv1.pdf not found in asset "Test Asset" version 1.0" If I try to go to the General Details for v1.1, I get an exception: (Unfortunately, this is on another system so I don't have the full trace.) Why does the newAsset.setArtifactsRoot(folderArtifact); not remove all of the existing content from the cloned asset? Essentially, I want to create a new version of the asset and keep all attributes and categories, but wipe out the entire contents. |
2 answers
What about:
FolderArtifact root = newAsset.getArtifactsRoot(); Comments
Lin Lu
commented Jan 05 '13, 10:12 p.m.
Hi Gili,
|
Here is a another way to remove all artifacts in asset, maybe not that effective.
RAMFolderArtifact root = (RAMFolderArtifact) newAsset.getArtifactsRoot(); for(Artifact art:root.getChildren()){ root.removeArtifact(art); } |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Hi,
when newAsset.setArtifactsRoot(folderArtifact) called it will copy some info including artifactes from old version asset to new. I think the problem you met it's a defect we have fixed in ram's later release.