initial checkin

This commit is contained in:
Brian Long 2021-04-22 15:58:20 -04:00
commit a7fef4641b
278 changed files with 14028 additions and 0 deletions

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Maven
target
pom.xml.versionsBackup
# Eclipse
.project
.classpath
.settings

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "disabled"
}

245
README.md Normal file
View File

@ -0,0 +1,245 @@
# Order of the Bee Development Kit
This project is a Maven aggregator for the components of the *proposed* Order of the Bee Development Kit. The proposed abbreviation for this kit is the **BeeDK**.
## Purpose
The sole purpose of this project is to build all the submodule components. It is not the Maven Parent of any Maven project. This means this project is not to be directly used by a developer using the BeeDK, but only a developer that is developing, building, or deploying the BeeDK.
## For BeeDK Users
### Configuration
There are a couple configurations required to use the components of the BeeDK. Those are covered in the sections below.
#### Plugin Repository
First, you will need define a reference to the repository for the BeeDK tiles. This is the case until they find their way into the Maven Central Repository.
You will need to define a plugin repository in your `setting.xml` or your project `pom.xml`. The following snippet is meant to be included in your `~/.m2/settings.xml` file.
> If you choose to include it in your project `pom.xml`, ignore the structure outside the `pluginRepositories` element and place that element directly under the `project` element.
```xml
<settings ...>
...
<profiles>
...
<profile>
<id>inteligr8</id>
<pluginRepositories>
<pluginRepository>
<id>inteligr8-public</id>
<url>http://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
</pluginRepository>
</pluginRepositories>
</profile>
...
</profiles>
...
</settings>
```
#### Archetype
Next, you will need to configure using a repository not named Maven Central for archetypes. Defining a location for archetypes is incredibly bug-laden in the Maven Archetype plugin framework. The only good way to achieve it is by defining an alternative `settings.xml` file. So create a new file called `.m2/beedk-settings.xml` with the following contents.
```xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>custom-archetype</id>
<repositories>
<repository>
<id>archetype</id>
<url>http://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>custom-archetype</activeProfile>
</activeProfiles>
</settings>
```
### Components
The following components are useful to users of the BeeDK.
#### Public API
| Component | Folder Link | Details |
| ------------------------------------- | ------------- | ------- |
| `beedk-acs-platform-module-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-module-tile) | Intended to be inherited by all Alfresco Platform module projects; Includes ampification, integration testing framework, and more. |
| `beedk-acs-share-module-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-module-tile) | Intended to be inherited by all Alfresco Share module projects; Includes ampification, JS compression, integration testing framework, and more. |
| `beedk-acs-platform-webapp-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-webapp-tile) | Intended to be inherited by all Alfresco Platform web application projects; Includes installing AMPs, integration testing framework, and more. |
| `beedk-acs-share-webapp-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-webapp-tile) | Intended to be inherited by all Alfresco Share web application projects; Includes installing AMPs, integration testing framework, and more. |
| `beedk-ate-springboot` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-ate-springboot) | Intended to be inherited by all Alfresco Transform Engine Spring Boot projects; Includes dependencies. |
| `beedk-ate-springboot-test` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-ate-springboot-test) | Intended to be inherited by all Alfresco Transform Engine Spring Boot projects; Includes dependencies. |
| `beedk-ate-springboot-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-ate-springboot-tile) | Intended to be inherited by all Alfresco Transform Engine Spring Boot projects; Includes Spring Boot repackaging and more. |
| `beedk-aps-ext-tile` | *Coming Soon* | Intended to be inherited by all Alfresco Process Service extension projects; Includes integration testing framework and more. |
| `beedk-flowable-ext-tile` | *Coming Soon* | Intended to be inherited by all Flowable extension projects; Includes integration testing framework and more. |
| `beedk-camunda-ext-tile` | *Coming Soon* | Intended to be inherited by all Camunda extension projects; Includes integration testing framework and more. |
#### ACS Platform Accessories
| Component | Folder Link | Details |
| ------------------------------------- | ------------- | ------- |
| `beedk-acs-platform-docker-tile` | *Coming Soon* | Intended to be inherited by any project that already includes a `beedk-acs-platform-webapp-tile` Maven Tile and wants to deliver a Docker image; Includes building and publishing the container images and more. |
| `beedk-acs-platform-sibling-it-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-sibling-it-tile) | Intended to be inherited by any Maven project that has a sibling Alfresco Platform module or web application Maven project. It enables integration testing with the sibling ACS Platform. This is great for ACS Share modules, ACS Share web applications, custom Alfresco Transform Engines, and APS extensions in **all-in-one** style Maven projects. |
| `beedk-acs-platform-artifact-it-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-artifact-it-tile) | Intended to be inherited by any Maven project that does not have a sibling Alfresco Platform module or web application Maven project. It enables integration testing with any ACS Platform as an already built Maven Artifact. This is great for ACS Share modules, ACS Share web applications, custom Alfresco Transform Engines, APS extensions, and non-Alfresco applications in **standalone** projects. |
| `beedk-acs-search-it-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-search-it-tile) | Intended to be inherited by any project that already includes a `beedk-acs-platform-*-tile` Maven Tile. It enables integration testing of the ACS Platform with the Alfresco Search Services enabled. This is great for any project requiring non-transactional search functionality for integration testing purposes. |
| `beedk-acs-lts-it-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-lts-it-tile) | Intended to be inherited by any project that already includes a `beedk-acs-platform-*-tile` Maven Tile. It enables integration testing of the ACS Platform with the Local Transform Service and the AIO Transform Engine enabled. This is great for any project requiring basic transformation functionality for integration testing purposes. |
| `beedk-ats-it-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-ats-it-tile) | Intended to be inherited by any project that already includes a `beedk-acs-platform-*-tile` Maven Tile. It enables integration testing of the ACS Platform with the Alfresco Transform Service (ATS) enabled. This is great for any project requiring Alfresco Enterprise transformation functionality for integration testing purposes. |
| `beedk-ate-it-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-ate-it-tile) | Intended to be inherited by any project that already includes a `beedk-acs-platform-*-tile` Maven Tile. It enables integration testing of the ACS Platform with a specific Alfresco Transform Engine (ATE) enabled. This is great for any project requiring custom Alfresco transformation functionality for integration testing purposes. |
#### ACS Share Accessories
| Component | Folder Link | Details |
| ------------------------------------- | ------------- | ------- |
| `beedk-acs-share-docker-tile` | *Coming Soon* | Intended to be inherited by any project that already includes a `beedk-acs-share-webapp-tile` Maven Tile and wants to deliver a Docker image; Includes building and publishing the container images and more. |
#### ACS Share Accessories
| Component | Folder Link | Details |
| ------------------------------------- | ------------- | ------- |
| `beedk-ate-docker-tile` | *Coming Soon* | Intended to be inherited by any project that already includes a `beedk-ate-app-tile` tile and wants to deliver a Docker image. |
#### Rapid Application Development
| Component | Folder Link | Details |
| -------------------------------------- | ------------- | ------- |
| `beedk-acs-platform-self-rad-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-self-rad-tile) | Intended to be inherited by any Alfresco Platform module or web application projects; Includes startup with partial hot reloading. |
| `beedk-acs-platform-sibling-rad-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-sibling-rad-tile) | Intended to be inherited by any Maven project that has a sibling Alfresco Platform module or web application Maven project; Includes simple startup to assist with development. |
| `beedk-acs-platform-artifact-rad-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-artifact-rad-tile) | Intended to be inherited by any Maven project that wants to use the Alfresco Platform web application; Includes simple startup to assist with development. |
| `beedk-acs-share-self-rad-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-self-rad-tile) | Intended to be inherited by any Alfresco Platform module or web application projects; Includes startup with partial hot reloading. |
| `beedk-ate-rad-tile` | [Source](/inteligr8/ootbee-beedk/src/stable/beedk-ate-rad-tile) | Intended to be inherited by any Alfresco Transform Engine projects; Includes startup with partial hot reloading. |
### Rapid Application Development
If your project includes RAD tiles, you can start the application with the following command.
```sh
mvn -Drad process-classes
```
To stop RAD and remove the Docker containers, you will need to do it through Docker commands. This will differ between operating systems.
#### SH or BASH Shells
```sh
docker container stop `docker container ls -q --filter={artifactId}-*`
docker container rm `docker container ls -aq --filter={artifactId}-*`
```
#### Microsoft PowerShell
```PowerShell
docker container ls -q --filter={artifactId}-* | % { docker container stop $_ }
docker container ls -aq --filter={artifactId}-* | % { docker container rm $_ }
```
### Archetypes
| Archetype | Folder Link | Details |
| --------------------------- | ------------- | ------- |
| `beedk-acs-platform-module` | *Coming Soon* | Generates a standalone ACS Platform module project. |
| `beedk-acs-platform-webapp` | *Coming Soon* | Generates a standalone ACS Platform webapp project. |
| `beedk-acs-share-module` | *Coming Soon* | Generates a standalone ACS Share module project. |
| `beedk-acs-share-webapp` | *Coming Soon* | Generates a standalone ACS Share webapp project. |
| `beedk-acs-aio` | *Coming Soon* | Generates a parent, ACS Platform webapp, ACS Share webapp, 2 sample ACS Platform module, and 2 sample ACS Share module projects. |
| `beedk-ate-app` | *Coming Soon* | Generates a standalone Alfresco Transform Engine project. |
| `beedk-ate-aio` | *Coming Soon* | Generates a parent, ATE app, ACS Platform webapp, ACS Share webapp, and a sample ACS Platform module projects. The ACS Platform module will include sample ATE configuration. |
| `beedk-activiti-ext` | *Coming Soon* | Generates a standalone APS/Activiti extension project. |
| `beedk-flowable-ext` | *Coming Soon* | Generates a standalone [Flowable](https://flowable.com) extension project. Flowable is a fork of Activiti 6. |
| `beedk-camunda-ext` | *Coming Soon* | Generates a standalone [Camunda](https://camunda.com) extension project. Camunda is a fork of Activiti 5. |
You can use one of these Maven Archetypes to generate a new project by executing the following at the command line.
```sh
mvn -s ~/.m2/beedk-settings.xml archetype:generate
```
### Scaffolding
This is a feature that is designed to be extended in the near future. It will include minimal engines on first release. The goals is to "generate" resources and code for developers so they can quickly implement certain features. Each feature supported is called a scaffolding engine. The goal is to support several scaffold engines that would execute like the following command.
```sh
mvn -Dscaffold-webscript -Dbeedk.name=test-webscript -Dbeedk.method=get -Dbeedk.style=java
```
There is currently one scaffolding engine implemented, but it is useful across all the BeeDK Maven Tiles.
| Engine | Options | Description |
| --------------- | ------- | ----------- |
| `scaffold` | | Generates the required files for the applicable Maven Tile. |
The plan is to implement the following engines (and more).
| Engine | Options | Description |
| ----------------------- | ------- | ----------- |
| `scaffold-webscript` | `name`, `method` (**`get`**, `post`, ...), `style` (**`java`**, `java-ftl`, `js`) | Generates skeleton code for the configuration and implementation of a Spring Web Script; a ReST entrypoint. |
| `scaffold-behavior` | `name`, `event` (`onUpdateProperties`, ...) | Generates skeleton code for the configuration and implementation of an Alfresco Policy Behavior; an event listener entrypoint. |
| `scaffold-job` | `name`, `schedule` | Generates skeleton code for the configuration and implementation of a Quartz Job; a scheduled periodic execution entrypoint. |
| `scaffold-action` | `name` | Generates skeleton code for the configuration and implementation of an Alfresco Action; a function that may be executed through API calls or ACS Share hooks. |
| `scaffold-rendition` | `name` | Generates skeleton code for the configuration of an Alfresco rendition. |
| `scaffold-evaluator` | `name`, `type` (**`component`**, `em`) | Generates skeleton code for the configuration and implementation of a Spring Surf (ACS Share) evaluator; a conditional filter on user interface components or extensibility modules. |
| `scaffold-extmodule` | `name`, `style` (**`config`**, `webscript`) | Generates skeleton code for the configuration and implementation of a Spring Surf extensibility module. |
| `scaffold-transformer` | `name` | Generates skeleton code for the configuration and implementation of an Alfresco Transform Engine Spring Boot application and transformer Spring service. |
## For BeeDK Maintainers
### Build Components
You can build the components of the BeeDK by cloning this repository and executing the typical Maven commands. There is nothing special to consider. A brief example is provided below.
```sh
git clone git@bitbucket.org:inteligr8/ootbee-beedk.git
cd ootbee-beedk
mvn clean package
```
### Development Model
This project uses a development model with two active Git branches: `develop` and `stable`. All changes are to be made to branches not named `stable`. If you use neither of these branches, first merge your changes into the `develop` branch. Those changes should then be merged into the `stable` branch. The following sets of commands intends to demonstrate all the Maven and Git commands used from inception to delivery of each bug fix or feature request.
#### Fork & Pull Requesst
If you choose to fork the repository, then no problem. When you want to "push" you changes to this repository, create a pull request against the `develop` branch.
#### For Direct Maintainers
```sh
git clone git@bitbucket.org:inteligr8/ootbee-beedk.git
cd ootbee-beedk
git checkout develop
git checkout -b personal
# make your changes
mvn clean package
git add .
git commit -m "your informative commit message"
git push -u origin personal
# make more changes
mvn clean verify
git add .
git commit -m "another informative commmit message"
git push origin
# development done
git checkout develop
git merge personal
# resolve conflicts, if applicable
git push origin
git checkout stable
git merge develop
mvn versions:set
mvn clean deploy
git add pom.xml
git commit -m "vX.Y.Z poms"
git tag vX.Y.Z
git push origin
git push origin vX.Y.Z
git checkout develop
```

View File

@ -0,0 +1,9 @@
# Maven
/target
pom.xml.versionsBackup
# Eclipse
.settings
.project
.classpath

View File

@ -0,0 +1,52 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-acs-allinone-archetype</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<name>Order of the Bee Development Kit: Project Scaffolding for multi-module ACS projects</name>
<scm>
<url>https://bitbucket.org/inteligr8/ootbee-beedk</url>
</scm>
<organization>
<name>Order of the Bee</name>
<url>https://orderofthebee.net</url>
</organization>
<developers>
<developer>
<name>Brian Long</name>
<email>brian@inteligr8.com</email>
<organization>Inteligr8</organization>
<organizationUrl>https://www.inteligr8.com</organizationUrl>
<url>https://twitter.com/brianmlong</url>
</developer>
</developers>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
<version>3.1.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,50 @@
<archetype-descriptor name="${project.artifactId}"
xmlns="https://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0 https://maven.apache.org/xsd/archetype-descriptor-1.1.0.xsd">
<requiredProperties>
<requiredProperty key="shortname">
<validationRegex>[A-Za-z0-9]+</validationRegex>
</requiredProperty>
<requiredProperty key="dockerRegistryHost">
<defaultValue>quay.io</defaultValue>
</requiredProperty>
<requiredProperty key="dockerImagePrefix">
<defaultValue>local</defaultValue>
</requiredProperty>
<requiredProperty key="beedkVersion">
<defaultValue>[1.0.0,2.0.0)</defaultValue>
</requiredProperty>
</requiredProperties>
<fileSets>
<fileSet filtered="true" packaged="true">
<directory></directory>
<includes>
<include>*/src/main/java/**/*.java</include>
<include>*/src/test/java/**/*.java</include>
<include>*/src/main/extension/templates/webscripts/**/*</include>
<include>*/src/main/resources/alfresco/extension/templates/webscripts/**/*</include>
</includes>
</fileSet>
<fileSet filtered="true">
<directory></directory>
<includes>
<include>*/src/**/*</include>
</includes>
<excludes>
<exclude>*/src/main/java/**/*.java</exclude>
<exclude>*/src/test/java/**/*.java</exclude>
<exclude>*/src/main/extension/templates/webscripts/**/*</exclude>
<exclude>*/src/main/resources/alfresco/extension/templates/webscripts/**/*</exclude>
</excludes>
</fileSet>
<fileSet filtered="false">
<directory></directory>
<includes>
<include>.gitignore</include>
<include>rad.*</include>
<include>*.md</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>

View File

@ -0,0 +1,8 @@
# Maven
/target
pom.xml.versionsBackup
# Eclipse
.settings
.project
.classpath

View File

@ -0,0 +1,62 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}-platform-A</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}-parent</artifactId>
<version>${version}</version>
<relativePath>..</relativePath>
</parent>
<name>${shortname} ACS Platform Module A</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>acs-community-packaging</artifactId>
<version>${alfresco.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Very popular, but not required, dependency -->
<!-- Provided as an example -->
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-repository</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<!-- This assures the parent properties override defaults in the tiles -->
<applyBefore>${groupId}:${artifactId}-parent</applyBefore>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-self-rad-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-platform-self-rad-tile:${beedkVersion}</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-module-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-platform-module-tile:${beedkVersion}</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-self-it-tile
<tile>com.inteligr8.ootbee:beedk-acs-platform-self-it-tile:${beedkVersion}</tile> -->
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,66 @@
function discoverArtifactId {
$script:ARTIFACT_ID=(mvn -q -Dexpression=project"."artifactId -DforceStdout help:evaluate)
}
function rebuild {
echo "Rebuilding project ..."
mvn process-classes
}
function start_ {
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
mvn -Drad process-classes
}
function stop_ {
discoverArtifactId
echo "Stopping Docker containers that supported rapid application development ..."
docker container ls --filter name=${ARTIFACT_ID}-*
echo "Stopping containers ..."
docker container stop (docker container ls -q --filter name=${ARTIFACT_ID}-*)
echo "Removing containers ..."
docker container rm (docker container ls -aq --filter name=${ARTIFACT_ID}-*)
}
function tail_logs {
param (
$container
)
discoverArtifactId
docker container logs -f (docker container ls -q --filter name=${ARTIFACT_ID}-${container})
}
function list {
discoverArtifactId
docker container ls --filter name=${ARTIFACT_ID}-*
}
switch ($args[0]) {
"start" {
start_
}
"stop" {
stop_
}
"restart" {
stop_
start_
}
"rebuild" {
rebuild
}
"tail" {
tail_logs $args[1]
}
"containers" {
list
}
default {
echo "Usage: .\rad.ps1 [ start | stop | restart | rebuild | tail {container} | containers ]"
}
}
echo "Completed!"

View File

@ -0,0 +1,63 @@
#!/bin/sh
discoverArtifactId() {
ARTIFACT_ID=`mvn -q -Dexec.executable=echo -Dexec.args='${project.artifactId}' --non-recursive exec:exec 2>/dev/null`
}
rebuild() {
echo "Rebuilding project ..."
mvn process-classes
}
start() {
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
mvn -Drad process-classes
}
stop() {
discoverArtifactId
echo "Stopping Docker containers that supported rapid application development ..."
docker container ls --filter name=${ARTIFACT_ID}-*
echo "Stopping containers ..."
docker container stop `docker container ls -q --filter name=${ARTIFACT_ID}-*`
echo "Removing containers ..."
docker container rm `docker container ls -aq --filter name=${ARTIFACT_ID}-*`
}
tail_logs() {
discoverArtifactId
docker container logs -f `docker container ls -q --filter name=${ARTIFACT_ID}-$1`
}
list() {
discoverArtifactId
docker container ls --filter name=${ARTIFACT_ID}-*
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
rebuild)
rebuild
;;
tail)
tail_logs $2
;;
containers)
list
;;
*)
echo "Usage: ./rad.sh [ start | stop | restart | rebuild | tail {container} | containers ]"
exit 1
esac
echo "Completed!"

View File

@ -0,0 +1,42 @@
package ${package};
import java.util.List;
import org.alfresco.repo.action.ParameterDefinitionImpl;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* This class is an example of how you can use the Alfresco Java Public API in Alfresco Actions.
*/
public class ExampleActionExecuter extends ActionExecuterAbstractBase {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
protected ServiceRegistry serviceRegistry;
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
paramList.add(new ParameterDefinitionImpl("example.param", DataTypeDefinition.TEXT, false, "Param #1"));
}
@Override
protected void executeImpl(Action action, NodeRef actionedUponNoderef) {
if (this.logger.isTraceEnabled())
this.logger.trace("executeImpl('" + actionedUponNoderef + "')");
String value = (String)action.getParameterValue("example.param");
// TODO do some work
}
}

View File

@ -0,0 +1,76 @@
package ${package};
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* This class is an example of how you can use the Alfresco Java Public API on startup or shutdown.
*/
@Component
public class ExampleBootstrap implements InitializingBean, DisposableBean {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
protected ServiceRegistry serviceRegistry;
@Override
public void afterPropertiesSet() throws Exception {
if (this.logger.isTraceEnabled())
this.logger.trace("onStartup()");
// provide some authority within the Alfresco context
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork() throws Exception {
// provide expected hiccup/concurrency protection
return ExampleBootstrap.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>() {
@Override
public Void execute() throws Throwable {
ExampleBootstrap.this.onStartup();
return null;
}
});
}
});
}
@Override
public void destroy() throws Exception {
if (this.logger.isTraceEnabled())
this.logger.trace("onShutdown()");
// provide some authority within the Alfresco context
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork() throws Exception {
// provide expected hiccup/concurrency protection
return ExampleBootstrap.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>() {
@Override
public Void execute() throws Throwable {
ExampleBootstrap.this.onShutdown();
return null;
}
});
}
});
}
public void onStartup() {
// TODO do some work
}
public void onShutdown() {
// TODO do some work
}
}

View File

@ -0,0 +1,48 @@
package ${package};
import org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy;
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* This class is an example of how you can use the Alfresco Java Public API when Alfresco triggers an event.
*/
@Component
public class ExampleEventListener implements InitializingBean, OnCreateNodePolicy {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
protected ServiceRegistry serviceRegistry;
@Override
public void afterPropertiesSet() throws Exception {
this.bind();
}
public void bind() {
if (this.logger.isTraceEnabled())
this.logger.trace("bind()");
// example listener
this.serviceRegistry.getPolicyComponent().bindClassBehaviour(OnCreateNodePolicy.QNAME, this,
new JavaBehaviour(this, OnCreateNodePolicy.QNAME.getLocalName(), NotificationFrequency.TRANSACTION_COMMIT));
}
@Override
public void onCreateNode(ChildAssociationRef childAssocRef) {
if (this.logger.isTraceEnabled())
this.logger.trace("onCreateNode('" + childAssocRef.getChildRef() + "')");
// TODO do some work
}
}

View File

@ -0,0 +1,35 @@
package ${package};
import org.alfresco.service.ServiceRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.extensions.webscripts.AbstractWebScript;
import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
* This class is an example of how you can use the Alfresco Java Public API by listening for external ReST requests.
*
* The component value (bean ID) must start with 'webscript.' and end with '.{rest_method}'.
*/
@Component(value = "webscript.${package}.exampleJava.get")
public class ExampleGetWebScript extends AbstractWebScript {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
protected ServiceRegistry serviceRegistry;
@Override
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
if (this.logger.isTraceEnabled())
this.logger.trace("execute()");
// TODO do some work
}
}

View File

@ -0,0 +1,29 @@
package ${package};
import org.alfresco.repo.processor.BaseProcessorExtension;
import org.alfresco.service.ServiceRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* This class is an example of how you can use the Alfresco Java Public API to extend the JavaScript engine.
*/
public class ExampleJavaScriptRootObject extends BaseProcessorExtension {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
protected ServiceRegistry serviceRegistry;
public String getMessage(String messageKey) {
if (this.logger.isTraceEnabled())
this.logger.trace("getMessage('" + messageKey + "')");
// just and example method, called in JS with: example.getMessage("example.property");
return this.serviceRegistry.getDictionaryService().getMessage(messageKey);
}
}

View File

@ -0,0 +1,76 @@
package ${package};
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
import org.quartz.CronScheduleBuilder;
import org.quartz.Job;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
/**
* This class is an example of how you can use the Alfresco Java Public API on a routine schedule.
*/
@Component
public class ExampleJob implements Job {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
private ServiceRegistry serviceRegistry;
@Bean
public JobDetail jobDetail() {
return JobBuilder.newJob().ofType(this.getClass())
.withIdentity("exampleJobName", "${groupId}.${artifactId}")
.build();
}
@Bean
public Trigger trigger(JobDetail jobDetail) {
return TriggerBuilder.newTrigger().forJob(jobDetail)
.withIdentity("exampleTriggerName", "${groupId}.${artifactId}")
.withSchedule(CronScheduleBuilder.dailyAtHourAndMinute(3, 30))
.build();
}
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
if (this.logger.isTraceEnabled())
this.logger.trace("execute('" + context.getFireInstanceId() + "')");
// provide some authority within the Alfresco context
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork() throws Exception {
// provide expected hiccup/concurrency protection
return ExampleJob.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>() {
@Override
public Void execute() throws Throwable {
ExampleJob.this.fire(context);
return null;
}
});
}
});
}
public void fire(JobExecutionContext context) throws JobExecutionException {
if (this.logger.isTraceEnabled())
this.logger.trace("fire('" + context.getFireInstanceId() + "')");
// TODO do some work
}
}

View File

@ -0,0 +1,12 @@
package ${package}.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ModuleEarlyComponent {
}

View File

@ -0,0 +1,12 @@
package ${package}.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ModuleLateComponent {
}

View File

@ -0,0 +1,9 @@
<!-- Documentation: https://docs.alfresco.com/content-services/6.2/develop/reference/web-scripts-ref -->
<webscript>
<shortname>Example Webscript</shortname>
<description>Example Java-backed webscript description</description>
<url>/exampleJava?paramName={paramValue}</url>
<authentication>user</authentication>
<format default="json"></format>
<family>${shortname}</family>
</webscript>

View File

@ -0,0 +1,9 @@
<!-- Documentation: https://docs.alfresco.com/content-services/6.2/develop/reference/web-scripts-ref -->
<webscript>
<shortname>Example Webscript</shortname>
<description>Example JS-backed webscript description</description>
<url>/exampleJs?paramName={paramValue}</url>
<authentication>guest</authentication>
<format default="json"></format>
<family>${shortname}</family>
</webscript>

View File

@ -0,0 +1,4 @@
logger.log("exampleJavaScript('" + person.userName + "'):");
// TODO do your work

View File

@ -0,0 +1,5 @@
# It is a good idea to document required properties, and comment them out to force failure
#example.property.required=
# Document other properties too, but give them default values
example.property.defaulted=default value

View File

@ -0,0 +1,10 @@
# These are values accessible within the Alfresco API
# You can use 'title' and 'description'
# You can define them for all types, aspects, and properties
# These are standard resource bundles; great for supporting multiple languages: https://www.baeldung.com/java-resourcebundle
# Use the format 'prefix_dataModelName.object.prefix_objectName.field='
# See the examples below
ootbee_exampleDataModel.type.ootbee_exampleType.title=Example Type
ootbee_exampleDataModel.aspect.ootbee_exampleAspect.title=Example Aspect
ootbee_exampleDataModel.property.ootbee_exampleProperty.title=Example Property
ootbee_exampleDataModel.property.ootbee_exampleProperty.description=Example Property Description

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<model name="ootbee:exampleDataModel"
xmlns="http://www.alfresco.org/model/dictionary/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/model/dictionary/1.0 https://raw.githubusercontent.com/Alfresco/alfresco-repository/master/src/main/resources/alfresco/model/modelSchema.xsd">
<description>Example Data Model</description>
<author>Order of the Bee</author>
<version>1.0</version>
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<!-- Import Alfresco System Model Definitions -->
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
</imports>
<namespaces>
<namespace uri="http://orderofthebee.org/alfresco/model/example/1.0" prefix="example"/>
</namespaces>
</model>

View File

@ -0,0 +1,29 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Use this file for beans to be loaded in whatever order Alfresco/Spring decides -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- Enable Spring annotation scanning for classes in package -->
<context:component-scan base-package="${package}">
<context:include-filter type="annotation" expression="${package}.annotation.ModuleEarlyComponent" />
</context:component-scan>
<!-- Example Data Model loading -->
<bean id="${project.groupId}.${project.artifactId}.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/module/${project.groupId}.${project.artifactId}/model/example-model.xml</value>
</list>
</property>
<property name="labels">
<list>
<value>alfresco/module/${project.groupId}.${project.artifactId}/messages/example-model</value>
</list>
</property>
</bean>
</beans>

View File

@ -0,0 +1,22 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Use this file for beans to be loaded in whatever order Alfresco/Spring decides -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- Enable Spring annotation scanning for classes in package -->
<context:component-scan base-package="${package}">
<context:exclude-filter type="annotation" expression="${package}.annotation.ModuleEarlyComponent" />
<context:exclude-filter type="annotation" expression="${package}.annotation.ModuleLateComponent" />
</context:component-scan>
<bean id="${project.groupId}.${project.artifactId}.jsroot.example" class="${package}.ExampleJavaScriptRootObject" parent="baseJavaScriptExtension">
<property name="extensionName" value="example" />
</bean>
<bean id="${project.groupId}.${project.artifactId}.action.example" class="${package}.ExampleActionExecuter" parent="action-executer" />
</beans>

View File

@ -0,0 +1,16 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Use this file for beans to be defined after all modules are loaded -->
<!-- This is particularly useful if your bean is getting shadowed by another module -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- Enable Spring annotation scanning for classes in package -->
<context:component-scan base-package="${package}">
<context:include-filter type="annotation" expression="${package}.annotation.ModuleLateComponent" />
</context:component-scan>
</beans>

View File

@ -0,0 +1,5 @@
module.id=${project.artifactId}
#module.aliases=myModule-123, my-module
module.title=${project.name}
module.description=${project.description}
module.version=${project.version}

View File

@ -0,0 +1,8 @@
# Module debugging
log4j.logger.${package}=trace
# WebScript debugging
log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=debug
# non-WebScript JavaScript execution debugging
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug

View File

@ -0,0 +1,63 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!--
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.
-->
<beans>
<!--
To support hot reloading of server side Javascript files in Share, we have to turn on development mode.
This setting will tell the Rhinoscript Processor not to compile and cache the JS files.
Cool, we can now change server side JS files and have the changes picked up,
without having to restart or refresh web scripts.
But… Due to a known bug in the Surf framework (ALF-9970) this will break the admin consoles in Share.
Override this bean and disable javascript compilation so that webscripts can be hot reloaded.
We have changed the 'compile' property from true to false.
-->
<bean id="javaScriptProcessor" class="org.alfresco.repo.jscript.RhinoScriptProcessor" init-method="register">
<property name="name">
<value>javascript</value>
</property>
<property name="extension">
<value>js</value>
</property>
<!-- Do not "compile javascript and cache compiled scripts" -->
<property name="compile">
<value>false</value>
</property>
<!-- allow sharing of sealed scopes for performance -->
<!-- disable to give each script it's own new scope which can be extended -->
<property name="shareSealedScopes">
<value>true</value>
</property>
<property name="scriptService">
<ref bean="scriptService"/>
</property>
<!-- Creates ScriptNodes which require the ServiceRegistry -->
<property name="serviceRegistry">
<ref bean="ServiceRegistry"/>
</property>
<property name="storeUrl">
<value>${spaces.store}</value>
</property>
<property name="storePath">
<value>${spaces.company_home.childname}</value>
</property>
</bean>
</beans>

View File

@ -0,0 +1,55 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}-platform-webapp</artifactId>
<packaging>war</packaging>
<parent>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}-parent</artifactId>
<version>${version}</version>
<relativePath>..</relativePath>
</parent>
<name>${shortname} ACS Platform Web Application</name>
<dependencies>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}-platform-A</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>de.fmaul</groupId>
<artifactId>javascript-console-repo</artifactId>
<version>0.6.0</version>
<type>amp</type>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<!-- This assures the parent properties override defaults in the tiles -->
<applyBefore>${groupId}:${artifactId}-parent</applyBefore>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-self-rad-tile
<tile>com.inteligr8.ootbee:beedk-acs-platform-self-rad-tile:${beedkVersion}</tile> -->
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-webapp-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-platform-webapp-tile:${beedkVersion}</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-self-it-tile
<tile>com.inteligr8.ootbee:beedk-acs-platform-self-it-tile:${beedkVersion}</tile> -->
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}-parent</artifactId>
<version>${version}</version>
<packaging>pom</packaging>
<name>${shortname} ACS All-in-one Parent Project</name>
<properties>
<alfresco.sdk.version>4.2.0</alfresco.sdk.version>
<edition>community</edition>
<alfresco.platform.version>6.2.0-ga</alfresco.platform.version>
<alfresco.share.version>6.2.2.2</alfresco.share.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<modules>
<module>tengine-A</module>
<module>platform-module-A</module>
<module>platform-webapp</module>
<module>share-module-A</module>
<module>share-webapp</module>
</modules>
<repositories>
<repository>
<id>inteligr8-releases</id>
<url>http://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
</repository>
<repository>
<id>alfresco-public</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>inteligr8-releases</id>
<url>http://repos.inteligr8.com/nexus/repository/inteligr8-private</url>
</pluginRepository>
</pluginRepositories>
</project>

View File

@ -0,0 +1,66 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}-share-A</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}-parent</artifactId>
<version>${version}</version>
<relativePath>..</relativePath>
</parent>
<name>${shortname} ACS Share Module A</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>acs-community-packaging</artifactId>
<version>${alfresco.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Very popular, but not required, dependency -->
<!-- Provided as an example -->
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>share</artifactId>
<version>${alfresco.share.version}</version>
<classifier>classes</classifier>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<!-- This assures the parent properties override defaults in the tiles -->
<applyBefore>${groupId}:${artifactId}-parent</applyBefore>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-self-rad-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-share-self-rad-tile:${beedkVersion}</tile>
<tile>com.inteligr8.ootbee:beedk-acs-platform-artifact-rad-tile:${beedkVersion}</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-module-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-share-module-tile:${beedkVersion}</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-self-it-tile
<tile>com.inteligr8.ootbee:beedk-acs-share-self-it-tile:${beedkVersion}</tile>
<tile>com.inteligr8.ootbee:beedk-acs-share-artifact-it-tile:${beedkVersion}</tile> -->
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,66 @@
function discoverArtifactId {
$script:ARTIFACT_ID=(mvn -q -Dexpression=project"."artifactId -DforceStdout help:evaluate)
}
function rebuild {
echo "Rebuilding project ..."
mvn process-classes
}
function start_ {
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
mvn -Drad process-classes
}
function stop_ {
discoverArtifactId
echo "Stopping Docker containers that supported rapid application development ..."
docker container ls --filter name=${ARTIFACT_ID}-*
echo "Stopping containers ..."
docker container stop (docker container ls -q --filter name=${ARTIFACT_ID}-*)
echo "Removing containers ..."
docker container rm (docker container ls -aq --filter name=${ARTIFACT_ID}-*)
}
function tail_logs {
param (
$container
)
discoverArtifactId
docker container logs -f (docker container ls -q --filter name=${ARTIFACT_ID}-${container})
}
function list {
discoverArtifactId
docker container ls --filter name=${ARTIFACT_ID}-*
}
switch ($args[0]) {
"start" {
start_
}
"stop" {
stop_
}
"restart" {
stop_
start_
}
"rebuild" {
rebuild
}
"tail" {
tail_logs $args[1]
}
"containers" {
list
}
default {
echo "Usage: .\rad.ps1 [ start | stop | restart | rebuild | tail {container} | containers ]"
}
}
echo "Completed!"

View File

@ -0,0 +1,63 @@
#!/bin/sh
discoverArtifactId() {
ARTIFACT_ID=`mvn -q -Dexec.executable=echo -Dexec.args='${project.artifactId}' --non-recursive exec:exec 2>/dev/null`
}
rebuild() {
echo "Rebuilding project ..."
mvn process-classes
}
start() {
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
mvn -Drad process-classes
}
stop() {
discoverArtifactId
echo "Stopping Docker containers that supported rapid application development ..."
docker container ls --filter name=${ARTIFACT_ID}-*
echo "Stopping containers ..."
docker container stop `docker container ls -q --filter name=${ARTIFACT_ID}-*`
echo "Removing containers ..."
docker container rm `docker container ls -aq --filter name=${ARTIFACT_ID}-*`
}
tail_logs() {
discoverArtifactId
docker container logs -f `docker container ls -q --filter name=${ARTIFACT_ID}-$1`
}
list() {
discoverArtifactId
docker container ls --filter name=${ARTIFACT_ID}-*
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
rebuild)
rebuild
;;
tail)
tail_logs $2
;;
containers)
list
;;
*)
echo "Usage: ./rad.sh [ start | stop | restart | rebuild | tail {container} | containers ]"
exit 1
esac
echo "Completed!"

View File

@ -0,0 +1,334 @@
<alfresco-config>
<config evaluator="string-compare" condition="DocumentLibrary">
<aspects>
<visible>
<aspect name="example:aspect" />
</visible>
<addable> <!-- defaults to visible config -->
</addable>
<removeable> <!-- defaults to visible config -->
</removeable>
</aspects>
<types>
<type name="cm:content">
<subtype name="example:document"/>
</type>
</types>
</config>
<config evaluator="string-compare" condition="AdvancedSearch" replace="true">
<advanced-search>
<forms>
<!-- Standard out-of-the-box types -->
<form labelId="search.form.label.cm_content" descriptionId="search.form.desc.cm_content">cm:content</form>
<form labelId="search.form.label.cm_folder" descriptionId="search.form.desc.cm_folder">cm:folder</form>
<!-- Custom type -->
<form labelId="form.label.advancedsearch.exampleDocument" descriptionId="form.description.advancedsearch.exampleDocument">example:document</form>
</forms>
</advanced-search>
</config>
<config evaluator="node-type" condition="example:document">
<forms>
<!-- Default form configuration for the cm:content type -->
<form>
<field-visibility>
<show id="cm:name"/>
<show id="cm:title" force="true"/>
<show id="cm:description" force="true"/>
<show id="mimetype"/>
<show id="cm:author" force="true"/>
<show id="size" for-mode="view"/>
<show id="cm:creator" for-mode="view"/>
<show id="cm:created" for-mode="view"/>
<show id="cm:modifier" for-mode="view"/>
<show id="cm:modified" for-mode="view"/>
<!-- tags and categories -->
<show id="cm:taggable" for-mode="edit" force="true"/>
<show id="cm:categories"/>
<!-- cm:dublincore aspect -->
<show id="cm:publisher"/>
<show id="cm:contributor"/>
<show id="cm:type"/>
<show id="cm:identifier"/>
<show id="cm:dcsource"/>
<show id="cm:coverage"/>
<show id="cm:rights"/>
<show id="cm:subject"/>
<!-- cm:complianceable aspect -->
<show id="cm:removeAfter"/>
<!-- cm:effectivity aspect -->
<show id="cm:from"/>
<show id="cm:to"/>
<!-- cm:summarizable aspect -->
<show id="cm:summary"/>
<!-- cm:translatable aspect -->
<show id="cm:translations"/>
<!-- cm:localizable aspect -->
<show id="cm:locale"/>
<!-- cm:ownable aspect -->
<show id="cm:owner"/>
<!-- cm:attachable aspect -->
<show id="cm:attachments"/>
<!-- cm:emailed aspect -->
<show id="cm:originator"/>
<show id="cm:addressee"/>
<show id="cm:addressees"/>
<show id="cm:sentdate"/>
<show id="cm:subjectline"/>
<!-- exif:exif aspect -->
<show id="exif:dateTimeOriginal"/>
<show id="exif:pixelXDimension"/>
<show id="exif:pixelYDimension"/>
<show id="exif:exposureTime"/>
<show id="exif:fNumber"/>
<show id="exif:flash"/>
<show id="exif:focalLength"/>
<show id="exif:isoSpeedRatings"/>
<show id="exif:manufacturer"/>
<show id="exif:model"/>
<show id="exif:software"/>
<show id="exif:orientation"/>
<show id="exif:xResolution"/>
<show id="exif:yResolution"/>
<show id="exif:resolutionUnit"/>
<!-- audio:audio aspect -->
<show id="audio:album"/>
<show id="audio:artist"/>
<show id="audio:composer"/>
<show id="audio:engineer"/>
<show id="audio:genre"/>
<show id="audio:trackNumber"/>
<show id="audio:releaseDate"/>
<show id="audio:sampleRate"/>
<show id="audio:sampleType"/>
<show id="audio:channelType"/>
<show id="audio:compressor"/>
<!-- cm:indexControl aspect -->
<show id="cm:isIndexed"/>
<show id="cm:isContentIndexed"/>
<!-- cm:geographic aspect -->
<show id="cm:latitude"/>
<show id="cm:longitude"/>
<!-- surf:widget aspect -->
<show id="surf:widgetType"/>
<show id="surf:mid"/>
<show id="surf:label"/>
</field-visibility>
<appearance>
<field id="cm:name">
<control>
<control-param name="maxLength">255</control-param>
</control>
</field>
<field id="cm:title">
<control template="/org/alfresco/components/form/controls/textfield.ftl"/>
</field>
<field id="cm:description">
<control>
<control-param name="activateLinks">true</control-param>
</control>
</field>
<set id="cm:content2cols" template="/org/alfresco/components/form/2-column-set.ftl"/>
<field set="cm:content2cols" id="mimetype">
<control template="/org/alfresco/components/form/controls/mimetype.ftl"/>
</field>
<field set="cm:content2cols" id="size">
<control template="/org/alfresco/components/form/controls/size.ftl"/>
</field>
<field set="cm:content2cols" id="cm:creator"/>
<field set="cm:content2cols" id="cm:created"/>
<field set="cm:content2cols" id="cm:modifier"/>
<field set="cm:content2cols" id="cm:modified"/>
<field id="cm:taggable">
<control>
<control-param name="compactMode">true</control-param>
<control-param name="params">aspect=cm:taggable</control-param>
<control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
<control-param name="createNewItemIcon">tag</control-param>
</control>
</field>
<field id="cm:categories">
<control>
<control-param name="compactMode">true</control-param>
</control>
</field>
<field id="cm:originator" read-only="true"/>
<field id="cm:addressee" read-only="true"/>
<field id="cm:addressees" read-only="true"/>
<field id="cm:sentdate" read-only="true"/>
<field id="cm:subjectline" read-only="true"/>
<!-- Example Properties -->
<set id="exampleDocumentSet" appearance="bordered-panel" label-id="form.set.label.example.document"/>
</appearance>
</form>
<!-- Document Library pop-up Edit Metadata form -->
<form id="doclib-simple-metadata">
<field-visibility>
<show id="cm:name"/>
<show id="cm:title" force="true"/>
<show id="cm:description" force="true"/>
<!-- tags and categories -->
<show id="cm:taggable" for-mode="edit" force="true"/>
<show id="cm:categories"/>
</field-visibility>
<edit-form template="../documentlibrary/forms/doclib-simple-metadata.ftl"/>
<appearance>
<field id="cm:name">
<control>
<control-param name="maxLength">255</control-param>
</control>
</field>
<field id="cm:title">
<control template="/org/alfresco/components/form/controls/textfield.ftl"/>
</field>
<field id="cm:description">
<control>
<control-param name="activateLinks">true</control-param>
</control>
</field>
<field id="cm:taggable">
<control>
<control-param name="compactMode">true</control-param>
<control-param name="params">aspect=cm:taggable</control-param>
<control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
<control-param name="createNewItemIcon">tag</control-param>
</control>
</field>
<field id="cm:categories">
<control>
<control-param name="compactMode">true</control-param>
</control>
</field>
<!-- Example Properties -->
<set id="exampleDocumentSet" appearance="bordered-panel" label-id="form.set.label.example.document"/>
</appearance>
</form>
<!-- Document Library Inline Edit form -->
<form id="doclib-inline-edit">
<field-visibility>
<show id="cm:name"/>
<show id="cm:content" force="true"/>
<show id="cm:title" force="true"/>
<show id="cm:description" force="true"/>
</field-visibility>
<appearance>
<field id="cm:name">
<control>
<control-param name="maxLength">255</control-param>
</control>
</field>
<field id="cm:title">
<control template="/org/alfresco/components/form/controls/textfield.ftl"/>
</field>
<field id="cm:content" label-id="">
<control>
<control-param name="editorAppearance">explorer</control-param>
<control-param name="forceEditor">true</control-param>
</control>
</field>
<!-- Example Properties -->
<set id="exampleDocumentSet" appearance="bordered-panel" label-id="form.set.label.example.document"/>
</appearance>
</form>
</forms>
</config>
<!-- Create and search forms for acme:document -->
<config evaluator="model-type" condition="acme:document">
<forms>
<form>
<field-visibility>
<show id="cm:name"/>
<show id="cm:content" force="true"/>
<show id="cm:title" force="true"/>
<show id="cm:description" force="true"/>
<show id="mimetype"/>
<show id="app:editInline" force="true"/>
</field-visibility>
<appearance>
<field id="cm:name">
<control>
<control-param name="maxLength">255</control-param>
</control>
</field>
<field id="cm:title">
<control template="/org/alfresco/components/form/controls/textfield.ftl"/>
</field>
<field id="cm:content" label-id="">
<control>
<control-param name="editorAppearance">explorer</control-param>
</control>
</field>
<field id="mimetype">
<control template="/org/alfresco/components/form/controls/hidden.ftl">
<control-param name="contextProperty">mimeType</control-param>
</control>
</field>
<field id="app:editInline">
<control template="/org/alfresco/components/form/controls/hidden.ftl">
<control-param name="contextProperty">editInline</control-param>
</control>
</field>
<!-- Example Properties -->
<set id="exampleDocumentSet" appearance="bordered-panel" label-id="form.set.label.example.document"/>
</appearance>
</form>
<!-- Search form -->
<form id="search">
<field-visibility>
<show id="cm:name"/>
<show id="cm:title" force="true"/>
<show id="cm:description" force="true"/>
<show id="mimetype"/>
<show id="cm:modified"/>
<show id="cm:modifier"/>
</field-visibility>
<appearance>
<field id="mimetype">
<control template="/org/alfresco/components/form/controls/mimetype.ftl"/>
</field>
<field id="cm:modifier">
<control>
<control-param name="forceEditable">true</control-param>
</control>
</field>
<field id="cm:modified">
<control template="/org/alfresco/components/form/controls/daterange.ftl"/>
</field>
<!-- Example Properties -->
<set id="exampleDocumentSet" appearance="bordered-panel" label-id="form.set.label.example.document"/>
</appearance>
</form>
</forms>
</config>
</alfresco-config>

View File

@ -0,0 +1,5 @@
module.id=${project.artifactId}
#module.aliases=myModule-123, my-module
module.title=${project.name}
module.description=${project.description}
module.version=${project.version}

View File

@ -0,0 +1,39 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Use this file for beans to be loaded in whatever order Alfresco/Spring decides -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- Enable Spring annotation scanning for classes in package -->
<context:component-scan base-package="${package}" />
<bean id="${project.groupId}.${project.artifactId}.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>${alfresco.ext.package}.messages.example</value>
</list>
</property>
</bean>
<!-- An example Action Evaluator -->
<bean id="evaluator.doclib.action.isMarkdown" parent="evaluator.doclib.action.isMimetype">
<property name="mimetypes">
<list>
<value>text/x-markdown</value>
</list>
</property>
</bean>
<!-- An example Extensibility Module Evaluator -->
<bean id="moduleEvaluator.doclib.action.isMarkdown" parent="moduleEvaluator.doclib.action.isMimetype">
<property name="mimetypes">
<list>
<value>text/x-markdown</value>
</list>
</property>
</bean>
</beans>

View File

@ -0,0 +1,9 @@
<extension>
<modules>
<module>
<id>${project.artifactId} Example Extensibility Module</id>
<version>${project.version}</version>
<auto-deploy>true</auto-deploy>
</module>
</modules>
</extension>

View File

@ -0,0 +1,95 @@
<alfresco-config>
<config evaluator="string-compare" condition="WebFramework">
<web-framework>
<autowire>
<!-- Changing this to 'development' currently breaks the Admin Console.
Instead we make a POST to clear Share dependency caches, see 'clear-caches-refresh-ws' profile. -->
<mode>production</mode> <!-- not really need in the long run, used for YUI - deprecate -->
</autowire>
<!--
We don't need to do this when we have the new refresh mojos in the Alfresco plug-in.
If resource caching has been disabled then all the dependency caches will be cleared
before processing the Aikau jsonModel request...
(i.e. this.dojoDependencyHandler.clearCaches() )
For more information see the Aikau source code: https://github.com/Alfresco/Aikau
-->
<disable-resource-caching>true</disable-resource-caching>
</web-framework>
</config>
<!-- Global config section -->
<config replace="true">
<flags>
<!--
Developer debugging setting to turn on DEBUG mode for client scripts in the browser
-->
<client-debug>true</client-debug>
<!--
LOGGING can always be toggled at runtime when in DEBUG mode (Ctrl, Ctrl, Shift, Shift).
This flag automatically activates logging on page load.
-->
<client-debug-autologging>false</client-debug-autologging>
</flags>
</config>
<!--
Disable CSRF completely for now
It seems Share has issues on 4.2.x with the embedded tomcat and CSRFPolicy
-->
<config evaluator="string-compare" condition="CSRFPolicy" replace="true">
<filter/>
</config>
<!--
Change so it is picked up from property where the Alfresco Repo Webapp is running
(e.g. http://localhost:8080/alfresco)
-->
<config evaluator="string-compare" condition="Remote">
<remote>
<endpoint>
<id>alfresco-noauth</id>
<name>Alfresco - unauthenticated access</name>
<description>Access to Alfresco Repository WebScripts that do not require authentication</description>
<connector-id>alfresco</connector-id>
<endpoint-url>${acs-platform.url}/alfresco/s</endpoint-url>
<identity>none</identity>
</endpoint>
<endpoint>
<id>alfresco</id>
<name>Alfresco - user access</name>
<description>Access to Alfresco Repository WebScripts that require user authentication</description>
<connector-id>alfresco</connector-id>
<endpoint-url>${acs-platform.url}/alfresco/s</endpoint-url>
<identity>user</identity>
</endpoint>
<endpoint>
<id>alfresco-feed</id>
<name>Alfresco Feed</name>
<description>Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet</description>
<connector-id>http</connector-id>
<endpoint-url>${acs-platform.url}/alfresco/s</endpoint-url>
<basic-auth>true</basic-auth>
<identity>user</identity>
</endpoint>
<endpoint>
<id>alfresco-api</id>
<parent-id>alfresco</parent-id>
<name>Alfresco Public API - user access</name>
<description>Access to Alfresco Repository Public API that require user authentication.
This makes use of the authentication that is provided by parent 'alfresco' endpoint.</description>
<connector-id>alfresco</connector-id>
<endpoint-url>${acs-platform.url}/alfresco/api</endpoint-url>
<identity>user</identity>
</endpoint>
</remote>
</config>
</alfresco-config>

View File

@ -0,0 +1,56 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
# Set root logger level to error
log4j.rootLogger=error, 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=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{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %m%n
# 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
# 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
# Alfresco
log4j.logger.org.alfresco=error
log4j.logger.org.alfresco.config=warn
log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn
log4j.logger.org.alfresco.web=info
# Web Framework
log4j.logger.org.springframework.extensions.webscripts=info
log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=info
log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off
# 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=
#-----------------------------------------------------------------------
# Custom Share module logging goes here...
#-----------------------------------------------------------------------
log4j.logger.${package}=debug

View File

@ -0,0 +1,55 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}-share-webapp</artifactId>
<packaging>war</packaging>
<parent>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}-parent</artifactId>
<version>${version}</version>
<relativePath>..</relativePath>
</parent>
<name>${shortname} ACS Share Web Application</name>
<dependencies>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}-share-A</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>de.fmaul</groupId>
<artifactId>javascript-console-share</artifactId>
<version>0.6.0</version>
<type>amp</type>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<!-- This assures the parent properties override defaults in the tiles -->
<applyBefore>${groupId}:${artifactId}-parent</applyBefore>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-self-rad-tile
<tile>com.inteligr8.ootbee:beedk-acs-share-self-rad-tile:${beedkVersion}</tile> -->
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-webapp-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-share-webapp-tile:${beedkVersion}</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-self-it-tile
<tile>com.inteligr8.ootbee:beedk-acs-share-self-it-tile:${beedkVersion}</tile> -->
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,71 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}-tengine-A</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}-parent</artifactId>
<version>${version}</version>
<relativePath>..</relativePath>
</parent>
<name>${shortname} Alfresco T-Engine A</name>
<properties>
<ats.version>2.3.6</ats.version>
<spring-boot.version>2.3.5.RELEASE</spring-boot.version>
<activemq.version>5.15.8</activemq.version>
<docker.image.registry>${dockerRegistryHost}</docker.image.registry>
<docker.image.name>${dockerImagePrefix}/${project.artifactId}</docker.image.name>
<docker.image.tag>${project.version}</docker.image.tag>
</properties>
<dependencies>
<dependency>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-ate-springboot</artifactId>
<version>${beedkVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-ate-springboot-test</artifactId>
<version>${beedkVersion}</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<!-- This assures the parent properties override defaults in the tiles -->
<applyBefore>${groupId}:${artifactId}-parent</applyBefore>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-ate-docker-tile -->
<tile>com.inteligr8.ootbee:beedk-ate-docker-tile:${beedkVersion}</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-ate-springboot-tile -->
<tile>com.inteligr8.ootbee:beedk-ate-springboot-tile:${beedkVersion}</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,66 @@
function discoverArtifactId {
$script:ARTIFACT_ID=(mvn -q -Dexpression=project"."artifactId -DforceStdout help:evaluate)
}
function rebuild {
echo "Rebuilding project ..."
mvn process-classes
}
function start_ {
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
mvn -Drad process-classes
}
function stop_ {
discoverArtifactId
echo "Stopping Docker containers that supported rapid application development ..."
docker container ls --filter name=${ARTIFACT_ID}-*
echo "Stopping containers ..."
docker container stop (docker container ls -q --filter name=${ARTIFACT_ID}-*)
echo "Removing containers ..."
docker container rm (docker container ls -aq --filter name=${ARTIFACT_ID}-*)
}
function tail_logs {
param (
$container
)
discoverArtifactId
docker container logs -f (docker container ls -q --filter name=${ARTIFACT_ID}-${container})
}
function list {
discoverArtifactId
docker container ls --filter name=${ARTIFACT_ID}-*
}
switch ($args[0]) {
"start" {
start_
}
"stop" {
stop_
}
"restart" {
stop_
start_
}
"rebuild" {
rebuild
}
"tail" {
tail_logs $args[1]
}
"containers" {
list
}
default {
echo "Usage: .\rad.ps1 [ start | stop | restart | rebuild | tail {container} | containers ]"
}
}
echo "Completed!"

View File

@ -0,0 +1,63 @@
#!/bin/sh
discoverArtifactId() {
ARTIFACT_ID=`mvn -q -Dexec.executable=echo -Dexec.args='${project.artifactId}' --non-recursive exec:exec 2>/dev/null`
}
rebuild() {
echo "Rebuilding project ..."
mvn process-classes
}
start() {
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
mvn -Drad process-classes
}
stop() {
discoverArtifactId
echo "Stopping Docker containers that supported rapid application development ..."
docker container ls --filter name=${ARTIFACT_ID}-*
echo "Stopping containers ..."
docker container stop `docker container ls -q --filter name=${ARTIFACT_ID}-*`
echo "Removing containers ..."
docker container rm `docker container ls -aq --filter name=${ARTIFACT_ID}-*`
}
tail_logs() {
discoverArtifactId
docker container logs -f `docker container ls -q --filter name=${ARTIFACT_ID}-$1`
}
list() {
discoverArtifactId
docker container ls --filter name=${ARTIFACT_ID}-*
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
rebuild)
rebuild
;;
tail)
tail_logs $2
;;
containers)
list
;;
*)
echo "Usage: ./rad.sh [ start | stop | restart | rebuild | tail {container} | containers ]"
exit 1
esac
echo "Completed!"

View File

@ -0,0 +1,28 @@
FROM docker.inteligr8.com/inteligr8/ubuntu-jdk:20.04-11
# Set default user information
ARG JAR_FILE
ARG APPGROUPNAME=alfresco
ARG APPGROUPID=1000
ARG APPUSERNAME=atengine
ARG APPUSERID=33001
ENV JAVA_OPTS="-Xmx128m"
ENV JAR_PATH=/usr/local/bin/${project.artifactId}.jar
COPY ${JAR_FILE} ${JAR_PATH}
# Install your engine's dependencies here
#RUN apt update && \
# apt -y install {dependency names in APT repository}
RUN groupadd -g ${APPGROUPID} ${APPGROUPNAME} && \
useradd -u ${APPUSERID} -G ${APPGROUPNAME} ${APPUSERNAME} && \
chown ${APPUSERNAME}:${APPGROUPNAME} ${JAR_PATH}
EXPOSE 8090
USER ${APPUSERNAME}
ENTRYPOINT java ${JAVA_OPTS} -jar ${JAR_PATH}

View File

@ -0,0 +1,67 @@
/*
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
* -
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* -
* Alfresco 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 Lesser General Public License for more details.
* -
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package ${groupId};
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.event.EventListener;
import io.micrometer.core.instrument.MeterRegistry;
@SpringBootApplication
@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class })
@ImportResource({"classpath*:application-context.xml"})
public class Application {
private final Logger logger = LoggerFactory.getLogger(Application.class);
@Value("${container.name}")
private String containerName;
@Bean
public MeterRegistryCustomizer<MeterRegistry> metricsCommonTags() {
return registry -> registry.config().commonTags("containerName", this.containerName);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@EventListener(ApplicationReadyEvent.class)
public void startup() {
this.logger.info("Starting application components... Done");
}
}

View File

@ -0,0 +1,145 @@
/*
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
* -
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* -
* Alfresco 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 Lesser General Public License for more details.
* -
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*
* Copyright (C) 2020 - 2021 Inteligr8
*/
package ${groupId};
import java.io.File;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.PostConstruct;
import org.alfresco.transformer.AbstractTransformerController;
import org.alfresco.transformer.probes.ProbeTestTransform;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
/**
* Controller for the Spring Boot transformer.
*
* Status Codes:
*
* 200 Success
* 400 Bad Request: Request parameter <name> is missing (missing mandatory parameter)
* 400 Bad Request: Request parameter <name> is of the wrong type
* 400 Bad Request: Transformer exit code was not 0 (possible problem with the source file)
* 400 Bad Request: The source filename was not supplied
* 500 Internal Server Error: (no message with low level IO problems)
* 500 Internal Server Error: The target filename was not supplied (should not happen as targetExtension is checked)
* 500 Internal Server Error: Transformer version check exit code was not 0
* 500 Internal Server Error: Transformer version check failed to create any output
* 500 Internal Server Error: Could not read the target file
* 500 Internal Server Error: The target filename was malformed (should not happen because of other checks)
* 500 Internal Server Error: Transformer failed to create an output file (the exit code was 0, so there should be some content)
* 500 Internal Server Error: Filename encoding error
* 507 Insufficient Storage: Failed to store the source file
*/
@Controller
public class TransformerController extends AbstractTransformerController {
private final Logger logger = LoggerFactory.getLogger(TransformerController.class);
private final Pattern fileext = Pattern.compile("\\.([^\\.]+)$");
@Autowired
private TransformerImpl transformer;
#set( $dollar = '$' )
@Value("${dollar}{transform.${shortname}.version}")
private String version;
private ProbeTestTransform probe;
@Override
public String getTransformerName() {
return "${shortname}";
}
@Override
public String version() {
return this.version;
}
@PostConstruct
public void initProbe() {
this.probe = new ProbeTestTransform(this, "quick.src", "quick.trgt",
7455L, 1024L, 150, 10240L, 60L * 20L + 1L, 60L * 15L - 15L) {
@Override
protected void executeTransformCommand(File sourceFile, File targetFile) {
if (logger.isTraceEnabled())
logger.trace("getProbeTestTransform().executeTransformCommand('" + sourceFile + "', '" + targetFile + "')");
// TODO test a transformation
}
};
}
@Override
public ProbeTestTransform getProbeTestTransform() {
if (this.logger.isTraceEnabled())
this.logger.trace("getProbeTestTransform()");
return this.probe;
}
@Override
protected String getTransformerName(final File sourceFile, final String sourceMimetype, final String targetMimetype, final Map<String, String> transformOptions) {
if (this.logger.isTraceEnabled())
this.logger.trace("getTransformerName('" + sourceFile + "', '" + sourceMimetype + "', '" + targetMimetype + "', " + transformOptions + ")");
// does not matter what value is returned, as it is not used because there is only one.
return this.getTransformerName();
}
@Override
public void transformImpl(String transformName, String sourceMimetype, String targetMimetype, Map<String, String> transformOptions, File sourceFile, File targetFile) {
if (this.logger.isTraceEnabled())
this.logger.trace("transformImpl('" + transformName + "', '" + sourceMimetype + "', '" + targetMimetype + "', " + transformOptions.keySet() + ", '" + sourceFile + "', '" + targetFile + "')");
if (sourceMimetype == null) {
Matcher matcher = this.fileext.matcher(sourceFile.getAbsolutePath());
sourceMimetype = matcher.find() ? this.ext2mime(matcher.group(1)) : null;
}
if (targetMimetype == null) {
Matcher matcher = this.fileext.matcher(targetFile.getAbsolutePath());
targetMimetype = matcher.find() ? this.ext2mime(matcher.group(1)) : MediaType.TEXT_PLAIN_VALUE;
}
this.transformer.transform(transformName, sourceMimetype, targetMimetype, transformOptions, sourceFile, targetFile);
}
private String ext2mime(String ext) {
switch (ext.toLowerCase()) {
// add applicable extensions here
case "text":
case "txt": return MediaType.TEXT_PLAIN_VALUE;
default: return null;
}
}
}

View File

@ -0,0 +1,45 @@
package ${groupId};
import java.io.File;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.alfresco.transformer.executors.Transformer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class TransformerImpl implements Transformer {
private final Logger logger = LoggerFactory.getLogger(TransformerImpl.class);
private final String id = "${shortname}";
@PostConstruct
public void init() throws Exception {
if (this.logger.isDebugEnabled())
this.logger.debug("init()");
}
@Override
public String getTransformerId() {
return this.id;
}
@Override
public void extractMetadata(String transformName, String sourceMimetype, String targetMimetype, Map<String, String> transformOptions, File sourceFile, File targetFile) {
if (this.logger.isTraceEnabled())
this.logger.trace("extractMetadata('" + transformName + "', '" + sourceMimetype + "', '" + targetMimetype + "', " + transformOptions.keySet() + ", '" + sourceFile + "', '" + targetFile + "')");
this.transform(transformName, sourceMimetype, targetMimetype, transformOptions, sourceFile, targetFile);
}
@Override
public void transform(String transformName, String sourceMimetype, String targetMimetype, Map<String, String> transformOptions, File sourceFile, File targetFile) {
if (this.logger.isTraceEnabled())
this.logger.trace("transform('" + transformName + "', '" + sourceMimetype + "', '" + targetMimetype + "', " + transformOptions.keySet() + ", '" + sourceFile + "', '" + targetFile + "')");
// TODO implement your transformation logic here
}
}

View File

@ -0,0 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns="http://www.springframework.org/schema/beans" 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-3.0.xsd">
<bean autowire-candidate="true" class="org.alfresco.transformer.clients.AlfrescoSharedFileStoreClient" />
<bean autowire-candidate="true" class="org.springframework.web.client.RestTemplate" />
<bean autowire-candidate="true" class="org.alfresco.transform.client.model.TransformRequestValidator" />
<bean autowire-candidate="true" class="org.alfresco.transformer.TransformRegistryImpl" />
</beans>

View File

@ -0,0 +1,14 @@
queue:
#set( $dollar = '$' )
engineRequestQueue: ${dollar}{TRANSFORM_ENGINE_REQUEST_QUEUE:${groupId}.${shortname}.acs}
transform:
core:
config:
location: classpath:this_engine_config.json
${shortname}:
version: ${project.version}
logging:
level:
${groupId}: ${dollar}{LOG_LEVEL:info}

View File

@ -0,0 +1,21 @@
<html xmlns:th="http://www.thymeleaf.org">
<body>
<div>
<h2>${shortname} Test Transformation</h2>
<form method="POST" enctype="multipart/form-data" action="/transform">
<table>
<tr><td><div style="text-align:right">file *</div></td><td><input type="file" name="file" /></td></tr>
<tr><td><div style="text-align:right">targetExtension *</div></td><td><input type="text" name="targetExtension" value="" /></td></tr>
<!-- Add a row for each of your transform options -->
<tr><td></td><td><input type="submit" value="Transform" /></td></tr>
</table>
</form>
</div>
<div>
<a href="/log">Log entries</a>
</div>
</body>
</html>

View File

@ -0,0 +1,18 @@
{
"transformOptions": {
"${shortname}Options": [
// {"value": {"name": "profile"}},
]
},
"transformers": [
{
"transformerName": "${shortname}",
"supportedSourceAndTargetList": [
// {"sourceMediaType": "text/plain", "priority": 10, "targetMediaType": "text/plain" }
],
"transformOptions": [
"${shortname}Options"
]
}
]
}

View File

@ -0,0 +1,174 @@
/*
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
* -
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* -
* Alfresco 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 Lesser General Public License for more details.
* -
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package ${groupId};
import java.util.HashSet;
import java.util.Set;
import javax.annotation.PostConstruct;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.junit.Assert;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.web.client.HttpStatusCodeException;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class HttpRequestIT {
private final Logger logger = LoggerFactory.getLogger(HttpRequestIT.class);
@LocalServerPort
private int port;
@Autowired
private TestRestTemplate restTemplate;
protected String baseUrl;
@PostConstruct
public void init() {
this.baseUrl = "http://localhost:" + this.port;
}
@Test
public void testRootPath() {
String result = this.restTemplate.getForObject(this.baseUrl, String.class);
if (this.logger.isDebugEnabled())
this.logger.debug("testRootPath(): result: " + result);
Assert.assertNotNull("A result from the HTTP GET was expected", result);
Document htmldoc = Jsoup.parse(result);
Assert.assertNotNull("An HTML compliant result was expected: " + result.substring(0, 50), htmldoc);
Elements elements = htmldoc.select("html body h2");
Assert.assertFalse("The HTML body is expected to have an h2 element: html: " + htmldoc.toString(), elements.isEmpty());
Assert.assertEquals("The HTML body is expected to have just one h2 element", 1, elements.size());
Assert.assertEquals("The HTML body header is not what was expected", "${shortname} Test Transformation", elements.html());
elements = htmldoc.select("html input");
Set<String> inputs = new HashSet<String>();
for (Element element : elements)
inputs.add(element.attr("name"));
Assert.assertTrue("The HTML is expected to have a form input for 'file': " + inputs.toString(), inputs.contains("file"));
Assert.assertTrue("The HTML is expected to have a form input for 'targetExtension': " + inputs.toString(), inputs.contains("targetExtension"));
}
@Test
public void testLogPath() {
String result = this.restTemplate.getForObject(this.baseUrl + "/log", String.class);
if (this.logger.isDebugEnabled())
this.logger.debug("testLogPath(): result: " + result);
Assert.assertNotNull("A result from the HTTP GET was expected", result);
Document htmldoc = Jsoup.parse(result);
Assert.assertNotNull("An HTML compliant result was expected: " + result.substring(0, 50), htmldoc);
Elements elements = htmldoc.select("html body div h2");
Assert.assertFalse("The HTML is expected to have an html/body/div/h2 element: html: " + htmldoc.select("html").toString(), elements.isEmpty());
Assert.assertEquals("The HTML is expected to have just one html/body/div/h2 element", 1, elements.size());
Assert.assertEquals("The HTML body header is not what was expected", "${shortname} Log Entries", elements.html());
}
@Test
public void testNoPath() {
try {
ResponseEntity<String> response = this.restTemplate.getForEntity(this.baseUrl + "/doesnotexist", String.class);
Assert.assertEquals("An unexpected path must return a 404 error", 404, response.getStatusCodeValue());
} catch (HttpStatusCodeException hsce) {
Assert.assertEquals("An unexpected path must return a 404 error", 404, hsce.getRawStatusCode());
}
}
@Test
public void testServiceGet() {
try {
ResponseEntity<String> response = this.restTemplate.getForEntity(this.baseUrl + "/transform", String.class);
Assert.assertEquals("An unexpected path must return a 405 error", 405, response.getStatusCodeValue());
} catch (HttpStatusCodeException hsce) {
Assert.assertEquals("An unexpected path must return a 405 error", 405, hsce.getRawStatusCode());
}
}
@Test
public void testServiceNoFile() {
try {
ResponseEntity<String> response = this._testService(null, "trgt");
Assert.assertEquals("An unexpected path must return a 400 error", 400, response.getStatusCodeValue());
} catch (HttpStatusCodeException hsce) {
Assert.assertEquals("An unexpected path must return a 400 error", 400, hsce.getRawStatusCode());
}
}
@Test @Ignore
public void testServiceNoTargetExtension() {
try {
ResponseEntity<String> response = this._testService("quick.src", null);
Assert.assertEquals("An unexpected path must return a 400 error", 400, response.getStatusCodeValue());
} catch (HttpStatusCodeException hsce) {
Assert.assertEquals("An unexpected path must return a 400 error", 400, hsce.getRawStatusCode());
}
}
@Test @Ignore
public void testServiceQuick() {
this._testService("quick.src", "trgt");
}
protected ResponseEntity<String> _testService(String filename, String targetExtension) {
LinkedMultiValueMap<String, Object> parameters = new LinkedMultiValueMap<>();
if (filename != null)
parameters.add("file", new ClassPathResource(filename));
if (targetExtension != null)
parameters.add("targetExtension", targetExtension);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
HttpEntity<LinkedMultiValueMap<String, Object>> entity = new HttpEntity<>(parameters, headers);
return this.restTemplate.postForEntity(this.baseUrl + "/transform", entity, String.class);
}
}

View File

@ -0,0 +1,22 @@
package ${groupId};
import org.alfresco.transformer.AbstractTransformerController;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@WebMvcTest(controllers = TransformerController.class)
public class TransformerControllerTest {
@Autowired
protected AbstractTransformerController controller;
@Test @Ignore
public void test() {
}
}

View File

@ -0,0 +1,14 @@
queue:
#set( $dollar = '$' )
engineRequestQueue: ${dollar}{TRANSFORM_ENGINE_REQUEST_QUEUE:${groupId}.${shortname}.acs}
transform:
core:
config:
location: classpath:this_engine_config.json
${shortname}:
version: ${project.version}
logging:
level:
${groupId}: ${dollar}{LOG_LEVEL:trace}

9
beedk-acs-lts-it-tile/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Eclipse
.project
.classpath
.settings
# Maven
pom.xml.versionsBackup
target

View File

@ -0,0 +1,77 @@
# BeeDK Alfresco Local Transform Services Maven Tile for Integration Tests
This is a component within the proposed [BeeDK](/inteligr8/ootbee-beedk). It is considered to be part of the **Public API** of the BeeDK.
## Purpose
This project creates a [Maven Tile](https://github.com/repaint-io/maven-tiles) that provides Alfresco Local Transform Services for the integration testing of any ACS module, extension, service, or web application.
## Usage
To use this plugin, just reference it with the Maven Tiles plugin as shown in the following snippet. Do not forget the `extensions` element in the *plugin* configuration.
```xml
<project ...>
...
<build>
...
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>[2.0,3.0)</version>
<extensions>true</extensions>
<configuration>
<tiles>
...
<tile>com.inteligr8.ootbee:beedk-acs-<!-- See below -->-tile:[1.0.0,2.0.0)</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-lts-it-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-lts-it-tile:[1.0.0,2.0.0)</tile>
...
</tiles>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
```
This tile is meant to be used in conjunction with the `beedk-acs-platform-it-tile` tile which is automatically included in each of the following BeeDK Public API Maven Tiles.
* [`beedk-acs-platform-module-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-module-tile)
* [`beedk-acs-share-module-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-module-tile)
* [`beedk-acs-platform-webapp-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-webapp-tile)
* [`beedk-acs-share-webapp-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-webapp-tile)
> This Maven Tile should always be declared **AFTER** the Maven Tile used from the list above.
## Configuration
In your Maven project, set the following properties to define the behavior of this Maven Tile. Unless otherwise stated, they can only be overridden in the project POM or other Maven Tiles loaded earlier than this Maven Tile.
### Public API
The following properties are intended to be exposed by inheriting Public API Maven Tiles.
| Maven Property | Required | Default | Description |
| -------------------------------- |:--------:| --------------- | ----------- |
| `alfresco.transform-aio.version` | | *not important* | The version of the [Alfresco Transform Core Engine Docker Image](https://hub.docker.com/r/alfresco/alfresco-transform-core-aio/tags). |
### Other APIs
Additional less important configurations are inherited from the following Maven Tiles.
* [`beedk-run-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-run-tile)
## Results
The AIO Alfresco Transform Engine will be started and stopped during the `pre-integration-test` and `post-integration-test` Maven phases, respectively.
This tile will result in the definition of the following Maven properties during the respective Maven phase.
| Property | Data Type | Phase | Description |
| --------------------------------- |:---------:|:------------:| ----------- |
| `beedk.deploy.alts.enabled` | Boolean | *At startup* | `true`, which signals other Maven Tiles |

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-acs-lts-it-tile</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>tile</packaging>
<name>Order of the Bee Development Kit: Integration Testing for ACS Local Transform Service</name>
<scm>
<url>https://bitbucket.org/inteligr8/ootbee-beedk</url>
</scm>
<organization>
<name>Order of the Bee</name>
<url>https://orderofthebee.net</url>
</organization>
<developers>
<developer>
<name>Brian Long</name>
<email>brian@inteligr8.com</email>
<organization>Inteligr8</organization>
<organizationUrl>https://www.inteligr8.com</organizationUrl>
<url>https://twitter.com/brianmlong</url>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0 https://bitbucket.org/inteligr8/maven-tiles/raw/xsd/src/main/resources/maven-tiles.xsd">
<build>
<plugins>
<!-- Using Docker for Alfresco AIO Transform Engine without ATS -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${beedk.plugins.fabric8.docker.version}</version>
<executions>
<execution>
<id>start-alts</id>
<phase>pre-integration-test</phase>
<goals><goal>start</goal></goals>
<configuration>
<images>
<image>
<name>alfresco/alfresco-transform-core-aio:${alfresco.transform-aio.version}</name>
<alias>ate-aio</alias>
<run>
<skip>${skipTests}</skip>
<network>
<mode>custom</mode>
<name>${project.artifactId}</name>
</network>
</run>
</image>
</images>
</configuration>
</execution>
<execution>
<id>stop-alts</id>
<phase>post-integration-test</phase>
<goals><goal>stop</goal></goals>
<configuration>
<images>
<image>
<name>alfresco/alfresco-transform-core-aio:${alfresco.transform-aio.version}</name>
<alias>ate-aio</alias>
</image>
</images>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>default-props</id>
<activation>
<property>
<name>!some-prop-that-never-exists</name>
</property>
</activation>
<properties>
<!-- versions -->
<alfresco.transform-aio.version>2.3.6</alfresco.transform-aio.version>
<!-- configuring beedk-acs-platform-it-tile -->
<beedk.deploy.alts.enabled>true</beedk.deploy.alts.enabled>
</properties>
</profile>
</profiles>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-run-tile -->
<tile>com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT</tile>
</tiles>
</project>

