commit a7fef4641b7d25bb9ab00aaa81f1d793698b1eee Author: Brian Long Date: Thu Apr 22 15:58:20 2021 -0400 initial checkin diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e740936 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Maven +target +pom.xml.versionsBackup + +# Eclipse +.project +.classpath +.settings + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0e14d8e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "disabled" +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7a94e1f --- /dev/null +++ b/README.md @@ -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 + + ... + + ... + + inteligr8 + + + inteligr8-public + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + + ... + + ... + +``` + +#### 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 + + + + custom-archetype + + + archetype + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + + + + custom-archetype + + +``` + +### 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 +``` diff --git a/beedk-acs-allinone-archetype/.gitignore b/beedk-acs-allinone-archetype/.gitignore new file mode 100644 index 0000000..5de9fc3 --- /dev/null +++ b/beedk-acs-allinone-archetype/.gitignore @@ -0,0 +1,9 @@ +# Maven +/target +pom.xml.versionsBackup + +# Eclipse +.settings +.project +.classpath + diff --git a/beedk-acs-allinone-archetype/pom.xml b/beedk-acs-allinone-archetype/pom.xml new file mode 100644 index 0000000..8fd3d90 --- /dev/null +++ b/beedk-acs-allinone-archetype/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-allinone-archetype + 1.0-SNAPSHOT + maven-archetype + + Order of the Bee Development Kit: Project Scaffolding for multi-module ACS projects + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + org.apache.maven.archetype + archetype-packaging + 3.1.1 + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/beedk-acs-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 0000000..9fe9bd6 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,50 @@ + + + + [A-Za-z0-9]+ + + + quay.io + + + local + + + [1.0.0,2.0.0) + + + + + + + */src/main/java/**/*.java + */src/test/java/**/*.java + */src/main/extension/templates/webscripts/**/* + */src/main/resources/alfresco/extension/templates/webscripts/**/* + + + + + + */src/**/* + + + */src/main/java/**/*.java + */src/test/java/**/*.java + */src/main/extension/templates/webscripts/**/* + */src/main/resources/alfresco/extension/templates/webscripts/**/* + + + + + + .gitignore + rad.* + *.md + + + + \ No newline at end of file diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/.gitignore b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/.gitignore new file mode 100644 index 0000000..0a33814 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/.gitignore @@ -0,0 +1,8 @@ +# Maven +/target +pom.xml.versionsBackup + +# Eclipse +.settings +.project +.classpath diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/pom.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/pom.xml new file mode 100644 index 0000000..4e54e1e --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + ${artifactId}-platform-A + jar + + + ${groupId} + ${artifactId}-parent + ${version} + .. + + + ${shortname} ACS Platform Module A + + + + + org.alfresco + acs-community-packaging + ${alfresco.platform.version} + pom + import + + + + + + + + + org.alfresco + alfresco-repository + provided + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + ${groupId}:${artifactId}-parent + + + com.inteligr8.ootbee:beedk-acs-platform-self-rad-tile:${beedkVersion} + + com.inteligr8.ootbee:beedk-acs-platform-module-tile:${beedkVersion} + + + + + + + \ No newline at end of file diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/rad.ps1 b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/rad.ps1 new file mode 100644 index 0000000..e4e3b6e --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/rad.ps1 @@ -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!" + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/rad.sh b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/rad.sh new file mode 100644 index 0000000..1b37cf5 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/rad.sh @@ -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!" + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleActionExecuter.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleActionExecuter.java new file mode 100644 index 0000000..c9f32d3 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleActionExecuter.java @@ -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 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 + } + +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleBootstrap.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleBootstrap.java new file mode 100644 index 0000000..61ebef5 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleBootstrap.java @@ -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() { + @Override + public Void doWork() throws Exception { + // provide expected hiccup/concurrency protection + return ExampleBootstrap.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback() { + @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() { + @Override + public Void doWork() throws Exception { + // provide expected hiccup/concurrency protection + return ExampleBootstrap.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback() { + @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 + } + +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleEventListener.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleEventListener.java new file mode 100644 index 0000000..fed0004 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleEventListener.java @@ -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 + } + +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleGetWebScript.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleGetWebScript.java new file mode 100644 index 0000000..cc8ca95 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleGetWebScript.java @@ -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 + } +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleJavaScriptRootObject.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleJavaScriptRootObject.java new file mode 100644 index 0000000..eccae08 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleJavaScriptRootObject.java @@ -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); + } + +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleJob.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleJob.java new file mode 100644 index 0000000..468d103 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/ExampleJob.java @@ -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() { + @Override + public Void doWork() throws Exception { + // provide expected hiccup/concurrency protection + return ExampleJob.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback() { + @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 + } + +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/annotation/ModuleEarlyComponent.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/annotation/ModuleEarlyComponent.java new file mode 100644 index 0000000..f51310b --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/annotation/ModuleEarlyComponent.java @@ -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 { + +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/annotation/ModuleLateComponent.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/annotation/ModuleLateComponent.java new file mode 100644 index 0000000..b343108 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/java/annotation/ModuleLateComponent.java @@ -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 { + +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJava.get.desc.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJava.get.desc.xml new file mode 100644 index 0000000..6875ab6 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJava.get.desc.xml @@ -0,0 +1,9 @@ + + + Example Webscript + Example Java-backed webscript description + /exampleJava?paramName={paramValue} + user + + ${shortname} + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.desc.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.desc.xml new file mode 100644 index 0000000..e2a99ba --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.desc.xml @@ -0,0 +1,9 @@ + + + Example Webscript + Example JS-backed webscript description + /exampleJs?paramName={paramValue} + guest + + ${shortname} + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.js b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.js new file mode 100644 index 0000000..4c6f720 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.js @@ -0,0 +1,4 @@ + +logger.log("exampleJavaScript('" + person.userName + "'):"); + +// TODO do your work diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.json.ftl b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.json.ftl new file mode 100644 index 0000000..e598f13 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.json.ftl @@ -0,0 +1,3 @@ +{ + "success": true +} \ No newline at end of file diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.properties b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.properties new file mode 100644 index 0000000..cd559b0 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.properties @@ -0,0 +1 @@ +example.webscript.property=default value diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/alfresco-global.properties b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/alfresco-global.properties new file mode 100644 index 0000000..7b102fe --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/alfresco-global.properties @@ -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 diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties new file mode 100644 index 0000000..71703c3 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties @@ -0,0 +1 @@ +log4j.logger.${package}=info diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/messages/example-model.properties b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/messages/example-model.properties new file mode 100644 index 0000000..8649d7b --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/messages/example-model.properties @@ -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 \ No newline at end of file diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/model/example-model.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/model/example-model.xml new file mode 100644 index 0000000..788cbc2 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/model/example-model.xml @@ -0,0 +1,24 @@ + + + + Example Data Model + Order of the Bee + 1.0 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-boostrap-context.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-boostrap-context.xml new file mode 100644 index 0000000..391039b --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-boostrap-context.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + alfresco/module/${project.groupId}.${project.artifactId}/model/example-model.xml + + + + + alfresco/module/${project.groupId}.${project.artifactId}/messages/example-model + + + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-context.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-context.xml new file mode 100644 index 0000000..bacb856 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-context.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-uninstall-context.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-uninstall-context.xml new file mode 100644 index 0000000..5f87726 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-uninstall-context.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties new file mode 100644 index 0000000..e64eae5 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties @@ -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} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/test/resources/alfresco/extension/debug-log4j.properties b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/test/resources/alfresco/extension/debug-log4j.properties new file mode 100644 index 0000000..3f2adeb --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/test/resources/alfresco/extension/debug-log4j.properties @@ -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 diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/test/resources/alfresco/extension/disable-webscript-caching-context.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/test/resources/alfresco/extension/disable-webscript-caching-context.xml new file mode 100644 index 0000000..07829ea --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-module-A/src/test/resources/alfresco/extension/disable-webscript-caching-context.xml @@ -0,0 +1,63 @@ + + + + + + + + javascript + + + js + + + + false + + + + + true + + + + + + + + + + ${spaces.store} + + + ${spaces.company_home.childname} + + + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-webapp/pom.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-webapp/pom.xml new file mode 100644 index 0000000..73477a8 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/platform-webapp/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + ${artifactId}-platform-webapp + war + + + ${groupId} + ${artifactId}-parent + ${version} + .. + + + ${shortname} ACS Platform Web Application + + + + ${groupId} + ${artifactId}-platform-A + ${version} + + + de.fmaul + javascript-console-repo + 0.6.0 + amp + test + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + ${groupId}:${artifactId}-parent + + + + com.inteligr8.ootbee:beedk-acs-platform-webapp-tile:${beedkVersion} + + + + + + + \ No newline at end of file diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/pom.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 0000000..ca3c4f3 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,52 @@ + + + + 4.0.0 + ${groupId} + ${artifactId}-parent + ${version} + pom + + ${shortname} ACS All-in-one Parent Project + + + 4.2.0 + community + 6.2.0-ga + 6.2.2.2 + + UTF-8 + 8 + 8 + + + + tengine-A + + platform-module-A + platform-webapp + + share-module-A + share-webapp + + + + + inteligr8-releases + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + alfresco-public + https://artifacts.alfresco.com/nexus/content/groups/public + + + + + + inteligr8-releases + http://repos.inteligr8.com/nexus/repository/inteligr8-private + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/pom.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/pom.xml new file mode 100644 index 0000000..3301b5b --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/pom.xml @@ -0,0 +1,66 @@ + + 4.0.0 + + ${artifactId}-share-A + jar + + + ${groupId} + ${artifactId}-parent + ${version} + .. + + + ${shortname} ACS Share Module A + + + + + org.alfresco + acs-community-packaging + ${alfresco.platform.version} + pom + import + + + + + + + + + org.alfresco + share + ${alfresco.share.version} + classes + provided + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + ${groupId}:${artifactId}-parent + + + com.inteligr8.ootbee:beedk-acs-share-self-rad-tile:${beedkVersion} + com.inteligr8.ootbee:beedk-acs-platform-artifact-rad-tile:${beedkVersion} + + com.inteligr8.ootbee:beedk-acs-share-module-tile:${beedkVersion} + + + + + + + \ No newline at end of file diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/rad.ps1 b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/rad.ps1 new file mode 100644 index 0000000..e4e3b6e --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/rad.ps1 @@ -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!" + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/rad.sh b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/rad.sh new file mode 100644 index 0000000..1b37cf5 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/rad.sh @@ -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!" + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/META-INF/share-config-custom.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/META-INF/share-config-custom.xml new file mode 100644 index 0000000..3bbc9ee --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/META-INF/share-config-custom.xml @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + +
cm:content
+
cm:folder
+ + +
example:document
+
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 255 + + + + + + + + true + + + + + + + + + + + + + + + + + + + + true + aspect=cm:taggable + /api/tag/workspace/SpacesStore + tag + + + + + true + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + 255 + + + + + + + + true + + + + + true + aspect=cm:taggable + /api/tag/workspace/SpacesStore + tag + + + + + true + + + + + + + + + +
+ + + + + + + + + + 255 + + + + + + + + explorer + true + + + + + + +
+
+
+ + + + +
+ + + + + + + + + + + + 255 + + + + + + + + explorer + + + + + mimeType + + + + + editInline + + + + + + +
+ + +
+
+ +
diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties new file mode 100644 index 0000000..71703c3 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties @@ -0,0 +1 @@ +log4j.logger.${package}=info diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties new file mode 100644 index 0000000..e64eae5 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties @@ -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} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/web-extension/__groupId__.__artifactId__-context.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/web-extension/__groupId__.__artifactId__-context.xml new file mode 100644 index 0000000..5bdc358 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/web-extension/__groupId__.__artifactId__-context.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + ${alfresco.ext.package}.messages.example + + + + + + + + + text/x-markdown + + + + + + + + + text/x-markdown + + + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/web-extension/messages/example.properties b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/web-extension/messages/example.properties new file mode 100644 index 0000000..e69de29 diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/web-extension/site-data/extensions/__groupId__.__artifactId__-extension.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/web-extension/site-data/extensions/__groupId__.__artifactId__-extension.xml new file mode 100644 index 0000000..af338a5 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/main/resources/alfresco/web-extension/site-data/extensions/__groupId__.__artifactId__-extension.xml @@ -0,0 +1,9 @@ + + + + ${project.artifactId} Example Extensibility Module + ${project.version} + true + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/test/resources/META-INF/share-config-custom.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/test/resources/META-INF/share-config-custom.xml new file mode 100644 index 0000000..a7b8f4f --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/test/resources/META-INF/share-config-custom.xml @@ -0,0 +1,95 @@ + + + + + + + production + + + + true + + + + + + + + + true + + false + + + + + + + + + + + + + + alfresco-noauth + Alfresco - unauthenticated access + Access to Alfresco Repository WebScripts that do not require authentication + alfresco + ${acs-platform.url}/alfresco/s + none + + + + alfresco + Alfresco - user access + Access to Alfresco Repository WebScripts that require user authentication + alfresco + ${acs-platform.url}/alfresco/s + user + + + + alfresco-feed + Alfresco Feed + Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet + http + ${acs-platform.url}/alfresco/s + true + user + + + + alfresco-api + alfresco + Alfresco Public API - user access + Access to Alfresco Repository Public API that require user authentication. + This makes use of the authentication that is provided by parent 'alfresco' endpoint. + alfresco + ${acs-platform.url}/alfresco/api + user + + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/test/resources/log4j.properties b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/test/resources/log4j.properties new file mode 100644 index 0000000..97ba7dd --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-module-A/src/test/resources/log4j.properties @@ -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 diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-webapp/pom.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-webapp/pom.xml new file mode 100644 index 0000000..13191f8 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/share-webapp/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + ${artifactId}-share-webapp + war + + + ${groupId} + ${artifactId}-parent + ${version} + .. + + + ${shortname} ACS Share Web Application + + + + ${groupId} + ${artifactId}-share-A + ${version} + + + de.fmaul + javascript-console-share + 0.6.0 + amp + test + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + ${groupId}:${artifactId}-parent + + + + com.inteligr8.ootbee:beedk-acs-share-webapp-tile:${beedkVersion} + + + + + + + \ No newline at end of file diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/pom.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/pom.xml new file mode 100644 index 0000000..b990e51 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/pom.xml @@ -0,0 +1,71 @@ + + 4.0.0 + + ${artifactId}-tengine-A + jar + + + ${groupId} + ${artifactId}-parent + ${version} + .. + + + ${shortname} Alfresco T-Engine A + + + 2.3.6 + 2.3.5.RELEASE + 5.15.8 + + ${dockerRegistryHost} + ${dockerImagePrefix}/${project.artifactId} + ${project.version} + + + + + com.inteligr8.ootbee + beedk-ate-springboot + ${beedkVersion} + pom + import + + + com.inteligr8.ootbee + beedk-ate-springboot-test + ${beedkVersion} + pom + test + + + org.jsoup + jsoup + 1.13.1 + test + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + ${groupId}:${artifactId}-parent + + + com.inteligr8.ootbee:beedk-ate-docker-tile:${beedkVersion} + + com.inteligr8.ootbee:beedk-ate-springboot-tile:${beedkVersion} + + + + + + \ No newline at end of file diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/rad.ps1 b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/rad.ps1 new file mode 100644 index 0000000..e4e3b6e --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/rad.ps1 @@ -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!" + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/rad.sh b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/rad.sh new file mode 100644 index 0000000..1b37cf5 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/rad.sh @@ -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!" + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/docker/Dockerfile b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/docker/Dockerfile new file mode 100644 index 0000000..09b9893 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/docker/Dockerfile @@ -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} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/java/Application.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/java/Application.java new file mode 100644 index 0000000..6f2f6d5 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/java/Application.java @@ -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 . + * #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 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"); + } +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/java/TransformerController.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/java/TransformerController.java new file mode 100644 index 0000000..e05d030 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/java/TransformerController.java @@ -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 . + * #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 is missing (missing mandatory parameter) + * 400 Bad Request: Request parameter 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 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 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; + } + } +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/java/TransformerImpl.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/java/TransformerImpl.java new file mode 100644 index 0000000..e79a332 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/java/TransformerImpl.java @@ -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 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 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 + } + +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/application-context.xml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/application-context.xml new file mode 100644 index 0000000..065e12d --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/application-context.xml @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/application-default.yaml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/application-default.yaml new file mode 100644 index 0000000..1b27361 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/application-default.yaml @@ -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} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/templates/transformForm.html b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/templates/transformForm.html new file mode 100644 index 0000000..02dbbe6 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/templates/transformForm.html @@ -0,0 +1,21 @@ + + + +
+

${shortname} Test Transformation

