Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60af96ac03 | ||
|
|
09c61e62e5 | ||
|
|
41edf95bd7 | ||
|
|
b7279c4c2a | ||
|
|
2ca3322e81 | ||
|
|
5db57ce4e6 | ||
|
|
ce95e77177 | ||
|
|
e0ba345686 | ||
|
|
831dc43d9b | ||
|
|
9b8d4d2d33 | ||
|
|
c0ce11dd63 | ||
|
|
3d39f0db74 | ||
|
|
a64b70acd9 | ||
|
|
e87cc00722 |
@@ -6,10 +6,10 @@
|
||||
|
||||
<groupId>com.inteligr8.alfresco</groupId>
|
||||
<artifactId>acs-public-rest-client</artifactId>
|
||||
<version>3.0.0-cxf</version>
|
||||
|
||||
<version>3.0-SNAPSHOT-jersey</version>
|
||||
|
||||
<name>Alfresco Content Services ReST API Client for Java</name>
|
||||
<description>An ACS Client library for building CXF-based REST API clients</description>
|
||||
<description>An ACS Client library for building Jersey-based REST API clients</description>
|
||||
<url>https://bitbucket.org/inteligr8/acs-public-rest-client</url>
|
||||
|
||||
<licenses>
|
||||
@@ -44,29 +44,29 @@
|
||||
<maven.compiler.release>11</maven.compiler.release>
|
||||
<maven.compiler.debuglevel>lines,vars,source</maven.compiler.debuglevel>
|
||||
|
||||
<acs.platform.tag>acs23</acs.platform.tag>
|
||||
<acs.platform.tag>acs26</acs.platform.tag>
|
||||
|
||||
<junit.version>5.10.0</junit.version>
|
||||
<spring.version>6.0.19</spring.version>
|
||||
<cxf.version>4.0.2</cxf.version>
|
||||
<!-- for testing only -->
|
||||
<spring.version>6.2.18</spring.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.inteligr8</groupId>
|
||||
<artifactId>common-rest-client</artifactId>
|
||||
<version>3.0.0-cxf</version>
|
||||
<version>3.0.4-jersey</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.inteligr8.alfresco</groupId>
|
||||
<artifactId>acs-public-rest-api</artifactId>
|
||||
<version>3.0.0-${acs.platform.tag}</version>
|
||||
<version>3.0.2-${acs.platform.tag}</version>
|
||||
<scope>provided</scope> <!-- explicitly, bring your own version -->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
<version>5.14.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -84,24 +84,40 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-slf4j-impl</artifactId>
|
||||
<version>2.20.0</version>
|
||||
<version>2.25.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.5.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>3.5.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-jaxrs-src</id>
|
||||
<goals><goal>add-source</goal></goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/main/cxf</source>
|
||||
<source>src/main/jersey</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
@@ -110,40 +126,18 @@
|
||||
<goals><goal>add-test-source</goal></goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/test/cxf</source>
|
||||
<source>src/test/jersey</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>ossrh-release</id>
|
||||
<id>central-publish</id>
|
||||
<properties>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
@@ -161,7 +155,6 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>javadoc</id>
|
||||
@@ -185,19 +178,20 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.6.13</version>
|
||||
<groupId>org.sonatype.central</groupId>
|
||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||
<version>0.10.0</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<serverId>ossrh</serverId>
|
||||
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
|
||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
||||
<publishingServerId>central</publishingServerId>
|
||||
<autoPublish>true</autoPublish>
|
||||
</configuration>
|
||||
<!-- for some reason this is required... -->
|
||||
<executions>
|
||||
<execution>
|
||||
<id>ossrh-deploy</id>
|
||||
<id>deploy</id>
|
||||
<phase>deploy</phase>
|
||||
<goals><goal>deploy</goal></goals>
|
||||
<goals><goal>publish</goal></goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
+10
-10
@@ -18,11 +18,11 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.inteligr8.rs.ClientCxfConfiguration;
|
||||
import com.inteligr8.rs.ClientJerseyConfiguration;
|
||||
|
||||
/**
|
||||
* This class provides a POJO & Spring-based implementation of the
|
||||
* ClientCxfConfiguration interface. You can use it outside of the Spring
|
||||
* ClientJerseyConfiguration interface. You can use it outside of the Spring
|
||||
* context, but you will need the spring-context and spring-beans libraries in
|
||||
* your non-Spring application.
|
||||
*
|
||||
@@ -30,17 +30,17 @@ import com.inteligr8.rs.ClientCxfConfiguration;
|
||||
*/
|
||||
@Configuration
|
||||
@ComponentScan
|
||||
public class AcsClientCxfConfiguration extends AcsClientConfiguration implements ClientCxfConfiguration {
|
||||
|
||||
@Value("${content.service.cxf.defaultBusEnabled:true}")
|
||||
private boolean defaultBusEnabled;
|
||||
public class AcsClientJerseyConfiguration extends AcsClientConfiguration implements ClientJerseyConfiguration {
|
||||
|
||||
public boolean isDefaultBusEnabled() {
|
||||
return this.defaultBusEnabled;
|
||||
@Value("${content.service.jersey.putBodyRequired:true}")
|
||||
private boolean putBodyRequired;
|
||||
|
||||
public boolean isPutBodyRequired() {
|
||||
return this.putBodyRequired;
|
||||
}
|
||||
|
||||
public void setDefaultBusEnabled(boolean defaultBusEnabled) {
|
||||
this.defaultBusEnabled = defaultBusEnabled;
|
||||
public void setPutBodyRequired(boolean putBodyRequired) {
|
||||
this.putBodyRequired = putBodyRequired;
|
||||
}
|
||||
|
||||
}
|
||||
+9
-9
@@ -18,25 +18,25 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.inteligr8.rs.ClientCxfImpl;
|
||||
import com.inteligr8.rs.ClientJerseyImpl;
|
||||
|
||||
/**
|
||||
* This class provides a POJO & Spring-based implementation of the Apache
|
||||
* CXF client. You can use it outside of the Spring context, but you will need
|
||||
* the spring-context and spring-beans libraries in your non-Spring
|
||||
* application.
|
||||
* This class provides a POJO & Spring-based implementation of the Jersey
|
||||
* client configured for APS. You can use it outside of the Spring context,
|
||||
* but you will need the spring-context and spring-beans libraries in your
|
||||
* non-Spring application.
|
||||
*
|
||||
* @author brian@inteligr8.com
|
||||
*/
|
||||
@Component("acs.client.cxf")
|
||||
@Component("acs.client.jersey")
|
||||
@Lazy
|
||||
public class AcsClientCxfImpl extends ClientCxfImpl {
|
||||
public class AcsClientJerseyImpl extends ClientJerseyImpl {
|
||||
|
||||
/**
|
||||
* This constructor is for Spring or POJO use
|
||||
* This constructor is for Spring and POJO use
|
||||
*/
|
||||
@Autowired
|
||||
public AcsClientCxfImpl(AcsClientCxfConfiguration config) {
|
||||
public AcsClientJerseyImpl(AcsClientJerseyConfiguration config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
+5
-5
@@ -19,20 +19,20 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* This class provides the Apache CXF client to the JAX-RS API for the ACS
|
||||
* Public ReST API.
|
||||
* This class provides the Jersey client to the JAX-RS API for the ACS Public
|
||||
* ReST API.
|
||||
*
|
||||
* @author brian@inteligr8.com
|
||||
*/
|
||||
@Component("acs.api.cxf")
|
||||
@Component("acs.api.jersey")
|
||||
@Lazy
|
||||
public class AcsPublicRestApiCxfImpl extends AcsPublicRestApiImpl implements AcsPublicRestCxfApi {
|
||||
public class AcsPublicRestApiJerseyImpl extends AcsPublicRestApiImpl implements AcsPublicRestJerseyApi {
|
||||
|
||||
/**
|
||||
* This constructor is for Spring or POJO use
|
||||
*/
|
||||
@Autowired
|
||||
public AcsPublicRestApiCxfImpl(AcsClientCxfImpl client) {
|
||||
public AcsPublicRestApiJerseyImpl(AcsClientJerseyImpl client) {
|
||||
super(client);
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
org.apache.cxf.jaxrs.client.spec.ClientBuilderImpl
|
||||
@@ -0,0 +1 @@
|
||||
org.glassfish.jersey.client.JerseyClientBuilder
|
||||
+3
-3
@@ -22,11 +22,11 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
import com.inteligr8.rs.ClientConfiguration;
|
||||
|
||||
@TestPropertySource(locations = {"/local.properties"})
|
||||
@SpringJUnitConfig(classes = {AcsClientCxfConfiguration.class, AcsPublicRestApiCxfImpl.class, AcsClientCxfImpl.class})
|
||||
public class ConnectionCxfClientIT extends ConnectionClientIT {
|
||||
@SpringJUnitConfig(classes = {AcsClientJerseyConfiguration.class, AcsPublicRestApiJerseyImpl.class, AcsClientJerseyImpl.class})
|
||||
public class ConnectionJerseyClientIT extends ConnectionClientIT {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("acs.api.cxf")
|
||||
@Qualifier("acs.api.jersey")
|
||||
private AcsPublicRestApiImpl api;
|
||||
|
||||
@Override
|
||||
+8
-7
@@ -16,6 +16,7 @@ package com.inteligr8.alfresco.acs;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
@@ -28,16 +29,16 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
import com.inteligr8.alfresco.acs.model.Node;
|
||||
import com.inteligr8.alfresco.acs.model.NodeBodyCreate;
|
||||
import com.inteligr8.alfresco.acs.model.NodeBodyCreateMultipartCxf;
|
||||
import com.inteligr8.alfresco.acs.model.NodeBodyCreateMultipartJersey;
|
||||
import com.inteligr8.rs.ClientConfiguration;
|
||||
|
||||
@TestPropertySource(locations = {"/local.properties"})
|
||||
@SpringJUnitConfig(classes = {AcsClientCxfConfiguration.class, AcsPublicRestApiCxfImpl.class, AcsClientCxfImpl.class})
|
||||
public class CxfUploadIT extends UploadIT {
|
||||
@SpringJUnitConfig(classes = {AcsClientJerseyConfiguration.class, AcsPublicRestApiJerseyImpl.class, AcsClientJerseyImpl.class})
|
||||
public class JerseyUploadIT extends UploadIT {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("acs.api.cxf")
|
||||
private AcsPublicRestApiCxfImpl api;
|
||||
@Qualifier("acs.api.jersey")
|
||||
private AcsPublicRestApiJerseyImpl api;
|
||||
|
||||
@Override
|
||||
public AcsPublicRestApi getApi() {
|
||||
@@ -51,14 +52,14 @@ public class CxfUploadIT extends UploadIT {
|
||||
|
||||
@Test
|
||||
@EnabledIf("hostExists")
|
||||
public void uploadFile() throws IOException {
|
||||
public void uploadFile() throws IOException, ParseException {
|
||||
String folderNodeId = this.getSharedFolder();
|
||||
|
||||
NodeBodyCreate nodeBody = new NodeBodyCreate().nodeType("trx:transferReport").name("test-name1.txt")
|
||||
.properties(Collections.singletonMap("cm:author", "Brian"));
|
||||
|
||||
ByteArrayInputStream istream = new ByteArrayInputStream("This is a test".getBytes());
|
||||
NodeBodyCreateMultipartCxf body = NodeBodyCreateMultipartCxf.from(nodeBody, "test-name2.txt", istream, true, null, null);
|
||||
NodeBodyCreateMultipartJersey body = NodeBodyCreateMultipartJersey.from(nodeBody, "test-name2.txt", istream, true, null, null);
|
||||
|
||||
Node newNode = this.api.getNodesExtApi().createNode(folderNodeId, body).getEntry();
|
||||
Assertions.assertNotNull(newNode);
|
||||
Reference in New Issue
Block a user