From d36f8c00a3e35bb616188d1c189be20234f56244 Mon Sep 17 00:00:00 2001 From: mindthegab Date: Sat, 3 Nov 2012 09:37:52 +0000 Subject: [PATCH] Experimental / trunk switch - Part 3 - Copying of experimental branch to trunk git-svn-id: http://maven-alfresco-archetypes.googlecode.com/svn/trunk@624 04253f4f-3451-0410-a141-5562f1e59037 --- alfresco-lifecycle-aggregator/DOCS.txt | 252 ++++ alfresco-lifecycle-aggregator/README.txt | 199 +++ alfresco-lifecycle-aggregator/TODO.txt | 42 + .../alfresco-allinone-archetype/pom.xml | 18 + .../META-INF/maven/archetype-metadata.xml | 154 +++ .../resources/archetype-resources/README.txt | 128 ++ .../archetype-resources/alfresco/pom.xml | 87 ++ .../local/alfresco-global.properties | 308 +++++ .../alfresco/extension/dev-log4j.properties | 2 + .../src/main/resources/log4j.properties | 265 ++++ .../webapp/WEB-INF/faces-config-custom.xml | 33 + .../alfresco/src/main/webapp/WEB-INF/web.xml | 911 ++++++++++++++ .../archetype-resources/amp/jetty/jetty.xml | 16 + .../resources/archetype-resources/amp/pom.xml | 37 + .../module/amp/context/service-context.xml | 34 + .../alfresco/module/amp/module-context.xml | 25 + .../amp/src/main/amp/module.properties | 47 + .../amp/src/main/amp/web/css/demoamp.css | 16 + .../amp/src/main/amp/web/jsp/demoamp.jsp | 16 + .../main/amp/web/licenses/README-licenses.txt | 2 + .../amp/src/main/amp/web/scripts/demoamp.js | 16 + .../main/java/org/alfresco/demoamp/Demo.java | 15 + .../org/alfresco/demoamp/DemoComponent.java | 26 + .../local/alfresco-global.properties | 57 + .../src/test/resources/test-log4j.properties | 23 + .../resources/archetype-resources/pom.xml | 66 + .../runner/jetty/jetty.xml | 34 + .../runner/jetty/root-web.xml | 10 + .../archetype-resources/runner/pom.xml | 72 ++ .../archetype-resources/share/pom.xml | 64 + .../properties/local/application.properties | 8 + ...m-slingshot-application-context.xml.sample | 112 ++ .../share-config-custom.xml.sample | 346 +++++ .../share/src/main/resources/log4j.properties | 262 ++++ .../src/main/webapp/WEB-INF/web.xml.sample | 167 +++ .../archetype-resources/solr/pom.xml | 148 +++ .../solr/src/main/resources/log4j.properties | 18 + .../solr-properties/archive/solrconfig.xml | 1108 +++++++++++++++++ .../archive/solrcore.properties | 83 ++ .../solr-properties/workspace/solrconfig.xml | 1108 +++++++++++++++++ .../workspace/solrcore.properties | 103 ++ .../solr/src/main/webapp/WEB-INF/web.xml | 175 +++ .../archetype-resources/wcmqs/pom.xml | 42 + .../wcmqs/src/main/resources/log4j.xml | 55 + .../archetypes/alfresco-amp-archetype/pom.xml | 19 + .../META-INF/maven/archetype-metadata.xml | 73 ++ .../resources/archetype-resources/README.txt | 123 ++ .../archetype-resources/jetty/jetty.xml | 16 + .../resources/archetype-resources/pom.xml | 85 ++ .../context/service-context.xml | 35 + .../module/__artifactId__/log4j.properties | 40 + .../module/__artifactId__/module-context.xml | 24 + .../src/main/amp/log4j.properties | 4 + .../src/main/amp/module.properties | 48 + .../src/main/amp/web/css/demoamp.css | 16 + .../src/main/amp/web/jsp/demoamp.jsp | 19 + .../main/amp/web/licenses/README-licenses.txt | 2 + .../src/main/amp/web/scripts/demoamp.js | 16 + .../main/java/org/alfresco/demoamp/Demo.java | 38 + .../org/alfresco/demoamp/DemoComponent.java | 85 ++ .../demoamp/test/DemoComponentTest.java | 77 ++ .../local/alfresco-global.properties | 59 + .../src/test/resources/log4j.properties | 266 ++++ .../projects/basic/archetype.properties | 8 + .../test/resources/projects/basic/goal.txt | 0 .../plugins/alfresco-maven-plugin/README.txt | 100 ++ .../plugins/alfresco-maven-plugin/ROADMAP.txt | 22 + .../plugins/alfresco-maven-plugin/pom.xml | 91 ++ .../org/alfresco/maven/plugin/AmpModel.java | 16 + .../org/alfresco/maven/plugin/AmpMojo.java | 243 ++++ .../alfresco/maven/plugin/InstallMojo.java | 150 +++ .../alfresco/maven/plugin/VersionMojo.java | 113 ++ .../maven/plugin/archiver/AmpArchiver.java | 47 + .../maven/plugin/archiver/AmpUnArchiver.java | 65 + .../resources/META-INF/maven/lifecycle.xml | 27 + .../resources/META-INF/plexus/components.xml | 61 + .../src/site/apt/usage.apt.vm | 36 + .../alfresco-maven-plugin/src/site/site.xml | 59 + alfresco-lifecycle-aggregator/pom.xml | 128 ++ .../poms/alfresco-sdk-parent/pom.xml | 640 ++++++++++ 80 files changed, 9561 insertions(+) create mode 100644 alfresco-lifecycle-aggregator/DOCS.txt create mode 100644 alfresco-lifecycle-aggregator/README.txt create mode 100644 alfresco-lifecycle-aggregator/TODO.txt create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/pom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/README.txt create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/pom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/properties/local/alfresco-global.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/resources/alfresco/extension/dev-log4j.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/resources/log4j.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/webapp/WEB-INF/faces-config-custom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/webapp/WEB-INF/web.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/jetty/jetty.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/pom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/config/alfresco/module/amp/context/service-context.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/config/alfresco/module/amp/module-context.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/module.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/css/demoamp.css create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/jsp/demoamp.jsp create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/licenses/README-licenses.txt create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/scripts/demoamp.js create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/java/org/alfresco/demoamp/Demo.java create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/java/org/alfresco/demoamp/DemoComponent.java create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/test/properties/local/alfresco-global.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/test/resources/test-log4j.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/jetty/jetty.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/jetty/root-web.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/pom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/pom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/properties/local/application.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/alfresco/web-extension/custom-slingshot-application-context.xml.sample create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/alfresco/web-extension/share-config-custom.xml.sample create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/log4j.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/webapp/WEB-INF/web.xml.sample create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/pom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/resources/log4j.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/archive/solrconfig.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/archive/solrcore.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/workspace/solrconfig.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/workspace/solrcore.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/webapp/WEB-INF/web.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/wcmqs/pom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/wcmqs/src/main/resources/log4j.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/pom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/README.txt create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/jetty/jetty.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/pom.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/context/service-context.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/log4j.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/module-context.xml create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/log4j.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/module.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/css/demoamp.css create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/jsp/demoamp.jsp create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/licenses/README-licenses.txt create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/scripts/demoamp.js create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/Demo.java create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/DemoComponent.java create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/java/org/alfresco/demoamp/test/DemoComponentTest.java create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/properties/local/alfresco-global.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/test/resources/projects/basic/archetype.properties create mode 100644 alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/test/resources/projects/basic/goal.txt create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/README.txt create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/ROADMAP.txt create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/pom.xml create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AmpModel.java create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AmpMojo.java create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/InstallMojo.java create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/VersionMojo.java create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/archiver/AmpArchiver.java create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/archiver/AmpUnArchiver.java create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/resources/META-INF/maven/lifecycle.xml create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/resources/META-INF/plexus/components.xml create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/site/apt/usage.apt.vm create mode 100644 alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/site/site.xml create mode 100644 alfresco-lifecycle-aggregator/pom.xml create mode 100644 alfresco-lifecycle-aggregator/poms/alfresco-sdk-parent/pom.xml diff --git a/alfresco-lifecycle-aggregator/DOCS.txt b/alfresco-lifecycle-aggregator/DOCS.txt new file mode 100644 index 00000000..76da7370 --- /dev/null +++ b/alfresco-lifecycle-aggregator/DOCS.txt @@ -0,0 +1,252 @@ +This document needs updating... + +********************************** +Disclaimer for maven-alfresco list +********************************** + +This codebase is currently work in progress; the effort have been split in three directions: +a) The definition of 2 POM files that can handle versions and common build behaviors/features +b) The writing of an alfresco-maven-plugin to enable amp-to-war overlay provided by Alfresco +Repository built-in features (ModuleManagementTool) and replace the maven-amp-plugin (big +rewriting of the maven-war-plugin) +c) The definition of (initially 2) archetypes that show some simple project's configuration using +the parent POMs + +Most of the build features have been successfully ported to a new structure, whose main advantage is +to keep pom.xml files extremely simple and readable (since a lot of logic have been moved to the parent). +Inherited behaviours are configurable simply defining specific properties in the project's or module's pom.xml +(see documentation below). + +Here follows a list of build features that have not been ported yet: +- Maven SCM and release +- JBoss run +- Tomcat remote deployment +- Jetty Java source and resources reloading (Jetty currently runs .war files) +- Maven Site generation +- Maven reporting +- Maven distributionManagement + +Apart from SCM and release, all the mentioned features are probably best suited for a more enterprise archetype, +using the Alfresco Web Integration POM as parent and adding more build features around Maven, Tomcat and JBoss. + +****************** +Alfresco Maven SDK +****************** + +The Maven SDK is an effort that have been developing in the last 5 years - mostly driven by community efforts on +Google Code (http://code.google.com/p/maven-alfresco-archetypes) - which delivers archetypes for building Alfresco +integration project with Maven; builds are based on artifacts that are deployed into maven.alfresco.com Repository +manually as a community effort. + +The main advantages with the (currently official) Alfresco SDK follows: + +- IDE-independent SDK, use IntelliJ, eMacs or any other IDE sto write your code + +- No IDE manual configuration, all build-related features are provided by Apache Maven, which is the only +prerequisite to use this SDK + +- Language independent, you don't like Maven? You can still use Ant, Ivy, Buildr, Gradle, Leiningen or any other build +system that is compatible with Maven artifact resolution mechanism; just configure maven.alfresco.com as (one of) your +Maven repositories and you're ready to go + +- Javadoc and Sources support, provided by maven.alfresco.com related Maven artifacts; you don't need to manually +configure your IDE to attach (manually downloaded) sources to your (manually downloaded) binaries. + +- Clean and readable, the build logic related with OOTB Alfresco features is wrapped in 50 lines of pom.xml + +- Advanced build functionality, inherited by your parent POMs you can use embedded databases and j2ee +containers with (almost) no configuration at all, among other features exposed below. + +- One mvn command to generate, one mvn command to run, this is all you need to do to have a local Alfresco running +on an empty laptop + +- Supports community and enterprise flawlessly, allowing to switch one to another very easily + +The following documentation aims to provide three different levels of complexity to tackle an Alfresco integration +project: simple, advanced and custom; the latter exposes in details the Maven Alfresco SDK features. + +************* +Prerequisites +************* + +The main and only prerequisite to follow reading this document is to have Apache Maven 3.0.3 (or higher) installed +on your machine; there is no preferred IDE nor web container and database requirements needed. + +It is strongly advised to use the Apache Maven official binary distributions downloaded from maven.apache.org; avoid +OS-specific distributions as much as possible. + +************ +Use - Simple +************ + +If you're new to Alfresco, you probably want to know which is the impact of introducing such a technology within your +development team, run it locally, assess all development processes involved with the product and which +technologies/tools are best suited for those. + +You can currently choose between two different flavors, depending on your final goal: + +* If you want to assess efforts involved with AMP development, you can run the following commands: + +1. +mvn archetype:generate \ +-DarchetypeGroupId=org.alfresco.maven \ +-DarchetypeArtifactId=quickstart-amp-archetype \ +-DarchetypeVersion=1.0 \ +-DgroupId=com.someco \ +-DartifactId=alfresco-amp-quickstart \ +-Dversion=1.0-SNAPSHOT \ +-DarchetypeRepository=http://maven.alfresco.com/nexus/content/repositories/releases \ +-DinteractiveMode=false + +You can always switch Alfresco versions/editions by editing the coordinates of your generated pom.xml + +2. +cd alfresco-amp-quickstart && MAVEN_OPTS="-Xms256m -Xmx1G -XX:PermSize=300m" mvn package -Drunamp + +Browse to http://localhost:8080/amp-quickstart and you will find Alfresco Explorer Client running against a local +Alfresco Repository sitting on top of an H2 embedded database and loading your AMP package. + +* If you want to customise Alfresco Explorer and/or Share clients, embed AMP packages/projects or simply run both +Alfresco Explorer and Share on the same machine, run the following commands: + +1. +mvn archetype:generate \ +-DarchetypeGroupId=org.alfresco.maven \ +-DarchetypeArtifactId=quickstart-allinone-archetype \ +-DarchetypeVersion=1.0 \ +-DgroupId=com.someco \ +-DartifactId=alfresco-allinone-quickstart \ +-Dversion=1.0-SNAPSHOT \ +-Dedition=community \ +-DarchetypeRepository=http://maven.alfresco.com/nexus/content/repositories/releases \ +-DinteractiveMode=false + +2. +cd alfresco-allinone-quickstart && MAVEN_OPTS="-Xms256m -Xmx1G -XX:PermSize=300m" mvn package -Drun + +Compared with the previous flavor, alfresco-allinone-quickstart is a Maven multi-module project, which also includes +an AMP project that gets 'overlaid' into both Alfresco and Share web applications. +Alfresco Explorer is available at http://localhost:8080/alfresco whereas Alfresco Share is available at +http://localhost:8080/share + +************ +Use - Custom +************ + +When the build logic becomes tough, integrating with third party technologies, introducing complex build scenarios, +you might want to have a lower integration level with Alfresco SDK; there are basically 2 big integration points +you can rely on, which are basically Alfresco-maintained POM files that provide: + +- A list of Alfresco artifacts, including binaries, javadoc and sources, Maven plugins successfully tested against +the standard and supported build process; artifacts come with correct platform versions and editions +(community vs enterprise) according with the and tags parent coordinates. +You can simply define the following parent POM in your project's pom.xml: + + + org.alfresco.enterprise + alfresco-platform-parent + 4.0.1 + + +In Maven geek terms, this parent POM will define , and elements +related with Alfresco-produced artifacts. + +The main goal of this approach is to give you full access to Alfresco artifacts without needing to handle dependency +and plugin management inside your pom.xml. + +Please note that Alfresco artifacts are not shipped with POM files at the moment, therefore transitive dependencies +are not handled; you will need to define them explicitly in your pom.xml (using provided + +- A set of useful build features around Alfresco web integrations, which are also inherited by alfresco-platform-parent; +if you want to use it directly and skip alfresco-platform-parent, you can define: + + + org.alfresco.enterprise + alfresco-developer-parent + 1 + + +In this case you will have to re-define a list of properties to set your dependency versions: + + 4.0.1 + 3.0.5.RELEASE + 1.3.158 + 1.2 + 2.5 + 1.1_02 + 1.6 + 1.2.15 + +Besides the alfresco-integration-parent items inherited, this parent POM provides 3 commonly used features that can +be easily enabled/disabled/configured: + +* AMP overlay into an Alfresco (or Share) Extension +--- +Activation: built-in +--- +When your project (or sub-module) is a war, you can automatically include one or more +AMP files by defining the dependencies into the pom.xml, as follows: + + com.mycompany + amp-module + 1.0-SNAPSHOT + amp + +The AMP files will be overlayed on top of your current WAR customizations, therefore +they can override the content of the original WAR. + + -- oOo -- + +* Multi-environment property filtering +--- +Activation: exists src/main/properties +--- +You can enable multi-environment property filtering by simply creating the +src/main/properties/${env}/${webapp.resource.filter} file with your property values; +all files included in src/main/resources and src/main/properties will be filtered +with your properties defined; in order to switch between environments, +simply attach -Denv=yourenv to your mvn commands. +--- +Properties +--- +local +alfresco-global.properties +${project.build.outputDirectory} +${project.artifactId} + + -- oOo -- + +* Jetty H2 configuration +--- +Activation: exists jetty/jetty.xml +--- +You can enable Jetty to run your application(s); by default Jetty will run all contexts +using jetty/jetty.xml as Jetty Server configuration, allowing to add the jndi resource +needed to start Alfresco Repository webapp; if you want to run multiple webapps - for +example share and alfresco - follow the example listed below: + + org.mortbay.jetty + maven-jetty-plugin + + + run + run + package + + / + . + jetty/root-web.xml + + + ${project.basedir}/../alfresco/target/alfresco.war + /alfresco + + + ${project.basedir}/../share/target/share.war + /share + + + + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/README.txt b/alfresco-lifecycle-aggregator/README.txt new file mode 100644 index 00000000..3841ddd7 --- /dev/null +++ b/alfresco-lifecycle-aggregator/README.txt @@ -0,0 +1,199 @@ +This document needs updating... + +Archetypes using the SDK can be generated with: + +mvn archetype:generate -DarchetypeCatalog=https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/archetype-catalog.xml + +********** +Disclaimer +********** + +This codebase is currently work in progress; the effort have been split in three directions: +a) The definition of 2 POM files that can handle versions and common build behaviors/features +b) The writing of an alfresco-maven-plugin to enable amp-to-war overlay provided by Alfresco +Repository built-in features (ModuleManagementTool) and replace the maven-amp-plugin (big +rewriting of the maven-war-plugin) +c) The definition of (initially 2) archetypes that show some simple project's configuration using +the parent POMs + +Most of the build features have been successfully ported to a new structure, whose main advantage is +to keep pom.xml files extremely simple and readable (since a lot of logic have been moved to the parent). +Inherited behaviours are configurable simply defining specific properties in the project's or module's pom.xml +(see documentation below). + +Here follows a list of build features that have not been ported yet: +- Maven SCM and release +- JBoss run +- Tomcat remote deployment +- Jetty Java source and resources reloading (Jetty currently runs .war files) +- Maven Site generation +- Maven reporting +- Maven distributionManagement + +Apart from SCM and release, all the mentioned features are probably best suited for a more enterprise archetype, +using the Alfresco Web Integration POM as parent and adding more build features around Maven, Tomcat and JBoss. + +Regarding the POM files, I'd like to see them deployed on maven.alfresco.com, hopefully generated (by the +Alfresco build?) and tested for each Alfresco release. + +--- oOo --- + +************* +Prerequisites +************* + +- Maven 3.0.3 (official binary distribution from maven.apache.org) + +--- oOo --- + +************* +Build and Run +************* + +----- +Build +----- +All the steps that follow are necessary because neither POMs nor +alfresco-maven-plugin are yet available on maven.alfresco.com; as soon +as their implementation is consolidated, you will be able to skip +this first part and just enjoy the second. +--- +mvn clean install +(with empty repository, Maven will download 365Mb) + +--- + +--- +Run +--- +cd archetypes/quickstart-allinone-archetype +MAVEN_OPTS="-Xms256m -Xmx1G -XX:PermSize=300m" mvn clean package -Drun +-> http://localhost:8080/alfresco and http://localhost:8080/share +--- OR +cd archetypes/quickstart-amp-archetype +MAVEN_OPTS="-Xms256m -Xmx1G -XX:PermSize=300m" mvn clean package -Drun-amp +-> http://localhost:8080/quickstart-amp-archetype +--- + +--- oOo --- + +********** +Archetypes +********** + +--------------------------- +ALFRESCO ALLINONE ARCHETYPE +--------------------------- +- run mvn clean install to package all apps +- run mvn clean install -Prun to run the full platform embedded in Jetty/H2 +--- + +--- +ALFRESCO AMP ARCHETYPE +--- + +--- + +--- oOo --- + +********* +POM files +********* + +------------------------------- +ALFRESCO PLATFORM POM +------------------------------- +* Describes the Alfresco platform. Lives in the Alfresco SVN and gets deployed at every release. +* DependencyManagement for all Alfresco commonly used JAR/WAR/AMP artifacts +* IInherits alfresco-developer-parent POM + +--- +ALFRESCO DEVELOPER PARENT POM +--- +* Alfresco Repository Log and storage cleaning +--- +Activation: built-in +--- +When mvn clean is invoked, all files produced by Maven runs must be removed; this is the list of +filesets inherited from alfresco-developer-parent: + * target/ (default behaviour) + * *.log + * ${alfresco.data.location} +--- +Properties +--- +alf_data_dev +--- + +--- +* AMP overlay into an Alfresco (or Share) Extension +--- +Activation: built-in +--- +When your project (or sub-module) is a war, you can automatically include one or more +AMP files by defining the dependencies into the pom.xml, as follows: + + com.mycompany + amp-module + 1.0-SNAPSHOT + amp + +The AMP files will be overlayed on top of your current WAR customizations, therefore +they can override the content of the original WAR. +--- + +--- +* Multi-environment property filtering +--- +Activation: exists src/main/properties +--- +You can enable multi-environment property filtering by simply creating the +src/main/properties/${env}/${webapp.resource.filter} file with your property values; +all files included in src/main/resources and src/main/properties will be filtered +with your properties defined; in order to switch between environments, +simply attach -Denv=yourenv to your mvn commands. +--- +Properties +--- +local +alfresco-global.properties +${project.build.outputDirectory} +${project.artifactId} +--- + +--- +* Jetty H2 configuration +--- +Activation: exists jetty/jetty.xml +--- +You can enable Jetty to run your application(s); by default Jetty will run all contexts +using jetty/jetty.xml as Jetty Server configuration, allowing to add the jndi resource +needed to start Alfresco Repository webapp; if you want to run multiple webapps - for +example share and alfresco - follow the example listed below: + + org.mortbay.jetty + maven-jetty-plugin + + + run + run + package + + / + . + jetty/root-web.xml + + + ${project.basedir}/../alfresco/target/alfresco.war + /alfresco + + + ${project.basedir}/../share/target/share.war + /share + + + + + + +--- \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/TODO.txt b/alfresco-lifecycle-aggregator/TODO.txt new file mode 100644 index 00000000..fee1bfd4 --- /dev/null +++ b/alfresco-lifecycle-aggregator/TODO.txt @@ -0,0 +1,42 @@ +Short term (pre 4.x release): +----------------------------- +- Generate archetypes for sample projects +- Cleanup issues +- Release +- Testing against 1 Community and 1 Enterprise version +- Documentation, documentation, documentation + - Maven Site + - https://wiki.alfresco.com/index.php?title=Maven_Alfresco_SDK (from scratch) + - http://code.google.com/p/maven-alfresco-archetypes/ + +Mid term (post 4.x release): +---------------------------- +- More archetypes + +************************************************** +Enterprise Supported Archetypes (aka Advanced Use) +************************************************** + +If you have built integration projects with Alfresco, you're familiar with Maven and you have a case study in mind, +wondering how to integrate it with your software development around the product, you can start from the Alfresco +Enterprise archetype suite: + +1. +mvn archetype:generate \ +-DarchetypeGroupId=org.alfresco.enterprise \ +-DarchetypeArtifactId=supported-alfresco-archetype \ +-DarchetypeVersion=1.0 \ +-DgroupId=com.someco \ +-DartifactId=alfresco-enterprise \ +-Dversion=1.0-SNAPSHOT \ +-DarchetypeRepository=http://maven.alfresco.com/nexus/content/repositories/releases \ +-DinteractiveMode=false + +2. +cd alfresco-enterprise && MAVEN_OPTS="-Xms256m -Xmx1G -XX:PermSize=300m" mvn package -Drun + +Run the following command if you want to have a list of the available archetypes: + +mvn archetype:generate \ +-DarchetypeCatalog=http://maven.alfresco.com/nexus/content/repositories/releases/archetype-catalog.xml + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/pom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/pom.xml new file mode 100644 index 00000000..23afc9ea --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + org.alfresco.maven.archetype + alfresco-allinone-archetype + maven-archetype + alfresco-allinone-archetype + Sample multi-module project for All-in-One development on the Alfresco plaftorm. Includes modules for: Repository, AMP, Share, Solr and embedded Jetty run + + + org.alfresco.maven + alfresco-lifecycle-aggregator + 1.0-SNAPSHOT + ../../pom.xml + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 00000000..89e9e41a --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,154 @@ + + + + + 1.0-SNAPSHOT + + + org.alfresco + + + 4.2.b + + + (not used) + + + + + + + src/main/java + + **/*.java + + + + src/main/amp + + ** + + + + src/test/resources + + ** + + + + src/test/properties + + **/*.properties + + + + jetty + + ** + + + + + + + + src/main/webapp + + ** + + + + src/main/properties + + **/*.properties + + + + src/main/resources + + ** + + + + + + + + src/main/solr-properties + + ** + ** + + + + src/main/webapp + + ** + + + + src/main/resources + + ** + + + + + + + + src/main/webapp + + ** + + + + src/main/properties + + **/*.properties + + + + src/main/resources + + ** + + + + + + + + src/main/webapp + + ** + + + + src/main/resources + + ** + + + + src/main/webapp + + ** + + + + + + + + jetty + + ** + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/README.txt b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/README.txt new file mode 100644 index 00000000..2a9cc811 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/README.txt @@ -0,0 +1,128 @@ +************* +Prerequisites +************* + +- The only prerequisite to follow reading this document is to have Apache Maven 3.0.3+ (or higher) installed +on your machine; there is no preferred IDE nor web container and database requirements needed. + +- It is strongly advised to use the Apache Maven official binary distributions downloaded from maven.apache.org; avoid +OS-specific distributions as much as possible. + +- add MAVEN_OPTS="-Xms256m -Xmx1G -XX:PermSize=300m" to your environment if your plan to launch tests / run embedded in Jetty + +***** +Usage +***** +This multi-module project manages an All-in-One Alfresco project and it's composed by the following modules: +- amp --> An Repository Tier AMP project, demonstrating sample project structure and demo component loading. Can be configured to work for Share +- alfresco --> An alfresco.war Repository Extension, overlaying the Alfresco WAR with custom resources / classes and depending on the 'amp' project +- share --> A share.war extension, overlaying the Share WAR with custom resoruces / classes +- solr --> A solr.zip overlay / customization to configure solr cores properties + +The project provides support for typical development lifecycle use cases like: +- packaging +- testing +- run embedded +- integration testing +- release and distribution + +of your Alfresco (and platform components) related artifacts. The AMPs produced with this project are fully compatible with Alfresco MMT, +in fact the Alfresco Maven plugin - used to manage AMPs in this SDK - embeds the official Alfresco MMT to install depended AMPs. + +Project layout: +-------------- +parent-project + |-> amp + |-> alfresco + |-> share + |-> solr + |-> wcmqs (Alfresco Web Quick Start) + |-> runner (a Jetty embedded runner / integration test runner) + +Useful commands +--------------- +Running from parent project: +- mvn package --> Runs unit tests (if present) and packages all modules in their respective target/ +- mvn install --> Runs unit tests (if present) , packages and installs AMP in local Maven repository +- mvn install -Dmaven.test.skip=true --> Packages and installs AMP in local Maven repository, skipping tests +- mvn integration-test -Prun --> Runs unit tests and packages all modules and the runner project runs Alfresco, Share and Solr in Jetty + H2 +- mvn clean -Ppurge --> Removes DB, alf_data and log files + +Running from runner: +- 'mvn jetty:run -Prun' or 'mvn integration-test -Prun' to quickly run already packaged webapps + +Properties management +--------------------- +Properties are configurable at 2 levels: +- POM properties (in the parent POM or at single module level) +- direclty in each modules *.properties files, particularly + - src/main/properties//alfresco-global.properties (environment dependent properties for Alfresco WARs) + +Useful properties that can be fully controlled directly in the POM are: + +alfresco.data.location (default = alf_data_dev) +alfresco.db.name (default = alf_dev) +app.log.dir (default = target/) +app.log.root.level (default = INFO) + +*************************** +Maven Alfresco SDK Overview +*************************** + +The Maven Alfresco SDK is an effort that have been developing in the last 5 years - mostly driven by community efforts on +Google Code (http://code.google.com/p/maven-alfresco-archetypes) - which delivers archetypes for building Alfresco +integration project with Maven; builds are based on Alfresco Community and Enterprise artifacts released on the +Alfresco Artifacts Repository at https://artifacts.alfresco.com + +The Maven Alfresco SDK is full rewriting of the Maven Alfresco Lifecyle (latest version 3.9.1) and it's composed of 3 efforts: + +a) POM files: + - alfresco-sdk-parent: provides lifecycle features and behaviors for typical Alfresco development projects + - alfresco-platform-distribution: describes and provides dependencyManagement for artifacts of each Alfresco release + +b) alfresco-maven-plugin: + - defines the AMP packaging type and lifecycle in Maven + - emdeds Alfresco MMT to provide safe installation of single / multiple AMP -> WAR + - will potentially grow including more use cases around Alfresco / Maven + +c) The definition of (initially 2) archetypes that show some simple project's configuration using +the parent POMs + - AMP archetype (this archetype) + - All-in-One multi-module archetype including + - Alfresco Repository AMP + - Alfresco Repository extension project (WAR, also depending on the AMP) + - Share customization project (WAR) + - Solr customization project (WAR) + - Jetty embedded runner for the full platform (mvn clean install -Prun) + + +**************************************** +Why using this SDK might be a good idea? +**************************************** +The main reported advantages of using the Maven Alfresco SDK are: + +- IDE-independent SDK, all build-related features are provided by Apache Maven, which is the only +prerequisite to use this SDK + +- No IDE manual configuration, all modern IDEs offer advanced Maven integrations, so +feel free to use Eclipse, IntelliJ, or any other IDE to write your code and leverage Maven + +- Process ready: scales from quick start rapid application development, to be seamlessly +integrated in enterprise devleopment processes like Continuous Integration and Release + +- Language independent, you don't like Maven? You can still use Ant, Ivy, Buildr, Gradle, Leiningen or any other build +system that is compatible with Maven artifact resolution mechanism; just configure artifacts.alfresco.com as (one of) your +Maven repositories and you're ready to go + +- Javadoc and Sources support, provided by artifacts.alfresco.com related Maven artifacts; you don't need to manually +configure your IDE to attach (manually downloaded) sources to your (manually downloaded) binaries. + +- Clean and readable, the build logic related with OOTB Alfresco features is wrapped in 50 lines of pom.xml + +- Advanced build functionality, inherited by your parent POMs you can use embedded databases and j2ee +containers with (almost) no configuration at all, among other features exposed below. + +- One mvn command to generate, one mvn command to run embedded, this is all you need to do to have a local Alfresco running +on an empty laptop + +- Supports community and enterprise flawlessly, allowing to switch one to another very easily \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/pom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/pom.xml new file mode 100644 index 00000000..4b4d5912 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/pom.xml @@ -0,0 +1,87 @@ + + + + + 4.0.0 + ${artifactId} + Alfresco Repository and Explorer Client + war + Alfresco Repository and Explorer Client + + + ${groupId} + ${rootArtifactId} + ${version} + + + + + ${alfresco.groupId} + alfresco + war + + + + ${project.groupId} + amp + ${project.version} + amp + + + + ${alfresco.groupId} + alfresco-wcm-quickstart-repo + ${alfresco.version} + amp + + + + + + + maven-war-plugin + + + + + + + + ${alfresco.groupId} + alfresco + war + + + + + + ${project.groupId} + amp + amp + + + ${alfresco.groupId} + alfresco-wcm-quickstart-repo + amp + + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/properties/local/alfresco-global.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/properties/local/alfresco-global.properties new file mode 100644 index 00000000..95592642 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/properties/local/alfresco-global.properties @@ -0,0 +1,308 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# RUN TIME PROPERTIES +# ------------------- + +# Sample custom content and index data location +# This will create alf_data Relative to appserver run folder +# In this default file we take the property from the POM (for compatbility with local jetty and jboss deployments) but it can also be edited here. + +############################### +## Common Alfresco Properties # +############################### + + +dir.root=${alfresco.data.location} +# Allowed values are: NONE, AUTO, FULL +index.recovery.mode=FULL + +index.subsystem.name=solr +solr.host=localhost +solr.port=8080 +solr.secureComms=none +# Setting Solr backup for the future. Tweak this if needed (ideally in other env properties files) +solr.backup.alfresco.cronExpression=0 30 2 * * ? 2050 +solr.backup.archive.cronExpression=0 30 3 * * ? 2050 +solr.backup.alfresco.remoteBackupLocation=${dir.root}/solrBackup/alfresco +solr.backup.archive.remoteBackupLocation=${dir.root}/solrBackup/archive +# We are in the local DEV properties file, no need for Solr backup +solr.backup.alfresco.numberToKeep=0 +solr.backup.archive.numberToKeep=0 + +# These jobs seem to require Lucene (Unsupported Operation with Solr) so we disasble them / set to future date +# See https://forums.alfresco.com/en/viewtopic.php?f=52&t=41597 +# If you want to enable them (and so full WQS functionality), please also set index.subsystem.name=lucene +wcmqs.dynamicCollectionProcessor.schedule=0 30 2 * * ? 2060 +wcmqs.feedbackProcessor.schedule=0 40 2 * * ? 2060 +wcmqs.publishQueueProcessor.schedule=0 50 2 * * ? 2060 + +# Fail or not when there are node integrity checker errors +integrity.failOnError=true + +# database connection properties +# MySQL connection (This is default and requires mysql-connector-java-5.0.3-bin.jar, which ships with the Alfresco server) + +db.driver=${alfresco.db.datasource.class} +db.url=${alfresco.db.url} +db.username=${alfresco.db.username} +db.password=${alfresco.db.password} +db.pool.initial=10 +db.pool.max=100 + + +# +# Sample custom content and index data location +# +#dir.root=/srv/alfresco/alf_data +#dir.keystore=${dir.root}/keystore + +# +# Sample database connection properties +# +#db.username=alfresco +#db.password=alfresco + +# +# External locations +#------------- +#ooo.exe=soffice +#ooo.enabled=false +#jodconverter.officeHome=./OpenOffice.org +#jodconverter.portNumbers=8101 +#jodconverter.enabled=true +#img.root=./ImageMagick +#swf.exe=./bin/pdf2swf + +# +# Property to control whether schema updates are performed automatically. +# Updates must be enabled during upgrades as, apart from the static upgrade scripts, +# there are also auto-generated update scripts that will need to be executed. After +# upgrading to a new version, this can be disabled. +# +#db.schema.update=true + +# +# MySQL connection +# +#db.driver=org.gjt.mm.mysql.Driver +#db.url=jdbc:mysql://localhost/alfresco?useUnicode=yes&characterEncoding=UTF-8 + +# +# Oracle connection +# +#db.driver=oracle.jdbc.OracleDriver +#db.url=jdbc:oracle:thin:@localhost:1521:alfresco + +# +# SQLServer connection +# Requires jTDS driver version 1.2.5 and SNAPSHOT isolation mode +# Enable TCP protocol on fixed port 1433 +# Prepare the database with: +# ALTER DATABASE alfresco SET ALLOW_SNAPSHOT_ISOLATION ON; +# +#db.driver=net.sourceforge.jtds.jdbc.Driver +#db.url=jdbc:jtds:sqlserver://localhost:1433/alfresco +#db.txn.isolation=4096 + +# +# PostgreSQL connection (requires postgresql-8.2-504.jdbc3.jar or equivalent) +# +#db.driver=org.postgresql.Driver +#db.url=jdbc:postgresql://localhost:5432/alfresco + +# +# DB2 connection +# +#db.driver=com.ibm.db2.jcc.DB2Driver +#db.url=jdbc:db2://localhost:50000/alfresco:retrieveMessagesFromServerOnGetMessage=true; + +# +# Index Recovery Mode +#------------- +#index.recovery.mode=AUTO + +# +# Outbound Email Configuration +#------------- +#mail.host= +#mail.port=25 +#mail.username=anonymous +#mail.password= +#mail.encoding=UTF-8 +#mail.from.default=alfresco@alfresco.org +#mail.smtp.auth=false + +# +# Alfresco Email Service and Email Server +#------------- + +# Enable/Disable the inbound email service. The service could be used by processes other than +# the Email Server (e.g. direct RMI access) so this flag is independent of the Email Service. +#------------- +#email.inbound.enabled=true + +# Email Server properties +#------------- +#email.server.enabled=true +#email.server.port=25 +#email.server.domain=alfresco.com +#email.inbound.unknownUser=anonymous + +# A comma separated list of email REGEX patterns of allowed senders. +# If there are any values in the list then all sender email addresses +# must match. For example: +# .*\@alfresco\.com, .*\@alfresco\.org +# Allow anyone: +#------------- +#email.server.allowed.senders=.* + +# +# The default authentication chain +# To configure external authentication subsystems see: +# http://wiki.alfresco.com/wiki/Alfresco_Authentication_Subsystems +#------------- +#authentication.chain=alfrescoNtlm1:alfrescoNtlm + +# +# URL Generation Parameters (The ${localname} token is replaced by the local server name) +#------------- +#alfresco.context=alfresco +#alfresco.host=${localname} +#alfresco.port=8080 +#alfresco.protocol=http +# +#share.context=share +#share.host=${localname} +#share.port=8080 +#share.protocol=http + +#imap.server.enabled=true +#imap.server.port=143 +#imap.server.host=localhost + +# Default value of alfresco.rmi.services.host is 0.0.0.0 which means 'listen on all adapters'. +# This allows connections to JMX both remotely and locally. +# +alfresco.rmi.services.host=0.0.0.0 + +# +# RMI service ports for the individual services. +# These seven services are available remotely. +# +# Assign individual ports for each service for best performance +# or run several services on the same port. You can even run everything on 50500 if needed. +# +# Select 0 to use a random unused port. +# +#avm.rmi.service.port=50501 +#avmsync.rmi.service.port=50502 +#attribute.rmi.service.port=50503 +#authentication.rmi.service.port=50504 +#repo.rmi.service.port=50505 +#action.rmi.service.port=50506 +#wcm-deployment-receiver.rmi.service.port=50507 +#monitor.rmi.service.port=50508 + + +# Dialect is autodetected starting from 3.2 +# H2 dialect +#hibernate.dialect=org.hibernate.dialect.H2Dialect + + +# Property to control whether schema updates are performed automatically. +# Updates must be enabled during upgrades as, apart from the static upgrade scripts, +# there are also auto-generated update scripts that will need to be executed. After +# upgrading to a new version, this can be disabled. +#db.schema.update=true + + +# File servers related properties +# For local builds we disable CIFS and FTP. Edit the following property to reenable them +smb.server.enabled=false +smb.server.name=CFS_SHARE_LOCAL +smb.server.domain=mycompany.com +smb.server.bindto=127.0.0.1 +smb.tcpip.port=1445 +netbios.session.port=1139 +netbios.name.port=1137 +netbios.datagram.port=1138 +ftp.server.enabled=false +ftp.port=1121 +ftp.authenticator=alfresco + +# This properties file is used to configure LDAP authentication +# NB: The following LDAP related properties are read only in case -Denteprise mvn build property is specified +# Wheter to allow silent deletion of users in the Alfresco UI (note: users will be then resynced in the next synchronization) +ldap.authentication.allowDeleteUser=true +# LDAP JNDI provider +ldap.authentication.provider=com.sun.jndi.ldap.LdapCtxFactory +# Url and protocol for LDAP server to carry authentication against +ldap.authentication.url=ldap://ldap.mycompany.com:636 +# can be (simple, ssl) +ldap.authentication.protcol=ssl +# Credentials with full access to the directoty used +ldap.authentication.adminUser=ou=Admin,ou=Services,o=Company +ldap.authentication.adminPassword=secret +# Wheter to allow unauthenticated guest a read only login +ldap.authentication.guestLogin.allowed=false +# Wheter users can be created on the fly upon successful external (e.g. LDAP) authentication. Useful to avoid user synchronization in case just uid and pwd are needed for a user +server.transaction.allow-writes=true +# Wheter user names are case sensitive +user.name.caseSensitive=true +# Wheter the synchronization process has to process duplicated users (e.g. synced users and users coming from the sync) +personService.processDuplicates=true +# Which action to take when processin duplicates. One of: LEAVE, SPLIT, DELETE +personService.duplicateMode=DELETE +# Which of the users (in case of SPLIT duplicates policy) should be considered valid +personService.lastIsBest=true +# Wheter auto created users should be considered when processing duplicates +personService.includeAutoCreated=true +# The query to find the people to import +ldap.synchronisation.personQuery=(objectclass=inetOrgPerson) +# The search base of the query to find people to import +ldap.synchronisation.personSearchBase=ou=Identities,ou=mycompany,o=com +# The attribute name on people objects found in LDAP to use as the uid in Alfresco +ldap.synchronisation.userIdAttributeName=cn +# The attribute on person objects in LDAP to map to the first name property in Alfresco +ldap.synchronisation.userFirstNameAttributeName=givenName +# The attribute on person objects in LDAP to map to the last name property in Alfresco +ldap.synchronisation.userLastNameAttributeName=sn +# The attribute on person objects in LDAP to map to the email property in Alfresco +ldap.synchronisation.userEmailAttributeName=cn +# The attribute on person objects in LDAP to map to the organizational id property in Alfresco +ldap.synchronisation.userOrganizationalIdAttributeName=maildomain +# The default home folder provider to use for people created via LDAP import +ldap.synchronisation.defaultHomeFolderProvider=companyHomeFolderProvider +# The query to find group objects +ldap.synchronisation.groupQuery=(objectclass=AlfrescoGroup) +# The search base to use to find group objects +ldap.synchronisation.groupSearchBase=ou=AlfrescoGroups,ou=mycompany,o=com +# The attribute on LDAP group objects to map to the gid property in Alfrecso +ldap.synchronisation.groupIdAttributeName=cn +# The group type in LDAP +ldap.synchronisation.groupType=AlfrescoGroup +# The person type in LDAP +ldap.synchronisation.personType=inetOrgPerson +# The attribute in LDAP on group objects that defines the DN for its members +ldap.synchronisation.groupMemberAttributeName=member +# The cron expression defining when people imports should take place (e.g. every evening at 22:00 hours) +ldap.synchronisation.import.person.cron=0 0 22 * * ? +# The cron expression defining when group imports should take place (e.g. every evening at 21:45 hours) +ldap.synchronisation.import.group.cron=0 45 21 * * ? +# Should all groups be cleared out at import time? +# - this is safe as groups are not used in Alfresco for other things (unlike person objects which you should never clear out during an import) +# - setting this to true means old group definitions will be tidied up. +ldap.synchronisation.import.group.clearAllChildren=false + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/resources/alfresco/extension/dev-log4j.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/resources/alfresco/extension/dev-log4j.properties new file mode 100644 index 00000000..4bc0c51d --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/resources/alfresco/extension/dev-log4j.properties @@ -0,0 +1,2 @@ +# You can add here custom log4j classes. This will be merged with the main log4j.properties +# See http://wiki.alfresco.com/wiki/Developing_an_Alfresco_Module#Best_Log4j_Configuration_Practices \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/resources/log4j.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/resources/log4j.properties new file mode 100644 index 00000000..6d549200 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/resources/log4j.properties @@ -0,0 +1,265 @@ +# This is a full override of Alfresco 4.2.b log4j.properties +# This file overwrites the alfresco.war log4j.properties + +# Set root logger level to error +log4j.rootLogger=${app.log.root.level}, Console, File + +###### Console appender definition ####### + +# All outputs currently set to be a ConsoleAppender. +log4j.appender.Console=org.apache.log4j.ConsoleAppender +log4j.appender.Console.layout=org.apache.log4j.PatternLayout + +# use log4j NDC to replace %x with tenant domain / username +log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n +#log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n + +###### File appender definition ####### +log4j.appender.File=org.apache.log4j.DailyRollingFileAppender +log4j.appender.File.File=${app.log.dir}alfresco.log +log4j.appender.File.Append=true +log4j.appender.File.DatePattern='.'yyyy-MM-dd +log4j.appender.File.layout=org.apache.log4j.PatternLayout +log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n + +###### Hibernate specific appender definition ####### +#log4j.appender.file=org.apache.log4j.FileAppender +#log4j.appender.file.File=hibernate.log +#log4j.appender.file.layout=org.apache.log4j.PatternLayout +#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n + +###### Log level overrides ####### + +# Commented-in loggers will be exposed as JMX MBeans (refer to org.alfresco.repo.admin.Log4JHierarchyInit) +# Hence, generally useful loggers should be listed with at least ERROR level to allow simple runtime +# control of the level via a suitable JMX Console. Also, any other loggers can be added transiently via +# Log4j addLoggerMBean as long as the logger exists and has been loaded. + +# Hibernate +log4j.logger.org.hibernate=error +log4j.logger.org.hibernate.util.JDBCExceptionReporter=fatal +log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=fatal +log4j.logger.org.hibernate.type=warn +log4j.logger.org.hibernate.cfg.SettingsFactory=warn + +# Spring +log4j.logger.org.springframework=warn +# Turn off Spring remoting warnings that should really be info or debug. +log4j.logger.org.springframework.remoting.support=error +log4j.logger.org.springframework.util=error + +# Axis/WSS4J +log4j.logger.org.apache.axis=info +log4j.logger.org.apache.ws=info + +# CXF +log4j.logger.org.apache.cxf=error + +# MyFaces +log4j.logger.org.apache.myfaces.util.DebugUtils=info +log4j.logger.org.apache.myfaces.el.VariableResolverImpl=error +log4j.logger.org.apache.myfaces.application.jsp.JspViewHandlerImpl=error +log4j.logger.org.apache.myfaces.taglib=error + +# OpenOfficeConnection +log4j.logger.net.sf.jooreports.openoffice.connection=fatal + +# log prepared statement cache activity ### +log4j.logger.org.hibernate.ps.PreparedStatementCache=info + +# Alfresco +log4j.logger.org.alfresco=error +log4j.logger.org.alfresco.repo.admin=info +log4j.logger.org.alfresco.repo.cache.TransactionalCache=warn +log4j.logger.org.alfresco.repo.model.filefolder=warn +log4j.logger.org.alfresco.repo.tenant=info +log4j.logger.org.alfresco.repo.avm=info +log4j.logger.org.alfresco.config=warn +log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn +log4j.logger.org.alfresco.config.JBossEnabledWebApplicationContext=warn +log4j.logger.org.alfresco.repo.management.subsystems=warn +log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory=info +log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ChildApplicationContext=warn +log4j.logger.org.alfresco.repo.security.sync=info +log4j.logger.org.alfresco.repo.security.person=info + +log4j.logger.org.alfresco.sample=info +log4j.logger.org.alfresco.web=info +#log4j.logger.org.alfresco.web.app.AlfrescoNavigationHandler=debug +#log4j.logger.org.alfresco.web.ui.repo.component.UIActions=debug +#log4j.logger.org.alfresco.web.ui.repo.tag.PageTag=debug +#log4j.logger.org.alfresco.web.bean.clipboard=debug +log4j.logger.org.alfresco.repo.webservice=info +log4j.logger.org.alfresco.service.descriptor.DescriptorService=info +#log4j.logger.org.alfresco.web.page=debug + +log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=error +#log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=info + +log4j.logger.org.alfresco.web.ui.common.Utils=error +#log4j.logger.org.alfresco.web.ui.common.Utils=info + +log4j.logger.org.alfresco.repo.admin.patch.PatchExecuter=info +log4j.logger.org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl=info + +# Specific patches +log4j.logger.org.alfresco.repo.admin.patch.impl.DeploymentMigrationPatch=info +log4j.logger.org.alfresco.repo.version.VersionMigrator=info +log4j.logger.org.alfresco.repo.admin.patch.impl.ResetWCMToGroupBasedPermissionsPatch=info + +log4j.logger.org.alfresco.repo.module.ModuleServiceImpl=info +log4j.logger.org.alfresco.repo.domain.schema.SchemaBootstrap=info +log4j.logger.org.alfresco.repo.admin.ConfigurationChecker=info +log4j.logger.org.alfresco.repo.node.index.AbstractReindexComponent=warn +log4j.logger.org.alfresco.repo.node.index.IndexTransactionTracker=warn +log4j.logger.org.alfresco.repo.node.index.FullIndexRecoveryComponent=info +log4j.logger.org.alfresco.repo.node.index.AVMFullIndexRecoveryComponent=info +log4j.logger.org.alfresco.util.OpenOfficeConnectionTester=info +log4j.logger.org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl=warn +log4j.logger.org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor=warn +log4j.logger.org.alfresco.repo.transaction.RetryingTransactionHelper=warn +log4j.logger.org.alfresco.util.transaction.SpringAwareUserTransaction.trace=warn +log4j.logger.org.alfresco.util.AbstractTriggerBean=warn +log4j.logger.org.alfresco.enterprise.repo.cache.cluster.KeepAliveHeartbeatReceiver=info +log4j.logger.org.alfresco.repo.version.Version2ServiceImpl=warn + +#log4j.logger.org.alfresco.web.app.DebugPhaseListener=debug + +log4j.logger.org.alfresco.repo.workflow=info + +# CIFS server debugging +log4j.logger.org.alfresco.smb.protocol=error +#log4j.logger.org.alfresco.smb.protocol.auth=debug +#log4j.logger.org.alfresco.acegi=debug + +# FTP server debugging +log4j.logger.org.alfresco.ftp.protocol=error +#log4j.logger.org.alfresco.ftp.server=debug + +# WebDAV debugging +#log4j.logger.org.alfresco.webdav.protocol=debug +log4j.logger.org.alfresco.webdav.protocol=error + +# NTLM servlet filters +#log4j.logger.org.alfresco.web.app.servlet.NTLMAuthenticationFilter=debug +#log4j.logger.org.alfresco.repo.webdav.auth.NTLMAuthenticationFilter=debug + +# Kerberos servlet filters +#log4j.logger.org.alfresco.web.app.servlet.KerberosAuthenticationFilter=debug +#log4j.logger.org.alfresco.repo.webdav.auth.KerberosAuthenticationFilter=debug + +# File servers +log4j.logger.org.alfresco.fileserver=warn + +# Repo filesystem debug logging +#log4j.logger.org.alfresco.filesys.repo.ContentDiskDriver=debug + +# AVM filesystem debug logging +#log4j.logger.org.alfresco.filesys.avm.AVMDiskDriver=debug + +# Integrity message threshold - if 'failOnViolation' is off, then WARNINGS are generated +log4j.logger.org.alfresco.repo.node.integrity=ERROR + +# Indexer debugging +log4j.logger.org.alfresco.repo.search.Indexer=error +#log4j.logger.org.alfresco.repo.search.Indexer=debug + +log4j.logger.org.alfresco.repo.search.impl.lucene.index=error +log4j.logger.org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl=warn +#log4j.logger.org.alfresco.repo.search.impl.lucene.index=DEBUG + +# Audit debugging +# log4j.logger.org.alfresco.repo.audit=DEBUG +# log4j.logger.org.alfresco.repo.audit.model=DEBUG + +# Forms debugging +# log4j.logger.org.alfresco.web.forms=debug +# log4j.logger.org.chiba.xml.xforms=debug +log4j.logger.org.alfresco.web.forms.xforms.XFormsBean=error +log4j.logger.org.alfresco.web.forms.XSLTRenderingEngine=error + +# Property sheet and modelling debugging +# change to error to hide the warnings about missing properties and associations +log4j.logger.alfresco.missingProperties=warn +log4j.logger.org.alfresco.web.ui.repo.component.property.UIChildAssociation=warn +log4j.logger.org.alfresco.web.ui.repo.component.property.UIAssociation=warn +#log4j.logger.org.alfresco.web.ui.repo.component.property=debug + +# Dictionary/Model debugging +log4j.logger.org.alfresco.repo.dictionary=warn +log4j.logger.org.alfresco.repo.dictionary.types.period=warn + +# Virtualization Server Registry +log4j.logger.org.alfresco.mbeans.VirtServerRegistry=error + +# Spring context runtime property setter +log4j.logger.org.alfresco.util.RuntimeSystemPropertiesSetter=info + +# Debugging options for clustering +log4j.logger.org.alfresco.repo.content.ReplicatingContentStore=error +log4j.logger.org.alfresco.repo.content.replication=error + +#log4j.logger.org.alfresco.repo.deploy.DeploymentServiceImpl=debug + +# Activity service +log4j.logger.org.alfresco.repo.activities=warn + +# User usage tracking +log4j.logger.org.alfresco.repo.usage=info + +# Sharepoint +log4j.logger.org.alfresco.module.vti=info + +# Forms Engine +log4j.logger.org.alfresco.repo.forms=info +log4j.logger.org.alfresco.web.config.forms=info +log4j.logger.org.alfresco.web.scripts.forms=info + +# CMIS +log4j.logger.org.alfresco.opencmis=error +log4j.logger.org.alfresco.opencmis.AlfrescoCmisServiceInterceptor=error +log4j.logger.org.alfresco.cmis=error +log4j.logger.org.alfresco.cmis.dictionary=warn +log4j.logger.org.apache.chemistry.opencmis=info + +# IMAP +log4j.logger.org.alfresco.repo.imap=info + +# JBPM +# Note: non-fatal errors (eg. logged during job execution) should be handled by Alfresco's retrying transaction handler +log4j.logger.org.jbpm.graph.def.GraphElement=fatal + +#log4j.logger.org.alfresco.repo.googledocs=debug + +###### Scripting ####### + +# Web Framework +log4j.logger.org.springframework.extensions.webscripts=info +log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn +log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off + +# Repository +log4j.logger.org.alfresco.repo.web.scripts=warn +log4j.logger.org.alfresco.repo.web.scripts.BaseWebScriptTest=info +log4j.logger.org.alfresco.repo.web.scripts.AlfrescoRhinoScriptDebugger=off +log4j.logger.org.alfresco.repo.jscript=error +log4j.logger.org.alfresco.repo.jscript.ScriptLogger=warn +log4j.logger.org.alfresco.repo.cmis.rest.CMISTest=info + +log4j.logger.org.alfresco.repo.avm.actions=info + +# Freemarker +# Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler +log4j.logger.freemarker.runtime= + +# Metadata extraction +log4j.logger.org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter=warn + +# Reduces PDFont error level due to ALF-7105 +log4j.logger.org.apache.pdfbox.pdmodel.font.PDSimpleFont=fatal +log4j.logger.org.apache.pdfbox.pdmodel.font.PDFont=fatal +log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFont=fatal + +# no index support +log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexIndexer=fatal +log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexSearchService=fatal \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/webapp/WEB-INF/faces-config-custom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/webapp/WEB-INF/faces-config-custom.xml new file mode 100644 index 00000000..bf9ab691 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/webapp/WEB-INF/faces-config-custom.xml @@ -0,0 +1,33 @@ + + + + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/webapp/WEB-INF/web.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..4372b3c1 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/alfresco/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,911 @@ + + + + + + Alfresco Web Client + + Alfresco Web Client + + + org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL + true + + + + javax.faces.STATE_SAVING_METHOD + server + + + + javax.faces.PARTIAL_STATE_SAVING_METHOD + false + + + + javax.faces.CONFIG_FILES + /WEB-INF/faces-config-app.xml,/WEB-INF/faces-config-beans.xml,/WEB-INF/faces-config-navigation.xml,/WEB-INF/faces-config-common.xml,/WEB-INF/faces-config-repo.xml,/WEB-INF/faces-config-wcm.xml,/WEB-INF/faces-config-custom.xml + + + + org.apache.myfaces.ALLOW_JAVASCRIPT + true + + + + org.apache.myfaces.DETECT_JAVASCRIPT + false + This is an EXPERIMENTAL feature, so leave it off for now! + + + + org.apache.myfaces.SERIALIZE_STATE_IN_SESSION + false + Stop MyFaces from Serializing the state to the session + + + + + org.apache.myfaces.PRETTY_HTML + true + + If true, rendered HTML code will be formatted, so that it is "human readable". + i.e. additional line separators and whitespace will be written, that do not + influence the HTML code. + Default: "true" + + + + + org.apache.myfaces.AUTO_SCROLL + false + + If true, a javascript function will be rendered that is able to restore the + former vertical scroll on every request. Convenient feature if you have pages + with long lists and you do not want the browser page to always jump to the top + if you trigger a link or button action that stays on the same page. + Default: "false" + + + + + + contextConfigLocation + /WEB-INF/web-application-context.xml + Spring config file location + + + + log4jExposeWebAppRoot + false + Do not try to resolve web app root as file + + + + + store + workspace://SpacesStore + + + rootPath + /app:company_home + + + + org.apache.myfaces.ERROR_HANDLING + false + + + + + + com.ibm.ws.jsf.loadExternalDtd + false + Sets "http://apache.org/xml/features/nonvalidating/load-external-dtd" feature on the SAXParser to false if this parameter is false + + + + Authentication Filter + Authentication filter mapped only to faces URLs. Other URLs generally use proprietary means to talk to the AuthenticationComponent + org.alfresco.repo.web.filter.beans.BeanProxyFilter + + beanName + AuthenticationFilter + + + + + Global Authentication Filter + Authentication filter mapped to all authenticated URLs. Mainly for SSO support + org.alfresco.repo.web.filter.beans.BeanProxyFilter + + beanName + GlobalAuthenticationFilter + + + + + WebScript Authentication Filter + Authentication filter mapped to web script URLs. Mainly for SSO support + org.alfresco.repo.web.filter.beans.BeanProxyFilter + + beanName + WebscriptAuthenticationFilter + + + + + WebDAV Authentication Filter + org.alfresco.repo.web.filter.beans.BeanProxyFilter + + beanName + WebDavAuthenticationFilter + + + + + Admin Authentication Filter + org.alfresco.web.app.servlet.AdminAuthenticationFilter + + + + CacheExpiresFilter + Set HTTP cache Expires header 30 days forward for a mapping. + org.alfresco.web.scripts.servlet.StaticAssetCacheFilter + + expires + 30 + Add an Expires Header 30 days forward + + + + + Global Localization Filter + Sets fallback default locale for ALL requests + org.alfresco.web.app.servlet.GlobalLocalizationFilter + + + + JSF Session Synchronized Filter + org.alfresco.repo.web.filter.beans.SessionSynchronizedFilter + + + + Global Localization Filter + /* + + + + Global Authentication Filter + /navigate/* + + + + Global Authentication Filter + /command/* + + + + Global Authentication Filter + /download/* + + + + Global Authentication Filter + /template/* + + + + Global Authentication Filter + /n/* + + + + Global Authentication Filter + /c/* + + + + Global Authentication Filter + /t/* + + + + Global Authentication Filter + /d/* + + + + + WebScript Authentication Filter + /wcservice/* + + + + WebScript Authentication Filter + /wcs/* + + + + Global Authentication Filter + /wcservice/* + + + + Global Authentication Filter + /wcs/* + + + + Global Authentication Filter + /ajax/* + + + + Global Authentication Filter + /faces/* + + + + Authentication Filter + /faces/* + + + + WebDAV Authentication Filter + /webdav/* + + + + Admin Authentication Filter + /faces/jsp/admin/* + + + + Admin Authentication Filter + /faces/jsp/categories/* + + + + Admin Authentication Filter + /faces/jsp/groups/* + + + + Admin Authentication Filter + /faces/jsp/users/delete-user.jsp + + + + Admin Authentication Filter + /faces/jsp/users/users.jsp + + + + Admin Authentication Filter + /faces/jsp/admin/system-info.jsp + + + + JSF Session Synchronized Filter + /faces/* + + + + CacheExpiresFilter + *.jpg + + + CacheExpiresFilter + *.png + + + CacheExpiresFilter + *.gif + + + CacheExpiresFilter + *.css + + + CacheExpiresFilter + *.js + + + + org.apache.myfaces.webapp.StartupServletContextListener + + + + org.springframework.web.util.Log4jConfigListener + + + + + org.alfresco.web.app.ContextLoaderListener + + + + + org.alfresco.web.app.ContextListener + + + + + org.alfresco.repo.webdav.WebDAVSessionListener + + + + + com.sun.xml.ws.transport.http.servlet.WSServletContextListener + + + + + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + + uploadFile + org.alfresco.web.app.servlet.UploadFileServlet + + + + uploadContent + org.alfresco.web.app.servlet.UploadContentServlet + + + + downloadContent + org.alfresco.web.app.servlet.DownloadContentServlet + + + + downloadRawContent + org.alfresco.web.app.servlet.DownloadRawContentServlet + + + + guestDownloadContent + org.alfresco.web.app.servlet.GuestDownloadContentServlet + + + + guestTemplateContent + org.alfresco.web.app.servlet.GuestTemplateContentServlet + + + + externalAccess + org.alfresco.web.app.servlet.ExternalAccessServlet + + + + templateContent + org.alfresco.web.app.servlet.TemplateContentServlet + + + + commandServlet + org.alfresco.web.app.servlet.CommandServlet + + + + ajaxServlet + org.alfresco.web.app.servlet.ajax.AjaxServlet + + + + axis + org.apache.axis.transport.http.AxisServlet + 5 + + + + CXFServlet + org.apache.cxf.transport.servlet.CXFServlet + 6 + + + + WebDAV + org.alfresco.repo.webdav.WebDAVServlet + 5 + + + + apiServlet + org.springframework.extensions.webscripts.servlet.WebScriptServlet + + authenticator + webscripts.authenticator.basic + + + + + wcapiServlet + org.springframework.extensions.webscripts.servlet.WebScriptServlet + + authenticator + webscripts.authenticator.webclient + + + + + portalapiServlet + org.springframework.extensions.webscripts.servlet.WebScriptServlet + + authenticator + webscripts.authenticator.webclient + + + + + facebookServlet + org.alfresco.repo.web.scripts.facebook.FacebookServlet + + authenticator + webscripts.authenticator.facebook + + + + + fbapiServlet + org.alfresco.repo.web.scripts.facebook.FacebookAPIServlet + + authenticator + webscripts.authenticator.facebook + + + + + proxyServlet + org.alfresco.web.app.servlet.HTTPProxyServlet + + + + workflowDefinitionImageServlet + org.alfresco.web.app.servlet.WorkflowDefinitionImageServlet + + + + JBPMDeployProcessServlet + org.alfresco.web.app.servlet.JBPMDeployProcessServlet + + + + CMISFileShareServlet + org.apache.chemistry.opencmis.browser.BrowseServlet + + auxroot + cmisfs/browser/ + + + allow + http.* + + + stylesheet:application/atomsvc+xml + /cmisfs/stylesheets/service.xsl + + + stylesheet:application/atom+xml;type=feed + /cmisfs/stylesheets/feed.xsl + + + stylesheet:application/cmistree+xml + /cmisfs/stylesheets/feed.xsl + + + stylesheet:application/atom+xml;type=entry + /cmisfs/stylesheets/entry.xsl + + + stylesheet:application/cmisallowableactions+xml + /cmisfs/stylesheets/actions.xsl + + + stylesheet:application/cmisacl+xml + /cmisfs/stylesheets/acl.xsl + + + override-stylesheet:renditions + /cmisfs/stylesheets/renditions.xsl + + + override-stylesheet:relationships + /cmisfs/stylesheets/relationships.xsl + + + override-stylesheet:thumbnails + /cmisfs/stylesheets/thumbnails.xsl + + + + + cmisws + com.sun.xml.ws.transport.http.servlet.WSServlet + 7 + + + + cmisatom + org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet + + callContextHandler + org.apache.chemistry.opencmis.server.shared.BasicAuthCallContextHandler + + 8 + + + + cmisbrowser + org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet + + callContextHandler + org.apache.chemistry.opencmis.server.shared.BasicAuthCallContextHandler + + 8 + + + + cmistck + org.apache.chemistry.opencmis.tck.runner.WebRunnerServlet + 8 + + + + authenticatorServlet + org.alfresco.repo.web.scripts.servlet.AuthenticatorServlet + + + + + + Faces Servlet + /faces/* + + + + uploadFile + /uploadFileServlet + + + + uploadContent + /upload/* + + + + downloadContent + /download/* + + + + downloadContent + /d/* + + + + downloadRawContent + /dr + + + + guestDownloadContent + /guestDownload/* + + + + guestDownloadContent + /gd/* + + + + templateContent + /template/* + + + + templateContent + /t/* + + + + guestTemplateContent + /guestTemplate/* + + + + guestTemplateContent + /gt/* + + + + externalAccess + /navigate/* + + + + externalAccess + /n/* + + + + commandServlet + /command/* + + + + commandServlet + /c/* + + + + ajaxServlet + /ajax/* + + + + axis + /api/* + + + + CXFServlet + /cmis/* + + + + WebDAV + /webdav/* + + + + apiServlet + /service/* + + + + apiServlet + /s/* + + + + wcapiServlet + /wcservice/* + + + + wcapiServlet + /wcs/* + + + + portalapiServlet + /168service/* + + + + portalapiServlet + /168s/* + + + + facebookServlet + /facebook/* + + + + facebookServlet + /fb/* + + + + fbapiServlet + /fbservice/* + + + + fbapiServlet + /fbs/* + + + + proxyServlet + /proxy + + + + JBPMDeployProcessServlet + /jbpm/deployprocess + + + + workflowDefinitionImageServlet + /workflowdefinitionimage/* + + + + CMISFileShareServlet + /cmisbrowse + + + + cmisws + /cmisws/* + + + + cmisatom + /cmisatom/* + + + + cmisbrowser + /cmisbrowser/* + + + + + + + + + 60 + + + + index.jsp + + + + java.lang.Exception + /jsp/error.jsp + + + + The Alfresco database connection + jdbc/dataSource + javax.sql.DataSource + Container + Unshareable + + + + + A flag that globally enables or disables startup of the major Alfresco subsystems. + properties/startup.enable + true + java.lang.Boolean + + + + The filesystem directory below which content and index data is stored. Should be on a shared disk + if this is a clustered installation. + properties/dir.root + + java.lang.String + + + + The fully qualified name of a org.hibernate.dialect.Dialect subclass that allows Hibernate to + generate SQL optimized for a particular relational database. Choose from org.hibernate.dialect.DerbyDialect, + org.hibernate.dialect.MySQLInnoDBDialect, + org.alfresco.repo.domain.hibernate.dialect.AlfrescoOracle9Dialect, + org.alfresco.repo.domain.hibernate.dialect.AlfrescoSybaseAnywhereDialect, + org.alfresco.repo.domain.hibernate.dialect.AlfrescoSQLServerDialect, org.hibernate.dialect.PostgreSQLDialect + properties/hibernate.dialect + + java.lang.String + + + + Mapping from tokens in Hibernate queries to SQL tokens. For PostgreSQL, set this to "true + TRUE, false FALSE". + properties/hibernate.query.substitutions + + java.lang.String + + + + Enable use of JDBC3 PreparedStatement.getGeneratedKeys() to retrieve natively generated keys + after insert. Requires JDBC3+ driver. Set to false if your driver has problems with the Hibernate identifier + generators. By default, tries to determine the driver capabilities using connection metadata. + properties/hibernate.jdbc.use_get_generated_keys + + java.lang.String + + + + Qualify unqualified table names with the given schema/tablespace in generated SQL. It may be + necessary to set this when the target database has more than one schema. + properties/hibernate.default_schema + + java.lang.String + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/jetty/jetty.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/jetty/jetty.xml new file mode 100644 index 00000000..b9bf3d84 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/jetty/jetty.xml @@ -0,0 +1,16 @@ + + + + + + jdbc/dataSource + + + ${alfresco.db.url} + ${alfresco.db.username} + ${alfresco.db.password} + + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/pom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/pom.xml new file mode 100644 index 00000000..1846c37b --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + ${artifactId} + Alfresco AMP Module + amp + This is a sample AMP project, depended upon by the alfresco WAR module + + + ${groupId} + ${rootArtifactId} + ${version} + + + + + + ${alfresco.groupId} + alfresco-repository + + + + + + alfresco + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/config/alfresco/module/amp/context/service-context.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/config/alfresco/module/amp/context/service-context.xml new file mode 100644 index 00000000..645860e4 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/config/alfresco/module/amp/context/service-context.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/config/alfresco/module/amp/module-context.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/config/alfresco/module/amp/module-context.xml new file mode 100644 index 00000000..2111526d --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/config/alfresco/module/amp/module-context.xml @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/module.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/module.properties new file mode 100644 index 00000000..ff42da63 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/module.properties @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +# SDK Sample module + +# ==== Beginning of Alfresco required/optional properties ====== # + +module.id=${project.artifactId} +#module.aliases=myModule-123, my-module +module.title=${project.name} +module.description=${project.description} +module.version=${noSnapshotVersion} + +# The following optional properties can be used to prevent the module from being added +# to inappropriate versions of the WAR file. +# module.repo.version.min=2.0 +# module.repo.version.max=2.1 + +# FIXME: This dependencies should come out of mvn dependencies on amp + +# The following describe dependencies on other modules +# Depends on net.sf.myproject.module.SupportModuleA version ${version} or later +# module.depends.net.sf.myproject.module.SupportModuleA=${version}-* +# Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0 +# module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0 +# Depends on net.sf.myproject.module.SupportModuleC - any version +# module.depends.net.sf.myproject.module.SupportModuleB=* + + +# ==== End of Alfresco required/optional properties ======= # + + +# ==== Beginning of module required properties/optional ====== # \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/css/demoamp.css b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/css/demoamp.css new file mode 100644 index 00000000..c24bc1bd --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/css/demoamp.css @@ -0,0 +1,16 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/jsp/demoamp.jsp b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/jsp/demoamp.jsp new file mode 100644 index 00000000..f442d2ef --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/jsp/demoamp.jsp @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/licenses/README-licenses.txt b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/licenses/README-licenses.txt new file mode 100644 index 00000000..2a848d02 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/licenses/README-licenses.txt @@ -0,0 +1,2 @@ +This folder (root in the AMP) gets mapped automagically in WEB-INF/licenses +in the war build \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/scripts/demoamp.js b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/scripts/demoamp.js new file mode 100644 index 00000000..c24bc1bd --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/amp/web/scripts/demoamp.js @@ -0,0 +1,16 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/java/org/alfresco/demoamp/Demo.java b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/java/org/alfresco/demoamp/Demo.java new file mode 100644 index 00000000..8ea79e2a --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/java/org/alfresco/demoamp/Demo.java @@ -0,0 +1,15 @@ +package org.alfresco.demoamp; + +/** + * This class does nothing except dump some output to system.out. + * This is a sample taken from Alfresco SDK + * + * @author Derek Hulley + */ +public class Demo +{ + public void init() + { + System.out.println("SDK Demo AMP class has been loaded"); + } +} diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/java/org/alfresco/demoamp/DemoComponent.java b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/java/org/alfresco/demoamp/DemoComponent.java new file mode 100644 index 00000000..3de78f01 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/main/java/org/alfresco/demoamp/DemoComponent.java @@ -0,0 +1,26 @@ +package org.alfresco.demoamp; + +import java.util.logging.Logger; + +import org.alfresco.repo.module.AbstractModuleComponent; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * A basic component that will be started for this module. + * This is a sample taken from Alfresco SDK + * + * @author Derek Hulley + */ +public class DemoComponent extends AbstractModuleComponent +{ + Log log = LogFactory.getLog(DemoComponent.class); + + @Override + protected void executeInternal() throws Throwable + { + System.out.println("DemoComponent has been executed"); + log.debug("Test debug logging is working"); + log.info("This should not be outputted by default"); + } +} diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/test/properties/local/alfresco-global.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/test/properties/local/alfresco-global.properties new file mode 100644 index 00000000..343401a2 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/test/properties/local/alfresco-global.properties @@ -0,0 +1,57 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +# RUN TIME PROPERTIES +# ------------------- + +# Sample custom content and index data location +# This will create alf_data Relative to appserver run folder +# In this default file we take the property from the POM (for compatbility with local jetty and jboss deployments) but it can also be edited here. +dir.root=${alfresco.data.location} +# Allowed values are: NONE, AUTO, FULL +index.recovery.mode=NONE +# This is default. Allowed values are: solr, lucene, noindex +index.subsystem.name=solr + +#dir.keystore=. +#keystore.password=storepassword +#metadata.password=metapassword + +# Fail or not when there are node integrity checker errors +integrity.failOnError=true + +# Database connection properties +db.driver=${alfresco.db.datasource.class} +db.url=${alfresco.db.url} +db.username=${alfresco.db.username} +db.password=${alfresco.db.password} +db.pool.initial=10 +db.pool.max=100 + +# File servers related properties +# For local builds we disable CIFS and FTP. Edit the following property to reenable them +smb.server.enabled=false +smb.server.name=CFS_SHARE_LOCAL +smb.server.domain=mycompany.com +smb.server.bindto=127.0.0.1 +smb.tcpip.port=1445 +netbios.session.port=1139 +netbios.name.port=1137 +netbios.datagram.port=1138 +ftp.server.enables=false +ftp.port=1121 +ftp.authenticator=alfresco \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/test/resources/test-log4j.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/test/resources/test-log4j.properties new file mode 100644 index 00000000..b40d9974 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/amp/src/test/resources/test-log4j.properties @@ -0,0 +1,23 @@ +# Overrides only log4j locations and add the test logging properties +# This gets merged with the main file + +# Set root logger level to error +log4j.rootLogger=${app.log.root.level}, Console, File + +###### Console appender definition ####### + +# All outputs currently set to be a ConsoleAppender. +log4j.appender.Console=org.apache.log4j.ConsoleAppender +log4j.appender.Console.layout=org.apache.log4j.PatternLayout + +# use log4j NDC to replace %x with tenant domain / username +log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n +#log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n + +###### File appender definition ####### +log4j.appender.File=org.apache.log4j.DailyRollingFileAppender +log4j.appender.File.File=${app.log.dir}alfresco.log +log4j.appender.File.Append=true +log4j.appender.File.DatePattern='.'yyyy-MM-dd +log4j.appender.File.layout=org.apache.log4j.PatternLayout +log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 00000000..1476e74b --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,66 @@ + + + 4.0.0 + ${groupId} + ${artifactId} + ${version} + Quickstart of Alfresco and Share with DB and runner embedded + This All-in-One project allows to manage all the components involved in Alfresco development (Repo, Share, Solr, AMPs) in one project + pom + + + org.alfresco.maven + alfresco-sdk-parent + 1.0-SNAPSHOT + + + + + ${alfresco_target_groupId} + ${alfresco_target_version} + WARN + alf_data_dev + + local + + + + + + + + ${alfresco.groupId} + alfresco-platform-distribution + ${alfresco.version} + pom + import + + + + + + + + alfresco-artifacts + https://artifacts.alfresco.com/nexus/content/groups/public + + + alfresco-artifacts-snapshots + https://artifacts.alfresco.com/nexus/content/groups/public-snapshots + + never + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/jetty/jetty.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/jetty/jetty.xml new file mode 100644 index 00000000..4af5ae64 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/jetty/jetty.xml @@ -0,0 +1,34 @@ + + + + + + jdbc/dataSource + + + ${alfresco.db.url} + ${alfresco.db.username} + ${alfresco.db.password} + + + + + + + + + + + + + 300000 + 2 + false + 8443 + 20000 + 5000 + + + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/jetty/root-web.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/jetty/root-web.xml new file mode 100644 index 00000000..a2ffb44e --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/jetty/root-web.xml @@ -0,0 +1,10 @@ + + + + + + Alfresco Runner + Alfresco Runner + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/pom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/pom.xml new file mode 100644 index 00000000..b6b27c89 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + ${artifactId} + Alfresco and Share Runner + pom + Alfresco and Share Runner + + + ${groupId} + ${rootArtifactId} + ${version} + + + + + run + + + run + + + + ${project.basedir}/../solr/solr_home + 127.0.0.1 + 8080 + + + + + org.mortbay.jetty + maven-jetty-plugin + + + run + run + integration-test + + + + + / + . + jetty/root-web.xml + + + ${project.basedir}/../alfresco/target/alfresco.war + /alfresco + + + ${alfresco.solr.dir}/apache-solr-1.4.1-overlay.war + /solr + + + ${project.basedir}/../share/target/share.war + /share + + + + + solr.solr.home + ${alfresco.solr.dir} + + + + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/pom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/pom.xml new file mode 100644 index 00000000..b18d90d9 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + ${artifactId} + Alfresco Share Client + war + Alfresco Share Client + + + ${groupId} + ${rootArtifactId} + ${version} + + + + + ${alfresco.groupId} + share + war + + + + ${alfresco.groupId} + alfresco-wcm-quickstart-share + ${alfresco.version} + amp + + + + + + maven-war-plugin + + + + + + + + ${alfresco.groupId} + share + war + + + + + + ${alfresco.groupId} + alfresco-wcm-quickstart-share + amp + + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/properties/local/application.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/properties/local/application.properties new file mode 100644 index 00000000..7eace432 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/properties/local/application.properties @@ -0,0 +1,8 @@ +# SHARE client environment dependent properties (local build) +share.server.scheme=http +share.server.name=localhost +share.server.port=${jetty.port} +alfresco.server.scheme=http +alfresco.server.name=localhost +alfresco.server.port=${jetty.port} +alfresco.webapp.name=alfresco \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/alfresco/web-extension/custom-slingshot-application-context.xml.sample b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/alfresco/web-extension/custom-slingshot-application-context.xml.sample new file mode 100644 index 00000000..323b4dcb --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/alfresco/web-extension/custom-slingshot-application-context.xml.sample @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/alfresco/web-extension/share-config-custom.xml.sample b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/alfresco/web-extension/share-config-custom.xml.sample new file mode 100644 index 00000000..a6c906ad --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/alfresco/web-extension/share-config-custom.xml.sample @@ -0,0 +1,346 @@ + + + + + + + + false + + + false + + + + + + + + + + production + + + + + manual + true + + + + + + + + + + + + + + + + false + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://localhost:8080/alfresco + + + + + false + + + + application/msword + application/vnd.ms-excel + application/vnd.ms-powerpoint + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + location.path.documents + + slingshot/doclib/treenode/site/{site}/{container}{path}?children={evaluateChildFoldersSite}&max={maximumFolderCountSite} + + + + + + + + alfresco://company/home + + + + false + + + 500 + + + + + + + + + secret + + ALFRESCO.ORG + + HTTP/repository.server.com@ALFRESCO.ORG + + ShareHTTP + + + + + + + + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/log4j.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/log4j.properties new file mode 100644 index 00000000..12d10f02 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/resources/log4j.properties @@ -0,0 +1,262 @@ +# Set root logger level to error +log4j.rootLogger=${app.log.root.level}, Console, File + +###### Console appender definition ####### + +# All outputs currently set to be a ConsoleAppender. +log4j.appender.Console=org.apache.log4j.ConsoleAppender +log4j.appender.Console.layout=org.apache.log4j.PatternLayout + +# use log4j NDC to replace %x with tenant domain / username +log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n +#log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n + +###### File appender definition ####### +log4j.appender.File=org.apache.log4j.DailyRollingFileAppender +log4j.appender.File.File=${app.log.dir}share.log +log4j.appender.File.Append=true +log4j.appender.File.DatePattern='.'yyyy-MM-dd +log4j.appender.File.layout=org.apache.log4j.PatternLayout +log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n + +###### Hibernate specific appender definition ####### +#log4j.appender.file=org.apache.log4j.FileAppender +#log4j.appender.file.File=hibernate.log +#log4j.appender.file.layout=org.apache.log4j.PatternLayout +#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n + +###### Log level overrides ####### + +# Commented-in loggers will be exposed as JMX MBeans (refer to org.alfresco.repo.admin.Log4JHierarchyInit) +# Hence, generally useful loggers should be listed with at least ERROR level to allow simple runtime +# control of the level via a suitable JMX Console. Also, any other loggers can be added transiently via +# Log4j addLoggerMBean as long as the logger exists and has been loaded. + +# Hibernate +log4j.logger.org.hibernate=error +log4j.logger.org.hibernate.util.JDBCExceptionReporter=fatal +log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=fatal +log4j.logger.org.hibernate.type=warn +log4j.logger.org.hibernate.cfg.SettingsFactory=warn + +# Spring +log4j.logger.org.springframework=warn +# Turn off Spring remoting warnings that should really be info or debug. +log4j.logger.org.springframework.remoting.support=error +log4j.logger.org.springframework.util=error + +# Axis/WSS4J +log4j.logger.org.apache.axis=info +log4j.logger.org.apache.ws=info + +# CXF +log4j.logger.org.apache.cxf=error + +# MyFaces +log4j.logger.org.apache.myfaces.util.DebugUtils=info +log4j.logger.org.apache.myfaces.el.VariableResolverImpl=error +log4j.logger.org.apache.myfaces.application.jsp.JspViewHandlerImpl=error +log4j.logger.org.apache.myfaces.taglib=error + +# OpenOfficeConnection +log4j.logger.net.sf.jooreports.openoffice.connection=fatal + +# log prepared statement cache activity ### +log4j.logger.org.hibernate.ps.PreparedStatementCache=info + +# Alfresco +log4j.logger.org.alfresco=error +log4j.logger.org.alfresco.repo.admin=info +log4j.logger.org.alfresco.repo.cache.TransactionalCache=warn +log4j.logger.org.alfresco.repo.model.filefolder=warn +log4j.logger.org.alfresco.repo.tenant=info +log4j.logger.org.alfresco.repo.avm=info +log4j.logger.org.alfresco.config=warn +log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn +log4j.logger.org.alfresco.config.JBossEnabledWebApplicationContext=warn +log4j.logger.org.alfresco.repo.management.subsystems=warn +log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory=info +log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ChildApplicationContext=warn +log4j.logger.org.alfresco.repo.security.sync=info +log4j.logger.org.alfresco.repo.security.person=info + +log4j.logger.org.alfresco.sample=info +log4j.logger.org.alfresco.web=info +#log4j.logger.org.alfresco.web.app.AlfrescoNavigationHandler=debug +#log4j.logger.org.alfresco.web.ui.repo.component.UIActions=debug +#log4j.logger.org.alfresco.web.ui.repo.tag.PageTag=debug +#log4j.logger.org.alfresco.web.bean.clipboard=debug +log4j.logger.org.alfresco.repo.webservice=info +log4j.logger.org.alfresco.service.descriptor.DescriptorService=info +#log4j.logger.org.alfresco.web.page=debug + +log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=error +#log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=info + +log4j.logger.org.alfresco.web.ui.common.Utils=error +#log4j.logger.org.alfresco.web.ui.common.Utils=info + +log4j.logger.org.alfresco.repo.admin.patch.PatchExecuter=info +log4j.logger.org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl=info + +# Specific patches +log4j.logger.org.alfresco.repo.admin.patch.impl.DeploymentMigrationPatch=info +log4j.logger.org.alfresco.repo.version.VersionMigrator=info +log4j.logger.org.alfresco.repo.admin.patch.impl.ResetWCMToGroupBasedPermissionsPatch=info + +log4j.logger.org.alfresco.repo.module.ModuleServiceImpl=info +log4j.logger.org.alfresco.repo.domain.schema.SchemaBootstrap=info +log4j.logger.org.alfresco.repo.admin.ConfigurationChecker=info +log4j.logger.org.alfresco.repo.node.index.AbstractReindexComponent=warn +log4j.logger.org.alfresco.repo.node.index.IndexTransactionTracker=warn +log4j.logger.org.alfresco.repo.node.index.FullIndexRecoveryComponent=info +log4j.logger.org.alfresco.repo.node.index.AVMFullIndexRecoveryComponent=info +log4j.logger.org.alfresco.util.OpenOfficeConnectionTester=info +log4j.logger.org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl=warn +log4j.logger.org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor=warn +log4j.logger.org.alfresco.repo.transaction.RetryingTransactionHelper=warn +log4j.logger.org.alfresco.util.transaction.SpringAwareUserTransaction.trace=warn +log4j.logger.org.alfresco.util.AbstractTriggerBean=warn +log4j.logger.org.alfresco.enterprise.repo.cache.cluster.KeepAliveHeartbeatReceiver=info +log4j.logger.org.alfresco.repo.version.Version2ServiceImpl=warn + +#log4j.logger.org.alfresco.web.app.DebugPhaseListener=debug + +log4j.logger.org.alfresco.repo.workflow=info + +# CIFS server debugging +log4j.logger.org.alfresco.smb.protocol=error +#log4j.logger.org.alfresco.smb.protocol.auth=debug +#log4j.logger.org.alfresco.acegi=debug + +# FTP server debugging +log4j.logger.org.alfresco.ftp.protocol=error +#log4j.logger.org.alfresco.ftp.server=debug + +# WebDAV debugging +#log4j.logger.org.alfresco.webdav.protocol=debug +log4j.logger.org.alfresco.webdav.protocol=error + +# NTLM servlet filters +#log4j.logger.org.alfresco.web.app.servlet.NTLMAuthenticationFilter=debug +#log4j.logger.org.alfresco.repo.webdav.auth.NTLMAuthenticationFilter=debug + +# Kerberos servlet filters +#log4j.logger.org.alfresco.web.app.servlet.KerberosAuthenticationFilter=debug +#log4j.logger.org.alfresco.repo.webdav.auth.KerberosAuthenticationFilter=debug + +# File servers +log4j.logger.org.alfresco.fileserver=warn + +# Repo filesystem debug logging +#log4j.logger.org.alfresco.filesys.repo.ContentDiskDriver=debug + +# AVM filesystem debug logging +#log4j.logger.org.alfresco.filesys.avm.AVMDiskDriver=debug + +# Integrity message threshold - if 'failOnViolation' is off, then WARNINGS are generated +log4j.logger.org.alfresco.repo.node.integrity=ERROR + +# Indexer debugging +log4j.logger.org.alfresco.repo.search.Indexer=error +#log4j.logger.org.alfresco.repo.search.Indexer=debug + +log4j.logger.org.alfresco.repo.search.impl.lucene.index=error +log4j.logger.org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl=warn +#log4j.logger.org.alfresco.repo.search.impl.lucene.index=DEBUG + +# Audit debugging +# log4j.logger.org.alfresco.repo.audit=DEBUG +# log4j.logger.org.alfresco.repo.audit.model=DEBUG + +# Forms debugging +# log4j.logger.org.alfresco.web.forms=debug +# log4j.logger.org.chiba.xml.xforms=debug +log4j.logger.org.alfresco.web.forms.xforms.XFormsBean=error +log4j.logger.org.alfresco.web.forms.XSLTRenderingEngine=error + +# Property sheet and modelling debugging +# change to error to hide the warnings about missing properties and associations +log4j.logger.alfresco.missingProperties=warn +log4j.logger.org.alfresco.web.ui.repo.component.property.UIChildAssociation=warn +log4j.logger.org.alfresco.web.ui.repo.component.property.UIAssociation=warn +#log4j.logger.org.alfresco.web.ui.repo.component.property=debug + +# Dictionary/Model debugging +log4j.logger.org.alfresco.repo.dictionary=warn +log4j.logger.org.alfresco.repo.dictionary.types.period=warn + +# Virtualization Server Registry +log4j.logger.org.alfresco.mbeans.VirtServerRegistry=error + +# Spring context runtime property setter +log4j.logger.org.alfresco.util.RuntimeSystemPropertiesSetter=info + +# Debugging options for clustering +log4j.logger.org.alfresco.repo.content.ReplicatingContentStore=error +log4j.logger.org.alfresco.repo.content.replication=error + +#log4j.logger.org.alfresco.repo.deploy.DeploymentServiceImpl=debug + +# Activity service +log4j.logger.org.alfresco.repo.activities=warn + +# User usage tracking +log4j.logger.org.alfresco.repo.usage=info + +# Sharepoint +log4j.logger.org.alfresco.module.vti=info + +# Forms Engine +log4j.logger.org.alfresco.repo.forms=info +log4j.logger.org.alfresco.web.config.forms=info +log4j.logger.org.alfresco.web.scripts.forms=info + +# CMIS +log4j.logger.org.alfresco.opencmis=error +log4j.logger.org.alfresco.opencmis.AlfrescoCmisServiceInterceptor=error +log4j.logger.org.alfresco.cmis=error +log4j.logger.org.alfresco.cmis.dictionary=warn +log4j.logger.org.apache.chemistry.opencmis=info + +# IMAP +log4j.logger.org.alfresco.repo.imap=info + +# JBPM +# Note: non-fatal errors (eg. logged during job execution) should be handled by Alfresco's retrying transaction handler +log4j.logger.org.jbpm.graph.def.GraphElement=fatal + +#log4j.logger.org.alfresco.repo.googledocs=debug + +###### Scripting ####### + +# Web Framework +log4j.logger.org.springframework.extensions.webscripts=info +log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn +log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off + +# Repository +log4j.logger.org.alfresco.repo.web.scripts=warn +log4j.logger.org.alfresco.repo.web.scripts.BaseWebScriptTest=info +log4j.logger.org.alfresco.repo.web.scripts.AlfrescoRhinoScriptDebugger=off +log4j.logger.org.alfresco.repo.jscript=error +log4j.logger.org.alfresco.repo.jscript.ScriptLogger=warn +log4j.logger.org.alfresco.repo.cmis.rest.CMISTest=info + +log4j.logger.org.alfresco.repo.avm.actions=info + +# Freemarker +# Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler +log4j.logger.freemarker.runtime= + +# Metadata extraction +log4j.logger.org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter=warn + +# Reduces PDFont error level due to ALF-7105 +log4j.logger.org.apache.pdfbox.pdmodel.font.PDSimpleFont=fatal +log4j.logger.org.apache.pdfbox.pdmodel.font.PDFont=fatal +log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFont=fatal + +# no index support +log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexIndexer=fatal +log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexSearchService=fatal \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/webapp/WEB-INF/web.xml.sample b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/webapp/WEB-INF/web.xml.sample new file mode 100644 index 00000000..72710fe6 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/src/main/webapp/WEB-INF/web.xml.sample @@ -0,0 +1,167 @@ + + + + + Alfresco Project Slingshot + Alfresco Project Slingshot application + + + org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL + true + + + + + Spring config file location + contextConfigLocation + /WEB-INF/classes/web-application-config.xml + + + + Set HTTP cache Expires header 30 days forward for a mapping. + CacheExpiresFilter + org.alfresco.web.scripts.servlet.StaticAssetCacheFilter + + Add an Expires Header 30 days forward + expires + 30 + + + + + MT authentication support - NOTE: does not support portlets + MTAuthentationFilter + org.alfresco.web.site.servlet.MTAuthenticationFilter + + + + Redirects view and service URLs to the dispatcher servlet. + UrlRewriteFilter + org.tuckey.web.filters.urlrewrite.UrlRewriteFilter + + + + Share SSO authentication support filter. + Authentication Filter + org.alfresco.web.site.servlet.SSOAuthenticationFilter + + endpoint + alfresco + + + + + CacheExpiresFilter + *.jpg + + + CacheExpiresFilter + *.png + + + CacheExpiresFilter + *.gif + + + CacheExpiresFilter + *.css + + + CacheExpiresFilter + *.js + + + + Authentication Filter + /page/* + + + + Authentication Filter + /p/* + + + + Authentication Filter + /proxy/* + + + + UrlRewriteFilter + /proxy/* + + + + UrlRewriteFilter + /service/* + + + + UrlRewriteFilter + /feedservice/* + + + + UrlRewriteFilter + /res/* + + + + UrlRewriteFilter + /system/* + + + + MTAuthentationFilter + /page/* + + + MTAuthentationFilter + /p/* + + + + + org.springframework.web.context.ContextLoaderListener + + + + Spring Surf Dispatcher Servlet + org.springframework.web.servlet.DispatcherServlet + + contextAttribute + org.springframework.web.context.WebApplicationContext.ROOT + + 1 + + + + Spring Surf Dispatcher Servlet + /page/* + + + Spring Surf Dispatcher Servlet + /p/* + + + + 60 + + + + + page + index.jsp + + + + 500 + /error500.jsp + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/pom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/pom.xml new file mode 100644 index 00000000..b89abd49 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/pom.xml @@ -0,0 +1,148 @@ + + + 4.0.0 + ${artifactId} + Alfresco Apache Solr customization + pom + Alfresco Apache Solr Customization + + + ${groupId} + ${rootArtifactId} + ${version} + + + + ${project.basedir}/solr_home + ${project.build.directory}/${project.artifactId}-overlay + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-alfresco-community-lib + unpack + generate-resources + + ${alfresco.solr.dir} + + + alfresco-solr + ${alfresco.groupId} + ${alfresco.version} + zip + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + + + overlay-solr-war + generate-resources + + run + + + + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + overlay-web-xml + process-resources + copy-resources + + ${alfresco.solr.war.overlay}/WEB-INF + true + + + src/main/webapp/WEB-INF + + web.xml + + + + src/main/resources + true + classes + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + + + create-solr-war + package + + run + + + + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + copy-lib + package + copy-resources + + ${alfresco.solr.dir} + + + src/main/solr-properties/archive + true + ${alfresco.solr.dir}/archive-SpacesStore/conf + + + src/main/solr-properties/workspace + true + ${alfresco.solr.dir}/workspace-SpacesStore/conf + + + + + + + + + + + + ${alfresco.groupId} + alfresco-solr + ${alfresco.version} + zip + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/resources/log4j.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/resources/log4j.properties new file mode 100644 index 00000000..8db3649a --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/resources/log4j.properties @@ -0,0 +1,18 @@ +# Set root logger level to error +log4j.rootLogger=${app.log.root.level}, Console, File + +###### Console appender definition ####### + +# All outputs currently set to be a ConsoleAppender. +log4j.appender.Console=org.apache.log4j.ConsoleAppender +log4j.appender.Console.layout=org.apache.log4j.PatternLayout + +log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n + +###### File appender definition ####### +log4j.appender.File=org.apache.log4j.DailyRollingFileAppender +log4j.appender.File.File=${app.log.dir}solr.log +log4j.appender.File.Append=true +log4j.appender.File.DatePattern='.'yyyy-MM-dd +log4j.appender.File.layout=org.apache.log4j.PatternLayout +log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/archive/solrconfig.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/archive/solrconfig.xml new file mode 100644 index 00000000..1477c0d7 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/archive/solrconfig.xml @@ -0,0 +1,1108 @@ + + + + + + + ${enable.alfresco.tracking} + + + + ${solr.abortOnConfigurationError:true} + + + + + + + + + + + + + + + + ${data.dir.root}/${data.dir.store} + + + + + + false + + 3 + + + + + 32 + + ${max.field.length} + 1000 + 10000 + + + + + + + + + + + + + native + + + + + + + false + 32 + 3 + + + + + + + + false + + + true + + + + + + + + 1 + + 0 + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + ${solr.maxBooleanClauses} + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + ${solr.queryResultWindowSize:50} + + + ${solr.queryResultMaxDocsCached:200} + + + + + + + + + + + + + solr rocks010 + static firstSearcher warming query from solrconfig.xml + + + + + false + + + 2 + + + + + + + + + + + + + + + + + + + + + + + explicit + + + + + + + + + + + schema.xml,stopwords.txt + startup + optimize + + + + + + + + dismax + explicit + 0.01 + + text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4 + + + text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9 + + + popularity^0.5 recip(price,1,1000,1000)^0.3 + + + id,name,price,score + + + 2<-1 5<-2 6<90% + + 100 + *:* + + text features name + + 0 + + name + regex + + + + + + + + + alfresco + + + setLocale + query + facet + mlt + highlight + stats + debug + clearLocale + + + + + + afts + + + setLocale + query + facet + mlt + highlight + stats + debug + clearLocale + + + + + + cmis + + + setLocale + query + facet + mlt + highlight + stats + debug + clearLocale + + + + + + + dismax + explicit + text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 + 2<-1 5<-2 6<90% + + incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2 + + + + inStock:true + + + + cat + manu_exact + price:[* TO 500] + price:[500 TO *] + + + + + + + + + + textSpell + + + default + name + ./spellchecker + + + + + + + + + + + + false + + false + + 1 + + + spellcheck + + + + + + + + true + + + tvComponent + + + + + + + + + default + + org.carrot2.clustering.lingo.LingoClusteringAlgorithm + + 20 + + + stc + org.carrot2.clustering.stc.STCClusteringAlgorithm + + + + + true + default + true + + name + id + + features + + true + + + + false + + + clusteringComponent + + + + + + + + text + true + ignored_ + + + true + links + ignored_ + + + + + + + + + + true + + + termsComponent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + standard + solrpingquery + all + + + + + + + explicit + true + + + + + + + + + 100 + + + + + + + + 70 + + 0.5 + + [-\w ,/\n\"']{20,200} + + + + + + + ]]> + ]]> + + + + + + + + + + + + + + + 5 + + + + + + + + + + + + + + solr + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/archive/solrcore.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/archive/solrcore.properties new file mode 100644 index 00000000..bff76d9b --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/archive/solrcore.properties @@ -0,0 +1,83 @@ +# +# solrcore.properties - used in solrconfig.xml +# +# data is in ${data.dir.root}/${data.dir.store} + +data.dir.root=${alfresco.solr.dir} +data.dir.store=archive/SpacesStore +enable.alfresco.tracking=true +cache.alfresco.size=100 +max.field.length=2147483647 + + +# +# Properties loaded during alfresco tracking +# + +alfresco.host=localhost +alfresco.port=8080 +alfresco.port.ssl=8443 +alfresco.baseUrl=/alfresco +alfresco.cron=0/15 * * * * ? * +alfresco.stores=archive://SpacesStore +alfresco.lag=1000 +alfresco.hole.retention=3600000 +alfresco.batch.count=1000 + +# encryption + +# none, https +alfresco.secureComms=none + +# ssl +alfresco.encryption.ssl.keystore.type=JCEKS +alfresco.encryption.ssl.keystore.provider= +alfresco.encryption.ssl.keystore.location=ssl.repo.client.keystore +alfresco.encryption.ssl.keystore.passwordFileLocation=ssl-keystore-passwords.properties +alfresco.encryption.ssl.truststore.type=JCEKS +alfresco.encryption.ssl.truststore.provider= +alfresco.encryption.ssl.truststore.location=ssl.repo.client.truststore +alfresco.encryption.ssl.truststore.passwordFileLocation=ssl-truststore-passwords.properties + +## Tracking + +alfresco.enableMultiThreadedTracking=true +alfresco.corePoolSize=3 +alfresco.maximumPoolSize=-1 +alfresco.keepAliveTime=120 +alfresco.threadPriority=5 +alfresco.threadDaemon=true +alfresco.workQueueSize=-1 + +# HTTP Client + +alfresco.maxTotalConnections=40 +alfresco.maxHostConnections=40 + +# SOLR caching + +solr.filterCache.size=512 +solr.filterCache.initialSize=512 +solr.queryResultCache.size=512 +solr.queryResultCache.initialSize=512 +solr.documentCache.size=512 +solr.documentCache.initialSize=512 +solr.queryResultMaxDocsCached=200 + +solr.authorityCache.size=512 +solr.authorityCache.initialSize=512 +solr.pathCache.size=512 +solr.pathCache.initialSize=512 + +# SOLR + +solr.maxBooleanClauses=10000 + +# +# TODO +# +# cross language support +# locale expansion +# logging check report .... +# +# diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/workspace/solrconfig.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/workspace/solrconfig.xml new file mode 100644 index 00000000..27be2c52 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/workspace/solrconfig.xml @@ -0,0 +1,1108 @@ + + + + + + + ${enable.alfresco.tracking} + + + + ${solr.abortOnConfigurationError:true} + + + + + + + + + + + + + + + + ${data.dir.root}/${data.dir.store} + + + + + + false + + 3 + + + + + 32 + + ${max.field.length} + 1000 + 10000 + + + + + + + + + + + + + native + + + + + + + false + 32 + 3 + + + + + + + + false + + + true + + + + + + + + 1 + + 0 + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + ${solr.maxBooleanClauses} + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + ${solr.queryResultWindowSize:50} + + + ${solr.queryResultMaxDocsCached:200} + + + + + + + + + + + + + solr rocks010 + static firstSearcher warming query from solrconfig.xml + + + + + false + + + 2 + + + + + + + + + + + + + + + + + + + + + + + explicit + + + + + + + + + + + schema.xml,stopwords.txt + startup + optimize + + + + + + + + dismax + explicit + 0.01 + + text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4 + + + text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9 + + + popularity^0.5 recip(price,1,1000,1000)^0.3 + + + id,name,price,score + + + 2<-1 5<-2 6<90% + + 100 + *:* + + text features name + + 0 + + name + regex + + + + + + + + + alfresco + + + setLocale + query + facet + mlt + highlight + stats + debug + clearLocale + + + + + + afts + + + setLocale + query + facet + mlt + highlight + stats + debug + clearLocale + + + + + + cmis + + + setLocale + query + facet + mlt + highlight + stats + debug + clearLocale + + + + + + + dismax + explicit + text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 + 2<-1 5<-2 6<90% + + incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2 + + + + inStock:true + + + + cat + manu_exact + price:[* TO 500] + price:[500 TO *] + + + + + + + + + + textSpell + + + default + name + ./spellchecker + + + + + + + + + + + + false + + false + + 1 + + + spellcheck + + + + + + + + true + + + tvComponent + + + + + + + + + default + + org.carrot2.clustering.lingo.LingoClusteringAlgorithm + + 20 + + + stc + org.carrot2.clustering.stc.STCClusteringAlgorithm + + + + + true + default + true + + name + id + + features + + true + + + + false + + + clusteringComponent + + + + + + + + text + true + ignored_ + + + true + links + ignored_ + + + + + + + + + + true + + + termsComponent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + standard + solrpingquery + all + + + + + + + explicit + true + + + + + + + + + 100 + + + + + + + + 70 + + 0.5 + + [-\w ,/\n\"']{20,200} + + + + + + + ]]> + ]]> + + + + + + + + + + + + + + + 5 + + + + + + + + + + + + + + solr + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/workspace/solrcore.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/workspace/solrcore.properties new file mode 100644 index 00000000..a755bfc1 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/solr-properties/workspace/solrcore.properties @@ -0,0 +1,103 @@ +# +# solrcore.properties - used in solrconfig.xml +# +# data is in ${data.dir.root}/${data.dir.store} + +data.dir.root=${alfresco.solr.dir} +data.dir.store=workspace/SpacesStore +enable.alfresco.tracking=true +cache.alfresco.size=100 +max.field.length=2147483647 + + +# +# Properties loaded during alfresco tracking +# + +alfresco.host=localhost +alfresco.port=8080 +alfresco.port.ssl=8443 +alfresco.baseUrl=/alfresco +alfresco.cron=0/15 * * * * ? * +alfresco.stores=workspace://SpacesStore +#alfresco.index.transformContent=false +#alfresco.ignore.datatype.1=d:content +alfresco.lag=1000 +alfresco.hole.retention=3600000 +# alfresco.hole.check.after is not used yet +# It will reduce the hole checking load +alfresco.hole.check.after=300000 +alfresco.batch.count=1000 + +# encryption + +# none, https +alfresco.secureComms=none + +# ssl +alfresco.encryption.ssl.keystore.type=JCEKS +alfresco.encryption.ssl.keystore.provider= +alfresco.encryption.ssl.keystore.location=ssl.repo.client.keystore +alfresco.encryption.ssl.keystore.passwordFileLocation=ssl-keystore-passwords.properties +alfresco.encryption.ssl.truststore.type=JCEKS +alfresco.encryption.ssl.truststore.provider= +alfresco.encryption.ssl.truststore.location=ssl.repo.client.truststore +alfresco.encryption.ssl.truststore.passwordFileLocation=ssl-truststore-passwords.properties + +# Tracking + +alfresco.enableMultiThreadedTracking=true +alfresco.corePoolSize=3 +alfresco.maximumPoolSize=-1 +alfresco.keepAliveTime=120 +alfresco.threadPriority=5 +alfresco.threadDaemon=true +alfresco.workQueueSize=-1 + +# HTTP Client + +alfresco.maxTotalConnections=40 +alfresco.maxHostConnections=40 + +# SOLR caching + +solr.filterCache.size=512 +solr.filterCache.initialSize=512 +solr.queryResultCache.size=1024 +solr.queryResultCache.initialSize=1024 +solr.documentCache.size=512 +solr.documentCache.initialSize=512 +solr.queryResultMaxDocsCached=2000 + +solr.authorityCache.size=512 +solr.authorityCache.initialSize=512 +solr.pathCache.size=512 +solr.pathCache.initialSize=512 + +# SOLR + +solr.maxBooleanClauses=10000 + +# Batch fetch + +alfresco.transactionDocsBatchSize=100 +alfresco.changeSetAclsBatchSize=100 +alfresco.aclBatchSize=10 + +# Warming + +solr.filterCache.autowarmCount=128 +solr.authorityCache.autowarmCount=0 +solr.pathCache.autowarmCount=128 + +solr.queryResultWindowSize=200 + + +# +# TODO +# +# cross language support +# locale expansion +# logging check report .... +# +# diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/webapp/WEB-INF/web.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..e72f21fb --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + SolrRequestFilter + org.apache.solr.servlet.SolrDispatchFilter + + + + + + + SolrRequestFilter + /* + + + + + + SolrServer + Solr + Solr Server + org.apache.solr.servlet.SolrServlet + 1 + + + + SolrUpdate + SolrUpdate + Solr Update Handler + org.apache.solr.servlet.SolrUpdateServlet + 2 + + + + Logging + org.apache.solr.servlet.LogLevelSelection + + + + + ping + /admin/ping.jsp + + + + SolrServer + /select/* + + + + SolrUpdate + /update/* + + + + Logging + /admin/logging + + + + + ping + /admin/ping + + + + + Logging + /admin/logging.jsp + + + + .xsl + + application/xslt+xml + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/wcmqs/pom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/wcmqs/pom.xml new file mode 100644 index 00000000..896385c7 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/wcmqs/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + ${groupId} + ${rootArtifactId} + ${version} + + wcmqs + war + Alfresco Web Quick Start customization + This project allows you to customize and overlay Alfresco Web Quick Start + + + ${alfresco.groupId} + alfresco-wcm-quickstart + ${alfresco.version} + war + + + + + + maven-war-plugin + + + + + + + alfresco-wcm-quickstart + ${alfresco.groupId} + + + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/wcmqs/src/main/resources/log4j.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/wcmqs/src/main/resources/log4j.xml new file mode 100644 index 00000000..e98bc7f2 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/wcmqs/src/main/resources/log4j.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/pom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/pom.xml new file mode 100644 index 00000000..bb41734c --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + org.alfresco.maven.archetype + alfresco-amp-archetype + + maven-archetype + AMP Archetype from Maven Alfresco SDK + Sample project with full support for lifecycle and rapid development of AMPs (Alfresco Module Packages) + + + org.alfresco.maven + alfresco-lifecycle-aggregator + 1.0-SNAPSHOT + ../../pom.xml + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 00000000..a9e228f7 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,73 @@ + + + + + 1.0-SNAPSHOT + + + org.alfresco + + + 4.2.b + + + (not used) + + + + + src/main/java + + **/*.java + + + + src/main/amp + + **/*.jsp + **/*.xml + **/*.properties + **/*.txt + + + + src/main/amp + + **/*.js + **/*.css + + + + src/test/java + + **/*.java + + + + src/test/resources + + **/*.properties + + + + src/test/properties + + **/*.properties + + + + jetty + + **/*.xml + + + + + + *.txt + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/README.txt b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/README.txt new file mode 100644 index 00000000..fa3ced6f --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/README.txt @@ -0,0 +1,123 @@ +************* +Prerequisites +************* + +- The only prerequisite to follow reading this document is to have Apache Maven 3.0.3+ (or higher) installed +on your machine; there is no preferred IDE nor web container and database requirements needed. + +- It is strongly advised to use the Apache Maven official binary distributions downloaded from maven.apache.org; avoid +OS-specific distributions as much as possible. + +- add MAVEN_OPTS="-Xms256m -Xmx1G -XX:PermSize=300m" to your environment if your plan to launch tests / run embedded in Jetty + +***** +Usage +***** +This project manages an AMP and provides support for typical development lifecycle use cases like: +- packaging +- testing +- run embedded +- integration testing +- release and distribution + +of your AMP artifact. The AMPs produced with this project are fully compatible with Alfresco MMT, +in fact the Alfresco Maven plugin used to manage AMPs in this SDK embeds the official Alfresco MMT to install depdended AMPs. + +Project layout: +-------------- +- src/main/amp (maps the AMP structure, as per https://wiki.alfresco.com/wiki/AMP_Files#The_structure_of_an_AMP_file) + |-> module.properties + |-> file-mappings.properties (optional) + |-> config/ + |-> web/ + |-> licenses/ + +- src/main/java (Java classes to be packaged in the AMP embedded JAR) +- src/main/resources (resources to the packaged in the AMP embedded JAR) + +Useful commands +--------------- +- mvn package --> Runs unit tests and packages AMP in target/ +- mvn install --> Runs unit tests, packages and installs AMP in local Maven repository +- mvn install -Dmaven.test.skip=true --> Packages and installs AMP in local Maven repository, skipping tests +- mvn package -Pamp-to-war --> Runs unit tests and packages AMP onto Alfresco WAR in target/ +- mvn integration-test -Pamp-to-war --> Runs unit tests, packages AMP onto Alfresco WAR and runs in Jetty + H2 embedded for integration testing +- mvn integration-test -Pamp-to-war -Dalfresco.client.war=share --> Runs unit tests, packages AMP onto Share WAR and runs in Jetty + H2 embedded for integration testing +- mvn clean -Ppurge --> Removes DB, alf_data and log files + +Properties management +--------------------- +Properties are configurable at 2 levels: +- POM properties +- direclty in *.properties, particularly + - src/main/amp/module.properties (filtered and packaged in the AMP) + - src/test/properties//alfresco-global.properties (environment dependent properties for WAR run embedded) + +Useful properties that can be fully controlled directly in the POM are: + +alfresco.data.location (default = alf_data_dev) +alfresco.db.name (default = alf_dev) +app.log.dir (default = target/) +app.log.root.level (default = INFO) + +*************************** +Maven Alfresco SDK Overview +*************************** + +The Maven Alfresco SDK is an effort that have been developing in the last 5 years - mostly driven by community efforts on +Google Code (http://code.google.com/p/maven-alfresco-archetypes) - which delivers archetypes for building Alfresco +integration project with Maven; builds are based on Alfresco Community and Enterprise artifacts released on the +Alfresco Artifacts Repository at https://artifacts.alfresco.com + +The Maven Alfresco SDK is full rewriting of the Maven Alfresco Lifecyle (latest version 3.9.1) and it's composed of 3 efforts: + +a) POM files: + - alfresco-sdk-parent: provides lifecycle features and behaviors for typical Alfresco development projects + - alfresco-platform-distribution: describes and provides dependencyManagement for artifacts of each Alfresco release + +b) alfresco-maven-plugin: + - defines the AMP packaging type and lifecycle in Maven + - emdeds Alfresco MMT to provide safe installation of single / multiple AMP -> WAR + - will potentially grow including more use cases around Alfresco / Maven + +c) The definition of (initially 2) archetypes that show some simple project's configuration using +the parent POMs + - AMP archetype (this archetype) + - All-in-One multi-module archetype including + - Alfresco Repository AMP + - Alfresco Repository extension project (WAR, also depending on the AMP) + - Share customization project (WAR) + - Solr customization project (WAR) + - Jetty embedded runner for the full platform (mvn clean install -Prun) + + +**************************************** +Why using this SDK might be a good idea? +**************************************** +The main reported advantages of using the Maven Alfresco SDK are: + +- IDE-independent SDK, all build-related features are provided by Apache Maven, which is the only +prerequisite to use this SDK + +- No IDE manual configuration, all modern IDEs offer advanced Maven integrations, so +feel free to use Eclipse, IntelliJ, or any other IDE to write your code and leverage Maven + +- Process ready: scales from quick start rapid application development, to be seamlessly +integrated in enterprise devleopment processes like Continuous Integration and Release + +- Language independent, you don't like Maven? You can still use Ant, Ivy, Buildr, Gradle, Leiningen or any other build +system that is compatible with Maven artifact resolution mechanism; just configure artifacts.alfresco.com as (one of) your +Maven repositories and you're ready to go + +- Javadoc and Sources support, provided by artifacts.alfresco.com related Maven artifacts; you don't need to manually +configure your IDE to attach (manually downloaded) sources to your (manually downloaded) binaries. + +- Clean and readable, the build logic related with OOTB Alfresco features is wrapped in 50 lines of pom.xml + +- Advanced build functionality, inherited by your parent POMs you can use embedded databases and j2ee +containers with (almost) no configuration at all, among other features exposed below. + +- One mvn command to generate, one mvn command to run embedded, this is all you need to do to have a local Alfresco running +on an empty laptop + +- Supports community and enterprise flawlessly, allowing to switch one to another very easily \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/jetty/jetty.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/jetty/jetty.xml new file mode 100644 index 00000000..b9bf3d84 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/jetty/jetty.xml @@ -0,0 +1,16 @@ + + + + + + jdbc/dataSource + + + ${alfresco.db.url} + ${alfresco.db.username} + ${alfresco.db.password} + + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/pom.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 00000000..97e52811 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,85 @@ + + + 4.0.0 + ${groupId} + ${artifactId} + ${version} + ${artifactId} AMP project + amp + Manages the lifecycle of the ${artifactId} AMP (Alfresco Module Package) + + + org.alfresco.maven + alfresco-sdk-parent + 1.0-SNAPSHOT + + + + + ${alfresco_target_groupId} + ${alfresco_target_version} + WARN + alf_data_dev + + + alfresco + + local + + + + + + + + ${alfresco.groupId} + alfresco-platform-distribution + ${alfresco.version} + pom + import + + + + + + + ${alfresco.groupId} + alfresco-repository + + + + junit + junit + 4.8.1 + test + + + + + + + alfresco-public + https://artifacts.alfresco.com/nexus/content/groups/public + + + alfresco-public-snapshots + https://artifacts.alfresco.com/nexus/content/groups/public-snapshots + + true + daily + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/context/service-context.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/context/service-context.xml new file mode 100644 index 00000000..10441e94 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/context/service-context.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/log4j.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/log4j.properties new file mode 100644 index 00000000..798f6b2e --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/log4j.properties @@ -0,0 +1,40 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#----------------------------------------------------------------------- +# ${artifactId} module log4j.properties +# +# NOTE +# ---- +# Log4j uses the following logging levels: +# debug,info,warn,error,fatal +# +# To set the logging level of {fullClassName} to {loglevel}, +# add a line to this file of the following form: +# +# log4j.logger.{fullClassName}={loglevel} +# +# For example, to make 'com.example.MyExample' produce 'debug' +# logs, add a line like this: +# +# log4j.logger.com.example.MyExample=debug +# +# +# WARNING +# ------- +# Log properties in this log4j.properties file override/augment +# those in the webapp's main log4j.properties. +# +#----------------------------------------------------------------------- +log4j.logger.org.alfresco.demoamp.DemoComponent=${module.log.level} \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/module-context.xml b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/module-context.xml new file mode 100644 index 00000000..223aed4f --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/module-context.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/log4j.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/log4j.properties new file mode 100644 index 00000000..183137c2 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/log4j.properties @@ -0,0 +1,4 @@ +# Define here logging properties for your AMP specific classes +# This will end up in alfresco.war/WEB-INF/classes/alfresco/module/log4j.properties +# and loaded as per http://wiki.alfresco.com/wiki/Developing_an_Alfresco_Module#log4j.properties +log4j.logger.org.alfresco.demoamp=DEBUG \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/module.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/module.properties new file mode 100644 index 00000000..0e5c045a --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/module.properties @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +# SDK Sample module + +# ==== Beginning of Alfresco required/optional properties ====== # +# NB: These properties are filtered at build time by Maven, single +# sourcing from POM properties +module.id=${project.artifactId} +#module.aliases=myModule-123, my-module +module.title=${project.name} +module.description=${project.description} +module.version=${noSnapshotVersion} + +# The following optional properties can be used to prevent the module from being added +# to inappropriate versions of the WAR file. +# module.repo.version.min=2.0 +# module.repo.version.max=2.1 + +# FIXME: This dependencies should come out of mvn dependencies on amp + +# The following describe dependencies on other modules +# Depends on net.sf.myproject.module.SupportModuleA version ${version} or later +# module.depends.net.sf.myproject.module.SupportModuleA=${version}-* +# Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0 +# module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0 +# Depends on net.sf.myproject.module.SupportModuleC - any version +# module.depends.net.sf.myproject.module.SupportModuleB=* + + +# ==== End of Alfresco required/optional properties ======= # + + +# ==== Beginning of module required properties/optional ====== # \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/css/demoamp.css b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/css/demoamp.css new file mode 100644 index 00000000..c24bc1bd --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/css/demoamp.css @@ -0,0 +1,16 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/jsp/demoamp.jsp b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/jsp/demoamp.jsp new file mode 100644 index 00000000..2fe9c38a --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/jsp/demoamp.jsp @@ -0,0 +1,19 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/licenses/README-licenses.txt b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/licenses/README-licenses.txt new file mode 100644 index 00000000..3ff33baf --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/licenses/README-licenses.txt @@ -0,0 +1,2 @@ +This folder (root in the AMP) gets mapped automagically in WEB-INF/licenses +by the MMT or the alfresco-maven-plugin \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/scripts/demoamp.js b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/scripts/demoamp.js new file mode 100644 index 00000000..c24bc1bd --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/web/scripts/demoamp.js @@ -0,0 +1,16 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/Demo.java b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/Demo.java new file mode 100644 index 00000000..402f7195 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/Demo.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2005-2007 Alfresco Software Limited. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" + */ +package org.alfresco.demoamp; + +/** + * This class does nothing except dump some output to system.out. + * NB: This code is taken from Alfresco Eclipse SDK Samples + * @author Derek Hulley + */ +public class Demo +{ + public void init() + { + System.out.println("SDK Demo AMP class has been loaded"); + } +} diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/DemoComponent.java b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/DemoComponent.java new file mode 100644 index 00000000..f55e8fd2 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/DemoComponent.java @@ -0,0 +1,85 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ +package org.alfresco.demoamp; + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.module.AbstractModuleComponent; +import org.alfresco.repo.nodelocator.NodeLocatorService; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.repository.StoreRef; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * A basic component that will be started for this module. + * Uses the NodeLocatorService to easily find nodes and the + * NodeService to display them + * + * @author Gabriele Columbro + * @author Maurizio Pillitu + */ +public class DemoComponent extends AbstractModuleComponent +{ + Log log = LogFactory.getLog(DemoComponent.class); + + private NodeService nodeService; + + private NodeLocatorService nodeLocatorService; + + public void setNodeService(NodeService nodeService) { + this.nodeService = nodeService; + } + + public void setNodeLocatorService(NodeLocatorService nodeLocatorService) { + this.nodeLocatorService = nodeLocatorService; + } + + /** + * Bogus component execution + */ + @Override + protected void executeInternal() throws Throwable + { + System.out.println("DemoComponent has been executed"); + log.debug("Test debug logging. Congratulation your AMP is working"); + log.info("This is only for information purposed. Better remove me from the log in Production"); + } + + /** + * This is a demo service interaction with Alfresco Foundation API. + * This sample method returns the number of child nodes of a certain type + * under a certain node. + * + * @return + */ + public int childNodesCount(NodeRef nodeRef) + { + return nodeService.countChildAssocs(nodeRef, true); + } + + /** + * Returns the NodeRef of "Company Home" + * + * @return + */ + public NodeRef getCompanyHome() + + { + return nodeLocatorService.getNode("companyhome", null, null); + } +} diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/java/org/alfresco/demoamp/test/DemoComponentTest.java b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/java/org/alfresco/demoamp/test/DemoComponentTest.java new file mode 100644 index 00000000..3208b702 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/java/org/alfresco/demoamp/test/DemoComponentTest.java @@ -0,0 +1,77 @@ +package org.alfresco.demoamp.test; + +import static org.junit.Assert.assertEquals; + +import static org.junit.Assert.assertNotNull; + +import org.alfresco.demoamp.DemoComponent; +import org.alfresco.model.ContentModel; +import org.alfresco.repo.security.authentication.AuthenticationUtil; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.util.ApplicationContextHelper; +import org.apache.log4j.Logger; +import org.junit.BeforeClass; +import org.junit.Test; +import org.springframework.context.ApplicationContext; + +/** + * A simple class demonstrating how to run out-of-container tests + * loading Alfresco application context. + * + * @author columbro + * + */ +public class DemoComponentTest { + + private static final String ADMIN_USER_NAME = "admin"; + + static Logger log = Logger.getLogger(DemoComponentTest.class); + + protected static ApplicationContext applicationContext; + + protected static DemoComponent demoComponent; + + protected static NodeService nodeService; + + @BeforeClass + public static void initAppContext() + { + // TODO: Make testing properly working without need for helpers + // TODO: Provide this in an SDK base class + ApplicationContextHelper.setUseLazyLoading(false); + ApplicationContextHelper.setNoAutoStart(true); + applicationContext = ApplicationContextHelper.getApplicationContext(new String[] { "classpath:alfresco/application-context.xml" }); + demoComponent = (DemoComponent) applicationContext.getBean("changeme.exampleComponent"); + nodeService = (NodeService) applicationContext.getBean("NodeService"); + AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER_NAME); + log.debug("Sample test logging: If you see this message, means your unit test logging is properly configured. Change it in test-log4j.properties"); + log.debug("Sample test logging: Application Context properly loaded"); + } + + + + @Test + public void testWiring() { + assertNotNull(demoComponent); + } + + @Test + public void testGetCompanyHome() { + NodeRef companyHome = demoComponent.getCompanyHome(); + assertNotNull(companyHome); + String companyHomeName = (String) nodeService.getProperty(companyHome, ContentModel.PROP_NAME); + assertNotNull(companyHomeName); + assertEquals("Company Home", companyHomeName); + } + + @Test + public void testChildNodesCount() { + NodeRef companyHome = demoComponent.getCompanyHome(); + int childNodeCount = demoComponent.childNodesCount(companyHome); + assertNotNull(childNodeCount); + // There are 5 folders by default under Company Home + assertEquals(5, childNodeCount); + } + +} diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/properties/local/alfresco-global.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/properties/local/alfresco-global.properties new file mode 100644 index 00000000..419cca75 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/properties/local/alfresco-global.properties @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +# RUN TIME PROPERTIES +# ------------------- + +# Sample custom content and index data location +# This will create alf_data Relative to appserver run folder +# In this default file we take the property from the POM (for compatbility with local jetty and jboss deployments) but it can also be edited here. +dir.root=${alfresco.data.location} +# Allowed values are: NONE, AUTO, FULL +index.recovery.mode=NONE +# As we run embedded, we set Lucene +index.subsystem.name=lucene + +#dir.keystore=. +#keystore.password=storepassword +#metadata.password=metapassword + +# Fail or not when there are node integrity checker errors +integrity.failOnError=true + +# Database connection properties +# These are also filtered from Maven at build time from POM properties. +# Alternatively you can directly define them directly here +db.driver=${alfresco.db.datasource.class} +db.url=${alfresco.db.url} +db.username=${alfresco.db.username} +db.password=${alfresco.db.password} +db.pool.initial=10 +db.pool.max=100 + +# File servers related properties +# For local builds we disable CIFS and FTP. Edit the following property to reenable them +smb.server.enabled=false +smb.server.name=CFS_SHARE_LOCAL +smb.server.domain=mycompany.com +smb.server.bindto=127.0.0.1 +smb.tcpip.port=1445 +netbios.session.port=1139 +netbios.name.port=1137 +netbios.datagram.port=1138 +ftp.server.enables=false +ftp.port=1121 +ftp.authenticator=alfresco \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties new file mode 100644 index 00000000..bf4a4721 --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties @@ -0,0 +1,266 @@ +# This is a full override of Alfresco 4.2.b log4j.properties +# This file overwrites the alfresco.war log4j.properties + +# Set root logger level to error +log4j.rootLogger=${app.log.root.level}, Console, File + +###### Console appender definition ####### + +# All outputs currently set to be a ConsoleAppender. +log4j.appender.Console=org.apache.log4j.ConsoleAppender +log4j.appender.Console.layout=org.apache.log4j.PatternLayout + +# use log4j NDC to replace %x with tenant domain / username +log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n +#log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n + +###### File appender definition ####### +log4j.appender.File=org.apache.log4j.DailyRollingFileAppender +log4j.appender.File.File=${app.log.dir}alfresco.log +log4j.appender.File.Append=true +log4j.appender.File.DatePattern='.'yyyy-MM-dd +log4j.appender.File.layout=org.apache.log4j.PatternLayout +log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n + +###### Hibernate specific appender definition ####### +#log4j.appender.file=org.apache.log4j.FileAppender +#log4j.appender.file.File=hibernate.log +#log4j.appender.file.layout=org.apache.log4j.PatternLayout +#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n + +###### Log level overrides ####### + +# Commented-in loggers will be exposed as JMX MBeans (refer to org.alfresco.repo.admin.Log4JHierarchyInit) +# Hence, generally useful loggers should be listed with at least ERROR level to allow simple runtime +# control of the level via a suitable JMX Console. Also, any other loggers can be added transiently via +# Log4j addLoggerMBean as long as the logger exists and has been loaded. + +# Hibernate +log4j.logger.org.hibernate=error +log4j.logger.org.hibernate.util.JDBCExceptionReporter=fatal +log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=fatal +log4j.logger.org.hibernate.type=warn +log4j.logger.org.hibernate.cfg.SettingsFactory=warn + +# Spring +log4j.logger.org.springframework=warn +# Turn off Spring remoting warnings that should really be info or debug. +log4j.logger.org.springframework.remoting.support=error +log4j.logger.org.springframework.util=error + +# Axis/WSS4J +log4j.logger.org.apache.axis=info +log4j.logger.org.apache.ws=info + +# CXF +log4j.logger.org.apache.cxf=error + +# MyFaces +log4j.logger.org.apache.myfaces.util.DebugUtils=info +log4j.logger.org.apache.myfaces.el.VariableResolverImpl=error +log4j.logger.org.apache.myfaces.application.jsp.JspViewHandlerImpl=error +log4j.logger.org.apache.myfaces.taglib=error + +# OpenOfficeConnection +log4j.logger.net.sf.jooreports.openoffice.connection=fatal + +# log prepared statement cache activity ### +log4j.logger.org.hibernate.ps.PreparedStatementCache=info + +# Alfresco +log4j.logger.org.alfresco=error +log4j.logger.org.alfresco.repo.admin=info +log4j.logger.org.alfresco.repo.cache.TransactionalCache=warn +log4j.logger.org.alfresco.repo.model.filefolder=warn +log4j.logger.org.alfresco.repo.tenant=info +log4j.logger.org.alfresco.repo.avm=info +log4j.logger.org.alfresco.config=warn +log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn +log4j.logger.org.alfresco.config.JBossEnabledWebApplicationContext=warn +log4j.logger.org.alfresco.repo.management.subsystems=warn +log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory=info +log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ChildApplicationContext=warn +log4j.logger.org.alfresco.repo.security.sync=info +log4j.logger.org.alfresco.repo.security.person=info + +log4j.logger.org.alfresco.sample=info +log4j.logger.org.alfresco.web=info +#log4j.logger.org.alfresco.web.app.AlfrescoNavigationHandler=debug +#log4j.logger.org.alfresco.web.ui.repo.component.UIActions=debug +#log4j.logger.org.alfresco.web.ui.repo.tag.PageTag=debug +#log4j.logger.org.alfresco.web.bean.clipboard=debug +log4j.logger.org.alfresco.repo.webservice=info +log4j.logger.org.alfresco.service.descriptor.DescriptorService=info +#log4j.logger.org.alfresco.web.page=debug + +log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=error +#log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=info + +log4j.logger.org.alfresco.web.ui.common.Utils=error +#log4j.logger.org.alfresco.web.ui.common.Utils=info + +log4j.logger.org.alfresco.repo.admin.patch.PatchExecuter=info +log4j.logger.org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl=info + +# Specific patches +log4j.logger.org.alfresco.repo.admin.patch.impl.DeploymentMigrationPatch=info +log4j.logger.org.alfresco.repo.version.VersionMigrator=info +log4j.logger.org.alfresco.repo.admin.patch.impl.ResetWCMToGroupBasedPermissionsPatch=info + +log4j.logger.org.alfresco.repo.module.ModuleServiceImpl=info +log4j.logger.org.alfresco.repo.domain.schema.SchemaBootstrap=info +log4j.logger.org.alfresco.repo.admin.ConfigurationChecker=info +log4j.logger.org.alfresco.repo.node.index.AbstractReindexComponent=warn +log4j.logger.org.alfresco.repo.node.index.IndexTransactionTracker=warn +log4j.logger.org.alfresco.repo.node.index.FullIndexRecoveryComponent=info +log4j.logger.org.alfresco.repo.node.index.AVMFullIndexRecoveryComponent=info +log4j.logger.org.alfresco.util.OpenOfficeConnectionTester=info +log4j.logger.org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl=warn +log4j.logger.org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor=warn +log4j.logger.org.alfresco.repo.transaction.RetryingTransactionHelper=warn +log4j.logger.org.alfresco.util.transaction.SpringAwareUserTransaction.trace=warn +log4j.logger.org.alfresco.util.AbstractTriggerBean=warn +log4j.logger.org.alfresco.enterprise.repo.cache.cluster.KeepAliveHeartbeatReceiver=info +log4j.logger.org.alfresco.repo.version.Version2ServiceImpl=warn + +#log4j.logger.org.alfresco.web.app.DebugPhaseListener=debug + +log4j.logger.org.alfresco.repo.workflow=info + +# CIFS server debugging +log4j.logger.org.alfresco.smb.protocol=error +#log4j.logger.org.alfresco.smb.protocol.auth=debug +#log4j.logger.org.alfresco.acegi=debug + +# FTP server debugging +log4j.logger.org.alfresco.ftp.protocol=error +#log4j.logger.org.alfresco.ftp.server=debug + +# WebDAV debugging +#log4j.logger.org.alfresco.webdav.protocol=debug +log4j.logger.org.alfresco.webdav.protocol=error + +# NTLM servlet filters +#log4j.logger.org.alfresco.web.app.servlet.NTLMAuthenticationFilter=debug +#log4j.logger.org.alfresco.repo.webdav.auth.NTLMAuthenticationFilter=debug + +# Kerberos servlet filters +#log4j.logger.org.alfresco.web.app.servlet.KerberosAuthenticationFilter=debug +#log4j.logger.org.alfresco.repo.webdav.auth.KerberosAuthenticationFilter=debug + +# File servers +log4j.logger.org.alfresco.fileserver=warn + +# Repo filesystem debug logging +#log4j.logger.org.alfresco.filesys.repo.ContentDiskDriver=debug + +# AVM filesystem debug logging +#log4j.logger.org.alfresco.filesys.avm.AVMDiskDriver=debug + +# Integrity message threshold - if 'failOnViolation' is off, then WARNINGS are generated +log4j.logger.org.alfresco.repo.node.integrity=ERROR + +# Indexer debugging +log4j.logger.org.alfresco.repo.search.Indexer=error +#log4j.logger.org.alfresco.repo.search.Indexer=debug + +log4j.logger.org.alfresco.repo.search.impl.lucene.index=error +log4j.logger.org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl=warn +#log4j.logger.org.alfresco.repo.search.impl.lucene.index=DEBUG + +# Audit debugging +# log4j.logger.org.alfresco.repo.audit=DEBUG +# log4j.logger.org.alfresco.repo.audit.model=DEBUG + +# Forms debugging +# log4j.logger.org.alfresco.web.forms=debug +# log4j.logger.org.chiba.xml.xforms=debug +log4j.logger.org.alfresco.web.forms.xforms.XFormsBean=error +log4j.logger.org.alfresco.web.forms.XSLTRenderingEngine=error + +# Property sheet and modelling debugging +# change to error to hide the warnings about missing properties and associations +log4j.logger.alfresco.missingProperties=warn +log4j.logger.org.alfresco.web.ui.repo.component.property.UIChildAssociation=warn +log4j.logger.org.alfresco.web.ui.repo.component.property.UIAssociation=warn +#log4j.logger.org.alfresco.web.ui.repo.component.property=debug + +# Dictionary/Model debugging +log4j.logger.org.alfresco.repo.dictionary=warn +log4j.logger.org.alfresco.repo.dictionary.types.period=warn + +# Virtualization Server Registry +log4j.logger.org.alfresco.mbeans.VirtServerRegistry=error + +# Spring context runtime property setter +log4j.logger.org.alfresco.util.RuntimeSystemPropertiesSetter=info + +# Debugging options for clustering +log4j.logger.org.alfresco.repo.content.ReplicatingContentStore=error +log4j.logger.org.alfresco.repo.content.replication=error + +#log4j.logger.org.alfresco.repo.deploy.DeploymentServiceImpl=debug + +# Activity service +log4j.logger.org.alfresco.repo.activities=warn + +# User usage tracking +log4j.logger.org.alfresco.repo.usage=info + +# Sharepoint +log4j.logger.org.alfresco.module.vti=info + +# Forms Engine +log4j.logger.org.alfresco.repo.forms=info +log4j.logger.org.alfresco.web.config.forms=info +log4j.logger.org.alfresco.web.scripts.forms=info + +# CMIS +log4j.logger.org.alfresco.opencmis=error +log4j.logger.org.alfresco.opencmis.AlfrescoCmisServiceInterceptor=error +log4j.logger.org.alfresco.cmis=error +log4j.logger.org.alfresco.cmis.dictionary=warn +log4j.logger.org.apache.chemistry.opencmis=info + +# IMAP +log4j.logger.org.alfresco.repo.imap=info + +# JBPM +# Note: non-fatal errors (eg. logged during job execution) should be handled by Alfresco's retrying transaction handler +log4j.logger.org.jbpm.graph.def.GraphElement=fatal + +#log4j.logger.org.alfresco.repo.googledocs=debug + +###### Scripting ####### + +# Web Framework +log4j.logger.org.springframework.extensions.webscripts=info +log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn +log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off + +# Repository +log4j.logger.org.alfresco.repo.web.scripts=warn +log4j.logger.org.alfresco.repo.web.scripts.BaseWebScriptTest=info +log4j.logger.org.alfresco.repo.web.scripts.AlfrescoRhinoScriptDebugger=off +log4j.logger.org.alfresco.repo.jscript=error +log4j.logger.org.alfresco.repo.jscript.ScriptLogger=warn +log4j.logger.org.alfresco.repo.cmis.rest.CMISTest=info + +log4j.logger.org.alfresco.repo.avm.actions=info + +# Freemarker +# Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler +log4j.logger.freemarker.runtime= + +# Metadata extraction +log4j.logger.org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter=warn + +# Reduces PDFont error level due to ALF-7105 +log4j.logger.org.apache.pdfbox.pdmodel.font.PDSimpleFont=fatal +log4j.logger.org.apache.pdfbox.pdmodel.font.PDFont=fatal +log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFont=fatal + +# no index support +log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexIndexer=fatal +log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexSearchService=fatal +log4j.logger.org.alfresco.demoamp.test=DEBUG \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/test/resources/projects/basic/archetype.properties b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/test/resources/projects/basic/archetype.properties new file mode 100644 index 00000000..ca7ce9ef --- /dev/null +++ b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/test/resources/projects/basic/archetype.properties @@ -0,0 +1,8 @@ +#Tue Oct 30 14:23:01 CET 2012 +package=it.pkg +version=0.1-SNAPSHOT +groupId=archetype.it +alfresco_target_version=4.2.b +$=cat archetype.properties +alfresco_target_groupId=org.alfresco +artifactId=basic diff --git a/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/test/resources/projects/basic/goal.txt b/alfresco-lifecycle-aggregator/archetypes/alfresco-amp-archetype/src/test/resources/projects/basic/goal.txt new file mode 100644 index 00000000..e69de29b diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/README.txt b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/README.txt new file mode 100644 index 00000000..538abe23 --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/README.txt @@ -0,0 +1,100 @@ +*************** +What does it do +*************** + +The alfresco-maven-plugin provides the following features: + +* Packages an AMP starting from a simple (and configurable) Maven project folder structure +* Performs AMP to WAR overlay by using the Alfresco Repository ModuleManagementTool and emulating the same process +during Alfresco boostrap + + +***** +Usage +***** + ++ In order to build an AMP file, you must: +---- + +1. Define your POM as amp + +2. Specify a module.properties file in the src/main/amp folder, containing the following properties: +module.id=${project.artifactId} +module.title=${project.name} +module.description=${project.description} +module.version=${project.version} +As you can see, the file is filtered with Maven project placeholders + +3. Declare the alfresco-maven-plugin in your POM build section + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + 0.7-SNAPSHOT + + + ... + + +Always keep in mind the default project-to-AMP mapping: +* src/main/amp => / +* src/main/resources => /lib/amp-classes.jar +* src/main/java => /lib/amp-classes.kar + + ++ In order to overlay an existing Alfresco WAR file, you'll need the following elements: +---- + +1. Define the type of Alfresco WAR you want to overlay: share or alfresco + + + share + + +2. Define the following build behaviour + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-alfresco + prepare-package + + unpack + + + ${project.build.directory}/${project.build.finalName} + + + ${alfresco.groupId} + alfresco + war + ${alfresco.version} + + + + + + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + + + amps-to-war-overlay + prepare-package + + install + + + + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/ROADMAP.txt b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/ROADMAP.txt new file mode 100644 index 00000000..b1a4e02b --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/ROADMAP.txt @@ -0,0 +1,22 @@ +SHORT TERM (TODO): +* Review of the module.properties version replace. Can't it be just using resource filtering? +(i.e. a more similar approach to the buildnumber or nosnapshot plugin) +* Review the amp-to-war profile. When ran from an AMP project abuses of + the project.build.directory/project.build.finalName folder (both AMP and WAR content in there) +* Documentation +* Full release + - Alfresco POMs + - Developer & Parent POMs + - Archetypes + - Test test test + +MID TERM +* Validate module.properties : make sure all properties are there and version is correct; if not, fix it +* Fail if module-context.xml is not present +* Implement and configurations; based on that, the alfresco WAR dependency will be +included into the POM at runtime by the add-resources goal +* Test coverage (unit first, use mocking) +* Test AMP install with extensions from addons.alfresco.com +* Release alfresco-maven-plugin (on git - maven-alfresco-archetypes on Google Code) +* Finalize documentation and publish it (wiki.alfresco.com) +* Evaluate running JMeter Maven plugin in order to launch Alfresco test suites diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/pom.xml b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/pom.xml new file mode 100644 index 00000000..7b1b486c --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/pom.xml @@ -0,0 +1,91 @@ + + 4.0.0 + org.alfresco.maven.plugin + alfresco-maven-plugin + maven-plugin + Alfresco Maven Plugin + + + org.alfresco.maven + alfresco-lifecycle-aggregator + 1.0-SNAPSHOT + ../../pom.xml + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.0 + + + generated-helpmojo + + helpmojo + + + + + + + + + + org.apache.maven + maven-plugin-api + 3.0.4 + + + org.apache.maven + maven-archiver + 2.5 + + + maven-core + org.apache.maven + + + + + org.apache.maven + maven-artifact + 3.0.4 + + + org.apache.maven + maven-core + 3.0.4 + + + commons-io + commons-io + 2.1 + + + org.alfresco + alfresco-mmt + 4.2.b + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.1 + + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AmpModel.java b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AmpModel.java new file mode 100644 index 00000000..478c4f95 --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AmpModel.java @@ -0,0 +1,16 @@ +package org.alfresco.maven.plugin; + +import java.util.Arrays; +import java.util.List; + +/** + * Class holding all common well know constants for the AMP packaging/extraction process + * @author columbro + * + */ +public class AmpModel { + + public static final String AMP_FOLDER_LIB = "lib"; + + public static final List EXTENSION_LIST = Arrays.asList(new String[] {"jar","ejb","ejb-client","test-jar"}); +} diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AmpMojo.java b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AmpMojo.java new file mode 100644 index 00000000..f4d2f994 --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AmpMojo.java @@ -0,0 +1,243 @@ +package org.alfresco.maven.plugin; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Set; + +import org.alfresco.maven.plugin.archiver.AmpArchiver; +import org.apache.commons.io.FileUtils; +import org.apache.maven.archiver.MavenArchiveConfiguration; +import org.apache.maven.archiver.MavenArchiver; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.MavenProjectHelper; +import org.codehaus.plexus.archiver.jar.JarArchiver; + +/** + * Builds an AMP archive of the current project's contents. By default, + * the location of the AMP root contents is ${project.build.directory}/${project.build.finalName} + * but it can be customised using plugin's configuration. + * Java resources (in src/main/java and src/main/resources) are packages in a separate JAR file + * that is automatically bundled in the /lib folder of the AMP archive and it treated as build artifact + * (i.e. distributed on Maven repositories during deploy). + * Optionally you can include Maven dependencies into the /lib folder of the AMP archive + * and customise the classifier of both AMP and JAR archives being created + * + * @author Gabriele Columbro, Maurizio Pillitu + * @version $Id:$ + * @goal amp + * @phase package + * @requiresProject + * @threadSafe + * @requiresDependencyResolution runtime + */ +public class AmpMojo extends AbstractMojo { + + /** + * Name of the generated AMP and JAR artifacts + * + * @parameter expression="${ampFinalName}" default-value="${project.build.finalName}" + * @required + * @readonly + */ + protected String ampFinalName; + + /** + * Root folder that is packaged into the AMP + * + * @parameter default-value="${project.build.directory}/${project.build.finalName}" + * @required + * @ + */ + protected File ampBuildDirectory; + + /** + * Classifier to add to the artifact generated. If given, the artifact will be attached. + * If this is not given,it will merely be written to the output directory + * according to the finalName. + * + * @parameter + */ + protected String classifier; + + /** + * Whether (runtime scoped) JAR dependencies (including transitive) should be added or not to the generated AMP /lib folder. + * By default it's true so all direct and transitive dependencies will be added + * + * @parameter default-value="true" + * @required + */ + protected boolean includeDependencies; + + /** + * ${project.basedir}/target directory + * + * @parameter default-value="${project.build.directory}" + * @required + * @readonly + */ + protected File outputDirectory; + + /** + * (Read Only) Directory containing the classes and resource files that should be packaged into the JAR. + * + * @parameter default-value="${project.build.outputDirectory}" + * @required + * @readonly + */ + protected File classesDirectory; + + /** + * (Read Only) The Maven project. + * + * @parameter default-value="${project}" + * @required + * @readonly + */ + protected MavenProject project; + + /** + * (Read Only) The Maven session + * + * @parameter default-value="${session}" + * @readonly + * @required + */ + protected MavenSession session; + + /** + * The archive configuration to use. + * See Maven Archiver Reference. + * + * @parameter + */ + protected MavenArchiveConfiguration archive = new MavenArchiveConfiguration(); + + /** + * @component + */ + protected MavenProjectHelper projectHelper; + + public void execute() + throws MojoExecutionException { + + if(includeDependencies) { + gatherDependencies(); + } + + File ampFile = createArchive(); + if (this.classifier != null) { + this.projectHelper.attachArtifact(this.project, "amp", this.classifier, ampFile); + } else { + this.project.getArtifact().setFile(ampFile); + } + } + + /** + * Creates and returns the AMP archive, invoking the AmpArchiver + * + * @return a File pointing to an existing AMP package, contained + * in ${project.build.outputDirectory} + */ + protected File createArchive() + throws MojoExecutionException { + File jarFile = getFile( + new File(this.ampBuildDirectory, AmpModel.AMP_FOLDER_LIB), + this.ampFinalName, + this.classifier, + "jar"); + + File ampFile = getFile( + this.outputDirectory, + this.ampFinalName, + this.classifier, + "amp" + ); + + MavenArchiver jarArchiver = new MavenArchiver(); + jarArchiver.setArchiver(new JarArchiver()); + jarArchiver.setOutputFile(jarFile); + + MavenArchiver ampArchiver = new MavenArchiver(); + ampArchiver.setArchiver(new AmpArchiver()); + ampArchiver.setOutputFile(ampFile); + + if (!this.ampBuildDirectory.exists()) { + getLog().warn("ampBuildDirectory does not exist - AMP will be empty"); + } else { + try { + jarArchiver.getArchiver().addDirectory(this.classesDirectory, new String[]{}, new String[]{}); + jarArchiver.createArchive(this.session, this.project, this.archive); + } catch (Exception e) { + throw new MojoExecutionException("Error creating JAR", e); + } + try { + ampArchiver.getArchiver().addDirectory(this.ampBuildDirectory, new String[]{"**"}, new String[]{}); + ampArchiver.createArchive(this.session, this.project, this.archive); + } + catch (Exception e) { + throw new MojoExecutionException("Error creating AMP", e); + } + } + return ampFile; + } + + /** + * Builds a File object pointing to the target AMP package; the pointer to the File is created taking into + * account the (optional) artifact classifier defined + * + * @param basedir the Base Directory of the currently built project + * @param finalName the Final Name of the artifact being built + * @param classifier the optional classifier of the artifact being built + * @return a File object pointing to the target AMP package + */ + protected static File getFile(File basedir, String finalName, String classifier, String extension) { + if (classifier == null) { + classifier = ""; + } else if (classifier.trim().length() > 0 && !classifier.startsWith("-")) { + classifier = "-" + classifier; + } + return new File(basedir, finalName + classifier + "." + extension); + } + + /** + * Copies all runtime dependencies to AMP lib. By default transitive runtime dependencies are retrieved. + * This behavior can be configured via the transitive parameter + * @throws MojoExecutionException + */ + protected void gatherDependencies() throws MojoExecutionException + { + Set dependencies = null; + // Whether transitive deps should be gathered or not + dependencies = project.getArtifacts(); + + ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME ); + + for (Artifact artifact : dependencies) { + if ( !artifact.isOptional() && filter.include( artifact ) ) + { + String type = artifact.getType(); + + if (AmpModel.EXTENSION_LIST.contains(type)) + { + File targetFile = new File(ampBuildDirectory + File.separator + AmpModel.AMP_FOLDER_LIB + File.separator + artifact.getFile().getName()); + String targetFilePath = targetFile.getPath(); + try { + FileUtils.copyFile(artifact.getFile(), targetFile); + } catch (IOException e) { + throw new MojoExecutionException("Error copying transitive dependency " + artifact.getId() + " to file: " + targetFilePath); + } + } + } + } + } +} \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/InstallMojo.java b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/InstallMojo.java new file mode 100644 index 00000000..0e1aa9de --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/InstallMojo.java @@ -0,0 +1,150 @@ +package org.alfresco.maven.plugin; + +import org.alfresco.repo.module.tool.ModuleManagementTool; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.FileUtils; + +import java.io.File; +import java.io.IOException; + +/** + * Performs a AMP to WAR overlay invoking the Alfresco Repository POJO + * ModuleManagementTool.installModules() and therefore emulating the same + * WAR overlay performed by Alfresco Repository during bootstrap. + *

