Merged API-STRIKES-BACK (5.2.0) to HEAD (5.2)

127461 jvonka: Fix RA-1011: REST API create site
   - can't create site with id/shortName = 'true'


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127614 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jamal Kaabi-Mofrad
2016-06-02 22:24:27 +00:00
parent a6470f588e
commit 010295d84d
2 changed files with 16 additions and 5 deletions

View File

@@ -920,13 +920,14 @@ public class SitesImpl implements Sites
}
String siteId = siteInfo.getShortName();
NodeRef siteNodeRef = siteInfo.getNodeRef();
// default false (if not provided)
boolean skipShareSurfConfig = Boolean.valueOf(parameters.getParameter(PARAM_SKIP_SURF_CONFIGURATION));
if (skipShareSurfConfig == false)
{
// import default/fixed preset Share surf config
importSite(siteId);
importSite(siteId, siteNodeRef);
}
// pre-create doclib
@@ -936,7 +937,6 @@ public class SitesImpl implements Sites
boolean skipAddToFavorites = Boolean.valueOf(parameters.getParameter(PARAM_SKIP_ADDTOFAVORITES));
if (skipAddToFavorites == false)
{
NodeRef siteNodeRef = siteInfo.getNodeRef();
String personId = AuthenticationUtil.getFullyAuthenticatedUser();
favouritesService.addFavourite(personId, siteNodeRef); // ignore result
}
@@ -1005,11 +1005,10 @@ public class SitesImpl implements Sites
return site;
}
private void importSite(final String siteId)
private void importSite(final String siteId, final NodeRef siteNodeRef)
{
ImportPackageHandler acpHandler = new SiteImportPackageHandler(siteSurfConfig, siteId);
Location location = new Location(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
location.setPath("/app:company_home/st:sites/cm:" + ISO9075.encode(siteId));
Location location = new Location(siteNodeRef);
ImporterBinding binding = new ImporterBinding()
{
@Override