+
+ + + + + +
file *
targetExtension *
+
+
+ + + + + diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/this_engine_config.json b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/this_engine_config.json new file mode 100644 index 0000000..a4f1fad --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/main/resources/this_engine_config.json @@ -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" + ] + } + ] +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/test/java/HttpRequestIT.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/test/java/HttpRequestIT.java new file mode 100644 index 0000000..7bf7fc7 --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/test/java/HttpRequestIT.java @@ -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 . + * #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 inputs = new HashSet(); + 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 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 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 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 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 _testService(String filename, String targetExtension) { + LinkedMultiValueMap 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> entity = new HttpEntity<>(parameters, headers); + return this.restTemplate.postForEntity(this.baseUrl + "/transform", entity, String.class); + } + +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/test/java/TransformerControllerTest.java b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/test/java/TransformerControllerTest.java new file mode 100644 index 0000000..995c3cf --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/test/java/TransformerControllerTest.java @@ -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() { + + } +} diff --git a/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/test/resources/application-default.yaml b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/test/resources/application-default.yaml new file mode 100644 index 0000000..316190d --- /dev/null +++ b/beedk-acs-allinone-archetype/src/main/resources/archetype-resources/tengine-A/src/test/resources/application-default.yaml @@ -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} diff --git a/beedk-acs-lts-it-tile/.gitignore b/beedk-acs-lts-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-lts-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-lts-it-tile/README.md b/beedk-acs-lts-it-tile/README.md new file mode 100644 index 0000000..b7da42f --- /dev/null +++ b/beedk-acs-lts-it-tile/README.md @@ -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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + com.inteligr8.ootbee:beedk-acs--tile:[1.0.0,2.0.0) + + com.inteligr8.ootbee:beedk-acs-lts-it-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +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 | diff --git a/beedk-acs-lts-it-tile/pom.xml b/beedk-acs-lts-it-tile/pom.xml new file mode 100644 index 0000000..49ddede --- /dev/null +++ b/beedk-acs-lts-it-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-lts-it-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Integration Testing for ACS Local Transform Service + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-lts-it-tile/tile.xml b/beedk-acs-lts-it-tile/tile.xml new file mode 100644 index 0000000..08bd3b7 --- /dev/null +++ b/beedk-acs-lts-it-tile/tile.xml @@ -0,0 +1,75 @@ + + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + start-alts + pre-integration-test + start + + + + alfresco/alfresco-transform-core-aio:${alfresco.transform-aio.version} + ate-aio + + ${skipTests} + + custom + ${project.artifactId} + + + + + + + + stop-alts + post-integration-test + stop + + + + alfresco/alfresco-transform-core-aio:${alfresco.transform-aio.version} + ate-aio + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + 2.3.6 + + + true + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-lts-rad-tile/.gitignore b/beedk-acs-lts-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-lts-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-lts-rad-tile/README.md b/beedk-acs-lts-rad-tile/README.md new file mode 100644 index 0000000..f14ce84 --- /dev/null +++ b/beedk-acs-lts-rad-tile/README.md @@ -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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + com.inteligr8.ootbee:beedk-acs-platform--rad-tile:[1.0.0,2.0.0) + + com.inteligr8.ootbee:beedk-acs-lts-rad-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +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 | diff --git a/beedk-acs-lts-rad-tile/pom.xml b/beedk-acs-lts-rad-tile/pom.xml new file mode 100644 index 0000000..bfd7428 --- /dev/null +++ b/beedk-acs-lts-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-lts-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: RAD for ACS Local Transform Service + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-lts-rad-tile/tile.xml b/beedk-acs-lts-rad-tile/tile.xml new file mode 100644 index 0000000..705d205 --- /dev/null +++ b/beedk-acs-lts-rad-tile/tile.xml @@ -0,0 +1,74 @@ + + + + + + rad-acs-lts + + + rad + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + run-alts + process-classes + start + + + + alfresco/alfresco-transform-core-aio:${alfresco.transform-aio.version} + ate-aio + + + ${alfresco.transform-aio.port}:8090 + + + custom + ${project.artifactId} + + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + 8091 + + + 2.3.6 + + + true + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-module-tile/.gitignore b/beedk-acs-module-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-module-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-module-tile/README.md b/beedk-acs-module-tile/README.md new file mode 100644 index 0000000..cee994b --- /dev/null +++ b/beedk-acs-module-tile/README.md @@ -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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-module-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +## 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 +``` diff --git a/beedk-acs-module-tile/pom.xml b/beedk-acs-module-tile/pom.xml new file mode 100644 index 0000000..886fc54 --- /dev/null +++ b/beedk-acs-module-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-module-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: ACS Module Core + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-module-tile/tile.xml b/beedk-acs-module-tile/tile.xml new file mode 100644 index 0000000..84f786f --- /dev/null +++ b/beedk-acs-module-tile/tile.xml @@ -0,0 +1,257 @@ + + + + + + + + src/main/resources + true + + **/README* + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + add-acs-module-resources + generate-resources + add-resource + + + + + src/main/resources + true + + **/README* + + + + + src/main/module + true + + **/README* + + ${project.build.directory}/module-classes/${alfresco.module.path} + + + + src/main/web + true + + **/README* + + ${project.build.directory}/web-resources/META-INF + + + + src/main/webapp + true + + **/README* + + ${project.build.directory}/web-resources/META-INF + + + + src/main/assembly/web + true + + **/README* + + ${project.build.directory}/web-resources/META-INF + + + + + + + + + maven-resources-plugin + 3.2.0 + + UTF-8 + + + ftl + acp + svg + pdf + doc + docx + xls + xlsx + ppt + pptx + bin + lic + swf + zip + msg + jar + ttf + eot + woff + woff2 + css + ico + psd + js + + + + + + consolidate-resources + process-resources + copy-resources + + ${project.build.packageDirectory} + + + ${project.build.outputDirectory} + false + + + ${project.build.directory}/module-classes + false + + + ${project.build.directory}/web-resources + false + + + + + + + + + net.alchim31.maven + yuicompressor-maven-plugin + 1.5.1 + + + **/webscripts/** + **/site-webscripts/** + **/*.lib.js + **/*.css + **/*-min.js + **/*-min.css + **/*.min.js + **/*.pack.js + + true + true + false + + + + + compress-resources + compile + + compress + + + ${project.build.packageDirectory} + ${project.build.packageDirectory} + + + + + + + maven-jar-plugin + 3.2.0 + + ${project.build.packageDirectory} + + + + + com.inteligr8.alfresco + amp-plugin + 1.0.1 + + + build-amp-file + package + + amp + + + ${beedk.jar.notest.empty} + + + + + + + + + + scaffold-acs-module + + + scaffold + + + + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.1 + + + download-module-props + generate-sources + + wget + + + 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 + ${basedir}/src/main/module + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + ${project.build.directory}/package + ${project.groupId}.${project.artifactId} + + + alfresco/module/${alfresco.module.pathname} + + + + + + + com.inteligr8.ootbee:beedk-amp-check-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-platform-artifact-it-tile/.gitignore b/beedk-acs-platform-artifact-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-platform-artifact-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-platform-artifact-it-tile/README.md b/beedk-acs-platform-artifact-it-tile/README.md new file mode 100644 index 0000000..6b56bfa --- /dev/null +++ b/beedk-acs-platform-artifact-it-tile/README.md @@ -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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-platform-artifact-it-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +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.
*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.
*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.
*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.
*May be overridden by any POM parent or Maven Tile.*
*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. diff --git a/beedk-acs-platform-artifact-it-tile/pom.xml b/beedk-acs-platform-artifact-it-tile/pom.xml new file mode 100644 index 0000000..b8e6159 --- /dev/null +++ b/beedk-acs-platform-artifact-it-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-artifact-it-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Integration Testing for ACS Platform by Maven Artifact + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-platform-artifact-it-tile/tile.xml b/beedk-acs-platform-artifact-it-tile/tile.xml new file mode 100644 index 0000000..3982c0c --- /dev/null +++ b/beedk-acs-platform-artifact-it-tile/tile.xml @@ -0,0 +1,109 @@ + + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-platform-webapp + pre-integration-test + copy + + + + ${alfresco.platform.war.groupId} + ${alfresco.platform.war.artifactId} + ${alfresco.platform.war.version} + war + + + ${project.build.warDirectory} + + + + + download-platform-jdbc + pre-integration-test + copy + + + + org.postgresql + postgresql + ${postgres.jdbc.version} + + + ${beedk.deploy.platform.extDirectory} + + + + + + + + + + + acs-community + + + edition + !enterprise + + + + + content-services-community + + + + + acs-enterprise + + + edition + enterprise + + + + + content-services + + + + default-props + + + !some-prop-that-never-exists + + + + + ${project.build.directory}/war + ${project.build.directory}/ext/platform + org.alfresco + ${alfresco.platform.version} + + + 42.2.18 + + + ${project.build.warDirectory}/${alfresco.platform.war.artifactId}-${alfresco.platform.war.version}.war + ${project.build.extDirectory} + + + + + + + com.inteligr8.ootbee:beedk-acs-platform-it-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-platform-artifact-rad-tile/.gitignore b/beedk-acs-platform-artifact-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-platform-artifact-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-platform-artifact-rad-tile/README.md b/beedk-acs-platform-artifact-rad-tile/README.md new file mode 100644 index 0000000..051ee90 --- /dev/null +++ b/beedk-acs-platform-artifact-rad-tile/README.md @@ -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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-platform-artifact-rad-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +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.
*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.
*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.
*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.
*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.
*May be overridden by any POM parent or Maven Tile.*
*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. diff --git a/beedk-acs-platform-artifact-rad-tile/pom.xml b/beedk-acs-platform-artifact-rad-tile/pom.xml new file mode 100644 index 0000000..1d16859 --- /dev/null +++ b/beedk-acs-platform-artifact-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-artifact-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: RAD for ACS Platform by Maven Artifact + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-platform-artifact-rad-tile/tile.xml b/beedk-acs-platform-artifact-rad-tile/tile.xml new file mode 100644 index 0000000..bfcadd9 --- /dev/null +++ b/beedk-acs-platform-artifact-rad-tile/tile.xml @@ -0,0 +1,116 @@ + + + + + + rad-acs-platform-artifact + + + rad + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-platform-webapp + generate-resources + copy + + + + ${alfresco.platform.war.groupId} + ${alfresco.platform.war.artifactId} + ${alfresco.platform.war.version} + war + + + ${beedk.deploy.platform.warDirectory} + + + + + download-platform-jdbc + generate-resources + copy + + + + org.postgresql + postgresql + ${postgres.jdbc.version} + + + ${beedk.deploy.platform.extDirectory} + + + + + + + + + + acs-community + + + edition + !enterprise + + + + + content-services-community + + + + + acs-enterprise + + + edition + enterprise + + + + + content-services + + + + default-props + + + !some-prop-that-never-exists + + + + + ${project.build.directory}/war + ${project.build.directory}/ext/platform + org.alfresco + ${alfresco.platform.version} + + + 42.2.18 + + + ${project.build.warDirectory}/${alfresco.platform.war.artifactId}-${alfresco.platform.war.version}.war + ${project.build.extDirectory} + + + + + + + com.inteligr8.ootbee:beedk-acs-platform-rad-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-platform-it-tile/.gitignore b/beedk-acs-platform-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-platform-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-platform-it-tile/README.md b/beedk-acs-platform-it-tile/README.md new file mode 100644 index 0000000..bdce7b1 --- /dev/null +++ b/beedk-acs-platform-it-tile/README.md @@ -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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-platform-it-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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.
*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. diff --git a/beedk-acs-platform-it-tile/pom.xml b/beedk-acs-platform-it-tile/pom.xml new file mode 100644 index 0000000..bda4edc --- /dev/null +++ b/beedk-acs-platform-it-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-it-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Integration Testing for ACS Platform Core + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-platform-it-tile/tile.xml b/beedk-acs-platform-it-tile/tile.xml new file mode 100644 index 0000000..f63851a --- /dev/null +++ b/beedk-acs-platform-it-tile/tile.xml @@ -0,0 +1,216 @@ + + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + start-acs-platform + pre-integration-test + start + + + + postgres:${acs-postgres.version} + acs-db + + ${skipTests} + + alfresco + alfresco + alfresco + + + ${acs-postgres.port}:5432 + + + custom + ${project.artifactId} + + + + + alfresco/alfresco-activemq:${acs-activemq.version} + acs-mq + + ${skipTests} + + ${acs-activemq.port}:8161 + + + custom + ${project.artifactId} + + + + + docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version} + acs-platform + + ${skipTests} + + ${acs-platform.memory} + -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\&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} + + + ${acs-platform.port}:8080 + + + custom + ${project.artifactId} + + + + ${beedk.deploy.platform.warFile}:/var/lib/tomcat/webapps/alfresco.war:ro + ${beedk.deploy.platform.testClassesDirectory}:/var/lib/tomcat/dev/classes:ro + ${beedk.deploy.platform.extDirectory}:/var/lib/tomcat/dev/lib:ro + ${beedk.deploy.platform.dataDirectory}:/tmp/alf_data:rw + + + + + http://localhost:${acs-platform.port}/alfresco/service/api/server + GET + 200..399 + + + + + + + + + + stop-acs-platform + post-integration-test + stop + + + + postgres:${acs-postgres.version} + acs-db + + + alfresco/alfresco-activemq:${acs-activemq.version} + acs-mq + + + docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version} + acs-platform + + + + + + + + + + + + acs-search-disabled + + + !beedk.deploy.acs-search.enabled + + + + noindex + + + + acs-search-enabled + + + beedk.deploy.acs-search.enabled + + + + solr6 + + + + + ats-unspecified + + + !beedk.deploy.ats.enabled + + + + false + + + + + alts-unspecified + + + !beedk.deploy.alts.enabled + + + + false + + + + + tomcat-opts-unspecified + + + !acs-platform.tomcat.opts + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + ${project.build.directory}/doesnotexist + ${project.build.directory}/doesnotexist + ${project.build.directory}/alf_data + 120000 + 1g + + + 5432 + 8161 + 8080 + + + 9.6 + 5.15.8 + 9-1.3 + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-platform-module-archetype/.gitignore b/beedk-acs-platform-module-archetype/.gitignore new file mode 100644 index 0000000..5de9fc3 --- /dev/null +++ b/beedk-acs-platform-module-archetype/.gitignore @@ -0,0 +1,9 @@ +# Maven +/target +pom.xml.versionsBackup + +# Eclipse +.settings +.project +.classpath + diff --git a/beedk-acs-platform-module-archetype/pom.xml b/beedk-acs-platform-module-archetype/pom.xml new file mode 100644 index 0000000..5b3fe37 --- /dev/null +++ b/beedk-acs-platform-module-archetype/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-module-archetype + 1.0-SNAPSHOT + maven-archetype + + Order of the Bee Development Kit: Project Scaffolding for an ACS Platform Module + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + org.apache.maven.archetype + archetype-packaging + 3.1.1 + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + diff --git a/beedk-acs-platform-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/beedk-acs-platform-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 0000000..df00561 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,59 @@ + + + + [A-Za-z0-9]+ + + + quay.io + + + local + + + + + src/main/java + + **/*.java + + + + src/test/java + + **/*.java + + + + src/main/extension/templates/webscripts + + **/* + + + + src/main/resources/alfresco/extension/templates/webscripts + + **/* + + + + src + + main/extension/templates/webscripts/**/* + main/resources/alfresco/extension/templates/webscripts/**/* + main/java/**/* + test/java/**/* + + + + + + .gitignore + rad.* + *.md + + + + \ No newline at end of file diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/.gitignore b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/.gitignore new file mode 100644 index 0000000..0a33814 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/.gitignore @@ -0,0 +1,8 @@ +# Maven +/target +pom.xml.versionsBackup + +# Eclipse +.settings +.project +.classpath diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/pom.xml b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 0000000..6a30f45 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,82 @@ + + 4.0.0 + + ${groupId} + ${artifactId} + ${version} + jar + + ${shortname} ACS Platform Module + + + UTF-8 + 8 + 8 + + 4.2.0 + 6.2.0-ga + + + + + + org.alfresco + acs-community-packaging + ${alfresco.platform.version} + pom + import + + + + + + + + + org.alfresco + alfresco-repository + provided + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + + com.inteligr8.ootbee:beedk-acs-platform-self-rad-tile:1.0-SNAPSHOT + + com.inteligr8.ootbee:beedk-acs-platform-module-tile:1.0-SNAPSHOT + + + + + + + + + + inteligr8-releases + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + alfresco-public + https://artifacts.alfresco.com/nexus/content/groups/public + + + + + + inteligr8-releases + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + \ No newline at end of file diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/rad.ps1 b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/rad.ps1 new file mode 100644 index 0000000..e4e3b6e --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/rad.ps1 @@ -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!" + diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/rad.sh b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/rad.sh new file mode 100644 index 0000000..1b37cf5 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/rad.sh @@ -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!" + diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleActionExecuter.java b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleActionExecuter.java new file mode 100644 index 0000000..c9f32d3 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleActionExecuter.java @@ -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 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 + } + +} diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleBootstrap.java b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleBootstrap.java new file mode 100644 index 0000000..61ebef5 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleBootstrap.java @@ -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() { + @Override + public Void doWork() throws Exception { + // provide expected hiccup/concurrency protection + return ExampleBootstrap.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback() { + @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() { + @Override + public Void doWork() throws Exception { + // provide expected hiccup/concurrency protection + return ExampleBootstrap.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback() { + @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 + } + +} diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleEventListener.java b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleEventListener.java new file mode 100644 index 0000000..fed0004 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleEventListener.java @@ -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 + } + +} diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleGetWebScript.java b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleGetWebScript.java new file mode 100644 index 0000000..cc8ca95 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleGetWebScript.java @@ -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 + } +} diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleJavaScriptRootObject.java b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleJavaScriptRootObject.java new file mode 100644 index 0000000..eccae08 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleJavaScriptRootObject.java @@ -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); + } + +} diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleJob.java b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleJob.java new file mode 100644 index 0000000..468d103 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/ExampleJob.java @@ -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() { + @Override + public Void doWork() throws Exception { + // provide expected hiccup/concurrency protection + return ExampleJob.this.serviceRegistry.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback() { + @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 + } + +} diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/annotation/ModuleEarlyComponent.java b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/annotation/ModuleEarlyComponent.java new file mode 100644 index 0000000..f51310b --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/annotation/ModuleEarlyComponent.java @@ -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 { + +} diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/annotation/ModuleLateComponent.java b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/annotation/ModuleLateComponent.java new file mode 100644 index 0000000..b343108 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/java/annotation/ModuleLateComponent.java @@ -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 { + +} diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJava.get.desc.xml b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJava.get.desc.xml new file mode 100644 index 0000000..6875ab6 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJava.get.desc.xml @@ -0,0 +1,9 @@ + + + Example Webscript + Example Java-backed webscript description + /exampleJava?paramName={paramValue} + user + + ${shortname} + diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.desc.xml b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.desc.xml new file mode 100644 index 0000000..e2a99ba --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.desc.xml @@ -0,0 +1,9 @@ + + + Example Webscript + Example JS-backed webscript description + /exampleJs?paramName={paramValue} + guest + + ${shortname} + diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.js b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.js new file mode 100644 index 0000000..4c6f720 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.js @@ -0,0 +1,4 @@ + +logger.log("exampleJavaScript('" + person.userName + "'):"); + +// TODO do your work diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.json.ftl b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.json.ftl new file mode 100644 index 0000000..e598f13 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.json.ftl @@ -0,0 +1,3 @@ +{ + "success": true +} \ No newline at end of file diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.properties b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.properties new file mode 100644 index 0000000..cd559b0 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/extension/templates/webscripts/exampleJavaScript.get.properties @@ -0,0 +1 @@ +example.webscript.property=default value diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/alfresco-global.properties b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/alfresco-global.properties new file mode 100644 index 0000000..7b102fe --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/alfresco-global.properties @@ -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 diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties new file mode 100644 index 0000000..71703c3 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties @@ -0,0 +1 @@ +log4j.logger.${package}=info diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/messages/example-model.properties b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/messages/example-model.properties new file mode 100644 index 0000000..8649d7b --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/messages/example-model.properties @@ -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 \ No newline at end of file diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/model/example-model.xml b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/model/example-model.xml new file mode 100644 index 0000000..788cbc2 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/model/example-model.xml @@ -0,0 +1,24 @@ + + + + Example Data Model + Order of the Bee + 1.0 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-boostrap-context.xml b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-boostrap-context.xml new file mode 100644 index 0000000..391039b --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-boostrap-context.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + alfresco/module/${project.groupId}.${project.artifactId}/model/example-model.xml + + + + + alfresco/module/${project.groupId}.${project.artifactId}/messages/example-model + + + + + diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-context.xml b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-context.xml new file mode 100644 index 0000000..bacb856 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-context.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-uninstall-context.xml b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-uninstall-context.xml new file mode 100644 index 0000000..5f87726 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module-uninstall-context.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties new file mode 100644 index 0000000..e64eae5 --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties @@ -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} diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/test/resources/alfresco/extension/debug-log4j.properties b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/test/resources/alfresco/extension/debug-log4j.properties new file mode 100644 index 0000000..3f2adeb --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/test/resources/alfresco/extension/debug-log4j.properties @@ -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 diff --git a/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/test/resources/alfresco/extension/disable-webscript-caching-context.xml b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/test/resources/alfresco/extension/disable-webscript-caching-context.xml new file mode 100644 index 0000000..07829ea --- /dev/null +++ b/beedk-acs-platform-module-archetype/src/main/resources/archetype-resources/src/test/resources/alfresco/extension/disable-webscript-caching-context.xml @@ -0,0 +1,63 @@ + + + + + + + + javascript + + + js + + + + false + + + + + true + + + + + + + + + + ${spaces.store} + + + ${spaces.company_home.childname} + + + + + diff --git a/beedk-acs-platform-module-tile/.gitignore b/beedk-acs-platform-module-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-platform-module-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-platform-module-tile/README.md b/beedk-acs-platform-module-tile/README.md new file mode 100644 index 0000000..d5d7f9b --- /dev/null +++ b/beedk-acs-platform-module-tile/README.md @@ -0,0 +1,78 @@ +# BeeDK ACS Platform Module Maven Tile + +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 any ACS Platform 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-platform-module-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +## 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. | + +### Other APIs + +Additional less important configurations are inherited from the following Maven Tile. + +* [`beedk-acs-module-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-module-tile) + +## Results + +The project will build as a deployable ACS Platform module. + +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}` | +| `alfresco.ext.path` | Text | *At startup* | The classpath to the extension resources: `alfresco/extension` | +| `alfresco.ext.package` | Text | *At startup* | The package reference to the extension resources: `alfresco.extension` | + +## Initialization + +This tile comes with the ability to initialize your project with the required file(s) of an ACS Platform module. You can do this by executing any Maven build with the `scaffold` property. + +```sh +mvn -Dscaffold generate-sources +``` diff --git a/beedk-acs-platform-module-tile/pom.xml b/beedk-acs-platform-module-tile/pom.xml new file mode 100644 index 0000000..5e243d7 --- /dev/null +++ b/beedk-acs-platform-module-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-module-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: ACS Platform Module + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-platform-module-tile/tile.xml b/beedk-acs-platform-module-tile/tile.xml new file mode 100644 index 0000000..edd0fa7 --- /dev/null +++ b/beedk-acs-platform-module-tile/tile.xml @@ -0,0 +1,77 @@ + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + add-acs-platform-module-resources + add-resource + + + + + src/main/extension + true + + **/README* + + ${project.build.directory}/extension-classes/${alfresco.ext.path} + + + + + + + + maven-resources-plugin + 3.2.0 + + + + consolidate-extension + process-resources + copy-resources + + ${project.build.packageDirectory} + + + ${project.build.directory}/extension-classes + false + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + alfresco/extension + alfresco.extension + + + + + + + com.inteligr8.ootbee:beedk-acs-module-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-platform-rad-tile/.gitignore b/beedk-acs-platform-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-platform-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-platform-rad-tile/README.md b/beedk-acs-platform-rad-tile/README.md new file mode 100644 index 0000000..67682de --- /dev/null +++ b/beedk-acs-platform-rad-tile/README.md @@ -0,0 +1,93 @@ +# BeeDK Abstract ACS Platform Maven Tile for RAD + +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 rapid application development of 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-platform-rad-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +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 | +| -------------------------- |:--------:| --------------- | ----------- | +| `acs-platform.port` | | 8080 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `acs-postgres.port` | | 5432 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `acs-activemq.port` | | 8161 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `acs-platform.debugger.port` | | 8000 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `acs-platform.tomcat.opts` | | | Additional `CATALINA_OPTS` to add to the Apache Tomcat startup.
*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. | +| `tomcat-rad.version` | | *not important* | The version of the [Apache Tomcat Rapid Application Development Docker container](/inteligr8/tomcat-rad-docker). | +| `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. | +| `acs-api-explorer.war.groupId` | | `org.alfresco` | The API Explorer WAR Maven Group ID. | +| `acs-api-explorer.war.artifactId` | | `api-explorer` | The API Explorer WAR Maven Artifact ID. | +| `acs-api-explorer.war.version` | | `${acs-api-explorer.version}` | The API Explorer WAR Maven version. See the [Alfresco Maven Repository](https://artifacts.alfresco.com/nexus/content/groups/public/org/alfresco/api-explorer/) for details on available versions. | +| `acs-aos.war.version` | | `1.3.2.1` | The Alfresco Office Services WAR Maven version. See the [Alfresco Maven Repository](https://artifacts.alfresco.com/nexus/content/groups/public/org/alfresco/aos-module/alfresco-vti-bin/) for details on available versions. | + +### 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.classesDirectory` | | | An additional classpath directory to sideload into the web application. | +| `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.webDirectory` | | | An additional directory of web resources to sideload in the web application. | +| `beedk.deploy.platform.warDirectory` | | `${project.build.warDirectory}` | A build directory for WAR files. | +| `beedk.deploy.platform.dataDirectory` | | `${project.build.directory}/alf_data` | The temporary binary storage location for ACS. | +| `beedk.deploy.api-explorer.warFile` | | *Not important* | The API Explorer WAR file to deploy in the Apache Tomcat instance. | +| `beedk.rad.acs-search.enabled` | | false | **Do not** set explicitly; just include the [`beedk-acs-search-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-search-rad-tile) tile **AFTER** this tile. | +| `beedk.rad.alts.enabled` | | false | **Do not** set explicitly; just include the [`beedk-acs-lts-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-lts-rad-tile) tile **AFTER** this tile. | +| `beedk.rad.ats.enabled` | | false | **Do not** set explicitly; just include the [`beedk-ats-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-ats-rad-tile) tile **AFTER** this tile. | +| `acs-api-explorer.version` | | `6.2.0` | The API Explorer version. You could use `${alfresco.platform.version}` in ACS Enterprise. This will eventually parse the ACS Platform version for the right value. | + +### 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 during the `process-classes` Maven phase. diff --git a/beedk-acs-platform-rad-tile/pom.xml b/beedk-acs-platform-rad-tile/pom.xml new file mode 100644 index 0000000..e488c75 --- /dev/null +++ b/beedk-acs-platform-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: RAD for ACS Platform Core + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-platform-rad-tile/tile.xml b/beedk-acs-platform-rad-tile/tile.xml new file mode 100644 index 0000000..0d59402 --- /dev/null +++ b/beedk-acs-platform-rad-tile/tile.xml @@ -0,0 +1,260 @@ + + + + + + rad-acs-platform + + + rad + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-api-explorer-webapp + generate-resources + copy + + + + ${acs-api-explorer.war.groupId} + ${acs-api-explorer.war.artifactId} + ${acs-api-explorer.war.version} + war + + + ${beedk.deploy.platform.warDirectory} + + + + + download-aos-webapp + generate-resources + copy + + + + org.alfresco.aos-module + alfresco-vti-bin + ${acs-aos.war.version} + war + + + ${beedk.deploy.platform.warDirectory} + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + run-acs-platform + process-classes + start + + + + postgres:${acs-postgres.version} + acs-db + + + alfresco + alfresco + alfresco + + + ${acs-postgres.port}:5432 + + + custom + ${project.artifactId} + + + + + alfresco/alfresco-activemq:${acs-activemq.version} + acs-mq + + + ${acs-activemq.port}:8161 + + + custom + ${project.artifactId} + + + + + docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version} + acs-platform + + + ${acs-platform.memory} + -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\&jms.useCompression\=true \ + -Dtransform.service.enabled=${beedk.rad.ats.enabled} -Dtransform.service.url=http://${project.artifactId}-ats-atr:8095 -Dsfs.url=http://${project.artifactId}-ats-sfs:8099 \ + -Dlocal.transform.service.enabled=${beedk.rad.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.rad.platform.index} -Dsolr.host=${project.artifactId}-acs-search -Dsolr.secureComms=none \ + ${acs-platform.tomcat.opts} + + + ${acs-platform.port}:8080 + ${acs-platform.debugger.port}:8000 + + + custom + ${project.artifactId} + + + + ${beedk.deploy.platform.warFile}:/var/lib/tomcat/webapps/alfresco.war:ro + ${beedk.deploy.api-explorer.warFile}:/var/lib/tomcat/webapps/api-explorer.war:ro + ${beedk.deploy.aos.warFile}:/var/lib/tomcat/webapps/_vti_bin.war:ro + ${beedk.deploy.platform.classesDirectory}:/var/lib/tomcat/dev/classes:ro + ${beedk.deploy.platform.modClassesDirectory}:/var/lib/tomcat/dev/classes-extra1:ro + ${beedk.deploy.platform.extClassesDirectory}:/var/lib/tomcat/dev/classes-extra2:ro + ${beedk.deploy.platform.testClassesDirectory}:/var/lib/tomcat/dev/classes-extra3:ro + ${beedk.deploy.platform.extDirectory}:/var/lib/tomcat/dev/lib:ro + ${beedk.deploy.platform.webDirectory}:/var/lib/tomcat/dev/web:ro + ${beedk.deploy.platform.dataDirectory}:/tmp/alf_data:rw + + + + + http://localhost:${acs-platform.port}/alfresco/service/api/server + GET + 200..399 + + + + + + + + + + + + + + + acs-search-disabled + + + !beedk.rad.acs-search.enabled + + + + noindex + + + + acs-search-enabled + + + beedk.rad.acs-search.enabled + + + + solr6 + + + + + ats-unspecified + + + !beedk.rad.ats.enabled + + + + false + + + + + alts-unspecified + + + !beedk.rad.alts.enabled + + + + false + + + + + tomcat-opts-unspecified + + + !acs-platform.tomcat.opts + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + ${project.build.directory}/doesnotexist + ${project.build.directory}/doesnotexist + ${project.build.directory}/doesnotexist + ${project.build.directory}/doesnotexist + ${project.build.directory}/doesnotexist + ${project.build.directory}/doesnotexist + ${project.build.directory}/alf_data + ${project.build.warDirectory} + 150000 + 1g + org.alfresco + api-explorer + ${acs-api-explorer.version} + ${beedk.deploy.platform.warDirectory}/${acs-api-explorer.war.artifactId}-${acs-api-explorer.war.version}.war + ${beedk.deploy.platform.warDirectory}/alfresco-vti-bin-${acs-aos.war.version}.war + + + 5432 + 8161 + 8080 + 8000 + + + 6.2.0 + 1.3.2.1 + 9.6 + 5.15.8 + 9-1.3 + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-platform-self-it-tile/.gitignore b/beedk-acs-platform-self-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-platform-self-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-platform-self-it-tile/README.md b/beedk-acs-platform-self-it-tile/README.md new file mode 100644 index 0000000..e18cdf0 --- /dev/null +++ b/beedk-acs-platform-self-it-tile/README.md @@ -0,0 +1,83 @@ +# BeeDK ACS Platform Integration Test Maven Tile for Platform Projects + +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 Platform 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-platform-self-it-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +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 this `beedk-acs-platform-self-it-tile` Maven 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 the [`beedk-acs-platform-artifact-it-tile` Maven Tile](../beedk-acs-platform-artifact-it-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.sdk.version` | **YES** | | For a list of versions and more details, see the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk).
*Inherited from [`beedk-acs-webapp-artifact-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-it-tile)* | +| `alfresco.platform.version` | *Maybe* | | The Alfresco Platform version to use for integration testing. See below for more details. | +| `edition` | | `community` | The Alfresco Platform edition to use for integration testing. `community` or `enterprise`. See below for more details. | +| `alfresco.war.version` | *Maybe* | *See Below* | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `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.
*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.
*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.
*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.
*May be overridden by any POM parent or Maven Tile.*
*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.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) +* [`beedk-acs-webapp-artifact-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-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. diff --git a/beedk-acs-platform-self-it-tile/pom.xml b/beedk-acs-platform-self-it-tile/pom.xml new file mode 100644 index 0000000..0d5ab8c --- /dev/null +++ b/beedk-acs-platform-self-it-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-self-it-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Integration Testing for ACS Platform + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-platform-self-it-tile/tile.xml b/beedk-acs-platform-self-it-tile/tile.xml new file mode 100644 index 0000000..0bacf02 --- /dev/null +++ b/beedk-acs-platform-self-it-tile/tile.xml @@ -0,0 +1,106 @@ + + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-platform-jars + pre-integration-test + copy-dependencies + + provided + jar + ${beedk.deploy.platform.extDirectory} + + + + + download-platform-jdbc + pre-integration-test + copy + + + + org.postgresql + postgresql + ${postgres.jdbc.version} + + + ${beedk.deploy.platform.extDirectory} + + + + + + + + + + + acs-community + + + edition + !enterprise + + + + + content-services-community + + + + + acs-enterprise + + + edition + enterprise + + + + + content-services + + + + default-props + + + !some-prop-that-never-exists + + + + + ${project.build.directory}/ext/platform + + + 42.2.18 + + + ${project.build.warFile} + ${project.build.testOutputDirectory} + ${project.build.extDirectory} + + + ${alfresco.platform.version} + + + + + + + com.inteligr8.ootbee:beedk-acs-platform-it-tile:1.0-SNAPSHOT + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-it-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-platform-self-rad-tile/.gitignore b/beedk-acs-platform-self-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-platform-self-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-platform-self-rad-tile/README.md b/beedk-acs-platform-self-rad-tile/README.md new file mode 100644 index 0000000..ed04654 --- /dev/null +++ b/beedk-acs-platform-self-rad-tile/README.md @@ -0,0 +1,86 @@ +# BeeDK ACS Platform RAD Maven Tile for Platform 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 of any ACS Platform 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-platform-self-rad-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +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. + +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](../beedk-acs-platform-artifact-rad-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.sdk.version` | **YES** | | For a list of versions and more details, see the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk).
*Inherited from [`beedk-acs-webapp-artifact-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-aritfact-rad-tile)* | +| `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.war.version` | *Maybe* | *See Below* | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `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.
*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.
*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.
*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.
*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.
*May be overridden by any POM parent or Maven Tile.*
*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.war.artifactId` to `content-services-community` or `content-services`. +* The `alfresco.platform.version` is used to default the `alfresco.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) +* [`beedk-acs-webapp-artifact-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-rad-tile) + +## Results + +The ACS Platform, database, and MQ components will be started during the `process-classes` Maven phase. diff --git a/beedk-acs-platform-self-rad-tile/pom.xml b/beedk-acs-platform-self-rad-tile/pom.xml new file mode 100644 index 0000000..16571f9 --- /dev/null +++ b/beedk-acs-platform-self-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-self-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: RAD for ACS Platform + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-platform-self-rad-tile/tile.xml b/beedk-acs-platform-self-rad-tile/tile.xml new file mode 100644 index 0000000..91bc6d0 --- /dev/null +++ b/beedk-acs-platform-self-rad-tile/tile.xml @@ -0,0 +1,115 @@ + + + + + + rad-acs-platform-self + + + rad + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-platform-jars + generate-resources + copy-dependencies + + provided + jar + ${beedk.deploy.platform.extDirectory} + + + + + download-platform-jdbc + generate-resources + copy + + + + org.postgresql + postgresql + ${postgres.jdbc.version} + + + ${beedk.deploy.platform.extDirectory} + + + + + + + + + + acs-community + + + edition + !enterprise + + + + + content-services-community + + + + + acs-enterprise + + + edition + enterprise + + + + + content-services + + + + default-props + + + !some-prop-that-never-exists + + + + + 42.2.18 + + + ${project.build.warFile} + ${project.build.outputDirectory} + ${project.build.directory}/module-classes + ${project.build.directory}/extension-classes + ${project.build.testOutputDirectory} + ${project.build.directory}/ext/platform + ${project.build.directory}/war + ${project.build.directory}/web-resources + + + ${alfresco.platform.version} + + + + + + + com.inteligr8.ootbee:beedk-acs-platform-rad-tile:1.0-SNAPSHOT + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-rad-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-platform-sibling-it-tile/.gitignore b/beedk-acs-platform-sibling-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-platform-sibling-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-platform-sibling-it-tile/README.md b/beedk-acs-platform-sibling-it-tile/README.md new file mode 100644 index 0000000..85c27f6 --- /dev/null +++ b/beedk-acs-platform-sibling-it-tile/README.md @@ -0,0 +1,80 @@ +# BeeDK ACS Platform Integration Test Maven Tile for non-Platform 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-platform-sibling-it-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +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 this `beedk-acs-platform-sibling-it-tile` Maven Tile. + +Otherwise +: You will need to explicitly declare and configure the [`beedk-acs-platform-artifact-it-tile` Maven Tile](../beedk-acs-platform-artifact-it-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 | +| ---------------------------------- |:--------:| ------------------ | ----------- | +| `project.sibling.name` | **Yes** | | The name of a sibling Platform module or web application project. | +| `project.sibling.build.directory` | | `../${project.sibling.name}/target` | The traditional `project.build.directory` of the sibling Platform module or web appliation project. | +| `project.sibling.build.extDirectory` | | `{project.sibling.build.directory}/ext/platform` | An additional directory of JARs to sideload into the web application. | +| `project.sibling.warFileName` | **Yes** | | The filename of the sibling Platform module or web appliation WAR. | +| `project.sibling.build.warDirectory` | | `${project.sibling.build.directory}/war` | The path of the sibling Platform module or web appliation WAR. | +| `project.sibling.build.warFile` | | `${project.sibling.build.warDirectory}/${project.sibling.warFileName}` | The path and filename of the sibling Platform module or web appliation WAR. | +| `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.
*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.
*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.
*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.
*May be overridden by any POM parent or Maven Tile.*
*Inherited from [`beedk-acs-platform-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-it-tile)* | + +### 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. diff --git a/beedk-acs-platform-sibling-it-tile/pom.xml b/beedk-acs-platform-sibling-it-tile/pom.xml new file mode 100644 index 0000000..d9e064c --- /dev/null +++ b/beedk-acs-platform-sibling-it-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-sibling-it-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Integration Testing for ACS Platform by Maven Sibling Project + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-platform-sibling-it-tile/tile.xml b/beedk-acs-platform-sibling-it-tile/tile.xml new file mode 100644 index 0000000..374432e --- /dev/null +++ b/beedk-acs-platform-sibling-it-tile/tile.xml @@ -0,0 +1,33 @@ + + + + + + default-props + + + !some-prop-that-never-exists + + + + + ${basedir}/../${project.sibling.name}/target + ${project.sibling.build.directory}/ext/platform + ${project.sibling.build.directory}/war + ${project.sibling.build.warDirectory}/${project.sibling.warFileName} + + + ${project.sibling.build.warFile} + ${project.sibling.build.extDirectory} + + + + + + + com.inteligr8.ootbee:beedk-acs-platform-it-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-platform-sibling-rad-tile/.gitignore b/beedk-acs-platform-sibling-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-platform-sibling-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-platform-sibling-rad-tile/README.md b/beedk-acs-platform-sibling-rad-tile/README.md new file mode 100644 index 0000000..4186b26 --- /dev/null +++ b/beedk-acs-platform-sibling-rad-tile/README.md @@ -0,0 +1,83 @@ +# BeeDK ACS Platform RAD Maven Tile for non-Platform 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 the rapid application development of 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-platform-sibling-rad-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +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. + +Otherwise +: You will need to explicitly declare and configure the [`beedk-acs-platform-artifact-rad-tile` Maven Tile](../beedk-acs-platform-artifact-rad-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 | +| ---------------------------------- |:--------:| ------------------ | ----------- | +| `project.sibling.name` | **Yes** | | The name of a sibling Platform module or web application project. | +| `project.sibling.build.directory` | | `../${project.sibling.name}/target` | The traditional `project.build.directory` of the sibling Platform module or web appliation project. | +| `project.sibling.build.extDirectory` | | `${project.sibling.build.directory}/ext/platform` | An additional directory of JARs to sideload into the web application. | +| `project.sibling.warFileName` | **Yes** | | The filename of the sibling Platform module or web appliation WAR. | +| `project.sibling.build.warDirectory` | | `${project.sibling.build.directory}/war` | The path of the sibling Platform module or web appliation WAR. | +| `project.sibling.build.warFile` | | `${project.sibling.build.warDirectory}/${project.sibling.warFileName}` | The path and filename of the sibling Platform module or web appliation WAR. | +| `acs-platform.port` | | 8080 | The port to expose on `localhost` for the developer; not for other applications or users.
*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.
*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.
*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.
*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.
*May be overridden by any POM parent or Maven Tile.*
*Inherited from [`beedk-acs-platform-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-rad-tile)* | + +### 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. diff --git a/beedk-acs-platform-sibling-rad-tile/pom.xml b/beedk-acs-platform-sibling-rad-tile/pom.xml new file mode 100644 index 0000000..cba1ef7 --- /dev/null +++ b/beedk-acs-platform-sibling-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-sibling-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: RAD for ACS Platform by Maven Sibling Project + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-platform-sibling-rad-tile/tile.xml b/beedk-acs-platform-sibling-rad-tile/tile.xml new file mode 100644 index 0000000..2763ea4 --- /dev/null +++ b/beedk-acs-platform-sibling-rad-tile/tile.xml @@ -0,0 +1,34 @@ + + + + + + default-props + + + !some-prop-that-never-exists + + + + + ${basedir}/../${project.sibling.name}/target + ${project.sibling.build.directory}/ext/platform + ${project.sibling.build.directory}/war + ${project.sibling.build.warDirectory}/${project.sibling.warFileName} + + + ${project.sibling.build.warFile} + ${project.sibling.build.extDirectory} + ${project.sibling.build.warDirectory} + + + + + + + com.inteligr8.ootbee:beedk-acs-platform-rad-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-platform-webapp-tile/.gitignore b/beedk-acs-platform-webapp-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-platform-webapp-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-platform-webapp-tile/README.md b/beedk-acs-platform-webapp-tile/README.md new file mode 100644 index 0000000..968f429 --- /dev/null +++ b/beedk-acs-platform-webapp-tile/README.md @@ -0,0 +1,57 @@ +# BeeDK ACS Platform Web Application Maven Tile + +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 any ACS Platform 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-platform-webapp-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +## 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.sdk.version` | **YES** | | For a list of versions and more details, see the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk).
*Inherited from [`beedk-acs-webapp-artifact-build-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-build-tile)* | + +### Other APIs + +Additional less important configurations are inherited from the following Maven Tiles. + + * [`beedk-acs-webapp-artifact-build-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-build-tile) diff --git a/beedk-acs-platform-webapp-tile/pom.xml b/beedk-acs-platform-webapp-tile/pom.xml new file mode 100644 index 0000000..eaccec2 --- /dev/null +++ b/beedk-acs-platform-webapp-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-platform-webapp-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: ACS Platform Web Application + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-platform-webapp-tile/tile.xml b/beedk-acs-platform-webapp-tile/tile.xml new file mode 100644 index 0000000..fd2257d --- /dev/null +++ b/beedk-acs-platform-webapp-tile/tile.xml @@ -0,0 +1,93 @@ + + + + + + + + maven-war-plugin + 3.0.0 + + false + true + + + + + maven-install-plugin + 3.0.0-M1 + + + true + + + + + install-alt-file + install + install-file + + ${project.groupId} + ${project.artifactId} + ${project.version} + war + ${project.build.warFile} + false + + + + + + + + + + + acs-community + + + edition + !enterprise + + + + + content-services-community + + + + + acs-enterprise + + + edition + enterprise + + + + + content-services + + + + default-props + + + !some-prop-that-never-exists + + + + + ${alfresco.platform.version} + + + + + + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-build-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-search-it-tile/.gitignore b/beedk-acs-search-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-search-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-search-it-tile/README.md b/beedk-acs-search-it-tile/README.md new file mode 100644 index 0000000..eee9ca5 --- /dev/null +++ b/beedk-acs-search-it-tile/README.md @@ -0,0 +1,77 @@ +# BeeDK Alfresco Search 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 Search 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + com.inteligr8.ootbee:beedk-acs--tile:[1.0.0,2.0.0) + + com.inteligr8.ootbee:beedk-acs-search-it-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +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 | +| -------------------- |:--------:| --------------- | ----------- | +| `acs-search.version` | | *not important* | The version of the [Alfresco Search Services Docker Image](https://hub.docker.com/r/alfresco/alfresco-search-services/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 Alfresco Search Service 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.acs-search.enabled` | Boolean | *At startup* | `true`, which signals other Maven Tiles | diff --git a/beedk-acs-search-it-tile/pom.xml b/beedk-acs-search-it-tile/pom.xml new file mode 100644 index 0000000..f0c81d1 --- /dev/null +++ b/beedk-acs-search-it-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-search-it-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Integration Testing for Alfresco Search Services + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-search-it-tile/tile.xml b/beedk-acs-search-it-tile/tile.xml new file mode 100644 index 0000000..9567905 --- /dev/null +++ b/beedk-acs-search-it-tile/tile.xml @@ -0,0 +1,84 @@ + + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + start-acs-search + pre-integration-test + start + + + + alfresco/alfresco-search-services:${acs-search.version} + acs-search + + ${skipTests} + + ${project.artifactId}-acs-platform + 8080 + ${project.artifactId}-acs-search + 8983 + alfresco + none + + + custom + ${project.artifactId} + + + + + + + + stop-acs-search + post-integration-test + stop + + + + alfresco/alfresco-search-services:${acs-search.version} + acs-search + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + 2.0.1 + + + + true + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-search-rad-tile/.gitignore b/beedk-acs-search-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-search-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-search-rad-tile/README.md b/beedk-acs-search-rad-tile/README.md new file mode 100644 index 0000000..f2d4efd --- /dev/null +++ b/beedk-acs-search-rad-tile/README.md @@ -0,0 +1,79 @@ +# BeeDK Alfresco Search 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 Search 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + com.inteligr8.ootbee:beedk-acs-platform--rad-tile:[1.0.0,2.0.0) + + com.inteligr8.ootbee:beedk-acs-search-rad-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +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 | +| -------------------- |:--------:| --------------- | ----------- | +| `acs-search.port` | | 8983 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `acs-search.version` | | *not important* | The version of the [Alfresco Search Services Docker Image](https://hub.docker.com/r/alfresco/alfresco-search-services/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 Alfresco Search Service 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.acs-search.enabled` | Boolean | *At startup* | `true`, which signals other Maven Tiles | diff --git a/beedk-acs-search-rad-tile/pom.xml b/beedk-acs-search-rad-tile/pom.xml new file mode 100644 index 0000000..17b21f2 --- /dev/null +++ b/beedk-acs-search-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-search-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: RAD for Alfresco Search Services + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-search-rad-tile/tile.xml b/beedk-acs-search-rad-tile/tile.xml new file mode 100644 index 0000000..8b051ed --- /dev/null +++ b/beedk-acs-search-rad-tile/tile.xml @@ -0,0 +1,83 @@ + + + + + + rad-acs-search + + + rad + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + run-acs-search + process-classes + start + + + + alfresco/alfresco-search-services:${acs-search.version} + acs-search + + + ${project.artifactId}-acs-platform + 8080 + ${project.artifactId}-acs-search + 8983 + alfresco + none + + + ${acs-search.port}:8983 + + + custom + ${project.artifactId} + + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + 8983 + + + 2.0.1 + + + + true + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-share-module-archetype/.gitignore b/beedk-acs-share-module-archetype/.gitignore new file mode 100644 index 0000000..5de9fc3 --- /dev/null +++ b/beedk-acs-share-module-archetype/.gitignore @@ -0,0 +1,9 @@ +# Maven +/target +pom.xml.versionsBackup + +# Eclipse +.settings +.project +.classpath + diff --git a/beedk-acs-share-module-archetype/pom.xml b/beedk-acs-share-module-archetype/pom.xml new file mode 100644 index 0000000..b7047dd --- /dev/null +++ b/beedk-acs-share-module-archetype/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-share-module-archetype + 1.0-SNAPSHOT + maven-archetype + + Order of the Bee Development Kit: Project Scaffolding for an ACS Share Module + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + org.apache.maven.archetype + archetype-packaging + 3.1.1 + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + diff --git a/beedk-acs-share-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/beedk-acs-share-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 0000000..9ca3f29 --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,59 @@ + + + + [A-Za-z0-9]+ + + + quay.io + + + local + + + + + src/main/java + + **/*.java + + + + src/test/java + + **/*.java + + + + src/main/extension/site-webscripts + + **/* + + + + src/main/resources/alfresco/web-extension/site-webscripts + + **/* + + + + src + + main/extension/site-webscripts/**/* + main/resources/alfresco/web-extension/site-webscripts/**/* + main/java/**/* + test/java/**/* + + + + + + .gitignore + rad.* + *.md + + + + \ No newline at end of file diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/.gitignore b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/.gitignore new file mode 100644 index 0000000..0a33814 --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/.gitignore @@ -0,0 +1,8 @@ +# Maven +/target +pom.xml.versionsBackup + +# Eclipse +.settings +.project +.classpath diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/pom.xml b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 0000000..04e710d --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,87 @@ + + 4.0.0 + + ${groupId} + ${artifactId} + ${version} + jar + + ${shortname} ACS Share Module + + + UTF-8 + 8 + 8 + + 4.2.0 + 6.2.0-ga + 6.2.2 + + + + + + org.alfresco + acs-community-packaging + ${alfresco.platform.version} + pom + import + + + + + + + + + org.alfresco + share + ${alfresco.share.version} + classes + provided + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + + com.inteligr8.ootbee:beedk-acs-share-self-rad-tile:1.0-SNAPSHOT + com.inteligr8.ootbee:beedk-acs-platform-artifact-rad-tile:1.0-SNAPSHOT + + com.inteligr8.ootbee:beedk-acs-share-module-tile:1.0-SNAPSHOT + + + + + + + + + + inteligr8-releases + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + alfresco-public + https://artifacts.alfresco.com/nexus/content/groups/public + + + + + + inteligr8-releases + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + \ No newline at end of file diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/rad.ps1 b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/rad.ps1 new file mode 100644 index 0000000..e4e3b6e --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/rad.ps1 @@ -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!" + diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/rad.sh b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/rad.sh new file mode 100644 index 0000000..1b37cf5 --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/rad.sh @@ -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!" + diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/share-config-custom.xml b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/share-config-custom.xml new file mode 100644 index 0000000..3bbc9ee --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/share-config-custom.xml @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + +
cm:content
+
cm:folder
+ + +
example:document
+
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 255 + + + + + + + + true + + + + + + + + + + + + + + + + + + + + true + aspect=cm:taggable + /api/tag/workspace/SpacesStore + tag + + + + + true + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + 255 + + + + + + + + true + + + + + true + aspect=cm:taggable + /api/tag/workspace/SpacesStore + tag + + + + + true + + + + + + + + + +
+ + + + + + + + + + 255 + + + + + + + + explorer + true + + + + + + +
+
+
+ + + + +
+ + + + + + + + + + + + 255 + + + + + + + + explorer + + + + + mimeType + + + + + editInline + + + + + + +
+ + +
+
+ +
diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties new file mode 100644 index 0000000..71703c3 --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/log4j.properties @@ -0,0 +1 @@ +log4j.logger.${package}=info diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties new file mode 100644 index 0000000..e64eae5 --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/module/__groupId__.__artifactId__/module.properties @@ -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} diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/__groupId__.__artifactId__-context.xml b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/__groupId__.__artifactId__-context.xml new file mode 100644 index 0000000..5bdc358 --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/__groupId__.__artifactId__-context.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + ${alfresco.ext.package}.messages.example + + + + + + + + + text/x-markdown + + + + + + + + + text/x-markdown + + + + + diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/messages/example.properties b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/messages/example.properties new file mode 100644 index 0000000..e69de29 diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/site-data/extensions/__groupId__.__artifactId__-extension.xml b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/site-data/extensions/__groupId__.__artifactId__-extension.xml new file mode 100644 index 0000000..af338a5 --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/site-data/extensions/__groupId__.__artifactId__-extension.xml @@ -0,0 +1,9 @@ + + + + ${project.artifactId} Example Extensibility Module + ${project.version} + true + + + diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/test/resources/META-INF/share-config-custom.xml b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/test/resources/META-INF/share-config-custom.xml new file mode 100644 index 0000000..a7b8f4f --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/test/resources/META-INF/share-config-custom.xml @@ -0,0 +1,95 @@ + + + + + + + production + + + + true + + + + + + + + + true + + false + + + + + + + + + + + + + + alfresco-noauth + Alfresco - unauthenticated access + Access to Alfresco Repository WebScripts that do not require authentication + alfresco + ${acs-platform.url}/alfresco/s + none + + + + alfresco + Alfresco - user access + Access to Alfresco Repository WebScripts that require user authentication + alfresco + ${acs-platform.url}/alfresco/s + user + + + + alfresco-feed + Alfresco Feed + Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet + http + ${acs-platform.url}/alfresco/s + true + user + + + + alfresco-api + alfresco + Alfresco Public API - user access + Access to Alfresco Repository Public API that require user authentication. + This makes use of the authentication that is provided by parent 'alfresco' endpoint. + alfresco + ${acs-platform.url}/alfresco/api + user + + + + diff --git a/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties new file mode 100644 index 0000000..97ba7dd --- /dev/null +++ b/beedk-acs-share-module-archetype/src/main/resources/archetype-resources/src/test/resources/log4j.properties @@ -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 diff --git a/beedk-acs-share-module-tile/.gitignore b/beedk-acs-share-module-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-share-module-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-share-module-tile/README.md b/beedk-acs-share-module-tile/README.md new file mode 100644 index 0000000..a24d3b3 --- /dev/null +++ b/beedk-acs-share-module-tile/README.md @@ -0,0 +1,77 @@ +# BeeDK ACS Share Module Maven Tile + +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 any ACS Share 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-share-module-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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. | + +### Other APIs + +Additional less important configurations are inherited from the following Maven Tile. + +* [`beedk-acs-module-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-module-tile) + +## Results + +The project will build as a deployable ACS Share module. + +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}` | +| `alfresco.ext.path` | | *At startup* | The classpath to the extension resources: `alfresco/web-extension` | +| `alfresco.ext.package` | Text | *At startup* | The package reference to the extension resources: `alfresco.web-extension` | + +## Initialization + +This tile comes with the ability to initialize your project with the required file(s) of an ACS Share module. You can do this by executing any Maven build with the `scaffold` property. + +```sh +mvn -Dscaffold generate-sources +``` diff --git a/beedk-acs-share-module-tile/pom.xml b/beedk-acs-share-module-tile/pom.xml new file mode 100644 index 0000000..9a8e1d3 --- /dev/null +++ b/beedk-acs-share-module-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-share-module-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: ACS Share Module + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-share-module-tile/tile.xml b/beedk-acs-share-module-tile/tile.xml new file mode 100644 index 0000000..16e0d0b --- /dev/null +++ b/beedk-acs-share-module-tile/tile.xml @@ -0,0 +1,96 @@ + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + add-acs-share-module-resources + add-resource + + + + + src/main/extension + true + + **/README* + share-config*.xml + + ${project.build.directory}/extension-classes/${alfresco.ext.path} + + + + src/main/module + true + + share-config*.xml + + ${project.build.directory}/web-resources/META-INF + + + + src/main/extension + true + + share-config*.xml + + ${project.build.directory}/web-resources/META-INF + + + + + + + + maven-resources-plugin + 3.2.0 + + + + consolidate-extension + process-resources + copy-resources + + ${project.build.packageDirectory} + + + ${project.build.directory}/extension-classes + false + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + alfresco/web-extension + alfresco.web-extension + + + + + + + com.inteligr8.ootbee:beedk-acs-module-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-share-self-it-tile/.gitignore b/beedk-acs-share-self-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-share-self-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-share-self-it-tile/README.md b/beedk-acs-share-self-it-tile/README.md new file mode 100644 index 0000000..d7e960b --- /dev/null +++ b/beedk-acs-share-self-it-tile/README.md @@ -0,0 +1,72 @@ +# BeeDK ACS Share Integration Test Maven Tile for Share Projects + +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 Share 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-share-self-it-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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.sdk.version` | **YES** | | For a list of versions and more details, see the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk).
*Inherited from [`beedk-acs-webapp-artifact-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-it-tile)* | +| `alfresco.share.version` | *Maybe* | | The Alfresco Share version to use for integration testing. See below for more details. | +| `alfresco.war.artifactId` | | `share` | The Maven `artifactId` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `alfresco.war.version` | *Maybe* | *See Below* | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `project.build.shareExtDirectory` | | `${project.build.directory}/ext/share` | An additional directory of JARs to add to the ACS Share at runtime. | +| `acs-platform.url` | | *See Below* | The URL of the backend ACS Platform to be used. | +| `acs-share.port` | | 8180 | 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-share.timeout` | | 45000 | The time to wait for the startup to complete, in milliseconds. | +| `tomcat-rad.version` | | *not important* | The version of the [Apache Tomcat Rapid Application Development Docker container](/inteligr8/tomcat-rad-docker). | + +* The `alfresco.share.version` is used to default the `alfresco.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. +* The `acs-platform.url` will default to the appropriate value when using the `beedk-acs-platform-*-it-tile` tiles. This should be overridden if you are not using those tiles and are instead using some other ACS Platform instance. + +### Other APIs + +Additional less important configurations are inherited from the following Maven Tiles. + +* [`beedk-run-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-run-tile) +* [`beedk-acs-webapp-artifact-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-it-tile) + +## Results + +ACS Share will be started and stopped during the `pre-integration-test` and `post-integration-test` Maven phases, respectively. diff --git a/beedk-acs-share-self-it-tile/pom.xml b/beedk-acs-share-self-it-tile/pom.xml new file mode 100644 index 0000000..b089ebd --- /dev/null +++ b/beedk-acs-share-self-it-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-share-self-it-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Integration Testing for ACS Share + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-share-self-it-tile/tile.xml b/beedk-acs-share-self-it-tile/tile.xml new file mode 100644 index 0000000..1b22ad9 --- /dev/null +++ b/beedk-acs-share-self-it-tile/tile.xml @@ -0,0 +1,167 @@ + + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-share-jars + pre-integration-test + copy-dependencies + + provided + jar + ${project.build.shareExtDirectory} + + + + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.1 + + + download-share-config + pre-integration-test + + wget + + + https://raw.githubusercontent.com/Alfresco/alfresco-sdk/alfresco-sdk-aggregator-${alfresco.sdk.version}/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/docker/share-config-custom.xml + ${project.build.directory}/download + + + + + + + com.google.code.maven-replacer-plugin + maven-replacer-plugin + 1.4.1 + + + pre-integration-test + + replace + + + + + ${basedir}/target/download + ${basedir}/target/test-classes + share-config-custom.xml + alfresco/web-extension + + + http://\$\{acs\.host\}:8080 + ${acs-platform.url} + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + start-acs-share + pre-integration-test + start + + + + docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version} + acs-share + + ${skipTests} + + ${acs-share.port}:8080 + + + custom + ${project.artifactId} + + + + ${project.build.warFile}:/var/lib/tomcat/webapps/share.war:ro + ${project.build.testOutputDirectory}:/var/lib/tomcat/dev/classes:ro + ${project.build.shareExtDirectory}:/var/lib/tomcat/dev/lib:ro + + + + + http://localhost:${acs-share.port}/share + GET + 200..399 + + + + + + + + + + stop-acs-share + post-integration-test + stop + + + + docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version} + acs-share + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + http://${project.artifactId}-acs-platform:8080 + 45000 + ${project.build.directory}/ext/share + + + 8180 + + + 9-1.3 + + + share + ${alfresco.share.version} + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-it-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-share-self-rad-tile/.gitignore b/beedk-acs-share-self-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-share-self-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-share-self-rad-tile/README.md b/beedk-acs-share-self-rad-tile/README.md new file mode 100644 index 0000000..ce49eb0 --- /dev/null +++ b/beedk-acs-share-self-rad-tile/README.md @@ -0,0 +1,73 @@ +# BeeDK ACS Share RAD Maven Tile for Share 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 of any ACS Share 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-share-self-rad-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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.sdk.version` | **YES** | | For a list of versions and more details, see the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk).
*Inherited from [`beedk-acs-webapp-artifact-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-rad-tile)* | +| `alfresco.share.version` | *Maybe* | | The Alfresco Share version to use for RAD. See below for more details. | +| `alfresco.war.artifactId` | | `share` | The Maven `artifactId` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `alfresco.war.version` | *Maybe* | *See Below* | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `project.build.shareExtDirectory` | | `${project.build.directory}/ext/share` | An additional directory of JARs to add to the ACS Share at runtime. | +| `acs-platform.url` | | *See Below* | The URL of the backend ACS Platform to be used. | +| `acs-share.port` | | 8180 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `acs-share.debugger.port` | | 8100 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `acs-share.timeout` | | 45000 | The time to wait for the startup to complete, in milliseconds. | +| `tomcat-rad.version` | | *not important* | The version of the [Apache Tomcat Rapid Application Development Docker container](/inteligr8/tomcat-rad-docker). | + +* The `alfresco.share.version` is used to default the `alfresco.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. +* The `acs-platform.url` will default to the appropriate value when using the `beedk-acs-platform-*-rad-tile` tiles. This should be overridden if you are not using those tiles and are instead using some other ACS Platform instance. + +### Other APIs + +Additional less important configurations are inherited from the following Maven Tiles. + +* [`beedk-run-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-run-tile) +* [`beedk-acs-webapp-artifact-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-rad-tile) + +## Results + +ACS Share will be started during the `process-classes` Maven phase. diff --git a/beedk-acs-share-self-rad-tile/pom.xml b/beedk-acs-share-self-rad-tile/pom.xml new file mode 100644 index 0000000..896025b --- /dev/null +++ b/beedk-acs-share-self-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-share-self-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: RAD for ACS Share + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-share-self-rad-tile/tile.xml b/beedk-acs-share-self-rad-tile/tile.xml new file mode 100644 index 0000000..a4d6c9c --- /dev/null +++ b/beedk-acs-share-self-rad-tile/tile.xml @@ -0,0 +1,167 @@ + + + + + + rad-acs-share-self + + + rad + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-share-jars + generate-resources + copy-dependencies + + provided + jar + ${project.build.shareExtDirectory} + + + + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.1 + + + download-share-config + generate-resources + + wget + + + https://raw.githubusercontent.com/Alfresco/alfresco-sdk/alfresco-sdk-aggregator-${alfresco.sdk.version}/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/docker/share-config-custom.xml + ${project.build.directory}/download + + + + + + + com.google.code.maven-replacer-plugin + maven-replacer-plugin + 1.4.1 + + + process-resources + + replace + + + + + ${basedir}/target/download + ${basedir}/target/test-classes + share-config-custom.xml + alfresco/web-extension + + + http://\$\{acs\.host\}:8080 + ${acs-platform.url} + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + run-acs-share + process-classes + start + + true + + + docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version} + acs-share + + + ${acs-share.port}:8080 + ${acs-share.debugger.port}:8000 + + + custom + ${project.artifactId} + + + + ${project.build.warFile}:/var/lib/tomcat/webapps/share.war:ro + ${project.build.outputDirectory}:/var/lib/tomcat/dev/classes:ro + ${project.build.directory}/module-classes:/var/lib/tomcat/dev/classes-extra1:ro + ${project.build.directory}/extension-classes:/var/lib/tomcat/dev/classes-extra2:ro + ${project.build.testOutputDirectory}:/var/lib/tomcat/dev/classes-extra3:ro + ${project.build.shareExtDirectory}:/var/lib/tomcat/dev/lib:ro + ${project.build.directory}/web-resources:/var/lib/tomcat/dev/web:ro + + + + + http://localhost:${acs-share.port}/share + GET + 200..399 + + + + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + http://${project.artifactId}-acs-platform:8080 + 8100 + 45000 + ${project.build.directory}/ext/share + + + 8180 + + + 9-1.3 + + + share + ${alfresco.share.version} + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-rad-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-share-webapp-tile/.gitignore b/beedk-acs-share-webapp-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-share-webapp-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-share-webapp-tile/README.md b/beedk-acs-share-webapp-tile/README.md new file mode 100644 index 0000000..e1ea46d --- /dev/null +++ b/beedk-acs-share-webapp-tile/README.md @@ -0,0 +1,57 @@ +# BeeDK ACS Share Web Application Maven Tile + +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 any ACS Share 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-share-webapp-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +## 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.sdk.version` | **YES** | | For a list of versions and more details, see the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk).
*Inherited from [`beedk-acs-webapp-artifact-build-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-build-tile)* | + +### Other APIs + +Additional less important configurations are inherited from the following Maven Tiles. + + * [`beedk-acs-webapp-artifact-build-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-build-tile) diff --git a/beedk-acs-share-webapp-tile/pom.xml b/beedk-acs-share-webapp-tile/pom.xml new file mode 100644 index 0000000..23c2601 --- /dev/null +++ b/beedk-acs-share-webapp-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-share-webapp-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: ACS Share Web Application + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-share-webapp-tile/tile.xml b/beedk-acs-share-webapp-tile/tile.xml new file mode 100644 index 0000000..c3d5e5f --- /dev/null +++ b/beedk-acs-share-webapp-tile/tile.xml @@ -0,0 +1,64 @@ + + + + + + + + maven-war-plugin + 3.0.0 + + false + true + + + + + maven-install-plugin + 3.0.0-M1 + + true + + + + install-alt-file + install + install-file + + ${project.groupId} + ${project.artifactId} + ${project.version} + war + ${project.build.warFile} + false + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + share + ${alfresco.platform.version} + + + + + + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-build-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-webapp-artifact-build-tile/.gitignore b/beedk-acs-webapp-artifact-build-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-webapp-artifact-build-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-webapp-artifact-build-tile/README.md b/beedk-acs-webapp-artifact-build-tile/README.md new file mode 100644 index 0000000..cd31b09 --- /dev/null +++ b/beedk-acs-webapp-artifact-build-tile/README.md @@ -0,0 +1,64 @@ +# BeeDK ACS Web Application Builder 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 building Alfresco web applications. 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-build-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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.sdk.version` | **YES** | | For a list of versions and more details, see the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk). This is used for AMP packaging functionality. | +| `alfresco.war.groupId` | | `org.alfresco` | The Maven `groupId` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `alfresco.war.artifactId` | **YES** | | The Maven `artifactId` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `alfresco.war.version` | **YES** | | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `project.build.ampDirectory` | | `${project.build.directory}/amp` | This is where AMPs are temporarily copied during the build process. | + +### Other APIs + +Additional less important configurations are inherited from the following Maven Tiles. + +* [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile) + +## Results + +The configured WAR will downloaded to your local Maven Repository and copied into the configured directory during the configured Maven phase. The project's AMP `compile` and `runtime` dependencies will be downloaded to your local Maven Repository and copied into the configured directory during the `pre-package` Maven phase. The AMPs will be installed into the WAR during the `package` Maven phase. The downloaded and copied AMPs will remain in place. diff --git a/beedk-acs-webapp-artifact-build-tile/pom.xml b/beedk-acs-webapp-artifact-build-tile/pom.xml new file mode 100644 index 0000000..66cd155 --- /dev/null +++ b/beedk-acs-webapp-artifact-build-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-webapp-artifact-build-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Alfresco Web Application Artifact Builder for Deployment + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-webapp-artifact-build-tile/tile.xml b/beedk-acs-webapp-artifact-build-tile/tile.xml new file mode 100644 index 0000000..e03eb2f --- /dev/null +++ b/beedk-acs-webapp-artifact-build-tile/tile.xml @@ -0,0 +1,69 @@ + + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-amp-modules + prepare-package + copy-dependencies + + ${beedk.amp.notest.empty} + runtime + amp + ${project.build.ampDirectory} + + + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + ${alfresco.sdk.version} + + + build-webapp + package + install + + ${beedk.amp.notest.empty} + ${project.build.warFile} + ${project.build.ampDirectory} + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + ${project.build.directory}/amps + + + + + + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-webapp-artifact-it-tile/.gitignore b/beedk-acs-webapp-artifact-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-webapp-artifact-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-webapp-artifact-it-tile/README.md b/beedk-acs-webapp-artifact-it-tile/README.md new file mode 100644 index 0000000..1d0be1b --- /dev/null +++ b/beedk-acs-webapp-artifact-it-tile/README.md @@ -0,0 +1,64 @@ +# BeeDK ACS Web Application Builder 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 building Alfresco web applications for integration testing purposes. + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-it-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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.sdk.version` | **YES** | | For a list of versions and more details, see the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk). This is used for AMP packaging functionality. | +| `alfresco.war.groupId` | | `org.alfresco` | The Maven `groupId` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `alfresco.war.artifactId` | **YES** | | The Maven `artifactId` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `alfresco.war.version` | **YES** | | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `project.build.ampDirectory` | | `${project.build.directory}/amp` | This is where AMPs are temporarily copied during the build process. | + +### Other APIs + +Additional less important configurations are inherited from the following Maven Tiles. + +* [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile) + +## Results + +The configured WAR will downloaded to your local Maven Repository and copied into the configured directory during the configured Maven phase. The project's AMP `compile`, `runtime`,and `test` dependencies will be downloaded to your local Maven Repository and copied into the configured directory during the `pre-integration-test` Maven phase. The AMPs will be installed into the WAR during that same `pre-integration-test` Maven phase. The downloaded and copied AMPs will remain in place. diff --git a/beedk-acs-webapp-artifact-it-tile/pom.xml b/beedk-acs-webapp-artifact-it-tile/pom.xml new file mode 100644 index 0000000..ef3b64b --- /dev/null +++ b/beedk-acs-webapp-artifact-it-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-webapp-artifact-it-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Alfresco Web Application Artifact for Testing + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-webapp-artifact-it-tile/tile.xml b/beedk-acs-webapp-artifact-it-tile/tile.xml new file mode 100644 index 0000000..51f8433 --- /dev/null +++ b/beedk-acs-webapp-artifact-it-tile/tile.xml @@ -0,0 +1,72 @@ + + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-test-amp-modules + ${beedk.download.war.phase} + copy-dependencies + + ${beedk.amp.test.empty} + provided + amp + ${project.build.ampDirectory} + + + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + ${alfresco.sdk.version} + + + build-test-webapp + ${beedk.download.war.phase} + install + + ${beedk.amp.test.empty} + ${project.build.warFile} + ${project.build.ampDirectory} + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + ${project.build.directory}/amps + + + pre-integration-test + + + + + + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-webapp-artifact-rad-tile/.gitignore b/beedk-acs-webapp-artifact-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-webapp-artifact-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-webapp-artifact-rad-tile/README.md b/beedk-acs-webapp-artifact-rad-tile/README.md new file mode 100644 index 0000000..0fcc27f --- /dev/null +++ b/beedk-acs-webapp-artifact-rad-tile/README.md @@ -0,0 +1,64 @@ +# BeeDK ACS Web Application Builder Maven Tile for RAD + +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 building Alfresco web applications for rapid application development purposes. + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-rad-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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.sdk.version` | **YES** | | For a list of versions and more details, see the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk). This is used for AMP packaging functionality. | +| `alfresco.war.groupId` | | `org.alfresco` | The Maven `groupId` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `alfresco.war.artifactId` | **YES** | | The Maven `artifactId` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `alfresco.war.version` | **YES** | | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository.
*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* | +| `project.build.ampDirectory` | | `${project.build.directory}/amp` | This is where AMPs are temporarily copied during the build process. | + +### Other APIs + +Additional less important configurations are inherited from the following Maven Tiles. + +* [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile) + +## Results + +The configured WAR will downloaded to your local Maven Repository and copied into the configured directory during the configured Maven phase. The project's AMP `compile`, `runtime`,and `test` dependencies will be downloaded to your local Maven Repository and copied into the configured directory during the `generate-resources` Maven phase. The AMPs will be installed into the WAR during that same `generate-resources` Maven phase. The downloaded and copied AMPs will remain in place. diff --git a/beedk-acs-webapp-artifact-rad-tile/pom.xml b/beedk-acs-webapp-artifact-rad-tile/pom.xml new file mode 100644 index 0000000..f99f45f --- /dev/null +++ b/beedk-acs-webapp-artifact-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-webapp-artifact-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Alfresco Web Application Artifact for RAD + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-webapp-artifact-rad-tile/tile.xml b/beedk-acs-webapp-artifact-rad-tile/tile.xml new file mode 100644 index 0000000..33f7d1a --- /dev/null +++ b/beedk-acs-webapp-artifact-rad-tile/tile.xml @@ -0,0 +1,72 @@ + + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-test-amp-modules + ${beedk.download.war.phase} + copy-dependencies + + ${beedk.amp.test.empty} + provided + amp + ${project.build.ampDirectory} + + + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + ${alfresco.sdk.version} + + + build-test-webapp + ${beedk.download.war.phase} + install + + ${beedk.amp.test.empty} + ${project.build.warFile} + ${project.build.ampDirectory} + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + ${project.build.directory}/amps + + + generate-resources + + + + + + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-tile:1.0-SNAPSHOT + + + diff --git a/beedk-acs-webapp-artifact-tile/.gitignore b/beedk-acs-webapp-artifact-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-acs-webapp-artifact-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-acs-webapp-artifact-tile/README.md b/beedk-acs-webapp-artifact-tile/README.md new file mode 100644 index 0000000..8a1933d --- /dev/null +++ b/beedk-acs-webapp-artifact-tile/README.md @@ -0,0 +1,71 @@ +# BeeDK Abstract ACS Web Application 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 building Alfresco web applications. + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-acs-webapp-artifact-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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.war.groupId` | | `org.alfresco` | The Maven `groupId` of a Maven `war` Type Project defined in a Maven Repository. | +| `alfresco.war.artifactId` | **YES** | | The Maven `artifactId` of a Maven `war` Type Project defined in a Maven Repository. | +| `alfresco.war.version` | **YES** | | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository. | +| `project.build.warDirectory` | | `${project.build.directory}/war` | This is where WARs are temporarily copied during the build process. | + +### Private API + +The following properties are only intended to be defined by BeeDK components. + +| Maven Property | Required | Default | Description | +| ---------------------------- |:--------:| ----------------- | ----------- | +| `beedk.download.war.phase` | | `prepare-package` | The Maven `phase` of when the WAR should be downloaded, copied, or otherwise prepared for packaging. If packaging for integration testing, you will want this to be `pre-integration-test`. | + +## Results + +The configured WAR will be downloaded to your local Maven Repository and copied into the configured directory during the configured Maven phase. + +This tile will result in the definition of the following Maven properties during the respective Maven phase. + +| Property | Data Type | Phase | Description | +| ---------------------------- |:---------:|:------------:| ----------- | +| `project.build.warFile` | Text | *At startup* | The WAR path and filename for your convenience: `${project.build.warDirectory}/${alfresco.war.artifactId}-${alfresco.war.version}.war` | diff --git a/beedk-acs-webapp-artifact-tile/pom.xml b/beedk-acs-webapp-artifact-tile/pom.xml new file mode 100644 index 0000000..bd82fca --- /dev/null +++ b/beedk-acs-webapp-artifact-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-acs-webapp-artifact-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Alfreco Web Application Artifact Downloader + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-acs-webapp-artifact-tile/tile.xml b/beedk-acs-webapp-artifact-tile/tile.xml new file mode 100644 index 0000000..0041924 --- /dev/null +++ b/beedk-acs-webapp-artifact-tile/tile.xml @@ -0,0 +1,61 @@ + + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-webapp + ${beedk.download.war.phase} + copy + + + + ${alfresco.war.groupId} + ${alfresco.war.artifactId} + ${alfresco.war.version} + war + + + ${project.build.warDirectory} + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + org.alfresco + prepare-package + ${project.build.directory}/war + + + ${project.build.warDirectory}/${alfresco.war.artifactId}-${alfresco.war.version}.war + + + + + + + com.inteligr8.ootbee:beedk-amp-check-tile:1.0-SNAPSHOT + + + diff --git a/beedk-amp-check-tile/.gitignore b/beedk-amp-check-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-amp-check-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-amp-check-tile/README.md b/beedk-amp-check-tile/README.md new file mode 100644 index 0000000..6140dc2 --- /dev/null +++ b/beedk-amp-check-tile/README.md @@ -0,0 +1,57 @@ +# BeeDK Alfresco Module Package Checker 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 building Alfresco web applications. 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-amp-check-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## Configuration + +There is nothing to configure for this Maven tile. + +## Results + +This tile will result in the definition of the following Maven properties during the respective Maven phase. + +| Property | Data Type | Phase | Description | +| ---------------------------- |:---------:|:------------:| ----------- | +| `beedk.amp.notest.empty` | Boolean | `initialize` | `false` if there any `compile` or `runtime` AMP dependencies on the project; `true` if there are none | +| `beedk.jar.notest.empty` | Boolean | `initialize` | `false` if there any `compile` or `runtime` JAR dependencies on the project; `true` if there are none | +| `beedk.amp.test.empty` | Boolean | `initialize` | `false` if there any `compile`, `runtime`, or `test` AMP dependencies on the project; `true` if there are none | +| `beedk.jar.test.empty` | Boolean | `initialize` | `false` if there any `compile`, `runtime`, or `test` JAR dependencies on the project;`true` if there are none | +| `beedk.amp.notest.classpath` | Text | `initialize` | Java command line classpath text of all `compile` and `runtime` AMP dependencies on the project | +| `beedk.jar.notest.classpath` | Text | `initialize` | Java command line classpath text of all `compile` and `runtime` JAR dependencies on the project | +| `beedk.amp.test.classpath` | Text | `initialize` | Java command line classpath text of all `compile`, `runtime`, or `test` AMP dependencies on the project | +| `beedk.jar.test.classpath` | Text | `initialize` | Java command line classpath text of all `compile`, `runtime`, or `test` JAR dependencies on the project | diff --git a/beedk-amp-check-tile/pom.xml b/beedk-amp-check-tile/pom.xml new file mode 100644 index 0000000..7323567 --- /dev/null +++ b/beedk-amp-check-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-amp-check-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: AMP Checker + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-amp-check-tile/tile.xml b/beedk-amp-check-tile/tile.xml new file mode 100644 index 0000000..692210d --- /dev/null +++ b/beedk-amp-check-tile/tile.xml @@ -0,0 +1,118 @@ + + + + + + + + maven-dependency-plugin + 3.1.2 + + + generate-amp-notest-classpath + initialize + build-classpath + + runtime + amp + beedk.amp.notest.classpath + + + + generate-jar-notest-classpath + initialize + build-classpath + + runtime + jar + beedk.jar.notest.classpath + + + + generate-amp-test-classpath + initialize + build-classpath + + provided + amp + beedk.amp.test.classpath + + + + generate-jar-test-classpath + initialize + build-classpath + + provided + jar + beedk.jar.test.classpath + + + + + + + com.inteligr8 + regex-maven-plugin + 1.0.1 + + + string-2-boolean-1 + initialize + match-property + + beedk.amp.notest.classpath + + .+ + + true + beedk.amp.notest.empty + + + + string-2-boolean-2 + initialize + match-property + + beedk.jar.notest.classpath + + .+ + + true + beedk.jar.notest.empty + + + + string-2-boolean-3 + initialize + match-property + + beedk.amp.test.classpath + + .+ + + true + beedk.amp.test.empty + + + + string-2-boolean-4 + initialize + match-property + + beedk.jar.test.classpath + + .+ + + true + beedk.jar.test.empty + + + + + + + + diff --git a/beedk-ate-archetype/.gitignore b/beedk-ate-archetype/.gitignore new file mode 100644 index 0000000..5de9fc3 --- /dev/null +++ b/beedk-ate-archetype/.gitignore @@ -0,0 +1,9 @@ +# Maven +/target +pom.xml.versionsBackup + +# Eclipse +.settings +.project +.classpath + diff --git a/beedk-ate-archetype/pom.xml b/beedk-ate-archetype/pom.xml new file mode 100644 index 0000000..4fc6d8f --- /dev/null +++ b/beedk-ate-archetype/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + + com.inteligr8.ootbee + beedk-ate-archetype + 1.0-SNAPSHOT + maven-archetype + + Order of the Bee Development Kit: Project Scaffolding for an ACS Platform Module + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + utf-8 + + + + + + org.apache.maven.archetype + archetype-packaging + 3.1.1 + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + diff --git a/beedk-ate-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/beedk-ate-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 0000000..3d520ae --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,40 @@ + + + + [A-Za-z0-9]+ + + + quay.io + + + local + + + [1.0.0,2.0.0) + + + + + src/main/java + + **/* + + + + src/test/java + + **/* + + + + src + + main/java/**/* + test/java/**/* + + + + \ No newline at end of file diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/.gitignore b/beedk-ate-archetype/src/main/resources/archetype-resources/.gitignore new file mode 100644 index 0000000..5de9fc3 --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/.gitignore @@ -0,0 +1,9 @@ +# Maven +/target +pom.xml.versionsBackup + +# Eclipse +.settings +.project +.classpath + diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/pom.xml b/beedk-ate-archetype/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 0000000..544e36e --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,85 @@ + + 4.0.0 + + ${groupId} + ${artifactId} + ${version} + jar + + ${shortname} Alfresco T-Engine + + + UTF-8 + 8 + 8 + + 2.3.6 + 2.3.5.RELEASE + + ${dockerRegistryHost} + ${dockerImagePrefix}/${project.artifactId} + ${project.version} + + + + + com.inteligr8.ootbee + beedk-ate-springboot + ${beedkVersion} + pom + import + + + com.inteligr8.ootbee + beedk-ate-springboot-test + ${beedkVersion} + pom + test + + + org.jsoup + jsoup + 1.13.1 + test + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + + com.inteligr8.ootbee:beedk-ate-docker-tile:${beedkVersion} + + com.inteligr8.ootbee:beedk-ate-springboot-tile:${beedkVersion} + + + + + + + + + inteligr8-releases + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + alfresco-public + https://artifacts.alfresco.com/nexus/content/groups/public + + + + + + inteligr8-releases + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + \ No newline at end of file diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile new file mode 100644 index 0000000..09b9893 --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile @@ -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} diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/java/Application.java b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/java/Application.java new file mode 100644 index 0000000..6f2f6d5 --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/java/Application.java @@ -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 . + * #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 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"); + } +} diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/java/TransformerController.java b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/java/TransformerController.java new file mode 100644 index 0000000..e05d030 --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/java/TransformerController.java @@ -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 . + * #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 is missing (missing mandatory parameter) + * 400 Bad Request: Request parameter 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 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 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; + } + } +} diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/java/TransformerImpl.java b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/java/TransformerImpl.java new file mode 100644 index 0000000..e79a332 --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/java/TransformerImpl.java @@ -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 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 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 + } + +} diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/application-context.xml b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/application-context.xml new file mode 100644 index 0000000..065e12d --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/application-context.xml @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/application-default.yaml b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/application-default.yaml new file mode 100644 index 0000000..1b27361 --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/application-default.yaml @@ -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} diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/templates/transformForm.html b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/templates/transformForm.html new file mode 100644 index 0000000..02dbbe6 --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/templates/transformForm.html @@ -0,0 +1,21 @@ + + + +
+

${shortname} Test Transformation

+
+ + + + + +
file *
targetExtension *
+
+
+ + + + + diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/this_engine_config.json b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/this_engine_config.json new file mode 100644 index 0000000..a4f1fad --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/main/resources/this_engine_config.json @@ -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" + ] + } + ] +} diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/test/java/HttpRequestIT.java b/beedk-ate-archetype/src/main/resources/archetype-resources/src/test/java/HttpRequestIT.java new file mode 100644 index 0000000..7bf7fc7 --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/test/java/HttpRequestIT.java @@ -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 . + * #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 inputs = new HashSet(); + 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 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 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 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 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 _testService(String filename, String targetExtension) { + LinkedMultiValueMap 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> entity = new HttpEntity<>(parameters, headers); + return this.restTemplate.postForEntity(this.baseUrl + "/transform", entity, String.class); + } + +} diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/test/java/TransformerControllerTest.java b/beedk-ate-archetype/src/main/resources/archetype-resources/src/test/java/TransformerControllerTest.java new file mode 100644 index 0000000..995c3cf --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/test/java/TransformerControllerTest.java @@ -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() { + + } +} diff --git a/beedk-ate-archetype/src/main/resources/archetype-resources/src/test/resources/application-default.yaml b/beedk-ate-archetype/src/main/resources/archetype-resources/src/test/resources/application-default.yaml new file mode 100644 index 0000000..316190d --- /dev/null +++ b/beedk-ate-archetype/src/main/resources/archetype-resources/src/test/resources/application-default.yaml @@ -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} diff --git a/beedk-ate-docker-tile/.gitignore b/beedk-ate-docker-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-ate-docker-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-ate-docker-tile/README.md b/beedk-ate-docker-tile/README.md new file mode 100644 index 0000000..559795a --- /dev/null +++ b/beedk-ate-docker-tile/README.md @@ -0,0 +1,71 @@ +# BeeDK Docker Alfresco Transform Engine Maven Tile + +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 any ATE that is delivered as a Docker Image. + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-ate-docker-tile:[1.0.0,2.0.0) + + + + + ... + + ... + + ... + +``` + +This tile is nearly always used in conjunction with `beedk-ate-springboot-tile` Maven Tile. If the `Dockerfile` intends to package the Spring Boot application, this Maven Tile must be declared **BEFORE** that 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 | +| ------------------------------ |:--------:| ------------------ | ----------- | +| `docker.source.directory` | | `src/main/docker` | The source directory of the `Dockerfile` and related resources.
*Inherited from [`beedk-springboot-docker-base-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-springboot-docker-base-tile)* | +| `beedk.deploy.dockerImageOnly` | | true | Set to `true` to skip the Maven `deploy` of the Spring Boot application; `false` to deploy it to the configured Maven Repository. Regardless, the Docker Image will be deployed to the configured Docker Registry.
*Inherited from [`beedk-springboot-docker-base-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-springboot-docker-base-tile)* | +| `docker.image.registry` | **Yes** | | The Docker Registry where to push the built Docker Image. If none is specified, Docker pushes to the [Docker Hub](https://hub.docker.com).
*Inherited from [`beedk-springboot-docker-base-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-springboot-docker-base-tile)* | +| `docker.image.name` | **Yes** | | The Docker Image name. You typically want to pattern it as `prefix/${project.artifactId}`.
*Inherited from [`beedk-springboot-docker-base-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-springboot-docker-base-tile)* | +| `docker.image.tag` | | *Project Version* | The Docker Image tag or label. This will default to the Maven project version.
*Inherited from [`beedk-springboot-docker-base-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-springboot-docker-base-tile)* | + +## Results + +A Docker image will be built using your local Docker installation during the `package` phase. It will be tagged both with and without the configured Docker Registry. During the `deploy` phase, the Docker image will be pushed to the configured Docker Registry. + +## Initialization + +This tile comes with the ability to initialize your project with a sample file of a Docker ATE. You can do this by executing any Maven build with the `scaffold` property. + +```sh +mvn -Dscaffold generate-sources +``` diff --git a/beedk-ate-docker-tile/pom.xml b/beedk-ate-docker-tile/pom.xml new file mode 100644 index 0000000..db7d5af --- /dev/null +++ b/beedk-ate-docker-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-ate-docker-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: ATE Docker Enablement + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-ate-docker-tile/tile.xml b/beedk-ate-docker-tile/tile.xml new file mode 100644 index 0000000..928f11f --- /dev/null +++ b/beedk-ate-docker-tile/tile.xml @@ -0,0 +1,59 @@ + + + + + + scaffold-ate-docker + + + scaffold + + + + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.1 + + + + download-dockerfile + generate-sources + + wget + + + https://raw.githubusercontent.com/Alfresco/alfresco-transform-core/master/alfresco-transform-misc/alfresco-transform-misc-boot/Dockerfile + ${basedir}/src/main/docker + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + ${docker.image.name} + ${docker.image.tag} + + + + + + + com.inteligr8.ootbee:beedk-springboot-docker-base-tile:1.0-SNAPSHOT + + + diff --git a/beedk-ate-it-tile/.gitignore b/beedk-ate-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-ate-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-ate-it-tile/README.md b/beedk-ate-it-tile/README.md new file mode 100644 index 0000000..c20f6f3 --- /dev/null +++ b/beedk-ate-it-tile/README.md @@ -0,0 +1,78 @@ +# BeeDK Alfresco Transform Engine Maven Tile for Integration Test + +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 a Alfresco Transform Engine for the integration testing of any ATS or ACS module, exension, service, or web application. + +For the development of the ATE itself, you can use the [`beedk-ate-springboot-test` composite POM](../beedk-ate-springboot-test). + +> This does not currently support use with ATS. Only the ALTS (ACS Platform Local Transform Service). + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + com.inteligr8.ootbee:beedk-acs--tile:[1.0.0,2.0.0) + + com.inteligr8.ootbee:beedk-ate-it-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +This tile is meant to be used in conjunction with the `beedk-acs-platform-it-tile` tile. The `beedk-acs-platform-it-tile` tile 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 | +| ------------------------- |:--------:| ----------- | ----------- | +| `ate.docker.image.name` | **Yes** | | The Docker image name of the ATE, including the Docker registry host if applicable. | +| `ate.docker.image.tag` | | `latest` | The Docker image tag (version) of the ATE. | +| `ate.port` | | 8080 | The port to expose on `localhost` for the developer; not for other applications. | +| `ate.timeout` | | 30000 | The time to wait for the startup to complete, in milliseconds. | + +### 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 configured Alfresco Transform Engine will be started and stopped during the `pre-integration-test` and `post-integration-test` Maven phases, respectively. diff --git a/beedk-ate-it-tile/pom.xml b/beedk-ate-it-tile/pom.xml new file mode 100644 index 0000000..f9276ff --- /dev/null +++ b/beedk-ate-it-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-ate-it-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Integration Testing for ATE + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-ate-it-tile/tile.xml b/beedk-ate-it-tile/tile.xml new file mode 100644 index 0000000..090d567 --- /dev/null +++ b/beedk-ate-it-tile/tile.xml @@ -0,0 +1,85 @@ + + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + start-ate + pre-integration-test + start + + + + ${ate.docker.image.name}:${ate.docker.image.tag} + ate + + ${skipTests} + + ${ate.port}:8090 + + + custom + ${project.artifactId} + + + + http://localhost:${ate.port}/transform/config + GET + 200..399 + + + + + + + + + + stop-ate + post-integration-test + stop + + + + ${ate.docker.image.name}:${ate.docker.image.tag} + ate + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + latest + 8090 + 30000 + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-ate-self-rad-tile/.gitignore b/beedk-ate-self-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-ate-self-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-ate-self-rad-tile/README.md b/beedk-ate-self-rad-tile/README.md new file mode 100644 index 0000000..ae3fb15 --- /dev/null +++ b/beedk-ate-self-rad-tile/README.md @@ -0,0 +1,80 @@ +# BeeDK Alfresco Transform Engine RAD Maven Tile + +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 supports the rapid application development of a Alfresco Transform Engine. + +> This does not currently support use with ATS. Only the ALTS (ACS Platform Local Transform Service). + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-ate-self-rad-tile:[1.0.0,2.0.0) + ... + com.inteligr8.ootbee:beedk-ate-springboot-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +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 | +| ------------------------- |:--------:| --------------- | ----------- | +| `ate.app.className` | **Yes** | | The Java class name of the @SpringBootApplication annotated class. | +| `ate.docker.image.name` | **Yes** | | The Docker image name of the ATE, including the Docker registry host if applicable. | +| `ate.docker.image.tag` | | `latest` | The Docker image tag (version) of the ATE. | +| `ate.port` | | 8080 | The port to expose on `localhost` for the developer; not for other applications. | +| `ate.debugger.port` | | 8001 | The port to expose on `localhost` for the developer; not for other applications. | +| `ate.timeout` | | 20000 | The time to wait for the startup to complete, in milliseconds. | + +### Private API + +The following properties are only intended to be defined by BeeDK components. + +| Maven Property | Required | Default | Description | +| ---------------------------- |:--------:| --------------- | ----------- | +| `java-dcevm-hotswap.version` | | *not important* | The version of the [Java DCEVM Hotswap Rapid Application Development Docker container](/inteligr8/java-dcevm-hotswap-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 configured Alfresco Transform Engine will be started during the `process-classes` Maven phase. It will **not** be configured automatically for use by the ACS Platform or ATS. diff --git a/beedk-ate-self-rad-tile/pom.xml b/beedk-ate-self-rad-tile/pom.xml new file mode 100644 index 0000000..7b58309 --- /dev/null +++ b/beedk-ate-self-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-ate-self-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: RAD for ATE + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-ate-self-rad-tile/tile.xml b/beedk-ate-self-rad-tile/tile.xml new file mode 100644 index 0000000..6180866 --- /dev/null +++ b/beedk-ate-self-rad-tile/tile.xml @@ -0,0 +1,112 @@ + + + + + + rad-ate + + + rad + + + + + + + maven-dependency-plugin + 3.1.2 + + + + download-ate-jars + process-classes + copy-dependencies + + provided + jar + ${beedk.deploy.ate.extDirectory} + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + run-ate + process-classes + start + + + + docker.inteligr8.com/inteligr8/java-dcevm-hotswap:${java-dcevm-hotswap.version} + ate + + + ${ate.app.className} + + + ${ate.port}:8090 + ${ate.debugger.port}:8000 + + + + ${project.build.outputDirectory}:/var/lib/jvm/dev/classes:ro + ${project.build.testOutputDirectory}:/var/lib/jvm/dev/classes-extra1:ro + ${beedk.deploy.ate.extDirectory}:/var/lib/jvm/dev/lib:ro + + + + custom + ${project.artifactId} + + + + http://localhost:${ate.port}/transform/config + GET + 200..399 + + + + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + latest + 8090 + 8001 + 20000 + ${project.build.directory}/libs + + + 11.0.10-1.4.1 + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-ate-sibling-rad-tile/.gitignore b/beedk-ate-sibling-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-ate-sibling-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-ate-sibling-rad-tile/README.md b/beedk-ate-sibling-rad-tile/README.md new file mode 100644 index 0000000..cd71ac9 --- /dev/null +++ b/beedk-ate-sibling-rad-tile/README.md @@ -0,0 +1,79 @@ +# BeeDK Alfresco Transform Engine RAD Maven Tile for non T-Engine 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 a Alfresco Transform Engine for the rapid application development of any ATS or ACS module, extension, service, or web application. + +> This does not currently support use with ATS. Only the ALTS (ACS Platform Local Transform Service). + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + com.inteligr8.ootbee:beedk-acs-platform--rad-tile:[1.0.0,2.0.0) + com.inteligr8.ootbee:beedk-acs-alts-rad-tile:[1.0.0,2.0.0) + + com.inteligr8.ootbee:beedk-ate-sibling-rad-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +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) +* [`beedk-acs-platform-sibling-rad-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-platform-sibling-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 | +| ------------------------- |:--------:| --------------- | ----------- | +| `ate.app.className` | **Yes** | | The Java class name of the @SpringBootApplication annotated class. | +| `ate.docker.image.name` | **Yes** | | The Docker image name of the ATE, including the Docker registry host if applicable. | +| `ate.docker.image.tag` | | `latest` | The Docker image tag (version) of the ATE. | +| `ate.port` | | 8080 | The port to expose on `localhost` for the developer; not for other applications. | +| `ate.timeout` | | 20000 | The time to wait for the startup to complete, in milliseconds. | + +### 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 configured Alfresco Transform Engine will be started during the `process-classes` Maven phase. It will **not** be configured automatically for use by the ACS Platform or ATS. diff --git a/beedk-ate-sibling-rad-tile/pom.xml b/beedk-ate-sibling-rad-tile/pom.xml new file mode 100644 index 0000000..6e9f897 --- /dev/null +++ b/beedk-ate-sibling-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-ate-sibling-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: RAD for ATE by a Maven Sibling Project + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-ate-sibling-rad-tile/tile.xml b/beedk-ate-sibling-rad-tile/tile.xml new file mode 100644 index 0000000..398f07a --- /dev/null +++ b/beedk-ate-sibling-rad-tile/tile.xml @@ -0,0 +1,78 @@ + + + + + + rad-ate + + + rad + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + run-ate + process-classes + start + + + + ${ate.docker.image.name}:${ate.docker.image.tag} + ate + + + ${ate.port}:8090 + + + custom + ${project.artifactId} + + + + http://localhost:${ate.port}/transform/config + GET + 200..399 + + + + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + latest + 8090 + 20000 + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-ate-springboot-test/.gitignore b/beedk-ate-springboot-test/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-ate-springboot-test/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-ate-springboot-test/README.md b/beedk-ate-springboot-test/README.md new file mode 100644 index 0000000..3abb010 --- /dev/null +++ b/beedk-ate-springboot-test/README.md @@ -0,0 +1,52 @@ +# BeeDK Spring Boot Alfresco Transform Engine Maven Composite POM for Unit Testing + +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 Composite POM that prorvides the basis for unit testing any Maven project using the [`beedk-ate-springboot`](../beedk-ate-springboot) Composite POM. + +## Usage + +To use this plugin, just reference it with the standard Maven dependencies as shown in the following snippet. + +```xml + + ... + + ... + + com.inteligr8.ootbee + beedk-ate-springboot + [1.0.0,1.1.0) + pom + + + com.inteligr8.ootbee + beedk-ate-springboot-test + [1.0.0,1.1.0) + pom + test + + ... + + ... + +``` + +## Configuration + +In your Maven project, set the following properties to define the behavior of this Maven Composite POM. + +### Public API + +The following properties are exposed by this Maven Composite POM. + +| Maven Property | Required | Default | Description | +| --------------------------------- |:--------:| --------------- | ----------- | +| `alfresco.transform-base.version` | | *not important* | For a list of versions and more details, see the [Alfresco Transform project](https://github.com/Alfresco/alfresco-transform-core). | +| `spring-boot.version` | | *not important* | For a list of versions and more details, see the [Spring Boot Project](https://spring.io/projects/spring-boot).
You could use a different Spring Boot version for building your application. This one is only for test execution. | + +## Results + +The Spring Boot project will be have all the dependencies required for unit testing an Alfresco Transform Engine. diff --git a/beedk-ate-springboot-test/pom.xml b/beedk-ate-springboot-test/pom.xml new file mode 100644 index 0000000..6d69566 --- /dev/null +++ b/beedk-ate-springboot-test/pom.xml @@ -0,0 +1,81 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-ate-springboot-test + 1.0-SNAPSHOT + pom + + Order of the Bee Development Kit: ATE Spring Boot Test + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + 2.3.6 + 2.3.5.RELEASE + + + + + org.alfresco + alfresco-transformer-base + ${alfresco.transform-base.version} + tests + test-jar + + + org.springframework.boot + spring-boot-starter-test + ${spring-boot.version} + + + com.vaadin.external.google + android-json + + + + + + + + + alfresco-public + https://artifacts.alfresco.com/nexus/content/groups/public + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-ate-springboot-tile/.gitignore b/beedk-ate-springboot-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-ate-springboot-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-ate-springboot-tile/README.md b/beedk-ate-springboot-tile/README.md new file mode 100644 index 0000000..83e40c6 --- /dev/null +++ b/beedk-ate-springboot-tile/README.md @@ -0,0 +1,63 @@ +# BeeDK Spring Boot Alfresco Transform Engine Maven Tile + +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 any ATE implemented using the Alfresco Transform Base, which is based on Spring Boot. + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-ate-springboot-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +## 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 | +| --------------------- |:--------:| ------- | ----------- | +| `spring-boot.version` | | 2.4.3 | For a list of versions and more details, see the [Spring Boot Project](https://spring.io/projects/spring-boot).
You could use a different Spring Boot version for building your application. This one is only for repackaging it with all dependencies. | + +## Results + +The Spring Boot project will be repackaged during the `package` phase so all dependencies are consolidated into a single JAR file. + +## Initialization + +This tile comes with the ability to initialize your project with the required file(s) of a Spring Boot ATE. You can do this by executing any Maven build with the `scaffold` property. + +```sh +mvn -Dscaffold generate-sources +``` diff --git a/beedk-ate-springboot-tile/pom.xml b/beedk-ate-springboot-tile/pom.xml new file mode 100644 index 0000000..2deff30 --- /dev/null +++ b/beedk-ate-springboot-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-ate-springboot-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: ATE Spring Boot + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-ate-springboot-tile/tile.xml b/beedk-ate-springboot-tile/tile.xml new file mode 100644 index 0000000..67f47aa --- /dev/null +++ b/beedk-ate-springboot-tile/tile.xml @@ -0,0 +1,131 @@ + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + filter-default-resources + generate-resources + + add-resource + + + + + src/main/resources + true + + + + + + filter-default-test-resources + generate-test-resources + + add-test-resource + + + + + src/test/resources + true + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + repackage + package + + repackage + + + + + + + + + + scaffold-ate-springboot + + + scaffold + + + + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.1 + + + + + download-application-default + generate-sources + + wget + + + https://raw.githubusercontent.com/Alfresco/alfresco-transform-core/master/alfresco-transform-misc/alfresco-transform-misc-boot/src/main/resources/application-default.yaml + ${basedir}/src/main/resources + + + + download-engine-config + generate-sources + + wget + + + https://raw.githubusercontent.com/Alfresco/alfresco-transform-core/master/alfresco-transformer-base/src/main/resources/engine_config.json + ${basedir}/src/main/resources + + + + download-transform-form + generate-sources + + wget + + + https://raw.githubusercontent.com/Alfresco/alfresco-transform-core/master/alfresco-transform-misc/alfresco-transform-misc-boot/src/main/resources/templates/transformForm.html + ${basedir}/src/main/resources/templates + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + 2.4.3 + + + + + diff --git a/beedk-ate-springboot/.gitignore b/beedk-ate-springboot/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-ate-springboot/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-ate-springboot/README.md b/beedk-ate-springboot/README.md new file mode 100644 index 0000000..665adff --- /dev/null +++ b/beedk-ate-springboot/README.md @@ -0,0 +1,44 @@ +# BeeDK Spring Boot Alfresco Transform Engine Maven Composite POM + +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 Composite POM that provides the basis for any ATE implemented using the Alfresco Transform Base, which is based on Spring Boot. This includes libraries that cover ACS integration through both the Alfresco Local Transform Service (HTTP) and the Alfresco Transform Service (MQ & Shared File Store). + +## Usage + +To use this plugin, just reference it with the standard Maven dependencies as shown in the following snippet. + +```xml + + ... + + ... + + com.inteligr8.ootbee + beedk-ate-springboot + [1.0.0,1.1.0) + pom + + ... + + ... + +``` + +## Configuration + +In your Maven project, set the following properties to define the behavior of this Maven Composite POM. + +### Public API + +The following properties are exposed by this Maven Composite POM. + +| Maven Property | Required | Default | Description | +| --------------------------------- |:--------:| --------------- | ----------- | +| `alfresco.transform-base.version` | | *not important* | For a list of versions and more details, see the [Alfresco Transform project](https://github.com/Alfresco/alfresco-transform-core). | + +## Results + +The Spring Boot project will be have all the dependencies required for the quick development of an Alfresco Transform Engine. diff --git a/beedk-ate-springboot/pom.xml b/beedk-ate-springboot/pom.xml new file mode 100644 index 0000000..0fc04ff --- /dev/null +++ b/beedk-ate-springboot/pom.xml @@ -0,0 +1,67 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-ate-springboot + 1.0-SNAPSHOT + pom + + Order of the Bee Development Kit: ATE Spring Boot + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + 2.3.6 + + + + + org.alfresco + alfresco-transformer-base + ${alfresco.transform-base.version} + + + + + + + alfresco-public + https://artifacts.alfresco.com/nexus/content/groups/public + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-ats-it-tile/.gitignore b/beedk-ats-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-ats-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-ats-it-tile/README.md b/beedk-ats-it-tile/README.md new file mode 100644 index 0000000..71272b0 --- /dev/null +++ b/beedk-ats-it-tile/README.md @@ -0,0 +1,79 @@ +# BeeDK ATS 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 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + com.inteligr8.ootbee:beedk-acs--tile:[1.0.0,2.0.0) + + com.inteligr8.ootbee:beedk-ats-it-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +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). | +| `alfresco-transform-router.version` | | *not important* | The version of the [Alfresco Transform Router Docker Image](https://quay.io/repository/alfresco/alfresco-transform-router?tab=tags). | +| `alfresco.sfs.version` | | *not important* | The version of the [Alfresco Shared File Store Engine Docker Image](https://quay.io/repository/alfresco/alfresco-shared-file-store?tab=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 Alfresco Transform Service components 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.ats.enabled` | Boolean | *At startup* | `true`, which signals other Maven Tiles | diff --git a/beedk-ats-it-tile/pom.xml b/beedk-ats-it-tile/pom.xml new file mode 100644 index 0000000..9b6e513 --- /dev/null +++ b/beedk-ats-it-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-ats-it-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Integration Testing for ATS + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-ats-it-tile/tile.xml b/beedk-ats-it-tile/tile.xml new file mode 100644 index 0000000..ca806e2 --- /dev/null +++ b/beedk-ats-it-tile/tile.xml @@ -0,0 +1,121 @@ + + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + start-ats + pre-integration-test + start + + + + alfresco/alfresco-transform-core-aio:${alfresco.transform-aio.version} + ate-aio + + ${skipTests} + + nio://${project.artifactId}-acs-mq:61616 + http://${project.artifactId}-ats-sfs:8099/alfresco/api/-default-/private/sfs/versions/1/file + + + custom + ${project.artifactId} + + + + + quay.io/alfresco/alfresco-transform-router:${alfresco.transform-router.version} + ats-atr + + ${skipTests} + + nio://${project.artifactId}-acs-mq:61616 + http://${project.artifactId}-ats-sfs:8099/alfresco/api/-default-/private/sfs/versions/1/file + http://${project.artifactId}-ate-aio:8090 + + + custom + ${project.artifactId} + + + + + quay.io/alfresco/alfresco-shared-file-store:${alfresco.sfs.version} + ats-sfs + + custom + ${project.artifactId} + + + ${skipTests} + + + ${project.build.directory}/sfs:/tmp/Alfresco/sfs:rw + + + + + + + + + stop-ats + post-integration-test + stop + + + + alfresco/alfresco-transform-core-aio:${alfresco.transform-aio.version} + ate-aio + + + alfresco/alfresco-transform-router:${alfresco.transform-router.version} + ats-atr + + + alfresco/alfresco-shared-file-store:${alfresco.sfs.version} + ats-sfs + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + 2.3.6 + 1.3.1 + 0.10.0 + + + true + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-ats-rad-tile/.gitignore b/beedk-ats-rad-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-ats-rad-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-ats-rad-tile/README.md b/beedk-ats-rad-tile/README.md new file mode 100644 index 0000000..638ca87 --- /dev/null +++ b/beedk-ats-rad-tile/README.md @@ -0,0 +1,81 @@ +# BeeDK ATS 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 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + com.inteligr8.ootbee:beedk-acs-platform--rad-tile:[1.0.0,2.0.0) + + com.inteligr8.ootbee:beedk-ats-rad-tile:[1.0.0,2.0.0) + ... + + + + ... + + ... + + ... + +``` + +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` | | 8090 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `alfresco.transform-router.port` | | 8095 | 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). | +| `alfresco.transform-router.version` | | *not important* | The version of the [Alfresco Transform Router Docker Image](https://quay.io/repository/alfresco/alfresco-transform-router?tab=tags). | +| `alfresco.sfs.version` | | *not important* | The version of the [Alfresco Shared File Store Engine Docker Image](https://quay.io/repository/alfresco/alfresco-shared-file-store?tab=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 Alfresco Transform Service components 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.ats.enabled` | Boolean | *At startup* | `true`, which signals other Maven Tiles | diff --git a/beedk-ats-rad-tile/pom.xml b/beedk-ats-rad-tile/pom.xml new file mode 100644 index 0000000..0e3cf2b --- /dev/null +++ b/beedk-ats-rad-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-ats-rad-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: RAD for ATS + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-ats-rad-tile/tile.xml b/beedk-ats-rad-tile/tile.xml new file mode 100644 index 0000000..a94ade1 --- /dev/null +++ b/beedk-ats-rad-tile/tile.xml @@ -0,0 +1,114 @@ + + + + + + rad-ats + + + rad + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + + run-ats + process-classes + start + + + + alfresco/alfresco-transform-core-aio:${alfresco.transform-aio.version} + ate-aio + + + nio://${project.artifactId}-acs-mq:61616 + http://${project.artifactId}-ats-sfs:8099/alfresco/api/-default-/private/sfs/versions/1/file + + + ${alfresco.transform-aio.port}:8090 + + + custom + ${project.artifactId} + + + + + quay.io/alfresco/alfresco-transform-router:${alfresco.transform-router.version} + ats-atr + + + nio://${project.artifactId}-acs-mq:61616 + http://${project.artifactId}-ats-sfs:8099/alfresco/api/-default-/private/sfs/versions/1/file + http://${project.artifactId}-ate-aio:8090 + + + ${alfresco.transform-router.port}:8095 + + + custom + ${project.artifactId} + + + + + quay.io/alfresco/alfresco-shared-file-store:${alfresco.sfs.version} + ats-sfs + + custom + ${project.artifactId} + + + + + ${project.build.directory}/sfs:/tmp/Alfresco/sfs:rw + + + + + + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + 8090 + 8095 + + + 2.3.6 + 1.3.1 + 0.10.0 + + + true + + + + + + + com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT + + + diff --git a/beedk-run-tile/.gitignore b/beedk-run-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-run-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-run-tile/README.md b/beedk-run-tile/README.md new file mode 100644 index 0000000..4f6671f --- /dev/null +++ b/beedk-run-tile/README.md @@ -0,0 +1,58 @@ +# BeeDK Alfresco Core Run 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 rapid application development and integration testing any Alfresco 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-run-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## Configuration + +In your Maven project, set the following properties to define the behavior of this Maven Tile. + +### Public API + +There are no properties that are intended to be exposed by inheriting Public API Maven Tiles. + +### Private API + +The following properties are only intended to be defined by BeeDK components. + +| Maven Property | Required | Default | Description | +| -------------------------------------- |:--------:| ----------------- | ----------- | +| `beedk.plugins.fabric8.docker.version` | | *not important* | The version of the [docker-maven-plugin](https://dmp.fabric8.io/) Maven Plugin. | + +## Results + +The Docker features of the BeeDK will be initialized and configured for all subsequent use cases. These features are used for both integration testing and rapid application development support. diff --git a/beedk-run-tile/pom.xml b/beedk-run-tile/pom.xml new file mode 100644 index 0000000..8fd2a73 --- /dev/null +++ b/beedk-run-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-run-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Testing Core + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-run-tile/tile.xml b/beedk-run-tile/tile.xml new file mode 100644 index 0000000..e3ebda2 --- /dev/null +++ b/beedk-run-tile/tile.xml @@ -0,0 +1,36 @@ + + + + + + + + io.fabric8 + docker-maven-plugin + ${beedk.plugins.fabric8.docker.version} + + ${project.artifactId}-%a + true + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + 0.34.1 + + + + + diff --git a/beedk-springboot-api-archetype/.gitignore b/beedk-springboot-api-archetype/.gitignore new file mode 100644 index 0000000..5de9fc3 --- /dev/null +++ b/beedk-springboot-api-archetype/.gitignore @@ -0,0 +1,9 @@ +# Maven +/target +pom.xml.versionsBackup + +# Eclipse +.settings +.project +.classpath + diff --git a/beedk-springboot-api-archetype/pom.xml b/beedk-springboot-api-archetype/pom.xml new file mode 100644 index 0000000..b31b43e --- /dev/null +++ b/beedk-springboot-api-archetype/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + + com.inteligr8.ootbee + beedk-springboot-api-archetype + 1.0-SNAPSHOT + maven-archetype + + Order of the Bee Development Kit: Project Scaffolding for a Spring Boot application using ACS/API remote APIs + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + utf-8 + + + + + + org.apache.maven.archetype + archetype-packaging + 3.1.1 + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + diff --git a/beedk-springboot-api-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/beedk-springboot-api-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 0000000..aada40f --- /dev/null +++ b/beedk-springboot-api-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,37 @@ + + + + [A-Za-z0-9]+ + + + quay.io + + + local + + + + + src/main/java + + **/* + + + + src/test/java + + **/* + + + + src + + main/java/**/* + test/java/**/* + + + + \ No newline at end of file diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/.gitignore b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/.gitignore new file mode 100644 index 0000000..5de9fc3 --- /dev/null +++ b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/.gitignore @@ -0,0 +1,9 @@ +# Maven +/target +pom.xml.versionsBackup + +# Eclipse +.settings +.project +.classpath + diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/pom.xml b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 0000000..a48698a --- /dev/null +++ b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + + ${groupId} + ${artifactId} + ${version} + jar + + ${shortname} + + + UTF-8 + 11 + 5.0.0 + + + community + 6.2.0-ga + + + ${dockerRegistryHost} + ${dockerImagePrefix}/${project.artifactId} + ${project.version} + + + + + + org.alfresco + alfresco-java-rest-api-spring-boot-starter + ${alfresco.sdk.version} + + + + org.alfresco + alfresco-java-event-api-spring-boot-starter + ${alfresco.sdk.version} + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + + com.inteligr8.ootbee:beedk-acs-platform-artifact-rad-tile:${beedkVersion} + + com.inteligr8.ootbee:beedk-springboot-docker-tile:${beedkVersion} + + + + + + + + + inteligr8-releases + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + alfresco-public + https://artifacts.alfresco.com/nexus/content/groups/public + + + + + + inteligr8-releases + http://repos.inteligr8.com/nexus/repository/inteligr8-public + + + \ No newline at end of file diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile new file mode 100644 index 0000000..b2b4625 --- /dev/null +++ b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile @@ -0,0 +1,26 @@ + +FROM docker.inteligr8.com/inteligr8/ubuntu-jdk:20.04-11 + +# Set default user information +ARG JAR_FILE=target/${env.project_artifactId}-${env.project_version}.jar +ARG APPGROUPNAME=alfresco +ARG APPGROUPID=1000 +ARG APPUSERNAME=atengine +ARG APPUSERID=33001 + +ENV JAVA_OPTS="-Xmx128m" +ENV JAR_PATH=/usr/local/bin/${env.project_artifactId}-${env.project_version}.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} + +USER ${APPUSERNAME} + +ENTRYPOINT java ${JAVA_OPTS} -jar ${JAR_PATH} diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/java/Application.java b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/java/Application.java new file mode 100644 index 0000000..7db5222 --- /dev/null +++ b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/java/Application.java @@ -0,0 +1,41 @@ +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 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"); + } +} diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-context.xml b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-context.xml new file mode 100644 index 0000000..863c2e5 --- /dev/null +++ b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-context.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-default.yaml b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-default.yaml new file mode 100644 index 0000000..ed608e8 --- /dev/null +++ b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-default.yaml @@ -0,0 +1,5 @@ +#set( $dollar = '$' ) + +logging: + level: + ${groupId}: ${dollar}{LOG_LEVEL:info} diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/HttpRequestIT.java b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/HttpRequestIT.java new file mode 100644 index 0000000..7bf7fc7 --- /dev/null +++ b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/HttpRequestIT.java @@ -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 . + * #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 inputs = new HashSet(); + 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 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 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 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 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 _testService(String filename, String targetExtension) { + LinkedMultiValueMap 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> entity = new HttpEntity<>(parameters, headers); + return this.restTemplate.postForEntity(this.baseUrl + "/transform", entity, String.class); + } + +} diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/TransformerControllerTest.java b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/TransformerControllerTest.java new file mode 100644 index 0000000..995c3cf --- /dev/null +++ b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/TransformerControllerTest.java @@ -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() { + + } +} diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/resources/application-default.yaml b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/resources/application-default.yaml new file mode 100644 index 0000000..316190d --- /dev/null +++ b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/resources/application-default.yaml @@ -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} diff --git a/beedk-springboot-docker-base-tile/.gitignore b/beedk-springboot-docker-base-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-springboot-docker-base-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-springboot-docker-base-tile/README.md b/beedk-springboot-docker-base-tile/README.md new file mode 100644 index 0000000..43d029d --- /dev/null +++ b/beedk-springboot-docker-base-tile/README.md @@ -0,0 +1,58 @@ +# BeeDK Docker Spring Boot 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 Spring Boot application that is delivered as a Docker Image. + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-springboot-docker-base-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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 | +| ------------------------------ |:--------:| ------------------ | ----------- | +| `docker.source.directory` | | `src/main/docker` | The source directory of the `Dockerfile` and related resources. | +| `beedk.deploy.dockerImageOnly` | | true | Set to `true` to skip the Maven `deploy` of the Spring Boot application; `false` to deploy it to the configured Maven Repository. Regardless, the Docker Image will be deployed to the configured Docker Registry. | +| `docker.image.registry` | **Yes** | | The Docker Registry where to push the built Docker Image. If none is specified, Docker pushes to the [Docker Hub](https://hub.docker.com). | +| `docker.image.name` | **Yes** | | The Docker Image name. You typically want to pattern it as `prefix/${project.artifactId}`. | +| `docker.image.tag` | | *Project Version* | The Docker Image tag or label. This will default to the Maven project version. | + +## Results + +A Docker image will be built using your local Docker installation during the `package` phase. It will be tagged both with and without the configured Docker Registry. During the `deploy` phase, the Docker image will be pushed to the configured Docker Registry. diff --git a/beedk-springboot-docker-base-tile/pom.xml b/beedk-springboot-docker-base-tile/pom.xml new file mode 100644 index 0000000..7a0a559 --- /dev/null +++ b/beedk-springboot-docker-base-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-springboot-docker-base-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Spring Boot Docker Enablement Base + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-springboot-docker-base-tile/tile.xml b/beedk-springboot-docker-base-tile/tile.xml new file mode 100644 index 0000000..48a19a3 --- /dev/null +++ b/beedk-springboot-docker-base-tile/tile.xml @@ -0,0 +1,89 @@ + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + copy-and-filter-docker-resources + generate-resources + + add-resource + + + + + ${docker.source.directory} + true + ${project.build.directory} + + + + + + + + + com.spotify + dockerfile-maven-plugin + 1.4.13 + + ${project.build.directory} + ${docker.image.registry}/${docker.image.name} + ${docker.image.tag} + true + + ${project.artifactId}-${project.version}.jar + + + + + docker-build + package + build + + ${docker.image.name} + + + + docker-tag-registry + install + tag + + + docker-push + deploy + push + + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + true + ${beedk.deploy.dockerImageOnly} + ${basedir}/src/main/docker + ${project.version} + + + + + diff --git a/beedk-springboot-docker-tile/.gitignore b/beedk-springboot-docker-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-springboot-docker-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-springboot-docker-tile/Dockerfile b/beedk-springboot-docker-tile/Dockerfile new file mode 100644 index 0000000..b2b4625 --- /dev/null +++ b/beedk-springboot-docker-tile/Dockerfile @@ -0,0 +1,26 @@ + +FROM docker.inteligr8.com/inteligr8/ubuntu-jdk:20.04-11 + +# Set default user information +ARG JAR_FILE=target/${env.project_artifactId}-${env.project_version}.jar +ARG APPGROUPNAME=alfresco +ARG APPGROUPID=1000 +ARG APPUSERNAME=atengine +ARG APPUSERID=33001 + +ENV JAVA_OPTS="-Xmx128m" +ENV JAR_PATH=/usr/local/bin/${env.project_artifactId}-${env.project_version}.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} + +USER ${APPUSERNAME} + +ENTRYPOINT java ${JAVA_OPTS} -jar ${JAR_PATH} diff --git a/beedk-springboot-docker-tile/README.md b/beedk-springboot-docker-tile/README.md new file mode 100644 index 0000000..767dd53 --- /dev/null +++ b/beedk-springboot-docker-tile/README.md @@ -0,0 +1,66 @@ +# BeeDK Docker Spring Boot Maven Tile + +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 any Spring Boot application that is delivered as a Docker Image. + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-springboot-docker-tile:[1.0.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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 | +| ------------------------------ |:--------:| ------------------ | ----------- | +| `docker.source.directory` | | `src/main/docker` | The source directory of the `Dockerfile` and related resources.
*Inherited from [`beedk-springboot-docker-base-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-springboot-docker-base-tile)* | +| `beedk.deploy.dockerImageOnly` | | true | Set to `true` to skip the Maven `deploy` of the Spring Boot application; `false` to deploy it to the configured Maven Repository. Regardless, the Docker Image will be deployed to the configured Docker Registry.
*Inherited from [`beedk-springboot-docker-base-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-springboot-docker-base-tile)* | +| `docker.image.registry` | **Yes** | | The Docker Registry where to push the built Docker Image. If none is specified, Docker pushes to the [Docker Hub](https://hub.docker.com).
*Inherited from [`beedk-springboot-docker-base-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-springboot-docker-base-tile)* | +| `docker.image.name` | **Yes** | | The Docker Image name. You typically want to pattern it as `prefix/${project.artifactId}`.
*Inherited from [`beedk-springboot-docker-base-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-springboot-docker-base-tile)* | +| `docker.image.tag` | | *Project Version* | The Docker Image tag or label. This will default to the Maven project version.
*Inherited from [`beedk-springboot-docker-base-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-springboot-docker-base-tile)* | + +## Results + +A Docker image will be built using your local Docker installation during the `package` phase. It will be tagged both with and without the configured Docker Registry. During the `deploy` phase, the Docker image will be pushed to the configured Docker Registry. + +## Initialization + +This tile comes with the ability to initialize your project with a sample file of a Docker Spring Boot application. You can do this by executing any Maven build with the `scaffold` property. + +```sh +mvn -Dscaffold generate-sources +``` diff --git a/beedk-springboot-docker-tile/pom.xml b/beedk-springboot-docker-tile/pom.xml new file mode 100644 index 0000000..b39375f --- /dev/null +++ b/beedk-springboot-docker-tile/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-springboot-docker-tile + 1.0-SNAPSHOT + tile + + Order of the Bee Development Kit: Spring Boot Docker Enablement + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + 2.20 + true + + + com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0) + + + + + + + diff --git a/beedk-springboot-docker-tile/tile.xml b/beedk-springboot-docker-tile/tile.xml new file mode 100644 index 0000000..bdd8560 --- /dev/null +++ b/beedk-springboot-docker-tile/tile.xml @@ -0,0 +1,46 @@ + + + + + + scaffold-springboot-docker + + + scaffold + + + + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.1 + + + + download-dockerfile + generate-sources + + wget + + + https://bitbucket.org/inteligr8/ootbee-beedk/raw/stable/beedk-springboot-docker-tile/Dockerfile + ${basedir}/src/main/docker + + + + + + + + + + + + com.inteligr8.ootbee:beedk-springboot-docker-base-tile:1.0-SNAPSHOT + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..591f689 --- /dev/null +++ b/pom.xml @@ -0,0 +1,85 @@ + + + + 4.0.0 + + com.inteligr8.ootbee + beedk-parent + 1.0-SNAPSHOT + pom + + Bee Development Kit + An alternative development kit for products of interest to the Order of the Bee + + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + beedk-amp-check-tile + + beedk-acs-webapp-artifact-tile + beedk-acs-webapp-artifact-build-tile + beedk-acs-webapp-artifact-it-tile + beedk-acs-webapp-artifact-rad-tile + + beedk-run-tile + + beedk-acs-search-rad-tile + beedk-acs-lts-rad-tile + beedk-ats-rad-tile + beedk-acs-platform-rad-tile + beedk-acs-platform-self-rad-tile + beedk-acs-platform-sibling-rad-tile + beedk-acs-platform-artifact-rad-tile + beedk-acs-share-self-rad-tile + beedk-ate-self-rad-tile + beedk-ate-sibling-rad-tile + + beedk-acs-search-it-tile + beedk-acs-lts-it-tile + beedk-ats-it-tile + beedk-acs-platform-it-tile + beedk-acs-platform-self-it-tile + beedk-acs-platform-sibling-it-tile + beedk-acs-platform-artifact-it-tile + beedk-acs-share-self-it-tile + beedk-ate-it-tile + + beedk-acs-module-tile + beedk-acs-platform-module-tile + beedk-acs-share-module-tile + + beedk-acs-platform-webapp-tile + beedk-acs-share-webapp-tile + + beedk-ate-springboot + beedk-ate-springboot-test + beedk-ate-springboot-tile + + beedk-springboot-docker-base-tile + beedk-springboot-docker-tile + beedk-ate-docker-tile + + beedk-acs-platform-module-archetype + beedk-acs-share-module-archetype + beedk-ate-archetype + beedk-acs-allinone-archetype + beedk-springboot-api-archetype + + +