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.ade.sitemap.shared.rpc; 029 030import org.opencms.ade.sitemap.shared.CmsClientSitemapEntry; 031import org.opencms.ade.sitemap.shared.CmsGalleryFolderEntry; 032import org.opencms.ade.sitemap.shared.CmsGalleryType; 033import org.opencms.ade.sitemap.shared.CmsLocaleComparePropertyData; 034import org.opencms.ade.sitemap.shared.CmsModelInfo; 035import org.opencms.ade.sitemap.shared.CmsModelPageEntry; 036import org.opencms.ade.sitemap.shared.CmsNewResourceInfo; 037import org.opencms.ade.sitemap.shared.CmsSitemapCategoryData; 038import org.opencms.ade.sitemap.shared.CmsSitemapChange; 039import org.opencms.ade.sitemap.shared.CmsSitemapData; 040import org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode; 041import org.opencms.gwt.CmsRpcException; 042import org.opencms.gwt.shared.alias.CmsAliasEditValidationReply; 043import org.opencms.gwt.shared.alias.CmsAliasEditValidationRequest; 044import org.opencms.gwt.shared.alias.CmsAliasImportResult; 045import org.opencms.gwt.shared.alias.CmsAliasInitialFetchResult; 046import org.opencms.gwt.shared.alias.CmsAliasSaveValidationRequest; 047import org.opencms.gwt.shared.alias.CmsRewriteAliasValidationReply; 048import org.opencms.gwt.shared.alias.CmsRewriteAliasValidationRequest; 049import org.opencms.gwt.shared.property.CmsPropertyModification; 050import org.opencms.util.CmsUUID; 051 052import java.util.List; 053import java.util.Map; 054 055import com.google.gwt.user.client.rpc.RemoteService; 056 057/** 058 * Handles all RPC services related to the sitemap.<p> 059 * 060 * @since 8.0.0 061 * 062 * @see org.opencms.ade.sitemap.CmsVfsSitemapService 063 * @see org.opencms.ade.sitemap.shared.rpc.I_CmsSitemapService 064 * @see org.opencms.ade.sitemap.shared.rpc.I_CmsSitemapServiceAsync 065 */ 066public interface I_CmsSitemapService extends RemoteService { 067 068 /** 069 * Sets the name and title of the given category.<p> 070 * 071 * @param entryPoint the current entry point 072 * @param id the category id 073 * @param title the new title 074 * @param name the new name 075 * @throws CmsRpcException if something goes wrong 076 */ 077 void changeCategory(String entryPoint, CmsUUID id, String title, String name) throws CmsRpcException; 078 079 /** 080 * Creates a new category.<p> 081 * 082 * @param entryPoint the entry point 083 * @param id the parent category id 084 * @param title the title 085 * @param name the category name 086 * 087 * @throws CmsRpcException if something goes wrong 088 */ 089 void createCategory(String entryPoint, CmsUUID id, String title, String name) throws CmsRpcException; 090 091 /** 092 * Creates a new gallery folder.<p> 093 * 094 * @param parentFolder the parent folder path 095 * @param title the title property 096 * @param folderTypeId the resource type id 097 * 098 * @return the new gallery folder data 099 * 100 * @throws CmsRpcException if something goes wrong 101 */ 102 CmsGalleryFolderEntry createNewGalleryFolder(String parentFolder, String title, int folderTypeId) 103 throws CmsRpcException; 104 105 /** 106 * Creates a new model page.<p> 107 * 108 * @param entryPointUri the uri of the entry point 109 * @param title the title for the model page 110 * @param description the description for the model page 111 * @param copyId the structure id of the resource to copy to create a new model page; if null, the model page is created as an empty container page 112 * @param isModelGroup <code>true</code> to create a new model group page 113 * 114 * @return a bean representing the created model page 115 * @throws CmsRpcException if something goes wrong 116 */ 117 CmsModelPageEntry createNewModelPage( 118 String entryPointUri, 119 String title, 120 String description, 121 CmsUUID copyId, 122 boolean isModelGroup) 123 throws CmsRpcException; 124 125 /** 126 * Creates a sub-sitemap of the given sitemap starting from the given entry.<p> 127 * 128 * @param entryId the structure id of the sitemap entry to create a sub sitemap of 129 * 130 * @return the sub-sitemap creation result 131 * 132 * @throws CmsRpcException if something goes wrong 133 */ 134 CmsSitemapChange createSubSitemap(CmsUUID entryId) throws CmsRpcException; 135 136 /** 137 * Sets the disabled flag of a model page within the current sitemap configuration.<p> 138 * 139 * @param baseUri the base uri for the current sitemap 140 * @param modelPageId structure id of the model page to remove 141 * @param disabled the disabled flag 142 * 143 * @throws CmsRpcException if something goes wrong 144 */ 145 void disableModelPage(String baseUri, CmsUUID modelPageId, boolean disabled) throws CmsRpcException; 146 147 /** 148 * Gets the alias import results from the server.<p> 149 * 150 * @param resultKey the key which identifies the alias import results to get 151 * @return the list of alias import results 152 * 153 * @throws CmsRpcException if something goes wrong 154 */ 155 List<CmsAliasImportResult> getAliasImportResult(String resultKey) throws CmsRpcException; 156 157 /** 158 * Gets the initial data for the bulk alias editor.<p> 159 * 160 * @return the initial data for the alias editor 161 * 162 * @throws CmsRpcException if something goes wrong 163 */ 164 CmsAliasInitialFetchResult getAliasTable() throws CmsRpcException; 165 166 /** 167 * Gets the category data for the given entry point.<p> 168 * 169 * @param entryPoint the entry point 170 * @return the category data 171 * 172 * @throws CmsRpcException if something goes wrong 173 **/ 174 CmsSitemapCategoryData getCategoryData(String entryPoint) throws CmsRpcException; 175 176 /** 177 * Returns the sitemap children for the given path.<p> 178 * 179 * @param entryPointUri the URI of the sitemap entry point 180 * @param entryId the entry id 181 * @param levels the count of child levels to read 182 * 183 * @return the sitemap children 184 * 185 * @throws CmsRpcException if something goes wrong 186 */ 187 CmsClientSitemapEntry getChildren(String entryPointUri, CmsUUID entryId, int levels) throws CmsRpcException; 188 189 /** 190 * Returns the gallery data to this sub site.<p> 191 * 192 * @param entryPointUri the sub site folder 193 * 194 * @return the gallery data to this sub site 195 * 196 * @throws CmsRpcException if something goes wrong 197 */ 198 Map<CmsGalleryType, List<CmsGalleryFolderEntry>> getGalleryData(String entryPointUri) throws CmsRpcException; 199 200 /** 201 * Gets the model pages for the given structure id of the sitemap root folder.<p> 202 * 203 * @param rootId structure id of a folder 204 * @return the model pages available in the given folder 205 * 206 * @throws CmsRpcException if something goes wrong 207 */ 208 CmsModelInfo getModelInfos(CmsUUID rootId) throws CmsRpcException; 209 210 /** 211 * Loads the model page data for the "add" menu.<p> 212 * 213 * @param entryPointUri the entry point uri 214 * @return the list of resource info beans for the model pages 215 * 216 * @throws CmsRpcException if something goes wrong 217 */ 218 List<CmsNewResourceInfo> getNewElementInfo(String entryPointUri) throws CmsRpcException; 219 220 /** 221 * Fetches the link for a resource selected in the sitemap editor.<p> 222 * 223 * @param baseId the structure id of the current sitemap root entry 224 * @param sitePath the site path of a resource 225 * @return the link to the resource 226 * 227 * @throws CmsRpcException if something goes wrong 228 */ 229 String getResourceLink(CmsUUID baseId, String sitePath) throws CmsRpcException; 230 231 /** 232 * Loads the data needed by the property editor in the locale comparison view.<p> 233 * 234 * @param id the id of the resource for which the property editor should be opened 235 * @param rootId the structure id of the resource which corresponds to the tree root in locale compare mode 236 * 237 * @return the property data for locale comparison mode 238 * 239 * @throws CmsRpcException if something goes wrong 240 */ 241 CmsLocaleComparePropertyData loadPropertyDataForLocaleCompareView(CmsUUID id, CmsUUID rootId) 242 throws CmsRpcException; 243 244 /** 245 * Merges a sub-sitemap into it's parent sitemap.<p> 246 * 247 * @param entryPoint the sitemap entry point 248 * @param subSitemapId the structure id of the sub sitemap folder 249 * 250 * @return the result of the merge operation 251 * 252 * @throws CmsRpcException if something goes wrong 253 */ 254 CmsSitemapChange mergeSubSitemap(String entryPoint, CmsUUID subSitemapId) throws CmsRpcException; 255 256 /** 257 * Returns the initialization data for the given sitemap.<p> 258 * 259 * @param sitemapUri the site relative path 260 * 261 * @return the initialization data 262 * 263 * @throws CmsRpcException if something goes wrong 264 */ 265 CmsSitemapData prefetch(String sitemapUri) throws CmsRpcException; 266 267 /** 268 * Prepares sitemap reloading for the given sitemap root.<p> 269 * 270 * This method may change the currently set site root. If the given root id is not in a valid site, 271 * null will be returned, otherwise the URL which the client should use to reload the sitemap will be returned. 272 * 273 * @param rootId the structure id of the new sitemap root 274 * @param mode the new editor mode 275 * 276 * @return the URL which should be used to reload the sitemap 277 * 278 * @throws CmsRpcException if something goes wrong 279 */ 280 String prepareReloadSitemap(CmsUUID rootId, EditorMode mode) throws CmsRpcException; 281 282 /** 283 * Removes a model page from the current sitemap configuration.<p> 284 * 285 * @param baseUri the base uri for the current sitemap 286 * @param modelPageId structure id of the model page to remove 287 * 288 * @throws CmsRpcException if something goes wrong 289 */ 290 void removeModelPage(String baseUri, CmsUUID modelPageId) throws CmsRpcException; 291 292 /** 293 * Saves the change to the given sitemap.<p> 294 * 295 * @param sitemapUri the sitemap URI 296 * @param change the change to save 297 * 298 * @return the updated change 299 * 300 * @throws CmsRpcException if something goes wrong 301 */ 302 CmsSitemapChange save(String sitemapUri, CmsSitemapChange change) throws CmsRpcException; 303 304 /** 305 * Saves the aliases for the bulk alias editor.<p> 306 * 307 * @param saveRequest the object containing the data to save 308 * @return the result of saving the aliases 309 * 310 * @throws CmsRpcException if something goes wrong 311 */ 312 CmsAliasEditValidationReply saveAliases(CmsAliasSaveValidationRequest saveRequest) throws CmsRpcException; 313 314 /** 315 * Saves the changed properties in locale comparison mode.<p> 316 * 317 * @param id the structure id 318 * @param newUrlName the new URL name 319 * @param propertyChanges the property changes 320 * @param editedName true if the name was edited 321 * 322 * @throws CmsRpcException if something goes wrong 323 */ 324 void savePropertiesForLocaleCompareMode( 325 CmsUUID id, 326 String newUrlName, 327 List<CmsPropertyModification> propertyChanges, 328 boolean editedName) 329 throws CmsRpcException; 330 331 /** 332 * Sets the default model page for the given sub-sitemap, returns the updated model info.<p> 333 * 334 * @param rootId structure id of the sub-sitemap root folder 335 * @param modelId the id of the model page to set as default 336 * 337 * @return the updated model info 338 * 339 * @throws CmsRpcException if something goes wrong 340 */ 341 CmsModelInfo setDefaultModel(CmsUUID rootId, CmsUUID modelId) throws CmsRpcException; 342 343 /** 344 * Sets the editor mode in the current user session.<p> 345 * 346 * @param editorMode the editor mode to set 347 * 348 * @throws CmsRpcException in case something goes wrong 349 */ 350 void setEditorMode(EditorMode editorMode) throws CmsRpcException; 351 352 /** 353 * Updates the alias editor status.<p> 354 * 355 * This is used to keep two users from editing the alias table for a site root concurrently.<p> 356 * 357 * @param editing true to indicate that the table is still being edited, false to indicate that the table isn't being edited anymore 358 * 359 * @throws CmsRpcException if something goes wrong 360 */ 361 void updateAliasEditorStatus(boolean editing) throws CmsRpcException; 362 363 /** 364 * Validates the aliases for the bulk alias editor.<p> 365 * 366 * @param validationRequest an object indicating the type of validation to perform 367 * @return the validation result 368 * 369 * @throws CmsRpcException if something goes wrong 370 */ 371 CmsAliasEditValidationReply validateAliases(CmsAliasEditValidationRequest validationRequest) throws CmsRpcException; 372 373 /** 374 * Validates rewrite aliases.<p> 375 * 376 * @param validationRequest the rewrite alias data to validate 377 * @return the validation result 378 * 379 * @throws CmsRpcException if something goes wrong 380 */ 381 CmsRewriteAliasValidationReply validateRewriteAliases(CmsRewriteAliasValidationRequest validationRequest) 382 throws CmsRpcException; 383 384}