9
beedk-acs-lts-rad-tile/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Eclipse
.project
.classpath
.settings
# Maven
pom.xml.versionsBackup
target

View File

@ -0,0 +1,78 @@
# BeeDK Alfresco Local Transform Services Maven Tile for RAD
This is a component within the proposed [BeeDK](/inteligr8/ootbee-beedk). It is considered to be part of the **Public API** of the BeeDK.
## Purpose
This project creates a [Maven Tile](https://github.com/repaint-io/maven-tiles) that provides Alfresco Local Transform Services for the rapid application development of any ACS module, extension, service, or web application.
## Usage
To use this plugin, just reference it with the Maven Tiles plugin as shown in the following snippet. Do not forget the `extensions` element in the *plugin* configuration.
```xml
<project ...>
...
<build>
...
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>[2.0,3.0)</version>
<extensions>true</extensions>
<configuration>
<tiles>
...
<tile>com.inteligr8.ootbee:beedk-acs-platform-<!-- See Below -->-rad-tile:[1.0.0,2.0.0)</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-lts-rad-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-lts-rad-tile:[1.0.0,2.0.0)</tile>
...
</tiles>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
```
This tile is meant to be used in conjunction with the `beedk-acs-platform-rad-tile` tile which is automatically included in each of the following BeeDK Public API Maven Tiles.
* [`beedk-acs-platform-self-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-self-rad-tile)
* [`beedk-acs-platform-artifact-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-artifact-rad-tile)
> This Maven Tile should always be declared **AFTER** the Maven Tile used from the list above.
See the [BeeDK documentation](/inteligr8/ootbee-beedk) on instructions for how to start and stop RAD capabilities.
## Configuration
In your Maven project, set the following properties to define the behavior of this Maven Tile. Unless otherwise stated, they can only be overridden in the project POM or other Maven Tiles loaded earlier than this Maven Tile.
### Public API
The following properties are intended to be exposed by inheriting Public API Maven Tiles.
| Maven Property | Required | Default | Description |
| ------------------------------------- |:--------:| --------------- | ----------- |
| `alfresco.transform-aio.port` | | 8091 | The port to expose on `localhost` for the developer; not for other applications or users. |
| `alfresco.transform-aio.version` | | *not important* | The version of the [Alfresco Transform Core Engine Docker Image](https://hub.docker.com/r/alfresco/alfresco-transform-core-aio/tags). |
### Other APIs
Additional less important configurations are inherited from the following Maven Tiles.
* [`beedk-run-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-run-tile)
## Results
The AIO Alfresco Transform Engine will be started during the `process-classes` Maven phase.
This tile will result in the definition of the following Maven properties during the respective Maven phase.
| Property | Data Type | Phase | Description |
| --------------------------------- |:---------:|:------------:| ----------- |
| `beedk.rad.alts.enabled` | Boolean | *At startup* | `true`, which signals other Maven Tiles |

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-acs-lts-rad-tile</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>tile</packaging>
<name>Order of the Bee Development Kit: RAD for ACS Local Transform Service</name>
<scm>
<url>https://bitbucket.org/inteligr8/ootbee-beedk</url>
</scm>
<organization>
<name>Order of the Bee</name>
<url>https://orderofthebee.net</url>
</organization>
<developers>
<developer>
<name>Brian Long</name>
<email>brian@inteligr8.com</email>
<organization>Inteligr8</organization>
<organizationUrl>https://www.inteligr8.com</organizationUrl>
<url>https://twitter.com/brianmlong</url>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0 https://bitbucket.org/inteligr8/maven-tiles/raw/xsd/src/main/resources/maven-tiles.xsd">
<profiles>
<profile>
<id>rad-acs-lts</id>
<activation>
<property>
<name>rad</name>
</property>
</activation>
<build>
<plugins>
<!-- Using Docker for Alfresco AIO Transform Engine without ATS -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${beedk.plugins.fabric8.docker.version}</version>
<executions>
<execution>
<id>run-alts</id>
<phase>process-classes</phase>
<goals><goal>start</goal></goals>
<configuration>
<images>
<image>
<name>alfresco/alfresco-transform-core-aio:${alfresco.transform-aio.version}</name>
<alias>ate-aio</alias>
<run>
<ports>
<port>${alfresco.transform-aio.port}:8090</port>
</ports>
<network>
<mode>custom</mode>
<name>${project.artifactId}</name>
</network>
</run>
</image>
</images>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>default-props</id>
<activation>
<property>
<name>!some-prop-that-never-exists</name>
</property>
</activation>
<properties>
<!-- configurable -->
<alfresco.transform-aio.port>8091</alfresco.transform-aio.port>
<!-- versions -->
<alfresco.transform-aio.version>2.3.6</alfresco.transform-aio.version>
<!-- configuring beedk-acs-platform-rad-tile -->
<beedk.rad.alts.enabled>true</beedk.rad.alts.enabled>
</properties>
</profile>
</profiles>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-run-tile -->
<tile>com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT</tile>
</tiles>
</project>

9
beedk-acs-module-tile/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Eclipse
.project
.classpath
.settings
# Maven
pom.xml.versionsBackup
target

View File

@ -0,0 +1,68 @@
# BeeDK ACS Module Maven Tile
This is a component within the proposed [BeeDK](/inteligr8/ootbee-beedk). It is considered to be part of the **Private API** of the BeeDK.
## Purpose
This project creates a [Maven Tile](https://github.com/repaint-io/maven-tiles) that provides the basis for any ACS module or extension.
## Usage
To use this plugin, just reference it with the Maven Tiles plugin as shown in the following snippet. Do not forget the `extensions` element in the *plugin* configuration.
```xml
<project ...>
...
<build>
...
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>[2.0,3.0)</version>
<extensions>true</extensions>
<configuration>
<tiles>
...
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-module-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-module-tile:[1.0.0,2.0.0)</tile>
...
</tiles>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
```
## Configuration
In your Maven project, set the following properties to define the behavior of this Maven Tile. Unless otherwise stated, they can only be overridden in the project POM or other Maven Tiles loaded earlier than this Maven Tile.
### Public API
The following properties are intended to be exposed by inheriting Public API Maven Tiles.
| Maven Property | Required | Default | Description |
| ---------------------------------- |:--------:| ------------------ | ----------- |
| `project.build.packageDirectory` | | `target/package` | A variable specifying the folder name of consolidated resources for packaging. |
| `alfresco.module.pathname` | | `${project.groupId}.${project.artifactId}` | A variable specifying the folder name of module resources. Use this property to help reference module resources. It should rarely ever be overridden. |
## Results
This Maven Tile will result in the definition of the following Maven properties during the respective Maven phase.
| Property | Data Type | Phase | Description |
| ---------------------------- |:---------:|:------------:| ----------- |
| `alfresco.module.path` | Text | *At startup* | The classpath to the module resources: `alfresco/module/${alfresco.module.pathname}` |
## Initialization
This tile comes with the ability to initialize your project with the required file(s) of an ACS module. You can do this by executing any Maven build with the `scaffold` property.
```sh
mvn -Dscaffold generate-sources
```

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-acs-module-tile</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>tile</packaging>
<name>Order of the Bee Development Kit: ACS Module Core</name>
<scm>
<url>https://bitbucket.org/inteligr8/ootbee-beedk</url>
</scm>
<organization>
<name>Order of the Bee</name>
<url>https://orderofthebee.net</url>
</organization>
<developers>
<developer>
<name>Brian Long</name>
<email>brian@inteligr8.com</email>
<organization>Inteligr8</organization>
<organizationUrl>https://www.inteligr8.com</organizationUrl>
<url>https://twitter.com/brianmlong</url>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,257 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0 https://bitbucket.org/inteligr8/maven-tiles/raw/xsd/src/main/resources/maven-tiles.xsd">
<build>
<resources>
<!-- need to override default resources, even though this shows up in the build-helper too -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/README*</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>add-acs-module-resources</id>
<phase>generate-resources</phase>
<goals><goal>add-resource</goal></goals>
<configuration>
<resources>
<!-- copy & filter all the resource files -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/README*</exclude>
</excludes>
</resource>
<!-- copy & filter the contents of a convenient module folder -->
<resource>
<directory>src/main/module</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/README*</exclude>
</excludes>
<targetPath>${project.build.directory}/module-classes/${alfresco.module.path}</targetPath>
</resource>
<!-- copy & filter the contents of standard web to web output -->
<resource>
<directory>src/main/web</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/README*</exclude>
</excludes>
<targetPath>${project.build.directory}/web-resources/META-INF</targetPath>
</resource>
<!-- copy & filter the contents of standard webapp to web output -->
<resource>
<directory>src/main/webapp</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/README*</exclude>
</excludes>
<targetPath>${project.build.directory}/web-resources/META-INF</targetPath>
</resource>
<!-- copy & filter the contents of Alfresco SDK assembly/web to web output -->
<resource>
<directory>src/main/assembly/web</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/README*</exclude>
</excludes>
<targetPath>${project.build.directory}/web-resources/META-INF</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- This plugin prevents binary file formats from being corrupted due to filtering -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<!-- jpg, jpeg, gif, bmp and png are added automatically -->
<nonFilteredFileExtension>ftl</nonFilteredFileExtension>
<nonFilteredFileExtension>acp</nonFilteredFileExtension>
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
<nonFilteredFileExtension>pdf</nonFilteredFileExtension>
<nonFilteredFileExtension>doc</nonFilteredFileExtension>
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
<nonFilteredFileExtension>ppt</nonFilteredFileExtension>
<nonFilteredFileExtension>pptx</nonFilteredFileExtension>
<nonFilteredFileExtension>bin</nonFilteredFileExtension>
<nonFilteredFileExtension>lic</nonFilteredFileExtension>
<nonFilteredFileExtension>swf</nonFilteredFileExtension>
<nonFilteredFileExtension>zip</nonFilteredFileExtension>
<nonFilteredFileExtension>msg</nonFilteredFileExtension>
<nonFilteredFileExtension>jar</nonFilteredFileExtension>
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
<nonFilteredFileExtension>eot</nonFilteredFileExtension>
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
<nonFilteredFileExtension>css</nonFilteredFileExtension>
<nonFilteredFileExtension>ico</nonFilteredFileExtension>
<nonFilteredFileExtension>psd</nonFilteredFileExtension>
<nonFilteredFileExtension>js</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
<executions>
<!-- This plugin execution consolidates the compiled/generated/filtered resources into one directory for packaging -->
<execution>
<id>consolidate-resources</id>
<phase>process-resources</phase>
<goals><goal>copy-resources</goal></goals>
<configuration>
<outputDirectory>${project.build.packageDirectory}</outputDirectory>
<resources>
<resource>
<directory>${project.build.outputDirectory}</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>${project.build.directory}/module-classes</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>${project.build.directory}/web-resources</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- This plugin minifies (compresses) JavaScript files -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<configuration>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*.pack.js</exclude>
</excludes>
<excludeResources>true</excludeResources>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
<executions>
<!-- This execution compresses the JavaScript files in the compiled classes folder -->
<execution>
<id>compress-resources</id>
<phase>compile</phase>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<sourceDirectory>${project.build.packageDirectory}</sourceDirectory>
<outputDirectory>${project.build.packageDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- This plugin changes the packaging directory to the consolidated directory -->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<classesDirectory>${project.build.packageDirectory}</classesDirectory>
</configuration>
</plugin>
<!-- This plugin builds an AMP file during the package phase -->
<plugin>
<groupId>com.inteligr8.alfresco</groupId>
<artifactId>amp-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>build-amp-file</id>
<phase>package</phase>
<goals>
<goal>amp</goal>
</goals>
<configuration>
<skip>${beedk.jar.notest.empty}</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>scaffold-acs-module</id>
<activation>
<property>
<name>scaffold</name>
</property>
</activation>
<build>
<plugins>
<!-- This plugin downloads the required configurations for all modules -->
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.6.1</version>
<executions>
<execution>
<id>download-module-props</id>
<phase>generate-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://raw.githubusercontent.com/Alfresco/alfresco-sdk/alfresco-sdk-aggregator-${alfresco.sdk.version}/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__artifactId__/module.properties</url>
<outputDirectory>${basedir}/src/main/module</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>default-props</id>
<activation>
<property>
<name>!some-prop-that-never-exists</name>
</property>
</activation>
<properties>
<!-- configurable -->
<project.build.packageDirectory>${project.build.directory}/package</project.build.packageDirectory>
<alfresco.module.pathname>${project.groupId}.${project.artifactId}</alfresco.module.pathname>
<!-- output -->
<alfresco.module.path>alfresco/module/${alfresco.module.pathname}</alfresco.module.path>
</properties>
</profile>
</profiles>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-amp-check-tile -->
<tile>com.inteligr8.ootbee:beedk-amp-check-tile:1.0-SNAPSHOT</tile>
</tiles>
</project>

View File

@ -0,0 +1,9 @@
# Eclipse
.project
.classpath
.settings
# Maven
pom.xml.versionsBackup
target

View File

@ -0,0 +1,83 @@
# BeeDK ACS Platform Integration Test Maven Tile for non-Platform-accessible Projects
This is a component within the proposed [BeeDK](/inteligr8/ootbee-beedk). It is considered to be part of the **Public API** of the BeeDK.
## Purpose
This project creates a [Maven Tile](https://github.com/repaint-io/maven-tiles) that provides the basis for integration testing any Maven project against the ACS Platform.
## Usage
To use this plugin, just reference it with the Maven Tiles plugin as shown in the following snippet. Do not forget the `extensions` element in the *plugin* configuration.
```xml
<project ...>
...
<build>
...
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>[2.0,3.0)</version>
<extensions>true</extensions>
<configuration>
<tiles>
...
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-artifact-it-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-platform-artifact-it-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
```
There are 2 other alternative tiles that serve a similar purpose, but are for other use cases. Make sure you are using the right one. Follow the logic below.
Is your Maven project an ACS Platform module or ACS Platform web application?
: You will be declaring the `beedk-acs-platform-module-tile` or `beedk-acs-platform-webapp-tile` Maven Tile. You will need to explicitly declare and configure the [`beedk-acs-platform-self-it-tile` Maven Tile](../beedk-acs-platform-self-it-tile).
Is your Maven project just one within a set of other Maven projects AND one of those other Maven projects is an ACS Platform web application (not a module)?
: You will need to explicitly declare and configure the [`beedk-acs-platform-sibling-it-tile` Maven Tile](../beedk-acs-platform-sibling-it-tile).
Otherwise
: You will need to explicitly declare and configure this `beedk-acs-platform-artifact-it-tile` Maven Tile.
## Configuration
In your Maven project, set the following properties to define the behavior of this Maven Tile. Unless otherwise stated, they can only be overridden in the project POM or other Maven Tiles loaded earlier than this Maven Tile.
### Public API
The following properties are intended to be exposed by inheriting Public API Maven Tiles.
| Maven Property | Required | Default | Description |
| ---------------------------------- |:--------:| ------------------ | ----------- |
| `alfresco.platform.version` | Maybe | | The Alfresco Platform version to use for integration testing. See below for more details. |
| `edition` | | `community` | The Alfresco Platform edition used for integration testing. `community` or `enterprise`. See below for more details. |
| `alfresco.platform.war.groupId` | | `org.alfresco` | The Maven `groupId` of a Maven `war` Type Project defined in a Maven Repository. |
| `alfresco.platform.war.artifactId` | | *See Below* | The Maven `artifactId` of a Maven `war` Type Project defined in a Maven Repository. |
| `alfresco.platform.war.version` | Maybe | *See Below* | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository. |
| `project.build.extDirectory` | | `${project.build.directory}/ext/platform` | An additional directory of JARs to add to the ACS Platform at runtime. |
| `acs-platform.port` | | 8080 | The port to expose on `localhost` for scripts to use during integration testing to verify the state of the application; not for a developer or user.<br/>*Inherited from [`beedk-acs-platform-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-it-tile)* |
| `acs-postgres.port` | | 5432 | The port to expose on `localhost` for scripts to use during integration testing to verify the state of the application; not for a developer or user.<br/>*Inherited from [`beedk-acs-platform-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-it-tile)* |
| `acs-activemq.port` | | 8161 | The port to expose on `localhost` for scripts to use during integration testing to verify the state of the application; not for a developer or user.<br/> *Inherited from [`beedk-acs-platform-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-it-tile)* |
| `acs-platform.tomcat.opts` | | | Additional `CATALINA_OPTS` to add to the Apache Tomcat startup.<br/>*May be overridden by any POM parent or Maven Tile.*<br/>*Inherited from [`beedk-acs-platform-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-it-tile)* |
* The `edition` is used to default the `alfresco.platform.war.artifactId` to `content-services-community` or `content-services`.
* The `alfresco.platform.version` is used to default the `alfresco.platform.war.version`. It is expected to be used by other Maven Tiles, so it is here for convenience. You must specify either property for this tile to function.
### Other APIs
Additional less important configurations are inherited from the following Maven Tiles.
* [`beedk-acs-platform-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-it-tile)
## Results
The ACS Platform, database, and MQ components will be started and stopped during the `pre-integration-test` and `post-integration-test` Maven phases, respectively.

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-acs-platform-artifact-it-tile</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>tile</packaging>
<name>Order of the Bee Development Kit: Integration Testing for ACS Platform by Maven Artifact</name>
<scm>
<url>https://bitbucket.org/inteligr8/ootbee-beedk</url>
</scm>
<organization>
<name>Order of the Bee</name>
<url>https://orderofthebee.net</url>
</organization>
<developers>
<developer>
<name>Brian Long</name>
<email>brian@inteligr8.com</email>
<organization>Inteligr8</organization>
<organizationUrl>https://www.inteligr8.com</organizationUrl>
<url>https://twitter.com/brianmlong</url>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0 https://bitbucket.org/inteligr8/maven-tiles/raw/xsd/src/main/resources/maven-tiles.xsd">
<build>
<plugins>
<!-- This plugin downloads the Platform WAR and JDBC JAR dependency -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<!-- This execution downloads the Platform WAR -->
<execution>
<id>download-platform-webapp</id>
<phase>pre-integration-test</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${alfresco.platform.war.groupId}</groupId>
<artifactId>${alfresco.platform.war.artifactId}</artifactId>
<version>${alfresco.platform.war.version}</version>
<type>war</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.warDirectory}</outputDirectory>
</configuration>
</execution>
<!-- This execution downloads the postgreSQL JDBC JAR -->
<execution>
<id>download-platform-jdbc</id>
<phase>pre-integration-test</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.jdbc.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${beedk.deploy.platform.extDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!-- This translates 'edition' into a configurable property -->
<profile>
<id>acs-community</id>
<activation>
<property>
<name>edition</name>
<value>!enterprise</value>
</property>
</activation>
<properties>
<!-- configurable -->
<alfresco.platform.war.artifactId>content-services-community</alfresco.platform.war.artifactId>
</properties>
</profile>
<!-- This translates 'edition' into a configurable property -->
<profile>
<id>acs-enterprise</id>
<activation>
<property>
<name>edition</name>
<value>enterprise</value>
</property>
</activation>
<properties>
<!-- configurable -->
<alfresco.platform.war.artifactId>content-services</alfresco.platform.war.artifactId>
</properties>
</profile>
<profile>
<id>default-props</id>
<activation>
<property>
<name>!some-prop-that-never-exists</name>
</property>
</activation>
<properties>
<!-- configurable -->
<project.build.warDirectory>${project.build.directory}/war</project.build.warDirectory>
<project.build.extDirectory>${project.build.directory}/ext/platform</project.build.extDirectory>
<alfresco.platform.war.groupId>org.alfresco</alfresco.platform.war.groupId>
<alfresco.platform.war.version>${alfresco.platform.version}</alfresco.platform.war.version>
<!-- versions -->
<postgres.jdbc.version>42.2.18</postgres.jdbc.version>
<!-- configuring beedk-acs-platform-it-tile -->
<beedk.deploy.platform.warFile>${project.build.warDirectory}/${alfresco.platform.war.artifactId}-${alfresco.platform.war.version}.war</beedk.deploy.platform.warFile>
<beedk.deploy.platform.extDirectory>${project.build.extDirectory}</beedk.deploy.platform.extDirectory>
</properties>
</profile>
</profiles>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-it-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-platform-it-tile:1.0-SNAPSHOT</tile>
</tiles>
</project>

View File

@ -0,0 +1,9 @@
# Eclipse
.project
.classpath
.settings
# Maven
pom.xml.versionsBackup
target

View File

@ -0,0 +1,87 @@
# BeeDK ACS Platform RAD Maven Tile for non-Platform-accessible Projects
This is a component within the proposed [BeeDK](/inteligr8/ootbee-beedk). It is considered to be part of the **Public API** of the BeeDK.
## Purpose
This project creates a [Maven Tile](https://github.com/repaint-io/maven-tiles) that provides the basis for rapid application development any Maven project against the ACS Platform.
## Usage
To use this plugin, just reference it with the Maven Tiles plugin as shown in the following snippet. Do not forget the `extensions` element in the *plugin* configuration.
```xml
<project ...>
...
<build>
...
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>[2.0,3.0)</version>
<extensions>true</extensions>
<configuration>
<tiles>
...
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-artifact-rad-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-platform-artifact-rad-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
```
There are 2 other alternative tiles that serve a similar purpose, but are for other use cases. Make sure you are using the right one. Follow the logic below.
Is your Maven project an ACS Platform module or ACS Platform web application?
: You will be declaring the `beedk-acs-platform-module-tile` or `beedk-acs-platform-webapp-tile` Maven Tile. You will need to explicitly declare and configure the [`beedk-acs-platform-self-rad-tile` Maven Tile](../beedk-acs-platform-self-rad-tile).
Is your Maven project just one within a set of other Maven projects AND one of those other Maven projects is an ACS Platform web application (not a module)?
: You will need to explicitly declare and configure the [`beedk-acs-platform-sibling-rad-tile` Maven Tile](../beedk-acs-platform-sibling-rad-tile).
Otherwise
: You will need to explicitly declare and configure the `beedk-acs-platform-artifact-rad-tile` Maven Tile.
See the [BeeDK documentation](/inteligr8/ootbee-beedk) on instructions for how to start and stop RAD capabilities.
## Configuration
In your Maven project, set the following properties to define the behavior of this Maven Tile. Unless otherwise stated, they can only be overridden in the project POM or other Maven Tiles loaded earlier than this Maven Tile.
### Public API
The following properties are intended to be exposed by inheriting Public API Maven Tiles.
| Maven Property | Required | Default | Description |
| ---------------------------------- |:--------:| ------------------ | ----------- |
| `alfresco.platform.version` | Maybe | | The Alfresco Platform version to use for RAD. See below for more details. |
| `edition` | | `community` | The Alfresco Platform edition used for RAD. `community` or `enterprise`. See below for more details. |
| `alfresco.platform.war.groupId` | | `org.alfresco` | The Maven `groupId` of a Maven `war` Type Project defined in a Maven Repository. |
| `alfresco.platform.war.artifactId` | | *See Below* | The Maven `artifactId` of a Maven `war` Type Project defined in a Maven Repository. |
| `alfresco.platform.war.version` | Maybe | *See Below* | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository. |
| `project.build.extDirectory` | | `${project.build.directory}/ext/platform` | An additional directory of JARs to add to the ACS Platform at runtime. |
| `acs-platform.port` | | 8080 | The port to expose on `localhost` for the developer; not for other applications or users.<br/>*Inherited from [`beedk-acs-platform-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-rad-tile)* |
| `acs-platform.debugger.port` | | 8000 | The port to expose on `localhost` for the developer; not for other applications or users.<br/>*Inherited from [`beedk-acs-platform-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-rad-tile)* |
| `acs-postgres.port` | | 5432 | The port to expose on `localhost` for the developer; not for other applications or users.<br/>*Inherited from [`beedk-acs-platform-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-rad-tile)* |
| `acs-activemq.port` | | 8161 | The port to expose on `localhost` for the developer; not for other applications or users.<br/> *Inherited from [`beedk-acs-platform-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-rad-tile)* |
| `acs-platform.tomcat.opts` | | | Additional `CATALINA_OPTS` to add to the Apache Tomcat startup.<br/>*May be overridden by any POM parent or Maven Tile.*<br/>*Inherited from [`beedk-acs-platform-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-rad-tile)* |
* The `edition` is used to default the `alfresco.platform.war.artifactId` to `content-services-community` or `content-services`.
* The `alfresco.platform.version` is used to default the `alfresco.platform.war.version`. It is expected to be used by other Maven Tiles, so it is here for convenience. You must specify either property for this tile to function.
### Other APIs
Additional less important configurations are inherited from the following Maven Tiles.
* [`beedk-acs-platform-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-rad-tile)
## Results
The ACS Platform, database, and MQ components will be started during the `process-classes` Maven phase.

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-acs-platform-artifact-rad-tile</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>tile</packaging>
<name>Order of the Bee Development Kit: RAD for ACS Platform by Maven Artifact</name>
<scm>
<url>https://bitbucket.org/inteligr8/ootbee-beedk</url>
</scm>
<organization>
<name>Order of the Bee</name>
<url>https://orderofthebee.net</url>
</organization>
<developers>
<developer>
<name>Brian Long</name>
<email>brian@inteligr8.com</email>
<organization>Inteligr8</organization>
<organizationUrl>https://www.inteligr8.com</organizationUrl>
<url>https://twitter.com/brianmlong</url>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0 https://bitbucket.org/inteligr8/maven-tiles/raw/xsd/src/main/resources/maven-tiles.xsd">
<profiles>
<profile>
<id>rad-acs-platform-artifact</id>
<activation>
<property>
<name>rad</name>
</property>
</activation>
<build>
<plugins>
<!-- This plugin downloads the Platform WAR and JDBC JAR dependency -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<!-- This execution downloads the Platform WAR -->
<execution>
<id>download-platform-webapp</id>
<phase>generate-resources</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${alfresco.platform.war.groupId}</groupId>
<artifactId>${alfresco.platform.war.artifactId}</artifactId>
<version>${alfresco.platform.war.version}</version>
<type>war</type>
</artifactItem>
</artifactItems>
<outputDirectory>${beedk.deploy.platform.warDirectory}</outputDirectory>
</configuration>
</execution>
<!-- This execution downloads the postgreSQL JDBC JAR -->
<execution>
<id>download-platform-jdbc</id>
<phase>generate-resources</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.jdbc.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${beedk.deploy.platform.extDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- This translates 'edition' into a configurable property -->
<profile>
<id>acs-community</id>
<activation>
<property>
<name>edition</name>
<value>!enterprise</value>
</property>
</activation>
<properties>
<!-- configurable -->
<alfresco.platform.war.artifactId>content-services-community</alfresco.platform.war.artifactId>
</properties>
</profile>
<!-- This translates 'edition' into a configurable property -->
<profile>
<id>acs-enterprise</id>
<activation>
<property>
<name>edition</name>
<value>enterprise</value>
</property>
</activation>
<properties>
<!-- configurable -->
<alfresco.platform.war.artifactId>content-services</alfresco.platform.war.artifactId>
</properties>
</profile>
<profile>
<id>default-props</id>
<activation>
<property>
<name>!some-prop-that-never-exists</name>
</property>
</activation>
<properties>
<!-- configurable -->
<project.build.warDirectory>${project.build.directory}/war</project.build.warDirectory>
<project.build.extDirectory>${project.build.directory}/ext/platform</project.build.extDirectory>
<alfresco.platform.war.groupId>org.alfresco</alfresco.platform.war.groupId>
<alfresco.platform.war.version>${alfresco.platform.version}</alfresco.platform.war.version>
<!-- versions -->
<postgres.jdbc.version>42.2.18</postgres.jdbc.version>
<!-- configuring beedk-acs-platform-rad-tile -->
<beedk.deploy.platform.warFile>${project.build.warDirectory}/${alfresco.platform.war.artifactId}-${alfresco.platform.war.version}.war</beedk.deploy.platform.warFile>
<beedk.deploy.platform.extDirectory>${project.build.extDirectory}</beedk.deploy.platform.extDirectory>
</properties>
</profile>
</profiles>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-rad-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-platform-rad-tile:1.0-SNAPSHOT</tile>
</tiles>
</project>

9
beedk-acs-platform-it-tile/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Eclipse
.project
.classpath
.settings
# Maven
pom.xml.versionsBackup
target

View File

@ -0,0 +1,81 @@
# BeeDK Abstract ACS Platform Maven Tile for Integration Tests
This is a component within the proposed [BeeDK](/inteligr8/ootbee-beedk). It is considered to be part of the **Private API** of the BeeDK.
## Purpose
This project creates a [Maven Tile](https://github.com/repaint-io/maven-tiles) that provides the basis for integration testing any ACS module, extension, service, or web application. It is intended to be used by other BeeDK components and not directly by any development project.
## Usage
To use this plugin, just reference it with the Maven Tiles plugin as shown in the following snippet. Do not forget the `extensions` element in the *plugin* configuration.
```xml
<project ...>
...
<build>
...
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>[2.0,3.0)</version>
<extensions>true</extensions>
<configuration>
<tiles>
...
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-it-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-platform-it-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
```
## Configuration
In your Maven project, set the following properties to define the behavior of this Maven Tile. Unless otherwise stated, they can only be overridden in the project POM or other Maven Tiles loaded earlier than this Maven Tile.
### Public API
The following properties are intended to be exposed by inheriting Public API Maven Tiles.
| Maven Property | Required | Default | Description |
| -------------------------- |:--------:| --------------- | ----------- |
| `acs-platform.port` | | 8080 | The port to expose on `localhost` for scripts to use during integration testing to verify the state of the application; not for a developer or user. |
| `acs-postgres.port` | | 5432 | The port to expose on `localhost` for scripts to use during integration testing to verify the state of the application; not for a developer or user. |
| `acs-activemq.port` | | 8161 | The port to expose on `localhost` for scripts to use during integration testing to verify the state of the application; not for a developer or user. |
| `acs-platform.tomcat.opts` | | | Additional `CATALINA_OPTS` to add to the Apache Tomcat startup.<br/>*May be overridden by any POM parent or Maven Tile.* |
| `acs-platform.timeout` | | 120000 | The time to wait for the startup to complete, in milliseconds. |
| `acs-postgres.version` | | *not important* | The version of PostgreSQL to use in the integration testing infrastructure. |
| `acs-activemq.version` | | *not important* | The version of Alfresco ActiveMQ to use in the integration testing infrastructure. |
### Private API
The following properties are only intended to be defined by BeeDK components.
| Maven Property | Required | Default | Description |
| ------------------------------------ |:--------:| ------------------ | ----------- |
| `beedk.deploy.platform.warFile` | **Yes** | | The WAR file to deploy in the Apache Tomcat instance. |
| `beedk.deploy.platform.testClassesDirectory` | | | An additional test classpath directory to sideload into the web application. |
| `beedk.deploy.platform.extDirectory` | | | An additional directory of JARs to sideload into the web application. |
| `beedk.deploy.platform.dataDirectory` | | `${project.build.directory}/alf_data` | The temporary binary storage location for ACS. |
| `beedk.deploy.acs-search.enabled` | | false | **Do not** set explicitly; just include the [`beedk-acs-search-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-search-it-tile) tile **AFTER** this tile. |
| `beedk.deploy.alts.enabled` | | false | **Do not** set explicitly; just include the [`beedk-acs-lts-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-lts-it-tile) tile **AFTER** this tile. |
| `beedk.deploy.ats.enabled` | | false | **Do not** set explicitly; just include the [`beedk-ats-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-ats-it-tile) tile **AFTER** this tile. |
| `tomcat-rad.version` | | *not important* | The version of the [Apache Tomcat Rapid Application Development Docker container](/inteligr8/tomcat-rad-docker). |
### Other APIs
Additional less important configurations are inherited from the following Maven Tiles.
* [`beedk-run-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-run-tile)
## Results
The ACS Platform, database, and MQ components will be started and stopped during the `pre-integration-test` and `post-integration-test` Maven phases, respectively.

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-acs-platform-it-tile</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>tile</packaging>
<name>Order of the Bee Development Kit: Integration Testing for ACS Platform Core</name>
<scm>
<url>https://bitbucket.org/inteligr8/ootbee-beedk</url>
</scm>
<organization>
<name>Order of the Bee</name>
<url>https://orderofthebee.net</url>
</organization>
<developers>
<developer>
<name>Brian Long</name>
<email>brian@inteligr8.com</email>
<organization>Inteligr8</organization>
<organizationUrl>https://www.inteligr8.com</organizationUrl>
<url>https://twitter.com/brianmlong</url>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0 https://bitbucket.org/inteligr8/maven-tiles/raw/xsd/src/main/resources/maven-tiles.xsd">
<build>
<plugins>
<!-- Using Docker to host the web application -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${beedk.plugins.fabric8.docker.version}</version>
<executions>
<execution>
<id>start-acs-platform</id>
<phase>pre-integration-test</phase>
<goals><goal>start</goal></goals>
<configuration>
<images>
<image>
<name>postgres:${acs-postgres.version}</name>
<alias>acs-db</alias>
<run>
<skip>${skipTests}</skip>
<env>
<POSTGRES_PASSWORD>alfresco</POSTGRES_PASSWORD>
<POSTGRES_USER>alfresco</POSTGRES_USER>
<POSTGRES_DB>alfresco</POSTGRES_DB>
</env>
<ports>
<port>${acs-postgres.port}:5432</port>
</ports>
<network>
<mode>custom</mode>
<name>${project.artifactId}</name>
</network>
</run>
</image>
<image>
<name>alfresco/alfresco-activemq:${acs-activemq.version}</name>
<alias>acs-mq</alias>
<run>
<skip>${skipTests}</skip>
<ports>
<port>${acs-activemq.port}:8161</port>
</ports>
<network>
<mode>custom</mode>
<name>${project.artifactId}</name>
</network>
</run>
</image>
<image>
<name>docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version}</name>
<alias>acs-platform</alias>
<run>
<skip>${skipTests}</skip>
<env>
<JAVA_MEMORY_MAX>${acs-platform.memory}</JAVA_MEMORY_MAX>
<CATALINA_OPTS>-Ddir.root=/tmp/alf_data -Ddb.driver=org.postgresql.Driver -Ddb.url=jdbc:postgresql://${project.artifactId}-acs-db:5432/alfresco \
-Dmessaging.broker.url=failover:\(tcp://${project.artifactId}-acs-mq:61616\)?timeout\=3000\&amp;jms.useCompression\=true \
-Dtransform.service.enabled=${beedk.deploy.ats.enabled} -Dtransform.service.url=http://${project.artifactId}-ats-atr:8095 -Dsfs.url=http://${project.artifactId}-ats-sfs:8099 \
-Dlocal.transform.service.enabled=${beedk.deploy.alts.enabled} \
-DlocalTransform.core-aio.url=http://${project.artifactId}-ate-aio:8090 -DlocalTransform.ate.url=http://${project.artifactId}-ate:8090 \
-Djodconverter.enabled=false \
-Dalfresco-pdf-renderer.url=http://${project.artifactId}-ate-aio:8090 -Djodconverter.url=http://${project.artifactId}-ate-aio:8090 -Dimg.url=http://${project.artifactId}-ate-aio:8090 -Dtika.url=http://${project.artifactId}-ate-aio:8090 -Dtransform.misc.url=http://${project.artifactId}-ate-aio:8090 \
-Dindex.subsystem.name=${beedk.deploy.platform.index} -Dsolr.host=${project.artifactId}-acs-search -Dsolr.secureComms=none \
${acs-platform.tomcat.opts}</CATALINA_OPTS>
</env>
<ports>
<port>${acs-platform.port}:8080</port>
</ports>
<network>
<mode>custom</mode>
<name>${project.artifactId}</name>
</network>
<volumes>
<bind>
<volume>${beedk.deploy.platform.warFile}:/var/lib/tomcat/webapps/alfresco.war:ro</volume>
<volume>${beedk.deploy.platform.testClassesDirectory}:/var/lib/tomcat/dev/classes:ro</volume>
<volume>${beedk.deploy.platform.extDirectory}:/var/lib/tomcat/dev/lib:ro</volume>
<volume>${beedk.deploy.platform.dataDirectory}:/tmp/alf_data:rw</volume>
</bind>
</volumes>
<wait>
<http>
<url>http://localhost:${acs-platform.port}/alfresco/service/api/server</url>
<method>GET</method>
<status>200..399</status>
</http>
<time>${acs-platform.timeout}</time>
</wait>
</run>
</image>
</images>
</configuration>
</execution>
<execution>
<id>stop-acs-platform</id>
<phase>post-integration-test</phase>
<goals><goal>stop</goal></goals>
<configuration>
<images>
<image>
<name>postgres:${acs-postgres.version}</name>
<alias>acs-db</alias>
</image>
<image>
<name>alfresco/alfresco-activemq:${acs-activemq.version}</name>
<alias>acs-mq</alias>
</image>
<image>
<name>docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version}</name>
<alias>acs-platform</alias>
</image>
</images>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>acs-search-disabled</id>
<activation>
<property>
<name>!beedk.deploy.acs-search.enabled</name>
</property>
</activation>
<properties>
<beedk.deploy.platform.index>noindex</beedk.deploy.platform.index>
</properties>
</profile>
<profile>
<id>acs-search-enabled</id>
<activation>
<property>
<name>beedk.deploy.acs-search.enabled</name>
</property>
</activation>
<properties>
<beedk.deploy.platform.index>solr6</beedk.deploy.platform.index>
</properties>
</profile>
<!-- allow downstream tiles to default this before this tile does -->
<profile>
<id>ats-unspecified</id>
<activation>
<property>
<name>!beedk.deploy.ats.enabled</name>
</property>
</activation>
<properties>
<beedk.deploy.ats.enabled>false</beedk.deploy.ats.enabled>
</properties>
</profile>
<!-- allow downstream tiles to default this before this tile does -->
<profile>
<id>alts-unspecified</id>
<activation>
<property>
<name>!beedk.deploy.alts.enabled</name>
</property>
</activation>
<properties>
<beedk.deploy.alts.enabled>false</beedk.deploy.alts.enabled>
</properties>
</profile>
<!-- allow downstream tiles to default this before this tile does -->
<profile>
<id>tomcat-opts-unspecified</id>
<activation>
<property>
<name>!acs-platform.tomcat.opts</name>
</property>
</activation>
<properties>
<acs-platform.tomcat.opts></acs-platform.tomcat.opts>
</properties>
</profile>
<profile>
<id>default-props</id>
<activation>
<property>
<name>!some-prop-that-never-exists</name>
</property>
</activation>
<properties>
<!-- configurable -->
<beedk.deploy.platform.testClassesDirectory>${project.build.directory}/doesnotexist</beedk.deploy.platform.testClassesDirectory>
<beedk.deploy.platform.extDirectory>${project.build.directory}/doesnotexist</beedk.deploy.platform.extDirectory>
<beedk.deploy.platform.dataDirectory>${project.build.directory}/alf_data</beedk.deploy.platform.dataDirectory>
<acs-platform.timeout>120000</acs-platform.timeout>
<acs-platform.memory>1g</acs-platform.memory>
<!-- ports -->
<acs-postgres.port>5432</acs-postgres.port>
<acs-activemq.port>8161</acs-activemq.port>
<acs-platform.port>8080</acs-platform.port>
<!-- versions -->
<acs-postgres.version>9.6</acs-postgres.version>
<acs-activemq.version>5.15.8</acs-activemq.version>
<tomcat-rad.version>9-1.3</tomcat-rad.version>
</properties>
</profile>
</profiles>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-run-tile -->
<tile>com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT</tile>
</tiles>
</project>

View File

@ -0,0 +1,9 @@
# Maven
/target
pom.xml.versionsBackup
# Eclipse
.settings
.project
.classpath

View File

@ -0,0 +1,52 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-acs-platform-module-archetype</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<name>Order of the Bee Development Kit: Project Scaffolding for an ACS Platform Module</name>
<scm>
<url>https://bitbucket.org/inteligr8/ootbee-beedk</url>
</scm>
<organization>
<name>Order of the Bee</name>
<url>https://orderofthebee.net</url>
</organization>
<developers>
<developer>
<name>Brian Long</name>
<email>brian@inteligr8.com</email>
<organization>Inteligr8</organization>
<organizationUrl>https://www.inteligr8.com</organizationUrl>
<url>https://twitter.com/brianmlong</url>
</developer>
</developers>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
<version>3.1.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,59 @@
<archetype-descriptor name="${project.artifactId}"
xmlns="https://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0 https://maven.apache.org/xsd/archetype-descriptor-1.1.0.xsd">
<requiredProperties>
<requiredProperty key="shortname">
<validationRegex>[A-Za-z0-9]+</validationRegex>
</requiredProperty>
<requiredProperty key="dockerRegistryHost">
<defaultValue>quay.io</defaultValue>
</requiredProperty>
<requiredProperty key="dockerImagePrefix">
<defaultValue>local</defaultValue>
</requiredProperty>
</requiredProperties>
<fileSets>
<fileSet filtered="true" packaged="true">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="true">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="true">
<directory>src/main/extension/templates/webscripts</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="true">
<directory>src/main/resources/alfresco/extension/templates/webscripts</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true">
<directory>src</directory>
<excludes>
<exclude>main/extension/templates/webscripts/**/*</exclude>
<exclude>main/resources/alfresco/extension/templates/webscripts/**/*</exclude>
<exclude>main/java/**/*</exclude>
<exclude>test/java/**/*</exclude>
</excludes>
</fileSet>
<fileSet filtered="false">
<directory></directory>
<includes>
<include>.gitignore</include>
<include>rad.*</include>
<include>*.md</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>

View File

@ -0,0 +1,8 @@
# Maven
/target
pom.xml.versionsBackup
# Eclipse
.settings
.project
.classpath

View File

@ -0,0 +1,82 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<packaging>jar</packaging>
<name>${shortname} ACS Platform Module</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<alfresco.sdk.version>4.2.0</alfresco.sdk.version>
<alfresco.platform.version>6.2.0-ga</alfresco.platform.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>acs-community-packaging</artifactId>
<version>${alfresco.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Very popular, but not required, dependency -->
<!-- Provided as an example -->
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-repository</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-self-rad-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-platform-self-rad-tile:1.0-SNAPSHOT</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-module-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-platform-module-tile:1.0-SNAPSHOT</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-self-it-tile
<tile>com.inteligr8.ootbee:beedk-acs-platform-self-it-tile:1.0-SNAPSHOT</tile> -->
</tiles>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>inteligr8-releases</id>
<url>http://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
</repository>
<repository>
<id>alfresco-public</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>inteligr8-releases</id>
<url>http://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
</pluginRepository>
</pluginRepositories>
</project>

View File

@ -0,0 +1,66 @@
function discoverArtifactId {
$script:ARTIFACT_ID=(mvn -q -Dexpression=project"."artifactId -DforceStdout help:evaluate)
}
function rebuild {
echo "Rebuilding project ..."
mvn process-classes
}
function start_ {
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
mvn -Drad process-classes
}
function stop_ {
discoverArtifactId
echo "Stopping Docker containers that supported rapid application development ..."
docker container ls --filter name=${ARTIFACT_ID}-*
echo "Stopping containers ..."
docker container stop (docker container ls -q --filter name=${ARTIFACT_ID}-*)
echo "Removing containers ..."
docker container rm (docker container ls -aq --filter name=${ARTIFACT_ID}-*)
}
function tail_logs {
param (
$container
)
discoverArtifactId
docker container logs -f (docker container ls -q --filter name=${ARTIFACT_ID}-${container})
}
function list {
discoverArtifactId
docker container ls --filter name=${ARTIFACT_ID}-*
}
switch ($args[0]) {
"start" {
start_
}
"stop" {
stop_
}
"restart" {
stop_
start_
}
"rebuild" {
rebuild
}
"tail" {
tail_logs $args[1]
}
"containers" {
list
}
default {
echo "Usage: .\rad.ps1 [ start | stop | restart | rebuild | tail {container} | containers ]"
}
}
echo "Completed!"

View File

@ -0,0 +1,63 @@
#!/bin/sh
discoverArtifactId() {
ARTIFACT_ID=`mvn -q -Dexec.executable=echo -Dexec.args='${project.artifactId}' --non-recursive exec:exec 2>/dev/null`
}
rebuild() {
echo "Rebuilding project ..."
mvn process-classes
}
start() {
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
mvn -Drad process-classes
}
stop() {
discoverArtifactId
echo "Stopping Docker containers that supported rapid application development ..."
docker container ls --filter name=${ARTIFACT_ID}-*
echo "Stopping containers ..."
docker container stop `docker container ls -q --filter name=${ARTIFACT_ID}-*`
echo "Removing containers ..."
docker container rm `docker container ls -aq --filter name=${ARTIFACT_ID}-*`
}
tail_logs() {
discoverArtifactId
docker container logs -f `docker container ls -q --filter name=${ARTIFACT_ID}-$1`
}
list() {
discoverArtifactId
docker container ls --filter name=${ARTIFACT_ID}-*
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
rebuild)
rebuild
;;
tail)
tail_logs $2
;;
containers)
list
;;
*)
echo "Usage: ./rad.sh [ start | stop | restart | rebuild | tail {container} | containers ]"
exit 1
esac
echo "Completed!"

View File

@ -0,0 +1,42 @@
package ${package};
import java.util.List;
import org.alfresco.repo.action.ParameterDefinitionImpl;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* This class is an example of how you can use the Alfresco Java Public API in Alfresco Actions.
*/
public class ExampleActionExecuter extends ActionExecuterAbstractBase {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
protected ServiceRegistry serviceRegistry;
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
paramList.add(new ParameterDefinitionImpl("example.param", DataTypeDefinition.TEXT, false, "Param #1"));
}
@Override
protected void executeImpl(Action action, NodeRef actionedUponNoderef) {
if (this.logger.isTraceEnabled())
this.logger.trace("executeImpl('" + actionedUponNoderef + "')");
String value = (String)action.getParameterValue("example.param");
// TODO do some work
}
}

View File

@ -0,0 +1,76 @@
package ${package};
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* This class is an example of how you can use the Alfresco Java Public API on startup or shutdown.
*/
@Component
public class ExampleBootstrap implements InitializingBean, DisposableBean {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
protected ServiceRegistry serviceRegistry;
@Override
public void afterPropertiesSet() throws Exception {
if (this.logger.isTraceEnabled())
this.logger.trace("onStartup()");
// provide some authority within the Alfresco context
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork() throws Exception {
// provide expected hiccup/concurrency protection
return ExampleBootstrap.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>() {
@Override
public Void execute() throws Throwable {
ExampleBootstrap.this.onStartup();
return null;
}
});
}
});
}
@Override
public void destroy() throws Exception {
if (this.logger.isTraceEnabled())
this.logger.trace("onShutdown()");
// provide some authority within the Alfresco context
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork() throws Exception {
// provide expected hiccup/concurrency protection
return ExampleBootstrap.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>() {
@Override
public Void execute() throws Throwable {
ExampleBootstrap.this.onShutdown();
return null;
}
});
}
});
}
public void onStartup() {
// TODO do some work
}
public void onShutdown() {
// TODO do some work
}
}

