cancel
Showing results for 
Search instead for 
Did you mean: 

Standard folder structure for sites..

szumbusch
Champ in-the-making
Champ in-the-making
Hi there,

I'm kind of new in the Alfresco universe, so please forgive me, if I ask silly questions…

I would like to configure the system in a way that when I create a new site, there will be a predefined folder structure in the document library.

Additionally I would like to add certain permissions to some of the folders based on groups.

I searched for days now to find out how to do this. But I seem to be stupid somehow… I didn't find something.

Could you please direct me to documents, blogs, files, etc. where this is described?

I would be very thankful for that.

Thanks in advance a happy holidays,

Sascha
3 REPLIES 3

migu
Champ in-the-making
Champ in-the-making
Bumping thread.

Hey!

I've got similar problem as szumbusch, but without the need of giving permissions. I just want to have predefined document structure created every time I add new site.

Thanks in advance

adrien
Champ in-the-making
Champ in-the-making
Hi,

Two easy solutions.

Here a code to create a folder structure. U can create a rule on Sites folder to execute on new content.

if (document.isContainer && document.type == "{http://www.alfresco.org/model/site/1.0}site")
{
   var site = siteService.getSite(document.name);
   var documentLibrary;

   if (site.hasContainer("documentLibrary")) {
      documentLibrary = site.getContainer("documentLibrary");
   }
   else {
      documentLibrary = site.createContainer("documentLibrary");
   }


   var Folder1 = documentLibrary.createFolder('Folder1');

   var subfolder1= Folder1.createFolder('subfolder1');
      subfolder1.createFolder('Maths')
      subfolder1.createFolder('French')

   var subfolder2 = Folder1.createFolder('Notes');
}

For rights :
var site = siteService.getSite(document.name);
site.setMembership("GROUP_Etudiants", "SiteCollaborator");

U can also create a site's template that u copy at each new site.

migu
Champ in-the-making
Champ in-the-making
Thank you very much Adrien! Works perfectly Smiley Happy

Another question comes up now:

Is there possibility, to upload premade documents to folder structure? E.x. I'd like to add few blank docs to newly created site, which would be available for users to download.