001/*
002 * (C) Copyright 2006-2007 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 *     <a href="mailto:at@nuxeo.com">Anahide Tchertchian</a>
018 *
019 * $Id: LayoutManager.java 26053 2007-10-16 01:45:43Z atchertchian $
020 */
021
022package org.nuxeo.ecm.platform.forms.layout.api.service;
023
024import java.io.Serializable;
025import java.util.List;
026
027import org.nuxeo.ecm.platform.forms.layout.api.LayoutDefinition;
028import org.nuxeo.ecm.platform.forms.layout.api.LayoutTypeDefinition;
029import org.nuxeo.ecm.platform.forms.layout.api.WidgetDefinition;
030import org.nuxeo.ecm.platform.forms.layout.api.WidgetType;
031import org.nuxeo.ecm.platform.forms.layout.api.WidgetTypeDefinition;
032
033/**
034 * Layout manager interface.
035 * <p>
036 * It manages access to layout definitions, widget definitions and widget types for a given category.
037 *
038 * @author <a href="mailto:at@nuxeo.com">Anahide Tchertchian</a>
039 */
040public interface LayoutManager extends Serializable {
041
042    /**
043     * Return the default category used for storage
044     *
045     * @since 5.5
046     */
047    String getDefaultStoreCategory();
048
049    /**
050     * Returns the registered widget type for this type name.
051     * <p>
052     * If the no widget type is found with this name, return null.
053     */
054    WidgetType getWidgetType(String typeName);
055
056    /**
057     * Returns the widget type definition with given name, or null if no widget type with this name is found.
058     *
059     * @since 5.4
060     */
061    WidgetTypeDefinition getWidgetTypeDefinition(String typeName);
062
063    /**
064     * Returns the widget type definitions for all the registered widget types.
065     *
066     * @since 5.4
067     */
068    List<WidgetTypeDefinition> getWidgetTypeDefinitions();
069
070    /**
071     * Returns the layout type definition with given name, or null if no layout type with this name is found.
072     *
073     * @since 6.0
074     */
075    LayoutTypeDefinition getLayoutTypeDefinition(String typeName);
076
077    /**
078     * Returns the layout type definitions for all the registered layout types.
079     *
080     * @since 6.0
081     */
082    List<LayoutTypeDefinition> getLayoutTypeDefinitions();
083
084    /**
085     * Returns the registered layout definition for this name.
086     * <p>
087     * If the no definition is found with this name, return null.
088     */
089    LayoutDefinition getLayoutDefinition(String layoutName);
090
091    /**
092     * Returns the names of all the registered layout definitions
093     *
094     * @since 5.5
095     */
096    List<String> getLayoutDefinitionNames();
097
098    /**
099     * Returns the registered widget definition for this name.
100     * <p>
101     * If the no definition is found with this name, return null.
102     *
103     * @since 5.1.7, 5.2.0
104     */
105    WidgetDefinition getWidgetDefinition(String widgetName);
106
107}