Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)

128790 mmuller: Fix for REPO-855 + Sanity test


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@129186 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Martin Muller
2016-08-05 13:49:10 +00:00
parent 79149bf9b3
commit 15f33e6130
6 changed files with 75 additions and 50 deletions

View File

@@ -12,6 +12,10 @@
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/</url>
<!-- bug fix REPO-855 -->
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/{leftover}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/{leftover}/</url>
<!-- -->
<authentication>user</authentication> <authentication>user</authentication>
<format default="json">argument</format> <format default="json">argument</format>
<!-- Note: the transaction is created in AbstractResourceWebScript --> <!-- Note: the transaction is created in AbstractResourceWebScript -->

View File

@@ -12,6 +12,10 @@
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/</url>
<!-- bug fix REPO-855 -->
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/{leftover}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/{leftover}/</url>
<!-- -->
<authentication>user</authentication> <authentication>user</authentication>
<format default="json">argument</format> <format default="json">argument</format>
<!-- Note: the transaction is created in AbstractResourceWebScript --> <!-- Note: the transaction is created in AbstractResourceWebScript -->

View File

@@ -12,6 +12,10 @@
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/</url>
<!-- bug fix REPO-855 -->
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/{leftover}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/{leftover}/</url>
<!-- -->
<authentication>user</authentication> <authentication>user</authentication>
<format default="json">argument</format> <format default="json">argument</format>
<!-- Note: the transaction is created in AbstractResourceWebScript --> <!-- Note: the transaction is created in AbstractResourceWebScript -->

View File

@@ -12,6 +12,10 @@
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/</url> <url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/</url>
<!-- bug fix REPO-855 -->
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/{leftover}</url>
<url>/{apiScope}/{apiName}/versions/{apiVersion}/{collectionResource}/{entityId}/{relationResource}/{relationshipId}/{property}/{leftover}/</url>
<!-- -->
<authentication>user</authentication> <authentication>user</authentication>
<format default="json">argument</format> <format default="json">argument</format>
<!-- Note: the transaction is created in AbstractResourceWebScript --> <!-- Note: the transaction is created in AbstractResourceWebScript -->

View File

@@ -1,28 +1,28 @@
/* /*
* #%L * #%L
* Alfresco Remote API * Alfresco Remote API
* %% * %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited * Copyright (C) 2005 - 2016 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of * If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is * the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms: * provided under the following open source license terms:
* *
* Alfresco is free software: you can redistribute it and/or modify * 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 * 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 * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* Alfresco is distributed in the hope that it will be useful, * Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L% * #L%
*/ */
package org.alfresco.rest.api.people; package org.alfresco.rest.api.people;
import org.alfresco.rest.api.Preferences; import org.alfresco.rest.api.Preferences;
@@ -80,6 +80,13 @@ public class PersonPreferencesRelation implements RelationshipResourceAction.Rea
@WebApiDescription(title = "Preference value for preference 'preferenceName' for person 'personId'.") @WebApiDescription(title = "Preference value for preference 'preferenceName' for person 'personId'.")
public Preference readById(String personId, String preferenceName, Parameters parameters) public Preference readById(String personId, String preferenceName, Parameters parameters)
{ {
// fix for REPO-855
String url = parameters.getRequest().getURL();
if(url.matches(".*workspace://SpacesStore/.*")){
preferenceName += url.substring(url.indexOf("//SpacesStore/"));
}
//
return preferences.getPreference(personId, preferenceName); return preferences.getPreference(personId, preferenceName);
} }

View File

@@ -1,28 +1,28 @@
/* /*
* #%L * #%L
* Alfresco Remote API * Alfresco Remote API
* %% * %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited * Copyright (C) 2005 - 2016 Alfresco Software Limited
* %% * %%
* This file is part of the Alfresco software. * This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of * If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is * the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms: * provided under the following open source license terms:
* *
* Alfresco is free software: you can redistribute it and/or modify * 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 * 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 * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* Alfresco is distributed in the hope that it will be useful, * Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L% * #L%
*/ */
package org.alfresco.rest.api.tests; package org.alfresco.rest.api.tests;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@@ -95,6 +95,8 @@ public class TestUserPreferences extends EnterpriseTestApi
expectedPreferences.add(new Preference("org.alfresco.share.documentList.testPreference1", String.valueOf(true))); expectedPreferences.add(new Preference("org.alfresco.share.documentList.testPreference1", String.valueOf(true)));
expectedPreferences.add(new Preference("org.alfresco.share.documentList.sortAscending", String.valueOf(true))); expectedPreferences.add(new Preference("org.alfresco.share.documentList.sortAscending", String.valueOf(true)));
expectedPreferences.add(new Preference("org.alfresco.share.documentList.testPreference3", String.valueOf(true))); expectedPreferences.add(new Preference("org.alfresco.share.documentList.testPreference3", String.valueOf(true)));
// new preference name for issue REPO-855
expectedPreferences.add(new Preference("org.alfresco.ext.folders.favourites.workspace://SpacesStore/4e3d0779-388a-4b94-91e1-eab588a7da3d.createdAt", String.valueOf(true)));
TenantUtil.runAsUserTenant(new TenantRunAsWork<Void>() TenantUtil.runAsUserTenant(new TenantRunAsWork<Void>()
{ {