mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Fixed minor issues reported by sonar (Constant Name)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@63803 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -55,7 +55,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
|
|||||||
private static final StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
|
private static final StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
|
||||||
|
|
||||||
/** Charset name */
|
/** Charset name */
|
||||||
private static final String charsetName = "UTF-8";
|
private static final String CHARSET_NAME = "UTF-8";
|
||||||
|
|
||||||
/** Importer service */
|
/** Importer service */
|
||||||
private ImporterService importerService;
|
private ImporterService importerService;
|
||||||
@@ -252,7 +252,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
|
|||||||
+ "' import file could not be found!"); }
|
+ "' import file could not be found!"); }
|
||||||
|
|
||||||
// Import view
|
// Import view
|
||||||
Reader viewReader = new InputStreamReader(is, charsetName);
|
Reader viewReader = new InputStreamReader(is, CHARSET_NAME);
|
||||||
Location location = new Location(filePlan);
|
Location location = new Location(filePlan);
|
||||||
importerService.importView(viewReader, location, null, null);
|
importerService.importView(viewReader, location, null, null);
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@ public class BootstrapTestDataGet extends DeclarativeWebScript
|
|||||||
private static final String ARG_IMPORT = "import";
|
private static final String ARG_IMPORT = "import";
|
||||||
|
|
||||||
private static final String XML_IMPORT = "alfresco/module/org_alfresco_module_rm/dod5015/DODExampleFilePlan.xml";
|
private static final String XML_IMPORT = "alfresco/module/org_alfresco_module_rm/dod5015/DODExampleFilePlan.xml";
|
||||||
private static final String charsetName = "UTF-8";
|
private static final String CHARSET_NAME = "UTF-8";
|
||||||
|
|
||||||
private static final StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
|
private static final StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
|
||||||
|
|
||||||
@@ -193,11 +193,11 @@ public class BootstrapTestDataGet extends DeclarativeWebScript
|
|||||||
Reader viewReader = null;
|
Reader viewReader = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
viewReader = new InputStreamReader(is, charsetName);
|
viewReader = new InputStreamReader(is, CHARSET_NAME);
|
||||||
}
|
}
|
||||||
catch (UnsupportedEncodingException error)
|
catch (UnsupportedEncodingException error)
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException("The Character Encoding '" + charsetName + "' is not supported.", error);
|
throw new AlfrescoRuntimeException("The Character Encoding '" + CHARSET_NAME + "' is not supported.", error);
|
||||||
}
|
}
|
||||||
Location location = new Location(filePlan);
|
Location location = new Location(filePlan);
|
||||||
importerService.importView(viewReader, location, null, null);
|
importerService.importView(viewReader, location, null, null);
|
||||||
|
@@ -35,17 +35,17 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides the implementation for the dodcustomtypes.get webscript.
|
* This class provides the implementation for the dodcustomtypes.get webscript.
|
||||||
*
|
*
|
||||||
* @author Neil McErlean
|
* @author Neil McErlean
|
||||||
*/
|
*/
|
||||||
public class DodCustomTypesGet extends DeclarativeWebScript
|
public class DodCustomTypesGet extends DeclarativeWebScript
|
||||||
{
|
{
|
||||||
// TODO Investigate a way of not hard-coding the 4 custom types here.
|
// TODO Investigate a way of not hard-coding the 4 custom types here.
|
||||||
private final static List<QName> customTypeAspects = Arrays.asList(new QName[]{DOD5015Model.ASPECT_SCANNED_RECORD,
|
private final static List<QName> CUSTOM_TYPE_ASPECTS = Arrays.asList(new QName[]{DOD5015Model.ASPECT_SCANNED_RECORD,
|
||||||
DOD5015Model.ASPECT_PDF_RECORD, DOD5015Model.ASPECT_DIGITAL_PHOTOGRAPH_RECORD, DOD5015Model.ASPECT_WEB_RECORD});
|
DOD5015Model.ASPECT_PDF_RECORD, DOD5015Model.ASPECT_DIGITAL_PHOTOGRAPH_RECORD, DOD5015Model.ASPECT_WEB_RECORD});
|
||||||
|
|
||||||
private DictionaryService dictionaryService;
|
private DictionaryService dictionaryService;
|
||||||
|
|
||||||
public void setDictionaryService(DictionaryService dictionaryService)
|
public void setDictionaryService(DictionaryService dictionaryService)
|
||||||
{
|
{
|
||||||
this.dictionaryService = dictionaryService;
|
this.dictionaryService = dictionaryService;
|
||||||
@@ -55,15 +55,15 @@ public class DodCustomTypesGet extends DeclarativeWebScript
|
|||||||
public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||||
{
|
{
|
||||||
Map<String, Object> model = new HashMap<String, Object>();
|
Map<String, Object> model = new HashMap<String, Object>();
|
||||||
|
|
||||||
List<AspectDefinition> customTypeAspectDefinitions = new ArrayList<AspectDefinition>(4);
|
List<AspectDefinition> customTypeAspectDefinitions = new ArrayList<AspectDefinition>(4);
|
||||||
for (QName aspectQName : customTypeAspects)
|
for (QName aspectQName : CUSTOM_TYPE_ASPECTS)
|
||||||
{
|
{
|
||||||
AspectDefinition nextAspectDef = dictionaryService.getAspect(aspectQName);
|
AspectDefinition nextAspectDef = dictionaryService.getAspect(aspectQName);
|
||||||
customTypeAspectDefinitions.add(nextAspectDef);
|
customTypeAspectDefinitions.add(nextAspectDef);
|
||||||
}
|
}
|
||||||
model.put("dodCustomTypes", customTypeAspectDefinitions);
|
model.put("dodCustomTypes", customTypeAspectDefinitions);
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -40,7 +40,7 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* RM metadata used by form extension
|
* RM metadata used by form extension
|
||||||
*
|
*
|
||||||
* @author Roy Wetherall
|
* @author Roy Wetherall
|
||||||
*/
|
*/
|
||||||
public class RMMetaDataGet extends DeclarativeWebScript
|
public class RMMetaDataGet extends DeclarativeWebScript
|
||||||
@@ -49,22 +49,22 @@ public class RMMetaDataGet extends DeclarativeWebScript
|
|||||||
private static final String PARAM_NODEREF = "noderef";
|
private static final String PARAM_NODEREF = "noderef";
|
||||||
private static final String PARAM_TYPE = "type";
|
private static final String PARAM_TYPE = "type";
|
||||||
private static final String PARAM_EXTENDED = "extended";
|
private static final String PARAM_EXTENDED = "extended";
|
||||||
|
|
||||||
/** NodeRef pattern */
|
/** NodeRef pattern */
|
||||||
private static final Pattern nodeRefPattern = Pattern.compile(".+://.+/.+");
|
private static final Pattern NODE_REF_PATTERN = Pattern.compile(".+://.+/.+");
|
||||||
|
|
||||||
/** QName pattern */
|
/** QName pattern */
|
||||||
private static final Pattern qnamePattern = Pattern.compile(".+:[^=,]+");
|
private static final Pattern QNAME_PATTERN = Pattern.compile(".+:[^=,]+");
|
||||||
|
|
||||||
/** Namespace service */
|
/** Namespace service */
|
||||||
private NamespaceService namespaceService;
|
private NamespaceService namespaceService;
|
||||||
|
|
||||||
/** Node service */
|
/** Node service */
|
||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
|
|
||||||
/** File Plan Service */
|
/** File Plan Service */
|
||||||
private FilePlanService filePlanService;
|
private FilePlanService filePlanService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param namespaceService namespace service
|
* @param namespaceService namespace service
|
||||||
*/
|
*/
|
||||||
@@ -72,15 +72,15 @@ public class RMMetaDataGet extends DeclarativeWebScript
|
|||||||
{
|
{
|
||||||
this.namespaceService = namespaceService;
|
this.namespaceService = namespaceService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param filePlanService file plan service
|
* @param filePlanService file plan service
|
||||||
*/
|
*/
|
||||||
public void setFilePlanService(FilePlanService filePlanService)
|
public void setFilePlanService(FilePlanService filePlanService)
|
||||||
{
|
{
|
||||||
this.filePlanService = filePlanService;
|
this.filePlanService = filePlanService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param nodeService node service
|
* @param nodeService node service
|
||||||
*/
|
*/
|
||||||
@@ -88,7 +88,7 @@ public class RMMetaDataGet extends DeclarativeWebScript
|
|||||||
{
|
{
|
||||||
this.nodeService = nodeService;
|
this.nodeService = nodeService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.Status, org.alfresco.web.scripts.Cache)
|
* @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.Status, org.alfresco.web.scripts.Cache)
|
||||||
*/
|
*/
|
||||||
@@ -100,15 +100,15 @@ public class RMMetaDataGet extends DeclarativeWebScript
|
|||||||
|
|
||||||
boolean extended = false;
|
boolean extended = false;
|
||||||
String result = "NONE";
|
String result = "NONE";
|
||||||
|
|
||||||
// Get the nodeRef and confirm it is valid
|
// Get the nodeRef and confirm it is valid
|
||||||
String nodeRef = req.getParameter(PARAM_NODEREF);
|
String nodeRef = req.getParameter(PARAM_NODEREF);
|
||||||
if (nodeRef == null || nodeRef.length() == 0)
|
if (nodeRef == null || nodeRef.length() == 0)
|
||||||
{
|
{
|
||||||
String type = req.getParameter(PARAM_TYPE);
|
String type = req.getParameter(PARAM_TYPE);
|
||||||
if (type != null && type.length() != 0 && type.indexOf(':') != -1)
|
if (type != null && type.length() != 0 && type.indexOf(':') != -1)
|
||||||
{
|
{
|
||||||
Matcher m = qnamePattern.matcher(type);
|
Matcher m = QNAME_PATTERN.matcher(type);
|
||||||
if (m.matches() == true)
|
if (m.matches() == true)
|
||||||
{
|
{
|
||||||
QName qname = QName.createQName(type, namespaceService);
|
QName qname = QName.createQName(type, namespaceService);
|
||||||
@@ -118,30 +118,30 @@ public class RMMetaDataGet extends DeclarativeWebScript
|
|||||||
result = kind.toString();
|
result = kind.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// quick test before running slow match for full NodeRef pattern
|
// quick test before running slow match for full NodeRef pattern
|
||||||
if (nodeRef.indexOf(':') != -1)
|
if (nodeRef.indexOf(':') != -1)
|
||||||
{
|
{
|
||||||
Matcher m = nodeRefPattern.matcher(nodeRef);
|
Matcher m = NODE_REF_PATTERN.matcher(nodeRef);
|
||||||
if (m.matches())
|
if (m.matches())
|
||||||
{
|
{
|
||||||
NodeRef nodeRefObj = new NodeRef(nodeRef);
|
NodeRef nodeRefObj = new NodeRef(nodeRef);
|
||||||
|
|
||||||
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRefObj);
|
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRefObj);
|
||||||
if (kind != null)
|
if (kind != null)
|
||||||
{
|
{
|
||||||
result = kind.toString();
|
result = kind.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
String extendedValue = req.getParameter(PARAM_EXTENDED);
|
String extendedValue = req.getParameter(PARAM_EXTENDED);
|
||||||
if (extendedValue != null && extendedValue.length() != 0)
|
if (extendedValue != null && extendedValue.length() != 0)
|
||||||
{
|
{
|
||||||
extended = Boolean.parseBoolean(extendedValue);
|
extended = Boolean.parseBoolean(extendedValue);
|
||||||
if (extended == true)
|
if (extended == true)
|
||||||
{
|
{
|
||||||
// get the aspects of the node
|
// get the aspects of the node
|
||||||
model.put("aspects", getAspects(nodeRefObj));
|
model.put("aspects", getAspects(nodeRefObj));
|
||||||
}
|
}
|
||||||
@@ -149,15 +149,15 @@ public class RMMetaDataGet extends DeclarativeWebScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
model.put("kind", result);
|
model.put("kind", result);
|
||||||
model.put("extended", extended);
|
model.put("extended", extended);
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current node aspects
|
* Gets the current node aspects
|
||||||
*
|
*
|
||||||
* @return node aspects
|
* @return node aspects
|
||||||
*/
|
*/
|
||||||
public List<Aspect> getAspects(NodeRef nodeRef)
|
public List<Aspect> getAspects(NodeRef nodeRef)
|
||||||
@@ -170,31 +170,31 @@ public class RMMetaDataGet extends DeclarativeWebScript
|
|||||||
}
|
}
|
||||||
return aspects;
|
return aspects;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Qname wrapper class
|
* Qname wrapper class
|
||||||
*/
|
*/
|
||||||
public class QNameBean implements Serializable
|
public class QNameBean implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 6982292337846270774L;
|
private static final long serialVersionUID = 6982292337846270774L;
|
||||||
|
|
||||||
protected QName name;
|
protected QName name;
|
||||||
|
|
||||||
public QNameBean(QName name)
|
public QNameBean(QName name)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return name.toString();
|
return name.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPrefixedName()
|
public String getPrefixedName()
|
||||||
{
|
{
|
||||||
return name.toPrefixString(namespaceService);
|
return name.toPrefixString(namespaceService);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return getName();
|
return getName();
|
||||||
|
Reference in New Issue
Block a user