001/* 002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * Bogdan Stefanescu 011 * Florent Guillaume 012 */ 013 014package org.nuxeo.ecm.core.schema; 015 016import java.util.List; 017import java.util.Set; 018 019import org.nuxeo.ecm.core.schema.types.CompositeType; 020import org.nuxeo.ecm.core.schema.types.Schema; 021 022/** 023 * A provider of types (schemas, document types, facets). 024 */ 025public interface TypeProvider { 026 027 /** Gets a schema. */ 028 Schema getSchema(String schema); 029 030 /** Gets the list of schemas. */ 031 Schema[] getSchemas(); 032 033 /** Gets a document type. */ 034 DocumentType getDocumentType(String docType); 035 036 /** Gets the list of document types. */ 037 DocumentType[] getDocumentTypes(); 038 039 /** Gets a facet. */ 040 CompositeType getFacet(String name); 041 042 /** Gets the list of facets. */ 043 CompositeType[] getFacets(); 044 045 /** Finds which facets are configured as no-per-instance-query. */ 046 Set<String> getNoPerDocumentQueryFacets(); 047 048 /** Gets the schemas on a proxy for a document of the given type. */ 049 List<Schema> getProxySchemas(String docType); 050 051 /** Checks if a schema is on a proxy for a document of the given type. */ 052 boolean isProxySchema(String schema, String docType); 053 054}