Skip to content

Commit

Permalink
ALFREDAPI-548 [test] first draft to support alfresco V7 & 23
Browse files Browse the repository at this point in the history
  * apix-impl changed the javax library to non-javax library dependencies
  * apix-rest-v1 has to be split up into
       * core
       * javax/jakarta specific classes
  • Loading branch information
codingBenVdS committed May 10, 2024
1 parent b727159 commit f9fa1a3
Show file tree
Hide file tree
Showing 110 changed files with 206 additions and 57 deletions.
8 changes: 8 additions & 0 deletions alfresco/231/overrides.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description = "Xenit Alfred API implementation Alfresco 23.1"

ext {
alfresco_version = '23.1.0'
alfresco_min_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".0"
//Not setting alfresco_max_version here to make it easier to test on next Alfresco version (only for latest version)
alfresco_max_version = null // explicit null to overwrite properties from other projects
}
8 changes: 8 additions & 0 deletions alfresco/232/overrides.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description = "Xenit Alfred API implementation Alfresco 23.1"

ext {
alfresco_version = '23.2.0'
alfresco_min_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".0"
//Not setting alfresco_max_version here to make it easier to test on next Alfresco version (only for latest version)
alfresco_max_version = null // explicit null to overwrite properties from other projects
}
4 changes: 2 additions & 2 deletions alfresco/70/overrides.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ description = "Xenit Alfred API implementation Alfresco 7.0"

ext {
alfresco_version = "7.0.0"
alfresco_min_version = alfresco_version.substring(0, 3) + ".0"
alfresco_max_version = alfresco_version.substring(0, 3) + ".99"
alfresco_min_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".0"
alfresco_max_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".99"
}
4 changes: 2 additions & 2 deletions alfresco/71/overrides.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ description = "Xenit Alfred API implementation Alfresco 7.1"

ext {
alfresco_version = "7.1.1"
alfresco_min_version = alfresco_version.substring(0, 3) + ".0"
alfresco_max_version = alfresco_version.substring(0, 3) + ".99"
alfresco_min_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".0"
alfresco_max_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".99"
}
4 changes: 2 additions & 2 deletions alfresco/72/overrides.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ description = "Xenit Alfred API implementation Alfresco 7.2"

ext {
alfresco_version = "7.2.1"
alfresco_min_version = alfresco_version.substring(0, 3) + ".0"
alfresco_max_version = alfresco_version.substring(0, 3) + ".99"
alfresco_min_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".0"
alfresco_max_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".99"
}
4 changes: 2 additions & 2 deletions alfresco/73/overrides.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ description = "Xenit Alfred API implementation Alfresco 7.3"

ext {
alfresco_version = '7.3.1'
alfresco_min_version = alfresco_version.substring(0, 3) + ".0"
alfresco_max_version = alfresco_version.substring(0, 3) + ".99"
alfresco_min_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".0"
alfresco_max_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".99"
}
2 changes: 1 addition & 1 deletion alfresco/74/overrides.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description = "Xenit Alfred API implementation Alfresco 7.4"

