Merged HEAD (5.2) to 5.2.N (5.2.1)

127614 jkaabimofrad: 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/BRANCHES/DEV/5.2.N/root@127721 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-06-03 15:19:11 +00:00
parent c96fec3100
commit f3e9c355c3
2 changed files with 16 additions and 5 deletions

View File

@@ -927,13 +927,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
@@ -943,7 +944,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
}
@@ -1012,11 +1012,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