cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic versioning for documents

galdes
Champ in-the-making
Champ in-the-making
Hello all,

I'm new to Alfresco. I have been googling and testing but cannot work out how to set documents to a state of automatic versioning. I have set 'spaces' to auto versioning = yes but the contents of those spaces still are non-versioning until manually set otherwise.

Is it possible to have all items by versioning=yes by default. I intend to use alfresco without the web interface so this is a must for us. By 'items' i mean files and sub-folders.

Thanks in advance.

-Andrew G
14 REPLIES 14

dmatejka
Champ in-the-making
Champ in-the-making
Hi Andrew,

I think the easiest way to do this is to set up a RULE.

= Go to the space
= Manage content rule
= Create rule
= Select condition (here you cen put "all items" to set up versioning for all files and subfolders)
= Select action - Add aspect to item
= Set Action values - versionable
= then set up the detials - type inbound , name e.g. set verioning, CHECK apply rule tu sub spaces (if you want to)
= FINISH

from now on all the files put into the space are going to be versioned automatically

see:
http://wiki.alfresco.com/wiki/Client_Manage_Content_Rules
http://wiki.alfresco.com/wiki/Version_Aspect

best regards

Daniel

galdes
Champ in-the-making
Champ in-the-making
Thanks Daniel,

Worked well!

Cheers,
-Andrew G

vivi
Champ in-the-making
Champ in-the-making
Hello,

Is there a way to activate the auto versioning from the configuration files?

Thanks,
Vivi

janv
Employee
Employee
Although not generally recommended (or formally supported), it is possible to modify the underlying Alfresco Content Model. Refer to:

http://wiki.alfresco.com/wiki/Versioning_Behaviour
http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Modifying_an_Alfresco_Content_Model

Regards,
Jan

mruflin
Champ in-the-making
Champ in-the-making
Attention: Setting the versionable aspect as mandatory on cm:content should only be done when you start with a fresh repository. This change will only affect newly created content, you would therefore end up with files that don't have the aspect, which then results in repository integrity issues (you won't be able to change nor delete such files afterwards). The repository could be fixed though by creating a rule that adds the versionable aspect and let it then run over the complete repository to make sure that really all files have that mandatory aspect.

I would strongly recommend not to modify the content model but use a rule instead.

skwong
Champ in-the-making
Champ in-the-making
Hi,

As mentioned by mruflin, it seems like existing documents in the folders can be added with aspect using rules. It can be done when updating each document's details manually. Can I apply rule to add aspect into all the existing documents within a folder?  Please help.
Thanks

dmatejka
Champ in-the-making
Champ in-the-making
Hi,
there is a "Reapply rules in space"  under MORE ACTIONS when you list the rules applied to the space.

Go to:
- space
- more actions
- manage content rules
- more actions
- Reapply rules in space

So maybe for your needs you should create the rule in a root directory and run the "Reapply rules in space and Children"

hope it helps

skwong
Champ in-the-making
Champ in-the-making
Hi Daniel,

Creating rules at the root space will add the rules to all the sub-spaces. Then, I have to browse into the space that contain the documents and click on reapply rules. Though it does not complete with one click, but I am glad that I don't have to apply to thousand of documents. With your suggestion, I just have to apply the rule at a few hundreds of spaces.  Smiley Very Happy
Thank you so much

xerox
Champ in-the-making
Champ in-the-making
You could write a script that go trough all those documents.
execute the following script in the top space
setVersioning(space);

function setVersioning(curNode)
{
  if (curNode.isContainer)
  
   {   
  
    var children = curNode.children;
           for (var i=0; i<children.length; i++)
           {
                       setVersioning(children[i]);
         }   
  
  
   }
   if(curNode.isDocument)
   {
   if (!curNode.hasAspect("cm:versionable")){
   var test = curNode.addAspect("cm:versionable");
   logger.log(curNode.name + test);
   }
   }
}

This is a lot faster than clicking all those spacesSmiley Happy

Friendly regards,
Nick