cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a new Site Type

krdto
Champ in-the-making
Champ in-the-making
I'd like to create a custom Site Type in Alfresco Share (yes, like the project site type in the Blue Fish webcast), but I can't seem to find any documentation on how to do this. Maybe I'm just not looking in the right places.

If anyone could point me in the right direction, I'd be most grateful.
7 REPLIES 7

richard_im
Champ in-the-making
Champ in-the-making
Since Share is a Surf application, it helps to get started by looking at the surf developers guide: http://wiki.alfresco.com/wiki/Surf_Platform_-_Developers_Guide

From there, have a look at Kevin Roast's blog on dashlets and page types: http://blogs.alfresco.com/wp/kevinr/2010/01/28/alfresco-share-33-extensions-and-springsurf/

Unfortunately, I am not aware of how to introduce a new site-type, in which the above two resource adds to the new 'site' you are creating.  But, there is a great reference implementation of this: The RM Module.
Since Shares collaboration site doesn't lend itself the appropriate functional requirements for records management, RM is implemented as a new Site Type and has it's own services tier in the Repository.

Good Luck!

krdto
Champ in-the-making
Champ in-the-making
Thanks! I took a look at the Surf Platform Developers Guide, and I'm sure an experienced developer would find it great, but for someone who is just looking for a way to customize a few elements in Alfresco, it's way to complex.

So, I decided to figure out how to do it:

The elements in the Site Type pulldown box on the Create Site page is generated by an array called in create-site.get.js (which you'll find in the share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules directory). The array definition looks like this:

var sitePresets = [{id: "site-dashboard", name: msg.get("title.collaborationSite")}]

The id refers to a site definition in an XML file, and title.collaborationSite refers to the title text defined in create-site.get.properties. Say you want to add a new Site Type called "Project Site". Change the definition of sitePresets to this:

var sitePresets = [{id: "site-dashboard", name: msg.get("title.collaborationSite")},{id: "project-site-dashboard", name: msg.get("title.projectSite")}];

Now edit create-site.get.properties (found in the same directory) and add a line defining the title text for the new Site Type:

title.projectSite=Project Site

Make sure that the line is added to any localized properties files as well.

Finally, you'll have to create the actual site definition. Edit presets.xml (in the share/WEB-INF/classes/alfresco/site-data/presets folder). Copy the entire definition that starts with the line "<preset id="site-dashboard"> and down to the corresponding </preset> tag, and change the id to "project-site-dashboard" (or whatever you want to call your site definition). You can then customize the default site dashboard layout by changing the component definitions.

Restart Alfresco, and your new Site Type will be available in the Create Site dialog.

richard_im
Champ in-the-making
Champ in-the-making
That's great news.  I also came across this during a mild search effort right now: http://forums.alfresco.com/en/viewtopic.php?f=47&t=22174&p=74482

Just be sure to test the lifecycle of what functional requirements you're trying to fulfill.  In this case, Share is using the Repository as a data repository.

rpalf
Champ in-the-making
Champ in-the-making
I have managed to create a new Site Type making use of the abovementioned notes. I have also create a new space template which should be used when creating the new site. The new site gets created but it does not use the space template at all. Any idea how to resolve this?

ebogaard
Champ on-the-rise
Champ on-the-rise
Has anybody found a solution to the automatic creation of a folder (and rights) structure when creating a new site?
I can't find anything about this, but would very much like to use this kind of automation, because I work a lot with projects.

zaizi
Champ in-the-making
Champ in-the-making
Yes. Register behaviour to check site type on NodeCreate of Sites. If it's your site type, set up the structure required or import content, etc.

Ainga

ebogaard
Champ on-the-rise
Champ on-the-rise
Thanks for your answer.

The problem is that I'm not a developer (when I see some simple code, I can understand how things work, though), and I can't find the right file(s) with this code.
So if you can give me some more details, I'd be very happy.