AnsweredAssumed Answered

Java-backed webscript to change property of versioned document

Question asked by metar on Mar 25, 2014
Latest reply on Oct 19, 2015 by maheshdanaveni

I have a versioned document (1.0, 1.1, 1.2, 1.3, …) based on a custom model and I want to change properties of older versions (eg 1.1).
Well, I thought thats not a big deal but im stuck :(

I im trying to realize this with a java backed webscript.
I am able to find the corresponding NodeRef to the passed version.

When I try to set the property I get the following exception:

 java.lang.UnsupportedOperationException: This operation is not supported by a version store implementation of the node service.
   at org.alfresco.repo.version.NodeServiceImpl.setProperty(

So its not allowed to do any modifications on a "frozen" Node?
From what I read in the forums its possible to do so. But how?

here is my testcode

   //custom model
   static final String NAMESPACE = "";
   static final QName TYPE_AUTHORTY = QName.createQName(NAMESPACE, "authority");

   public void execute(WebScriptRequest req, WebScriptResponse res)
         throws IOException {

      final String nodeUuid = (String) req.getParameter("uuid");
      final String versionLabel = (String) req.getParameter("versionLabel");
      final String authority = (String) req.getParameter("authority");

      String nodePath = "workspace://SpacesStore/" + nodeUuid;

      VersionHistory versionHistory = registry.getVersionService().getVersionHistory(new NodeRef(nodePath));
      if(null!= versionHistory){

         Iterator<Version> versionIterator = versionHistory.getAllVersions().iterator();
         Version version;
            version =;
               System.out.println("Trying to change Property of version: "+versionLabel);
               NodeRef node = version.getFrozenStateNodeRef();
               registry.getNodeService().setProperty(node, TYPE_AUTHORTY, authority);

and the request

thank you