Compare commits

..

12 Commits

Author SHA1 Message Date
Travis CI User
9930f18291 [maven-release-plugin][skip ci] prepare release v1.33 2020-02-17 12:38:37 +00:00
Ciprian Chelaru
ca785cda74 APPSREPO-752 added identityServiceConfig obj into sync service model (#38) 2020-02-17 14:34:48 +02:00
Travis CI User
308a60dcfa [maven-release-plugin][skip ci] prepare for next development iteration 2020-02-17 09:20:22 +00:00
Travis CI User
2518910fe1 [maven-release-plugin][skip ci] prepare release v1.32 2020-02-17 09:20:15 +00:00
ciprianchelaru
4ddfb16bff APPSREPO-752_new object in sync service model 2020-02-17 11:15:51 +02:00
Travis CI User
ffb4df068b [maven-release-plugin][skip ci] prepare for next development iteration 2020-02-11 16:23:10 +00:00
Travis CI User
7fdb040b50 [maven-release-plugin][skip ci] prepare release v1.31 2020-02-11 16:23:04 +00:00
Meenal Bhave
c2e587d640 Search-2096: Added missing API to update Site (#37) 2020-02-11 16:19:15 +00:00
Travis CI User
bed12e40ca [maven-release-plugin][skip ci] prepare for next development iteration 2020-02-06 12:14:27 +00:00
Travis CI User
a53daf152f [maven-release-plugin][skip ci] prepare release v1.30 2020-02-06 12:14:19 +00:00
Angel Borroy
cc03aaf92f RestWrapper for Solr Admin API (#34) 2020-02-06 13:10:30 +01:00
Travis CI User
f9102eae0d [maven-release-plugin][skip ci] prepare for next development iteration 2020-02-05 16:31:10 +00:00
8 changed files with 254 additions and 4 deletions

View File

@@ -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>

View File

@@ -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)
{

View File

@@ -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}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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
*

View File

@@ -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);
}
}