Question regarding when document revisions are created

We have some questions regarding when a new document revision is created.

It seems when we go through the document creation process using the Rhythmyx content mangement tool it seems a new document revision is only generated when the document is pushed through the final stage of the workflow and moved to the public state.

Alternatively, when we create a document using the web services API a new revision is created every time we issue a document check-in.

What we are looking to achieve is a new revision every time a user checks in the file. i.e. they can check out the file, make numerous modifications and saves, and when they check in a new revision is created.

Any insight would be greatly appreciated.

Dave

Dave,

The functionality that controls this is known as the “Revision Lock”. It can be specified programatically.

Once the revision lock is on for an item, each “check out” creates a new revision. That revision isn’t actually written into the back end until the item is saved, but the new revision happens on checkout. On Checkin, the new revision becomes the “current revision” for that item.

Items automatically get revision locked when they enter a public state. However there are other ways to make this happen (e.g. through the API). I believe that there is a way to do this via the content type definition, but I don’t see in the workbench right away.

I’ll try to get you a better answer on this (and post it here).

Dave

Dave,

We’ve done a bit more digging. As noted in your original post, you can turn on the revision lock with the API. Once you save an item with the lock flag set to “true” that item is locked forever.

It’s also possible to add the Revision Lock as a “system field” in the systemdef. While this is not a common extension point, it is legal and it will survive an upgrade.

Please note that while this technique has been around for years, we haven’t done it much lately. (The internal post I copied this from was written in 2002). We know of nothing that has changed that impacts this, but please be careful if you try this.

The file you need to modify is:

/Rhythmyx/rxconfig/Server/ContentEditors/ContentEditorSystemDef.xml

This file contains global settings for the content editor. There will be a node for <PSXFieldSet> with a group of <PSXField> elements. Add a new one at the end of the list.


     <PSXField name="sys_revisionlock" showInSummary="yes" showInPreview="yes" forceBinary="no">
          <DataLocator>
             <PSXBackEndColumn id="1002">
                <tableAlias>CONTENTSTATUS</tableAlias>
                <column>REVISIONLOCK</column>
                <columnAlias>REVISIONLOCK</columnAlias>
             </PSXBackEndColumn>               
          </DataLocator>
          <DefaultValue>
             <DataLocator>
                <PSXTextLiteral id="0">
                   <text>Y</text>
                </PSXTextLiteral>
             </DataLocator>
          </DefaultValue>          
          <OccurrenceSettings dimension="optional" multiValuedType="delimited" delimiter=";"/>
          <FieldRules>
             <PSXVisibilityRules dataHiding="xsl">
                <PSXRule boolean="and">
                   <PSXConditional id="0">
                      <variable>
                         <PSXTextLiteral id="0">
                            <text>1</text>
                         </PSXTextLiteral>
                      </variable>
                      <operator>=</operator>
                      <value>
                         <PSXTextLiteral id="0">
                            <text>2</text>
                         </PSXTextLiteral>
                      </value>
                      <boolean>AND</boolean>
                   </PSXConditional>
                </PSXRule>
             </PSXVisibilityRules>
          </FieldRules>       
       </PSXField>


Under the add the following tag:


        <PSXDisplayMapping>
             <FieldRef>sys_revisionlock</FieldRef>
             <PSXUISet name="" defaultSet="">
                <Label>
                   <PSXDisplayText/>
                </Label>
                <PSXControlRef name="sys_HiddenInput"/>
             </PSXUISet>
         </PSXDisplayMapping>

Of course, it’s possible that you will not want to have this turned on for all content types. In this case, remove the <DefaultValue> from the <PSXField> in the System Def, and add a default value for this field in each Content Type.

You will need to restart the Rhythmyx server after you make these changes.

Dave