Skip to content

Commit

Permalink
ALFREDAPI-556 [Update] Changed all other apix references in the code …
Browse files Browse the repository at this point in the history
…besides the URLs

	* Class names
        * Method names
        * Variable names
        * Folder name
  • Loading branch information
codingBenVdS committed Aug 13, 2024
1 parent d160a0a commit fba984d
Show file tree
Hide file tree
Showing 402 changed files with 879 additions and 878 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
ORG_GRADLE_PROJECT_sonatype_password: ${{ secrets.SONATYPE_S01_PASSWORD }}
BRANCH_NAME: ${{ github.ref_name }}
jobs:
apix-interface:
alfred-api-interface:
runs-on: ubuntu-latest
steps:
- name: Check out
Expand All @@ -30,18 +30,18 @@ jobs:
- name: Build interface # Execute before integration testing to catch errors early
uses: gradle/[email protected]
with:
arguments: :apix-interface:build :apix-interface:javadoc
arguments: :alfred-api-interface:build :alfred-api-interface:javadoc
- name: Unit test REST API
uses: gradle/[email protected]
with:
arguments: --info :apix-rest:test
arguments: --info :alfred-api-rest:test
- name: Publish
if: ${{ startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/heads/release') }}"
uses: gradle/[email protected]
with:
arguments: --info -PsigningKeyId=DF8285F0 :apix-interface:publish
arguments: --info -PsigningKeyId=DF8285F0 :alfred-api-interface:publish

apix-impl:
alfred-api-impl:
strategy:
matrix:
alfresco_version: [ 231, 232 ]
Expand All @@ -66,8 +66,8 @@ jobs:
with:
arguments: >-
--info
:apix-impl:apix-impl-${{ matrix.alfresco_version }}:test
:apix-integrationtests-client:alfresco:${{ matrix.alfresco_version }}:integrationTest
:alfred-api-impl:alfred-api-impl-${{ matrix.alfresco_version }}:test
:alfred-api-integrationtests-client:alfresco:${{ matrix.alfresco_version }}:integrationTest
- name: Publish Test Report
uses: mikepenz/[email protected]
if: success() || failure()
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated version file
apix-impl/src/main/java/eu/xenit/alfred/api/Version.java
alfred-api-impl/src/main/java/eu/xenit/alfred/api/Version.java

target/
*.iml
Expand Down
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
From this version onward Dynamic Extensions for integration-testing is replaced by [remote-junit](https://github.com/ruediste/remote-junit)
as framework to reduce maintenance efforts.

A subproject with the name of `apix-integrationtests-server` has been added. (See README)
The artifact name of `apix-integrationtests` has been changed to `apix-integrationtests-client`.
A subproject with the name of `alfred-api-integrationtests-server` has been added. (See README)
The artifact name of `alfred-api-integrationtests` has been changed to `alfred-api-integrationtests-client`.

**Breaking changes:**
* JDK11 --> JDK 17
* Library changes from Javax to Jakarta
* Tomcat V10.1: this comes with a breaking change in the dispatchservlet, blocking the MultiPart handling and blocks double forward slashes
* Fix has to be deployed from your tomcat image. You will have to update your META-INF/context.xml in tomcat. See subproject apix-docker.
* Fix has to be deployed from your tomcat image. You will have to update your META-INF/context.xml in tomcat. See subproject alfred-api-docker.
* Dropped all support for older Alfresco version prior to V23.1 just as alfresco-mvc
* **All package names have been updated from `eu.xenit.apix` to `eu.xenit.alfred.api`.**
* **All class names have been updated from `apix-...` to `alfred.api-...`.**

* [ALFREDAPI-548](https://xenitsupport.jira.com/browse/ALFREDAPI-548): Support Alfresco V23.1 && V23.2, dropping V7.x
* [ALFREDAPI-556](https://xenitsupport.jira.com/browse/ALFREDAPI-556): Change apix package-names to `eu.xenit.alfred.api`.
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ Full documentation can be found at the [project's documentation](https://docs.xe
* Follow our [coding styleguide and other active procedures](https://xenitsupport.jira.com/wiki/spaces/XEN/pages/624558081/XeniT+Enhancement+Proposals+XEP).

### Project structure
* *apix-interface* builds the interface of Alfred API. This part is agnostic of the
* *alfred-api-interface* builds the interface of Alfred API. This part is agnostic of the
Alfresco version used.
* *apix-rest* builds the REST API of Alfred API.
* *apix-impl* builds the Java code for each version of Alfresco.
* *alfred-api-rest* builds the REST API of Alfred API.
* *alfred-api-impl* builds the Java code for each version of Alfresco.
* *alfresco* builds the AMP for each Alfresco version that is the main deliverable for Alfred API. The AMP contains
the JARs of *apix-interface* and *apix-rest*.
the JARs of *alfred-api-interface* and *alfred-api-rest*.
* *alfresco/xx* contains the correct properties for each Alfresco version.
* *apix-integrationtests-client* contains the integration tests for each Alfresco version.
* *apix-integrationtests-server* contains the Remote-JUnit runner for remote class loading.
* *alfred-api-integrationtests-client* contains the integration tests for each Alfresco version.
* *alfred-api-integrationtests-server* contains the Remote-JUnit runner for remote class loading.
* uses java serialization and HTTP for communication.
* We startup a CodeRunnerStandaloneServer, which starts a nanohttpd server, listening on a specific port (4578 by default)
* Using a static appicationContext to reach all necessary beans.
Expand All @@ -59,31 +59,31 @@ Alfresco version used.

The following command starts up all docker containers required for an Alfresco running Alfred API.
```bash
./gradlew :apix-docker:docker-${VERSION}:composeUp --info
./gradlew :alfred-api-docker:docker-${VERSION}:composeUp --info
```
Where `VERSION` is e.g. `231`.


#### Run integration tests
```bash
./gradlew :apix-integrationtests-client:alfresco:${VERSION}:integrationTest
./gradlew :alfred-api-integrationtests-client:alfresco:${VERSION}:integrationTest
```
Again, where `VERSION` is e.g. `231`.

However, this starts (and afterwards stops) docker containers. This includes starting an Alfresco container,
adding a startup time of several minutes. To circumvent this you also run the test on already running containers with
for example:
```bash
./gradlew -x composeUp -x composeDown :apix-integrationtests-client:alfresco:231:integrationTest -Pprotocol=http -Phost=localhost -Pport=8074
./gradlew -x composeUp -x composeDown :alfred-api-integrationtests-client:alfresco:231:integrationTest -Pprotocol=http -Phost=localhost -Pport=8074
```

If you only want to run specific tests, you can specify this on the Gradle invocation with a pattern. For example:
```bash
./gradlew :apix-integrationtests-client:alfresco:231:integrationTest -x composeDown --tests ContentServiceTestJavaApi.TestContentUrlExists
./gradlew :alfred-api-integrationtests-client:alfresco:231:integrationTest -x composeDown --tests ContentServiceTestJavaApi.TestContentUrlExists
```

#### Run integration tests under debugger
1. Debugging settings are already added by `apix-docker/${VERSION}/debug-extension.docker-compose.yml`, including a
1. Debugging settings are already added by `alfred-api-docker/${VERSION}/debug-extension.docker-compose.yml`, including a
portmapping `8000:8000`. This file does not get loaded when running in CI.
2. Prepare your remote debugger in IntelliJ and set breakpoints where you want in your tests
(or Alfred API code).
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions apix-docker/build.gradle → alfred-api-docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ subprojects {
dependencies {
alfrescoAmp project(path: ":alfresco:${subproject_alfresco_version}", configuration: 'ampArtifact')
// Read in the alfresco V 23.x in with alfred-api amps
alfrescoAmp project(path: ":apix-integrationtests-server", configuration: 'amp')
alfrescoAmp project(path: ":alfred-api-integrationtests-server", configuration: 'amp')
// Read in the alfresco integration-test-server
alfrescoAmp project(path: ':apix-integrationtests-client:model-amp', configuration: 'ampArchives')
alfrescoAmp project(path: ':alfred-api-integrationtests-client:model-amp', configuration: 'ampArchives')
// Read the model in for running the integration tests.
alfrescoSM "com.gradecak.alfresco-mvc:alfresco-mvc-rest:${mvc}"
alfrescoSM "com.gradecak.alfresco-mvc:alfresco-mvc-aop:${mvc}"
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions apix-impl/build.gradle → alfred-api-impl/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
subprojects {
apply plugin: 'java-library'

// ::apix-impl cannot be set in allprojects due to circular dependency issues
// ::alfred-api-impl cannot be set in allprojects due to circular dependency issues
dependencies {
api(project(":apix-impl"))
api(project(":alfred-api-impl"))
}

sourceSets {
Expand All @@ -23,15 +23,15 @@ subprojects {

allprojects {
// Subproject of supported Alfresco versions
def subproject_alfresco_version = project.projectDir.name == "apix-impl"
def subproject_alfresco_version = project.projectDir.name == "alfred-api-impl"
? "231" : project.projectDir.name
apply from: "$rootProject.projectDir/alfresco/${subproject_alfresco_version}/overrides.gradle"
// allprojects also applies to shared code (under apix-impl/src) that needs to work in IntelliJ
// allprojects also applies to shared code (under alfred-api-impl/src) that needs to work in IntelliJ
apply plugin: 'eu.xenit.alfresco'
apply plugin: 'java-library'

dependencies {
api project(":apix-interface")
api project(":alfred-api-interface")
implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: '3.0.0'
implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '3.0.0'

Expand Down Expand Up @@ -64,7 +64,7 @@ allprojects {
}

task generateVersionFile(type: Task) {
def versionFile = "${rootDir}/apix-impl/src/main/java/eu/xenit/alfred/api/Version.java"
def versionFile = "${rootDir}/alfred-api-impl/src/main/java/eu/xenit/alfred/api/Version.java"
outputs.file versionFile
doFirst {
file(versionFile).text = """package eu.xenit.alfred.api;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* Components based on Alfresco version are wired in eu.xenit.alfred.api.alfrescoXX.SpringConfiguration (where XX is version)
*/
@Configuration
public class ApixSpringConfiguration {
public class AlfredApiSpringConfiguration {

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

/**
* Properties read from this AMP's 'alfresco-global.properties' file, exposed as a bean by Alfresco.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
import org.springframework.stereotype.Component;


@Component("eu.xenit.alfred.api.alfresco.ApixToAlfrescoConversion")
public class ApixToAlfrescoConversion {
@Component("eu.xenit.alfred.api.alfresco.AlfredApiToAlfrescoConversion")
public class AlfredApiToAlfrescoConversion {

private static final Logger logger = LoggerFactory.getLogger(ApixToAlfrescoConversion.class);
private static final Logger logger = LoggerFactory.getLogger(AlfredApiToAlfrescoConversion.class);
private final String qnameRegex = "^(\\{.+\\}.+)$";
private final Pattern qnamePattern = Pattern.compile(qnameRegex);
private NamespaceService namespaceService;

@Autowired
public ApixToAlfrescoConversion(ServiceRegistry serviceRegistry) {
public AlfredApiToAlfrescoConversion(ServiceRegistry serviceRegistry) {
this.namespaceService = serviceRegistry.getNamespaceService();
}

Expand All @@ -40,55 +40,55 @@ public StoreRef alfresco(eu.xenit.alfred.api.data.StoreRef obj) {
return new StoreRef(obj.getValue());
}

public eu.xenit.alfred.api.data.NodeRef apix(NodeRef obj) {
public eu.xenit.alfred.api.data.NodeRef alfredApi(NodeRef obj) {
if (obj == null) {
return null;
}
return new eu.xenit.alfred.api.data.NodeRef(obj.toString());
}

public List<eu.xenit.alfred.api.data.NodeRef> apix(List<NodeRef> obj) {
//return obj.stream().map(n->apix(n)).collect(Collectors.toList());
List<eu.xenit.alfred.api.data.NodeRef> apixNodes = new ArrayList<>(obj.size());
public List<eu.xenit.alfred.api.data.NodeRef> alfredApi(List<NodeRef> obj) {
//return obj.stream().map(n->alfredApi(n)).collect(Collectors.toList());
List<eu.xenit.alfred.api.data.NodeRef> alfredApiNodes = new ArrayList<>(obj.size());
for (NodeRef alfNode : obj) {
apixNodes.add(apix(alfNode));
alfredApiNodes.add(alfredApi(alfNode));
}

return apixNodes;
return alfredApiNodes;
}

// public org.alfresco.repo.forms.Item alfresco(Item apixItem){
// return new org.alfresco.repo.forms.Item(apixItem.getKind(), apixItem.getId());
// public org.alfresco.repo.forms.Item alfresco(Item alfredApiItem){
// return new org.alfresco.repo.forms.Item(alfredApiItem.getKind(), alfredApiItem.getId());
// }
//
// public org.alfresco.repo.forms.FormData alfresco(FormData apixFormData){
// public org.alfresco.repo.forms.FormData alfresco(FormData alfredApiFormData){
// org.alfresco.repo.forms.FormData alfFormData = new org.alfresco.repo.forms.FormData();
// Map<String, FieldData> apixFieldDataMap = apixFormData.getAllFieldData();
// Set<String> apixFieldNames = apixFieldDataMap.keySet();
// Map<String, FieldData> alfredApiFieldDataMap = alfredApiFormData.getAllFieldData();
// Set<String> alfredApiFieldNames = alfredApiFieldDataMap.keySet();
//
// for(String apixFieldName : apixFieldNames){
// FieldData apixFieldData = apixFieldDataMap.get(apixFieldName);
// alfFormData.addFieldData(apixFieldData.getName(), apixFieldData.getValue());
// for(String alfredApiFieldName : alfredApiFieldNames){
// FieldData alfredApiFieldData = alfredApiFieldDataMap.get(alfredApiFieldName);
// alfFormData.addFieldData(alfredApiFieldData.getName(), alfredApiFieldData.getValue());
// }
//
// return alfFormData;
// }

public Set<eu.xenit.alfred.api.data.NodeRef> apixNodeRefs(Set<NodeRef> obj) {
Set<eu.xenit.alfred.api.data.NodeRef> apixNodes = new HashSet<>(obj.size());
public Set<eu.xenit.alfred.api.data.NodeRef> alfredApiNodeRefs(Set<NodeRef> obj) {
Set<eu.xenit.alfred.api.data.NodeRef> alfredApiNodes = new HashSet<>(obj.size());
for (NodeRef alfNode : obj) {
apixNodes.add(apix(alfNode));
alfredApiNodes.add(alfredApi(alfNode));
}

return apixNodes;
return alfredApiNodes;
}

public List<NodeRef> alfresco(List<eu.xenit.alfred.api.data.NodeRef> obj) {
//return obj.stream().map(n->alfresco(n)).collect(Collectors.toList());

List<NodeRef> alfNodes = new ArrayList<>(obj.size());
for (eu.xenit.alfred.api.data.NodeRef apixNode : obj) {
alfNodes.add(alfresco(apixNode));
for (eu.xenit.alfred.api.data.NodeRef alfredApiNode : obj) {
alfNodes.add(alfresco(alfredApiNode));
}

return alfNodes;
Expand All @@ -104,9 +104,9 @@ public Set alfresco(Set s) {
} else if (first instanceof eu.xenit.alfred.api.data.QName) {
return alfrescoQNames(s);
} else if (first instanceof NodeRef) {
return apixNodeRefs(s);
return alfredApiNodeRefs(s);
} else if (first instanceof QName) {
return apixQNames(s);
return alfredApiQNames(s);
} else {
throw new UnsupportedOperationException(
"Unable to convertQuery Set<" + first.getClass().getName() + ">, class is not supported.");
Expand All @@ -116,8 +116,8 @@ public Set alfresco(Set s) {

public Set<NodeRef> alfrescoNoderefs(Set<eu.xenit.alfred.api.data.NodeRef> obj) {
Set<NodeRef> alfNodes = new HashSet<>(obj.size());
for (eu.xenit.alfred.api.data.NodeRef apixNode : obj) {
alfNodes.add(alfresco(apixNode));
for (eu.xenit.alfred.api.data.NodeRef alfredApiNode : obj) {
alfNodes.add(alfresco(alfredApiNode));
}

return alfNodes;
Expand All @@ -134,10 +134,10 @@ public boolean HasAlfrescoQname(eu.xenit.alfred.api.data.QName qName) {
}
}

public boolean HasApixQname(org.alfresco.service.namespace.QName qName) {
public boolean HasAlfredApiQname(org.alfresco.service.namespace.QName qName) {
try {
eu.xenit.alfred.api.data.QName apixName = apix(qName);
return apixName != null;
eu.xenit.alfred.api.data.QName alfredApiName = alfredApi(qName);
return alfredApiName != null;
} catch (Exception e) {
logger.debug("Qname does not exist: " + qName);
logger.debug(e.toString());
Expand Down Expand Up @@ -173,23 +173,23 @@ public Path alfresco(eu.xenit.alfred.api.data.Path obj) {

public Set<QName> alfrescoQNames(Set<eu.xenit.alfred.api.data.QName> obj) {
Set<QName> alfQnames = new HashSet<>(obj.size());
for (eu.xenit.alfred.api.data.QName apixQname : obj) {
alfQnames.add(alfresco(apixQname));
for (eu.xenit.alfred.api.data.QName alfredApiQname : obj) {
alfQnames.add(alfresco(alfredApiQname));
}

return alfQnames;
}

public Set<eu.xenit.alfred.api.data.QName> apixQNames(Set<QName> obj) {
Set<eu.xenit.alfred.api.data.QName> apixQnames = new HashSet<>(obj.size());
public Set<eu.xenit.alfred.api.data.QName> alfredApiQNames(Set<QName> obj) {
Set<eu.xenit.alfred.api.data.QName> alfredApiQnames = new HashSet<>(obj.size());
for (QName qname : obj) {
apixQnames.add(apix(qname));
alfredApiQnames.add(alfredApi(qname));
}

return apixQnames;
return alfredApiQnames;
}

public eu.xenit.alfred.api.data.QName apix(QName obj) {
public eu.xenit.alfred.api.data.QName alfredApi(QName obj) {
return new eu.xenit.alfred.api.data.QName(obj.toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.beans.factory.support.BeanNameGenerator;

/**
* Used to specify the full name + package for autowired (@Component) beans Currently only for the amp version of apix,
* Used to specify the full name + package for autowired (@Component) beans Currently only for the amp version of alfredApi,
* not for the DE version Created by Michiel Huygen on 19/04/2016.
*/
public class PackageBeanNameGenerator implements BeanNameGenerator {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package eu.xenit.alfred.api.alfresco.WIP;

import eu.xenit.alfred.api.WIP.IWIPService;
import eu.xenit.alfred.api.alfresco.ApixToAlfrescoConversion;
import eu.xenit.alfred.api.alfresco.AlfredApiToAlfrescoConversion;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.workflow.WorkflowService;
import org.slf4j.Logger;
Expand All @@ -16,12 +16,12 @@
public class WIPServiceImpl implements IWIPService {

private final static Logger logger = LoggerFactory.getLogger(WIPServiceImpl.class);
private ApixToAlfrescoConversion c;
private AlfredApiToAlfrescoConversion c;
private WorkflowService wf;
private ServiceRegistry serviceRegistry;

@Autowired
public void setC(ApixToAlfrescoConversion c) {
public void setC(AlfredApiToAlfrescoConversion c) {
this.c = c;
}

Expand Down
Loading

0 comments on commit fba984d

Please sign in to comment.