├── .gitignore ├── LICENSE ├── README.md ├── client-java ├── alfresco-java-client │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── alfresco │ │ │ └── client │ │ │ ├── AlfrescoClient.java │ │ │ ├── Version.java │ │ │ ├── api │ │ │ ├── authentication │ │ │ │ ├── AuthenticationAPI.java │ │ │ │ ├── AuthenticationConstant.java │ │ │ │ ├── AuthenticationUtils.java │ │ │ │ ├── body │ │ │ │ │ └── TicketBody.java │ │ │ │ └── representation │ │ │ │ │ ├── TicketRepresentation.java │ │ │ │ │ └── ValidTicketRepresentation.java │ │ │ ├── common │ │ │ │ ├── constant │ │ │ │ │ ├── APIConstant.java │ │ │ │ │ ├── ContentModel.java │ │ │ │ │ ├── OnPremiseConstant.java │ │ │ │ │ └── PublicAPIConstant.java │ │ │ │ ├── deserializer │ │ │ │ │ ├── EntryDeserializer.java │ │ │ │ │ └── PagingDeserializer.java │ │ │ │ └── representation │ │ │ │ │ ├── AbstractRepresentation.java │ │ │ │ │ ├── PaginationRepresentation.java │ │ │ │ │ └── ResultPaging.java │ │ │ ├── core │ │ │ │ ├── ActivitiesAPI.java │ │ │ │ ├── CommentsAPI.java │ │ │ │ ├── CoreConstant.java │ │ │ │ ├── FavoritesAPI.java │ │ │ │ ├── GroupsAPI.java │ │ │ │ ├── NetworksAPI.java │ │ │ │ ├── NodesAPI.java │ │ │ │ ├── PeopleAPI.java │ │ │ │ ├── PreferencesAPI.java │ │ │ │ ├── QueriesAPI.java │ │ │ │ ├── RatingsAPI.java │ │ │ │ ├── RenditionsAPI.java │ │ │ │ ├── SharedLinksAPI.java │ │ │ │ ├── SitesAPI.java │ │ │ │ ├── TagsAPI.java │ │ │ │ ├── TrashcanAPI.java │ │ │ │ ├── VersionAPI.java │ │ │ │ └── model │ │ │ │ │ ├── body │ │ │ │ │ ├── AssociationBody.java │ │ │ │ │ ├── CheckinBody.java │ │ │ │ │ ├── ChildAssociationBody.java │ │ │ │ │ ├── CommentBody.java │ │ │ │ │ ├── CompanyBody.java │ │ │ │ │ ├── FavoriteBodyCreate.java │ │ │ │ │ ├── GroupBodyCreate.java │ │ │ │ │ ├── GroupBodyUpdate.java │ │ │ │ │ ├── GroupMemberBodyAdd.java │ │ │ │ │ ├── NodeBodyCopy.java │ │ │ │ │ ├── NodeBodyCreate.java │ │ │ │ │ ├── NodeBodyCreateAssociation.java │ │ │ │ │ ├── NodeBodyLock.java │ │ │ │ │ ├── NodeBodyMove.java │ │ │ │ │ ├── NodeBodyUnLock.java │ │ │ │ │ ├── NodeBodyUpdate.java │ │ │ │ │ ├── PermissionsBodyUpdate.java │ │ │ │ │ ├── PersonBodyCreate.java │ │ │ │ │ ├── PersonBodyUpdate.java │ │ │ │ │ ├── RatingBody.java │ │ │ │ │ ├── RenditionBodyCreate.java │ │ │ │ │ ├── RevertBody.java │ │ │ │ │ ├── SharedLinkBodyCreate.java │ │ │ │ │ ├── SharedLinkBodyEmail.java │ │ │ │ │ ├── SiteBodyCreate.java │ │ │ │ │ ├── SiteBodyUpdate.java │ │ │ │ │ ├── SiteMembershipBodyCreate.java │ │ │ │ │ ├── SiteMembershipBodyUpdate.java │ │ │ │ │ ├── SiteMembershipRequestBodyCreate.java │ │ │ │ │ ├── SiteMembershipRequestBodyUpdate.java │ │ │ │ │ └── TagBody.java │ │ │ │ │ ├── deserializer │ │ │ │ │ └── FavoriteEntryDeserializer.java │ │ │ │ │ ├── parameters │ │ │ │ │ ├── FieldsParam.java │ │ │ │ │ ├── IncludeParam.java │ │ │ │ │ └── OrderByParam.java │ │ │ │ │ └── representation │ │ │ │ │ ├── ActivityRepresentation.java │ │ │ │ │ ├── AssociationInfoRepresentation.java │ │ │ │ │ ├── AssociationRepresentation.java │ │ │ │ │ ├── ChildAssociationRepresentation.java │ │ │ │ │ ├── CommentRepresentation.java │ │ │ │ │ ├── CompanyRepresentation.java │ │ │ │ │ ├── ContentInfoRepresentation.java │ │ │ │ │ ├── DeletedNodeRepresentation.java │ │ │ │ │ ├── FavoriteNodeRepresentation.java │ │ │ │ │ ├── FavoriteRepresentation.java │ │ │ │ │ ├── FavoriteSiteRepresentation.java │ │ │ │ │ ├── GroupMemberRepresentation.java │ │ │ │ │ ├── GroupRepresentation.java │ │ │ │ │ ├── NetworkQuotaRepresentation.java │ │ │ │ │ ├── NodeRepresentation.java │ │ │ │ │ ├── PathInfoRepresentation.java │ │ │ │ │ ├── PermissionElementRepresentation.java │ │ │ │ │ ├── PermissionsInfoRepresentation.java │ │ │ │ │ ├── PersonNetworkRepresentation.java │ │ │ │ │ ├── PersonRepresentation.java │ │ │ │ │ ├── PreferenceRepresentation.java │ │ │ │ │ ├── RatingAggregateRepresentation.java │ │ │ │ │ ├── RatingIdEnum.java │ │ │ │ │ ├── RatingRepresentation.java │ │ │ │ │ ├── RenditionRepresentation.java │ │ │ │ │ ├── RenditionStatusEnum.java │ │ │ │ │ ├── ServerInfoRepresentation.java │ │ │ │ │ ├── SharedLinkRepresentation.java │ │ │ │ │ ├── SiteContainerRepresentation.java │ │ │ │ │ ├── SiteMemberRepresentation.java │ │ │ │ │ ├── SiteMembershipRequestRepresentation.java │ │ │ │ │ ├── SiteRepresentation.java │ │ │ │ │ ├── SiteRoleEnum.java │ │ │ │ │ ├── SiteRoleRepresentation.java │ │ │ │ │ ├── SiteVisibilityEnum.java │ │ │ │ │ ├── SubscriptionLevelEnum.java │ │ │ │ │ ├── TagRepresentation.java │ │ │ │ │ ├── UserInfoRepresentation.java │ │ │ │ │ └── VersionRepresentation.java │ │ │ ├── discovery │ │ │ │ ├── DiscoveryAPI.java │ │ │ │ ├── DiscoveryConstant.java │ │ │ │ └── model │ │ │ │ │ ├── EntitlementsInfoRepresentation.java │ │ │ │ │ ├── LicenseInfoRepresentation.java │ │ │ │ │ ├── ModuleInfoRepresentation.java │ │ │ │ │ ├── RepositoryInfoRepresentation.java │ │ │ │ │ ├── StatusInfoRepresentation.java │ │ │ │ │ └── VersionInfoRepresentation.java │ │ │ ├── search │ │ │ │ ├── SearchAPI.java │ │ │ │ ├── SearchConstant.java │ │ │ │ ├── body │ │ │ │ │ ├── QueryBody.java │ │ │ │ │ ├── RequestDefaults.java │ │ │ │ │ ├── RequestFacetFields.java │ │ │ │ │ ├── RequestFacetFieldsFacets.java │ │ │ │ │ ├── RequestFacetQuery.java │ │ │ │ │ ├── RequestFilterQuery.java │ │ │ │ │ ├── RequestHighlight.java │ │ │ │ │ ├── RequestHighlightField.java │ │ │ │ │ ├── RequestLimits.java │ │ │ │ │ ├── RequestPagination.java │ │ │ │ │ ├── RequestQuery.java │ │ │ │ │ ├── RequestScope.java │ │ │ │ │ ├── RequestSortDefinition.java │ │ │ │ │ ├── RequestSpellcheck.java │ │ │ │ │ └── RequestTemplate.java │ │ │ │ ├── deserializer │ │ │ │ │ └── ResultSetPagingDeserializer.java │ │ │ │ └── model │ │ │ │ │ ├── ResponseConsistency.java │ │ │ │ │ ├── ResultNodeRepresentation.java │ │ │ │ │ ├── ResultSetContext.java │ │ │ │ │ ├── ResultSetContextBuckets.java │ │ │ │ │ ├── ResultSetContextFacetFields.java │ │ │ │ │ ├── ResultSetContextFacetQueries.java │ │ │ │ │ ├── ResultSetContextSpellcheck.java │ │ │ │ │ ├── ResultSetRepresentation.java │ │ │ │ │ ├── SearchEntry.java │ │ │ │ │ ├── SearchEntryHighlight.java │ │ │ │ │ └── SearchScore.java │ │ │ └── workflow │ │ │ │ ├── WorkflowAPI.java │ │ │ │ └── WorkflowConstant.java │ │ │ └── utils │ │ │ └── authentication │ │ │ └── saml │ │ │ ├── SAMLConstant.java │ │ │ └── models │ │ │ ├── SamlEnabledRepresentation.java │ │ │ ├── SamlEnabledRepresentationEntry.java │ │ │ ├── SamlTicketRepresentation.java │ │ │ └── SamlTicketRepresentationEntry.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── alfresco │ │ │ └── client │ │ │ └── api │ │ │ ├── AlfrescoAPITestCase.java │ │ │ └── tests │ │ │ ├── authentication │ │ │ └── AuthenticationApiTest.java │ │ │ ├── core │ │ │ ├── ActivityStreamApiTest.java │ │ │ ├── CommentsApiTest.java │ │ │ ├── FavoritesApiTest.java │ │ │ ├── NodesApiTest.java │ │ │ ├── PeopleApiTest.java │ │ │ ├── RatingApiTest.java │ │ │ ├── SharedLinkTest.java │ │ │ ├── SiteApiTest.java │ │ │ ├── TagApiTest.java │ │ │ └── TrashcanApiTest.java │ │ │ ├── search │ │ │ └── SearchApiTest.java │ │ │ └── utils │ │ │ ├── IOUtils.java │ │ │ └── NodeRefUtils.java │ │ └── resources │ │ ├── com │ │ └── alfresco │ │ │ └── client │ │ │ └── api │ │ │ └── tests │ │ │ ├── test.txt │ │ │ └── test2.txt │ │ └── testng.xml └── client-commons │ ├── README.md │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── alfresco │ │ └── client │ │ ├── AbstractClient.java │ │ ├── RestClient.java │ │ └── utils │ │ ├── Base64.java │ │ └── ISO8601Utils.java │ └── test │ └── java │ └── com │ └── alfresco │ └── client │ └── tests │ └── utils │ └── IOUtils.java ├── client-samples ├── client-samples-cli │ ├── README.md │ ├── docs │ │ └── SampleAlfrescoCLI.PNG │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── alfresco │ │ └── client │ │ └── cli │ │ ├── AlfrescoCLI.java │ │ └── AlfrescoCommands.java └── client-samples-java │ ├── README.md │ ├── pom.xml │ └── src │ └── main │ └── java │ └── org │ └── alfresco │ └── client │ └── samples │ ├── SampleConstants.java │ ├── batch │ └── HelloECM.java │ ├── customclient │ ├── CustomECM.java │ ├── deserializer │ │ ├── NodeDeserializer.java │ │ └── ServerInfoDeserializer.java │ ├── model │ │ ├── Node.java │ │ └── NodeImpl.java │ └── services │ │ ├── NodeService.java │ │ └── ServerInfoService.java │ ├── lambdas │ └── LambdasRxECM.java │ └── tutorial │ ├── IOUtils.java │ └── TutorialTest.java ├── docs ├── README.md └── openapi │ ├── alfresco-auth.yaml │ ├── alfresco-core.yaml │ ├── alfresco-discovery.yaml │ └── alfresco-search.yaml └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | #Android generated 2 | bin 3 | gen 4 | lint.xml 5 | 6 | #Eclipse 7 | .project 8 | .classpath 9 | .settings 10 | .checkstyle 11 | 12 | #IntelliJ IDEA 13 | .idea 14 | *.iml 15 | *.ipr 16 | *.iws 17 | classes 18 | gen-external-apklibs 19 | 20 | #Maven 21 | target 22 | release.properties 23 | pom.xml.* 24 | 25 | #GRADLE 26 | .gradle 27 | /local.properties 28 | .DS_Store 29 | /build 30 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/pom.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 22 | 4.0.0 23 | 24 | org.alfresco.client 25 | alfresco-client 26 | 1.0.0-beta1 27 | ../../ 28 | 29 | alfresco-java-client 30 | Alfresco One Client API 31 | Alfresco Client API 32 | jar 33 | 34 | 35 | 1.7 36 | 1.7 37 | 1.8 38 | 1.8 39 | 40 | 41 | 42 | 43 | org.alfresco.client 44 | client-commons 45 | 46 | 47 | com.squareup.retrofit2 48 | retrofit 49 | 50 | 51 | com.squareup.retrofit2 52 | adapter-rxjava 53 | 54 | 55 | com.squareup.retrofit2 56 | converter-gson 57 | 58 | 59 | com.squareup.okhttp3 60 | okhttp 61 | 62 | 63 | com.squareup.okhttp3 64 | logging-interceptor 65 | 66 | 67 | io.reactivex 68 | rxjava 69 | 70 | 71 | 72 | org.testng 73 | testng 74 | test 75 | 76 | 77 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client; 20 | 21 | /** 22 | * Informations relatives to the SDK. 23 | * 24 | * @author Jean Marie Pascal 25 | */ 26 | public class Version 27 | { 28 | /** 29 | * The user-visible version string. E.g., "1.0" or "3.4b5". 30 | */ 31 | public static int SDK = 1; 32 | } -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/authentication/AuthenticationConstant.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.authentication; 2 | 3 | import com.alfresco.client.api.common.constant.APIConstant; 4 | 5 | /** 6 | * Created by jpascal on 05/10/2016. 7 | */ 8 | public interface AuthenticationConstant extends APIConstant 9 | { 10 | String AUTHENTICATION_PUBLIC_API_V1 = PREFIX_PUBLIC_API + "authentication/versions/1"; 11 | } 12 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/authentication/AuthenticationUtils.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.authentication; 2 | 3 | import okhttp3.OkHttpClient; 4 | 5 | /** 6 | * Created by jpascal on 11/10/2016. 7 | */ 8 | // TODO Design it better to support Ticket Authentication 9 | public class AuthenticationUtils 10 | { 11 | 12 | public static String getTicket(String baseUrl) 13 | { 14 | OkHttpClient client = new OkHttpClient(); 15 | return null; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/authentication/body/TicketBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.authentication.body; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 22/08/2016. 25 | */ 26 | public class TicketBody 27 | { 28 | @SerializedName("userId") 29 | public final String userId; 30 | 31 | @SerializedName("password") 32 | private final String password; 33 | 34 | public TicketBody(String userId, String password) 35 | { 36 | this.userId = userId; 37 | this.password = password; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/authentication/representation/TicketRepresentation.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.authentication.representation; 2 | 3 | import java.util.Objects; 4 | 5 | import com.alfresco.client.api.common.representation.AbstractRepresentation; 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | /** 9 | * Created by jpascal on 04/10/2016. 10 | */ 11 | public class TicketRepresentation extends AbstractRepresentation 12 | { 13 | 14 | @SerializedName("id") 15 | private String id = null; 16 | 17 | @SerializedName("userId") 18 | private String userId = null; 19 | 20 | /** 21 | * Get id 22 | * 23 | * @return id 24 | **/ 25 | public String getId() 26 | { 27 | return id; 28 | } 29 | 30 | public void setId(String id) 31 | { 32 | this.id = id; 33 | } 34 | 35 | /** 36 | * Get userId 37 | * 38 | * @return userId 39 | **/ 40 | public String getUserId() 41 | { 42 | return userId; 43 | } 44 | 45 | public void setUserId(String userId) 46 | { 47 | this.userId = userId; 48 | } 49 | 50 | @Override 51 | public boolean equals(java.lang.Object o) 52 | { 53 | if (this == o) { return true; } 54 | if (o == null || getClass() != o.getClass()) { return false; } 55 | TicketRepresentation ticket = (TicketRepresentation) o; 56 | return Objects.equals(this.id, ticket.id) && Objects.equals(this.userId, ticket.userId); 57 | } 58 | 59 | @Override 60 | public int hashCode() 61 | { 62 | return Objects.hash(id, userId); 63 | } 64 | 65 | @Override 66 | public String toString() 67 | { 68 | StringBuilder sb = new StringBuilder(); 69 | sb.append("class Ticket {\n"); 70 | 71 | sb.append(" id: ").append(toIndentedString(id)).append("\n"); 72 | sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); 73 | sb.append("}"); 74 | return sb.toString(); 75 | } 76 | 77 | /** 78 | * Convert the given object to string with each line indented by 4 spaces 79 | * (except the first line). 80 | */ 81 | private String toIndentedString(java.lang.Object o) 82 | { 83 | if (o == null) { return "null"; } 84 | return o.toString().replace("\n", "\n "); 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/authentication/representation/ValidTicketRepresentation.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.authentication.representation; 2 | 3 | import java.util.Objects; 4 | 5 | import com.alfresco.client.api.common.representation.AbstractRepresentation; 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | /** 9 | * Created by jpascal on 04/10/2016. 10 | */ 11 | public class ValidTicketRepresentation extends AbstractRepresentation 12 | { 13 | 14 | @SerializedName("id") 15 | private String id = null; 16 | 17 | /** 18 | * Get id 19 | * 20 | * @return id 21 | **/ 22 | public String getId() 23 | { 24 | return id; 25 | } 26 | 27 | public void setId(String id) 28 | { 29 | this.id = id; 30 | } 31 | 32 | @Override 33 | public boolean equals(java.lang.Object o) 34 | { 35 | if (this == o) { return true; } 36 | if (o == null || getClass() != o.getClass()) { return false; } 37 | ValidTicketRepresentation validTicket = (ValidTicketRepresentation) o; 38 | return Objects.equals(this.id, validTicket.id); 39 | } 40 | 41 | @Override 42 | public int hashCode() 43 | { 44 | return Objects.hash(id); 45 | } 46 | 47 | @Override 48 | public String toString() 49 | { 50 | StringBuilder sb = new StringBuilder(); 51 | sb.append("class ValidTicket {\n"); 52 | 53 | sb.append(" id: ").append(toIndentedString(id)).append("\n"); 54 | sb.append("}"); 55 | return sb.toString(); 56 | } 57 | 58 | /** 59 | * Convert the given object to string with each line indented by 4 spaces 60 | * (except the first line). 61 | */ 62 | private String toIndentedString(java.lang.Object o) 63 | { 64 | if (o == null) { return "null"; } 65 | return o.toString().replace("\n", "\n "); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/common/constant/APIConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.common.constant; 20 | 21 | public interface APIConstant 22 | { 23 | String PREFIX_PUBLIC_API = "api/-default-/public/"; 24 | } 25 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/common/deserializer/EntryDeserializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.common.deserializer; 20 | 21 | import java.lang.reflect.Type; 22 | 23 | import com.alfresco.client.api.common.constant.PublicAPIConstant; 24 | import com.alfresco.client.utils.ISO8601Utils; 25 | import com.google.gson.*; 26 | 27 | /** 28 | * Created by jpascal on 19/01/2016. 29 | */ 30 | public class EntryDeserializer implements JsonDeserializer 31 | { 32 | @Override 33 | public T deserialize(JsonElement je, Type type, JsonDeserializationContext jdc) throws JsonParseException 34 | { 35 | JsonElement entry = je; 36 | if (je.getAsJsonObject().has(PublicAPIConstant.ENTRY_VALUE)) 37 | { 38 | entry = je.getAsJsonObject().get(PublicAPIConstant.ENTRY_VALUE); 39 | } 40 | return new GsonBuilder().setDateFormat(ISO8601Utils.DATE_ISO_FORMAT).create().fromJson(entry, type); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/common/deserializer/PagingDeserializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.common.deserializer; 20 | 21 | import java.lang.reflect.Type; 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | import com.alfresco.client.api.common.constant.PublicAPIConstant; 26 | import com.alfresco.client.api.common.representation.PaginationRepresentation; 27 | import com.alfresco.client.api.common.representation.ResultPaging; 28 | import com.google.gson.*; 29 | 30 | /** 31 | * Created by jpascal on 19/01/2016. 32 | */ 33 | public class PagingDeserializer implements JsonDeserializer> 34 | { 35 | protected Class clazz; 36 | 37 | public PagingDeserializer(Class clazz) 38 | { 39 | this.clazz = clazz; 40 | } 41 | 42 | @Override 43 | public ResultPaging deserialize(JsonElement je, Type type, JsonDeserializationContext jdc) 44 | throws JsonParseException 45 | { 46 | JsonObject pagination = null; 47 | JsonArray entries = null; 48 | if (je.getAsJsonObject().has(PublicAPIConstant.LIST_VALUE)) 49 | { 50 | pagination = je.getAsJsonObject().get(PublicAPIConstant.LIST_VALUE).getAsJsonObject() 51 | .get(PublicAPIConstant.PAGINATION_VALUE).getAsJsonObject(); 52 | entries = je.getAsJsonObject().get(PublicAPIConstant.LIST_VALUE).getAsJsonObject() 53 | .get(PublicAPIConstant.ENTRIES_VALUE).getAsJsonArray(); 54 | } 55 | 56 | final List result = new ArrayList<>(); 57 | T obj = null; 58 | for (Object entry : entries) 59 | { 60 | obj = jdc.deserialize((JsonElement) entry, clazz); 61 | result.add(obj); 62 | } 63 | 64 | PaginationRepresentation paging = jdc.deserialize(pagination, PaginationRepresentation.class); 65 | 66 | return new ResultPaging(result, paging); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/common/representation/AbstractRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.common.representation; 20 | 21 | public class AbstractRepresentation 22 | { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/common/representation/ResultPaging.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.common.representation; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * Created by jpascal on 19/01/2016. 25 | */ 26 | public class ResultPaging 27 | { 28 | 29 | /** List of all object present in a page. */ 30 | protected List objects; 31 | 32 | protected PaginationRepresentation pagination; 33 | 34 | public ResultPaging(List objects, PaginationRepresentation pagination) 35 | { 36 | this.objects = objects; 37 | this.pagination = pagination; 38 | } 39 | 40 | /** {@inheritDoc} */ 41 | public List getList() 42 | { 43 | return objects; 44 | } 45 | 46 | /** {@inheritDoc} */ 47 | public Boolean hasMoreItems() 48 | { 49 | return pagination.getHasMoreItems(); 50 | } 51 | 52 | /** {@inheritDoc} */ 53 | public int getCount() 54 | { 55 | return pagination.getCount(); 56 | } 57 | 58 | public PaginationRepresentation getPagination() 59 | { 60 | return pagination; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/CoreConstant.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core; 2 | 3 | import com.alfresco.client.api.common.constant.APIConstant; 4 | 5 | /** 6 | * Created by jpascal on 05/10/2016. 7 | */ 8 | public interface CoreConstant extends APIConstant 9 | { 10 | String CORE_PUBLIC_API_V1 = PREFIX_PUBLIC_API + "alfresco/versions/1"; 11 | } 12 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/AssociationBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 22/08/2016. 25 | */ 26 | public class AssociationBody 27 | { 28 | @SerializedName("targetId") 29 | public final String targetId; 30 | 31 | @SerializedName("assocType") 32 | public final String assocType; 33 | 34 | public AssociationBody(String targetId, String assocType) 35 | { 36 | this.targetId = targetId; 37 | this.assocType = assocType; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/CheckinBody.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.body; 2 | 3 | import java.util.Map; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | /** 8 | * CheckinBody 9 | */ 10 | public class CheckinBody 11 | { 12 | @SerializedName("majorVersion") 13 | public final Boolean majorVersion; 14 | 15 | @SerializedName("comment") 16 | public final String comment; 17 | 18 | @SerializedName("properties") 19 | public final Map properties; 20 | 21 | public CheckinBody(Boolean majorVersion, String comment, Map properties) 22 | { 23 | this.majorVersion = majorVersion != null ? false : majorVersion; 24 | this.comment = comment; 25 | this.properties = properties; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/ChildAssociationBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | /** 22 | * Created by jpascal on 29/07/2016. 23 | */ 24 | public class ChildAssociationBody 25 | { 26 | public final String childId; 27 | 28 | public final String assocType; 29 | 30 | public ChildAssociationBody(String childId) 31 | { 32 | this.childId = childId; 33 | this.assocType = null; 34 | } 35 | 36 | public ChildAssociationBody(String childId, String assocType) 37 | { 38 | this.childId = childId; 39 | this.assocType = assocType; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/CommentBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 15/12/2015. 25 | */ 26 | public class CommentBody 27 | { 28 | @SerializedName("content") 29 | private final String content; 30 | 31 | public CommentBody(String content) 32 | { 33 | this.content = content; 34 | } 35 | 36 | public String getContent() 37 | { 38 | return content; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/CompanyBody.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.body; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Company 7 | */ 8 | public class CompanyBody 9 | { 10 | @SerializedName("organization") 11 | public final String organization; 12 | 13 | @SerializedName("address1") 14 | public final String address1; 15 | 16 | @SerializedName("address2") 17 | public final String address2; 18 | 19 | @SerializedName("address3") 20 | public final String address3; 21 | 22 | @SerializedName("postcode") 23 | public final String postcode; 24 | 25 | @SerializedName("telephone") 26 | public final String telephone; 27 | 28 | @SerializedName("fax") 29 | public final String fax; 30 | 31 | @SerializedName("email") 32 | public final String email; 33 | 34 | public CompanyBody(String organization, String address1, String address2, String address3, String postcode, 35 | String telephone, String fax, String email) 36 | { 37 | this.organization = organization; 38 | this.address1 = address1; 39 | this.address2 = address2; 40 | this.address3 = address3; 41 | this.postcode = postcode; 42 | this.telephone = telephone; 43 | this.fax = fax; 44 | this.email = email; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/FavoriteBodyCreate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 25/08/2016. 25 | */ 26 | public class FavoriteBodyCreate 27 | { 28 | @SerializedName("target") 29 | public final Object target; 30 | 31 | public enum FavoriteTypeEnum 32 | { 33 | SITE("SITE"), 34 | 35 | FILE("FILE"), 36 | 37 | FOLDER("FOLDER"); 38 | 39 | private String value; 40 | 41 | FavoriteTypeEnum(String value) 42 | { 43 | this.value = value; 44 | } 45 | 46 | @Override 47 | public String toString() 48 | { 49 | return String.valueOf(value); 50 | } 51 | 52 | public String value() 53 | { 54 | return value; 55 | } 56 | } 57 | 58 | public FavoriteBodyCreate(FavoriteTypeEnum type, String guid) 59 | { 60 | switch (type) 61 | { 62 | case FILE: 63 | this.target = new FavoriteFileRequest(new FavoriteGuid(guid)); 64 | break; 65 | case FOLDER: 66 | this.target = new FavoriteFolderRequest(new FavoriteGuid(guid)); 67 | break; 68 | case SITE: 69 | this.target = new FavoriteSiteRequest(new FavoriteGuid(guid)); 70 | break; 71 | default: 72 | this.target = null; 73 | } 74 | } 75 | 76 | private class FavoriteGuid 77 | { 78 | @SerializedName("guid") 79 | public final String guid; 80 | 81 | public FavoriteGuid(String guid) 82 | { 83 | this.guid = guid; 84 | } 85 | } 86 | 87 | private class FavoriteSiteRequest 88 | { 89 | @SerializedName("site") 90 | public final FavoriteGuid site; 91 | 92 | public FavoriteSiteRequest(FavoriteGuid site) 93 | { 94 | this.site = site; 95 | } 96 | } 97 | 98 | private class FavoriteFileRequest 99 | { 100 | @SerializedName("file") 101 | public final FavoriteGuid site; 102 | 103 | public FavoriteFileRequest(FavoriteGuid site) 104 | { 105 | this.site = site; 106 | } 107 | } 108 | 109 | private class FavoriteFolderRequest 110 | { 111 | @SerializedName("folder") 112 | public final FavoriteGuid site; 113 | 114 | public FavoriteFolderRequest(FavoriteGuid site) 115 | { 116 | this.site = site; 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/GroupBodyCreate.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.body; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * GroupBodyCreate 7 | */ 8 | public class GroupBodyCreate 9 | { 10 | @SerializedName("id") 11 | public final String id; 12 | 13 | @SerializedName("displayName") 14 | public final String displayName; 15 | 16 | @SerializedName("parentGroupId") 17 | public final String parentGroupId; 18 | 19 | public GroupBodyCreate(String id, String displayName, String parentGroupId) 20 | { 21 | this.id = id; 22 | this.displayName = displayName; 23 | this.parentGroupId = parentGroupId; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/GroupBodyUpdate.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.body; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * GroupBodyUpdate 7 | */ 8 | public class GroupBodyUpdate 9 | { 10 | @SerializedName("displayName") 11 | public final String displayName; 12 | 13 | public GroupBodyUpdate(String displayName) 14 | { 15 | this.displayName = displayName; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/GroupMemberBodyAdd.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.body; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * GroupMemberBodyAdd 7 | */ 8 | public class GroupMemberBodyAdd 9 | { 10 | @SerializedName("groupMembmerId") 11 | public final String groupMembmerId; 12 | 13 | public GroupMemberBodyAdd(String groupMembmerId) 14 | { 15 | this.groupMembmerId = groupMembmerId; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/NodeBodyCopy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 15/12/2015. 25 | */ 26 | public class NodeBodyCopy 27 | { 28 | @SerializedName("name") 29 | public final String name; 30 | 31 | @SerializedName("targetParentId") 32 | public final String targetParentId; 33 | 34 | public NodeBodyCopy(String targetParentId) 35 | { 36 | this.targetParentId = targetParentId; 37 | this.name = null; 38 | } 39 | 40 | public NodeBodyCopy(String targetParentId, String name) 41 | { 42 | this.targetParentId = targetParentId; 43 | this.name = name; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/NodeBodyCreateAssociation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package com.alfresco.client.api.core.model.body; 19 | 20 | /** 21 | * NodeBodyCreateAssociation 22 | */ 23 | public class NodeBodyCreateAssociation 24 | { 25 | public final String assocType; 26 | 27 | public NodeBodyCreateAssociation(String assocType) 28 | { 29 | this.assocType = assocType; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/NodeBodyLock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 22/08/2016. 25 | */ 26 | public class NodeBodyLock 27 | { 28 | /** 29 | * Gets or Sets type 30 | */ 31 | public enum TypeEnum 32 | { 33 | @SerializedName("FULL") FULL("FULL"), 34 | 35 | @SerializedName("ALLOW_ADD_CHILDREN") ALLOW_ADD_CHILDREN("ALLOW_ADD_CHILDREN"), 36 | 37 | @SerializedName("ALLOW_OWNER_CHANGES") ALLOW_OWNER_CHANGES("ALLOW_OWNER_CHANGES"); 38 | 39 | private String value; 40 | 41 | TypeEnum(String value) 42 | { 43 | this.value = value; 44 | } 45 | 46 | @Override 47 | public String toString() 48 | { 49 | return String.valueOf(value); 50 | } 51 | } 52 | 53 | /** 54 | * Gets or Sets lifetime 55 | */ 56 | public enum LifetimeEnum 57 | { 58 | @SerializedName("PERSISTENT") PERSISTENT("PERSISTENT"), 59 | 60 | @SerializedName("EPHEMERAL") EPHEMERAL("EPHEMERAL"); 61 | 62 | private String value; 63 | 64 | LifetimeEnum(String value) 65 | { 66 | this.value = value; 67 | } 68 | 69 | @Override 70 | public String toString() 71 | { 72 | return String.valueOf(value); 73 | } 74 | } 75 | 76 | @SerializedName("timeToExpire") 77 | public final Integer timeToExpire; 78 | 79 | @SerializedName("type") 80 | public final TypeEnum type; 81 | 82 | @SerializedName("lifetime") 83 | public final LifetimeEnum lifetime; 84 | 85 | public NodeBodyLock() 86 | { 87 | this.timeToExpire = null; 88 | this.type = null; 89 | this.lifetime = null; 90 | } 91 | 92 | public NodeBodyLock(Integer timeToExpire, TypeEnum type, LifetimeEnum lifetime) 93 | { 94 | this.timeToExpire = timeToExpire; 95 | this.type = type != null ? type : TypeEnum.ALLOW_OWNER_CHANGES; 96 | this.lifetime = lifetime != null ? lifetime : LifetimeEnum.PERSISTENT; 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/NodeBodyMove.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 15/12/2015. 25 | */ 26 | public class NodeBodyMove 27 | { 28 | @SerializedName("targetParentId") 29 | public final String targetParentId; 30 | 31 | @SerializedName("name") 32 | public final String name; 33 | 34 | public NodeBodyMove(String targetParentId, String name) 35 | { 36 | this.name = name; 37 | this.targetParentId = targetParentId; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/NodeBodyUnLock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 22/08/2016. 25 | */ 26 | public class NodeBodyUnLock 27 | { 28 | @SerializedName("includeChildren") 29 | public final Boolean includeChildren; 30 | 31 | @SerializedName("allowCheckedOut") 32 | public final Boolean allowCheckedOut; 33 | 34 | public NodeBodyUnLock() 35 | { 36 | this.includeChildren = null; 37 | this.allowCheckedOut = null; 38 | } 39 | 40 | public NodeBodyUnLock(Boolean includeChildren, Boolean allowCheckedOut) 41 | { 42 | this.includeChildren = includeChildren != null ? includeChildren : false; 43 | this.allowCheckedOut = allowCheckedOut != null ? allowCheckedOut : false; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/PermissionsBodyUpdate.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.body; 2 | 3 | import java.util.List; 4 | 5 | import com.alfresco.client.api.core.model.representation.PermissionElementRepresentation; 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | /** 9 | * PermissionsBodyUpdate 10 | */ 11 | public class PermissionsBodyUpdate 12 | { 13 | @SerializedName("isInheritanceEnabled") 14 | public final Boolean isInheritanceEnabled; 15 | 16 | @SerializedName("locallySet") 17 | public final List locallySet; 18 | 19 | public PermissionsBodyUpdate(Boolean isInheritanceEnabled, List locallySet) 20 | { 21 | this.isInheritanceEnabled = isInheritanceEnabled; 22 | this.locallySet = locallySet; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/RatingBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 15/12/2015. 25 | */ 26 | public class RatingBody 27 | { 28 | @SerializedName("id") 29 | public final String id; 30 | 31 | @SerializedName("myRating") 32 | public final Object myRating; 33 | 34 | public RatingBody(String id, Object myRating) 35 | { 36 | this.id = id; 37 | this.myRating = myRating; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/RenditionBodyCreate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 15/12/2015. 25 | */ 26 | public class RenditionBodyCreate 27 | { 28 | @SerializedName("id") 29 | public final String id; 30 | 31 | public RenditionBodyCreate(String id, String myRating) 32 | { 33 | this.id = id; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/RevertBody.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.body; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by jpascal on 30/09/2016. 7 | */ 8 | public class RevertBody 9 | { 10 | @SerializedName("comment") 11 | public final String comment; 12 | 13 | @SerializedName("majorVersion") 14 | public final Boolean majorVersion; 15 | 16 | public RevertBody(String comment, Boolean majorVersion) 17 | { 18 | this.comment = comment; 19 | this.majorVersion = majorVersion; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/SharedLinkBodyCreate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import java.util.Date; 22 | 23 | import com.google.gson.annotations.SerializedName; 24 | 25 | /** 26 | * Created by jpascal on 23/08/2016. 27 | */ 28 | public class SharedLinkBodyCreate 29 | { 30 | @SerializedName("nodeId") 31 | public final String nodeId; 32 | 33 | @SerializedName("expiresAt") 34 | public final Date expiresAt; 35 | 36 | public SharedLinkBodyCreate(String nodeId) 37 | { 38 | this.nodeId = nodeId; 39 | this.expiresAt = null; 40 | } 41 | 42 | public SharedLinkBodyCreate(String nodeId, Date expiresAt) 43 | { 44 | this.nodeId = nodeId; 45 | this.expiresAt = expiresAt; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/SharedLinkBodyEmail.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import java.util.List; 22 | 23 | import com.google.gson.annotations.SerializedName; 24 | 25 | /** 26 | * Created by jpascal on 23/08/2016. 27 | */ 28 | public class SharedLinkBodyEmail 29 | { 30 | 31 | @SerializedName("client") 32 | public final String client; 33 | 34 | @SerializedName("message") 35 | public final String message; 36 | 37 | @SerializedName("locale") 38 | public final String locale; 39 | 40 | @SerializedName("recipientEmails") 41 | public final List recipientEmails; 42 | 43 | public SharedLinkBodyEmail(String client, String message, String locale, List recipientEmails) 44 | { 45 | this.client = client; 46 | this.message = message; 47 | this.locale = locale; 48 | this.recipientEmails = recipientEmails; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/SiteBodyCreate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.alfresco.client.api.core.model.representation.SiteVisibilityEnum; 22 | import com.google.gson.annotations.SerializedName; 23 | 24 | /** 25 | * Created by jpascal on 15/12/2015. 26 | */ 27 | public class SiteBodyCreate 28 | { 29 | @SerializedName("id") 30 | private String id = null; 31 | 32 | @SerializedName("title") 33 | private String title = null; 34 | 35 | @SerializedName("description") 36 | private String description = null; 37 | 38 | @SerializedName("visibility") 39 | private SiteVisibilityEnum visibility = null; 40 | 41 | public SiteBodyCreate(String id, String title, String description, SiteVisibilityEnum visibility) 42 | { 43 | this.id = id; 44 | this.title = title; 45 | this.description = description; 46 | this.visibility = visibility; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/SiteBodyUpdate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | import com.alfresco.client.api.core.model.representation.SiteVisibilityEnum; 22 | import com.google.gson.annotations.SerializedName; 23 | 24 | /** 25 | * Created by jpascal on 15/12/2015. 26 | */ 27 | public class SiteBodyUpdate 28 | { 29 | @SerializedName("title") 30 | private String title = null; 31 | 32 | @SerializedName("description") 33 | private String description = null; 34 | 35 | @SerializedName("visibility") 36 | private SiteVisibilityEnum visibility = null; 37 | 38 | public SiteBodyUpdate(String description) 39 | { 40 | this.description = description; 41 | } 42 | 43 | public SiteBodyUpdate(String title, String description, SiteVisibilityEnum visibility) 44 | { 45 | this.title = title; 46 | this.description = description; 47 | this.visibility = visibility; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/SiteMembershipBodyCreate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | /** 22 | * Created by jpascal on 15/12/2015. 23 | */ 24 | public class SiteMembershipBodyCreate 25 | { 26 | public final String role; 27 | 28 | public final String id; 29 | 30 | /** 31 | * Update only 32 | * 33 | * @param role 34 | */ 35 | public SiteMembershipBodyCreate(String personId, String role) 36 | { 37 | this.role = role; 38 | this.id = personId; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/SiteMembershipBodyUpdate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | /** 22 | * Created by jpascal on 15/12/2015. 23 | */ 24 | public class SiteMembershipBodyUpdate 25 | { 26 | public final String role; 27 | 28 | /** 29 | * Update only 30 | * 31 | * @param role 32 | */ 33 | public SiteMembershipBodyUpdate( String role) 34 | { 35 | this.role = role; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/SiteMembershipRequestBodyCreate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | /** 22 | * Created by jpascal on 15/12/2015. 23 | */ 24 | public class SiteMembershipRequestBodyCreate 25 | { 26 | public final String id; 27 | 28 | public final String message; 29 | 30 | public final String title; 31 | 32 | public SiteMembershipRequestBodyCreate(String id) 33 | { 34 | this.id = id; 35 | this.message = null; 36 | this.title = null; 37 | } 38 | 39 | public SiteMembershipRequestBodyCreate(String id, String message, String title) 40 | { 41 | this.id = id; 42 | this.message = message; 43 | this.title = title; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/SiteMembershipRequestBodyUpdate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | /** 22 | * Created by jpascal on 15/12/2015. 23 | */ 24 | public class SiteMembershipRequestBodyUpdate 25 | { 26 | public final String message; 27 | 28 | public SiteMembershipRequestBodyUpdate(String message) 29 | { 30 | this.message = message; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/body/TagBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.body; 20 | 21 | /** 22 | * Created by jpascal on 15/12/2015. 23 | */ 24 | public class TagBody 25 | { 26 | public final String tag; 27 | 28 | public TagBody(String tag) 29 | { 30 | this.tag = tag; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/deserializer/FavoriteEntryDeserializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.deserializer; 20 | 21 | import java.lang.reflect.Type; 22 | 23 | import com.alfresco.client.api.common.constant.PublicAPIConstant; 24 | import com.alfresco.client.api.common.deserializer.EntryDeserializer; 25 | import com.alfresco.client.api.core.model.representation.*; 26 | import com.google.gson.JsonDeserializationContext; 27 | import com.google.gson.JsonElement; 28 | import com.google.gson.JsonObject; 29 | import com.google.gson.JsonParseException; 30 | 31 | /** 32 | * Created by jpascal on 19/01/2016. 33 | */ 34 | public class FavoriteEntryDeserializer extends EntryDeserializer 35 | { 36 | @Override 37 | public FavoriteRepresentation deserialize(JsonElement je, Type type, JsonDeserializationContext jdc) 38 | throws JsonParseException 39 | { 40 | JsonElement entry = je; 41 | if (je.getAsJsonObject().has(PublicAPIConstant.ENTRY_VALUE)) 42 | { 43 | entry = je.getAsJsonObject().get(PublicAPIConstant.ENTRY_VALUE); 44 | } 45 | 46 | FavoriteRepresentation favorite = null; 47 | JsonObject target = entry.getAsJsonObject().get("target").getAsJsonObject(); 48 | if (target.has("file")) 49 | { 50 | favorite = jdc.deserialize(entry, FavoriteNodeRepresentation.class); 51 | NodeRepresentation file = jdc.deserialize(target.get("file").getAsJsonObject(), NodeRepresentation.class); 52 | favorite.setTarget(file); 53 | } 54 | else if (target.has("folder")) 55 | { 56 | favorite = jdc.deserialize(entry, FavoriteNodeRepresentation.class); 57 | NodeRepresentation file = jdc.deserialize(target.get("folder").getAsJsonObject(), NodeRepresentation.class); 58 | favorite.setTarget(file); 59 | } 60 | else if (target.has("site")) 61 | { 62 | favorite = jdc.deserialize(entry, FavoriteSiteRepresentation.class); 63 | SiteRepresentation site = jdc.deserialize(target.get("site").getAsJsonObject(), SiteRepresentation.class); 64 | favorite.setTarget(site); 65 | } 66 | 67 | return favorite; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/parameters/FieldsParam.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.parameters; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * Utility class to transform list of string to comma-separated value as 8 | * required by API 9 | */ 10 | public class FieldsParam 11 | { 12 | private List fieldValues = new ArrayList<>(0); 13 | 14 | public FieldsParam(List fieldValues) 15 | { 16 | this.fieldValues = fieldValues; 17 | } 18 | 19 | public List getValues() 20 | { 21 | return fieldValues; 22 | } 23 | 24 | public void setValues(List fieldValues) 25 | { 26 | this.fieldValues = fieldValues; 27 | } 28 | 29 | @Override 30 | public String toString() 31 | { 32 | return join(fieldValues, ","); 33 | } 34 | 35 | private static String join(List list, String delim) 36 | { 37 | 38 | StringBuilder sb = new StringBuilder(); 39 | 40 | String loopDelim = ""; 41 | 42 | for (String s : list) 43 | { 44 | 45 | sb.append(loopDelim); 46 | sb.append(s); 47 | 48 | loopDelim = delim; 49 | } 50 | 51 | return sb.toString(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/parameters/IncludeParam.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.parameters; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * Utility class to transform list of string to comma-separated value as 8 | * required by API 9 | */ 10 | public class IncludeParam 11 | { 12 | private List fieldValues = new ArrayList<>(0); 13 | 14 | public IncludeParam(List fieldValues) 15 | { 16 | this.fieldValues = fieldValues; 17 | } 18 | 19 | public List getValues() 20 | { 21 | return fieldValues; 22 | } 23 | 24 | public void setValues(List fieldValues) 25 | { 26 | this.fieldValues = fieldValues; 27 | } 28 | 29 | @Override 30 | public String toString() 31 | { 32 | return join(fieldValues, ","); 33 | } 34 | 35 | private static String join(List list, String delim) 36 | { 37 | 38 | StringBuilder sb = new StringBuilder(); 39 | 40 | String loopDelim = ""; 41 | 42 | for (String s : list) 43 | { 44 | 45 | sb.append(loopDelim); 46 | sb.append(s); 47 | 48 | loopDelim = delim; 49 | } 50 | 51 | return sb.toString(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/parameters/OrderByParam.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.parameters; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * Utility class to transform list of string to comma-separated value as 8 | * required by API 9 | */ 10 | public class OrderByParam 11 | { 12 | private List fieldValues = new ArrayList<>(0); 13 | 14 | public OrderByParam(List fieldValues) 15 | { 16 | this.fieldValues = fieldValues; 17 | } 18 | 19 | public List getValues() 20 | { 21 | return fieldValues; 22 | } 23 | 24 | public void setValues(List fieldValues) 25 | { 26 | this.fieldValues = fieldValues; 27 | } 28 | 29 | @Override 30 | public String toString() 31 | { 32 | return join(fieldValues, ","); 33 | } 34 | 35 | private static String join(List list, String delim) 36 | { 37 | 38 | StringBuilder sb = new StringBuilder(); 39 | 40 | String loopDelim = ""; 41 | 42 | for (String s : list) 43 | { 44 | 45 | sb.append(loopDelim); 46 | sb.append(s); 47 | 48 | loopDelim = delim; 49 | } 50 | 51 | return sb.toString(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/AssociationInfoRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import java.util.Objects; 22 | 23 | import com.google.gson.annotations.SerializedName; 24 | 25 | /** 26 | * Created by jpascal on 29/07/2016. 27 | */ 28 | public class AssociationInfoRepresentation 29 | { 30 | @SerializedName("assocType") 31 | protected String assocType = null; 32 | 33 | // High simplification to get same object for getParent or getAssoc 34 | @SerializedName("isPrimary") 35 | private Boolean isPrimary = null; 36 | 37 | /** 38 | * Get assocType 39 | * 40 | * @return assocType 41 | **/ 42 | public String getAssocType() 43 | { 44 | return assocType; 45 | } 46 | 47 | public void setAssocType(String assocType) 48 | { 49 | this.assocType = assocType; 50 | } 51 | 52 | public Boolean getIsPrimary() 53 | { 54 | return isPrimary; 55 | } 56 | 57 | public void setIsPrimary(Boolean isPrimary) 58 | { 59 | this.isPrimary = isPrimary; 60 | } 61 | 62 | @Override 63 | public boolean equals(Object o) 64 | { 65 | if (this == o) { return true; } 66 | if (o == null || getClass() != o.getClass()) { return false; } 67 | AssociationInfoRepresentation assocChild = (AssociationInfoRepresentation) o; 68 | return Objects.equals(this.assocType, assocChild.assocType) 69 | && Objects.equals(this.isPrimary, assocChild.isPrimary); 70 | } 71 | 72 | @Override 73 | public int hashCode() 74 | { 75 | return Objects.hash(assocType); 76 | } 77 | 78 | @Override 79 | public String toString() 80 | { 81 | StringBuilder sb = new StringBuilder(); 82 | sb.append("class AssocChild {\n"); 83 | 84 | sb.append(" assocType: ").append(toIndentedString(assocType)).append("\n"); 85 | sb.append(" isPrimary: ").append(toIndentedString(isPrimary)).append("\n"); 86 | sb.append("}"); 87 | return sb.toString(); 88 | } 89 | 90 | /** 91 | * Convert the given object to string with each line indented by 4 spaces 92 | * (except the first line). 93 | */ 94 | private String toIndentedString(Object o) 95 | { 96 | if (o == null) { return "null"; } 97 | return o.toString().replace("\n", "\n "); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/AssociationRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import java.util.Objects; 22 | 23 | import com.google.gson.annotations.SerializedName; 24 | 25 | /** 26 | * Created by jpascal on 29/07/2016. 27 | */ 28 | public class AssociationRepresentation 29 | { 30 | @SerializedName("targetId") 31 | private String targetId = null; 32 | 33 | @SerializedName("assocType") 34 | private String assocType = null; 35 | 36 | /** 37 | * Get targetId 38 | * 39 | * @return targetId 40 | **/ 41 | public String getTargetId() 42 | { 43 | return targetId; 44 | } 45 | 46 | public void setTargetId(String targetId) 47 | { 48 | this.targetId = targetId; 49 | } 50 | 51 | /** 52 | * Get assocType 53 | * 54 | * @return assocType 55 | **/ 56 | public String getAssocType() 57 | { 58 | return assocType; 59 | } 60 | 61 | public void setAssocType(String assocType) 62 | { 63 | this.assocType = assocType; 64 | } 65 | 66 | @Override 67 | public boolean equals(Object o) 68 | { 69 | if (this == o) { return true; } 70 | if (o == null || getClass() != o.getClass()) { return false; } 71 | AssociationRepresentation assocChild = (AssociationRepresentation) o; 72 | return Objects.equals(this.targetId, assocChild.targetId) 73 | && Objects.equals(this.assocType, assocChild.assocType); 74 | } 75 | 76 | @Override 77 | public int hashCode() 78 | { 79 | return Objects.hash(targetId, assocType); 80 | } 81 | 82 | @Override 83 | public String toString() 84 | { 85 | StringBuilder sb = new StringBuilder(); 86 | sb.append("class AssocChild {\n"); 87 | 88 | sb.append(" targetId: ").append(toIndentedString(targetId)).append("\n"); 89 | sb.append(" assocType: ").append(toIndentedString(assocType)).append("\n"); 90 | sb.append("}"); 91 | return sb.toString(); 92 | } 93 | 94 | /** 95 | * Convert the given object to string with each line indented by 4 spaces 96 | * (except the first line). 97 | */ 98 | private String toIndentedString(Object o) 99 | { 100 | if (o == null) { return "null"; } 101 | return o.toString().replace("\n", "\n "); 102 | } 103 | 104 | } 105 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/ChildAssociationRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import java.util.Objects; 22 | 23 | import com.google.gson.annotations.SerializedName; 24 | 25 | /** 26 | * Created by jpascal on 29/07/2016. 27 | */ 28 | public class ChildAssociationRepresentation 29 | { 30 | @SerializedName("childId") 31 | private String childId = null; 32 | 33 | @SerializedName("assocType") 34 | private String assocType = null; 35 | 36 | /** 37 | * Get childId 38 | * 39 | * @return childId 40 | **/ 41 | public String getChildId() 42 | { 43 | return childId; 44 | } 45 | 46 | public void setChildId(String childId) 47 | { 48 | this.childId = childId; 49 | } 50 | 51 | /** 52 | * Get assocType 53 | * 54 | * @return assocType 55 | **/ 56 | public String getAssocType() 57 | { 58 | return assocType; 59 | } 60 | 61 | public void setAssocType(String assocType) 62 | { 63 | this.assocType = assocType; 64 | } 65 | 66 | @Override 67 | public boolean equals(java.lang.Object o) 68 | { 69 | if (this == o) { return true; } 70 | if (o == null || getClass() != o.getClass()) { return false; } 71 | ChildAssociationRepresentation assocChild = (ChildAssociationRepresentation) o; 72 | return Objects.equals(this.childId, assocChild.childId) && Objects.equals(this.assocType, assocChild.assocType); 73 | } 74 | 75 | @Override 76 | public int hashCode() 77 | { 78 | return Objects.hash(childId, assocType); 79 | } 80 | 81 | @Override 82 | public String toString() 83 | { 84 | StringBuilder sb = new StringBuilder(); 85 | sb.append("class AssocChild {\n"); 86 | 87 | sb.append(" childId: ").append(toIndentedString(childId)).append("\n"); 88 | sb.append(" assocType: ").append(toIndentedString(assocType)).append("\n"); 89 | sb.append("}"); 90 | return sb.toString(); 91 | } 92 | 93 | /** 94 | * Convert the given object to string with each line indented by 4 spaces 95 | * (except the first line). 96 | */ 97 | private String toIndentedString(java.lang.Object o) 98 | { 99 | if (o == null) { return "null"; } 100 | return o.toString().replace("\n", "\n "); 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/FavoriteNodeRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | /** 22 | * Favorite 23 | */ 24 | public class FavoriteNodeRepresentation extends FavoriteRepresentation 25 | { 26 | // /////////////////////////////////////////////////////////////////////////// 27 | // GETTERS & SETTERS 28 | // /////////////////////////////////////////////////////////////////////////// 29 | 30 | public FavoriteNodeRepresentation(NodeRepresentation file) 31 | { 32 | this.target = file; 33 | } 34 | 35 | public NodeRepresentation getFile() 36 | { 37 | return target; 38 | } 39 | 40 | public void setFile(NodeRepresentation target) 41 | { 42 | this.target = target; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/FavoriteSiteRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | /** 22 | * Favorite 23 | */ 24 | public class FavoriteSiteRepresentation extends FavoriteRepresentation 25 | { 26 | // /////////////////////////////////////////////////////////////////////////// 27 | // GETTERS & SETTERS 28 | // /////////////////////////////////////////////////////////////////////////// 29 | 30 | public FavoriteSiteRepresentation(SiteRepresentation file) 31 | { 32 | this.target = file; 33 | } 34 | 35 | public SiteRepresentation getSite() 36 | { 37 | return target; 38 | } 39 | 40 | public void setSite(SiteRepresentation target) 41 | { 42 | this.target = target; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/GroupMemberRepresentation.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.representation; 2 | 3 | import java.util.Objects; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | /** 8 | * GroupMember 9 | */ 10 | public class GroupMemberRepresentation 11 | { 12 | @SerializedName("id") 13 | private String id = null; 14 | 15 | @SerializedName("displayName") 16 | private String displayName = null; 17 | 18 | /** 19 | * Gets or Sets memberType 20 | */ 21 | public enum MemberTypeEnum 22 | { 23 | @SerializedName("PERSON") PERSON("PERSON"), 24 | 25 | @SerializedName("GROUP") GROUP("GROUP"); 26 | 27 | private String value; 28 | 29 | MemberTypeEnum(String value) 30 | { 31 | this.value = value; 32 | } 33 | 34 | @Override 35 | public String toString() 36 | { 37 | return String.valueOf(value); 38 | } 39 | } 40 | 41 | @SerializedName("memberType") 42 | private MemberTypeEnum memberType = null; 43 | 44 | /** 45 | * Get id 46 | * 47 | * @return id 48 | **/ 49 | public String getId() 50 | { 51 | return id; 52 | } 53 | 54 | public void setId(String id) 55 | { 56 | this.id = id; 57 | } 58 | 59 | /** 60 | * Get displayName 61 | * 62 | * @return displayName 63 | **/ 64 | public String getDisplayName() 65 | { 66 | return displayName; 67 | } 68 | 69 | public void setDisplayName(String displayName) 70 | { 71 | this.displayName = displayName; 72 | } 73 | 74 | /** 75 | * Get memberType 76 | * 77 | * @return memberType 78 | **/ 79 | public MemberTypeEnum getMemberType() 80 | { 81 | return memberType; 82 | } 83 | 84 | public void setMemberType(MemberTypeEnum memberType) 85 | { 86 | this.memberType = memberType; 87 | } 88 | 89 | @Override 90 | public boolean equals(Object o) 91 | { 92 | if (this == o) { return true; } 93 | if (o == null || getClass() != o.getClass()) { return false; } 94 | GroupMemberRepresentation groupMember = (GroupMemberRepresentation) o; 95 | return Objects.equals(this.id, groupMember.id) && Objects.equals(this.displayName, groupMember.displayName) 96 | && Objects.equals(this.memberType, groupMember.memberType); 97 | } 98 | 99 | @Override 100 | public int hashCode() 101 | { 102 | return Objects.hash(id, displayName, memberType); 103 | } 104 | 105 | @Override 106 | public String toString() 107 | { 108 | StringBuilder sb = new StringBuilder(); 109 | sb.append("class GroupMember {\n"); 110 | 111 | sb.append(" id: ").append(toIndentedString(id)).append("\n"); 112 | sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); 113 | sb.append(" memberType: ").append(toIndentedString(memberType)).append("\n"); 114 | sb.append("}"); 115 | return sb.toString(); 116 | } 117 | 118 | /** 119 | * Convert the given object to string with each line indented by 4 spaces 120 | * (except the first line). 121 | */ 122 | private String toIndentedString(Object o) 123 | { 124 | if (o == null) { return "null"; } 125 | return o.toString().replace("\n", "\n "); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/PathInfoRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import java.util.List; 22 | 23 | import com.alfresco.client.api.common.representation.AbstractRepresentation; 24 | import com.google.gson.annotations.SerializedName; 25 | 26 | public class PathInfoRepresentation extends AbstractRepresentation 27 | { 28 | @SerializedName("name") 29 | private String name; 30 | 31 | @SerializedName("isComplete") 32 | private Boolean isComplete; 33 | 34 | @SerializedName("elements") 35 | private List element; 36 | 37 | public class PathElementRepresentation 38 | { 39 | @SerializedName("id") 40 | private String id; 41 | 42 | @SerializedName("name") 43 | private String name; 44 | 45 | public String getId() 46 | { 47 | return id; 48 | } 49 | 50 | public void setId(String id) 51 | { 52 | this.id = id; 53 | } 54 | 55 | public String getName() 56 | { 57 | return name; 58 | } 59 | 60 | public void setName(String name) 61 | { 62 | this.name = name; 63 | } 64 | } 65 | 66 | // /////////////////////////////////////////////////////////////////////////// 67 | // GETTERS & SETTERS 68 | // /////////////////////////////////////////////////////////////////////////// 69 | public String getName() 70 | { 71 | return name; 72 | } 73 | 74 | public void setName(String name) 75 | { 76 | this.name = name; 77 | } 78 | 79 | public Boolean getComplete() 80 | { 81 | return isComplete; 82 | } 83 | 84 | public void setComplete(Boolean complete) 85 | { 86 | isComplete = complete; 87 | } 88 | 89 | public List getElement() 90 | { 91 | return element; 92 | } 93 | 94 | public void setElement(List path) 95 | { 96 | this.element = path; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/PermissionElementRepresentation.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.core.model.representation; 2 | 3 | import java.util.Objects; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | /** 8 | * PermissionElement 9 | */ 10 | public class PermissionElementRepresentation 11 | { 12 | @SerializedName("authorityId") 13 | private String authorityId = null; 14 | 15 | @SerializedName("name") 16 | private String name = null; 17 | 18 | /** 19 | * Gets or Sets accessStatus 20 | */ 21 | public enum AccessStatusEnum 22 | { 23 | @SerializedName("ALLOWED") ALLOWED("ALLOWED"), 24 | 25 | @SerializedName("DENIED") DENIED("DENIED"); 26 | 27 | private String value; 28 | 29 | AccessStatusEnum(String value) 30 | { 31 | this.value = value; 32 | } 33 | 34 | @Override 35 | public String toString() 36 | { 37 | return String.valueOf(value); 38 | } 39 | } 40 | 41 | @SerializedName("accessStatus") 42 | private AccessStatusEnum accessStatus = AccessStatusEnum.ALLOWED; 43 | 44 | /** 45 | * Get authorityId 46 | * 47 | * @return authorityId 48 | **/ 49 | public String getAuthorityId() 50 | { 51 | return authorityId; 52 | } 53 | 54 | public void setAuthorityId(String authorityId) 55 | { 56 | this.authorityId = authorityId; 57 | } 58 | 59 | /** 60 | * Get name 61 | * 62 | * @return name 63 | **/ 64 | public String getName() 65 | { 66 | return name; 67 | } 68 | 69 | public void setName(String name) 70 | { 71 | this.name = name; 72 | } 73 | 74 | /** 75 | * Get accessStatus 76 | * 77 | * @return accessStatus 78 | **/ 79 | public AccessStatusEnum getAccessStatus() 80 | { 81 | return accessStatus; 82 | } 83 | 84 | public void setAccessStatus(AccessStatusEnum accessStatus) 85 | { 86 | this.accessStatus = accessStatus; 87 | } 88 | 89 | @Override 90 | public boolean equals(Object o) 91 | { 92 | if (this == o) { return true; } 93 | if (o == null || getClass() != o.getClass()) { return false; } 94 | PermissionElementRepresentation permissionElement = (PermissionElementRepresentation) o; 95 | return Objects.equals(this.authorityId, permissionElement.authorityId) 96 | && Objects.equals(this.name, permissionElement.name) 97 | && Objects.equals(this.accessStatus, permissionElement.accessStatus); 98 | } 99 | 100 | @Override 101 | public int hashCode() 102 | { 103 | return Objects.hash(authorityId, name, accessStatus); 104 | } 105 | 106 | @Override 107 | public String toString() 108 | { 109 | StringBuilder sb = new StringBuilder(); 110 | sb.append("class PermissionElement {\n"); 111 | 112 | sb.append(" authorityId: ").append(toIndentedString(authorityId)).append("\n"); 113 | sb.append(" name: ").append(toIndentedString(name)).append("\n"); 114 | sb.append(" accessStatus: ").append(toIndentedString(accessStatus)).append("\n"); 115 | sb.append("}"); 116 | return sb.toString(); 117 | } 118 | 119 | /** 120 | * Convert the given object to string with each line indented by 4 spaces 121 | * (except the first line). 122 | */ 123 | private String toIndentedString(Object o) 124 | { 125 | if (o == null) { return "null"; } 126 | return o.toString().replace("\n", "\n "); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/PreferenceRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import java.util.Objects; 22 | 23 | import com.alfresco.client.api.common.representation.AbstractRepresentation; 24 | import com.google.gson.annotations.SerializedName; 25 | 26 | /** 27 | * A specific preference. 28 | */ 29 | public class PreferenceRepresentation extends AbstractRepresentation 30 | { 31 | @SerializedName("id") 32 | private String id = null; 33 | 34 | @SerializedName("value") 35 | private String value = null; 36 | 37 | // /////////////////////////////////////////////////////////////////////////// 38 | // GETTERS & SETTERS 39 | // /////////////////////////////////////////////////////////////////////////// 40 | /** 41 | * The unique id of the preference 42 | * 43 | * @return id 44 | **/ 45 | public String getId() 46 | { 47 | return id; 48 | } 49 | 50 | public void setId(String id) 51 | { 52 | this.id = id; 53 | } 54 | 55 | /** 56 | * The value of the preference. Note that this can be of any JSON type. 57 | * 58 | * @return value 59 | **/ 60 | public String getValue() 61 | { 62 | return value; 63 | } 64 | 65 | public void setValue(String value) 66 | { 67 | this.value = value; 68 | } 69 | 70 | @Override 71 | public boolean equals(java.lang.Object o) 72 | { 73 | if (this == o) { return true; } 74 | if (o == null || getClass() != o.getClass()) { return false; } 75 | PreferenceRepresentation preference = (PreferenceRepresentation) o; 76 | return Objects.equals(this.id, preference.id) && Objects.equals(this.value, preference.value); 77 | } 78 | 79 | @Override 80 | public int hashCode() 81 | { 82 | return Objects.hash(id, value); 83 | } 84 | 85 | @Override 86 | public String toString() 87 | { 88 | StringBuilder sb = new StringBuilder(); 89 | sb.append("class Preference {\n"); 90 | 91 | sb.append(" id: ").append(toIndentedString(id)).append("\n"); 92 | sb.append(" value: ").append(toIndentedString(value)).append("\n"); 93 | sb.append("}"); 94 | return sb.toString(); 95 | } 96 | 97 | /** 98 | * Convert the given object to string with each line indented by 4 spaces 99 | * (except the first line). 100 | */ 101 | private String toIndentedString(java.lang.Object o) 102 | { 103 | if (o == null) { return "null"; } 104 | return o.toString().replace("\n", "\n "); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/RatingAggregateRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import java.util.Objects; 22 | 23 | import com.alfresco.client.api.common.representation.AbstractRepresentation; 24 | import com.google.gson.annotations.SerializedName; 25 | 26 | public class RatingAggregateRepresentation extends AbstractRepresentation 27 | { 28 | @SerializedName("average") 29 | private Integer average = null; 30 | 31 | @SerializedName("numberOfRatings") 32 | private Integer numberOfRatings = null; 33 | 34 | // /////////////////////////////////////////////////////////////////////////// 35 | // GETTERS & SETTERS 36 | // /////////////////////////////////////////////////////////////////////////// 37 | /** 38 | * Get average 39 | * 40 | * @return average 41 | **/ 42 | public Integer getAverage() 43 | { 44 | return average; 45 | } 46 | 47 | public void setAverage(Integer average) 48 | { 49 | this.average = average; 50 | } 51 | 52 | /** 53 | * Get numberOfRatings 54 | * 55 | * @return numberOfRatings 56 | **/ 57 | public Integer getNumberOfRatings() 58 | { 59 | return numberOfRatings; 60 | } 61 | 62 | public void setNumberOfRatings(Integer numberOfRatings) 63 | { 64 | this.numberOfRatings = numberOfRatings; 65 | } 66 | 67 | @Override 68 | public boolean equals(java.lang.Object o) 69 | { 70 | if (this == o) { return true; } 71 | if (o == null || getClass() != o.getClass()) { return false; } 72 | RatingAggregateRepresentation ratingAggregate = (RatingAggregateRepresentation) o; 73 | return Objects.equals(this.average, ratingAggregate.average) 74 | && Objects.equals(this.numberOfRatings, ratingAggregate.numberOfRatings); 75 | } 76 | 77 | @Override 78 | public int hashCode() 79 | { 80 | return Objects.hash(average, numberOfRatings); 81 | } 82 | 83 | @Override 84 | public String toString() 85 | { 86 | StringBuilder sb = new StringBuilder(); 87 | sb.append("class RatingAggregate {\n"); 88 | 89 | sb.append(" average: ").append(toIndentedString(average)).append("\n"); 90 | sb.append(" numberOfRatings: ").append(toIndentedString(numberOfRatings)).append("\n"); 91 | sb.append("}"); 92 | return sb.toString(); 93 | } 94 | 95 | /** 96 | * Convert the given object to string with each line indented by 4 spaces 97 | * (except the first line). 98 | */ 99 | private String toIndentedString(java.lang.Object o) 100 | { 101 | if (o == null) { return "null"; } 102 | return o.toString().replace("\n", "\n "); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/RatingIdEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | public enum RatingIdEnum 24 | { 25 | @SerializedName("likes") LIKES("likes"), 26 | 27 | @SerializedName("fiveStar") FIVESTAR("fiveStar"); 28 | 29 | private String value; 30 | 31 | RatingIdEnum(String value) 32 | { 33 | this.value = value; 34 | } 35 | 36 | public static RatingIdEnum fromString(String text) 37 | { 38 | for (RatingIdEnum b : RatingIdEnum.values()) 39 | { 40 | if (b.value.equalsIgnoreCase(text)) { return b; } 41 | } 42 | return null; 43 | } 44 | 45 | @Override 46 | public String toString() 47 | { 48 | return String.valueOf(value); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/RenditionStatusEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 25/07/2016. 25 | */ 26 | public enum RenditionStatusEnum 27 | { 28 | @SerializedName("CREATED") CREATED("CREATED"), 29 | 30 | @SerializedName("NOT_CREATED") NOT_CREATED("NOT_CREATED"); 31 | 32 | private String value; 33 | 34 | RenditionStatusEnum(String value) 35 | { 36 | this.value = value; 37 | } 38 | 39 | public static RenditionStatusEnum fromString(String text) 40 | { 41 | for (RenditionStatusEnum b : RenditionStatusEnum.values()) 42 | { 43 | if (b.value.equalsIgnoreCase(text)) { return b; } 44 | } 45 | return null; 46 | } 47 | 48 | @Override 49 | public String toString() 50 | { 51 | return String.valueOf(value); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/ServerInfoRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import com.alfresco.client.api.common.representation.AbstractRepresentation; 22 | 23 | public class ServerInfoRepresentation extends AbstractRepresentation 24 | { 25 | private String edition; 26 | 27 | private String version; 28 | 29 | private String schema; 30 | 31 | // /////////////////////////////////////////////////////////////////////////// 32 | // GETTERS & SETTERS 33 | // /////////////////////////////////////////////////////////////////////////// 34 | public String getEdition() 35 | { 36 | return edition; 37 | } 38 | 39 | public void setEdition(String edition) 40 | { 41 | this.edition = edition; 42 | } 43 | 44 | public String getVersion() 45 | { 46 | return version; 47 | } 48 | 49 | public void setVersion(String version) 50 | { 51 | this.version = version; 52 | } 53 | 54 | public String getSchema() 55 | { 56 | return schema; 57 | } 58 | 59 | public void setSchema(String schema) 60 | { 61 | this.schema = schema; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/SiteContainerRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import java.util.Objects; 22 | 23 | import com.alfresco.client.api.common.representation.AbstractRepresentation; 24 | import com.google.gson.annotations.SerializedName; 25 | 26 | public class SiteContainerRepresentation extends AbstractRepresentation 27 | { 28 | @SerializedName("id") 29 | private String id; 30 | 31 | @SerializedName("folderId") 32 | private String folderId; 33 | 34 | // /////////////////////////////////////////////////////////////////////////// 35 | // GETTERS & SETTERS 36 | // /////////////////////////////////////////////////////////////////////////// 37 | /** 38 | * Get id 39 | * 40 | * @return id 41 | **/ 42 | public String getId() 43 | { 44 | return id; 45 | } 46 | 47 | public void setId(String id) 48 | { 49 | this.id = id; 50 | } 51 | 52 | /** 53 | * Get folderId 54 | * 55 | * @return folderId 56 | **/ 57 | public String getFolderId() 58 | { 59 | return folderId; 60 | } 61 | 62 | public void setFolderId(String folderId) 63 | { 64 | this.folderId = folderId; 65 | } 66 | 67 | @Override 68 | public boolean equals(java.lang.Object o) 69 | { 70 | if (this == o) { return true; } 71 | if (o == null || getClass() != o.getClass()) { return false; } 72 | SiteContainerRepresentation siteContainer = (SiteContainerRepresentation) o; 73 | return Objects.equals(this.id, siteContainer.id) && Objects.equals(this.folderId, siteContainer.folderId); 74 | } 75 | 76 | @Override 77 | public int hashCode() 78 | { 79 | return Objects.hash(id, folderId); 80 | } 81 | 82 | @Override 83 | public String toString() 84 | { 85 | StringBuilder sb = new StringBuilder(); 86 | sb.append("class SiteContainer {\n"); 87 | 88 | sb.append(" id: ").append(toIndentedString(id)).append("\n"); 89 | sb.append(" folderId: ").append(toIndentedString(folderId)).append("\n"); 90 | sb.append("}"); 91 | return sb.toString(); 92 | } 93 | 94 | /** 95 | * Convert the given object to string with each line indented by 4 spaces 96 | * (except the first line). 97 | */ 98 | private String toIndentedString(java.lang.Object o) 99 | { 100 | if (o == null) { return "null"; } 101 | return o.toString().replace("\n", "\n "); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/SiteRoleEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 25/07/2016. 25 | */ 26 | public enum SiteRoleEnum 27 | { 28 | @SerializedName("SiteConsumer") SITECONSUMER("SiteConsumer"), 29 | 30 | @SerializedName("SiteCollaborator") SITECOLLABORATOR("SiteCollaborator"), 31 | 32 | @SerializedName("SiteContributor") SITECONTRIBUTOR("SiteContributor"), 33 | 34 | @SerializedName("SiteManager") SITEMANAGER("SiteManager"); 35 | 36 | private String value; 37 | 38 | SiteRoleEnum(String value) 39 | { 40 | this.value = value; 41 | } 42 | 43 | public static SiteRoleEnum fromString(String text) 44 | { 45 | for (SiteRoleEnum b : SiteRoleEnum.values()) 46 | { 47 | if (b.value.equalsIgnoreCase(text)) { return b; } 48 | } 49 | return null; 50 | } 51 | 52 | @Override 53 | public String toString() 54 | { 55 | return String.valueOf(value); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/SiteVisibilityEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Created by jpascal on 25/07/2016. 25 | */ 26 | public enum SiteVisibilityEnum 27 | { 28 | @SerializedName("PUBLIC") PUBLIC("PUBLIC"), 29 | 30 | @SerializedName("PRIVATE") PRIVATE("PRIVATE"), 31 | 32 | @SerializedName("MODERATED") MODERATED("MODERATED"); 33 | 34 | private String value; 35 | 36 | SiteVisibilityEnum(String value) 37 | { 38 | this.value = value; 39 | } 40 | 41 | @Override 42 | public String toString() 43 | { 44 | return String.valueOf(value); 45 | } 46 | 47 | public String value() 48 | { 49 | return value; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/SubscriptionLevelEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | public enum SubscriptionLevelEnum 24 | { 25 | @SerializedName("Free") FREE("Free"), 26 | 27 | @SerializedName("Standard") STANDARD("Standard"), 28 | 29 | @SerializedName("Enterprise") ENTERPRISE("Enterprise"); 30 | 31 | private String value; 32 | 33 | SubscriptionLevelEnum(String value) 34 | { 35 | this.value = value; 36 | } 37 | 38 | @Override 39 | public String toString() 40 | { 41 | return String.valueOf(value); 42 | } 43 | 44 | public static SubscriptionLevelEnum fromString(String text) 45 | { 46 | for (SubscriptionLevelEnum b : SubscriptionLevelEnum.values()) 47 | { 48 | if (b.value.equalsIgnoreCase(text)) { return b; } 49 | } 50 | return null; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/TagRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import java.util.Objects; 22 | 23 | import com.alfresco.client.api.common.representation.AbstractRepresentation; 24 | import com.google.gson.annotations.SerializedName; 25 | 26 | public class TagRepresentation extends AbstractRepresentation 27 | { 28 | @SerializedName("id") 29 | private String id = null; 30 | 31 | @SerializedName("tag") 32 | private String tag = null; 33 | 34 | // /////////////////////////////////////////////////////////////////////////// 35 | // GETTERS & SETTERS 36 | // /////////////////////////////////////////////////////////////////////////// 37 | /** 38 | * Get id 39 | * 40 | * @return id 41 | **/ 42 | public String getId() 43 | { 44 | return id; 45 | } 46 | 47 | public void setId(String id) 48 | { 49 | this.id = id; 50 | } 51 | 52 | /** 53 | * Get tag 54 | * 55 | * @return tag 56 | **/ 57 | public String getTag() 58 | { 59 | return tag; 60 | } 61 | 62 | public void setTag(String tag) 63 | { 64 | this.tag = tag; 65 | } 66 | 67 | @Override 68 | public boolean equals(java.lang.Object o) 69 | { 70 | if (this == o) { return true; } 71 | if (o == null || getClass() != o.getClass()) { return false; } 72 | TagRepresentation tag = (TagRepresentation) o; 73 | return Objects.equals(this.id, tag.id) && Objects.equals(this.tag, tag.tag); 74 | } 75 | 76 | @Override 77 | public int hashCode() 78 | { 79 | return Objects.hash(id, tag); 80 | } 81 | 82 | @Override 83 | public String toString() 84 | { 85 | StringBuilder sb = new StringBuilder(); 86 | sb.append("class TagRepresentation {\n"); 87 | 88 | sb.append(" id: ").append(toIndentedString(id)).append("\n"); 89 | sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); 90 | sb.append("}"); 91 | return sb.toString(); 92 | } 93 | 94 | /** 95 | * Convert the given object to string with each line indented by 4 spaces 96 | * (except the first line). 97 | */ 98 | private String toIndentedString(java.lang.Object o) 99 | { 100 | if (o == null) { return "null"; } 101 | return o.toString().replace("\n", "\n "); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/core/model/representation/UserInfoRepresentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.core.model.representation; 20 | 21 | import java.util.Objects; 22 | 23 | import com.alfresco.client.api.common.representation.AbstractRepresentation; 24 | import com.google.gson.annotations.SerializedName; 25 | 26 | public class UserInfoRepresentation extends AbstractRepresentation 27 | { 28 | @SerializedName("displayName") 29 | private String displayName = null; 30 | 31 | @SerializedName("id") 32 | private String id = null; 33 | 34 | // /////////////////////////////////////////////////////////////////////////// 35 | // GETTERS & SETTERS 36 | // /////////////////////////////////////////////////////////////////////////// 37 | /** 38 | * Get displayName 39 | * 40 | * @return displayName 41 | **/ 42 | public String getDisplayName() 43 | { 44 | return displayName; 45 | } 46 | 47 | public void setDisplayName(String displayName) 48 | { 49 | this.displayName = displayName; 50 | } 51 | 52 | /** 53 | * Get identifier 54 | * 55 | * @return identifier 56 | **/ 57 | public String getId() 58 | { 59 | return id; 60 | } 61 | 62 | public void setId(String identifier) 63 | { 64 | this.id = identifier; 65 | } 66 | 67 | @Override 68 | public boolean equals(java.lang.Object o) 69 | { 70 | if (this == o) { return true; } 71 | if (o == null || getClass() != o.getClass()) { return false; } 72 | UserInfoRepresentation userInfo = (UserInfoRepresentation) o; 73 | return Objects.equals(this.displayName, userInfo.displayName) && Objects.equals(this.id, userInfo.id); 74 | } 75 | 76 | @Override 77 | public int hashCode() 78 | { 79 | return Objects.hash(displayName, id); 80 | } 81 | 82 | @Override 83 | public String toString() 84 | { 85 | StringBuilder sb = new StringBuilder(); 86 | sb.append("class UserInfoRepresentation {\n"); 87 | 88 | sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); 89 | sb.append(" identifier: ").append(toIndentedString(id)).append("\n"); 90 | sb.append("}"); 91 | return sb.toString(); 92 | } 93 | 94 | /** 95 | * Convert the given object to string with each line indented by 4 spaces 96 | * (except the first line). 97 | */ 98 | private String toIndentedString(java.lang.Object o) 99 | { 100 | if (o == null) { return "null"; } 101 | return o.toString().replace("\n", "\n "); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/discovery/DiscoveryAPI.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.discovery; 2 | 3 | import com.alfresco.client.api.discovery.model.RepositoryInfoRepresentation; 4 | 5 | import retrofit2.Call; 6 | import retrofit2.http.GET; 7 | import rx.Observable; 8 | 9 | /** 10 | * Created by jpascal on 04/10/2016. 11 | */ 12 | public interface DiscoveryAPI 13 | { 14 | 15 | // /////////////////////////////////////////////////////////////////////////// 16 | // LISTING 17 | // /////////////////////////////////////////////////////////////////////////// 18 | /** 19 | * Get repository information **Note:** this endpoint is available in 20 | * Alfresco 5.2 and newer versions. Retrieves the capabilities and detailed 21 | * version information from the repository. 22 | * 23 | * @return RepositoryInfoRepresentation 24 | */ 25 | @GET(DiscoveryConstant.DISCOVERY_PUBLIC_API_V1 + "/discovery") 26 | Call getRepositoryInformationCall(); 27 | 28 | /** 29 | * Get repository information **Note:** this endpoint is available in 30 | * Alfresco 5.2 and newer versions. Retrieves the capabilities and detailed 31 | * version information from the repository. 32 | * 33 | * @return RepositoryInfoRepresentation 34 | */ 35 | @GET(DiscoveryConstant.DISCOVERY_PUBLIC_API_V1 + "/discovery") 36 | Observable getRepositoryInformationObservable(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/discovery/DiscoveryConstant.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.discovery; 2 | 3 | import com.alfresco.client.api.common.constant.APIConstant; 4 | 5 | /** 6 | * Created by jpascal on 05/10/2016. 7 | */ 8 | public interface DiscoveryConstant extends APIConstant 9 | { 10 | String DISCOVERY_PUBLIC_API_V1 = PREFIX_PUBLIC_API + "discovery/versions/1"; 11 | } 12 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/discovery/model/StatusInfoRepresentation.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.discovery.model; 2 | 3 | import java.util.Objects; 4 | 5 | import com.alfresco.client.api.common.representation.AbstractRepresentation; 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | /** 9 | * Created by jpascal on 04/10/2016. 10 | */ 11 | public class StatusInfoRepresentation extends AbstractRepresentation 12 | { 13 | 14 | @SerializedName("isReadOnly") 15 | private Boolean isReadOnly = false; 16 | 17 | @SerializedName("isAuditEnabled") 18 | private Boolean isAuditEnabled = null; 19 | 20 | @SerializedName("isQuickShareEnabled") 21 | private Boolean isQuickShareEnabled = null; 22 | 23 | /** 24 | * Get isReadOnly 25 | * 26 | * @return isReadOnly 27 | **/ 28 | public Boolean getIsReadOnly() 29 | { 30 | return isReadOnly; 31 | } 32 | 33 | public void setIsReadOnly(Boolean isReadOnly) 34 | { 35 | this.isReadOnly = isReadOnly; 36 | } 37 | 38 | /** 39 | * Get isAuditEnabled 40 | * 41 | * @return isAuditEnabled 42 | **/ 43 | public Boolean isAuditEnabled() 44 | { 45 | return isAuditEnabled; 46 | } 47 | 48 | public void setIsAuditEnabled(Boolean isAuditEnabled) 49 | { 50 | this.isAuditEnabled = isAuditEnabled; 51 | } 52 | 53 | /** 54 | * Get isQuickShareEnabled 55 | * 56 | * @return isQuickShareEnabled 57 | **/ 58 | public Boolean getIsQuickShareEnabled() 59 | { 60 | return isQuickShareEnabled; 61 | } 62 | 63 | public void setIsQuickShareEnabled(Boolean isQuickShareEnabled) 64 | { 65 | this.isQuickShareEnabled = isQuickShareEnabled; 66 | } 67 | 68 | @Override 69 | public boolean equals(java.lang.Object o) 70 | { 71 | if (this == o) { return true; } 72 | if (o == null || getClass() != o.getClass()) { return false; } 73 | StatusInfoRepresentation statusInfo = (StatusInfoRepresentation) o; 74 | return Objects.equals(this.isReadOnly, statusInfo.isReadOnly) 75 | && Objects.equals(this.isAuditEnabled, statusInfo.isAuditEnabled) 76 | && Objects.equals(this.isQuickShareEnabled, statusInfo.isQuickShareEnabled); 77 | } 78 | 79 | @Override 80 | public int hashCode() 81 | { 82 | return Objects.hash(isReadOnly, isAuditEnabled, isQuickShareEnabled); 83 | } 84 | 85 | @Override 86 | public String toString() 87 | { 88 | StringBuilder sb = new StringBuilder(); 89 | sb.append("class StatusInfo {\n"); 90 | 91 | sb.append(" isReadOnly: ").append(toIndentedString(isReadOnly)).append("\n"); 92 | sb.append(" isAuditEnabled: ").append(toIndentedString(isAuditEnabled)).append("\n"); 93 | sb.append(" isQuickShareEnabled: ").append(toIndentedString(isQuickShareEnabled)).append("\n"); 94 | sb.append("}"); 95 | return sb.toString(); 96 | } 97 | 98 | /** 99 | * Convert the given object to string with each line indented by 4 spaces 100 | * (except the first line). 101 | */ 102 | private String toIndentedString(java.lang.Object o) 103 | { 104 | if (o == null) { return "null"; } 105 | return o.toString().replace("\n", "\n "); 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/SearchConstant.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search; 2 | 3 | import com.alfresco.client.api.common.constant.APIConstant; 4 | 5 | /** 6 | * Created by jpascal on 05/10/2016. 7 | */ 8 | public interface SearchConstant extends APIConstant 9 | { 10 | String SEARCH_PUBLIC_API_V1 = PREFIX_PUBLIC_API + "search/versions/1"; 11 | } 12 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/body/RequestFacetFields.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.body; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Objects; 6 | 7 | import com.google.gson.annotations.SerializedName; 8 | 9 | /** 10 | * Simple facet fields to include The Properties reflect the global properties 11 | * related to field facts in SOLR. They are descripbed in detail by the SOLR 12 | * documentation 13 | */ 14 | public class RequestFacetFields 15 | { 16 | @SerializedName("facets") 17 | private List facets = new ArrayList(); 18 | 19 | public RequestFacetFields facets(List facets) 20 | { 21 | this.facets = facets; 22 | return this; 23 | } 24 | 25 | public RequestFacetFields addFacetsItem(RequestFacetFieldsFacets facetsItem) 26 | { 27 | this.facets.add(facetsItem); 28 | return this; 29 | } 30 | 31 | /** 32 | * Define specifc fields on which to facet (adds SOLR facet.field and f. 33 | * .facet.* options) 34 | * 35 | * @return facets 36 | **/ 37 | public List getFacets() 38 | { 39 | return facets; 40 | } 41 | 42 | public void setFacets(List facets) 43 | { 44 | this.facets = facets; 45 | } 46 | 47 | @Override 48 | public boolean equals(Object o) 49 | { 50 | if (this == o) { return true; } 51 | if (o == null || getClass() != o.getClass()) { return false; } 52 | RequestFacetFields requestFacetFields = (RequestFacetFields) o; 53 | return Objects.equals(this.facets, requestFacetFields.facets); 54 | } 55 | 56 | @Override 57 | public int hashCode() 58 | { 59 | return Objects.hash(facets); 60 | } 61 | 62 | @Override 63 | public String toString() 64 | { 65 | StringBuilder sb = new StringBuilder(); 66 | sb.append("class RequestFacetFields {\n"); 67 | 68 | sb.append(" facets: ").append(toIndentedString(facets)).append("\n"); 69 | sb.append("}"); 70 | return sb.toString(); 71 | } 72 | 73 | /** 74 | * Convert the given object to string with each line indented by 4 spaces 75 | * (except the first line). 76 | */ 77 | private String toIndentedString(Object o) 78 | { 79 | if (o == null) { return "null"; } 80 | return o.toString().replace("\n", "\n "); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/body/RequestFacetQuery.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.body; 2 | 3 | import java.util.Objects; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | /** 8 | * RequestFacetQueriesInner 9 | */ 10 | public class RequestFacetQuery 11 | { 12 | @SerializedName("query") 13 | private String query = null; 14 | 15 | @SerializedName("label") 16 | private String label = null; 17 | 18 | public RequestFacetQuery query(String query) 19 | { 20 | this.query = query; 21 | return this; 22 | } 23 | 24 | /** 25 | * A facet query 26 | * 27 | * @return query 28 | **/ 29 | public String getQuery() 30 | { 31 | return query; 32 | } 33 | 34 | public void setQuery(String query) 35 | { 36 | this.query = query; 37 | } 38 | 39 | public RequestFacetQuery label(String label) 40 | { 41 | this.label = label; 42 | return this; 43 | } 44 | 45 | /** 46 | * A label to include in place of the facet query 47 | * 48 | * @return label 49 | **/ 50 | public String getLabel() 51 | { 52 | return label; 53 | } 54 | 55 | public void setLabel(String label) 56 | { 57 | this.label = label; 58 | } 59 | 60 | @Override 61 | public boolean equals(Object o) 62 | { 63 | if (this == o) { return true; } 64 | if (o == null || getClass() != o.getClass()) { return false; } 65 | RequestFacetQuery requestFacetQuery = (RequestFacetQuery) o; 66 | return Objects.equals(this.query, requestFacetQuery.query) 67 | && Objects.equals(this.label, requestFacetQuery.label); 68 | } 69 | 70 | @Override 71 | public int hashCode() 72 | { 73 | return Objects.hash(query, label); 74 | } 75 | 76 | @Override 77 | public String toString() 78 | { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append("class RequestFacetQueriesInner {\n"); 81 | 82 | sb.append(" query: ").append(toIndentedString(query)).append("\n"); 83 | sb.append(" label: ").append(toIndentedString(label)).append("\n"); 84 | sb.append("}"); 85 | return sb.toString(); 86 | } 87 | 88 | /** 89 | * Convert the given object to string with each line indented by 4 spaces 90 | * (except the first line). 91 | */ 92 | private String toIndentedString(Object o) 93 | { 94 | if (o == null) { return "null"; } 95 | return o.toString().replace("\n", "\n "); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/body/RequestFilterQuery.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.body; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Objects; 6 | 7 | import com.google.gson.annotations.SerializedName; 8 | 9 | /** 10 | * RequestFilterQueriesInner 11 | */ 12 | public class RequestFilterQuery 13 | { 14 | @SerializedName("query") 15 | private String query = null; 16 | 17 | @SerializedName("tags") 18 | private List tags = new ArrayList(); 19 | 20 | public RequestFilterQuery query(String query) 21 | { 22 | this.query = query; 23 | return this; 24 | } 25 | 26 | /** 27 | * The filter query expression. For multi-select facets selected facets must 28 | * be order together 29 | * 30 | * @return query 31 | **/ 32 | public String getQuery() 33 | { 34 | return query; 35 | } 36 | 37 | public void setQuery(String query) 38 | { 39 | this.query = query; 40 | } 41 | 42 | public RequestFilterQuery tags(List tags) 43 | { 44 | this.tags = tags; 45 | return this; 46 | } 47 | 48 | public RequestFilterQuery addTagsItem(String tagsItem) 49 | { 50 | this.tags.add(tagsItem); 51 | return this; 52 | } 53 | 54 | /** 55 | * Tags used exclude the filters from facet evaluation for multi-select 56 | * facet support 57 | * 58 | * @return tags 59 | **/ 60 | public List getTags() 61 | { 62 | return tags; 63 | } 64 | 65 | public void setTags(List tags) 66 | { 67 | this.tags = tags; 68 | } 69 | 70 | @Override 71 | public boolean equals(Object o) 72 | { 73 | if (this == o) { return true; } 74 | if (o == null || getClass() != o.getClass()) { return false; } 75 | RequestFilterQuery requestFilterQuery = (RequestFilterQuery) o; 76 | return Objects.equals(this.query, requestFilterQuery.query) 77 | && Objects.equals(this.tags, requestFilterQuery.tags); 78 | } 79 | 80 | @Override 81 | public int hashCode() 82 | { 83 | return Objects.hash(query); 84 | } 85 | 86 | @Override 87 | public String toString() 88 | { 89 | StringBuilder sb = new StringBuilder(); 90 | sb.append("class RequestFilterQueriesInner {\n"); 91 | 92 | sb.append(" query: ").append(toIndentedString(query)).append("\n"); 93 | sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); 94 | sb.append("}"); 95 | return sb.toString(); 96 | } 97 | 98 | /** 99 | * Convert the given object to string with each line indented by 4 spaces 100 | * (except the first line). 101 | */ 102 | private String toIndentedString(Object o) 103 | { 104 | if (o == null) { return "null"; } 105 | return o.toString().replace("\n", "\n "); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/body/RequestLimits.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.body; 2 | 3 | import java.util.Objects; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | /** 8 | * Limit the time and resources used for query execution 9 | */ 10 | public class RequestLimits 11 | { 12 | @SerializedName("permissionEvaluationTime") 13 | private Integer permissionEvaluationTime = null; 14 | 15 | @SerializedName("permissionEvaluationCount") 16 | private Integer permissionEvaluationCount = null; 17 | 18 | public RequestLimits permissionEvaluationTime(Integer permissionEvaluationTime) 19 | { 20 | this.permissionEvaluationTime = permissionEvaluationTime; 21 | return this; 22 | } 23 | 24 | /** 25 | * Maximum time for post query permission evaluation 26 | * 27 | * @return permissionEvaluationTime 28 | **/ 29 | public Integer getPermissionEvaluationTime() 30 | { 31 | return permissionEvaluationTime; 32 | } 33 | 34 | public void setPermissionEvaluationTime(Integer permissionEvaluationTime) 35 | { 36 | this.permissionEvaluationTime = permissionEvaluationTime; 37 | } 38 | 39 | public RequestLimits permissionEvaluationCount(Integer permissionEvaluationCount) 40 | { 41 | this.permissionEvaluationCount = permissionEvaluationCount; 42 | return this; 43 | } 44 | 45 | /** 46 | * Maximum count of post query permission evaluations 47 | * 48 | * @return permissionEvaluationCount 49 | **/ 50 | public Integer getPermissionEvaluationCount() 51 | { 52 | return permissionEvaluationCount; 53 | } 54 | 55 | public void setPermissionEvaluationCount(Integer permissionEvaluationCount) 56 | { 57 | this.permissionEvaluationCount = permissionEvaluationCount; 58 | } 59 | 60 | @Override 61 | public boolean equals(Object o) 62 | { 63 | if (this == o) { return true; } 64 | if (o == null || getClass() != o.getClass()) { return false; } 65 | RequestLimits requestLimits = (RequestLimits) o; 66 | return Objects.equals(this.permissionEvaluationTime, requestLimits.permissionEvaluationTime) 67 | && Objects.equals(this.permissionEvaluationCount, requestLimits.permissionEvaluationCount); 68 | } 69 | 70 | @Override 71 | public int hashCode() 72 | { 73 | return Objects.hash(permissionEvaluationTime, permissionEvaluationCount); 74 | } 75 | 76 | @Override 77 | public String toString() 78 | { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append("class RequestLimits {\n"); 81 | 82 | sb.append(" permissionEvaluationTime: ").append(toIndentedString(permissionEvaluationTime)).append("\n"); 83 | sb.append(" permissionEvaluationCount: ").append(toIndentedString(permissionEvaluationCount)).append("\n"); 84 | sb.append("}"); 85 | return sb.toString(); 86 | } 87 | 88 | /** 89 | * Convert the given object to string with each line indented by 4 spaces 90 | * (except the first line). 91 | */ 92 | private String toIndentedString(Object o) 93 | { 94 | if (o == null) { return "null"; } 95 | return o.toString().replace("\n", "\n "); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/body/RequestPagination.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.body; 2 | 3 | import java.util.Objects; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | /** 8 | * RequestPagination 9 | */ 10 | public class RequestPagination 11 | { 12 | @SerializedName("maxItems") 13 | private Integer maxItems = null; 14 | 15 | @SerializedName("skipCount") 16 | private Integer skipCount = null; 17 | 18 | public RequestPagination maxItems(Integer maxItems) 19 | { 20 | this.maxItems = maxItems; 21 | return this; 22 | } 23 | 24 | /** 25 | * The maximum number of items to return in the query results minimum: 1.0 26 | * 27 | * @return maxItems 28 | **/ 29 | public Integer getMaxItems() 30 | { 31 | return maxItems; 32 | } 33 | 34 | public void setMaxItems(Integer maxItems) 35 | { 36 | this.maxItems = maxItems; 37 | } 38 | 39 | public RequestPagination skipCount(Integer skipCount) 40 | { 41 | this.skipCount = skipCount; 42 | return this; 43 | } 44 | 45 | /** 46 | * The number of items to skip from the start of the query set minimum: 0.0 47 | * 48 | * @return skipCount 49 | **/ 50 | public Integer getSkipCount() 51 | { 52 | return skipCount; 53 | } 54 | 55 | public void setSkipCount(Integer skipCount) 56 | { 57 | this.skipCount = skipCount; 58 | } 59 | 60 | @Override 61 | public boolean equals(Object o) 62 | { 63 | if (this == o) { return true; } 64 | if (o == null || getClass() != o.getClass()) { return false; } 65 | RequestPagination requestPagination = (RequestPagination) o; 66 | return Objects.equals(this.maxItems, requestPagination.maxItems) 67 | && Objects.equals(this.skipCount, requestPagination.skipCount); 68 | } 69 | 70 | @Override 71 | public int hashCode() 72 | { 73 | return Objects.hash(maxItems, skipCount); 74 | } 75 | 76 | @Override 77 | public String toString() 78 | { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append("class RequestPagination {\n"); 81 | 82 | sb.append(" maxItems: ").append(toIndentedString(maxItems)).append("\n"); 83 | sb.append(" skipCount: ").append(toIndentedString(skipCount)).append("\n"); 84 | sb.append("}"); 85 | return sb.toString(); 86 | } 87 | 88 | /** 89 | * Convert the given object to string with each line indented by 4 spaces 90 | * (except the first line). 91 | */ 92 | private String toIndentedString(Object o) 93 | { 94 | if (o == null) { return "null"; } 95 | return o.toString().replace("\n", "\n "); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/body/RequestScope.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.body; 2 | 3 | import java.util.Objects; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | /** 8 | * Scope 9 | */ 10 | public class RequestScope 11 | { 12 | /** 13 | * The locations to include in the query 14 | */ 15 | public enum LocationsEnum 16 | { 17 | @SerializedName("nodes") NODES("nodes"), 18 | 19 | @SerializedName("versions") VERSIONS("versions"), 20 | 21 | @SerializedName("deleted-nodes") DELETED_NODES("deleted-nodes"); 22 | 23 | private String value; 24 | 25 | LocationsEnum(String value) 26 | { 27 | this.value = value; 28 | } 29 | 30 | @Override 31 | public String toString() 32 | { 33 | return String.valueOf(value); 34 | } 35 | } 36 | 37 | @SerializedName("locations") 38 | private LocationsEnum locations = null; 39 | 40 | public RequestScope locations(LocationsEnum locations) 41 | { 42 | this.locations = locations; 43 | return this; 44 | } 45 | 46 | /** 47 | * The locations to include in the query 48 | * 49 | * @return locations 50 | **/ 51 | public LocationsEnum getLocations() 52 | { 53 | return locations; 54 | } 55 | 56 | public void setLocations(LocationsEnum locations) 57 | { 58 | this.locations = locations; 59 | } 60 | 61 | @Override 62 | public boolean equals(Object o) 63 | { 64 | if (this == o) { return true; } 65 | if (o == null || getClass() != o.getClass()) { return false; } 66 | RequestScope requestScope = (RequestScope) o; 67 | return Objects.equals(this.locations, requestScope.locations); 68 | } 69 | 70 | @Override 71 | public int hashCode() 72 | { 73 | return Objects.hash(locations); 74 | } 75 | 76 | @Override 77 | public String toString() 78 | { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append("class RequestScope {\n"); 81 | 82 | sb.append(" locations: ").append(toIndentedString(locations)).append("\n"); 83 | sb.append("}"); 84 | return sb.toString(); 85 | } 86 | 87 | /** 88 | * Convert the given object to string with each line indented by 4 spaces 89 | * (except the first line). 90 | */ 91 | private String toIndentedString(Object o) 92 | { 93 | if (o == null) { return "null"; } 94 | return o.toString().replace("\n", "\n "); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/body/RequestSpellcheck.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.body; 2 | 3 | import java.util.Objects; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | /** 8 | * Request that spellcheck fragments to be added to result set rows The 9 | * properties reflect SOLR spellcheck parameters. 10 | */ 11 | public class RequestSpellcheck 12 | { 13 | @SerializedName("query") 14 | private String query = null; 15 | 16 | public RequestSpellcheck query(String query) 17 | { 18 | this.query = query; 19 | return this; 20 | } 21 | 22 | /** 23 | * Get query 24 | * 25 | * @return query 26 | **/ 27 | public String getQuery() 28 | { 29 | return query; 30 | } 31 | 32 | public void setQuery(String query) 33 | { 34 | this.query = query; 35 | } 36 | 37 | @Override 38 | public boolean equals(Object o) 39 | { 40 | if (this == o) { return true; } 41 | if (o == null || getClass() != o.getClass()) { return false; } 42 | RequestSpellcheck requestSpellcheck = (RequestSpellcheck) o; 43 | return Objects.equals(this.query, requestSpellcheck.query); 44 | } 45 | 46 | @Override 47 | public int hashCode() 48 | { 49 | return Objects.hash(query); 50 | } 51 | 52 | @Override 53 | public String toString() 54 | { 55 | StringBuilder sb = new StringBuilder(); 56 | sb.append("class RequestSpellcheck {\n"); 57 | 58 | sb.append(" query: ").append(toIndentedString(query)).append("\n"); 59 | sb.append("}"); 60 | return sb.toString(); 61 | } 62 | 63 | /** 64 | * Convert the given object to string with each line indented by 4 spaces 65 | * (except the first line). 66 | */ 67 | private String toIndentedString(Object o) 68 | { 69 | if (o == null) { return "null"; } 70 | return o.toString().replace("\n", "\n "); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/body/RequestTemplate.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.body; 2 | 3 | import java.util.Objects; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | /** 8 | * RequestTemplatesInner 9 | */ 10 | public class RequestTemplate 11 | { 12 | @SerializedName("name") 13 | private String name = null; 14 | 15 | @SerializedName("template") 16 | private String template = null; 17 | 18 | public RequestTemplate name(String name) 19 | { 20 | this.name = name; 21 | return this; 22 | } 23 | 24 | /** 25 | * The template name 26 | * 27 | * @return name 28 | **/ 29 | public String getName() 30 | { 31 | return name; 32 | } 33 | 34 | public void setName(String name) 35 | { 36 | this.name = name; 37 | } 38 | 39 | public RequestTemplate template(String template) 40 | { 41 | this.template = template; 42 | return this; 43 | } 44 | 45 | /** 46 | * The template 47 | * 48 | * @return template 49 | **/ 50 | public String getTemplate() 51 | { 52 | return template; 53 | } 54 | 55 | public void setTemplate(String template) 56 | { 57 | this.template = template; 58 | } 59 | 60 | @Override 61 | public boolean equals(Object o) 62 | { 63 | if (this == o) { return true; } 64 | if (o == null || getClass() != o.getClass()) { return false; } 65 | RequestTemplate requestTemplate = (RequestTemplate) o; 66 | return Objects.equals(this.name, requestTemplate.name) 67 | && Objects.equals(this.template, requestTemplate.template); 68 | } 69 | 70 | @Override 71 | public int hashCode() 72 | { 73 | return Objects.hash(name, template); 74 | } 75 | 76 | @Override 77 | public String toString() 78 | { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append("class RequestTemplate {\n"); 81 | 82 | sb.append(" name: ").append(toIndentedString(name)).append("\n"); 83 | sb.append(" template: ").append(toIndentedString(template)).append("\n"); 84 | sb.append("}"); 85 | return sb.toString(); 86 | } 87 | 88 | /** 89 | * Convert the given object to string with each line indented by 4 spaces 90 | * (except the first line). 91 | */ 92 | private String toIndentedString(Object o) 93 | { 94 | if (o == null) { return "null"; } 95 | return o.toString().replace("\n", "\n "); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/deserializer/ResultSetPagingDeserializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.search.deserializer; 20 | 21 | import java.lang.reflect.Type; 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | import com.alfresco.client.api.common.constant.PublicAPIConstant; 26 | import com.alfresco.client.api.common.representation.PaginationRepresentation; 27 | import com.alfresco.client.api.search.model.ResultSetContext; 28 | import com.alfresco.client.api.search.model.ResultSetRepresentation; 29 | import com.google.gson.*; 30 | 31 | /** 32 | * Created by jpascal on 19/01/2016. 33 | */ 34 | public class ResultSetPagingDeserializer implements JsonDeserializer> 35 | { 36 | protected Class clazz; 37 | 38 | public ResultSetPagingDeserializer(Class clazz) 39 | { 40 | this.clazz = clazz; 41 | } 42 | 43 | @Override 44 | public ResultSetRepresentation deserialize(JsonElement je, Type type, JsonDeserializationContext jdc) 45 | throws JsonParseException 46 | { 47 | JsonObject contextInfo = null; 48 | JsonObject pagination = null; 49 | JsonArray entries = null; 50 | if (je.getAsJsonObject().has(PublicAPIConstant.LIST_VALUE)) 51 | { 52 | pagination = je.getAsJsonObject().get(PublicAPIConstant.LIST_VALUE).getAsJsonObject() 53 | .get(PublicAPIConstant.PAGINATION_VALUE).getAsJsonObject(); 54 | entries = je.getAsJsonObject().get(PublicAPIConstant.LIST_VALUE).getAsJsonObject() 55 | .get(PublicAPIConstant.ENTRIES_VALUE).getAsJsonArray(); 56 | 57 | if (je.getAsJsonObject().get(PublicAPIConstant.LIST_VALUE).getAsJsonObject() 58 | .has(PublicAPIConstant.CONTEXT_VALUE)) 59 | { 60 | contextInfo = je.getAsJsonObject().get(PublicAPIConstant.LIST_VALUE).getAsJsonObject() 61 | .get(PublicAPIConstant.CONTEXT_VALUE).getAsJsonObject(); 62 | } 63 | } 64 | 65 | final List result = new ArrayList<>(); 66 | T obj = null; 67 | for (Object entry : entries) 68 | { 69 | obj = jdc.deserialize((JsonElement) entry, clazz); 70 | result.add(obj); 71 | } 72 | 73 | PaginationRepresentation paging = jdc.deserialize(pagination, PaginationRepresentation.class); 74 | ResultSetContext context = jdc.deserialize(contextInfo, ResultSetContext.class); 75 | 76 | return new ResultSetRepresentation(result, context, paging); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/model/ResponseConsistency.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.model; 2 | 3 | import java.util.Objects; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | /** 8 | * The consistency state of the index used to execute the query 9 | */ 10 | public class ResponseConsistency 11 | { 12 | @SerializedName("lastTxId") 13 | private Integer lastTxId = null; 14 | 15 | public ResponseConsistency lastTxId(Integer lastTxId) 16 | { 17 | this.lastTxId = lastTxId; 18 | return this; 19 | } 20 | 21 | /** 22 | * The id of the last indexed transaction 23 | * 24 | * @return lastTxId 25 | **/ 26 | public Integer getLastTxId() 27 | { 28 | return lastTxId; 29 | } 30 | 31 | public void setLastTxId(Integer lastTxId) 32 | { 33 | this.lastTxId = lastTxId; 34 | } 35 | 36 | @Override 37 | public boolean equals(Object o) 38 | { 39 | if (this == o) { return true; } 40 | if (o == null || getClass() != o.getClass()) { return false; } 41 | ResponseConsistency responseConsistency = (ResponseConsistency) o; 42 | return Objects.equals(this.lastTxId, responseConsistency.lastTxId); 43 | } 44 | 45 | @Override 46 | public int hashCode() 47 | { 48 | return Objects.hash(lastTxId); 49 | } 50 | 51 | @Override 52 | public String toString() 53 | { 54 | StringBuilder sb = new StringBuilder(); 55 | sb.append("class ResponseConsistency {\n"); 56 | 57 | sb.append(" lastTxId: ").append(toIndentedString(lastTxId)).append("\n"); 58 | sb.append("}"); 59 | return sb.toString(); 60 | } 61 | 62 | /** 63 | * Convert the given object to string with each line indented by 4 spaces 64 | * (except the first line). 65 | */ 66 | private String toIndentedString(Object o) 67 | { 68 | if (o == null) { return "null"; } 69 | return o.toString().replace("\n", "\n "); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/model/ResultSetContextBuckets.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.model; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Objects; 5 | 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | /** 9 | * ResultSetContextBuckets 10 | */ 11 | public class ResultSetContextBuckets 12 | { 13 | @SerializedName("label") 14 | private String label = null; 15 | 16 | @SerializedName("count") 17 | private BigDecimal count = null; 18 | 19 | @SerializedName("display") 20 | private Object display = null; 21 | 22 | public ResultSetContextBuckets label(String label) 23 | { 24 | this.label = label; 25 | return this; 26 | } 27 | 28 | /** 29 | * The bucket label 30 | * 31 | * @return label 32 | **/ 33 | public String getLabel() 34 | { 35 | return label; 36 | } 37 | 38 | public void setLabel(String label) 39 | { 40 | this.label = label; 41 | } 42 | 43 | public ResultSetContextBuckets count(BigDecimal count) 44 | { 45 | this.count = count; 46 | return this; 47 | } 48 | 49 | /** 50 | * The count for the bucket 51 | * 52 | * @return count 53 | **/ 54 | public BigDecimal getCount() 55 | { 56 | return count; 57 | } 58 | 59 | public void setCount(BigDecimal count) 60 | { 61 | this.count = count; 62 | } 63 | 64 | public ResultSetContextBuckets display(Object display) 65 | { 66 | this.display = display; 67 | return this; 68 | } 69 | 70 | /** 71 | * An optional field for additional display information 72 | * 73 | * @return display 74 | **/ 75 | public Object getDisplay() 76 | { 77 | return display; 78 | } 79 | 80 | public void setDisplay(Object display) 81 | { 82 | this.display = display; 83 | } 84 | 85 | @Override 86 | public boolean equals(Object o) 87 | { 88 | if (this == o) { return true; } 89 | if (o == null || getClass() != o.getClass()) { return false; } 90 | ResultSetContextBuckets resultSetContextBuckets = (ResultSetContextBuckets) o; 91 | return Objects.equals(this.label, resultSetContextBuckets.label) 92 | && Objects.equals(this.count, resultSetContextBuckets.count) 93 | && Objects.equals(this.display, resultSetContextBuckets.display); 94 | } 95 | 96 | @Override 97 | public int hashCode() 98 | { 99 | return Objects.hash(label, count, display); 100 | } 101 | 102 | @Override 103 | public String toString() 104 | { 105 | StringBuilder sb = new StringBuilder(); 106 | sb.append("class ResultSetContextBuckets {\n"); 107 | 108 | sb.append(" label: ").append(toIndentedString(label)).append("\n"); 109 | sb.append(" count: ").append(toIndentedString(count)).append("\n"); 110 | sb.append(" display: ").append(toIndentedString(display)).append("\n"); 111 | sb.append("}"); 112 | return sb.toString(); 113 | } 114 | 115 | /** 116 | * Convert the given object to string with each line indented by 4 spaces 117 | * (except the first line). 118 | */ 119 | private String toIndentedString(Object o) 120 | { 121 | if (o == null) { return "null"; } 122 | return o.toString().replace("\n", "\n "); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/model/ResultSetContextFacetFields.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.model; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Objects; 6 | 7 | import com.google.gson.annotations.SerializedName; 8 | 9 | /** 10 | * ResultSetContextFacetFields 11 | */ 12 | public class ResultSetContextFacetFields 13 | { 14 | @SerializedName("label") 15 | private String label = null; 16 | 17 | @SerializedName("buckets") 18 | private List buckets = new ArrayList(); 19 | 20 | public ResultSetContextFacetFields label(String label) 21 | { 22 | this.label = label; 23 | return this; 24 | } 25 | 26 | /** 27 | * The field name or its explicit label, if provided on the request 28 | * 29 | * @return label 30 | **/ 31 | public String getLabel() 32 | { 33 | return label; 34 | } 35 | 36 | public void setLabel(String label) 37 | { 38 | this.label = label; 39 | } 40 | 41 | public ResultSetContextFacetFields buckets(List buckets) 42 | { 43 | this.buckets = buckets; 44 | return this; 45 | } 46 | 47 | public ResultSetContextFacetFields addBucketsItem(ResultSetContextBuckets bucketsItem) 48 | { 49 | this.buckets.add(bucketsItem); 50 | return this; 51 | } 52 | 53 | /** 54 | * An array of buckets and values 55 | * 56 | * @return buckets 57 | **/ 58 | public List getBuckets() 59 | { 60 | return buckets; 61 | } 62 | 63 | public void setBuckets(List buckets) 64 | { 65 | this.buckets = buckets; 66 | } 67 | 68 | @Override 69 | public boolean equals(Object o) 70 | { 71 | if (this == o) { return true; } 72 | if (o == null || getClass() != o.getClass()) { return false; } 73 | ResultSetContextFacetFields resultSetContextFacetFields = (ResultSetContextFacetFields) o; 74 | return Objects.equals(this.label, resultSetContextFacetFields.label) 75 | && Objects.equals(this.buckets, resultSetContextFacetFields.buckets); 76 | } 77 | 78 | @Override 79 | public int hashCode() 80 | { 81 | return Objects.hash(label, buckets); 82 | } 83 | 84 | @Override 85 | public String toString() 86 | { 87 | StringBuilder sb = new StringBuilder(); 88 | sb.append("class ResultSetContextFacetFields {\n"); 89 | 90 | sb.append(" label: ").append(toIndentedString(label)).append("\n"); 91 | sb.append(" buckets: ").append(toIndentedString(buckets)).append("\n"); 92 | sb.append("}"); 93 | return sb.toString(); 94 | } 95 | 96 | /** 97 | * Convert the given object to string with each line indented by 4 spaces 98 | * (except the first line). 99 | */ 100 | private String toIndentedString(Object o) 101 | { 102 | if (o == null) { return "null"; } 103 | return o.toString().replace("\n", "\n "); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/model/ResultSetContextFacetQueries.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.model; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Objects; 5 | 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | /** 9 | * ResultSetContextFacetQueries 10 | */ 11 | public class ResultSetContextFacetQueries 12 | { 13 | @SerializedName("label") 14 | private String label = null; 15 | 16 | @SerializedName("count") 17 | private BigDecimal count = null; 18 | 19 | public ResultSetContextFacetQueries label(String label) 20 | { 21 | this.label = label; 22 | return this; 23 | } 24 | 25 | /** 26 | * Get label 27 | * 28 | * @return label 29 | **/ 30 | public String getLabel() 31 | { 32 | return label; 33 | } 34 | 35 | public void setLabel(String label) 36 | { 37 | this.label = label; 38 | } 39 | 40 | public ResultSetContextFacetQueries count(BigDecimal count) 41 | { 42 | this.count = count; 43 | return this; 44 | } 45 | 46 | /** 47 | * Get count 48 | * 49 | * @return count 50 | **/ 51 | public BigDecimal getCount() 52 | { 53 | return count; 54 | } 55 | 56 | public void setCount(BigDecimal count) 57 | { 58 | this.count = count; 59 | } 60 | 61 | @Override 62 | public boolean equals(Object o) 63 | { 64 | if (this == o) { return true; } 65 | if (o == null || getClass() != o.getClass()) { return false; } 66 | ResultSetContextFacetQueries resultSetContextFacetQueries = (ResultSetContextFacetQueries) o; 67 | return Objects.equals(this.label, resultSetContextFacetQueries.label) 68 | && Objects.equals(this.count, resultSetContextFacetQueries.count); 69 | } 70 | 71 | @Override 72 | public int hashCode() 73 | { 74 | return Objects.hash(label, count); 75 | } 76 | 77 | @Override 78 | public String toString() 79 | { 80 | StringBuilder sb = new StringBuilder(); 81 | sb.append("class ResultSetContextFacetQueries {\n"); 82 | 83 | sb.append(" label: ").append(toIndentedString(label)).append("\n"); 84 | sb.append(" count: ").append(toIndentedString(count)).append("\n"); 85 | sb.append("}"); 86 | return sb.toString(); 87 | } 88 | 89 | /** 90 | * Convert the given object to string with each line indented by 4 spaces 91 | * (except the first line). 92 | */ 93 | private String toIndentedString(Object o) 94 | { 95 | if (o == null) { return "null"; } 96 | return o.toString().replace("\n", "\n "); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/model/ResultSetContextSpellcheck.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.model; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Objects; 6 | 7 | import com.google.gson.annotations.SerializedName; 8 | 9 | /** 10 | * ResultSetContextSpellcheck 11 | */ 12 | public class ResultSetContextSpellcheck 13 | { 14 | /** 15 | * Gets or Sets type 16 | */ 17 | public enum TypeEnum 18 | { 19 | @SerializedName("searchInsteadFor") SEARCHINSTEADFOR("searchInsteadFor"), 20 | 21 | @SerializedName("didYouMean") DIDYOUMEAN("didYouMean"); 22 | 23 | private String value; 24 | 25 | TypeEnum(String value) 26 | { 27 | this.value = value; 28 | } 29 | 30 | @Override 31 | public String toString() 32 | { 33 | return String.valueOf(value); 34 | } 35 | } 36 | 37 | @SerializedName("type") 38 | private TypeEnum type = null; 39 | 40 | @SerializedName("suggestion") 41 | private List suggestion = new ArrayList(); 42 | 43 | public ResultSetContextSpellcheck type(TypeEnum type) 44 | { 45 | this.type = type; 46 | return this; 47 | } 48 | 49 | /** 50 | * Get type 51 | * 52 | * @return type 53 | **/ 54 | public TypeEnum getType() 55 | { 56 | return type; 57 | } 58 | 59 | public void setType(TypeEnum type) 60 | { 61 | this.type = type; 62 | } 63 | 64 | public ResultSetContextSpellcheck suggestion(List suggestion) 65 | { 66 | this.suggestion = suggestion; 67 | return this; 68 | } 69 | 70 | public ResultSetContextSpellcheck addSuggestionItem(String suggestionItem) 71 | { 72 | this.suggestion.add(suggestionItem); 73 | return this; 74 | } 75 | 76 | /** 77 | * A suggested alternative query 78 | * 79 | * @return suggestion 80 | **/ 81 | public List getSuggestion() 82 | { 83 | return suggestion; 84 | } 85 | 86 | public void setSuggestion(List suggestion) 87 | { 88 | this.suggestion = suggestion; 89 | } 90 | 91 | @Override 92 | public boolean equals(Object o) 93 | { 94 | if (this == o) { return true; } 95 | if (o == null || getClass() != o.getClass()) { return false; } 96 | ResultSetContextSpellcheck resultSetContextSpellcheck = (ResultSetContextSpellcheck) o; 97 | return Objects.equals(this.type, resultSetContextSpellcheck.type) 98 | && Objects.equals(this.suggestion, resultSetContextSpellcheck.suggestion); 99 | } 100 | 101 | @Override 102 | public int hashCode() 103 | { 104 | return Objects.hash(type, suggestion); 105 | } 106 | 107 | @Override 108 | public String toString() 109 | { 110 | StringBuilder sb = new StringBuilder(); 111 | sb.append("class ResultSetContextSpellcheck {\n"); 112 | 113 | sb.append(" type: ").append(toIndentedString(type)).append("\n"); 114 | sb.append(" suggestion: ").append(toIndentedString(suggestion)).append("\n"); 115 | sb.append("}"); 116 | return sb.toString(); 117 | } 118 | 119 | /** 120 | * Convert the given object to string with each line indented by 4 spaces 121 | * (except the first line). 122 | */ 123 | private String toIndentedString(Object o) 124 | { 125 | if (o == null) { return "null"; } 126 | return o.toString().replace("\n", "\n "); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/model/ResultSetRepresentation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Alfresco Search REST API 3 | * Provides access to the search features of Alfresco 4 | * 5 | * OpenAPI spec version: 1 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | package com.alfresco.client.api.search.model; 26 | 27 | import java.util.List; 28 | import java.util.Objects; 29 | 30 | import com.alfresco.client.api.common.representation.PaginationRepresentation; 31 | import com.alfresco.client.api.common.representation.ResultPaging; 32 | import com.google.gson.annotations.SerializedName; 33 | 34 | /** 35 | * ResultSetPagingList 36 | */ 37 | public class ResultSetRepresentation extends ResultPaging 38 | { 39 | @SerializedName("context") 40 | private ResultSetContext context = null; 41 | 42 | public ResultSetRepresentation(List objects, ResultSetContext context, PaginationRepresentation pagination) 43 | { 44 | super(objects, pagination); 45 | this.context = context; 46 | } 47 | 48 | /** 49 | * Get context 50 | * 51 | * @return context 52 | **/ 53 | public ResultSetContext getContext() 54 | { 55 | return context; 56 | } 57 | 58 | public void setContext(ResultSetContext context) 59 | { 60 | this.context = context; 61 | } 62 | 63 | @Override 64 | public boolean equals(Object o) 65 | { 66 | if (this == o) { return true; } 67 | if (o == null || getClass() != o.getClass()) { return false; } 68 | ResultSetRepresentation resultSetPagingList = (ResultSetRepresentation) o; 69 | return Objects.equals(this.pagination, resultSetPagingList.pagination) 70 | && Objects.equals(this.context, resultSetPagingList.context) 71 | && Objects.equals(this.objects, resultSetPagingList.objects); 72 | } 73 | 74 | @Override 75 | public int hashCode() 76 | { 77 | return Objects.hash(pagination, context, objects); 78 | } 79 | 80 | @Override 81 | public String toString() 82 | { 83 | StringBuilder sb = new StringBuilder(); 84 | sb.append("class ResultSetPagingList {\n"); 85 | 86 | sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); 87 | sb.append(" context: ").append(toIndentedString(context)).append("\n"); 88 | sb.append(" entries: ").append(toIndentedString(objects)).append("\n"); 89 | sb.append("}"); 90 | return sb.toString(); 91 | } 92 | 93 | /** 94 | * Convert the given object to string with each line indented by 4 spaces 95 | * (except the first line). 96 | */ 97 | private String toIndentedString(Object o) 98 | { 99 | if (o == null) { return "null"; } 100 | return o.toString().replace("\n", "\n "); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/model/SearchEntry.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.model; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Objects; 6 | 7 | import com.google.gson.annotations.SerializedName; 8 | 9 | /** 10 | * SearchEntry 11 | */ 12 | @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-04-26T16:18:20.726+02:00") 13 | public class SearchEntry 14 | { 15 | @SerializedName("score") 16 | private Float score = null; 17 | 18 | @SerializedName("highlight") 19 | private List highlight = new ArrayList(); 20 | 21 | public SearchEntry score(Float score) 22 | { 23 | this.score = score; 24 | return this; 25 | } 26 | 27 | /** 28 | * The score for this row 29 | * 30 | * @return score 31 | **/ 32 | public Float getScore() 33 | { 34 | return score; 35 | } 36 | 37 | public void setScore(Float score) 38 | { 39 | this.score = score; 40 | } 41 | 42 | public SearchEntry highlight(List highlight) 43 | { 44 | this.highlight = highlight; 45 | return this; 46 | } 47 | 48 | public SearchEntry addHighlightItem(SearchEntryHighlight highlightItem) 49 | { 50 | this.highlight.add(highlightItem); 51 | return this; 52 | } 53 | 54 | /** 55 | * Highlight fragments if requested and available. A match can happen in any 56 | * of the requested field. 57 | * 58 | * @return highlight 59 | **/ 60 | public List getHighlight() 61 | { 62 | return highlight; 63 | } 64 | 65 | public void setHighlight(List highlight) 66 | { 67 | this.highlight = highlight; 68 | } 69 | 70 | @Override 71 | public boolean equals(Object o) 72 | { 73 | if (this == o) { return true; } 74 | if (o == null || getClass() != o.getClass()) { return false; } 75 | SearchEntry searchEntry = (SearchEntry) o; 76 | return Objects.equals(this.score, searchEntry.score) && Objects.equals(this.highlight, searchEntry.highlight); 77 | } 78 | 79 | @Override 80 | public int hashCode() 81 | { 82 | return Objects.hash(score, highlight); 83 | } 84 | 85 | @Override 86 | public String toString() 87 | { 88 | StringBuilder sb = new StringBuilder(); 89 | sb.append("class SearchEntry {\n"); 90 | 91 | sb.append(" score: ").append(toIndentedString(score)).append("\n"); 92 | sb.append(" highlight: ").append(toIndentedString(highlight)).append("\n"); 93 | sb.append("}"); 94 | return sb.toString(); 95 | } 96 | 97 | /** 98 | * Convert the given object to string with each line indented by 4 spaces 99 | * (except the first line). 100 | */ 101 | private String toIndentedString(Object o) 102 | { 103 | if (o == null) { return "null"; } 104 | return o.toString().replace("\n", "\n "); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/search/model/SearchScore.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.search.model; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * SearchEntry 7 | */ 8 | public class SearchScore 9 | { 10 | @SerializedName("score") 11 | private Float score = null; 12 | 13 | /** 14 | * The score for this row 15 | * 16 | * @return score 17 | **/ 18 | public Float getScore() 19 | { 20 | return score; 21 | } 22 | 23 | public void setScore(Float score) 24 | { 25 | this.score = score; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/workflow/WorkflowAPI.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.workflow; 2 | 3 | /** 4 | * Created by jpascal on 04/10/2016. 5 | */ 6 | public interface WorkflowAPI 7 | { 8 | 9 | // /////////////////////////////////////////////////////////////////////////// 10 | // LISTING 11 | // /////////////////////////////////////////////////////////////////////////// 12 | /** 13 | * Get repository information **Note:** this endpoint is available in 14 | * Alfresco 5.2 and newer versions. Retrieves the capabilities and detailed 15 | * version information from the repository. 16 | * 17 | * @return RepositoryInfoRepresentation 18 | */ 19 | 20 | } 21 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/api/workflow/WorkflowConstant.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.api.workflow; 2 | 3 | import com.alfresco.client.api.common.constant.APIConstant; 4 | 5 | /** 6 | * Created by jpascal on 05/10/2016. 7 | */ 8 | public interface WorkflowConstant extends APIConstant 9 | { 10 | String WORKFLOW_PUBLIC_API_V1 = PREFIX_PUBLIC_API + "workflow/versions/1"; 11 | } 12 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/utils/authentication/saml/SAMLConstant.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.utils.authentication.saml; 2 | 3 | /** 4 | * Created by jpascal on 20/10/2016. 5 | */ 6 | 7 | public interface SAMLConstant 8 | { 9 | 10 | String ALFRESCO_SAML_AUTHENTICATE_URL = "service/saml/-default-/rest-api/authenticate"; 11 | 12 | String ALFRESCO_SAML_AUTHENTICATE_RESPONSE_URL = "service/saml/-default-/rest-api/authenticate-response"; 13 | 14 | String ALFRESCO_SAML_INFO_URL = "service/saml/-default-/rest-api/enabled"; 15 | } 16 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/utils/authentication/saml/models/SamlEnabledRepresentation.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.utils.authentication.saml.models; 2 | 3 | import java.util.Objects; 4 | 5 | import com.google.gson.annotations.Expose; 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | public class SamlEnabledRepresentation 9 | { 10 | 11 | @SerializedName("isSamlEnabled") 12 | @Expose 13 | private Boolean isSamlEnabled; 14 | 15 | @SerializedName("isSamlEnforced") 16 | @Expose 17 | private Boolean isSamlEnforced; 18 | 19 | @SerializedName("idpDescription") 20 | @Expose 21 | private String idpDescription; 22 | 23 | @SerializedName("tenantDomain") 24 | @Expose 25 | private String tenantDomain; 26 | 27 | /** 28 | * @return The isSamlEnabled 29 | */ 30 | public Boolean getIsSamlEnabled() 31 | { 32 | return isSamlEnabled; 33 | } 34 | 35 | /** 36 | * @param isSamlEnabled The isSamlEnabled 37 | */ 38 | public void setIsSamlEnabled(Boolean isSamlEnabled) 39 | { 40 | this.isSamlEnabled = isSamlEnabled; 41 | } 42 | 43 | /** 44 | * @return The isSamlEnforced 45 | */ 46 | public Boolean getIsSamlEnforced() 47 | { 48 | return isSamlEnforced; 49 | } 50 | 51 | /** 52 | * @param isSamlEnforced The isSamlEnforced 53 | */ 54 | public void setIsSamlEnforced(Boolean isSamlEnforced) 55 | { 56 | this.isSamlEnforced = isSamlEnforced; 57 | } 58 | 59 | /** 60 | * @return The idpDescription 61 | */ 62 | public String getIdpDescription() 63 | { 64 | return idpDescription; 65 | } 66 | 67 | /** 68 | * @param idpDescription The idpDescription 69 | */ 70 | public void setIdpDescription(String idpDescription) 71 | { 72 | this.idpDescription = idpDescription; 73 | } 74 | 75 | /** 76 | * @return The tenantDomain 77 | */ 78 | public String getTenantDomain() 79 | { 80 | return tenantDomain; 81 | } 82 | 83 | /** 84 | * @param tenantDomain The tenantDomain 85 | */ 86 | public void setTenantDomain(String tenantDomain) 87 | { 88 | this.tenantDomain = tenantDomain; 89 | } 90 | 91 | @Override 92 | public int hashCode() 93 | { 94 | return Objects.hash(isSamlEnabled, isSamlEnforced, idpDescription, tenantDomain); 95 | } 96 | 97 | @Override 98 | public String toString() 99 | { 100 | StringBuilder sb = new StringBuilder(); 101 | sb.append("class SAMLEnabledRepresentation {\n"); 102 | sb.append(" isSamlEnabled: ").append(toIndentedString(isSamlEnabled)).append("\n"); 103 | sb.append(" isSamlEnforced: ").append(toIndentedString(isSamlEnforced)).append("\n"); 104 | sb.append(" idpDescription: ").append(toIndentedString(idpDescription)).append("\n"); 105 | sb.append(" tenantDomain: ").append(toIndentedString(tenantDomain)).append("\n"); 106 | sb.append("}"); 107 | return sb.toString(); 108 | } 109 | 110 | /** 111 | * Convert the given object to string with each line indented by 4 spaces 112 | * (except the first line). 113 | */ 114 | private String toIndentedString(Object o) 115 | { 116 | if (o == null) { return "null"; } 117 | return o.toString().replace("\n", "\n "); 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/utils/authentication/saml/models/SamlEnabledRepresentationEntry.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.utils.authentication.saml.models; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.google.gson.annotations.Expose; 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | public class SamlEnabledRepresentationEntry implements Serializable 9 | { 10 | 11 | @SerializedName("entry") 12 | @Expose 13 | private SamlEnabledRepresentation entry; 14 | 15 | public SamlEnabledRepresentation getEntry() 16 | { 17 | return entry; 18 | } 19 | 20 | public void setEntry(SamlEnabledRepresentation entry) 21 | { 22 | this.entry = entry; 23 | } 24 | 25 | @Override 26 | public int hashCode() 27 | { 28 | return entry.hashCode(); 29 | } 30 | 31 | @Override 32 | public String toString() 33 | { 34 | return entry.toString(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/utils/authentication/saml/models/SamlTicketRepresentation.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.utils.authentication.saml.models; 2 | 3 | import java.io.Serializable; 4 | import java.util.Objects; 5 | 6 | import com.google.gson.annotations.Expose; 7 | import com.google.gson.annotations.SerializedName; 8 | 9 | public class SamlTicketRepresentation implements Serializable 10 | { 11 | 12 | @SerializedName("ticket") 13 | @Expose 14 | private String ticket; 15 | 16 | @SerializedName("userId") 17 | @Expose 18 | private String userId; 19 | 20 | public String getTicket() 21 | { 22 | return ticket; 23 | } 24 | 25 | public void setTicket(String ticket) 26 | { 27 | this.ticket = ticket; 28 | } 29 | 30 | public String getUserId() 31 | { 32 | return userId; 33 | } 34 | 35 | public void setUserId(String userId) 36 | { 37 | this.userId = userId; 38 | } 39 | 40 | @Override 41 | public int hashCode() 42 | { 43 | return Objects.hash(ticket, userId); 44 | } 45 | 46 | @Override 47 | public String toString() 48 | { 49 | StringBuilder sb = new StringBuilder(); 50 | sb.append("class SamlTicketRepresentation {\n"); 51 | sb.append(" ticket: ").append(toIndentedString(ticket)).append("\n"); 52 | sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); 53 | sb.append("}"); 54 | return sb.toString(); 55 | } 56 | 57 | /** 58 | * Convert the given object to string with each line indented by 4 spaces 59 | * (except the first line). 60 | */ 61 | private String toIndentedString(Object o) 62 | { 63 | if (o == null) { return "null"; } 64 | return o.toString().replace("\n", "\n "); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/main/java/com/alfresco/client/utils/authentication/saml/models/SamlTicketRepresentationEntry.java: -------------------------------------------------------------------------------- 1 | package com.alfresco.client.utils.authentication.saml.models; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.google.gson.annotations.Expose; 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | public class SamlTicketRepresentationEntry implements Serializable 9 | { 10 | 11 | @SerializedName("entry") 12 | @Expose 13 | private SamlTicketRepresentation entry; 14 | 15 | public SamlTicketRepresentation getEntry() 16 | { 17 | return entry; 18 | } 19 | 20 | public void setEntry(SamlTicketRepresentation entry) 21 | { 22 | this.entry = entry; 23 | } 24 | 25 | @Override 26 | public int hashCode() 27 | { 28 | return entry.hashCode(); 29 | } 30 | 31 | @Override 32 | public String toString() 33 | { 34 | return entry.toString(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/test/java/com/alfresco/client/api/tests/authentication/AuthenticationApiTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.tests.authentication; 20 | 21 | import java.io.IOException; 22 | 23 | import org.testng.Assert; 24 | import org.testng.annotations.BeforeClass; 25 | import org.testng.annotations.Test; 26 | 27 | import com.alfresco.client.api.AlfrescoAPITestCase; 28 | import com.alfresco.client.api.authentication.AuthenticationAPI; 29 | import com.alfresco.client.api.authentication.body.TicketBody; 30 | import com.alfresco.client.api.authentication.representation.TicketRepresentation; 31 | import com.alfresco.client.api.authentication.representation.ValidTicketRepresentation; 32 | import com.alfresco.client.api.core.NodesAPI; 33 | import com.alfresco.client.api.core.model.representation.NodeRepresentation; 34 | 35 | import retrofit2.Response; 36 | 37 | public class AuthenticationApiTest extends AlfrescoAPITestCase 38 | { 39 | 40 | @BeforeClass 41 | public void prepare() throws Exception 42 | { 43 | client = prepareClient(TEST_ENDPOINT, TEST_USERNAME, TEST_PASSWORD); 44 | } 45 | 46 | @Test 47 | public void authenticate() throws IOException 48 | { 49 | 50 | AuthenticationAPI authAPI = client.getAuthenticationAPI(); 51 | 52 | // Validate undefined ticket 53 | Response validate = authAPI.validateTicketCall().execute(); 54 | Assert.assertFalse(validate.isSuccessful()); 55 | 56 | // Create Ticket 57 | Response ticketResponse = authAPI 58 | .createTicketCall(new TicketBody(TEST_USERNAME, TEST_PASSWORD)).execute(); 59 | Assert.assertTrue(ticketResponse.isSuccessful()); 60 | 61 | TicketRepresentation ticket = ticketResponse.body(); 62 | Assert.assertTrue(ticket.getId().startsWith("TICKET_"), "Ticket value doesn't start with TICKET_ prefix"); 63 | Assert.assertEquals(TEST_USERNAME, ticket.getUserId(), "Ticket userId is not " + TEST_USERNAME); 64 | 65 | // Get Ticket 66 | // Need to refresh client object with new credentials 67 | client = prepareClientTicket(TEST_ENDPOINT, ticket.getId()); 68 | authAPI = client.getAuthenticationAPI(); 69 | 70 | // Check it works 71 | Response nodeResponse = client.getNodesAPI().getNodeCall(NodesAPI.FOLDER_MY).execute(); 72 | Assert.assertTrue(nodeResponse.isSuccessful()); 73 | 74 | // Validate again 75 | validate = authAPI.validateTicketCall().execute(); 76 | Assert.assertTrue(validate.isSuccessful()); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/test/java/com/alfresco/client/api/tests/core/ActivityStreamApiTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.tests.core; 20 | 21 | import java.io.IOException; 22 | import java.util.List; 23 | 24 | import org.testng.Assert; 25 | import org.testng.annotations.BeforeClass; 26 | import org.testng.annotations.Test; 27 | 28 | import com.alfresco.client.api.AlfrescoAPITestCase; 29 | import com.alfresco.client.api.common.representation.ResultPaging; 30 | import com.alfresco.client.api.core.ActivitiesAPI; 31 | import com.alfresco.client.api.core.model.representation.ActivityRepresentation; 32 | 33 | import retrofit2.Response; 34 | 35 | public class ActivityStreamApiTest extends AlfrescoAPITestCase 36 | { 37 | @BeforeClass 38 | public void prepare() throws Exception 39 | { 40 | client = prepareClient(TEST_ENDPOINT, TEST_USERNAME, TEST_PASSWORD); 41 | } 42 | 43 | @Test 44 | public void retrieveActivities() throws IOException 45 | { 46 | // Request All Comments for a document 47 | Response> response = client.getAPI(ActivitiesAPI.class) 48 | .listActivitiesForPersonCall(TEST_USERNAME).execute(); 49 | Assert.assertNotNull(response); 50 | Assert.assertEquals(response.isSuccessful(), true); 51 | 52 | // Check Response 53 | ResultPaging activitiPaging = response.body(); 54 | Assert.assertNotNull(activitiPaging, "Response is empty"); 55 | Assert.assertNotNull(activitiPaging.getList(), "Response has no listActivitiesForPersonCall of comments"); 56 | 57 | // Check Pagination & Entries 58 | List activities = activitiPaging.getList(); 59 | Assert.assertNotNull(activities, "Response has no pagination"); 60 | 61 | // Check Entry 62 | for (int i = 0; i < activitiPaging.getCount(); i++) 63 | { 64 | Assert.assertNotNull(activities.get(i)); 65 | Assert.assertNotNull(activities.get(i).getActivitySummary()); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/test/java/com/alfresco/client/api/tests/core/FavoritesApiTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.tests.core; 20 | 21 | import java.io.IOException; 22 | 23 | import org.testng.Assert; 24 | import org.testng.annotations.BeforeClass; 25 | import org.testng.annotations.Test; 26 | 27 | import com.alfresco.client.api.AlfrescoAPITestCase; 28 | import com.alfresco.client.api.common.representation.ResultPaging; 29 | import com.alfresco.client.api.core.FavoritesAPI; 30 | import com.alfresco.client.api.core.model.body.FavoriteBodyCreate; 31 | import com.alfresco.client.api.core.model.representation.FavoriteRepresentation; 32 | import com.alfresco.client.api.core.model.representation.NodeRepresentation; 33 | 34 | import retrofit2.Response; 35 | 36 | public class FavoritesApiTest extends AlfrescoAPITestCase 37 | { 38 | @BeforeClass 39 | public void prepare() throws Exception 40 | { 41 | client = prepareClient(TEST_ENDPOINT, TEST_USERNAME, TEST_PASSWORD); 42 | } 43 | 44 | @Test 45 | public void retrieveFavorites() throws IOException 46 | { 47 | FavoritesAPI favoritesAPI = client.getFavoritesAPI(); 48 | 49 | // Create File 50 | NodeRepresentation dummyNode = createDummyFile(); 51 | 52 | // Check No Favorites 53 | Response> response = favoritesAPI.listFavoritesCall(TEST_USERNAME) 54 | .execute(); 55 | Assert.assertNotNull(response); 56 | Assert.assertEquals(response.isSuccessful(), true); 57 | Assert.assertEquals(response.body().getCount(), 0, "Favorite already present?"); 58 | 59 | // Add Favorite File 60 | Response favResponse = favoritesAPI.createFavoriteCall(TEST_USERNAME, 61 | new FavoriteBodyCreate(FavoriteBodyCreate.FavoriteTypeEnum.FILE, dummyNode.getId()), null).execute(); 62 | Assert.assertNotNull(favResponse); 63 | Assert.assertEquals(favResponse.isSuccessful(), true); 64 | 65 | String favId = favResponse.body().getTargetGuid(); 66 | 67 | // Check One Favorites 68 | response = favoritesAPI.listFavoritesCall(TEST_USERNAME).execute(); 69 | Assert.assertEquals(response.body().getCount(), 1, "Favorite already present?"); 70 | 71 | // Retrieve one favorite 72 | Response favResponse2 = favoritesAPI.getFavoriteCall(TEST_USERNAME, favId).execute(); 73 | Assert.assertEquals(favResponse2.body(), favResponse.body(), "Favorite are not the same?"); 74 | 75 | // Remove Favorite 76 | favoritesAPI.deleteFavoriteCall(TEST_USERNAME, favId).execute(); 77 | 78 | // Check No Favorites 79 | response = favoritesAPI.listFavoritesCall(TEST_USERNAME).execute(); 80 | Assert.assertEquals(response.body().getCount(), 0, "Favorite already present?"); 81 | 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/test/java/com/alfresco/client/api/tests/core/PeopleApiTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.tests.core; 20 | 21 | import java.io.IOException; 22 | 23 | import org.testng.Assert; 24 | import org.testng.annotations.BeforeClass; 25 | import org.testng.annotations.Test; 26 | 27 | import com.alfresco.client.api.AlfrescoAPITestCase; 28 | import com.alfresco.client.api.core.PeopleAPI; 29 | import com.alfresco.client.api.core.model.representation.PersonRepresentation; 30 | 31 | import retrofit2.Response; 32 | 33 | public class PeopleApiTest extends AlfrescoAPITestCase 34 | { 35 | 36 | @BeforeClass 37 | public void prepare() throws Exception 38 | { 39 | client = prepareClient(TEST_ENDPOINT, TEST_USERNAME, TEST_PASSWORD); 40 | } 41 | 42 | @Test 43 | public void retrievePerson() throws IOException 44 | { 45 | // Request All Sites 46 | Response response = client.getAPI(PeopleAPI.class).getPersonCall("admin").execute(); 47 | Assert.assertNotNull(response); 48 | Assert.assertEquals(response.isSuccessful(), true); 49 | 50 | // Check Response 51 | PersonRepresentation person = response.body(); 52 | Assert.assertNotNull(person, "Response is empty"); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/test/java/com/alfresco/client/api/tests/core/RatingApiTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client.api.tests.core; 20 | 21 | import java.io.IOException; 22 | 23 | import org.testng.annotations.BeforeClass; 24 | import org.testng.annotations.Test; 25 | 26 | import com.alfresco.client.api.AlfrescoAPITestCase; 27 | 28 | public class RatingApiTest extends AlfrescoAPITestCase 29 | { 30 | @BeforeClass 31 | public void prepare() throws Exception 32 | { 33 | client = prepareClient(TEST_ENDPOINT, TEST_USERNAME, TEST_PASSWORD); 34 | } 35 | 36 | @Test 37 | public void retrieveComments() throws IOException 38 | { 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/test/resources/com/alfresco/client/api/tests/test.txt: -------------------------------------------------------------------------------- 1 | Simple Test. -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/test/resources/com/alfresco/client/api/tests/test2.txt: -------------------------------------------------------------------------------- 1 | Simple Test. But a bit longer. -------------------------------------------------------------------------------- /client-java/alfresco-java-client/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /client-java/client-commons/README.md: -------------------------------------------------------------------------------- 1 | #Welcome to Alfresco Client Commons 2 | 3 | ## Introduction 4 | Common utility lib across client porject. 5 | 6 | ### Status 7 | **Please note this project is currently under development.** 8 | 9 | ##Installation 10 | 11 | ###MAVEN 12 | 13 | ```xml 14 | 15 | org.alfresco.client 16 | client-api-commons 17 | 1.0.0-beta1 18 | 19 | ``` 20 | 21 | ###GRADLE 22 | ```gradle 23 | compile 'org.alfresco.client:client-api-commons:1.0.0-beta1' 24 | ``` 25 | 26 | -------------------------------------------------------------------------------- /client-java/client-commons/pom.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 22 | 4.0.0 23 | 24 | org.alfresco.client 25 | alfresco-client 26 | 1.0.0-beta1 27 | ../../ 28 | 29 | client-commons 30 | Alfresco Client Commons 31 | Alfresco Client Commons 32 | jar 33 | 34 | 35 | 36 | 37 | com.squareup.retrofit2 38 | retrofit 39 | 40 | 41 | com.squareup.retrofit2 42 | adapter-rxjava 43 | 44 | 45 | com.squareup.retrofit2 46 | converter-gson 47 | 48 | 49 | com.squareup.okhttp3 50 | okhttp 51 | 52 | 53 | com.squareup.okhttp3 54 | logging-interceptor 55 | 56 | 57 | -------------------------------------------------------------------------------- /client-java/client-commons/src/main/java/com/alfresco/client/RestClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package com.alfresco.client; 20 | 21 | import retrofit2.Retrofit; 22 | 23 | public class RestClient 24 | { 25 | public final String username; 26 | 27 | public final String endpoint; 28 | 29 | public final Retrofit retrofit; 30 | 31 | public RestClient(String endpoint, Retrofit retrofit, String username) 32 | { 33 | this.endpoint = endpoint; 34 | this.retrofit = retrofit; 35 | this.username = username; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /client-samples/client-samples-cli/README.md: -------------------------------------------------------------------------------- 1 | #Alfresco Client - Command Line Tool 2 | 3 | ## Introduction 4 | This sample project illustrates how to use the alfresco java client lib to build a simple command line tool. 5 | 6 | ### Status 7 | **Please note this project is currently under development.** 8 | 9 | ##Usage 10 | ![Alfresco CLI](docs/SampleAlfrescoCLI.PNG) -------------------------------------------------------------------------------- /client-samples/client-samples-cli/docs/SampleAlfrescoCLI.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alfresco/alfresco-client-sdk/f9b787ff8b95ffb2b2fd3feb5eadfe9f3800f8e6/client-samples/client-samples-cli/docs/SampleAlfrescoCLI.PNG -------------------------------------------------------------------------------- /client-samples/client-samples-cli/pom.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 22 | 4.0.0 23 | 24 | org.alfresco.client 25 | alfresco-client 26 | 1.0.0-beta1 27 | ../../ 28 | 29 | client-samples-cli 30 | Client Samples - CLI 31 | Alfresco Command Line Tool 32 | jar 33 | 34 | 35 | 36 | 37 | org.alfresco.client 38 | alfresco-java-client 39 | 40 | 41 | io.airlift 42 | airline 43 | 44 | 45 | 46 | 47 | 48 | 49 | maven-assembly-plugin 50 | 51 | 52 | 53 | org.alfresco.client.cli.AlfrescoCLI 54 | 55 | 56 | 57 | jar-with-dependencies 58 | 59 | alfresco-cli 60 | 61 | 62 | 63 | make-assembly 64 | package 65 | 66 | single 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /client-samples/client-samples-cli/src/main/java/org/alfresco/client/cli/AlfrescoCLI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2016 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco Java Client. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.alfresco.client.cli; 20 | 21 | import io.airlift.airline.Cli; 22 | import io.airlift.airline.Help; 23 | import io.airlift.airline.Option; 24 | import io.airlift.airline.OptionType; 25 | 26 | /** 27 | * Created by jpascal on 18/01/2016. 28 | */ 29 | public class AlfrescoCLI 30 | { 31 | public static void main(String[] args) 32 | { 33 | Cli.CliBuilder builder = Cli. builder("alfclient") 34 | .withDescription("Sample Alfresco Command Line Client").withDefaultCommand(Help.class) 35 | .withCommands(Help.class, AlfrescoCommands.infoUser.class) 36 | .withCommands(Help.class, AlfrescoCommands.listRoot.class); 37 | 38 | Cli gitParser = builder.build(); 39 | 40 | gitParser.parse(args).run(); 41 | } 42 | 43 | public static class BaseCommand implements Runnable 44 | { 45 | @Option(type = OptionType.GLOBAL, name = "-v", description = "Verbose mode") 46 | public boolean verbose; 47 | 48 | @Option(type = OptionType.GLOBAL, name = "-h", required = true, description = "Hostname") 49 | public String hostname; 50 | 51 | @Option(type = OptionType.GLOBAL, name = "-u", required = true, description = "Username") 52 | public String username; 53 | 54 | @Option(type = OptionType.GLOBAL, name = "-p", required = true, description = "Password") 55 | public String password; 56 | 57 | public void run() 58 | { 59 | System.out.println(getClass().getSimpleName()); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /client-samples/client-samples-cli/src/main/java/org/alfresco/client/cli/AlfrescoCommands.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.client.cli; 2 | 3 | import java.io.IOException; 4 | 5 | import com.alfresco.client.AlfrescoClient; 6 | import com.alfresco.client.api.common.representation.ResultPaging; 7 | import com.alfresco.client.api.core.NodesAPI; 8 | import com.alfresco.client.api.core.model.representation.NodeRepresentation; 9 | import com.alfresco.client.api.core.model.representation.PersonRepresentation; 10 | 11 | import io.airlift.airline.Command; 12 | 13 | /** 14 | * Created by jpascal on 02/03/2016. 15 | */ 16 | public class AlfrescoCommands 17 | { 18 | 19 | @Command(name = "list-root", description = "List Company Home") 20 | public static class listRoot extends AlfrescoCLI.BaseCommand 21 | { 22 | @Override 23 | public void run() 24 | { 25 | try 26 | { 27 | final AlfrescoClient client = new AlfrescoClient.Builder().connect(hostname, username, password) 28 | .build(); 29 | ResultPaging nodes = client.getNodesAPI().listNodeChildrenCall(NodesAPI.FOLDER_ROOT) 30 | .execute().body(); 31 | 32 | System.out.println(""); 33 | System.out.println("---------------------------------------------"); 34 | System.out.println("COMPANY HOME CHILDREN"); 35 | System.out.println("---------------------------------------------"); 36 | for (NodeRepresentation node : nodes.getList()) 37 | { 38 | if (node.isFolder()) 39 | { 40 | System.out.println(" + " + node.getName()); 41 | } 42 | else 43 | { 44 | System.out.println(" - " + node.getName()); 45 | } 46 | } 47 | } 48 | catch (IOException e) 49 | { 50 | e.printStackTrace(); 51 | } 52 | } 53 | } 54 | 55 | @Command(name = "user-info", description = "Person Info") 56 | public static class infoUser extends AlfrescoCLI.BaseCommand 57 | { 58 | @Override 59 | public void run() 60 | { 61 | try 62 | { 63 | final AlfrescoClient client = new AlfrescoClient.Builder().connect(hostname, username, password) 64 | .build(); 65 | PersonRepresentation person = client.getPeopleAPI().getPersonCall(username).execute().body(); 66 | 67 | System.out.println(""); 68 | System.out.println("---------------------------------------------"); 69 | System.out.println("PERSON INFO"); 70 | System.out.println("---------------------------------------------"); 71 | System.out.println("First Name:" + person.getFirstName()); 72 | System.out.println("Last Name:" + person.getLastName()); 73 | System.out.println("Email:" + person.getEmail()); 74 | System.out.println("Location:" + person.getLocation()); 75 | } 76 | catch (IOException e) 77 | { 78 | e.printStackTrace(); 79 | } 80 | } 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /client-samples/client-samples-java/README.md: -------------------------------------------------------------------------------- 1 | #Alfresco Client - Java Samples 2 | 3 | ## Introduction 4 | The project regroups different simple java apps which interact with Alfresco Java Client. 5 | 6 | ### Status 7 | **Please note this project is currently under development.** 8 | 9 | ##Usage 10 | -------------------------------------------------------------------------------- /client-samples/client-samples-java/pom.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 22 | 4.0.0 23 | 24 | org.alfresco.client 25 | alfresco-client 26 | 1.0.0-beta1 27 | ../../ 28 | 29 | client-samples-java 30 | Alfresco Client Samples - Java 31 | Alfresco Client Samples project API 32 | jar 33 | 34 | 35 | 36 | 1.8 37 | 1.8 38 | 1.8 39 | 1.8 40 | 41 | 42 | 43 | 44 | org.alfresco.client 45 | alfresco-java-client 46 | 47 | 48 | org.testng 49 | testng 50 | 51 | 52 | -------------------------------------------------------------------------------- /client-samples/client-samples-java/src/main/java/org/alfresco/client/samples/SampleConstants.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.client.samples; 2 | 3 | /** 4 | * Created by jpascal on 02/03/2016. 5 | */ 6 | public class SampleConstants 7 | { 8 | 9 | public static final String ALFRESCO_URL = "http://"; 10 | 11 | public static final String ALFRESCO_USER = "admin"; 12 | 13 | public static final String ALFRESCO_PASSWORD = "admin"; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /client-samples/client-samples-java/src/main/java/org/alfresco/client/samples/batch/HelloECM.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.client.samples.batch; 2 | 3 | import java.io.IOException; 4 | 5 | import org.testng.Assert; 6 | 7 | import com.alfresco.client.AlfrescoClient; 8 | import com.alfresco.client.api.core.NodesAPI; 9 | import com.alfresco.client.api.core.model.representation.NodeRepresentation; 10 | 11 | import retrofit2.Response; 12 | 13 | /** 14 | * Created by jpascal on 18/01/2016. 15 | */ 16 | public class HelloECM 17 | { 18 | public static void main(String[] args) throws IOException 19 | { 20 | AlfrescoClient client = new AlfrescoClient.Builder() 21 | .connect("http://localhost:8080/alfresco/", "admin", "admin").build(); 22 | 23 | // Create Custom Node API 24 | NodesAPI nodeService = client.getNodesAPI(); 25 | Response nodeResponse = nodeService.getNodeCall(NodesAPI.FOLDER_ROOT).execute(); 26 | Assert.assertNotNull(nodeResponse); 27 | Assert.assertEquals(nodeResponse.isSuccessful(), true); 28 | Assert.assertEquals(nodeResponse.body().getName(), "Company Home"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /client-samples/client-samples-java/src/main/java/org/alfresco/client/samples/customclient/deserializer/NodeDeserializer.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.client.samples.customclient.deserializer; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import org.alfresco.client.samples.customclient.model.Node; 6 | import org.alfresco.client.samples.customclient.model.NodeImpl; 7 | 8 | import com.alfresco.client.api.common.constant.PublicAPIConstant; 9 | import com.google.gson.JsonDeserializationContext; 10 | import com.google.gson.JsonDeserializer; 11 | import com.google.gson.JsonElement; 12 | import com.google.gson.JsonParseException; 13 | 14 | /** 15 | * Created by jpascal on 19/01/2016. 16 | */ 17 | public class NodeDeserializer implements JsonDeserializer 18 | { 19 | @Override 20 | public Node deserialize(JsonElement je, Type type, JsonDeserializationContext jdc) throws JsonParseException 21 | { 22 | JsonElement entry = je; 23 | if (je.getAsJsonObject().has(PublicAPIConstant.ENTRY_VALUE)) 24 | { 25 | entry = je.getAsJsonObject().get(PublicAPIConstant.ENTRY_VALUE); 26 | } 27 | return jdc.deserialize(entry, NodeImpl.class); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /client-samples/client-samples-java/src/main/java/org/alfresco/client/samples/customclient/deserializer/ServerInfoDeserializer.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.client.samples.customclient.deserializer; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | import com.alfresco.client.api.common.constant.PublicAPIConstant; 6 | import com.alfresco.client.api.core.model.representation.ServerInfoRepresentation; 7 | import com.alfresco.client.utils.ISO8601Utils; 8 | import com.google.gson.*; 9 | 10 | /** 11 | * Created by jpascal on 19/01/2016. 12 | */ 13 | public class ServerInfoDeserializer implements JsonDeserializer 14 | { 15 | @Override 16 | public ServerInfoRepresentation deserialize(JsonElement je, Type type, JsonDeserializationContext jdc) 17 | throws JsonParseException 18 | { 19 | JsonElement entry = je; 20 | if (je.getAsJsonObject().has(PublicAPIConstant.DATA_VALUE)) 21 | { 22 | entry = je.getAsJsonObject().get(PublicAPIConstant.DATA_VALUE); 23 | } 24 | return new GsonBuilder().setDateFormat(ISO8601Utils.DATE_ISO_FORMAT).create().fromJson(entry, type); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /client-samples/client-samples-java/src/main/java/org/alfresco/client/samples/customclient/model/Node.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.client.samples.customclient.model; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import com.alfresco.client.api.core.model.representation.ContentInfoRepresentation; 7 | import com.alfresco.client.api.core.model.representation.PathInfoRepresentation; 8 | import com.alfresco.client.api.core.model.representation.UserInfoRepresentation; 9 | import com.google.gson.internal.LinkedTreeMap; 10 | 11 | /** 12 | * Created by jpascal on 21/01/2016. 13 | */ 14 | public interface Node 15 | { 16 | 17 | String getIdentifier(); 18 | 19 | String getName(); 20 | 21 | String getNodeType(); 22 | 23 | String getDescription(); 24 | 25 | Date getCreatedAt(); 26 | 27 | UserInfoRepresentation getCreatedBy(); 28 | 29 | boolean isFolder(); 30 | 31 | Date getModifiedAt(); 32 | 33 | UserInfoRepresentation getModifiedBy(); 34 | 35 | String getParentId(); 36 | 37 | PathInfoRepresentation getPath(); 38 | 39 | ContentInfoRepresentation getContent(); 40 | 41 | List getAspects(); 42 | 43 | boolean hasAspects(String aspectName); 44 | 45 | LinkedTreeMap getProperties(); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /client-samples/client-samples-java/src/main/java/org/alfresco/client/samples/customclient/services/ServerInfoService.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.client.samples.customclient.services; 2 | 3 | import com.alfresco.client.api.core.model.representation.ServerInfoRepresentation; 4 | 5 | import retrofit2.Call; 6 | import retrofit2.http.GET; 7 | 8 | public interface ServerInfoService 9 | { 10 | @GET("service/api/server") 11 | Call getInfo(); 12 | } 13 | -------------------------------------------------------------------------------- /client-samples/client-samples-java/src/main/java/org/alfresco/client/samples/lambdas/LambdasRxECM.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.client.samples.lambdas; 2 | 3 | import java.io.IOException; 4 | 5 | import org.testng.Assert; 6 | 7 | import com.alfresco.client.AlfrescoClient; 8 | import com.alfresco.client.api.core.NodesAPI; 9 | 10 | import rx.Observable; 11 | 12 | /** 13 | * Created by jpascal on 18/01/2016. 14 | */ 15 | public class LambdasRxECM 16 | { 17 | public static void main(String[] args) throws IOException 18 | { 19 | // Create AlfrescoClient 20 | AlfrescoClient client = new AlfrescoClient.Builder() 21 | .connect("http://localhost:8080/alfresco/", "admin", "admin").build(); 22 | 23 | NodesAPI nodesAPI = client.getNodesAPI(); 24 | 25 | // Retrieve Company Home via Observable 26 | nodesAPI.getNodeObservable(NodesAPI.FOLDER_ROOT) 27 | .subscribe(root -> Assert.assertEquals(root.getName(), "Company Home")); 28 | 29 | // Get the folder Root and list all its children 30 | // Then get the Data Dictionary Folder and list its children 31 | // Then Print the number of children 32 | nodesAPI.getNodeObservable(NodesAPI.FOLDER_ROOT) 33 | .flatMap(node -> nodesAPI.listNodeChildrenObservable(node.getId())) 34 | .flatMap(nodes -> Observable.from(nodes.getList())) 35 | .filter(node -> node.isFolder() && "Data Dictionary".equals(node.getName())) 36 | .flatMap(dataDictionaryFolder -> nodesAPI.listNodeChildrenObservable(dataDictionaryFolder.getId())) 37 | .subscribe(sites -> System.out.println(sites.getPagination().getTotalItems())); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Alfresco Client REST API Documentation 2 | 3 | ## Introduction 4 | This folder contains developer information about Alfresco Public REST API. 5 | 6 | ## Important Notice 7 | Up to date documentation can be found https://github.com/Alfresco/rest-api-explorer/tree/community-head/src/main/webapp/definitions 8 | 9 | 10 | ## External Tools 11 | You can use http://editor.swagger.io/ to open & edit swagger information. 12 | 13 | --------------------------------------------------------------------------------