View File

@ -0,0 +1,48 @@
package ${package};
import org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy;
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* This class is an example of how you can use the Alfresco Java Public API when Alfresco triggers an event.
*/
@Component
public class ExampleEventListener implements InitializingBean, OnCreateNodePolicy {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
protected ServiceRegistry serviceRegistry;
@Override
public void afterPropertiesSet() throws Exception {
this.bind();
}
public void bind() {
if (this.logger.isTraceEnabled())
this.logger.trace("bind()");
// example listener
this.serviceRegistry.getPolicyComponent().bindClassBehaviour(OnCreateNodePolicy.QNAME, this,
new JavaBehaviour(this, OnCreateNodePolicy.QNAME.getLocalName(), NotificationFrequency.TRANSACTION_COMMIT));
}
@Override
public void onCreateNode(ChildAssociationRef childAssocRef) {
if (this.logger.isTraceEnabled())
this.logger.trace("onCreateNode('" + childAssocRef.getChildRef() + "')");
// TODO do some work
}
}

View File

@ -0,0 +1,35 @@
package ${package};
import org.alfresco.service.ServiceRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.extensions.webscripts.AbstractWebScript;
import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
* This class is an example of how you can use the Alfresco Java Public API by listening for external ReST requests.
*
* The component value (bean ID) must start with 'webscript.' and end with '.{rest_method}'.
*/
@Component(value = "webscript.${package}.exampleJava.get")
public class ExampleGetWebScript extends AbstractWebScript {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
protected ServiceRegistry serviceRegistry;
@Override
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
if (this.logger.isTraceEnabled())
this.logger.trace("execute()");
// TODO do some work
}
}

