mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fixed major issues (Use Correct Exception Logging) reported in Sonar
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@89722 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -239,7 +239,7 @@ public class RecordsManagementAdminBase implements RecordsManagementCustomModel
|
||||
}
|
||||
catch (DictionaryException de)
|
||||
{
|
||||
logger.warn("readCustomContentModel: skip model ("+modelRef+") whilst searching for uri ("+uri+"): "+de);
|
||||
logger.warn("readCustomContentModel: skip model ("+modelRef+") whilst searching for uri ("+uri+"): ", de);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,6 @@ import org.alfresco.module.org_alfresco_module_rm.model.rma.type.RmSiteType;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.site.SiteService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
@@ -22,7 +21,7 @@ public class DataSetPost extends DeclarativeWebScript implements RecordsManageme
|
||||
{
|
||||
/** Constant for the site name parameter */
|
||||
private static final String ARG_SITE_NAME = "site";
|
||||
|
||||
|
||||
/** Constant for the data set id parameter */
|
||||
private static final String ARG_DATA_SET_ID = "dataSetId";
|
||||
|
||||
@@ -37,7 +36,7 @@ public class DataSetPost extends DeclarativeWebScript implements RecordsManageme
|
||||
|
||||
/**
|
||||
* Set site service
|
||||
*
|
||||
*
|
||||
* @param siteService the site service
|
||||
*/
|
||||
public void setSiteService(SiteService siteService)
|
||||
@@ -47,7 +46,7 @@ public class DataSetPost extends DeclarativeWebScript implements RecordsManageme
|
||||
|
||||
/**
|
||||
* Data set service
|
||||
*
|
||||
*
|
||||
* @param dataSetService the data set service
|
||||
*/
|
||||
public void setDataSetService(DataSetService dataSetService)
|
||||
@@ -77,21 +76,21 @@ public class DataSetPost extends DeclarativeWebScript implements RecordsManageme
|
||||
throw new WebScriptException(Status.STATUS_NOT_FOUND, "A data set with the id '" + dataSetId + "'"
|
||||
+ " does not exist.");
|
||||
}
|
||||
|
||||
|
||||
// Resolve RM site
|
||||
String siteName = req.getParameter(ARG_SITE_NAME);
|
||||
if (StringUtils.isBlank(siteName))
|
||||
{
|
||||
siteName = RmSiteType.DEFAULT_SITE_NAME;
|
||||
}
|
||||
|
||||
|
||||
// Check the site if it exists
|
||||
if (siteService.getSite(siteName) == null)
|
||||
{
|
||||
throw new WebScriptException(Status.STATUS_BAD_REQUEST, "A Records Management site with the name '"
|
||||
+ siteName + "' does not exist.");
|
||||
}
|
||||
|
||||
|
||||
// Resolve documentLibrary (filePlan) container
|
||||
NodeRef filePlan = siteService.getContainer(siteName, RmSiteType.COMPONENT_DOCUMENT_LIBRARY);
|
||||
if (filePlan == null)
|
||||
@@ -99,7 +98,7 @@ public class DataSetPost extends DeclarativeWebScript implements RecordsManageme
|
||||
filePlan = siteService.createContainer(siteName, RmSiteType.COMPONENT_DOCUMENT_LIBRARY,
|
||||
TYPE_FILE_PLAN, null);
|
||||
}
|
||||
|
||||
|
||||
// Load data set in to the file plan
|
||||
dataSetService.loadDataSet(filePlan, dataSetId);
|
||||
|
||||
@@ -110,7 +109,7 @@ public class DataSetPost extends DeclarativeWebScript implements RecordsManageme
|
||||
{
|
||||
model.put("success", false);
|
||||
model.put("message", ex.getMessage());
|
||||
logger.error(ExceptionUtils.getFullStackTrace(ex));
|
||||
logger.error("Error while importing data set: " + ex);
|
||||
}
|
||||
|
||||
return model;
|
||||
|
Reference in New Issue
Block a user