Moving to root below branch label

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2005 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2005-12-08 07:13:07 +00:00
commit e1e6508fec
1095 changed files with 230566 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
/**
* Read-only definition of an Aspect.
*
* @author David Caruana
*/
public interface AspectDefinition extends ClassDefinition
{
}

View File

@@ -0,0 +1,113 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
import org.alfresco.service.namespace.QName;
/**
* Read-only definition of an Association.
*
* @author David Caruana
*
*/
public interface AssociationDefinition
{
/**
* @return defining model
*/
public ModelDefinition getModel();
/**
* @return the qualified name
*/
public QName getName();
/**
* @return the human-readable title
*/
public String getTitle();
/**
* @return the human-readable description
*/
public String getDescription();
/**
* Is this a child association?
*
* @return true => child, false => general relationship
*/
public boolean isChild();
/**
* Is this association maintained by the Repository?
*
* @return true => system maintained, false => client may maintain
*/
public boolean isProtected();
/**
* @return the source class
*/
public ClassDefinition getSourceClass();
/**
* @return the role of the source class in this association?
*/
public QName getSourceRoleName();
/**
* Is the source class optional in this association?
*
* @return true => cardinality > 0
*/
public boolean isSourceMandatory();
/**
* Can there be many source class instances in this association?
*
* @return true => cardinality > 1, false => cardinality of 0 or 1
*/
public boolean isSourceMany();
/**
* @return the target class
*/
public ClassDefinition getTargetClass();
/**
* @return the role of the target class in this association?
*/
public QName getTargetRoleName();
/**
* Is the target class optional in this association?
*
* @return true => cardinality > 0
*/
public boolean isTargetMandatory();
/**
* Can there be many target class instances in this association?
*
* @return true => cardinality > 1, false => cardinality of 0 or 1
*/
public boolean isTargetMany();
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
/**
* Read-only definition of a Child Association.
*
* @author David Caruana
*
*/
public interface ChildAssociationDefinition extends AssociationDefinition
{
/**
* @return the required name of children (or null if none)
*/
public String getRequiredChildName();
/**
* @return whether duplicate child names allowed within this association?
*/
public boolean getDuplicateChildNamesAllowed();
}

View File

@@ -0,0 +1,105 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import org.alfresco.service.namespace.QName;
/**
* Read-only definition of a Class.
*
* @author David Caruana
*/
public interface ClassDefinition
{
/**
* @return defining model
*/
public ModelDefinition getModel();
/**
* @return the qualified name of the class
*/
public QName getName();
/**
* @return the human-readable class title
*/
public String getTitle();
/**
* @return the human-readable class description
*/
public String getDescription();
/**
* @return the super class (or null, if this is the root)
*/
public QName getParentName();
/**
* @return true => aspect, false => type
*/
public boolean isAspect();
/**
* @return the properties of the class, including inherited properties
*/
public Map<QName, PropertyDefinition> getProperties();
/**
* @return a map containing the default property values, including inherited properties
*/
public Map<QName, Serializable> getDefaultValues();
/**
* Fetch all associations for which this is a source type, including child associations.
*
* @return the associations including inherited ones
* @see ChildAssociationDefinition
*/
public Map<QName, AssociationDefinition> getAssociations();
/**
* @return true => this class supports child associations
*/
public boolean isContainer();
/**
* Fetch only child associations for which this is a source type.
*
* @return all child associations applicable to this type, including those
* inherited from super types
*/
public Map<QName, ChildAssociationDefinition> getChildAssociations();
/**
* Fetch all associations for which this is a target type, including child associations.
*
* @return the associations including inherited ones
*/
// TODO: public Map<QName, AssociationDefinition> getTargetAssociations();
/**
* @return the default aspects associated with this type
*/
public List<AspectDefinition> getDefaultAspects();
}

View File

@@ -0,0 +1,86 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
import java.util.Locale;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
/**
* Read-only definition of a Data Type
*
* @author David Caruana
*/
public interface DataTypeDefinition
{
//
// Built-in Property Types
//
public QName ANY = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "any");
public QName TEXT = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "text");
public QName CONTENT = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "content");
public QName INT = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "int");
public QName LONG = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "long");
public QName FLOAT = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "float");
public QName DOUBLE = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "double");
public QName DATE = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "date");
public QName DATETIME = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "datetime");
public QName BOOLEAN = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "boolean");
public QName QNAME = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "qname");
public QName CATEGORY = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "category");
public QName NODE_REF = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "noderef");
public QName PATH = QName.createQName(NamespaceService.DICTIONARY_MODEL_1_0_URI, "path");
/**
* @return defining model
*/
public ModelDefinition getModel();
/**
* @return the qualified name of the data type
*/
public QName getName();
/**
* @return the human-readable class title
*/
public String getTitle();
/**
* @return the human-readable class description
*/
public String getDescription();
/**
* @return the indexing analyser class
*/
public String getAnalyserClassName();
/**
* @return the indexing analyser class for the specified locale
*/
public String getAnalyserClassName(Locale locale);
/**
* @return the equivalent java class name (or null, if not mapped)
*/
public String getJavaClassName();
}

