Question

Am new to Alfresco, so this might be trivial, but I couldn't find the answer....

While using Alfresco Share, I will have many sites to be created. These are not known beforehand and will be done one at a time via the UI. I would like to have a standard set of 3 folders created each time I create a site. I think rules can be used for such a purpose?

Is this possible? If so, could you outline the detailed steps necessary? (New to Alfresco!)

thanks

Was it helpful?

Solution

Yes, a rule should be the starting point for this. The rule needs to be created on the Sites folder and set to "run on subfolders".

When your rule fires, it will be handed the folder that represents the site.

Sites have "containers" for the various tools used in the site which are just folders that site in the site's root folder. The container folders have a specific aspect and a component ID. Those containers get created lazily--they don't get created until the first user uses the component.

In your case, that means when you create a site, it doesn't contain a Document Library folder (it's actually named "documentLibrary") until someone uses the document library for the first time.

That means your rule will have to create the documentLibrary folder in the site folder. It needs to be named exactly like that, it needs to have the "st:siteContainer" aspect, and it needs to have st:componentId set to "documentLibrary".

Once that's done, your rule can create the standard set of folders, then you are done.

Because there is no out-of-the-box action that does what I've described, you'll use server-side JavaScript to implement this rule which just means you'll write the rule in JavaScript, upload it to Data Dictionary/Scripts, then point to it when you configure your rule.

As a side note, if your standard set of folders will change frequently, is complex, or needs to include documents (like sample content or something), you might want to use a space template and then create the documentLibrary folder based on that space template. If that sounds like overkill or isn't what you need, then forget I mentioned it and just have your rule create the three folders.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top