mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
CLOUD-1958 - CLONE - Cloud - "A server error has occured" while accessing a site dashboard.
- Surf libs r1316 - improvements to reporting error conditions from creating surf config presets - Share: retrying of Surf config creation if config for dashboard preset fails to create after creating a site. On repeated failure, deletes the site folder instance and requests user tries again later. - Repo: better rethrowing of exceptions during surf config creation - ensure txn rollback has a chance to occur git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55239 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -43,6 +43,7 @@ import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.query.CannedQueryPageDetails;
|
||||
import org.alfresco.query.PagingRequest;
|
||||
@@ -371,10 +372,12 @@ public class ADMRemoteStore extends BaseRemoteStore
|
||||
catch (AccessDeniedException ae)
|
||||
{
|
||||
res.setStatus(Status.STATUS_UNAUTHORIZED);
|
||||
throw ae;
|
||||
}
|
||||
catch (FileExistsException feeErr)
|
||||
{
|
||||
res.setStatus(Status.STATUS_CONFLICT);
|
||||
throw feeErr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,10 +425,12 @@ public class ADMRemoteStore extends BaseRemoteStore
|
||||
catch (AccessDeniedException ae)
|
||||
{
|
||||
res.setStatus(Status.STATUS_UNAUTHORIZED);
|
||||
throw ae;
|
||||
}
|
||||
catch (FileExistsException feeErr)
|
||||
{
|
||||
res.setStatus(Status.STATUS_CONFLICT);
|
||||
throw feeErr;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -433,6 +438,7 @@ public class ADMRemoteStore extends BaseRemoteStore
|
||||
// none of them should occur if the XML document is well formed
|
||||
logger.error(e);
|
||||
res.setStatus(Status.STATUS_INTERNAL_SERVER_ERROR);
|
||||
throw new AlfrescoRuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,6 +547,7 @@ public class ADMRemoteStore extends BaseRemoteStore
|
||||
catch (AccessDeniedException ae)
|
||||
{
|
||||
res.setStatus(Status.STATUS_UNAUTHORIZED);
|
||||
throw ae;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,6 +594,7 @@ public class ADMRemoteStore extends BaseRemoteStore
|
||||
catch (AccessDeniedException ae)
|
||||
{
|
||||
res.setStatus(Status.STATUS_UNAUTHORIZED);
|
||||
throw ae;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -780,6 +788,8 @@ public class ADMRemoteStore extends BaseRemoteStore
|
||||
|
||||
NodeRef surfConfigRef = aquireSurfConfigRef(path + (pattern != null ? ("/" + pattern) : ""), create);
|
||||
try
|
||||
{
|
||||
if (surfConfigRef != null)
|
||||
{
|
||||
if (create)
|
||||
{
|
||||
@@ -796,8 +806,6 @@ public class ADMRemoteStore extends BaseRemoteStore
|
||||
else
|
||||
{
|
||||
// perform the cm:name path lookup against our config root node
|
||||
if (surfConfigRef != null)
|
||||
{
|
||||
result = this.fileFolderService.resolveNamePath(surfConfigRef, pathElements);
|
||||
}
|
||||
}
|
||||
@@ -1011,9 +1019,11 @@ public class ADMRemoteStore extends BaseRemoteStore
|
||||
* @throws IOException
|
||||
*/
|
||||
private void outputFileNodes(Writer out, FileInfo fileInfo, NodeRef surfConfigRef, String pattern, boolean recurse) throws IOException
|
||||
{
|
||||
if (surfConfigRef != null)
|
||||
{
|
||||
final boolean debug = logger.isDebugEnabled();
|
||||
PagingResults<FileInfo> files = getFileNodes(fileInfo, surfConfigRef, pattern, recurse);
|
||||
PagingResults<FileInfo> files = getFileNodes(fileInfo, pattern, recurse);
|
||||
|
||||
final Map<NodeRef, String> nameCache = new HashMap<NodeRef, String>();
|
||||
for (final FileInfo file : files.getPage())
|
||||
@@ -1042,8 +1052,9 @@ public class ADMRemoteStore extends BaseRemoteStore
|
||||
if (debug) logger.debug(" /alfresco/site-data/" + displayPath.toString() + file.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected PagingResults<FileInfo> getFileNodes(FileInfo fileInfo, NodeRef surfConfigRef, String pattern, boolean recurse)
|
||||
protected PagingResults<FileInfo> getFileNodes(FileInfo fileInfo, String pattern, boolean recurse)
|
||||
{
|
||||
return fileFolderService.list(
|
||||
fileInfo.getNodeRef(), true, false,
|
||||
|
Reference in New Issue
Block a user