cancel
Showing results for 
Search instead for 
Did you mean: 

Versionable aspect vs. versions

konsultex
Confirmed Champ
Confirmed Champ
I'm developing some business logic for an Alfresco 3.4d installation and I'm having a problem with the versionable aspect regarding the number of versions created.

For testing I have a space with no local nor inherited rules. If I load a document into that space it goes in and no versions are created. In the document detailed view the Alfresco Explorer offers to "Allow Versioning". This is the behaviour I expect.

In that space I added just one rule for all incoming items that adds the versionable aspect to the document. If I load a document into the space when I open the detailed view I see version 1.0 and version 1.1. I was expecting just version 1.0. If I checkout this document into the space and go into the detailed view of the checked out Working Copy I see just version 1.0 which is what I expect.

My question is why do I get two versions for the original document loaded into this space?

Thanks.
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
Are you using the Explorer client or Share to add your document? I'm noticing that for the same folder with a rule that adds the versionable aspect, the behavior is different between the two clients. When I add a document via Explorer, the document shows up as 1.1. When I add a document via Share, the document shows up as 1.0.

I suspect this has to do with how the Explorer client creates objects first and then sets metadata. For example, if you go into a folder that doesn't have the add-versionable rule and upload a document, then click "allow versioning", then change a property, the version increments to 1.1. All of that is effectively happening when you add a document to the repo via Explorer.

Jeff

konsultex
Confirmed Champ
Confirmed Champ
Jeff,

Thanks for the input. My problem would be a lot easier if I got just version 1.0 this way.

I'm doing this in Alfresco Web Explorer.

The problem I'm solving is to rename the document according to the version number set in Alfresco so that for example file.odt coming in becomes file_A00.odt. If the user creates a new major version it's changed to file_B00.odt (a new minor version would be file_A01.odt) and so forth. In the end I fiddled a lot with the versionable rule and my script. I now have the rule off and I do all the versioning in my script code. This script ends up setting the autoVersion property to true so that an initial document update works as expected. My script runs for incoming files and updated files.

It seems to work reliably except for a problem I noticed and haven't solved yet. Right after the document goes in and gets renamed if I check it out and the check it in again from the same space, a new version is created but the rule is not fired so the document is not renamed. If I check it in from another file the script runs. If I do this after I update the file it also runs fine. In other words, there seems to be something that gets cleared after creation of the first version after 1.0. Maybe  yy script needs to set something else. It adds the versionable aspect with initial version and auto version false and at the end sets auto version on. Do you have a suggestion? Is this a versioning bug?

Thanks.