001/* 002 * (C) Copyright 2014 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl-2.1.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Anahide Tchertchian 016 */ 017package org.nuxeo.ecm.platform.forms.layout.api; 018 019import java.io.Serializable; 020import java.util.List; 021import java.util.Map; 022 023/** 024 * @since 6.0 025 */ 026public interface LayoutTypeConfiguration extends Serializable { 027 028 /** 029 * Returns the version name since the widget type has been available (5.4, 5.4.2, etc...) 030 */ 031 String getSinceVersion(); 032 033 /** 034 * Returns the version name since the widget type has been deprecated (5.4, 5.4.2, etc...) 035 */ 036 String getDeprecatedVersion(); 037 038 String getTitle(); 039 040 String getDescription(); 041 042 /** 043 * Returns the identifier to be used for the demo, or null if no demo is available. 044 */ 045 String getDemoId(); 046 047 /** 048 * Returns true is the preview is enabled on the demo. 049 */ 050 boolean isDemoPreviewEnabled(); 051 052 List<String> getCategories(); 053 054 List<String> getSupportedModes(); 055 056 /** 057 * Returns true if widget knows how to display its label (some widget types might delegate this to their containing 058 * widget or layout, usually when defining form layouts). 059 */ 060 boolean isHandlingLabels(); 061 062 /** 063 * Returns true if widget will be containing forms. 064 * <p> 065 * Since forms cannot contains any sub forms, layouts using this widget should not be surrounded by any form. Other 066 * widgets in the same layouts not containing forms may then need a surrounding form that could be added by the 067 * layout template. 068 */ 069 boolean isContainingForm(); 070 071 List<LayoutDefinition> getPropertyLayouts(String mode, String additionalMode); 072 073 Map<String, List<LayoutDefinition>> getPropertyLayouts(); 074 075 /** 076 * Returns the default values for the layout type properties, by mode. 077 */ 078 Map<String, Map<String, Serializable>> getDefaultPropertyValues(); 079 080 /** 081 * Returns the default values for the layout type properties, for given mode. 082 */ 083 Map<String, Serializable> getDefaultPropertyValues(String mode); 084 085 /** 086 * Returns the list of supported controls, e.g. controls that are checked on sub-widgets definitions. 087 */ 088 List<String> getSupportedControls(); 089 090}