Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
This page describes the Repository Data Dictionary Service. It's a service for managing metadata about Content Types, Aspects, and other Repository concepts.
Discussing meta data can become confusing as there are many levels of metadata. The following diagram provides the terms that will be used from now on.
The Data Dictionary service is associated with levels M1 and M2. It provides a metamodel (M2) that allows Content Modellers to define their own Content Models (M1).
Note: The NodeService is associated with level M0.
Note: Level M3 is unlikely to be supported directly by the Repository. This level is usually associated with meta-model interchange. E.g. convert UML to JSR-170 model
TODO: Meta-data for content oriented nodes (e.g. mime-type etc)
The Content Meta-model is described as follows:
Notes:
Property Types are the set of primitive Types upon which all other higher-level Types are built. The M2 Content Meta-model (above) is itself constructed with them.
The supported Property Types are:
The Repository will support a fixed set of Property Types. In the future, the Repository will support the ability to define a new a property type (based on an existing definition) with specific value constraints e.g. positive number
Future Types may include:
TBD
Note: This section represents current understanding of how to support end-user notions of defining structure as defined here by PHH, LB, JN. As such changes are expected over the next week or so.
Although a Content Model is constructed of Types and Aspects, it's still possible to present a different view for end-users who may wish to define structures in a looser fashion. This could be accomplished by separating a Node definition into three distinct parts:
Each Space defines a list of Aspects (primarily pre-defined) to be inherited by each instance that is created or linked into the Space. Some Aspects may be explicitly defined by the Space (and thus private to that Space and its sub-spaces). Within the User Interface, the user is picking from a pre-defined list of Aspects such as Translatable & Dublin Core, or defining a new simple Aspect such as a custom property list.
Content definitions including properties, children and relationships and behaviour. Definitions are named and scoped by namespace. A Space may itself act as a namespace (or have an associated namespace). Advanced definition may only be possible through a dedicated User Interface (restricted to modeller role)?.
Each Node is aware of its Type and applied Aspects. The Type is specified on creation. Aspects are either inherited on creation or manually assigned by the user at any time (choose from a pick list...).
Nodes inherit Aspects from their container(s) (in the following order) on Node creation:
Using constructs defined in the M2 level Model, the Repository will provide out-of-the-box, Types and Aspects for:
TBD
TBD
TBD
There are several public access points (for a Repository client) to meta-data:
Access points 2 & 3 are provided using the Node Handles and Store Protocols pattern.
Note: The plan is to provide access point 1 in the first 4 month deliverable.
A Node Reference is a handle onto an item within the Repository. The Data Dictionary provides a specialised Node Reference known as a DDRef which has specific knowledge of Data Dictionary store protocols and provides convenience constructors for creating references to Data Dictionary items.
public class DDRef extends NodeRef
{
public DDRef(QName metaName)
{
super(new StoreRef('datadictionary', 'local'), metaName.toString());
}
public QName getQName()
{
...
}
}
Example references (human readable):
datadictionary://local/{namespaceURI}file (Type)
datadictionary://local/{namespaceURI}version (Aspect)
datadictionary://local/{namespaceURI}file/name (Property)
Services that accept a Node Reference can also accept a DDRef. This is particularly useful for the Node and Search Service where we can register Data Dictionary implementations against the Data Dictionary Store protocol.
DDRef[] getTypes();
DDRef[] getTypes(String namespace);
DDRef[] getAspects();
DDRef[] getAspects(String namespace);
ClassDefinition getClass(DDRef className)
TypeDefinition getType(DDRef typeName)
AspectDefinition getAspect(DDRef aspectName)
TypeDefinition getAnonymousType(DDRef type, DDRef[] aspects)
PropertyDefinition getProperty(DDRef property)
PropertyDefinition getProperty(DDRef class, String propertyName)
AssociationDefinition getAssociation(DDRef association)
AssociationDefinition getAssociation(DDRef class, String associationName)
BehaviourDefinition[] getBehaviours()
TODO: Define
TBD
The Data Dictionary may be implemented:
Propose to go with Option 2. Primarily because it allows us to develop Data Dictionary as a core building block thus skipping any chicken and egg bootstrap issues in the future, but also, allows for custom performance tuning as it's expected this service will be heavily used within Repository services.
To start with, the Dictionary will support:
Followed by:
TODO: Provide diagram (service -> dao etc)
Issue: How do we identify a Property or Association?
Property and Association names are qualified names in their own right. An organisation may wish to use any number of namespaces to organise property and association names within their model. However, it's likely that only one namespace will be used, as an organisation will have complete control over their model naming, therefore avoiding clashes with appropriate local naming.
As a rule, a qualified name should not be re-used when it has been assigned to a property/association on an Aspect. This prohibits a name clash with a type definition when an aspect is introduced to a node. We can enforce this at design-time (first release - should).
When working with a property or association on a node, the Qname is specified. The QName may or may not be provided in the context of the node type or node aspect. Ignoring residual definitions (see below), either approach will resolve to a single definition in the dictionary.
Issue: We cannot override property or association definitions in a class hierarchy.
This will be supported. A sub-class can override the definition of a super-class property or association by providing a definition of the same qualified name. There will be restrictions on overridden values e.g. mandatory property value cannot be relaxed, target class of association can only be sub-type of overridden target class. Some values may not be overridden at all. As such, I'm considering having an explicit PropertyOverride/AssociationOverride construct in the meta-model.
Issue: Is that a type name or instance name?
Unlike JSR-170, all associations in the data dictionary are typed. Child associations are a special kind (stereotype) of association which represent a parent/child relationship i.e. an aggregate. Multiple child association types may exist for a given type/aspect. The node service allows for access to all children (regardless of child association type) or the children of a specific child association type.
Each association in the meta-model is named; the name representing the association type. For example, a folder may have the following associations: sub-folders (aggregate, 1-many-folder), files (aggregate, 1-many-file), visible-to (non-aggregate, many-many-users). Following typical OO constructs, the dictionary will allow the definition of source and target cardinality. We could also support a list of target classes where any of them are valid).
Child associations will also support the following additional meta-data to describe constraints on the parent/child instances themselves:
Note: Non aggregate associations do not have a child instance name in our Node model and so the above meta-data is not required.
Note: Child name only refers to the name in the node path - not a property (called name) that may or may not exist on the node.
It's not clear how residual definitions map into our meta-model. One approach is as follows...
First, I don't think we need the notion of a residual child (association) definition. If a bag of ad-hoc child associations is to be made available (to who, I don't know - the app. developer - unlikely - or end-user?), then a child association type called whatever (e.g. residual and possibly even residual2) can be defined.
Second, I think that residual properties are really only useful on types. Why? App. developers are unlikely to need them, they're working with a stricter model - however, an end-user may want to attach ad-hoc properties to their content and so this feature is made available at the type level, not aspect. Of course, an ad-hoc property bag can be implemented other ways.
So, I propose we support residual properties by adding the following to Type in our meta-model:
This approach means there are no '*' (or nameless) property or association definitions in the meta-model. Residual property names will not find an associated property definition.
Issue: Is there a quick and definitive answer to what type is this property?
If we're not already, I think we should consider storing the property type with the property value in our node schema. It's often required, but also, it may not be same as the property type defined in the dictionary - cases are: ANY type and residual properties who don't have a definition at all.
The direct PropertyDefinition lookup will be removed. Lookup must be indirectly via Class or Aspect definition.
Issue: Should we sub-type or use a property discriminator to describe the various 'types' of content e.g. SOP, Rule, Query, Order
Idea:
We extend our meta-model to include the notion of Content Type (which itself is derived from Type). Additional meta-data e.g. required mime-type, xml schema... is specified on the Content Type.
Actual types of content are modelled using the dictionary (as if types) with each type supporting specific meta-data. Sub-typing may be used (as with types); a root content content-type may exist in the domain model.
The list of available content types is provided by the dictionary.
So, effectively, we use sub-typing (type qname) to discriminate between content types, but formalise the notion of a content type in our meta-model.
When developing content domain models (M1) using UML, the following notation is a useful guideline for ensuring that M2 concepts are mapped in a consistent way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.