Skip to content

Commit

Permalink
Merge pull request #54 from dgcloud/develop
Browse files Browse the repository at this point in the history
Project ported into the SDK 3.0.1 structure
  • Loading branch information
douglascrp authored Oct 23, 2019
2 parents 10a7e58 + 26d76b4 commit e915bd7
Show file tree
Hide file tree
Showing 105 changed files with 1,637 additions and 2,532 deletions.
35 changes: 35 additions & 0 deletions pdf-toolkit-repo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Alfresco Platform JAR Module - SDK 3

To run use `mvn clean install -DskipTests=true alfresco:run` or `./run.sh` and verify that it

* Runs the embedded Tomcat + H2 DB
* Runs Alfresco Platform (Repository)
* Runs Alfresco Solr4
* Packages both as JAR and AMP assembly

Try cloning it, change the port and play with `enableShare`, `enablePlatform` and `enableSolr`.

Protip: This module will work just fine as a Share module if the files are changed and
if the enablePlatform and enableSolr is disabled.

# Few things to notice

* No parent pom
* WAR assembly is handled by the Alfresco Maven Plugin configuration
* Standard JAR packaging and layout
* Works seamlessly with Eclipse and IntelliJ IDEA
* JRebel for hot reloading, JRebel maven plugin for generating rebel.xml, agent usage: `MAVEN_OPTS=-Xms256m -Xmx1G -agentpath:/home/martin/apps/jrebel/lib/libjrebel64.so`
* AMP as an assembly
* [Configurable Run mojo](https://github.com/Alfresco/alfresco-sdk/blob/sdk-3.0/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RunMojo.java) in the `alfresco-maven-plugin`
* No unit testing/functional tests just yet
* Resources loaded from META-INF
* Web Fragment (this includes a sample servlet configured via web fragment)

# TODO

* Abstract assembly into a dependency so we don't have to ship the assembly in the archetype
* Purge,
* Functional/remote unit tests



9 changes: 9 additions & 0 deletions pdf-toolkit-repo/debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Dev environment startup script for Alfresco Community ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off

set MAVEN_OPTS=-Xms256m -Xmx2G

mvnDebug clean install alfresco:run

3 changes: 3 additions & 0 deletions pdf-toolkit-repo/debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

MAVEN_OPTS="-Xms256m -Xmx2G" mvnDebug clean install alfresco:run
408 changes: 346 additions & 62 deletions pdf-toolkit-repo/pom.xml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions pdf-toolkit-repo/run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Dev environment startup script for Alfresco Community ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off

set MAVEN_OPTS=-Xms256m -Xmx2G

mvn clean install alfresco:run
3 changes: 3 additions & 0 deletions pdf-toolkit-repo/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

MAVEN_OPTS="-Xms256m -Xmx2G" mvn clean install alfresco:run

This file was deleted.

61 changes: 61 additions & 0 deletions pdf-toolkit-repo/src/main/assembly/amp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">

<!--
Note that the Module dependency specified in the configuration section for the Alfresco Maven Plugin
needs to be set to amp if any 3rd party libs should be applied by MMT:
`
<platformModules>
<moduleDependency>
<groupId>${project.groupId}</groupId>
<artifactId>some-platform-jar</artifactId>
<version>${project.version}</version>
<type>amp</type>
</moduleDependency>
-->

<id>build-amp-file</id>

<formats>
<format>amp</format>
</formats>

<includeBaseDirectory>false</includeBaseDirectory>

<files>
<!-- Filter module.properties and put at top level in the AMP -->
<file>
<source>src/main/resources/alfresco/module/${project.artifactId}/module.properties</source>
<filtered>true</filtered>
</file>
<!-- Include AMP -> WAR mapping file (needed for custom mappings) -->
<file>
<source>src/main/assembly/file-mapping.properties</source>
<filtered>false</filtered>
</file>
</files>

<fileSets>
<!-- Anything in the assembly/web directory will end up in the /web directory in the AMP -->
<fileSet>
<directory>src/main/assembly/web</directory>
<outputDirectory>web</outputDirectory>
<filtered>true</filtered> <!-- Will filter files and substitute POM props such as for example ${project.name} -->
<excludes>
<exclude>README.md</exclude>
</excludes>
</fileSet>
</fileSets>

<!-- Include the project artifact (JAR) in the /lib directory in the AMP, and any 3rd party libraries (JARs)
used by the customization.
-->
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>

</assembly>
27 changes: 27 additions & 0 deletions pdf-toolkit-repo/src/main/assembly/file-mapping.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Custom AMP to WAR location mappings

#
# The following property can be used to include the standard set of mappings.
# The contents of this file will override any defaults. The default is
# 'true', i.e. the default mappings will be augmented or modified by values in
# this file.
#
# Default mappings are:
#
# /config=/WEB-INF/classes
# /lib=/WEB-INF/lib
# /licenses=/WEB-INF/licenses
# /web/jsp=/jsp
# /web/css=/css
# /web/images=/images
# /web/scripts=/scripts
# /web/php=/php
#
include.default=true

#
# Custom mappings. If 'include.default' is false, then this is the complete set.
# Map /web to / in AMP so we can override things like favicon.ico
#
/web=/

22 changes: 22 additions & 0 deletions pdf-toolkit-repo/src/main/assembly/web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Web resources that should override out-of-the-box files

Put here any web resources that should override out-of-the-box
web resources, such as favicon.ico. They will then end up in the
*/web* directory in the AMP, and applied to the WAR, and override
any existing web resources in the Alfresco.WAR.

**Note**. Module dependency needs to be set to amp for the web resources to be applied by MMT:

`
<moduleDependency>
<groupId>${project.groupId}</groupId>
<artifactId>some-platform-jar</artifactId>
<version>${project.version}</version>
<type>amp</type>
</moduleDependency>
`

**Important**. New web resources should not be located here, but instead
in the usual place in the *src/main/resources/META-INF/resources* directory.


Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test 123
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">


<!-- PDF Toolkit service -->
<!-- PDF Toolkit service -->
<bean id="org.alfresco.extension.pdf-toolkit-service"
class="org.alfresco.extension.pdftoolkit.service.PDFToolkitServiceImpl">
<property name="serviceRegistry" ref="ServiceRegistry"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<!-- Bean action definitions -->
<import resource="classpath:alfresco/module/org.alfresco.extension.pdftoolkit/context/alfresco-pdf-toolkit-context.xml" />
<import resource="classpath:alfresco/module/${project.artifactId}/context/alfresco-pdf-toolkit-context.xml" />

<!-- iText transformers -->
<import resource="classpath:alfresco/module/org.alfresco.extension.pdftoolkit/context/service-context.xml" />
<import resource="classpath:alfresco/module/${project.artifactId}/context/service-context.xml" />

<!-- form overrides -->
<import resource="classpath:alfresco/module/org.alfresco.extension.pdftoolkit/context/custom-form-services-context.xml" />
<import resource="classpath:alfresco/module/${project.artifactId}/context/custom-form-services-context.xml" />

<!-- load the custom content model -->
<bean id="pdftoolkit-model" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/module/org.alfresco.extension.pdftoolkit/model/pdftoolkitModel.xml</value>
<value>alfresco/module/${project.artifactId}/model/pdftoolkitModel.xml</value>
</list>
</property>
</bean>
Expand Down Expand Up @@ -161,7 +161,7 @@
<bean id="pdftoolkit.properties" parent="common-placeholder-configurer">
<property name="locations">
<list>
<value>classpath:alfresco/module/org.alfresco.extension.pdftoolkit/context/pdftoolkit-config.properties</value>
<value>classpath:alfresco/module/${project.artifactId}/context/pdftoolkit-config.properties</value>
</list>
</property>
</bean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
# 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}
module.version=${project.version}

# The following optional properties can be used to prevent the module from being added
# to inappropriate versions of the WAR file.
Expand Down

This file was deleted.

10 changes: 10 additions & 0 deletions pdf-toolkit-repo/src/test/license/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Enterprise License location

Put the Alfresco Enterprise license file in this directory.
It will then be copied into the Platform WAR in the
WEB-INF/classes/alfresco/extension/license directory.

And then not be part of any other classpaths.



Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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
# -------------------

########################################################################################################################
# Alfresco configuration for running locally with Enterprise Database, such as SQL Server, Oracle etc
#
# Configuration when running Tomcat embedded from Maven.
# Property values from the POM but it can also be edited here.
########################################################################################################################

dir.root=${alfresco.data.location}

# Alfresco Repo Webapp (alfresco.war) context, ports etc
alfresco.context=alfresco
alfresco.host=localhost
alfresco.port=8080
alfresco.protocol=http

# Alfresco Share Webapp (share.war) context, ports etc
share.context=share
share.host=localhost
share.port=8080
share.protocol=http

index.subsystem.name=solr4
solr.host=localhost
solr.port=8080
solr.secureComms=none

# Don't try and recover any index
index.recovery.mode=NONE

# These jobs seem to require Lucene (Unsupported Operation with Solr) so we disable 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

# Alfresco Repository Enterprise Database Configuration, such as SQL Server, Oracle etc
# The Enterprise Driver is brought in via the tomcat7-maven-plugin as a dependency.
db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
db.url=jdbc:sqlserver://localhost:1433;databaseName=alfrescoaio
db.username=alfresco
db.password=alfresco
db.pool.initial=10
db.pool.max=100

# File servers related properties
# For local runs we disable CIFS and FTP
cifs.enabled=false
ftp.enabled=false
Loading

0 comments on commit e915bd7

Please sign in to comment.