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:
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.
RAMAsset newAsset = session.createAssetNewVersion(existingAsset, "1.1", statusMonitor);
LocalFolderArtfact folderArtifact = new LocalFolderArtifact("./newContent");
newAsset.setArtifactsRoot(folderArtifact);
...
session.putAssets(...);
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.)
jvax.faces.el.EvaluationException: Error getting property 'showAssetContents" from bean of type pagecode.assetDetail.GeneralDetails: NullPointerException
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.
Comments
Lin Lu
Jan 04 '13, 6:45 a.m.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.