mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-24 14:32:01 +00:00
Compare commits
12 Commits
tas-restap
...
tas-restap
Author | SHA1 | Date | |
---|---|---|---|
|
9930f18291 | ||
|
ca785cda74 | ||
|
308a60dcfa | ||
|
2518910fe1 | ||
|
4ddfb16bff | ||
|
ffb4df068b | ||
|
7fdb040b50 | ||
|
c2e587d640 | ||
|
bed12e40ca | ||
|
a53daf152f | ||
|
cc03aaf92f | ||
|
f9102eae0d |
@@ -4,7 +4,7 @@
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>restapi</artifactId>
|
||||
<name>alfresco-tas-restapi</name>
|
||||
<version>1.29</version>
|
||||
<version>1.33</version>
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-super-pom</artifactId>
|
||||
@@ -48,7 +48,7 @@
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-tas-restapi</url>
|
||||
<tag>v1.29</tag>
|
||||
<tag>v1.33</tag>
|
||||
</scm>
|
||||
|
||||
<issueManagement>
|
||||
|
@@ -166,6 +166,19 @@ public class JsonBodyGenerator
|
||||
.add("title", title).build();
|
||||
return value.toString();
|
||||
}
|
||||
/**
|
||||
* Method to create a Json object for SiteBody with site title, description, visibility
|
||||
* @param siteModel
|
||||
* @return String
|
||||
*/
|
||||
public static String updateSiteRequest(SiteModel siteModel)
|
||||
{
|
||||
JsonObject value = defineJSON()
|
||||
.add("title", siteModel.getTitle())
|
||||
.add("description", siteModel.getDescription())
|
||||
.add("visibility", siteModel.getVisibility().toString()).build();
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
public static String process(String processDefinitionKey, UserModel assignee, boolean sendEmailNotifications, Priority priority)
|
||||
{
|
||||
|
@@ -42,6 +42,7 @@ import org.alfresco.rest.requests.search.SearchSQLAPI;
|
||||
import org.alfresco.rest.requests.search.SearchSQLJDBC;
|
||||
import org.alfresco.rest.requests.search.ShardInfoAPI;
|
||||
import org.alfresco.rest.requests.search.SolrAPI;
|
||||
import org.alfresco.rest.requests.search.SolrAdminAPI;
|
||||
import org.alfresco.rest.requests.workflowAPI.RestWorkflowAPI;
|
||||
import org.alfresco.utility.LogFactory;
|
||||
import org.alfresco.utility.Utility;
|
||||
@@ -955,6 +956,11 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
|
||||
{
|
||||
return new SolrAPI(this);
|
||||
}
|
||||
|
||||
public SolrAdminAPI withSolrAdminAPI()
|
||||
{
|
||||
return new SolrAdminAPI(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@link RestDiscoveryAPI} using the rest Discovery API as prefix: {@link /alfresco/api/discovery}
|
||||
|
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright 2020 Alfresco Software, Ltd. All rights reserved.
|
||||
* License rights for this program may be obtained from Alfresco Software, Ltd.
|
||||
* pursuant to a written agreement and any use of this program without such an
|
||||
* agreement is prohibited.
|
||||
*/
|
||||
|
||||
package org.alfresco.rest.model;
|
||||
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
public class RestIdentityServiceConfigurationModel extends TestModel{
|
||||
|
||||
public RestIdentityServiceConfigurationModel() {
|
||||
|
||||
}
|
||||
|
||||
private String authenticationChain;
|
||||
|
||||
private String authenticationEnabled;
|
||||
|
||||
private String enableBasicAuth;
|
||||
|
||||
private String authServerUrl;
|
||||
|
||||
private String realm;
|
||||
|
||||
private String resource;
|
||||
|
||||
private String publicClient;
|
||||
|
||||
private String sslRequired;
|
||||
|
||||
private String enablePkce;
|
||||
|
||||
private String credentialsSecret;
|
||||
|
||||
private String credentialsProvider;
|
||||
|
||||
public String getAuthenticationChain() {
|
||||
return authenticationChain;
|
||||
}
|
||||
|
||||
public void setAuthenticationChain(String authenticationChain) {
|
||||
this.authenticationChain = authenticationChain;
|
||||
}
|
||||
|
||||
public String getAuthenticationEnabled() {
|
||||
return authenticationEnabled;
|
||||
}
|
||||
|
||||
public void setAuthenticationEnabled(String authenticationEnabled) {
|
||||
this.authenticationEnabled = authenticationEnabled;
|
||||
}
|
||||
|
||||
public String getEnableBasicAuth() {
|
||||
return enableBasicAuth;
|
||||
}
|
||||
|
||||
public void setEnableBasicAuth(String enableBasicAuth) {
|
||||
this.enableBasicAuth = enableBasicAuth;
|
||||
}
|
||||
|
||||
public String getAuthServerUrl() {
|
||||
return authServerUrl;
|
||||
}
|
||||
|
||||
public void setAuthServerUrl(String authServerUrl) {
|
||||
this.authServerUrl = authServerUrl;
|
||||
}
|
||||
|
||||
public String getRealm() {
|
||||
return realm;
|
||||
}
|
||||
|
||||
public void setRealm(String realm) {
|
||||
this.realm = realm;
|
||||
}
|
||||
|
||||
public String getResource() {
|
||||
return resource;
|
||||
}
|
||||
|
||||
public void setResource(String resource) {
|
||||
this.resource = resource;
|
||||
}
|
||||
|
||||
public String getPublicClient() {
|
||||
return publicClient;
|
||||
}
|
||||
|
||||
public void setPublicClient(String publicClient) {
|
||||
this.publicClient = publicClient;
|
||||
}
|
||||
|
||||
public String getSslRequired() {
|
||||
return sslRequired;
|
||||
}
|
||||
|
||||
public void setSslRequired(String sslRequired) {
|
||||
this.sslRequired = sslRequired;
|
||||
}
|
||||
|
||||
public String getEnablePkce() {
|
||||
return enablePkce;
|
||||
}
|
||||
|
||||
public void setEnablePkce(String enablePkce) {
|
||||
this.enablePkce = enablePkce;
|
||||
}
|
||||
|
||||
public String getCredentialsSecret() {
|
||||
return credentialsSecret;
|
||||
}
|
||||
|
||||
public void setCredentialsSecret(String credentialsSecret) {
|
||||
this.credentialsSecret = credentialsSecret;
|
||||
}
|
||||
|
||||
public String getCredentialsProvider() {
|
||||
return credentialsProvider;
|
||||
}
|
||||
|
||||
public void setCredentialsProvider(String credentialsProvider) {
|
||||
this.credentialsProvider = credentialsProvider;
|
||||
}
|
||||
}
|
@@ -63,6 +63,8 @@ public class RestSyncServiceConfigModel extends TestModel
|
||||
@JsonProperty(required = true)
|
||||
private RestSyncServiceRepoInfoModel repoInfo;
|
||||
|
||||
private RestIdentityServiceConfigurationModel identityServiceConfig;
|
||||
|
||||
public String getDsyncClientVersionMin()
|
||||
{
|
||||
return dsyncClientVersionMin;
|
||||
@@ -77,5 +79,8 @@ public class RestSyncServiceConfigModel extends TestModel
|
||||
{
|
||||
return repoInfo;
|
||||
}
|
||||
|
||||
|
||||
public RestIdentityServiceConfigurationModel getIdentityServiceConfig() {
|
||||
return identityServiceConfig;
|
||||
}
|
||||
}
|
||||
|
@@ -67,6 +67,8 @@ public class RestSyncServiceModel extends TestModel
|
||||
@JsonProperty(required = true)
|
||||
private RestSyncServiceConfigModel config;
|
||||
|
||||
private RestIdentityServiceConfigurationModel identityServiceConfig;
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
@@ -81,5 +83,12 @@ public class RestSyncServiceModel extends TestModel
|
||||
{
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
public RestIdentityServiceConfigurationModel getIdentityServiceConfig() {
|
||||
return identityServiceConfig;
|
||||
}
|
||||
|
||||
public void setIdentityServiceConfig(RestIdentityServiceConfigurationModel identityServiceConfig) {
|
||||
this.identityServiceConfig = identityServiceConfig;
|
||||
}
|
||||
}
|
||||
|
@@ -192,6 +192,38 @@ public class Site extends ModelRequest<Site>
|
||||
return restWrapper.processModel(RestSiteModel.class, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a site: Site title, description, visibility can be updated
|
||||
* Body:
|
||||
* {
|
||||
* "title": "string",
|
||||
* "description": "string",
|
||||
* "visibility": "PRIVATE"
|
||||
* }
|
||||
*
|
||||
* Response:
|
||||
* {
|
||||
* "entry": {
|
||||
* "id": "string",
|
||||
* "guid": "string",
|
||||
* "title": "string",
|
||||
* "description": "string",
|
||||
* "visibility": "PRIVATE",
|
||||
* "preset": "string",
|
||||
* "role": "SiteConsumer"
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @return the properties of an updated site
|
||||
* @throws Exception
|
||||
*/
|
||||
public RestSiteModel updateSite(SiteModel site) throws Exception
|
||||
{
|
||||
String siteBody = JsonBodyGenerator.updateSiteRequest(site);
|
||||
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, siteBody, "sites/{siteId}", site.getId());
|
||||
return restWrapper.processModel(RestSiteModel.class, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get site membership requests by using GET /site-membership-requests
|
||||
*
|
||||
|
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Alfresco Software Limited.
|
||||
* This file is part of Alfresco
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.rest.requests.search;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.rest.core.RestRequest;
|
||||
import org.alfresco.rest.core.RestResponse;
|
||||
import org.alfresco.rest.core.RestWrapper;
|
||||
import org.alfresco.rest.requests.ModelRequest;
|
||||
import org.springframework.http.HttpMethod;
|
||||
|
||||
import io.restassured.RestAssured;
|
||||
import io.restassured.http.Header;
|
||||
import io.restassured.http.Headers;
|
||||
|
||||
/**
|
||||
* Wrapper for SOLR Admin REST API
|
||||
*
|
||||
* @author aborroy
|
||||
*
|
||||
*/
|
||||
public class SolrAdminAPI extends ModelRequest<SolrAdminAPI>
|
||||
{
|
||||
public SolrAdminAPI(RestWrapper restWrapper)
|
||||
{
|
||||
super(restWrapper);
|
||||
RestAssured.basePath = "solr/admin";
|
||||
|
||||
restWrapper.configureSolrEndPoint();
|
||||
restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
|
||||
}
|
||||
|
||||
public RestResponse getAction(String action) throws Exception
|
||||
{
|
||||
List<Header> headers = new ArrayList<Header>();
|
||||
headers.add(new Header("Content-Type", "application/json"));
|
||||
Headers header = new Headers(headers);
|
||||
restWrapper.setResponseHeaders(header);
|
||||
restWrapper.configureRequestSpec().setUrlEncodingEnabled(false);
|
||||
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET,
|
||||
"cores?action=" + action + "&wt=json&{parameters}", restWrapper.getParameters());
|
||||
return restWrapper.process(request);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user