+ * The AMP files overlaid are all AMP runtime dependencies defined in the + * current project's build. + *

+ * Additionally (and optionally) you can define the full path of a single AMP file that needs to + * be overlaid, using the configuration element. + * + * @version $Id:$ + * @requiresDependencyResolution + * @goal install + */ +public class InstallMojo extends AbstractMojo { + + private static final String AMP_OVERLAY_FOLDER_NAME = "ampoverlays_temp"; + + /** + * Name of the generated AMP and JAR artifacts + * + * @parameter expression="${ampFinalName}" default-value="${project.build.finalName}" + * @required + * @readonly + */ + protected String ampFinalName; + + /** + * The WAR file or exploded dir to install the AMPs in. If specified + * Defaults to outputDirectory/${ampFinalName}-war + * + * @parameter expression="${warLocation}" default-value="${project.build.directory}/${project.build.finalName}-war" + */ + private File warLocation; + + /** + * One single amp file that, if exists, gets included into the list + * of modules to install within the Alfresco WAR, along with other AMP + * defined as (runtime) Maven dependencies + * + * @parameter expression="${singleAmp}" default-value="${project.build.directory}/${project.build.finalName}.amp" + */ + private File singleAmp; + + /** + * [Read Only] The target/ directory. + * + * @parameter expression="${project.build.directory}" + * @readonly + * @required + */ + private String outputDirectory; + + /** + * The maven project. + * + * @parameter expression="${project}" + * @required + * @readonly + */ + private MavenProject project; + + public InstallMojo() { + } + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + File overlayTempDir = new File(this.outputDirectory, AMP_OVERLAY_FOLDER_NAME); + getLog().debug("Setting AMP Destination dir to " + overlayTempDir.getAbsolutePath()); + + /** + * Collect all AMP runtime dependencies and copy all files + * in one single build folder, *ampDirectoryDir* + */ + try { + for (Object artifactObj : project.getRuntimeArtifacts()) { + if (artifactObj instanceof Artifact) { + Artifact artifact = (Artifact) artifactObj; + if ("amp".equals(artifact.getType())) { + File artifactFile = artifact.getFile(); + FileUtils.copyFileToDirectory(artifactFile, overlayTempDir); + getLog().debug(String.format("Copied %s into %s", artifactFile, overlayTempDir)); + } + } + } + if (this.singleAmp != null && this.singleAmp.exists()) { + if (!overlayTempDir.exists()) { + overlayTempDir.mkdirs(); + } + + FileUtils.copyFileToDirectory(this.singleAmp, overlayTempDir); + getLog().debug(String.format("Copied %s into %s", this.singleAmp, overlayTempDir)); + } + } catch (IOException e) { + getLog().error( + String.format( + "Cannot copy AMP module to folder %s", + overlayTempDir)); + } + + // Locate the WAR file to overlay - the one produced by the current project +// if (warLocation == null) { +// String warLocation = this.outputDirectory + File.separator + this.ampFinalName + "-war" + File.separator; +// this.warLocation = new File(warLocation); +// } + if (!warLocation.exists()) { + getLog().info( + "No WAR file found in " + warLocation.getAbsolutePath() + " - skipping overlay."); + } else if (overlayTempDir == null || + !overlayTempDir.exists()) { + getLog().info( + "No ampoverlay folder found in " + overlayTempDir + " - skipping overlay."); + } else if (overlayTempDir.listFiles().length == 0) { + getLog().info( + "No runtime AMP dependencies found for this build - skipping overlay."); + } else { + /** + * Invoke the ModuleManagementTool to install AMP modules on the WAR file; + * so far, no backup or force flags are enabled + */ + ModuleManagementTool mmt = new ModuleManagementTool(); + mmt.setVerbose(true); + try { + mmt.installModules( + overlayTempDir.getAbsolutePath(), + warLocation.getAbsolutePath(), + false, //preview + true, //force install + false); //backup + } catch (IOException e) { + throw new MojoExecutionException("Problems while installing " + + overlayTempDir.getAbsolutePath() + " onto " + warLocation.getAbsolutePath(), e); + } + } + } +} \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/VersionMojo.java b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/VersionMojo.java new file mode 100644 index 00000000..21b7c9b7 --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/VersionMojo.java @@ -0,0 +1,113 @@ +package org.alfresco.maven.plugin; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.project.MavenProject; + +/** + * Removes -SNAPSHOT suffix from the version number (if present), optionally replacing it with a timestamp. + * The result is provided in the Maven property ${noSnapshotVersion} (name can be changed using + * myCustomVersion). + * This feature is mostly needed to avoid Alfresco failing when installing AMP modules with non-numeric + * versions. + * + * @version $Id:$ + * @goal set-version + * @phase initialize + * @requiresProject + * @threadSafe + */ +public class VersionMojo extends AbstractMojo { + + private static final DateFormat TIMESTAMP_FORMATTER = new SimpleDateFormat("yyMMddHHmm"); + + /** + * The snapshotSuffix used to identify and strip the -SNAPSHOT version suffix + * See issue https://issues.alfresco.com/jira/browse/ENH-1232 + * + * @parameter expression="${snapshotSuffix}" default-value="-SNAPSHOT" + * @required + */ + protected String snapshotSuffix; + + /** + * Enable this option in order to replace -SNAPSHOT with the currentTimestamp + * of the artifact creation + * See issue https://issues.alfresco.com/jira/browse/ENH-1232 + * + * @parameter expression="${snapshotToTimestamp}" default-value="false" + * @required + */ + protected boolean snapshotToTimestamp; + + /** + * Allows to append a custom (numeric) value to the current artifact's version, + * i.e. appending the SCM build number can be accomplished defining + * ${buildnumber} in the plugin + * configuration. + * + * @parameter expression="${customVersionSuffix}" + */ + protected String customVersionSuffix; + + /** + * The Maven project property the stripped version is pushed into + * + * @parameter expression="${propertyName}" default-value="noSnapshotVersion" + * @required + */ + private String propertyName; + + /** + * [Read Only] The Maven project. + * + * @parameter default-value="${project}" + * @required + * @readonly + */ + protected MavenProject project; + + /** + * [Read Only] Current version of the project + * + * @parameter expression="${project.version}" + * @required + * @readonly + */ + protected String version; + + /** + * Normalizes the project's version following 2 patterns + * - Remove the -SNAPSHOT suffix, if present + * - (Optionally) append the timestamp to the version, if -SNAPSHOT is present + * - (Optionally) append the build number to the version + * + * @return the current project's version normalized + */ + protected String getNormalizedVersion() { + int separatorIndex = version.indexOf(snapshotSuffix); + String normalizedVersion = version; + if (separatorIndex > -1) { + normalizedVersion = version.substring(0, separatorIndex); + getLog().info("Removed -SNAPSHOT suffix from version - " + normalizedVersion); + } + if (this.customVersionSuffix != null && this.customVersionSuffix.length() > 0) { + normalizedVersion += "." + this.customVersionSuffix; + getLog().info("Added custom suffix to version - " + normalizedVersion); + } else if (this.snapshotToTimestamp) { + normalizedVersion += "." + TIMESTAMP_FORMATTER.format(new Date()); + getLog().info("Added timestamp to version - " + normalizedVersion); + } + return normalizedVersion; + } + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + project.getProperties().put(propertyName, getNormalizedVersion()); + } +} diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/archiver/AmpArchiver.java b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/archiver/AmpArchiver.java new file mode 100644 index 00000000..721bf48b --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/archiver/AmpArchiver.java @@ -0,0 +1,47 @@ +package org.alfresco.maven.plugin.archiver; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.codehaus.plexus.archiver.jar.JarArchiver; + +import java.io.File; + + +/** + * Emulates the JarArchiver only changing the extension name from .jar to .amp + * It also adds a logging statement that can help debugging the build + * + * @author Gabriele Columbro, Maurizio Pillitu + */ +public class AmpArchiver extends JarArchiver { + + public AmpArchiver() { + super.archiveType = "amp"; + } + + /** + * @see org.codehaus.plexus.archiver.AbstractArchiver#addDirectory(java.io.File, String, String[], String[]) + */ + public void addDirectory(final File directory, final String prefix, final String[] includes, + final String[] excludes) { + getLogger().info("Adding directory to AMP package [ '" + directory + "' '" + prefix + "']"); + super.addDirectory(directory, prefix, includes, excludes); + } +} diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/archiver/AmpUnArchiver.java b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/archiver/AmpUnArchiver.java new file mode 100644 index 00000000..848923b4 --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/archiver/AmpUnArchiver.java @@ -0,0 +1,65 @@ +package org.alfresco.maven.plugin.archiver; + +import java.io.File; + +import org.alfresco.repo.module.tool.ModuleManagementTool; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.LegacySupport; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.archiver.ArchiverException; +import org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver; +import org.codehaus.plexus.component.annotations.Requirement; + +public class AmpUnArchiver extends AbstractZipUnArchiver { + + public AmpUnArchiver() + { + } + @Requirement + private LegacySupport legacySupport; + + @Override + public File getDestDirectory() { + MavenSession session = legacySupport.getSession(); + MavenProject project = session.getCurrentProject(); + return new File(project.getBuild().getDirectory() + File.separator + project.getBuild().getFinalName()); + } + + @Override + protected void execute() throws ArchiverException { + try { + /** + * Invoke the ModuleManagementTool to install AMP modules on the WAR file; + * so far, no backup or force flags are enabled + */ + ModuleManagementTool mmt = new ModuleManagementTool(); + mmt.setVerbose(true); + getLogger().info("getDestFile ():" + getDestFile()); + getLogger().info("getDestFile ():" + getDestFile()); + getLogger().info("getDestDirectory ():" + getDestDirectory()); + + File destLocation = (getDestFile() == null || !getDestFile().exists() ) ? getDestDirectory() : getDestFile(); + + getLogger().info("Installing " + getSourceFile() + " into " + destLocation); + try { + mmt.installModule( + getSourceFile().getAbsolutePath(), + destLocation.getAbsolutePath(), + false, //preview + true, //force install + false); //backup + } catch (Exception e) { + throw new MojoExecutionException("Problems while installing " + + getSourceFile().getAbsolutePath() + " onto " + destLocation.getAbsolutePath(), e); + } + getLogger().debug("MMT invocation for " + getSourceFile().getAbsolutePath() + "complete"); + } catch (Exception e) { + throw new ArchiverException("Error while expanding " + + getSourceFile().getAbsolutePath(), e); + } finally { + + } + } + +} diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/resources/META-INF/maven/lifecycle.xml b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/resources/META-INF/maven/lifecycle.xml new file mode 100644 index 00000000..3a19e278 --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/resources/META-INF/maven/lifecycle.xml @@ -0,0 +1,27 @@ + + + amp + + + initialize + + + + set-version + + + + + + package + + + + amp + + + + + + + diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/resources/META-INF/plexus/components.xml b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/resources/META-INF/plexus/components.xml new file mode 100644 index 00000000..4ea3a12a --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/main/resources/META-INF/plexus/components.xml @@ -0,0 +1,61 @@ + + + + org.apache.maven.artifact.handler.ArtifactHandler + amp + org.apache.maven.artifact.handler.DefaultArtifactHandler + + amp + amp + amp + java + true + true + + + + + org.apache.maven.lifecycle.mapping.LifecycleMapping + amp + org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping + + + org.alfresco.maven.plugin:alfresco-maven-plugin:set-version + org.apache.maven.plugins:maven-resources-plugin:resources + org.apache.maven.plugins:maven-compiler-plugin:compile + org.apache.maven.plugins:maven-resources-plugin:testResources + org.apache.maven.plugins:maven-compiler-plugin:testCompile + org.apache.maven.plugins:maven-surefire-plugin:test + org.alfresco.maven.plugin:alfresco-maven-plugin:amp + org.apache.maven.plugins:maven-install-plugin:install + org.apache.maven.plugins:maven-deploy-plugin:deploy + + + + + + org.codehaus.plexus.archiver.Archiver + amp + org.alfresco.maven.plugin.archiver.AmpArchiver + per-lookup + + + + + + org.codehaus.plexus.archiver.UnArchiver + amp + org.alfresco.maven.plugin.archiver.AmpUnArchiver + + + org.apache.maven.plugin.LegacySupport + + + + + + diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/site/apt/usage.apt.vm b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/site/apt/usage.apt.vm new file mode 100644 index 00000000..2a725917 --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/site/apt/usage.apt.vm @@ -0,0 +1,36 @@ +----- +Maven AMP Plugin Plexus Components +----- + + + +AMP Lifecycle Mapping + +This plugin provides support for amp type of projects. \ +Lifecycle of an Alfresco modules is mapped in the file: + +{{ ${site_tags_url}/${site_pom_artifactId}-${site_pom_version}/src/main/resources/META-INF/plexus/components.xml }} + +This build produces an Alfresco compatible AMP as main build product. It supports (being derived from maven-war-plugin) +overlay of modules and transitive AMP dependency packing. + +An AMP depending on one ore more AMP will package those AMP in the final product of the build: +overlays can be configured same as in {{ http://maven.apache.org/plugins/maven-war-plugin/overlays.html }}. +A plain zip UnArchiver is used for this overlay. + + + +AMP -> WAR Unarchiver + +The default UnArchiver (role-hint="amp") used by the default maven infrastructure for .amp files is a custom UnArchiver +which behaves as the MMT, unarchiving AMPs in the proper places as dictated by {{{http://wiki.alfresco.com/wiki/AMP_Files} Alfresco AMP convention}} . +This little component allows any plugin to manage .amp dependencies in case the maven-amp-plugin is declared with true in +the current POM, basically supporting AMPs in Maven with no need for custom external tools like MMT. + +See {{ ${site_tags_url}/${site_pom_artifactId}-${site_pom_version}/src/main/resources/META-INF/plexus/components.xml }} + + +AMP Artifact Handler + +Instructs maven which type of Archive is the AMP, providing info about its inclusion in the classpath or the fact that already contains +its dependencies. diff --git a/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/site/site.xml b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/site/site.xml new file mode 100644 index 00000000..52968a5f --- /dev/null +++ b/alfresco-lifecycle-aggregator/plugins/alfresco-maven-plugin/src/site/site.xml @@ -0,0 +1,59 @@ + + + org.apache.maven.skins + maven-fluido-skin + 1.2.1 + + + + true + true + + Maven Alfresco Lifecycle + Maven Alfresco Lifecycle + /img/Alfresco-logo-transparent.gif + /index.html + + + mindthegabz + true + true + + + + + + + + + + + + Alfresco Maven Plugin - v. ${project.version} + ${site_site_url} + + + + + + + +

+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/alfresco-lifecycle-aggregator/pom.xml b/alfresco-lifecycle-aggregator/pom.xml new file mode 100644 index 00000000..45a0f154 --- /dev/null +++ b/alfresco-lifecycle-aggregator/pom.xml @@ -0,0 +1,128 @@ + + + 4.0.0 + org.alfresco.maven + alfresco-lifecycle-aggregator + 1.0-SNAPSHOT + Maven Alfresco SDK Lifecycle Aggregator + This aggregator Project builds all modules required for the Maven Alfresco SDK + pom + + + 3.0.3 + + + + + GNU Lesser General Public License v3.0 or later + http://www.gnu.org/licenses/lgpl-3.0-standalone.html + + + + + + gabriele.columbro + Gabriele Columbro + gabriele.columbro@alfresco.com + http://mindthegab.com + Alfresco Software + http://www.alfresco.com + GMT+1 + + Founder + Architect + Developer + + + + maurizio.pillitu + Maurizio Pillitu + maurizio.pillitu@alfresco.com + http://session.it + Alfresco Software + http://www.alfresco.com + GMT+1 + + Architect + Developer + + + + + + + Carlo Sciolla + carlo@backbase.com + Backbase + http://www.backbase.com + GMT+1 + http://skuro.tk + + + + + + + plugins/alfresco-maven-plugin + + poms/alfresco-sdk-parent + + archetypes/alfresco-amp-archetype + archetypes/alfresco-allinone-archetype + + + + + alfresco-releases + https://artifacts.alfresco.com/nexus/content/repositories/releases + + + + alfresco snapshots repository + alfresco-snapshots + https://artifacts.alfresco.com/nexus/content/repositories/snapshots + + + + + + 2.2 + + + + + + + org.apache.maven.plugins + maven-archetype-plugin + ${maven.archetype.version} + + + + + + org.apache.maven.archetype + archetype-packaging + ${maven.archetype.version} + + + + + + + alfresco-public + https://artifacts.alfresco.com/nexus/content/groups/public + + + + alfresco-public-snapshots + https://artifacts.alfresco.com/nexus/content/groups/public-snapshots + + + true + + + + + diff --git a/alfresco-lifecycle-aggregator/poms/alfresco-sdk-parent/pom.xml b/alfresco-lifecycle-aggregator/poms/alfresco-sdk-parent/pom.xml new file mode 100644 index 00000000..1250463a --- /dev/null +++ b/alfresco-lifecycle-aggregator/poms/alfresco-sdk-parent/pom.xml @@ -0,0 +1,640 @@ + + + 4.0.0 + org.alfresco.maven + alfresco-sdk-parent + Alfresco Maven SDK Parent POM + + The Alfresco Maven SDK Parent POM exposes the developer features of the Maven Alfresco SDK. + Declare this POM as parent for your project and select the Alfresco version/edition by defining + the alfresco.groupId and alfresco.version in your POM. + + pom + + + 1.0-SNAPSHOT + + + + GNU Lesser General Public License v3.0 or later + http://www.gnu.org/licenses/lgpl-3.0-standalone.html + + + + + 3.0.3 + + + + + org.alfresco + 4.2.b + + + alfresco + + + ${project.build.directory}/${project.build.finalName}-war + + + alf_data_dev + + alf_dev + alfresco + alfresco + MODE=PostgreSQL;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;MVCC=TRUE + + jdbc:h2:./${alfresco.data.location}/h2_data/${alfresco.db.name};${alfresco.db.params} + org.h2.jdbcx.JdbcDataSource + + + + local + + src/main/amp + src/main/properties/${env} + src/test/properties/${env} + ** + ** + + + true + -Xms256m -Xmx1524m -XX:MaxPermSize=256m -Duser.language=en + + + ${project.build.directory}/ + WARN + + + 2.3.2 + 2.4.1 + 2.4 + 1.1.1 + 2.5 + 2.12.4 + 2.3.1 + 2.4 + 2.2 + 2.2.2 + 1.7 + 6.1.26 + + 1.0-SNAPSHOT + 1.3.158 + 1.5 + + + + + + alfresco-public + https://artifacts.alfresco.com/nexus/content/groups/public + + + alfresco-public-snapshots + https://artifacts.alfresco.com/nexus/content/groups/public-snapshots + + true + daily + + + + + + + alfresco-releases + https://artifacts.alfresco.com/nexus/content/repositories/releases + + + alfresco snapshots repository + alfresco-snapshots + https://artifacts.alfresco.com/nexus/content/repositories/snapshots + + + + + ${project.artifactId} + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + ${maven.alfresco.version} + true + + true + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compiler.version} + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-resources-plugin + ${maven.resources.version} + + UTF-8 + + ftl + acp + jpg + png + gif + pdf + doc + xls + ppt + bin + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven.war.version} + + false + tools/** + + + true + + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + ${maven.alfresco.version} + + + + + org.apache.maven.plugins + maven-clean-plugin + ${maven.clean.version} + + + org.apache.maven.plugins + maven-dependency-plugin + ${maven.dependency.version} + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.version} + + + org.apache.maven.plugins + maven-install-plugin + ${maven.install.version} + + + org.apache.maven.plugins + maven-release-plugin + ${maven.release.version} + + + org.apache.maven.plugins + maven-jar-plugin + ${maven.jar.version} + + + org.mortbay.jetty + maven-jetty-plugin + ${maven.jetty.version} + + + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + + + + + + src/main/resources + ${app.filtering.enabled} + + + ${app.amp.folder} + ../${project.build.finalName} + ${app.filtering.enabled} + + + + + src/test/resources + ${app.filtering.enabled} + + + + + + + + + enable-properties-filtering + + + + src/main/properties + + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${maven.buildhelper.version} + + + add-env-properties + generate-resources + + add-resource + + + + + ${app.properties.folder} + + ${app.properties.include} + + ${app.filtering.enabled} + + + + + + + + + + + + + enable-test-properties-filtering + + + + src/test/properties + + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${maven.buildhelper.version} + + + add-env-test-properties + generate-resources + + add-test-resource + + + + + ${app.properties.test.folder} + + ${app.properties.test.include} + + ${app.filtering.enabled} + + + + + + + + + + + + enable-jetty + + + jetty/jetty.xml + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + filter-jetty-conf + + copy-resources + + process-resources + + target + + + ${project.basedir}/jetty + ${app.filtering.enabled} + + + + + + + + org.mortbay.jetty + maven-jetty-plugin + + ${project.build.directory}/jetty.xml + + + + com.h2database + h2 + ${h2.version} + + + tk.skuro.alfresco + h2-support + ${h2-support.version} + + + + + + + + + + enable-amp + + + src/main/amp/module.properties + + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.version} + + ${app.testing.jvm.args} + + + ${project.build.directory}/${project.build.finalName}/config + ${project.build.directory}/${project.build.finalName}/module.properties + + + + + + + + + com.h2database + h2 + ${h2.version} + test + + + tk.skuro.alfresco + h2-support + ${h2-support.version} + test + + + org.springframework + spring-test + 3.0.5.RELEASE + test + + + + org.springframework + spring-context + 3.0.6.RELEASE + test + + + ${alfresco.groupId} + alfresco-repository + ${alfresco.version} + config + provided + + + ${alfresco.groupId} + alfresco-data-model + ${alfresco.version} + config + provided + + + + + + + amp-to-war + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-alfresco + prepare-package + unpack + + ${alfresco.client.war.folder} + + + ${alfresco.groupId} + ${alfresco.client.war} + war + ${alfresco.version} + + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + copy-alfresco-test-resources + prepare-package + copy-resources + + ${alfresco.client.war.folder} + + + src/test/webapp + + + ${project.build.testOutputDirectory} + WEB-INF/classes + ${app.filtering.enabled} + + + + + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + + + amps-to-war-overlay + package + + install + + + + + + + org.mortbay.jetty + maven-jetty-plugin + + + run-amp-to-war + + run-exploded + + pre-integration-test + + + + ${alfresco.client.war.folder} + + + + + + + + purge + + + + + org.apache.maven.plugins + maven-clean-plugin + + + + ${project.basedir}/${alfresco.data.location} + + + ${app.log.dir} + + *.log + + + + + + + + + + + enforce-sdk-rules + + true + + + + + org.apache.maven.plugins + maven-enforcer-plugin + ${maven.enforcer.plugin} + + + enforce-sdk-requirements + + enforce + + + + + + alfresco.version + At this time the SDK is supported only for Alfresco 4.2.b and above versions + ^(4\.[2-9]|[5-9]).* + + + + alfresco.groupId + You need to select an Alfresco Edition (Community / Enterprise) by setting alfresco.groupId=org.alfresco|org.alfresco.enterprise + (org\.alfresco|org\.alfresco\.enterprise) + + + + [1.7.0,) + As the SDK works only with Alfresco 4.2+, and Alfresco 4.2+ requires Java 7, you need Java 7 + + + true + + + + + + + + +