02-21-2011 02:46 AM
var version=doc.getVersion(args.version);
var id = version.node.id;
var requestedVersion = search.findNode("workspace://version2Store/"+id);
02-21-2011 10:28 AM
String versionLabel = "1.0";
//replace the above line with the version u want
String nodeRef="workspace://SpacesStore/83196957-6bdb-4caa-87ff-d08f773cda4a"
//replace the above line with the noderef u want
VersionHistory versionHistory = serviceRegistry.getVersionService().getVersionHistory(new NodeRef(nodeRef));
String fileName = (String)this.serviceRegistry.getNodeService().getProperty(new NodeRef(nodeRef), ContentModel.PROP_NAME);
if(null!= versionHistory){
Iterator<Version> versionIterator = versionHistory.getAllVersions().iterator();
Version version;
/*
* Frame the below url to get the contet of specific version
* http://localhost:8080/alfresco/d/d/versionStore/version2Store/551de18e-e94a-4ad1-a867-898d1adb0e22/W...
* the frozenNoderef to be used for the same to get the content of different version
*/
while(versionIterator.hasNext()){
version = versionIterator.next();
if(version.getVersionLabel().equals(versionLabel)){
versionURL = DownloadContentServlet.generateBrowserURL(version.getFrozenStateNodeRef(),fileName);
//LOGGER.debug("Frozen nodeRef:::"+version.getFrozenStateNodeRef());
LOGGER.debug("The version URL of the contetn is:::"+versionURL);
model.put(SutherlandBlmConstants.XMLRESPONSE, GetContentByVersionXML.getContentByVersion(versionURL, versionLabel , contextPath));
}
}
}
02-22-2011 04:50 PM
model.doc = doc;
and make my ftl template the same for every document requested, either original or some old version.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.