View File

@ -0,0 +1,29 @@
package ${package};
import org.alfresco.repo.processor.BaseProcessorExtension;
import org.alfresco.service.ServiceRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* This class is an example of how you can use the Alfresco Java Public API to extend the JavaScript engine.
*/
public class ExampleJavaScriptRootObject extends BaseProcessorExtension {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
protected ServiceRegistry serviceRegistry;
public String getMessage(String messageKey) {
if (this.logger.isTraceEnabled())
this.logger.trace("getMessage('" + messageKey + "')");
// just and example method, called in JS with: example.getMessage("example.property");
return this.serviceRegistry.getDictionaryService().getMessage(messageKey);
}
}

View File

@ -0,0 +1,76 @@
package ${package};
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
import org.quartz.CronScheduleBuilder;
import org.quartz.Job;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
/**
* This class is an example of how you can use the Alfresco Java Public API on a routine schedule.
*/
@Component
public class ExampleJob implements Job {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// this is the Alfresco Public Java API entrypoint
@Autowired
private ServiceRegistry serviceRegistry;
@Bean
public JobDetail jobDetail() {
return JobBuilder.newJob().ofType(this.getClass())
.withIdentity("exampleJobName", "${groupId}.${artifactId}")
.build();
}
@Bean
public Trigger trigger(JobDetail jobDetail) {
return TriggerBuilder.newTrigger().forJob(jobDetail)
.withIdentity("exampleTriggerName", "${groupId}.${artifactId}")
.withSchedule(CronScheduleBuilder.dailyAtHourAndMinute(3, 30))
.build();
}
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
if (this.logger.isTraceEnabled())
this.logger.trace("execute('" + context.getFireInstanceId() + "')");
// provide some authority within the Alfresco context
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork() throws Exception {
// provide expected hiccup/concurrency protection
return ExampleJob.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>() {
@Override
public Void execute() throws Throwable {
ExampleJob.this.fire(context);
return null;
}
});
}
});
}
public void fire(JobExecutionContext context) throws JobExecutionException {
if (this.logger.isTraceEnabled())
this.logger.trace("fire('" + context.getFireInstanceId() + "')");
// TODO do some work
}
}

View File

@ -0,0 +1,12 @@
package ${package}.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ModuleEarlyComponent {
}

View File

@ -0,0 +1,12 @@
package ${package}.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ModuleLateComponent {
}

Some files were not shown because too many files have changed in this diff Show More