on 12-23-2004 11:23 AM
Hi guys,
Just a very quick question for you.
Environment:
6.0.7.0.0.Enterprise_Portal_Support_Package_7
6.0.6.2.0.ContentManagementAndCollaboration
6.0.6.2.0. ContentManagementAndCollaboration
We'd like to get version history from a KM resource and delete, from this history, the version n-1.
Is it possible to do this via APIs?
We have tried with remove method of IVersionHistory interface but seems that nothing happens.
Do you have any suggestion or code snippets in order to perform this action?
Many many thanks in adavance
Merry Xmas to all
Cheers
Hi,
you should be able to delete any version, unless (I think) it's the checked-in/checked-out version. In any case, either the version should be deleted, or an exception should be thrown.
Maybe you could provide more details (sample code and layout of the version history before the delete attempt?).
Best regards, Julian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i'm working with Roberto.
This is the code that i'm using.
I make a check if it's active the versioning and i get the Version History.
As you can see in the code, in the ListHistory i delete version n-1 but the details of resource have not been modified.
movedResource.checkOut();
p = aCollection.getProperty PropertyName.createEnhancedCollection());
aVersion = p.getBooleanValue();
if (aVersion) {
// TODO Delete Version n-1
String no_vers = (String) common.get("NOT_CREATE_VERSION");
IVersionHistory ListHistory;
IResource b;
if ("X".equalsIgnoreCase(no_vers)) {
ListHistory = movedResource.getVersionHistory();
b = ListHistory.get(ListHistory.size() - 2);
ListHistory.remove(b);
}
aContent = movedResource.getContent();
IPropertyMap propMap = movedResource.getProperties();
movedResource.checkIn(aContent, propMap, true);
Best regards, Fabio
Hi,
1) Removing something from an IResourceList doesn't affect the underlying store. You'll have to apply <b>delete()</b> to the version itself.
2) What are you doing with the "Enhanced Collection" stuff here? The reliable way to find out whether something is version-controlled is simply to call <b>IResource.isVersioned()</b>...
Best regards, Julian
Well, <b>isVersioned()</b> is supposed to work; and if it doesn't that's a bug. Relying on "enhanced collection" is a bad idea because it's a different concept which may not even exist on all repository managers.
Please re-check that <b>isVersioned()</b> applied to the resource itself (<i>not</i> it's parent collection) really doesn't return the correct information. If this is the case, please open a support case.
Best regards, Julian
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.