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:
Tuna Aksoy
2014-03-09 21:45:53 +00:00
parent 173abadbfa
commit d01b4d5881
4 changed files with 40 additions and 40 deletions

View File

@@ -55,7 +55,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
private static final StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
/** Charset name */
private static final String charsetName = "UTF-8";
private static final String CHARSET_NAME = "UTF-8";
/** Importer service */
private ImporterService importerService;
@@ -252,7 +252,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
+ "' import file could not be found!"); }
// Import view
Reader viewReader = new InputStreamReader(is, charsetName);
Reader viewReader = new InputStreamReader(is, CHARSET_NAME);
Location location = new Location(filePlan);
importerService.importView(viewReader, location, null, null);

View File

@@ -75,7 +75,7 @@ public class BootstrapTestDataGet extends DeclarativeWebScript
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 charsetName = "UTF-8";
private static final String CHARSET_NAME = "UTF-8";
private static final StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
@@ -193,11 +193,11 @@ public class BootstrapTestDataGet extends DeclarativeWebScript
Reader viewReader = null;
try
{
viewReader = new InputStreamReader(is, charsetName);
viewReader = new InputStreamReader(is, CHARSET_NAME);
}
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);
importerService.importView(viewReader, location, null, null);

View File

@@ -35,17 +35,17 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
/**
* This class provides the implementation for the dodcustomtypes.get webscript.
*
*
* @author Neil McErlean
*/
public class DodCustomTypesGet extends DeclarativeWebScript
{
// 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});
private DictionaryService dictionaryService;
public void setDictionaryService(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)
{
Map<String, Object> model = new HashMap<String, Object>();
List<AspectDefinition> customTypeAspectDefinitions = new ArrayList<AspectDefinition>(4);
for (QName aspectQName : customTypeAspects)
for (QName aspectQName : CUSTOM_TYPE_ASPECTS)
{
AspectDefinition nextAspectDef = dictionaryService.getAspect(aspectQName);
customTypeAspectDefinitions.add(nextAspectDef);
}
model.put("dodCustomTypes", customTypeAspectDefinitions);
return model;
}
}

View File

@@ -40,7 +40,7 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
/**
* RM metadata used by form extension
*
*
* @author Roy Wetherall
*/
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_TYPE = "type";
private static final String PARAM_EXTENDED = "extended";
/** NodeRef pattern */
private static final Pattern nodeRefPattern = Pattern.compile(".+://.+/.+");
private static final Pattern NODE_REF_PATTERN = Pattern.compile(".+://.+/.+");
/** QName pattern */
private static final Pattern qnamePattern = Pattern.compile(".+:[^=,]+");
private static final Pattern QNAME_PATTERN = Pattern.compile(".+:[^=,]+");
/** Namespace service */
private NamespaceService namespaceService;
/** Node service */
private NodeService nodeService;
/** File Plan Service */
private FilePlanService filePlanService;
/**
* @param namespaceService namespace service
*/
@@ -72,15 +72,15 @@ public class RMMetaDataGet extends DeclarativeWebScript
{
this.namespaceService = namespaceService;
}
/**
* @param filePlanService file plan service
*/
public void setFilePlanService(FilePlanService filePlanService)
public void setFilePlanService(FilePlanService filePlanService)
{
this.filePlanService = filePlanService;
}
/**
* @param nodeService node service
*/
@@ -88,7 +88,7 @@ public class RMMetaDataGet extends DeclarativeWebScript
{
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)
*/
@@ -100,15 +100,15 @@ public class RMMetaDataGet extends DeclarativeWebScript
boolean extended = false;
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);
if (nodeRef == null || nodeRef.length() == 0)
{
String type = req.getParameter(PARAM_TYPE);
if (type != null && type.length() != 0 && type.indexOf(':') != -1)
{
Matcher m = qnamePattern.matcher(type);
Matcher m = QNAME_PATTERN.matcher(type);
if (m.matches() == true)
{
QName qname = QName.createQName(type, namespaceService);
@@ -118,30 +118,30 @@ public class RMMetaDataGet extends DeclarativeWebScript
result = kind.toString();
}
}
}
}
}
else
{
// quick test before running slow match for full NodeRef pattern
if (nodeRef.indexOf(':') != -1)
{
Matcher m = nodeRefPattern.matcher(nodeRef);
Matcher m = NODE_REF_PATTERN.matcher(nodeRef);
if (m.matches())
{
NodeRef nodeRefObj = new NodeRef(nodeRef);
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRefObj);
if (kind != null)
{
result = kind.toString();
}
String extendedValue = req.getParameter(PARAM_EXTENDED);
if (extendedValue != null && extendedValue.length() != 0)
{
extended = Boolean.parseBoolean(extendedValue);
if (extended == true)
{
{
// get the aspects of the node
model.put("aspects", getAspects(nodeRefObj));
}
@@ -149,15 +149,15 @@ public class RMMetaDataGet extends DeclarativeWebScript
}
}
}
model.put("kind", result);
model.put("extended", extended);
return model;
}
/**
* Gets the current node aspects
*
*
* @return node aspects
*/
public List<Aspect> getAspects(NodeRef nodeRef)
@@ -170,31 +170,31 @@ public class RMMetaDataGet extends DeclarativeWebScript
}
return aspects;
}
/**
* Qname wrapper class
*/
public class QNameBean implements Serializable
{
private static final long serialVersionUID = 6982292337846270774L;
protected QName name;
public QNameBean(QName name)
{
this.name = name;
}
public String getName()
{
return name.toString();
}
public String getPrefixedName()
{
return name.toPrefixString(namespaceService);
}
public String toString()
{
return getName();