View File

@@ -0,0 +1,39 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
/**
* Base Exception of Data Dictionary Exceptions.
*
* @author David Caruana
*/
public class DictionaryException extends RuntimeException
{
private static final long serialVersionUID = 3257008761007847733L;
public DictionaryException(String msg)
{
super(msg);
}
public DictionaryException(String msg, Throwable cause)
{
super(msg, cause);
}
}

View File

@@ -0,0 +1,163 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
import java.util.Collection;
import org.alfresco.service.namespace.QName;
/**
* This interface represents the Repository Data Dictionary. The
* dictionary provides access to content meta-data such as Type
* and Aspect descriptions.
*
* Content meta-data is organised into models where each model is
* given a qualified name. This means that it is safe to develop
* independent models and bring them together into the same
* Repository without name clashes (as long their namespace is
* different).
*
* @author David Caruana
*/
public interface DictionaryService
{
/**
* @return the names of all models that have been registered with the Repository
*/
public Collection<QName> getAllModels();
/**
* @param model the model name to retrieve
* @return the specified model (or null, if it doesn't exist)
*/
public ModelDefinition getModel(QName model);
/**
* @return the names of all data types that have been registered with the Repository
*/
Collection<QName> getAllDataTypes();
/**
* @param model the model to retrieve data types for
* @return the names of all data types defined within the specified model
*/
Collection<QName> getDataTypes(QName model);
/**
* @param name the name of the data type to retrieve
* @return the data type definition (or null, if it doesn't exist)
*/
DataTypeDefinition getDataType(QName name);
/**
* @param javaClass java class to find datatype for
* @return the data type definition (or null, if a mapping does not exist)
*/
DataTypeDefinition getDataType(Class javaClass);
/**
* @return the names of all types that have been registered with the Repository
*/
Collection<QName> getAllTypes();
/**
* @param model the model to retrieve types for
* @return the names of all types defined within the specified model
*/
Collection<QName> getTypes(QName model);
/**
* @param name the name of the type to retrieve
* @return the type definition (or null, if it doesn't exist)
*/
TypeDefinition getType(QName name);
/**
* Construct an anonymous type that combines the definitions of the specified
* type and aspects.
*
* @param type the type to start with
* @param aspects the aspects to combine with the type
* @return the anonymous type definition
*/
TypeDefinition getAnonymousType(QName type, Collection<QName> aspects);
/**
* @return the names of all aspects that have been registered with the Repository
*/
Collection<QName> getAllAspects();
/**
* @param model the model to retrieve aspects for
* @return the names of all aspects defined within the specified model
*/
Collection<QName> getAspects(QName model);
/**
* @param name the name of the aspect to retrieve
* @return the aspect definition (or null, if it doesn't exist)
*/
AspectDefinition getAspect(QName name);
/**
* @param name the name of the class (type or aspect) to retrieve
* @return the class definition (or null, if it doesn't exist)
*/
ClassDefinition getClass(QName name);
/**
* Determines whether a class is a sub-class of another class
*
* @param className the sub-class to test
* @param ofClassName the class to test against
* @return true => the class is a sub-class (or itself)
*/
boolean isSubClass(QName className, QName ofClassName);
/**
* Gets the definition of the property as defined by the specified Class.
*
* Note: A sub-class may override the definition of a property that's
* defined in a super-class.
*
* @param className the class name
* @param propertyName the property name
* @return the property definition (or null, if it doesn't exist)
*/
PropertyDefinition getProperty(QName className, QName propertyName);
/**
* Gets the definition of the property as defined by its owning Class.
*
* @param propertyName the property name
* @return the property definition (or null, if it doesn't exist)
*/
PropertyDefinition getProperty(QName propertyName);
/**
* Gets the definition of the association as defined by its owning Class.
*
* @param associationName the property name
* @return the association definition (or null, if it doesn't exist)
*/
AssociationDefinition getAssociation(QName associationName);
// TODO: Behaviour definitions
}