ext {
alfresco_version = '7.4.0'
alfresco_min_version = alfresco_version.substring(0, 3) + ".0"
alfresco_min_version = alfresco_version.substring(0, getSecondDotPosition(alfresco_version)) + ".0"
//Not setting alfresco_max_version here to make it easier to test on next Alfresco version (only for latest version)
alfresco_max_version = null // explicit null to overwrite properties from other projects
}
4 changes: 2 additions & 2 deletions alfresco/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ subprojects {
it.put("module.id", "alfred-api-${project.name}")
it.put("module.title", "alfred-api-${project.name}")
it.put("module.description",
"Xenit Alfred API implementation Alfresco ${alfresco_version.substring(0, 3)}")
"Xenit Alfred API implementation Alfresco ${alfresco_version.substring(0, getSecondDotPosition(alfresco_version))}")
it.put("module.version", project.version)
it.put("module.repo.version.min", project.alfresco_min_version)
if(project.hasProperty("alfresco_max_version")
Expand All @@ -33,7 +33,7 @@ subprojects {
dependencies {
implementation(project(":apix-impl"))
implementation(project(":apix-impl:apix-impl-${project.name}"))
implementation(project(":apix-rest-v1"))
implementation(project(":apix-rest-v1")) // has to be changed for alfresco 231 & 232
}

publishing {
Expand Down
8 changes: 8 additions & 0 deletions apix-docker/231/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dependencies {
baseAlfrescoWar platform("org.alfresco:acs-packaging:23.1.0")
baseAlfrescoWar 'org.alfresco:content-services@war'
}

dockerAlfresco {
baseImage = 'private.docker.xenit.eu/alfresco-enterprise/alfresco-repository-enterprise:23.1.0'
}
16 changes: 16 additions & 0 deletions apix-docker/231/debug-extension.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '2'
services:
alfresco-core:
ports:
- 8000:8000
environment:
- DEBUG=true
- SHARE_HOST=alfresco-share
alfresco-share:
image: docker.io/xenit/alfresco-share-community:23.1.0
ports:
- 8090:8080
environment:
- DEBUG=true
- ALFRESCO_HOST=alfresco-core
- ALFRESCO_INTERNAL_HOST=alfresco-core
48 changes: 48 additions & 0 deletions apix-docker/231/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: '2'

services:
alfresco-core:
image: ${DOCKER_IMAGE}
ports:
- "${DOCKER_IP}:8080:8080"
volumes:
- alfresco:/opt/alfresco/alf_data
restart: unless-stopped
environment:
- SOLR_HOST=solr
- TERM=xterm
- GLOBAL_messaging.broker.url=failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true
- GLOBAL_localTransform.core-aio.url=http://transform-core-aio:8090/

solr:
image: private.docker.xenit.eu/alfresco-enterprise/alfresco-solr6:2.0.8.2
volumes:
- solr:/opt/alfresco/alf_data
restart: unless-stopped
environment:
- ALFRESCO_HOST=alfresco-core

postgresql:
image: docker.io/xenit/postgres
volumes:
- postgres:/var/lib/postgresql/data
environment:
- POSTGRES_USER=alfresco
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=alfresco
restart: unless-stopped

activemq:
image: alfresco/alfresco-activemq:5.16.1
mem_limit: 1g

transform-core-aio:
image: alfresco/alfresco-transform-core-aio:2.5.0
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"

volumes:
alfresco:
solr:
postgres:
11 changes: 8 additions & 3 deletions apix-docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ subprojects {
}

// Isolate the version number ("docker-52" -> "52"). We should find a cleaner way
def subproject_alfresco_version = project.name.substring(project.name.length() - 2)
// todo: should now work for v 231 & 232
def subproject_alfresco_version = project.name.substring(project.name.length() - getTotalNumbersAfterDash(project.name))

dependencies {
alfrescoAmp project(path: ":alfresco:${subproject_alfresco_version}", configuration: 'ampArtifact')
alfrescoAmp project(path: ':apix-integrationtests:model-amp', configuration: 'ampArchives')
alfrescoSM "com.gradecak.alfresco-mvc:alfresco-mvc-rest:${mvc}"
alfrescoSM "com.gradecak.alfresco-mvc:alfresco-mvc-aop:${mvc}"
alfrescoSM "com.gradecak.alfresco-mvc:alfresco-mvc-rest:${mvc}" // todo change for 231 232
alfrescoSM "com.gradecak.alfresco-mvc:alfresco-mvc-aop:${mvc}"// todo change for 231 232
alfrescoSM files(jar)
alfrescoAmp "eu.xenit:alfresco-dynamic-extensions-repo-${subproject_alfresco_version}:${de_version}@amp"
}
Expand All @@ -32,3 +33,7 @@ subprojects {
}
}
}

def getTotalNumbersAfterDash(String version) {
return version.split("-")[1].length()
}
2 changes: 2 additions & 0 deletions apix-impl/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apply plugin: 'java-library'
dependencies {
api project(":apix-interface")
// todo change this implementation!
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
// implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: '3.0.2' // for JAKARTA!
}
subprojects {
def shortAlfrescoVersion = project.name.split("-")[2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
// To be changed!
import org.springframework.beans.factory.InitializingBean;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.workflow.WorkflowPath;
Expand All @@ -33,8 +34,9 @@
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;


@Service
public class WorkflowServiceActivitiImpl implements IWorkflowService {
public class WorkflowServiceActivitiImpl implements IWorkflowService, InitializingBean {

private final Logger logger = LoggerFactory.getLogger(WorkflowServiceActivitiImpl.class);

Expand All @@ -59,7 +61,12 @@ public class WorkflowServiceActivitiImpl implements IWorkflowService {
@Qualifier("WorkflowService")
private WorkflowService workflowService;

@PostConstruct

@Override
public void afterPropertiesSet() throws Exception {
init();
}

public void init() {
this.apixWfProcQueryConverter = this.activitiQueryConverterFactory.getProcessQueryConverter();
this.apixWfTaskQueryConverter = this.activitiQueryConverterFactory.getTasksQueryConverter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

import eu.xenit.apix.alfresco.workflow.AbstractApixWorkflowConvertor;
import eu.xenit.apix.alfresco.workflow.WorkflowConverterFactory;
import eu.xenit.apix.data.QName;
import eu.xenit.apix.workflow.model.ITaskOrWorkflow;
import eu.xenit.apix.workflow.model.WorkflowOrTaskChanges;
import java.io.Serializable;
import java.util.Map;
import javax.annotation.Resource;
import org.activiti.engine.history.HistoricProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
import eu.xenit.apix.alfresco.workflow.AbstractApixQueryConverter;
import eu.xenit.apix.alfresco.workflow.AbstractApixWorkflowConvertor;
import eu.xenit.apix.alfresco.workflow.WorkflowConverterFactory;
import eu.xenit.apix.data.QName;
import eu.xenit.apix.workflow.model.ITaskOrWorkflow;
import eu.xenit.apix.workflow.model.WorkflowOrTaskChanges;
import eu.xenit.apix.workflow.search.SearchQuery;
import java.io.Serializable;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
import eu.xenit.apix.alfresco.workflow.AbstractApixQueryConverter;
import eu.xenit.apix.alfresco.workflow.AbstractApixWorkflowConvertor;
import eu.xenit.apix.alfresco.workflow.WorkflowConverterFactory;
import eu.xenit.apix.data.QName;
import eu.xenit.apix.workflow.model.ITaskOrWorkflow;
import eu.xenit.apix.workflow.model.WorkflowOrTaskChanges;
import eu.xenit.apix.workflow.search.SearchQuery;
import java.io.Serializable;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,30 @@
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import javax.annotation.Resource;
import org.alfresco.repo.security.permissions.AccessDeniedException;
import org.alfresco.repo.workflow.WorkflowModel;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
import org.alfresco.service.cmr.workflow.WorkflowInstance;
import org.alfresco.service.cmr.workflow.WorkflowPath;
import org.alfresco.service.cmr.workflow.WorkflowService;
import org.alfresco.service.cmr.workflow.WorkflowTask;
import org.alfresco.service.namespace.QName;
import org.apache.commons.lang3.NotImplementedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.transaction.NotSupportedException;

@Component("eu.xenit.apix.alfresco.workflow.alfresco.AlfrescoProcessInstanceWorkflowConvertor")
public class AlfrescoProcessInstanceWorkflowConvertor extends AbstractApixAlfrescoWorkflowConvertor {

private static final Logger logger = LoggerFactory.getLogger(AlfrescoProcessInstanceWorkflowConvertor.class);
private static final Random random = new Random();
@Autowired
protected PersonService personService;
@Resource(name = "eu.xenit.apix.alfresco.workflow.alfresco.AlfrescoWorkflowTaskWorkflowConvertor")
@Qualifier("eu.xenit.apix.alfresco.workflow.alfresco.AlfrescoWorkflowTaskWorkflowConvertor")
protected AbstractApixWorkflowConvertor taskConvertor;

public <T> String getId(T instance) {
Expand Down
Empty file.
7 changes: 4 additions & 3 deletions apix-integrationtests/alfresco/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ allprojects {
}

dependencies {
alfrescoProvided(project(":apix-rest-v1")) { transitive = false }
alfrescoProvided(project(":apix-rest-v1")) { transitive = false } // todo Has to be changed for Alfresco V231 & V232
alfrescoProvided(project(":apix-interface")) { transitive = false }

// Add services used to the integration test fatjar, since we can't access the ones deployed in Alfresco
Expand All @@ -59,8 +59,9 @@ allprojects {
// - nobody knows where it came from
// Ergo, kill it with fire.
// The proper way is a fix of alfresco-remote-testrunner, but until then we use this workaround.
integrationTestImplementationLocal "commons-lang:commons-lang:1.0"

integrationTestImplementationLocal "commons-lang:commons-lang:1.0" // todo from 2005!!! change to commons-lang3!?
// integrationTestImplementationLocal "org.apache.commons:commons-lang3:3.14.0"
// implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0' //todo: change commons to v3?
alfrescoProvided platform("org.alfresco:acs-community-packaging:${alfresco_version}")
alfrescoProvided("org.alfresco:alfresco-repository")
alfrescoProvided('org.alfresco:alfresco-remote-api')
Expand Down
2 changes: 1 addition & 1 deletion apix-interface/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ publishing {
dependencies {
compileOnly "com.fasterxml.jackson.core:jackson-annotations:${jackson_version}"
compileOnly "com.fasterxml.jackson.core:jackson-databind:${jackson_version}"
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

// javax.servlet => jakarta.servlet
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

// javax.servlet => jakarta.servlet
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.springframework.util.StringUtils;

// javax.servlet => jakarta.servlet
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

// javax.servlet => jakarta.servlet
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import java.io.ByteArrayInputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest;

// javax.servlet => jakarta.servlet
import javax.servlet.http.HttpServletRequest;

public class IntermediateRequest extends WebScriptServletRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


import org.springframework.util.Assert;

// javax.servlet => jakarta.servlet
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import java.io.IOException;
Expand Down
Loading

0 comments on commit f9fa1a3

Please sign in to comment.