KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > service > cmr > dictionary > DictionaryService


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.service.cmr.dictionary;
18
19 import java.util.Collection JavaDoc;
20
21 import org.alfresco.service.namespace.QName;
22
23
24 /**
25  * This interface represents the Repository Data Dictionary. The
26  * dictionary provides access to content meta-data such as Type
27  * and Aspect descriptions.
28  *
29  * Content meta-data is organised into models where each model is
30  * given a qualified name. This means that it is safe to develop
31  * independent models and bring them together into the same
32  * Repository without name clashes (as long their namespace is
33  * different).
34  *
35  * @author David Caruana
36  */

37 public interface DictionaryService
38 {
39
40     /**
41      * @return the names of all models that have been registered with the Repository
42      */

43     public Collection JavaDoc<QName> getAllModels();
44     
45     /**
46      * @param model the model name to retrieve
47      * @return the specified model (or null, if it doesn't exist)
48      */

49     public ModelDefinition getModel(QName model);
50
51     /**
52      * @return the names of all data types that have been registered with the Repository
53      */

54     Collection JavaDoc<QName> getAllDataTypes();
55
56     /**
57      * @param model the model to retrieve data types for
58      * @return the names of all data types defined within the specified model
59      */

60     Collection JavaDoc<QName> getDataTypes(QName model);
61     
62     /**
63      * @param name the name of the data type to retrieve
64      * @return the data type definition (or null, if it doesn't exist)
65      */

66     DataTypeDefinition getDataType(QName name);
67     
68     /**
69      * @param javaClass java class to find datatype for
70      * @return the data type definition (or null, if a mapping does not exist)
71      */

72     DataTypeDefinition getDataType(Class JavaDoc javaClass);
73
74     /**
75      * @return the names of all types that have been registered with the Repository
76      */

77     Collection JavaDoc<QName> getAllTypes();
78     
79     /**
80      * @param model the model to retrieve types for
81      * @return the names of all types defined within the specified model
82      */

83     Collection JavaDoc<QName> getTypes(QName model);
84
85     /**
86      * @param name the name of the type to retrieve
87      * @return the type definition (or null, if it doesn't exist)
88      */

89     TypeDefinition getType(QName name);
90
91     /**
92      * Construct an anonymous type that combines the definitions of the specified
93      * type and aspects.
94      *
95      * @param type the type to start with
96      * @param aspects the aspects to combine with the type
97      * @return the anonymous type definition
98      */

99     TypeDefinition getAnonymousType(QName type, Collection JavaDoc<QName> aspects);
100
101     /**
102      * @return the names of all aspects that have been registered with the Repository
103      */

104     Collection JavaDoc<QName> getAllAspects();
105     
106     /**
107      * @param model the model to retrieve aspects for
108      * @return the names of all aspects defined within the specified model
109      */

110     Collection JavaDoc<QName> getAspects(QName model);
111
112     /**
113      * @param name the name of the aspect to retrieve
114      * @return the aspect definition (or null, if it doesn't exist)
115      */

116     AspectDefinition getAspect(QName name);
117
118     /**
119      * @param name the name of the class (type or aspect) to retrieve
120      * @return the class definition (or null, if it doesn't exist)
121      */

122     ClassDefinition getClass(QName name);
123     
124     /**
125      * Determines whether a class is a sub-class of another class
126      *
127      * @param className the sub-class to test
128      * @param ofClassName the class to test against
129      * @return true => the class is a sub-class (or itself)
130      */

131     boolean isSubClass(QName className, QName ofClassName);
132
133     /**
134      * Gets the definition of the property as defined by the specified Class.
135      *
136      * Note: A sub-class may override the definition of a property that's
137      * defined in a super-class.
138      *
139      * @param className the class name
140      * @param propertyName the property name
141      * @return the property definition (or null, if it doesn't exist)
142      */

143     PropertyDefinition getProperty(QName className, QName propertyName);
144
145     /**
146      * Gets the definition of the property as defined by its owning Class.
147      *
148      * @param propertyName the property name
149      * @return the property definition (or null, if it doesn't exist)
150      */

151     PropertyDefinition getProperty(QName propertyName);
152
153     /**
154      * Gets the definition of the association as defined by its owning Class.
155      *
156      * @param associationName the property name
157      * @return the association definition (or null, if it doesn't exist)
158      */

159     AssociationDefinition getAssociation(QName associationName);
160     
161     // TODO: Behaviour definitions
162

163 }
164
Popular Tags