001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.gwt.client.property;
029
030import org.opencms.gwt.shared.CmsListInfoBean;
031import org.opencms.gwt.shared.property.CmsClientProperty;
032import org.opencms.gwt.shared.property.CmsClientTemplateBean;
033import org.opencms.gwt.shared.property.CmsPropertyModification;
034import org.opencms.util.CmsUUID;
035
036import java.util.List;
037import java.util.Map;
038
039/**
040 * An interface for sitemap entry editor modes.<p>
041 *
042 * @since 8.0.0
043 */
044public interface I_CmsPropertyEditorHandler {
045
046    /**
047     * Gets a list of the names of available properties.<p>
048     *
049     * @return a list of property names
050     */
051    List<String> getAllPropertyNames();
052
053    /**
054     * Returns the default file id, if available.<p>
055     *
056     * @return the default file id
057     */
058    CmsUUID getDefaultFileId();
059
060    /**
061     * Returns the default file properties, if available.<p>
062     *
063     * @return the default file properties
064     */
065    Map<String, CmsClientProperty> getDefaultFileProperties();
066
067    /**
068     * Returns the text which should be used for the title of the sitemap entry editor dialog.
069     *
070     * @return the dialog title for the sitemap entry editor
071     */
072    String getDialogTitle();
073
074    /**
075     * Returns the URL names which the new URL name of the entry must not be equal to.<p>
076     *
077     * @return a list of forbidden URL names
078     */
079    List<String> getForbiddenUrlNames();
080
081    /**
082     * Returns the structure id of the resource being edited.<p>
083     *
084     * @return the structure id of the resource being edited
085     */
086    CmsUUID getId();
087
088    /**
089     * Returns an inherited property value.<p>
090     *
091     * This is the value that the resource being edited would inherit if it didn't define its own value for that property.<p>
092     *
093     * @param name the name of the property
094     * @return the inherited property
095     */
096    CmsClientProperty getInheritedProperty(String name);
097
098    /**
099     * Returns the class name which should be added when displaying resource info boxes.<p>
100     *
101     *
102     * @return the class name to use for displaying resource info boxes
103     */
104    String getModeClass();
105
106    /**
107     * Returns the URL name with which the sitemap entry editor should be initialized.<p>
108     *
109     * @return the initial URL name
110     */
111    String getName();
112
113    /**
114     * Returns the properties of the resource being edited.<p>
115     *
116     * @return the properties of the resource being edited
117     */
118    Map<String, CmsClientProperty> getOwnProperties();
119
120    /**
121     * Returns the page info bean.<p>
122     *
123     * @return the page info bean
124     */
125    CmsListInfoBean getPageInfo();
126
127    /**
128     * Gets the path of the resource being edited.<p>
129     *
130     * @return the path of the resource being edited
131     */
132    String getPath();
133
134    /**
135     * Returns a map of beans representing the selectable templates.<p>
136     *
137     * @return a map of selectable templates
138     */
139    Map<String, CmsClientTemplateBean> getPossibleTemplates();
140
141    /**
142     * Handles the submit action for the sitemap entry editor.<p>
143     *
144     * @param newUrlName the new url name
145     * @param vfsPath the new vfs path
146     * @param propertyChanges the property changes
147     * @param editedName if true, the URL name has been edited
148     * @param reloadMode the information about which entry should reloaded
149     */
150    void handleSubmit(
151        String newUrlName,
152        String vfsPath,
153        List<CmsPropertyModification> propertyChanges,
154        boolean editedName,
155        CmsReloadMode reloadMode);
156
157    /**
158     * Returns if the handled entry has an editable name.<p>
159     *
160     * @return <code>true</code> if the handled entry has an editable name
161     */
162    boolean hasEditableName();
163
164    /**
165     * Checks if the resource being edited is a folder.<p>
166     *
167     * @return true if the resource being edited is a folder
168     */
169    boolean isFolder();
170
171    /**
172     * Checks whether the property with the given name should be hidden.<p>
173     *
174     * @param key the property name
175     *
176     * @return true if the property should be hidden
177     */
178    boolean isHiddenProperty(String key);
179
180    /**
181     * Should return true if the sitemap editor is running in simple mode.<p>
182     *
183     * @return true if the sitemap editor is running in simple mode
184     */
185    boolean isSimpleMode();
186
187    /**
188     * Returns true if the property editor should use only ADE templates.<p>
189     *
190     * @return true if the property editor should use only ADE templates
191     */
192    boolean useAdeTemplates();
193
194}