cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Document Library tree

lerire
Champ in-the-making
Champ in-the-making
Hi,


We would like to use Alfresco Share for an application that manage  Projects. Each time a new project is initiated, we creates a new site throught Alfresco Share. It would be great if the documentation structure keep the same for each project
So, I would like to extend document library structure when creating a new site. I know that when a new site is dreated, a new structure is created under the space "Sites". Is it possible to extend a structure under the subfolder documentLibrary in order to have a same strucutre for each Site.
I am not a good developper, and I can't find the way the source code perform the creation of the structure when clicking on create site. Is there a simple way to do this?
First time, I searched the way to create a new custom type that the user could choose in the check box of the create site form. (I have found a discussion without respons in the forum http://forums.alfresco.com/en/viewtopic.php?f=47&t=16598)


Thank you very much in advance for your ideas and your advises.
Irene
1 REPLY 1

mikeh
Star Contributor
Star Contributor
HI

There isn't one central place where the repository structure is created for each Site, as that code would have to know in advance what pages and components you're using on that site.

Instead, each time a query is made for repository data, the repo-based web script checks the return value from getContainer() and if it's null then it calls createContainer(). You can see this for the Document Library in action.lib.js, upload.post.js and parse-args.lib.js. In reality it's the latter that will get called first, as the "Recently Modified Documents" dashlet calls it.

What you'd need to do is override (or modify) those web scripts so that you then create your custom folder structure underneath the newly-created container - i.e. call createFolder() a few times, or use a copy() call. Note that you shouldn't replace the createContainer() call, as the Site Service performs a couple of other housekeeping tasks, such as adding an aspect and setting the tag scope.

Thanks,
Mike