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 * Gets the default file path, if available. 062 * 063 * @return the default file path 064 */ 065 String getDefaultFilePath(); 066 067 /** 068 * Returns the default file properties, if available.<p> 069 * 070 * @return the default file properties 071 */ 072 Map<String, CmsClientProperty> getDefaultFileProperties(); 073 074 /** 075 * Returns the text which should be used for the title of the sitemap entry editor dialog. 076 * 077 * @return the dialog title for the sitemap entry editor 078 */ 079 String getDialogTitle(); 080 081 /** 082 * Returns the URL names which the new URL name of the entry must not be equal to.<p> 083 * 084 * @return a list of forbidden URL names 085 */ 086 List<String> getForbiddenUrlNames(); 087 088 /** 089 * Returns the structure id of the resource being edited.<p> 090 * 091 * @return the structure id of the resource being edited 092 */ 093 CmsUUID getId(); 094 095 /** 096 * Returns an inherited property value.<p> 097 * 098 * This is the value that the resource being edited would inherit if it didn't define its own value for that property.<p> 099 * 100 * @param name the name of the property 101 * @return the inherited property 102 */ 103 CmsClientProperty getInheritedProperty(String name); 104 105 /** 106 * Returns the class name which should be added when displaying resource info boxes.<p> 107 * 108 * 109 * @return the class name to use for displaying resource info boxes 110 */ 111 String getModeClass(); 112 113 /** 114 * Returns the URL name with which the sitemap entry editor should be initialized.<p> 115 * 116 * @return the initial URL name 117 */ 118 String getName(); 119 120 /** 121 * Returns the properties of the resource being edited.<p> 122 * 123 * @return the properties of the resource being edited 124 */ 125 Map<String, CmsClientProperty> getOwnProperties(); 126 127 /** 128 * Returns the page info bean.<p> 129 * 130 * @return the page info bean 131 */ 132 CmsListInfoBean getPageInfo(); 133 134 /** 135 * Gets the path of the resource being edited.<p> 136 * 137 * @return the path of the resource being edited 138 */ 139 String getPath(); 140 141 /** 142 * Returns a map of beans representing the selectable templates.<p> 143 * 144 * @return a map of selectable templates 145 */ 146 Map<String, CmsClientTemplateBean> getPossibleTemplates(); 147 148 /** 149 * Handles the submit action for the sitemap entry editor.<p> 150 * 151 * @param newUrlName the new url name 152 * @param vfsPath the new vfs path 153 * @param propertyChanges the property changes 154 * @param editedName if true, the URL name has been edited 155 * @param reloadMode the information about which entry should reloaded 156 */ 157 void handleSubmit( 158 String newUrlName, 159 String vfsPath, 160 List<CmsPropertyModification> propertyChanges, 161 boolean editedName, 162 CmsReloadMode reloadMode); 163 164 /** 165 * Returns if the handled entry has an editable name.<p> 166 * 167 * @return <code>true</code> if the handled entry has an editable name 168 */ 169 boolean hasEditableName(); 170 171 /** 172 * Checks if the resource being edited is a folder.<p> 173 * 174 * @return true if the resource being edited is a folder 175 */ 176 boolean isFolder(); 177 178 /** 179 * Checks whether the property with the given name should be hidden.<p> 180 * 181 * @param key the property name 182 * 183 * @return true if the property should be hidden 184 */ 185 boolean isHiddenProperty(String key); 186 187 /** 188 * Should return true if the sitemap editor is running in simple mode.<p> 189 * 190 * @return true if the sitemap editor is running in simple mode 191 */ 192 boolean isSimpleMode(); 193 194 /** 195 * Returns true if the property editor should use only ADE templates.<p> 196 * 197 * @return true if the property editor should use only ADE templates 198 */ 199 boolean useAdeTemplates(); 200 201}