From 25613d75d9fc66acac270fb6312d9f6cad90f81e Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Wed, 2 Aug 2017 13:29:40 +0100 Subject: [PATCH 1/3] RM-4729: Declassification timeframe API Implementation --- .../rm/rest/api/properties/Property.java | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/properties/Property.java diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/properties/Property.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/properties/Property.java new file mode 100644 index 0000000000..c74f05099e --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/properties/Property.java @@ -0,0 +1,147 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2017 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ + +package org.alfresco.rm.rest.api.properties; + +/** + * POJO representing a property key/value in the alfresco-global.properties file + * + * @author Tuna Aksoy + * @since 2.6 + */ +public class Property +{ + /** + * Property key + */ + private String key = null; + + /** + * Property value + */ + private Object value = null; + + /** + * Empty constructor needed for the REST API + */ + public Property() + { + } + + /** + * Constructor + */ + public Property(String key, Object value) + { + this.key = key; + this.value = value; + } + + /** + * Gets the property key + * + * @return The property key + */ + public String getKey() + { + return key; + } + + /** + * Sets the property key + * + * @param key The property key to set + */ + public void setKey(String key) + { + this.key = key; + } + + /** + * Get the property value + * + * @return The property value + */ + public Object getValue() + { + return value; + } + + /** + * Sets the property value + * + * @param value The property value + */ + public void setValue(Object value) + { + this.value = value; + } + + /** + * Equals implementation for the property + */ + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (o == null || getClass() != o.getClass()) + { + return false; + } + + Property property = (Property) o; + + if (!key.equals(property.key)) + { + return false; + } + return value.equals(property.value); + } + + /** + * hashCode implementation for the property + */ + @Override + public int hashCode() + { + int result = key.hashCode(); + result = 31 * result + value.hashCode(); + return result; + } + + /** + * toString implementation for the property + */ + @Override + public String toString() + { + return "Property{" + "key='" + key + '\'' + ", value=" + value + '}'; + } +} From ec48fcc45ce1b992da0d21537e815300a09cd45f Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Fri, 4 Aug 2017 15:04:34 +0300 Subject: [PATCH 2/3] add rest api tests for declassificationTimeFrame --- .../java/org/alfresco/rest/rm/community/base/TestData.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java index a1ebcb2d11..d37b2325f4 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/TestData.java @@ -192,4 +192,7 @@ public interface TestData }; } + + + public static final String ALFRESCO_ADMINISTRATORS = "ALFRESCO_ADMINISTRATORS"; } From 5db0559f834ada2272f31b84c606863949f87102 Mon Sep 17 00:00:00 2001 From: Ramona Popa Date: Wed, 16 Aug 2017 15:41:28 +0300 Subject: [PATCH 3/3] RM-4729 - Modified implementation in order to match the refactored swagger api --- .../SecurityControlSetting.java} | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) rename rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/{properties/Property.java => model/SecurityControlSetting.java} (79%) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/properties/Property.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/SecurityControlSetting.java similarity index 79% rename from rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/properties/Property.java rename to rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/SecurityControlSetting.java index c74f05099e..fc6abae030 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/properties/Property.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/model/SecurityControlSetting.java @@ -25,37 +25,38 @@ * #L% */ -package org.alfresco.rm.rest.api.properties; +package org.alfresco.rm.rest.api.model; /** - * POJO representing a property key/value in the alfresco-global.properties file + * POJO representing a setting/property key/value in the alfresco-global.properties file * * @author Tuna Aksoy + * @author Ramona Popa * @since 2.6 */ -public class Property +public class SecurityControlSetting { /** - * Property key + * Setting key */ private String key = null; /** - * Property value + * Setting value */ private Object value = null; /** * Empty constructor needed for the REST API */ - public Property() + public SecurityControlSetting() { } /** * Constructor */ - public Property(String key, Object value) + public SecurityControlSetting(String key, Object value) { this.key = key; this.value = value; @@ -72,7 +73,7 @@ public class Property } /** - * Sets the property key + * Sets the setting key * * @param key The property key to set */ @@ -82,7 +83,7 @@ public class Property } /** - * Get the property value + * Get the setting value * * @return The property value */ @@ -92,9 +93,9 @@ public class Property } /** - * Sets the property value + * Sets the setting value * - * @param value The property value + * @param value The setting value */ public void setValue(Object value) { @@ -116,13 +117,13 @@ public class Property return false; } - Property property = (Property) o; + SecurityControlSetting setting = (SecurityControlSetting) o; - if (!key.equals(property.key)) + if (!key.equals(setting.key)) { return false; } - return value.equals(property.value); + return value.equals(setting.value); } /** @@ -135,13 +136,12 @@ public class Property result = 31 * result + value.hashCode(); return result; } - /** * toString implementation for the property */ @Override public String toString() { - return "Property{" + "key='" + key + '\'' + ", value=" + value + '}'; + return "Setting{" + "key='" + key + '\'' + ", value=" + value + '}'; } }