Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiko Robert committed Nov 7, 2023
2 parents e798227 + d5e86da commit 218ff2f
Show file tree
Hide file tree
Showing 91 changed files with 4,904 additions and 1,363 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Java CI

on:
push:
paths-ignore:
- 'grafana/**'
- 'images/**'
- '*.md'
- '**/*.md'
- '*.sh'
- '**/*.sh'
- '*.bat'
- '**/*.bat'
branches:
- '*'
tags:
- '*'
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,4 @@ Maintainers:
- [Axel Faust](https://github.com/AFaust), Acosix / Order of the Bee
- [Bindu Wavell](https://github.com/binduwavell), Zia / Order of the Bee
- [Younes Regaieg](https://github.com/yregaieg), Order of the Bee
- [Robrecht Vanhuysse](https://github.com/RVanhuysseXenit), Xenit Solutions nv / Order of the Bee
51 changes: 49 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.orderofthebee.support-tools</groupId>
<artifactId>support-tools-parent</artifactId>
<version>1.2.0.0-SNAPSHOT</version>
<version>1.2.1.0</version>
<packaging>pom</packaging>

<name>OOTBee Support Tools - Parent</name>
Expand Down Expand Up @@ -101,9 +101,19 @@
<alfresco.bomDependencyArtifactId>acs-community-packaging</alfresco.bomDependencyArtifactId>
<alfresco.platform.version>6.1.2-ga</alfresco.platform.version>
<alfresco.share.version>6.1.0</alfresco.share.version>

<alfresco.search.version>1.2.0</alfresco.search.version>

<!-- baseline versions -->
<alfresco.slf4j.version>1.7.25</alfresco.slf4j.version>
<alfresco74.log4j2.version>2.19.0</alfresco74.log4j2.version>

<alfresco.docker.platform.version>${alfresco.platform.version}</alfresco.docker.platform.version>
<alfresco.docker.share.version>${alfresco.share.version}</alfresco.docker.share.version>
<docker.acs.image>alfresco/alfresco-content-repository-community</docker.acs.image>
<docker.acs.dockerfile>Dockerfile</docker.acs.dockerfile>
<docker.acs.opts></docker.acs.opts>
<docker.share.image>alfresco/alfresco-share</docker.share.image>
<docker.search.opts></docker.search.opts>

<acs.port>8080</acs.port>
<acs.debug.port>8888</acs.debug.port>
Expand Down Expand Up @@ -201,6 +211,20 @@
<classifier>classes</classifier>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${alfresco.slf4j.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${alfresco74.log4j2.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -655,5 +679,28 @@
</plugins>
</build>
</profile>
<profile>
<id>acs-docker-7.4</id>

<properties>
<alfresco.docker.platform.version>7.4.1</alfresco.docker.platform.version>
<alfresco.docker.share.version>7.4.1</alfresco.docker.share.version>
<docker.acs.dockerfile>DockerfileWithBuildUser</docker.acs.dockerfile>
<docker.acs.opts>-Dencryption.keystore.type=JCEKS -Dencryption.cipherAlgorithm=DESede/CBC/PKCS5Padding -Dencryption.keyAlgorithm=DESede -Dencryption.keystore.location=/usr/local/tomcat/shared/classes/alfresco/extension/keystore/keystore -Dmetadata-keystore.password=mp6yc0UD9e -Dmetadata-keystore.aliases=metadata -Dmetadata-keystore.metadata.password=oKIWzVdEdA -Dmetadata-keystore.metadata.algorithm=DESede -Dsolr.secureComms=secret -Dsolr.sharedSecret=secret -Dalfresco.restApi.basicAuthScheme=true</docker.acs.opts>
<alfresco.search.version>2.0.7</alfresco.search.version>
<docker.search.opts>-Dalfresco.secureComms=secret -Dalfresco.secureComms.secret=secret</docker.search.opts>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
<version>5.17.4</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</dependencyManagement>
</profile>
</profiles>
</project>
24 changes: 22 additions & 2 deletions repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.orderofthebee.support-tools</groupId>
<artifactId>support-tools-parent</artifactId>
<version>1.2.0.0-SNAPSHOT</version>
<version>1.2.1.0</version>
</parent>

<artifactId>support-tools-repo</artifactId>
Expand Down Expand Up @@ -104,7 +104,13 @@
<groupId>net.time4j</groupId>
<artifactId>time4j-i18n</artifactId>
<version>3.50</version>
</dependency>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -184,4 +190,18 @@
</plugins>
</build>

<profiles>
<profile>
<id>acs-docker-7.4</id>

<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
<version>5.17.4</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
4 changes: 2 additions & 2 deletions repository/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ${docker.acs.image}:${alfresco.platform.version}
FROM ${docker.acs.image}:${alfresco.docker.platform.version}

ARG TOMCAT_DIR=/usr/local/tomcat

Expand All @@ -11,4 +11,4 @@ RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \
$TOMCAT_DIR/amps $TOMCAT_DIR/webapps/alfresco -directory -nobackup -force

COPY alfresco-global.properties $TOMCAT_DIR/shared/classes/alfresco-global.properties
COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension
COPY dev-log4j*.properties $TOMCAT_DIR/shared/classes/alfresco/extension
20 changes: 20 additions & 0 deletions repository/src/main/docker/DockerfileWithBuildUser
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ${docker.acs.image}:${alfresco.docker.platform.version}

ARG TOMCAT_DIR=/usr/local/tomcat
ARG USERNAME=alfresco
ARG GROUPNAME=Alfresco

USER root

# Copy Dockerfile to avoid an error if no JARs exist
COPY Dockerfile extensions/*.jar $TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/

# Copy Dockerfile to avoid an error if no AMPs exist
COPY Dockerfile extensions/*.amp $TOMCAT_DIR/amps/
RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \
$TOMCAT_DIR/amps $TOMCAT_DIR/webapps/alfresco -directory -nobackup -force

COPY alfresco-global.properties $TOMCAT_DIR/shared/classes/alfresco-global.properties
COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension

USER ${USERNAME}
2 changes: 2 additions & 0 deletions repository/src/main/docker/dev-log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
logger.ootbee-support-tools.name=${basePackage}
logger.ootbee-support-tools.level=DEBUG
6 changes: 4 additions & 2 deletions repository/src/main/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ services:
support-tools-repo-acs:
image: alfresco-content-services-support-tools-repo:development
build:
dockerfile: ./Dockerfile
dockerfile: ./${docker.acs.dockerfile}
context: .
environment:
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888"
JAVA_TOOL_OPTIONS: "${docker.acs.opts}"
ports:
- ${acs.port}:8080
- ${acs.debug.port}:8888
Expand Down Expand Up @@ -36,13 +37,14 @@ services:
- support-tools-repo-db-volume:/var/lib/postgresql/data

support-tools-repo-ass:
image: alfresco/alfresco-search-services:1.2.0
image: alfresco/alfresco-search-services:${alfresco.search.version}
environment:
SOLR_ALFRESCO_HOST: acs
SOLR_ALFRESCO_PORT: 8080
SOLR_SOLR_HOST: ass
SOLR_SOLR_PORT: 8983
SOLR_CREATE_ALFRESCO_DEFAULTS: alfresco,archive
JAVA_TOOL_OPTIONS: "${docker.search.opts}"
ports:
- 8983:8983
networks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.util.List;
import java.util.Map;

import org.alfresco.model.ContentModel;
import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.jscript.RhinoScriptProcessor;
Expand All @@ -53,6 +54,8 @@
import org.alfresco.repo.security.permissions.AccessDeniedException;
import org.alfresco.scripts.ScriptResourceHelper;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.MD5;
import org.alfresco.util.Pair;
Expand Down Expand Up @@ -91,6 +94,10 @@ public class ExecuteWebscript extends AbstractWebScript

private TransactionService transactionService;

private NodeService nodeService;

private PermissionService permissionService;

private String postRollScript = "";

private org.alfresco.service.cmr.repository.ScriptProcessor jsProcessor;
Expand Down Expand Up @@ -443,10 +450,12 @@ private JavascriptConsoleResult executeScriptContent(final WebScriptRequest req,
}

final ScriptNode newSpace = javascriptConsole.getSpace();
output.setSpaceNodeRef(newSpace.getNodeRef().toString());
final NodeRef newSpaceRef = newSpace.getNodeRef();
output.setSpaceNodeRef(newSpaceRef.toString());
try
{
output.setSpacePath(newSpace.getDisplayPath() + "/" + newSpace.getName());
output.setSpacePath(this.nodeService.getPath(newSpaceRef).toDisplayPath(this.nodeService, this.permissionService) + "/"
+ this.nodeService.getProperty(newSpaceRef, ContentModel.PROP_NAME));
}
catch (final AccessDeniedException ade)
{
Expand Down Expand Up @@ -562,6 +571,16 @@ public void setTransactionService(final TransactionService transactionService)
this.transactionService = transactionService;
}

public void setNodeService(final NodeService nodeService)
{
this.nodeService = nodeService;
}

public void setPermissionService(final PermissionService permissionService)
{
this.permissionService = permissionService;
}

public void setJsProcessor(final org.alfresco.service.cmr.repository.ScriptProcessor jsProcessor)
{
this.jsProcessor = jsProcessor;
Expand Down
Loading

0 comments on commit 218ff2f

Please sign in to comment.