Summit2014 topic 0153 - Alfresco Maven for shared properties
-
Upload
angel-borroy -
Category
Technology
-
view
162 -
download
1
Transcript of Summit2014 topic 0153 - Alfresco Maven for shared properties
![Page 1: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/1.jpg)
![Page 2: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/2.jpg)
From Venus to Mars
Developer land
Real world
![Page 3: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/3.jpg)
Maven Alfresco SDK is fun! -Pamp-to-war
Alfresco AMP Archetype
Share AMP Archetype
![Page 4: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/4.jpg)
What about deployments?
Real world has environments…!!!
… and integrated systems!
TEST PRE PRO
TEST PRE PRO
![Page 5: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/5.jpg)
REPO SHARE!!!!!!
TEST + PRE + PRO!
Properties everywhere
INT
1 INT
2 INT
3 INT
1 INT
2 INT
3
![Page 6: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/6.jpg)
Shared properties REPO SHARE!
![Page 7: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/7.jpg)
Alfresco Repo properties
alfresco-global.properties!!• Packaging this file inside AMP module !• Or including new entries in Alfresco
shared folder original file!
No possibility to configure it by environment
![Page 8: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/8.jpg)
Alfresco Share properties • No visibility for resources in shared
alfresco-global.properties !• Custom properties files or custom
messages files!
No possibility to configure it by environment No possibility to share props with repo
![Page 9: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/9.jpg)
TEST
PRE
PRO
Our approach Maven Alfresco SDK to the rescue
profiles
properties-maven-plugin
maven-antrun-plugin
TEST
PRE
PRO
TEST
PRE
PRO
AMP!
![Page 10: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/10.jpg)
TEST
PRE
PRO
Our approach Maven Alfresco SDK to the rescue
profiles
properties-maven-plugin
maven-antrun-plugin
TEST
PRE
PRO
TEST
PRE
PRO
AMP!
![Page 11: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/11.jpg)
Properties files
external.system.url=test.external-system.com
conf/test.alfresco-amp.properties
external.system.url=pre.external-system.com
conf/pre.alfresco-amp.properties
external.system.url=external-system.com
conf/pro.alfresco-amp.properties
TEST
PRE
PRO
![Page 12: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/12.jpg)
pom.xml - environments <profiles>
<profile>
<id>test</id>
<properties><env>test</env></properties>
</profile>
<profile>
<id>pre</id>
<properties><env>pre</env></properties>
</profile>
<profile>
<id>pro</id>
<properties><env>pro</env></properties>
</profile>
</profiles>
![Page 13: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/13.jpg)
pom.xml – properties plugin <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<configuration>
<files>
<file>${user.dir}/conf/${env}.alfresco-amp.properties</file>
</files>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals><goal>read-project-properties</goal></goals>
</execution>
</executions>
</plugin>
![Page 14: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/14.jpg)
pom.xml – AntRun plugin <plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals><goal>run</goal></goals>
<configuration>
<tasks>
<copy todir="${dist}/${env}/amps" failonerror="false">
<fileset dir="${basedir}/target”><include name="*.amp"/>
</fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin> Repo + Share!
![Page 15: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/15.jpg)
<bean id="externalConnection"
class="es.keensoft.alfresco.ExternalConnection”>
<property name="url" value="${external.system.url}" />
</bean>
Using values !!!!… or by message property injection!
amp/config/alfresco/module/service-context.xml
![Page 16: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/16.jpg)
Packaging !!AMPs for TEST environment available at!• dist/test/amps!• dist/test/amps_share!
$ mvn clean package -Ptest
AMP!
![Page 17: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/17.jpg)
Real life A sample on where it can be useful
eSignature service Server signature Client signature Verification
![Page 18: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/18.jpg)
Real life A sample on where it can be useful
eSignature service Server signature Client signature Verification
![Page 19: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/19.jpg)
# Server signature
url.SignatureServer=http://preservicios3.aragon.es/asf/services/
SignatureServer
# Verification
url.PolicyManager=http://preservicios3.aragon.es/asf/services/
PolicyManager
# Client signature
url.websigner=https://preservicios3.aragon.es/firma/js/WS.js
Properties
conf/pre.alfresco-ast.properties
![Page 20: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/20.jpg)
Use case AMP Repo!<bean id="asfSignatureSystem” class="es.aragon.ast.alfresco.sign.impl.external.ASFSignatureSystem" > <property name="asfUrlSignatureServer" value="${asf.url.SignatureServer}" /> <property name="asfUrlPolicyManager" value="${asf.url.PolicyManager}" /></bean>
!AMP Share!<ast:getCAs policyManagerUrl="${asf.url.PolicyManager}" app="${asf.app}" />
!
![Page 21: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/21.jpg)
Final marks • Using additional maven plugins to
extend Maven Alfresco SDK functionalities!
• Ready to deploy AMPs are produced by environment!
• Version organization can be added to store each distributed AMP!
![Page 22: Summit2014 topic 0153 - Alfresco Maven for shared properties](https://reader034.fdocuments.net/reader034/viewer/2022042715/55a25ab41a28ab79138b46ad/html5/thumbnails/22.jpg)
Resources
GitHub"http://github.com/keensoft Twitter @AngelBorroy Blog http://www.keensoft.es/blog