cancel
Showing results for 
Search instead for 
Did you mean: 

Need to alter versioning behavior

fromano
Champ in-the-making
Champ in-the-making
Hi,

I've noticed that Alfresco Community 5.0.d treats a document MIMEtype transformation as a document change and increments the version # when a transformation occurs (such as changing from .docx to .pdf).

However, while I need to be able to allow versioning for all other document changes, I can NOT allow versioning based upon MIMEtype tranformation.

Can anyone walk me through how to stop MIME-type change version updates?
Thanks,
Frank
4 REPLIES 4

angelborroy
Community Manager Community Manager
Community Manager
You can disable versioning globally http://docs.alfresco.com/5.0/tasks/autoversion-disable.html

There is no ootb mechanism to disable versioning only for transformations. So you should extend VersionService and include your logic overriding createVersion methods.

Notice that once this customization is performed, user can't go back to DOCX format from PDF format any more.
Hyland Developer Evangelist

fromano
Champ in-the-making
Champ in-the-making
Thank you, Angel.  I've discovered how to disable versioning globally and locally.  However, I require versioning, except when changing the file type.  I found the information below in the wiki.  If I knew the location of the file in which to copy the excludedOnUpdateProps AND the name of the version increment property (is it ver:Name, ver:Increment??), I believe I'd have my solution.  Where would I modify/insert this bean? Can you help me with these specifics?

"If you want to configure auto-versioning on property-only updates (as above) but you also want to configure the repository so that certain property updates are excluded then the versionable aspect can be overridden with a list of excluded properties (in prefix:localname format).

   <bean id="versionableAspect" class="org.alfresco.repo.version.VersionableAspect" init-method="init">
       <property name="policyComponent">
           <ref bean="policyComponent" />
       </property>
       <property name="versionService">
           <ref bean="versionService"/>
       </property>
       <property name="nodeService">
           <ref bean="nodeService"/>
       </property>
       <property name="dictionaryDAO">
           <ref bean="dictionaryDAO"/>
       </property>
       <property name="namespacePrefixResolver">
           <ref bean="namespaceService"/>
       </property>
       <property name="excludedOnUpdateProps">
           <list>
               <value>webdavSmiley Surprisedpaquelocktoken</value>
               <value>webdav:sharedLockTokens</value>
               <value>webdav:lockDepth</value>
               <value>webdav:lockScope</value>
           </list>
       </property>
   </bean>

Frank

brunos10
Champ in-the-making
Champ in-the-making

Hi, just to add here a little update for version 5.2 of Alfresco (the version I'm working on), as I was searching also how to change the version behavior of nodes, in order to overlook properties that we may choose.

If you override now the versionableAspect bean that way you get an exception whenever versionable operations take place. I took a "little" time to find the solution. You need to add also:

<property name='lockService'>

   <ref bean='lockService'/>

</property>

Insert that bean on a customized service-context.xml file, and the new behavior should work.

Bruno

fromano
Champ in-the-making
Champ in-the-making
OK, only half of the post posted.  I'll add the other half as an attachment to this post.
Also, my boss wants me to have the answer by tomorrow morning, as this is the only thing stopping us from using Alfresco as a major solution.
My thanks again,
Frank