View File

@@ -0,0 +1,47 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
import org.alfresco.service.namespace.QName;
/**
* Thrown when a reference to an <b>aspect</b> is incorrect.
*
* @author Derek Hulley
*/
public class InvalidAspectException extends InvalidClassException
{
private static final long serialVersionUID = 3257290240330051893L;
public InvalidAspectException(QName aspectName)
{
super(null, aspectName);
}
public InvalidAspectException(String msg, QName aspectName)
{
super(msg, aspectName);
}
/**
* @return Returns the offending aspect name
*/
public QName getAspectName()
{
return getClassName();
}
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.service.namespace.QName;
/**
* Thrown when an operation cannot be performed because the dictionary class
* reference does not exist.
*
*/
public class InvalidClassException extends AlfrescoRuntimeException
{
private static final long serialVersionUID = 3256722870754293558L;
private QName className;
public InvalidClassException(QName className)
{
this(null, className);
}
public InvalidClassException(String msg, QName className)
{
super(msg);
this.className = className;
}
/**
* @return Returns the offending class name
*/
public QName getClassName()
{
return className;
}
}

View File

@@ -0,0 +1,48 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
import org.alfresco.service.namespace.QName;
/**
* Thrown when an operation cannot be performed because a type is not recognised
* by the data dictionary
*
* @author Derek Hulley
*/
public class InvalidTypeException extends InvalidClassException
{
private static final long serialVersionUID = 3256722870754293558L;
public InvalidTypeException(QName typeName)
{
super(null, typeName);
}
public InvalidTypeException(String msg, QName typeName)
{
super(msg, typeName);
}
/**
* @return Returns the offending type name
*/
public QName getTypeName()
{
return getClassName();
}
}

View File

@@ -0,0 +1,56 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
import java.util.Date;
import org.alfresco.service.namespace.QName;
/**
* Read-only definition of a Model.
*
* @author David Caruana
*/
public interface ModelDefinition
{
/**
* @return the model name
*/
public QName getName();
/**
* @return the model description
*/
public String getDescription();
/**
* @return the model author
*/
public String getAuthor();
/**
* @return the date when the model was published
*/
public Date getPublishedDate();
/**
* @return the model version
*/
public String getVersion();
}

View File

@@ -0,0 +1,101 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
import org.alfresco.service.namespace.QName;
/**
* Read-only definition of a Property.
*
* @author David Caruana
*/
public interface PropertyDefinition
{
/**
* @return defining model
*/
public ModelDefinition getModel();
/**
* @return the qualified name of the property
*/
public QName getName();
/**
* @return the human-readable class title
*/
public String getTitle();
/**
* @return the human-readable class description
*/
public String getDescription();
/**
* @return the default value
*/
public String getDefaultValue();
/**
* @return the qualified name of the property type
*/
public DataTypeDefinition getDataType();
/**
* @return Returns the owning class's defintion
*/
public ClassDefinition getContainerClass();
/**
* @return true => multi-valued, false => single-valued
*/
public boolean isMultiValued();
/**
* @return true => mandatory, false => optional
*/
public boolean isMandatory();
/**
* @return true => system maintained, false => client may maintain
*/
public boolean isProtected();
/**
* @return true => indexed, false => not indexed
*/
public boolean isIndexed();
/**
* @return true => stored in index
*/
public boolean isStoredInIndex();
/**
* @return true => tokenised when it is indexed (the stored value will not be tokenised)
*/
public boolean isTokenisedInIndex();
/**
* All non atomic properties will be indexed at the same time.
*
* @return true => The attribute must be indexed in the commit of the transaction.
* false => the indexing will be done in the background and may be out of date.
*/
public boolean isIndexedAtomically();
}

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.dictionary;
/**
* Read-only definition of a Type
*
* @author David Caruana
*/
public interface TypeDefinition extends ClassDefinition
{
}