cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing content between sites

Andreas_L-Å
Champ on-the-rise
Champ on-the-rise

Is it possible to share a document between two or more different sites?

I know of links and smart folders, but I don't want the user to leave the site when the document is opened.

From the user's perspective, it should look like the document is in the current site.

//Andreas

1 REPLY 1

openpj
Elite Collaborator
Elite Collaborator

I never tested on Share but typically you can use the association engine of the repo to avoid duplicating contents among spaces. You could add a secondary parent to your content in order to make it visible inside two different spaces.

Adding a secondary parent in Alfresco means creating a new child-association instance between the parent folder where you want that the content will be visible and the content itself.

The unique difference with the primary parent is that removing the primary will remove in cascade all its children associated with it as primary parent. 

You could use the same cm:contains child-association definition included in the Alfresco content model or you could create a brand new child-association, for Share it is the same because you will see any child association visible as a content included in the space.

For enabling Share to change all the secondary parents you should make visible the cm:contains association inside the edit form of your folder type (that could be the default cm:folder).

Or you can simply use the JavaScript API using a similar ECMAScript code:

var querySecondaryParent = "PATH:\"/app:company_home/st:Sites/cm:YourSite/cm:documentLibrary/cm:TheSecondaryParentFolder\"";
var queryChildContentToAdd = "PATH:\"/app:company_home/childToAdd.txt\"";
var parentFolder = search.luceneSearch(querySecondaryParent); var childContent = search.luceneSearch(queryChildContentToAdd); parentFolder.addNode(childContent);

Hope this helps Smiley Wink