AnsweredAssumed Answered

How to get versions of wbecontent?

Question asked by dynamolalit on Jun 24, 2011
Latest reply on Aug 1, 2011 by mitchellnickie

I want to know how can i

1. Create a versioned web content with different versions in a web project so that every time  i update content, it creates new version in web project & same is shown in properties of content? I tried like this but of little use

serviceRegistry.getAVMService().createFile(lsWebProjectPath, lsFileName).close();
Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>(2, 1.0f);
titledProps.put(ContentModel.PROP_TITLE, lsFileName);
titledProps.put(ContentModel.PROP_DESCRIPTION, lsFileName);
serviceRegistry.getNodeService().addAspect(loFileNodeRef,   ContentModel.ASPECT_TITLED, titledProps);
//Adding versionable aspect      
Map<QName, Serializable> loVersionProps = new HashMap<QName, Serializable>();
loVersionProps.put(ContentModel.ASPECT_VERSIONABLE, true);
loVersionProps.put(ContentModel.PROP_AUTO_VERSION, true);
loVersionProps.put(ContentModel.PROP_VERSION_LABEL, VersionType.MINOR);
serviceRegistry.getNodeService().addAspect(loFileNodeRef, ContentModel.ASPECT_VERSIONABLE,loVersionProps);
serviceRegistry.getAVMService().addAspect(lsFilePath, ContentModel.ASPECT_VERSIONABLE);      

2. Access all these versions in a web project?

Please help.