<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sharing content between sites in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/sharing-content-between-sites/m-p/130727#M35309</link>
    <description>&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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).&lt;/P&gt;
&lt;P&gt;Or you can simply use the JavaScript API using a similar ECMAScript code:&lt;/P&gt;
&lt;PRE&gt;var querySecondaryParent = "PATH:\"/app:company_home/st:Sites/cm:YourSite/cm:documentLibrary/cm:TheSecondaryParentFolder\"";
var queryChildContentToAdd = "PATH:\"/app:company_home/childToAdd.txt\"";&lt;BR /&gt;
var parentFolder = search.luceneSearch(querySecondaryParent);
var childContent = search.luceneSearch(queryChildContentToAdd);

parentFolder.addNode(childContent);&lt;/PRE&gt;
&lt;P&gt;Hope this helps&amp;nbsp;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Oct 2023 08:44:31 GMT</pubDate>
    <dc:creator>openpj</dc:creator>
    <dc:date>2023-10-03T08:44:31Z</dc:date>
    <item>
      <title>Sharing content between sites</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sharing-content-between-sites/m-p/130726#M35308</link>
      <description>&lt;P&gt;Is it possible to share a document between two or more different sites?&lt;/P&gt;&lt;P&gt;I know of links and smart folders, but I don't want the user to leave the site when the document is opened.&lt;/P&gt;&lt;P&gt;From the user's perspective, it should look like the document is in the current site.&lt;/P&gt;&lt;P&gt;//Andreas&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 12:04:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sharing-content-between-sites/m-p/130726#M35308</guid>
      <dc:creator>Andreas_L-Å</dc:creator>
      <dc:date>2023-09-29T12:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sharing content between sites</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sharing-content-between-sites/m-p/130727#M35309</link>
      <description>&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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).&lt;/P&gt;
&lt;P&gt;Or you can simply use the JavaScript API using a similar ECMAScript code:&lt;/P&gt;
&lt;PRE&gt;var querySecondaryParent = "PATH:\"/app:company_home/st:Sites/cm:YourSite/cm:documentLibrary/cm:TheSecondaryParentFolder\"";
var queryChildContentToAdd = "PATH:\"/app:company_home/childToAdd.txt\"";&lt;BR /&gt;
var parentFolder = search.luceneSearch(querySecondaryParent);
var childContent = search.luceneSearch(queryChildContentToAdd);

parentFolder.addNode(childContent);&lt;/PRE&gt;
&lt;P&gt;Hope this helps&amp;nbsp;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 08:44:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sharing-content-between-sites/m-p/130727#M35309</guid>
      <dc:creator>openpj</dc:creator>
      <dc:date>2023-10-03T08:44:31Z</dc:date>
    </item>
  </channel>
</rss>

