mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Add debug log message if exceptions are swallowed.
Fix a couple of minor issues in DynamicAuthoritiesGet webscript.
This commit is contained in:
@@ -60,6 +60,8 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.extensions.surf.util.I18NUtil;
|
import org.springframework.extensions.surf.util.I18NUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,6 +73,8 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
|||||||
public class FilePlanRoleServiceImpl implements FilePlanRoleService,
|
public class FilePlanRoleServiceImpl implements FilePlanRoleService,
|
||||||
RecordsManagementModel
|
RecordsManagementModel
|
||||||
{
|
{
|
||||||
|
/** Logger for the class. */
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(FilePlanRoleServiceImpl.class);
|
||||||
/** I18N */
|
/** I18N */
|
||||||
private static final String MSG_ALL_ROLES = "rm.role.all";
|
private static final String MSG_ALL_ROLES = "rm.role.all";
|
||||||
|
|
||||||
@@ -394,7 +398,14 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
try {is.close();} catch (IOException e) {}
|
try
|
||||||
|
{
|
||||||
|
is.close();
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
LOGGER.debug("Ignoring failed attempt to close stream.", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
@@ -53,6 +53,8 @@ import org.alfresco.service.namespace.QName;
|
|||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.extensions.webscripts.Cache;
|
import org.springframework.extensions.webscripts.Cache;
|
||||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||||
import org.springframework.extensions.webscripts.Status;
|
import org.springframework.extensions.webscripts.Status;
|
||||||
@@ -66,6 +68,8 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
|||||||
*/
|
*/
|
||||||
public class RMSearchGet extends DeclarativeWebScript
|
public class RMSearchGet extends DeclarativeWebScript
|
||||||
{
|
{
|
||||||
|
/** Logger for the class. */
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(RMSearchGet.class);
|
||||||
/** URL Parameters */
|
/** URL Parameters */
|
||||||
private static final String PARAM_QUERY = "query";
|
private static final String PARAM_QUERY = "query";
|
||||||
private static final String PARAM_SORTBY = "sortby";
|
private static final String PARAM_SORTBY = "sortby";
|
||||||
@@ -211,7 +215,10 @@ public class RMSearchGet extends DeclarativeWebScript
|
|||||||
Item item = new Item(pair.getFirst(), pair.getSecond());
|
Item item = new Item(pair.getFirst(), pair.getSecond());
|
||||||
items.add(item);
|
items.add(item);
|
||||||
}
|
}
|
||||||
catch(Exception e) {}
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.debug("Ignoring failed attempt to add item to search results.", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return model
|
// Return model
|
||||||
|
@@ -358,7 +358,7 @@ public class DynamicAuthoritiesGet extends AbstractWebScript implements RecordsM
|
|||||||
res.getWriter().write(")");
|
res.getWriter().write(")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
@@ -416,7 +416,7 @@ public class DynamicAuthoritiesGet extends AbstractWebScript implements RecordsM
|
|||||||
protected Long getBatchSizeParameter(WebScriptRequest req)
|
protected Long getBatchSizeParameter(WebScriptRequest req)
|
||||||
{
|
{
|
||||||
String batchSizeStr = req.getParameter(BATCH_SIZE);
|
String batchSizeStr = req.getParameter(BATCH_SIZE);
|
||||||
Long size = 0L;
|
Long size;
|
||||||
if (StringUtils.isBlank(batchSizeStr))
|
if (StringUtils.isBlank(batchSizeStr))
|
||||||
{
|
{
|
||||||
logger.info(MESSAGE_BATCHSIZE_IS_MANDATORY);
|
logger.info(MESSAGE_BATCHSIZE_IS_MANDATORY);
|
||||||
|
Reference in New Issue
Block a user