001/*
002 * (C) Copyright 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Bogdan Stefanescu
018 *     Florent Guillaume
019 */
020
021package org.nuxeo.ecm.core.schema;
022
023import java.util.List;
024import java.util.Set;
025
026import org.nuxeo.ecm.core.schema.types.CompositeType;
027import org.nuxeo.ecm.core.schema.types.Schema;
028
029/**
030 * A provider of types (schemas, document types, facets).
031 */
032public interface TypeProvider {
033
034    /** Gets a schema. */
035    Schema getSchema(String schema);
036
037    /** Gets the list of schemas. */
038    Schema[] getSchemas();
039
040    /** Gets a document type. */
041    DocumentType getDocumentType(String docType);
042
043    /** Gets the list of document types. */
044    DocumentType[] getDocumentTypes();
045
046    /** Gets a facet. */
047    CompositeType getFacet(String name);
048
049    /** Gets the list of facets. */
050    CompositeType[] getFacets();
051
052    /** Finds which facets are configured as no-per-instance-query. */
053    Set<String> getNoPerDocumentQueryFacets();
054
055    /** Gets the schemas on a proxy for a document of the given type. */
056    List<Schema> getProxySchemas(String docType);
057
058    /** Checks if a schema is on a proxy for a document of the given type. */
059    boolean isProxySchema(String schema, String docType);
060
061}