How to create rules, folder etc ... using amp file

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2017 11:26 AM
Hi,
I'm trying to do an automatic deployment of alfresco i've already achieve to do it with my amp files using script but i don't see how to do it with my rule ?
- I've a JS file to put un the script folder
- and i need to add a rule on a folder using this script on share
Is there an API or something else to do that on share ?
Thanks
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2017 12:16 AM
Question is no fully clear.Please rephrase it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2017 02:24 AM
Ok sorry
so i need to do a ready to use install of alfresco architecture (with custom models, folders to add, and rule on a folder)
- just launch script
- i don't want to set anything using share
my script already deploy custom models, create folders etc ... but i don't see how to "push" my js script file in "Data Dictionary/scripts/" folder and use it on another folder this is my question hope it's clear now
i find a way using SDK but i need to switch my rule from js to java that was not planned i hope there is another option ...
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2017 02:30 AM
You can bootstrap the content , in your case the file which you would like to put in data dictionary, Refer below link for more details on that.
Bootstrap content | Alfresco Documentation
I am not sure regarding rule, whether they can be applied using bootstrap or not.You can check on that.If it doesn't support than, I guess you can use patch in alfresco.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2017 09:40 AM
Yes it's exactly what i want to do thanks and it seems that it works for rules just need to acp export my folder with rule on it, I try to do what i want and i explain that step by step

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2017 03:42 PM
i have finally achieve to do what i want, an amp file to : create a new model / put a js file in the data dictionnary/scripts folder / create a folder with this rule set on it with alfresco 5.2
- First as i didn't find a way to export space i've installed a module who can import/export space in acp format : Import/Export ACP,ZIP from Share | Alfresco Add-ons - Alfresco Customizations
- I create my js file in the scripts folder, create a folder and set on it the rule i just copy
- After that i've used the export module on the scripts folder where my js file was (i've removed all other scripts because i don't need to export them ...) same for my folder with my rule on it each time i've obtained an acp files (who contains an xml and eventually few files depends what kind of stuff you export) - if you check "included selected space" you will have the folder + the content so for the rule uncheck it (we only want the file) and for the folder check it
- I was not able to directly bootstrap the acp (but several tutorials were using acp directly) so i unzip the acp and put the xml in my ide project
- I've needed to look inside each xml and correct the path of the files to reflect the path of my module
- I've updated the bootstrap-context.xml and add the bean(s) I need in my case 1 bean for the model and 1 bean for the rule & the folder
and that's it, compile it, you will have your amp file put it in amps folder in alfresco restart and enjoy ... or not if alfresco crash : in that case go in tomcat/logs/catalina.out (if you're using tomcat of course) and see the stacktrace, in my case i had as first error "Context initialization failed" then "org.alfresco.error.AlfrescoRuntimeException: Bootstrap failed" then a new error with the real problem like impossible to find this file etc ... with that you can correct the issue
bootstrap-context.xml :
//Here is my bean model
//Here is my bean for the rule and the folder
