Merge branch 'develop' into stable
This commit is contained in:
13
pom.xml
13
pom.xml
@@ -102,6 +102,19 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>javadoc</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals><goal>jar</goal></goals>
|
||||||
|
<configuration>
|
||||||
|
<show>public</show>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
@@ -7,6 +7,14 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
import com.inteligr8.rs.ClientCxfConfiguration;
|
import com.inteligr8.rs.ClientCxfConfiguration;
|
||||||
import com.inteligr8.rs.ClientJerseyConfiguration;
|
import com.inteligr8.rs.ClientJerseyConfiguration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class provides a POJO & Spring-based implementation of the
|
||||||
|
* ClientConfiguration 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.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@ComponentScan
|
@ComponentScan
|
||||||
public class ApsClientConfiguration implements ClientCxfConfiguration, ClientJerseyConfiguration {
|
public class ApsClientConfiguration implements ClientCxfConfiguration, ClientJerseyConfiguration {
|
||||||
@@ -20,8 +28,8 @@ public class ApsClientConfiguration implements ClientCxfConfiguration, ClientJer
|
|||||||
@Value("${process.service.security.basicAuth.password:admin}")
|
@Value("${process.service.security.basicAuth.password:admin}")
|
||||||
private String basicAuthPassword;
|
private String basicAuthPassword;
|
||||||
|
|
||||||
@Value("${process.service.security.accessToken:#{null}}")
|
@Value("${process.service.security.bearerToken:#{null}}")
|
||||||
private String accessToken;
|
private String bearerToken;
|
||||||
|
|
||||||
@Value("${process.service.security.oauth.tokenUrl:#{null}}")
|
@Value("${process.service.security.oauth.tokenUrl:#{null}}")
|
||||||
private String oAuthTokenUrl;
|
private String oAuthTokenUrl;
|
||||||
@@ -49,57 +57,109 @@ public class ApsClientConfiguration implements ClientCxfConfiguration, ClientJer
|
|||||||
|
|
||||||
@Value("${process.service.jersey.putBodyRequired:true}")
|
@Value("${process.service.jersey.putBodyRequired:true}")
|
||||||
private boolean putBodyRequired;
|
private boolean putBodyRequired;
|
||||||
|
|
||||||
public String getBaseUrl() {
|
public String getBaseUrl() {
|
||||||
return this.baseUrl;
|
return this.baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBaseUrl(String baseUrl) {
|
||||||
|
this.baseUrl = baseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public String getBasicAuthUsername() {
|
public String getBasicAuthUsername() {
|
||||||
return this.basicAuthUsername;
|
return this.basicAuthUsername;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBasicAuthUsername(String basicAuthUsername) {
|
||||||
|
this.basicAuthUsername = basicAuthUsername;
|
||||||
|
}
|
||||||
|
|
||||||
public String getBasicAuthPassword() {
|
public String getBasicAuthPassword() {
|
||||||
return this.basicAuthPassword;
|
return this.basicAuthPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBasicAuthPassword(String basicAuthPassword) {
|
||||||
|
this.basicAuthPassword = basicAuthPassword;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAccessToken() {
|
public String getBearerToken() {
|
||||||
return this.accessToken;
|
return this.bearerToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBearerToken(String bearerToken) {
|
||||||
|
this.bearerToken = bearerToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOAuthTokenUrl() {
|
public String getOAuthTokenUrl() {
|
||||||
return this.oAuthTokenUrl;
|
return this.oAuthTokenUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthTokenUrl(String oAuthTokenUrl) {
|
||||||
|
this.oAuthTokenUrl = oAuthTokenUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthClientId() {
|
public String getOAuthClientId() {
|
||||||
return this.oAuthClientId;
|
return this.oAuthClientId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthClientId(String oAuthClientId) {
|
||||||
|
this.oAuthClientId = oAuthClientId;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthClientSecret() {
|
public String getOAuthClientSecret() {
|
||||||
return this.oAuthClientSecret;
|
return this.oAuthClientSecret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthClientSecret(String oAuthClientSecret) {
|
||||||
|
this.oAuthClientSecret = oAuthClientSecret;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthAuthCode() {
|
public String getOAuthAuthCode() {
|
||||||
return this.oAuthAuthCode;
|
return this.oAuthAuthCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthAuthCode(String oAuthAuthCode) {
|
||||||
|
this.oAuthAuthCode = oAuthAuthCode;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthAuthRedirectUri() {
|
public String getOAuthAuthRedirectUri() {
|
||||||
return this.oAuthAuthRedirectUri;
|
return this.oAuthAuthRedirectUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthAuthRedirectUri(String oAuthAuthRedirectUri) {
|
||||||
|
this.oAuthAuthRedirectUri = oAuthAuthRedirectUri;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthUsername() {
|
public String getOAuthUsername() {
|
||||||
return this.oAuthUsername;
|
return this.oAuthUsername;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthUsername(String oAuthUsername) {
|
||||||
|
this.oAuthUsername = oAuthUsername;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthPassword() {
|
public String getOAuthPassword() {
|
||||||
return this.oAuthPassword;
|
return this.oAuthPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthPassword(String oAuthPassword) {
|
||||||
|
this.oAuthPassword = oAuthPassword;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isDefaultBusEnabled() {
|
public boolean isDefaultBusEnabled() {
|
||||||
return this.defaultBusEnabled;
|
return this.defaultBusEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDefaultBusEnabled(boolean defaultBusEnabled) {
|
||||||
|
this.defaultBusEnabled = defaultBusEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isPutBodyRequired() {
|
public boolean isPutBodyRequired() {
|
||||||
return this.putBodyRequired;
|
return this.putBodyRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPutBodyRequired(boolean putBodyRequired) {
|
||||||
|
this.putBodyRequired = putBodyRequired;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,12 @@ import com.inteligr8.rs.ClientCxfConfiguration;
|
|||||||
import com.inteligr8.rs.ClientCxfImpl;
|
import com.inteligr8.rs.ClientCxfImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configured JAX-RS Client & WebTarget for APS & CXF
|
* 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.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("aps.client.cxf")
|
@Component("aps.client.cxf")
|
||||||
@Lazy
|
@Lazy
|
||||||
@@ -17,6 +22,19 @@ public class ApsClientCxfImpl extends ClientCxfImpl {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ApsClientConfiguration config;
|
private ApsClientConfiguration config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for Spring use
|
||||||
|
*/
|
||||||
|
ApsClientCxfImpl() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for POJO use
|
||||||
|
*/
|
||||||
|
public ApsClientCxfImpl(ApsClientConfiguration config) {
|
||||||
|
this.config = config;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ClientCxfConfiguration getConfig() {
|
protected ClientCxfConfiguration getConfig() {
|
||||||
return this.config;
|
return this.config;
|
||||||
|
@@ -8,7 +8,12 @@ import com.inteligr8.rs.ClientJerseyConfiguration;
|
|||||||
import com.inteligr8.rs.ClientJerseyImpl;
|
import com.inteligr8.rs.ClientJerseyImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configured JAX-RS Client & WebTarget for APS & Jersey
|
* 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.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("aps.client.jersey")
|
@Component("aps.client.jersey")
|
||||||
@Lazy
|
@Lazy
|
||||||
@@ -17,6 +22,19 @@ public class ApsClientJerseyImpl extends ClientJerseyImpl {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ApsClientConfiguration config;
|
private ApsClientConfiguration config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for Spring use
|
||||||
|
*/
|
||||||
|
ApsClientJerseyImpl() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for POJO use
|
||||||
|
*/
|
||||||
|
public ApsClientJerseyImpl(ApsClientConfiguration config) {
|
||||||
|
this.config = config;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ClientJerseyConfiguration getConfig() {
|
protected ClientJerseyConfiguration getConfig() {
|
||||||
return this.config;
|
return this.config;
|
||||||
|
@@ -5,35 +5,68 @@ import com.inteligr8.alfresco.activiti.api.AppVersionApi;
|
|||||||
import com.inteligr8.alfresco.activiti.api.ProcessInstancesApi;
|
import com.inteligr8.alfresco.activiti.api.ProcessInstancesApi;
|
||||||
import com.inteligr8.alfresco.activiti.api.ProfileApi;
|
import com.inteligr8.alfresco.activiti.api.ProfileApi;
|
||||||
import com.inteligr8.alfresco.activiti.api.TasksApi;
|
import com.inteligr8.alfresco.activiti.api.TasksApi;
|
||||||
|
import com.inteligr8.rs.AuthorizationFilter;
|
||||||
|
import com.inteligr8.rs.Client;
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alfresco Process Services Spring-ready API
|
* This class serves as the base implementation for the JAX-RS API for the APS
|
||||||
|
* Public ReST API.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
public abstract class ApsPublicRestApi {
|
public abstract class ApsPublicRestApi {
|
||||||
|
|
||||||
protected abstract ClientConfiguration getConfig();
|
abstract ClientConfiguration getConfig();
|
||||||
|
|
||||||
protected abstract <T> T getApi(Class<T> apiClass);
|
abstract Client getClient();
|
||||||
|
|
||||||
|
protected final <T> T getApi(Class<T> apiClass) {
|
||||||
|
return this.getApi(null, apiClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected <T> T getApi(AuthorizationFilter authFilter, Class<T> apiClass) {
|
||||||
|
return this.getClient().getApi(authFilter, apiClass);
|
||||||
|
}
|
||||||
|
|
||||||
public AdminApi getAdminApi() {
|
public AdminApi getAdminApi() {
|
||||||
return this.getApi(AdminApi.class);
|
return this.getApi(AdminApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AdminApi getAdminApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, AdminApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public AppVersionApi getAppVersionApi() {
|
public AppVersionApi getAppVersionApi() {
|
||||||
return this.getApi(AppVersionApi.class);
|
return this.getApi(AppVersionApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AppVersionApi getAppVersionApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, AppVersionApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public ProcessInstancesApi getProcessInstancesApi() {
|
public ProcessInstancesApi getProcessInstancesApi() {
|
||||||
return this.getApi(ProcessInstancesApi.class);
|
return this.getApi(ProcessInstancesApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProcessInstancesApi getProcessInstancesApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, ProcessInstancesApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public ProfileApi getProfileApi() {
|
public ProfileApi getProfileApi() {
|
||||||
return this.getApi(ProfileApi.class);
|
return this.getApi(ProfileApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProfileApi getProfileApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, ProfileApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public TasksApi getTasksApi() {
|
public TasksApi getTasksApi() {
|
||||||
return this.getApi(TasksApi.class);
|
return this.getApi(TasksApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TasksApi getTasksApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, TasksApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -4,10 +4,14 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import com.inteligr8.rs.Client;
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alfresco Process Services Spring-ready API for CXF
|
* This class provides the Apache CXF client to the JAX-RS API for the APS
|
||||||
|
* Public ReST API.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("aps.api.cxf")
|
@Component("aps.api.cxf")
|
||||||
@Lazy
|
@Lazy
|
||||||
@@ -16,14 +20,27 @@ public class ApsPublicRestApiCxfImpl extends ApsPublicRestApi {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ApsClientCxfImpl client;
|
private ApsClientCxfImpl client;
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
protected ClientConfiguration getConfig() {
|
* This constructor is for Spring use
|
||||||
return this.client.getConfig();
|
*/
|
||||||
|
ApsPublicRestApiCxfImpl() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for POJO use
|
||||||
|
*/
|
||||||
|
public ApsPublicRestApiCxfImpl(ApsClientCxfImpl client) {
|
||||||
|
this.client = client;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected <T> T getApi(Class<T> apiClass) {
|
ClientConfiguration getConfig() {
|
||||||
return this.client.getApi(apiClass);
|
return this.client.getConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
Client getClient() {
|
||||||
|
return this.client;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -4,10 +4,14 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import com.inteligr8.rs.Client;
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alfresco Process Services Spring-ready API for Jersey
|
* This class provides the Jersey client to the JAX-RS API for the APS Public
|
||||||
|
* ReST API.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("aps.api.jersey")
|
@Component("aps.api.jersey")
|
||||||
@Lazy
|
@Lazy
|
||||||
@@ -16,14 +20,27 @@ public class ApsPublicRestApiJerseyImpl extends ApsPublicRestApi {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ApsClientJerseyImpl client;
|
private ApsClientJerseyImpl client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for Spring use
|
||||||
|
*/
|
||||||
|
ApsPublicRestApiJerseyImpl() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for POJO use
|
||||||
|
*/
|
||||||
|
public ApsPublicRestApiJerseyImpl(ApsClientJerseyImpl client) {
|
||||||
|
this.client = client;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ClientConfiguration getConfig() {
|
ClientConfiguration getConfig() {
|
||||||
return this.client.getConfig();
|
return this.client.getConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected <T> T getApi(Class<T> apiClass) {
|
Client getClient() {
|
||||||
return this.client.getApi(apiClass);
|
return this.client;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user