Class DictionaryWebServiceBase
java.lang.Object
org.springframework.extensions.webscripts.AbstractWebScript
org.springframework.extensions.webscripts.DeclarativeWebScript
org.alfresco.repo.web.scripts.dictionary.DictionaryWebServiceBase
- All Implemented Interfaces:
org.springframework.extensions.webscripts.WebScript
- Direct Known Subclasses:
AbstractAssociationGet,AbstractAssociationsGet,AbstractClassesGet,AbstractClassGet,AbstractPropertiesGet,AbstractPropertyGet,AbstractSubClassesGet,DictionaryGet
public abstract class DictionaryWebServiceBase
extends org.springframework.extensions.webscripts.DeclarativeWebScript
Base class for Dictionary web scripts
- Author:
- Saravanan Sellathurai
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.extensions.webscripts.AbstractWebScript
org.springframework.extensions.webscripts.AbstractWebScript.ScriptDetails -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.alfresco.service.cmr.dictionary.DictionaryServiceDictionary serviceprotected static final Stringprotected org.alfresco.service.namespace.NamespaceServiceNamespace service -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.alfresco.service.namespace.QNamecreateClassQName(String className) protected org.alfresco.service.namespace.QNamecreateClassQName(String prefix, String shortName) getFullNamespaceURI(String classname) getFullNamespaceURI(String prefix, String shorname) getNamespaceURIfromQname(org.alfresco.service.namespace.QName qname) getPrefixFromModelName(String modelname) getShortName(String classname) getValidInput(String input) booleanbooleanisValidClassFilter(String classfilter) booleanisValidClassname(String classname) booleanisValidClassname(String prefix, String shorname) Checks whether the classname is validbooleanisValidModelName(String modelname) booleanisValidTypeorAspect(String classname) booleanisValidTypeorAspect(String prefix, String shorname) protected <T> Collection<T>reorderedValues(List<org.alfresco.service.cmr.dictionary.ClassDefinition> sortedClassDefs, Map<org.alfresco.service.namespace.QName, T> dependent) Returns dependent collections (properties or associations) in order that complies to order of class definitionsvoidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) Set the dictionaryService property.voidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceservice) Set the namespaceService property.Methods inherited from class org.springframework.extensions.webscripts.DeclarativeWebScript
execute, executeFinallyImpl, executeImpl, executeImpl, executeImpl, getTemplateModel, renderFormatTemplateMethods inherited from class org.springframework.extensions.webscripts.AbstractWebScript
addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
-
Field Details
-
MODEL_PROP_KEY_MESSAGE_LOOKUP
- See Also:
-
namespaceService
protected org.alfresco.service.namespace.NamespaceService namespaceServiceNamespace service -
dictionaryservice
protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryserviceDictionary service
-
-
Constructor Details
-
DictionaryWebServiceBase
public DictionaryWebServiceBase()
-
-
Method Details
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceservice) Set the namespaceService property.- Parameters:
namespaceservice- The namespace service instance to set
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) Set the dictionaryService property.- Parameters:
dictionaryService- The dictionary service instance to set
-
createClassQName
-
createClassQName
- Parameters:
prefix- - prefix for class nameshortName- - short class name- Returns:
- qualified name for class name
-
getNamespaceURIfromQname
- Parameters:
qname- QName- Returns:
- the namespaceuri from a qname
-
getFullNamespaceURI
- Parameters:
classname- the class name as cm_person- Returns:
- String the full name in the following format {namespaceuri}shorname
-
getFullNamespaceURI
- Parameters:
prefix- prefix for classname as cmshorname- the short class name as person- Returns:
- String the full name in the following format {namespaceuri}shorname
-
isValidClassname
- Parameters:
classname- - checks whether the classname is valid , gets the classname as input e.g cm_person- Returns:
- true - if the class is valid , false - if the class is invalid
-
isValidClassname
Checks whether the classname is valid- Parameters:
prefix- - gets the prefix as input e.g cmshorname- - gets the short classname as input e.g person- Returns:
- true - if the class is valid , false - if the class is invalid
-
getPrefixFromModelName
- Parameters:
modelname- String- Returns:
- modelname from namespaceprefix - returns null if invalid namespaceprefix is given
-
isValidAssociationFilter
-
isValidTypeorAspect
- Parameters:
classname- as the input- Returns:
- true if it is a aspect or false if it is a Type
-
isValidTypeorAspect
- Parameters:
prefix- as the inputshorname- as the input- Returns:
- true if it is a aspect or false if it is a Type
-
isValidModelName
- Parameters:
modelname- - gets the modelname as the input (modelname is without prefix ie. cm:contentmodel => where modelname = contentmodel)- Returns:
- true if valid or false
-
getPrefix
- Parameters:
classname- - returns the prefix from the classname of the format namespaceprefix:name eg. cm_person- Returns:
- prefix - returns the prefix of the classname
-
getShortName
- Parameters:
classname- String- Returns:
- the shortname from the classname of the format cm_person here person represents the shortname
-
getValidInput
- Parameters:
input- -gets a string input and validates it- Returns:
- null if invalid or the string itself if its valid
-
isValidClassFilter
- Parameters:
classfilter- =>valid class filters are all,apect or type- Returns:
- true if valid or false if invalid
-
reorderedValues
protected <T> Collection<T> reorderedValues(List<org.alfresco.service.cmr.dictionary.ClassDefinition> sortedClassDefs, Map<org.alfresco.service.namespace.QName, T> dependent) Returns dependent collections (properties or associations) in order that complies to order of class definitions- Parameters:
sortedClassDefs- - list of sorted class definitionsdependent- - collections that depend on class definitions- Returns:
- collection of dependent values
-