Upload
alfresco-software
View
620
Download
0
Embed Size (px)
Citation preview
Demo Data: come creare rapidamente istanze di test per Alfresco
Marco Mancuso Automation Software Engineer (DevOps)
Marco Mancuso • Currently Alfresco DevOps team • Previously…
– Alfresco Support team – Consultant/Developer for Italian Alfresco Partner
About us
Alfresco DevOps About us Keep the lights on • Public services (activiti|my.alfresco.com, Alfresco
Online Trials) • Internal infrastructure • Internal projects (QA, Engineering, Sales,
Marketing, ...) Automate all the things • Mostly inspire • Sometimes lead • Never impose
Alfresco Demo Data
Big Questions What? Why? How? Where?
What it is? Big Q
uestions
AMP
What it is NOT? Big Q
uestions
Notanimport/exporttool!Notamigra1ontool!• Nottestedagainstlargedata• Justtestedatbootstrap1me
Why Demo Data? Big Q
uestions
h&ps://www.alfresco.com/products/one/trial/online
What else?
• Quickly test customisations with limited set of predefined bootstrapped data
• Collaborative approach on data definition • Show test environments:
– Marketing – Sales – Partners – …
• Easy to use: little or NO configuration at all!
Big Questions
How does it work?
• 2 repo AMPs:
Big Questions
• Appliedtotherepoinwhichtoexportdata
• ContainsalltheAPIstoextractdata
• Appliedatbootstrap1metotherepo
• Containsallthedatatobootstrap
Users.acp
mysite.acp
myfolder.acp
…
RestAPI
Timeline Big Q
uestions
Where I can find the project?
https://github.com/alfresco/alfresco-demo-data
Big Questions
What is it possible to export & import?
• Full Share Sites (Bootstrap) • Contents in Company Home (Bootstrap)
– Models – Virtual Folders – Smart Folders – Share facets – Scripts – Webscripts – Workflows
• Authorities (Users + People + Groups) • Models (Dynamic) • Workflows (Dynamic)
General Details
AMP Structure
AMPImport Structure
AMP structure
Authorities
AMP structure
Models (standard way) L AMP structure
Models J
AMP structure
Workflows (standard way)L
AMP structure
Workflows J
AMP structure
Sites (standard way) L AMP structure
Sites J
AMP structure
Record Management site K • Treated as standard site • Problem:
– ACP does not handle well d:any objects: – rma:readers (type d:any) – rma:writers (type d:any)
• Solution: – RMSitePatch: find nodes and convert properties values from String to Map
AMP structure
Files/Folders (standard way) L AMP structure
Files/FoldersJ
AMP structure
(Model Manager) Content Models • Alfresco already provides a way to export/import them • Folders not visible from Share à NodeBrowser • Path: /app:company_home/app:dictionary/app:models
AMP structure
Export APIs
Export files/folders • Custom API • (GET) http://localhost:8080/alfresco/s/api/file-folder/export?path={path} • Optional Parameters:
• It can extract just content inside Company Home (No tags/categories) • ACP file with specified content
Export APIs
crawlSelf TRUE/FALSE Default:TRUE
crawlChildNodes TRUE/FALSE Default:TRUE
crawlContent TRUE/FALSE Default:TRUE
crawlAssociaDons TRUE/FALSE Default:TRUE
Export a Site
• (GET) http://localhost:8080/alfresco/service/api/file-folder/export?path=/Sites/{sitename}
• Admin authentication
Export APIs
Export the authorities (1/2) • Custom API • (GET) http://localhost:8080/alfresco/s/api/people-groups/export • Optional Parameters:
Export APIs
usersToExport userstoexport Default:ALL
groupsToExport groupstoexport Default:ALL
excludeSiteGroups TRUE/FALSE Default:False
groupsToExclude groupstoexclude Default:NULL
usersToExclude userstoexclude Default:NULL
Export the authorities (2/2) Export APIs
people-users-groups-export.zip
Users.acp
People.acp
Groups.json
Excluded:admin+guest
Technical Details
So… Where are the configurations? • (Generally) No configuration is required • Beans dynamically generated with:
– org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor • Resources dynamically found with:
– org.springframework.core.io.support.PathMatchingResourcePatternResolver
Technical Details
Just one single configuration bean Technical Details
Let’s run it!
Prerequisites • Alfresco Maven SDK 2.1.1 with Alfresco 5.1:
– JDK 1.8 – Maven 3.2.5 or above
Let’s run it!
How to run the SDK 1. git clone [email protected]:maoo/alfresco-demo-data.git 2. cd alfresco-demo-data 3. ./run.sh 4. Go to http://localhost:8080/share
Let’s run it!
How to create the bootstrap AMP 1. git clone [email protected]:maoo/alfresco-demo-data.git 2. cd /alfresco-demo-data/alfresco-demo-data-repo-amp 3. mvn package –DskipTests=true 4. AMP in /alfresco-demo-data/alfresco-demo-data-repo-amp/target
Let’s run it!
How to create the export AMP 1. git clone [email protected]:maoo/alfresco-demo-data.git 2. cd /alfresco-demo-data/alfresco-demo-data-exporter-repo-amp 3. mvn package –DskipTests=true 4. AMP in /alfresco-demo-data/alfresco-demo-data-exporter-repo-amp/
target
Let’s run it!
ACP Limitations • Document categories and tags • Content models with d:any properties • Node versions • Secondary parents • ACP export/import can only be used between same versions
Limitations
Questions?
Grazie! @Alfresco
Condividi su
#AlfrescoDayMilano