cancel
Showing results for 
Search instead for 
Did you mean: 

Folder Versioning

robain
Champ in-the-making
Champ in-the-making
Is it possible to make folders versionable? seemed like it is possible but the version label on the details page does not get updated when I change the attributes.  anyone can help me with details on this. how do i display the version history on FOLDER details page the same way as in the DOCUMENTS attributes detail page.

I am doing this using webservice api, seems like thats the problem. Do i have to checkout and checkin to create a new version when using this api or how does it work.

Thanks
Robain.
12 REPLIES 12

pmonks
Star Contributor
Star Contributor
The DM repository doesn't support "structural" versioning (versioning of folders, filenames, file locations etc.), although the AVM repository (the repository used by the WCM functionality) does.

Cheers,
Peter

robain
Champ in-the-making
Champ in-the-making
Thanks for the reply. how about the attributes set on the folder, are those versioned in DM ?

Thanks
Robain

pmonks
Star Contributor
Star Contributor
Folders are not versioned at all in the DM repository - you can only enable versioning for files (and for files, properties are versioned along with the content).

Cheers,
Peter

robain
Champ in-the-making
Champ in-the-making
Thanks again.

Lets back track a little. DM vs WCM whats the difference as far as the alfresco instance is concerned ?  how do i know which one is being used for a given instance of alfresco?

I am running alfresco 2.1. Here, I have extended the general folder content model and have added the couple of attributes which I was expecting would be versioned once the versionable aspect is added to that folder. I am using a webservice client and calling "WebServiceFactory.getAuthoringService().createVersion(predicate, comments, false);" to create the version, as I update the attributes on the folder. The details page correctly shows increasing version label after each update but dont have a view of the hitory list as in the case of documents. Does it still mean there is no versioning being done even though the version label attribute is correctly incremented ?

Thanks
Robain.

hpalma
Champ in-the-making
Champ in-the-making
Have you found a way to achieve this ?
I'm looking for the same thing.

tommorris
Champ in-the-making
Champ in-the-making
I think for what robain was trying to achieve, the DM will always use the simple versioning repository (the ADM) not the repository used by WCM WebProjects (the AVM).

If you're trying to model a document / content management solution you would normally choose the ADM.
If you're trying to manage and control the creation of content destined for a web-site you would use the AVM by using Alfresco's WCM features.

So, for the ADM:
a Content-Type model (with metadata properties, inheritance etc.),
Rule triggers (on update / addition / deletion),
Behaviours,
Aspects,
Workflows,
Associations,
Actions,
Access control,
simple document versioning (no folder versioning)

Use the AVM for:
If you want to build and deploy websites,
content modelling is done using XML/XSDs of the content nodes themselves,
Workflows,
Aspects (through XML meta-data extraction),
an Advanced versioning model (branching, merging, folder versioning, etc),
Sandboxed editorial environments,
Access control (not quite as granular as the ADM… I think),
Preview services,
Link Validation,
advanced remote Deployment features,
Web-forms (XSD/template separation of content from presentation)

There is potential for a bit of a hybrid approach too….

Does that help a bit?

robain
Champ in-the-making
Champ in-the-making
Thanks for the post. clears things a bit. So how do I switch between those two ADM and AVM or atleast find out what it is that i am running on?

thanks
robain

tommorris
Champ in-the-making
Champ in-the-making
Really, you can't just "switch". 

If you're manipulating content underneath "Company Home", then you're using the ADM and always will be.
If you have installed the additional WCM bundle on top of your existing Alfresco DM installation, and you're adding content using sandboxes managed by Alfresco 'Web Projects', then you're using the AVM and always will be.

There's a distinctly different design paradigm adopted by Alfresco depending upon the task you're trying to achieve.
The AVM repository is generally only used for WCM projects.

Interestingly, the ability to richly model content in the ADM is used to model the meta-data needed to manage web-content.
What I mean by this, is that the ADM models things like Web Forms (find the folder in "Data Dictionary") and Web Projects (site name, DNS name, deployment servers etc - which can be found in Company Home/Web Projects); But the web-content itself (XML containing web-form content, any Web-Form rendition, or arbitrary HTML pages, JPGs, JS, CSS etc) is stored in the AVM.

These Web-Project / Web-Form objects held in the ADM, are only visible when you've installed the WCM package.
If you can't see these objects (for example a space named "Web Project" in the root of "Company Home"), then you probably haven't installed WCM and hence will only ever be using the ADM.

Tom.

robain
Champ in-the-making
Champ in-the-making
Alright heres what i did
created a custom folder content type with new attribute extending the basic folder type

<type name="someco:folder">
   <title>Article Catalog</title>
   <description />
   <parent>cm:folder</parent>
   <properties>
      <property name="someco:label">
         <type>d:text</type>
         <mandatory>false</mandatory>
         <multiple>false</multiple>
      </property>
   </properties>
   <mandatory-aspects>
      <aspect>cm:versionable</aspect>
   </mandatory-aspects>
</type>

no i ran webservice client to create and update the folder (in the company home - so this should be in the ADM and not in the AVM)
something to the effect of

//parent folder, new folder, label for the new folder
createFolder("/", "Test Folder", "TEsting 1");
for(int i = 0 ; i < 10; i ++) {
//same parameters here.
   updateFolder("/", "Test Folder", "TEsting"+i);
}

now i ran another piece of code to iterate the versions.

NodeRef nodeRef = new NodeRef(nodeId);
VersionHistory history = versionService.getVersionHistory(nodeRef);
final Collection<Version> versions = history.getAllVersions();

QName labelQName = QName.createQName("http://www.someco.com/model/content/1.0','label");

for(Version version: versions) {
   NodeRef versionNodeRef = version.getFrozenStateNodeRef();
   String label = nodeService.getProperty(versionNodeRef,labelQName).toString();
   System.out.println(version.getVersionLabel());
   System.out.println(label);
}

this is the output that i get
1.10
TEsting9
1.9
TEsting8
1.8
TEsting7
1.7
TEsting6
1.6
TEsting5
1.5
TEsting4
1.4
TEsting3
1.3
TEsting2
1.2
TEsting1
1.1
TEsting0
1.0
TEsting 1

so isnt this saving the versions of that folder. or am i missing something fundamental here ?

thanks
robain