05-13-2008 09:36 AM
05-14-2008 11:26 AM
var PROP_CONTENT = Packages.org.alfresco.model.ContentModel.PROP_CONTENT;
var versionService = null;
var nodeService = null;
function getServices( doc )
{
// *BEWARE* - HERE BE DRAGONS
var servicesField = doc.getClass().getDeclaredField( "services" );
servicesField.setAccessible( true ); // ick - yuck - nasty - but necessary
var serviceRegistry = servicesField.get( doc );
versionService = serviceRegistry.getVersionService();
nodeService = serviceRegistry.getNodeService();
}
function getHistory( doc )
{
return versionService.getVersionHistory( doc.nodeRef ).getAllVersions().toArray();
}
function getVersionSize( version )
{
return nodeService.getProperty( version.getFrozenStateNodeRef(), PROP_CONTENT ).getSize();
}
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.