Share Data Dictionary

cancel
Showing results for 
Search instead for 
Did you mean: 

Share Data Dictionary

resplin
Intermediate
0 0 1,788

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



Alfresco Share4.0Multi-tenancy


Overview


The Alfresco Share 4.0 release includes a simple query mechanism for the Alfresco Data Dictionary - accessible from Share web-tier components. The API is service orientated (stateless and read-only) and similar in use to the Data Dictionary Service on the Alfresco repository tier. Alfresco Multi-tenant repository mode is supported and a local dictionary will be available for each tenant as appropriate for the user authenticated against the current request. Multi-tenancy support is transparent and no additional code within the components is required for it.


Dictionary Script and Template Object


The Data Dictionary query is made available via a new WebScript JavaScript and Template root object called dictionary. The object is available to all user authenticated WebScripts scripts and templates - it is not available for unauthenticated WebScripts.


Dictionary Query API


Service orientated API - most arguments are simple strings. Some methods return Property and Association meta description objects that also have an API detailed below.

IMPORTANT: the methods expect to be passed (and also return) the 'prefixed name' short form of all QNames for types, aspects, properties or association names e.g. 'cm:content' not '{htttp://www.alfresco.org/model/content/1.0}content'.


boolean isSubType(string type, string isType): return if the supplied type is a sub-type of a given type.

type      Type to test
isType    Is the type a subtype of this type?

boolean hasDefaultAspect(string type, string aspect): return if the type definition has the default aspect applied.

type      Type to test
aspect    Aspect to look for in the default aspects

string[] getDefaultAspects(string type): return array of the default aspects for the given type, can be empty but never null.

type      Type to inspect

boolean isAspect(string ddclass): return if the supplied dd class is an aspect.

ddclass   DD class to test

boolean isType(string ddclass): return if the supplied dd class is a type.

ddclass   DD class to test

boolean hasProperty(string ddclass, string property): return if a type or aspect has the given property definition. This method correctly reports properties inherited from base types.

ddclass   Type or aspect to test
property  Property to look for in the type or aspect definition

boolean hasProperty(string ddclass, string property, boolean includeDefaultAspects): return if a type or aspect has the given property definition. This method correctly reports properties inherited from base types and also optionally checks any default aspects applied to the type for the property.

ddclass   Type or aspect to test
property  Property to look for in the type or aspect definition
includeDefaultAspects If true, check default aspects for the given property.

string getTitle(string ddclass): return the title string for the given dd class.

ddclass   DD class to inspect

string getDescription(string ddclass): return the description string for the given dd class.

ddclass   DD class to inspect

string getParent(string ddclass): return the parent for the given dd class.

ddclass   DD class to inspect

boolean isContainer(string type): return if the specified type is a container

type      Type to inspect

property getProperty(string ddclass, string property): return a single named property for the given dd class or null if not found.

ddclass   DD class to inspect
property  Property to look for in the type or aspect definition


property getProperty(string ddclass, string property, boolean includeDefaultAspects): return a single named property for the given dd class or null if not found, also optionally checks any default aspects applied to the type for the property.

ddclass   DD class to inspect
property  Property to look for in the type or aspect definition
includeDefaultAspects If true, check default aspects for the given property.

property[] getProperties(string ddclass): Return array of property objects describing all the property definitions for the class, can be empty but never null.

ddclass   DD class to inspect

property[] getProperties(string ddclass, boolean includeDefaultAspects): Return array of property objects describing all the property definitions for the class also optionally on any default aspects, can be empty but never null.

ddclass   DD class to inspect
includeDefaultAspects If true, get properties from default aspects.

association[] getAssociations(string ddclass): Return array of association objects describing the target associations for the class. Can be empty but never null.

ddclass   DD class to inspect

association[] getChildAssociations(string ddclass): Return array of association objects describing the child associations for the class. Can be empty but never null.

ddclass   DD class to inspect

Dictionary Property API


Some of the methods above return a property object, which has the following API:


string name: returns the property name
string title: returns the title of the property, can be empty string but never null
string description: returns the description of the property, can be empty string but never null
string dataType: returns the datatype such as d:text
string defaultValue: returns the default value for the property or null for no default value
boolean isMultiValued: returns true if the property is multi-value field
boolean isMandatory: returns true if the property is a mandatory field
boolean isEnforced: returns true if the property mandatory value is enforced repository integrity checking
boolean isProtected: returns true if the property is a protected system value and cannot be user modified
boolean isIndexed: returns true if the property is indexed by the repository

Dictionary Association API


Some of the methods above return an association object, which has the following API:


string name: returns the assocation name
string title: returns the title of the association, can be empty string but never null
string sourceClass: returns the source class name of the association or null if not specified
string sourceRole: returns the source role name of the association or null if not specified
boolean sourceIsMandatory: returns true if the source is mandatory
boolean sourceIsMany: returns true if the source multiplicity is many
string targetClass: returns the target class name of the association or null if not specified
string targetRole: returns the target role name of the association or null if not specified
boolean targetIsMandatory: returns true if the target is mandatory
boolean targetIsMany: returns true if the target multiplicity is many