Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76a2c21b1f | ||
|
|
83d389f995 | ||
|
|
60af96ac03 | ||
|
|
09c61e62e5 | ||
|
|
41edf95bd7 | ||
|
|
d2d2c0ab14 | ||
|
|
5db57ce4e6 | ||
|
|
ce95e77177 | ||
|
|
faa7f5fa39 | ||
|
|
4329034256 | ||
|
|
e0ba345686 | ||
|
|
5ba9c67406 | ||
|
|
9a6201ffce | ||
|
|
831dc43d9b | ||
|
|
9b8d4d2d33 | ||
|
|
3633da39e8 | ||
|
|
420bf47c2b | ||
|
|
c0ce11dd63 | ||
|
|
3d39f0db74 | ||
|
|
fc4a6a7355 | ||
|
|
a64b70acd9 | ||
|
|
18426e562d | ||
|
|
e87cc00722 | ||
|
|
77c101d64a |
@@ -6,10 +6,10 @@
|
||||
|
||||
<groupId>com.inteligr8.alfresco</groupId>
|
||||
<artifactId>acs-public-rest-client</artifactId>
|
||||
<version>3.0-SNAPSHOT-cxf</version>
|
||||
|
||||
<version>3.0.1-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>
|
||||
@@ -45,7 +45,7 @@
|
||||
<maven.compiler.debuglevel>lines,vars,source</maven.compiler.debuglevel>
|
||||
|
||||
<acs.platform.tag>acs26</acs.platform.tag>
|
||||
|
||||
|
||||
<!-- for testing only -->
|
||||
<spring.version>6.2.18</spring.version>
|
||||
</properties>
|
||||
@@ -54,7 +54,7 @@
|
||||
<dependency>
|
||||
<groupId>com.inteligr8</groupId>
|
||||
<artifactId>common-rest-client</artifactId>
|
||||
<version>3.0.4-cxf</version>
|
||||
<version>3.0.4-jersey</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.inteligr8.alfresco</groupId>
|
||||
@@ -117,7 +117,7 @@
|
||||
<goals><goal>add-source</goal></goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/main/cxf</source>
|
||||
<source>src/main/jersey</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
@@ -126,7 +126,7 @@
|
||||
<goals><goal>add-test-source</goal></goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/test/cxf</source>
|
||||
<source>src/test/jersey</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
+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