<?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: Preset site and script execution in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/preset-site-and-script-execution/m-p/302314#M255444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Marcus,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The way your outlining with rules etc will work, but it will be messy because of the hardcoded names and checks etc. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Possibly an easier way is to do create a behaviour, which is what the other link was using - in its case a Behaviour that runs a script.&amp;nbsp; A behaviour allows you to effectively bind some code (or a script) to what's effectively an event in Alfresco, like Site Creation. So every time a site is created do something (or don't do something if it's not using a preset you care about).&amp;nbsp; This way you don't have to worry about rules creating your folders in places you don't want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To avoid having to hard code a list of presets that you want to run this logic for, I'd suggest that your behaviour run through something like the following logic:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On create site do:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;ol&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Get the name of the preset the site was created with&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Look in the Site Templates folder in the Data Dictionary for a folder with a name that matches the preset&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;If none found, finish - we're not interested in this site&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;If we do find a folder in Site Templates, create the document library folder if needed and then copy the Site Templates folder into the new site&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Add any permissions you're interested in to the folders you created&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Finish&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/ol&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This basically allows you to use the preset name to do a lookup for the folder template you want to use.&amp;nbsp; If you don't create a template for a preset, then its ignored and you don't do anything.&amp;nbsp; So you can only only take action for the presets you want to, but still retain flexibility for handling new presets (with new templates maybe) if you want to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I seem to remember Jeff Potts created a small add on that did something along these lines (maybe slightly differently).&amp;nbsp; It might meet your needs without you having to do the customisation yourself: &lt;/SPAN&gt;&lt;A href="https://github.com/jpotts/share-site-space-templates" rel="nofollow noopener noreferrer"&gt;https://github.com/jpotts/share-site-space-templates&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steven&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jun 2016 14:54:48 GMT</pubDate>
    <dc:creator>steven_okennedy</dc:creator>
    <dc:date>2016-06-24T14:54:48Z</dc:date>
    <item>
      <title>Preset site and script execution</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/preset-site-and-script-execution/m-p/302313#M255443</link>
      <description>Hi there,I would like to perform my preset site creation. At this moment with my apps, if you create a preset site for a customer, a rules in DocumentLibrary run a script how check if its a folder and if his name is "documentLibrary" and if the name contains "-client" (i use this marks in name, beca</description>
      <pubDate>Fri, 24 Jun 2016 09:54:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/preset-site-and-script-execution/m-p/302313#M255443</guid>
      <dc:creator>marcùss</dc:creator>
      <dc:date>2016-06-24T09:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Preset site and script execution</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/preset-site-and-script-execution/m-p/302314#M255444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Marcus,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The way your outlining with rules etc will work, but it will be messy because of the hardcoded names and checks etc. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Possibly an easier way is to do create a behaviour, which is what the other link was using - in its case a Behaviour that runs a script.&amp;nbsp; A behaviour allows you to effectively bind some code (or a script) to what's effectively an event in Alfresco, like Site Creation. So every time a site is created do something (or don't do something if it's not using a preset you care about).&amp;nbsp; This way you don't have to worry about rules creating your folders in places you don't want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To avoid having to hard code a list of presets that you want to run this logic for, I'd suggest that your behaviour run through something like the following logic:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On create site do:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;ol&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Get the name of the preset the site was created with&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Look in the Site Templates folder in the Data Dictionary for a folder with a name that matches the preset&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;If none found, finish - we're not interested in this site&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;If we do find a folder in Site Templates, create the document library folder if needed and then copy the Site Templates folder into the new site&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Add any permissions you're interested in to the folders you created&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;Finish&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/ol&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This basically allows you to use the preset name to do a lookup for the folder template you want to use.&amp;nbsp; If you don't create a template for a preset, then its ignored and you don't do anything.&amp;nbsp; So you can only only take action for the presets you want to, but still retain flexibility for handling new presets (with new templates maybe) if you want to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I seem to remember Jeff Potts created a small add on that did something along these lines (maybe slightly differently).&amp;nbsp; It might meet your needs without you having to do the customisation yourself: &lt;/SPAN&gt;&lt;A href="https://github.com/jpotts/share-site-space-templates" rel="nofollow noopener noreferrer"&gt;https://github.com/jpotts/share-site-space-templates&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steven&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 14:54:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/preset-site-and-script-execution/m-p/302314#M255444</guid>
      <dc:creator>steven_okennedy</dc:creator>
      <dc:date>2016-06-24T14:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Preset site and script execution</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/preset-site-and-script-execution/m-p/302315#M255445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Steven,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your response. With the link that you give me, i was able to setup my preset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many Thanks !&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marcus&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2016 12:04:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/preset-site-and-script-execution/m-p/302315#M255445</guid>
      <dc:creator>marcùss</dc:creator>
      <dc:date>2016-06-27T12:04:03Z</dc:date>
    </item>
  </channel>
</rss>

