Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 8.0.0 #25

Merged
merged 18 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build
on:
push:
pull_request:

jobs:
compile:
name: "compile"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Build with Maven
run: ./mvnw compile

test:
name: "tests (Alfresco version ${{ matrix.alfresco-version }})"
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- alfresco-version: 6.1.2-ga
experimental: false
- alfresco-version: 6.2.0-ga
experimental: false
- alfresco-version: 7.1.0.1
experimental: false
- alfresco-version: 7.2.0
experimental: false
- alfresco-version: 7.3.0
experimental: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Run tests
run: ./mvnw test -Pcommunity-${{ matrix.alfresco-version }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ local
.idea
*iml
*.log
*.log.*
*.log.*

private-key.gpg
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
The missing glue between Alfresco and Spring MVC
===
Personally I do not like webscripts because of the boilerplate code that comes with them (XML, FTL, Java/Javascript). Also I am not a big fan of javascript on the server side esither, as in a medium sized application this becomes unmaintainable. That is why I wrote Alfresco @MVC.
Personally, I do not like Alfresco Webscripts because of the boilerplate code that comes with them (XML, FTL, Java/Javascript). Also, I am not a big fan of Javascript on the server side either, as in a medium sized application this becomes unmaintainable. That is why I wrote Alfresco @MVC.

Alfresco @MVC consists of several libraries for REST, AOP
- Alfresco MVC REST enables the usage of the full Spring MVC stack within the context of a webscript, benefiting of Alfresco standard authentication and security
- Alfresco MVC REST enables the usage of the full Spring MVC stack within the context of an Alfresco Webscript, benefiting of Alfresco standard authentication and security
- Alfresco MVC AOP enables simple handling of Alfresco transactions and Alfresco runAs mechanism with simple annotations

[Distributed on Maven Central](https://search.maven.org/search?q=g:com.gradecak.alfresco-mvc)
Expand All @@ -23,22 +23,40 @@ Alfresco @MVC consists of several libraries for REST, AOP
```

Works on Enterprise as well as on Community and it reuses a widely accepted REST framework.
For the correct version supported on your Alfresco version [please check the wiki](https://github.com/dgradecak/alfresco-mvc/wiki) or
[the release page](https://github.com/dgradecak/alfresco-mvc/releases).
For the correct version supported by your Alfresco version [please check the wiki](https://github.com/dgradecak/alfresco-mvc/wiki) or
[The release page](https://github.com/dgradecak/alfresco-mvc/releases).

[The docs are on the wiki page](https://github.com/dgradecak/alfresco-mvc/wiki)

[The Samples are provided on](https://github.com/dgradecak/alfresco-mvc-sample)

You should use it when
-
- You need custom APIs
- You want to be more productive
- You write custom webscripts
- You write custom Alfresco Webscripts

You would benefit of
You would benefit from
-
- Faster and cleaner development
- Java developers know how to use Spring MVC while new comers tend to avoid webscripts
- Java developers know how to use Spring MVC while newcomers tend to avoid Alfresco Webscripts


For supported Alfresco versions, check the [release notes](https://github.com/dgradecak/alfresco-mvc/releases)


Maven local installation
-
mvn clean install -Dgpg.skip


Profiles
-
We are using profiles to test against different Alfresco versions. If no configured Maven profiles are provided the default will be used and is specified by <activeByDefault>true</activeByDefault> in the pom.xml

For supported Alfresco versions check the [release notes](https://github.com/dgradecak/alfresco-mvc/releases)
example: mvn package -Pcommunity-7.2.0

Testing
-
From v8.0.0 we have decided to only run our unit tests against the Alfresco Community versions. Despite not being tested on Alfresco Enterprise it has to be compatible with the respectively tested Alfresco Community distribution

29 changes: 1 addition & 28 deletions alfresco-mvc-aop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.gradecak.alfresco-mvc</groupId>
<version>8.0.0</version>
<artifactId>alfresco-mvc-bom</artifactId>
<artifactId>alfresco-mvc-parent</artifactId>
<relativePath>../</relativePath>
</parent>

Expand All @@ -15,10 +15,6 @@
<name>Alfresco MVC aop</name>
<description>Glue between Spring AOP and Alfresco. This library enables the usage of Spring AOP within Alfresco.</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
Expand Down Expand Up @@ -57,27 +53,4 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@
String[] basePackages() default {};

Class<?>[] basePackageClasses() default {};

boolean defaultPropertiesSupport() default true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.type.AnnotationMetadata;
Expand All @@ -48,6 +49,11 @@ public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanD
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null!");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");

// Guard against calls for sub-classes
if (annotationMetadata.getAnnotationAttributes(EnableAlfrescoMvcAop.class.getName()) == null) {
return;
}

boolean proxyBeanRegistered = false;
for (String beanName : PackageAutoProxyCreator.DEFAULT_INTERCEPTORS) {
if (registry.containsBeanDefinition(beanName)) {
Expand All @@ -61,15 +67,16 @@ public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanD
xmlReader.loadBeanDefinitions("classpath:com/gradecak/alfresco-mvc/alfresco-mvc-aop.xml");
}

// Guard against calls for sub-classes
if (annotationMetadata.getAnnotationAttributes(EnableAlfrescoMvcAop.class.getName()) == null) {
return;
}

this.attributes = new AnnotationAttributes(
annotationMetadata.getAnnotationAttributes(EnableAlfrescoMvcAop.class.getName()));
this.metadata = annotationMetadata;

boolean defaultPropertiesSupport = attributes.getBoolean("defaultPropertiesSupport");
if (defaultPropertiesSupport) {
RootBeanDefinition beanDefinition = new RootBeanDefinition(PropertySourcesPlaceholderConfigurer.class);
registry.registerBeanDefinition("propertySourcesPlaceholderConfigurer", beanDefinition);
}

Iterable<String> basePackages = getBasePackages();
for (String basePackage : basePackages) {
registerOrEscalateApcAsRequired(PackageAutoProxyCreator.class, registry, null, basePackage);
Expand Down Expand Up @@ -115,13 +122,13 @@ public Iterable<String> getBasePackages() {
return packages;
}

public static BeanDefinition registerOrEscalateApcAsRequired(Class<PackageAutoProxyCreator> cls,
public static void registerOrEscalateApcAsRequired(Class<PackageAutoProxyCreator> cls,
BeanDefinitionRegistry registry, Object source, String basePackage) {
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");

String proxyPackageBeanName = PACKAGE_PROXY_CREATOR_BEAN_NAME + "." + basePackage;
if (registry.containsBeanDefinition(proxyPackageBeanName)) {
return null;
return;
}

RootBeanDefinition beanDefinition = new RootBeanDefinition(cls);
Expand All @@ -130,6 +137,5 @@ public static BeanDefinition registerOrEscalateApcAsRequired(Class<PackageAutoPr
beanDefinition.getPropertyValues().add("basePackage", basePackage);
beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
registry.registerBeanDefinition(proxyPackageBeanName, beanDefinition);
return beanDefinition;
}
}
55 changes: 55 additions & 0 deletions alfresco-mvc-bom/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.gradecak.alfresco-mvc</groupId>
<version>8.0.0</version>
<artifactId>alfresco-mvc-parent</artifactId>
<relativePath>../</relativePath>
</parent>

<artifactId>alfresco-mvc-bom</artifactId>
<packaging>pom</packaging>

<name>Alfresco MVC dependencies</name>
<description>Dependencies for Alfresco @MVC project</description>
<url>https://github.com/dgradecak/alfresco-mvc</url>

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>Daniel Gradečak</name>
<email>[email protected]</email>
<organization>PleoSoft</organization>
<organizationUrl>http://pleosoft.com/</organizationUrl>
</developer>
</developers>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.gradecak.alfresco-mvc</groupId>
<artifactId>alfresco-mvc-rest</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.gradecak.alfresco-mvc</groupId>
<artifactId>alfresco-mvc-aop</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
41 changes: 1 addition & 40 deletions alfresco-mvc-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.gradecak.alfresco-mvc</groupId>
<version>8.0.0</version>
<artifactId>alfresco-mvc-bom</artifactId>
<artifactId>alfresco-mvc-parent</artifactId>
<relativePath>../</relativePath>
</parent>

Expand All @@ -15,10 +15,6 @@
<name>Alfresco MVC rest</name>
<description>Glue between SpringMVC and Alfresco. This library enables the usage of Spring @MVC within Alfresco.</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
Expand Down Expand Up @@ -68,39 +64,4 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>

This file was deleted.

Loading