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.shared.rpc; 029 030import org.opencms.gwt.CmsRpcException; 031import org.opencms.gwt.shared.CmsDeleteResourceBean; 032import org.opencms.gwt.shared.CmsExternalLinkInfoBean; 033import org.opencms.gwt.shared.CmsHistoryResourceCollection; 034import org.opencms.gwt.shared.CmsHistoryVersion; 035import org.opencms.gwt.shared.CmsListInfoBean; 036import org.opencms.gwt.shared.CmsLockReportInfo; 037import org.opencms.gwt.shared.CmsPrepareEditResponse; 038import org.opencms.gwt.shared.CmsPreviewInfo; 039import org.opencms.gwt.shared.CmsQuickLaunchData; 040import org.opencms.gwt.shared.CmsQuickLaunchParams; 041import org.opencms.gwt.shared.CmsRenameInfoBean; 042import org.opencms.gwt.shared.CmsReplaceInfo; 043import org.opencms.gwt.shared.CmsResourceStatusBean; 044import org.opencms.gwt.shared.CmsRestoreInfoBean; 045import org.opencms.gwt.shared.CmsVfsEntryBean; 046import org.opencms.gwt.shared.alias.CmsAliasBean; 047import org.opencms.gwt.shared.property.CmsPropertiesBean; 048import org.opencms.gwt.shared.property.CmsPropertyChangeSet; 049import org.opencms.util.CmsUUID; 050import org.opencms.xml.content.CmsXmlContentProperty; 051 052import java.util.ArrayList; 053import java.util.List; 054import java.util.Map; 055 056import com.google.gwt.user.client.rpc.RemoteService; 057 058/** 059 * A service interface for retrieving information about the VFS tree.<p> 060 * 061 * @since 8.0.0 062 */ 063public interface I_CmsVfsService extends RemoteService { 064 065 /** 066 * Creates a new external link resource.<p> 067 * 068 * @param title the title 069 * @param link the link 070 * @param resourceName the name of the link resource to create 071 * @param parentFolderPath the parent folder site path 072 * 073 * @throws CmsRpcException if something goes wrong 074 */ 075 void createNewExternalLink(String title, String link, String resourceName, String parentFolderPath) 076 throws CmsRpcException; 077 078 /** 079 * Creates a new property definition.<p> 080 * 081 * @param propDef the name of the property 082 * 083 * @throws CmsRpcException if something goes wrong 084 */ 085 void createPropertyDefinition(String propDef) throws CmsRpcException; 086 087 /** 088 * Deletes a resource from the VFS.<p> 089 * 090 * @param structureId the structure id of the resource to delete 091 * 092 * @throws CmsRpcException if something goes wrong 093 */ 094 void deleteResource(CmsUUID structureId) throws CmsRpcException; 095 096 /** 097 * Deletes a resource from the VFS.<p> 098 * 099 * @param sitePath the site path of the resource to delete 100 * 101 * @throws CmsRpcException if something goes wrong 102 */ 103 void deleteResource(String sitePath) throws CmsRpcException; 104 105 /** 106 * Forces a resource to be unlocked. In case the given resource is a folder, all sub-resources are also unlocked.<p> 107 * 108 * @param structureId the structure id of the resource to unlock 109 * 110 * @throws CmsRpcException if something goes wrong 111 */ 112 void forceUnlock(CmsUUID structureId) throws CmsRpcException; 113 114 /** 115 * Fetches the aliases for a given page.<p> 116 * 117 * @param uuid the structure id of the page 118 * 119 * @return the lists of aliases for the page 120 * 121 * @throws CmsRpcException if something goes wrong 122 */ 123 List<CmsAliasBean> getAliasesForPage(CmsUUID uuid) throws CmsRpcException; 124 125 /** 126 * Returns a list of potentially broken links, if the given resource was deleted.<p> 127 * 128 * @param structureId the resource structure id 129 * 130 * @return a list of potentially broken links 131 * 132 * @throws CmsRpcException if something goes wrong 133 */ 134 CmsDeleteResourceBean getBrokenLinks(CmsUUID structureId) throws CmsRpcException; 135 136 /** 137 * Returns a list of potentially broken links, if the given resource was deleted.<p> 138 * 139 * @param sitePath the resource site-path 140 * 141 * @return a list of potentially broken links 142 * 143 * @throws CmsRpcException if something goes wrong 144 */ 145 CmsDeleteResourceBean getBrokenLinks(String sitePath) throws CmsRpcException; 146 147 /** 148 * Fetches the list of children of a path.<p> 149 * 150 * @param path the path for which the list of children should be retrieved 151 * 152 * @return the children of the path 153 * 154 * @throws CmsRpcException if something goes wrong 155 */ 156 List<CmsVfsEntryBean> getChildren(String path) throws CmsRpcException; 157 158 /** 159 * Loads a thumbnail for a dataview record.<p> 160 * 161 * @param config the dataview configuration string 162 * @param id the record id 163 * 164 * @return the URL of the thumbnail 165 * @throws CmsRpcException if something goes wrong 166 */ 167 String getDataViewThumbnail(String config, String id) throws CmsRpcException; 168 169 /** 170 * Gets the default property configurations for the given structure ids.<p> 171 * 172 * @param structureIds the structure ids for which the property configurations should be fetched 173 * @return a map from the given structure ids to their default property configurations 174 * 175 * @throws CmsRpcException if something goes wrong 176 */ 177 Map<CmsUUID, Map<String, CmsXmlContentProperty>> getDefaultProperties(List<CmsUUID> structureIds) 178 throws CmsRpcException; 179 180 /** 181 * Gets the names of defined properties.<p> 182 * 183 * @return the list of names for all defined properties 184 * 185 * @throws CmsRpcException if something goes wrong 186 */ 187 ArrayList<String> getDefinedProperties() throws CmsRpcException; 188 189 /** 190 * Returns the file replace info.<p> 191 * 192 * @param structureId the structure id of the file to replace 193 * 194 * @return the file replace info 195 * 196 * @throws CmsRpcException if the RPC call goes wrong 197 */ 198 CmsReplaceInfo getFileReplaceInfo(CmsUUID structureId) throws CmsRpcException; 199 200 /** 201 * Gets the preview information for a historic version.<p> 202 * 203 * @param structureId the structure id of the resource 204 * @param locale the locale 205 * @param version the version number 206 * 207 * @return the preview information for the historic resource version 208 * 209 * @throws CmsRpcException if something goes wrong 210 */ 211 CmsPreviewInfo getHistoryPreviewInfo(CmsUUID structureId, String locale, CmsHistoryVersion version) 212 throws CmsRpcException; 213 214 /** 215 * Returns the lock report info.<p> 216 * 217 * @param structureId the structure id of the resource to get the report for 218 * 219 * @return the lock report info 220 * 221 * @throws CmsRpcException if something goes wrong 222 */ 223 CmsLockReportInfo getLockReportInfo(CmsUUID structureId) throws CmsRpcException; 224 225 /** 226 * Returns a {@link CmsListInfoBean} for a given resource.<p> 227 * 228 * @param structureId the structure id to create the {@link CmsListInfoBean} for 229 * 230 * @return the {@link CmsListInfoBean} for a given resource 231 * 232 * @throws CmsRpcException if the RPC call goes wrong 233 */ 234 CmsListInfoBean getPageInfo(CmsUUID structureId) throws CmsRpcException; 235 236 /** 237 * Returns a {@link CmsListInfoBean} for a given resource.<p> 238 * 239 * @param vfsPath the vfs path to create the {@link CmsListInfoBean} for 240 * 241 * @return the {@link CmsListInfoBean} for a given resource 242 * 243 * @throws CmsRpcException if the RPC call goes wrong 244 */ 245 CmsListInfoBean getPageInfo(String vfsPath) throws CmsRpcException; 246 247 /** 248 * Returns the preview info for the given resource.<p> 249 * 250 * @param structureId the resource structure id 251 * @param locale the requested locale 252 * 253 * @return the preview info 254 * 255 * @throws CmsRpcException if something goes wrong 256 */ 257 CmsPreviewInfo getPreviewInfo(CmsUUID structureId, String locale) throws CmsRpcException; 258 259 /** 260 * Returns the preview info for the given resource.<p> 261 * 262 * @param sitePath the resource site path 263 * @param locale the requested locale 264 * 265 * @return the preview info 266 * 267 * @throws CmsRpcException if something goes wrong 268 */ 269 CmsPreviewInfo getPreviewInfo(String sitePath, String locale) throws CmsRpcException; 270 271 /*** 272 * Gets the information necessary for the rename dialog.<p> 273 * 274 * @param structureId the structure id of the resource to rename 275 * 276 * @return the information needed for the rename dialog 277 * 278 * @throws CmsRpcException if something goes wrong 279 */ 280 CmsRenameInfoBean getRenameInfo(CmsUUID structureId) throws CmsRpcException; 281 282 /** 283 * Gets the resource history for a given structure id.<p> 284 * 285 * @param structureId the structure id of a resource 286 * @return the history for the given resource 287 * 288 * @throws CmsRpcException if something goes wrong 289 */ 290 CmsHistoryResourceCollection getResourceHistory(CmsUUID structureId) throws CmsRpcException; 291 292 /** 293 * Gets a bean containing status information for a given resource.<p> 294 * 295 * @param structureId the structure id of a resource 296 * @param locale the locale for which we want the resource information 297 * @param includeTargets true if relation targets should also be fetched 298 * @param detailContentId the structure id of the detail content if present 299 * @param context additional context-dependent parameters used for providing additional information 300 * 301 * @return the resource status 302 * 303 * @throws CmsRpcException if something goes wrong 304 */ 305 CmsResourceStatusBean getResourceStatus( 306 CmsUUID structureId, 307 String locale, 308 boolean includeTargets, 309 CmsUUID detailContentId, 310 Map<String, String> context) 311 throws CmsRpcException; 312 313 /** 314 * Gets the information which is necessary for opening the 'Restore' dialog for a resource.<p> 315 * 316 * @param structureId the structure id of the resource 317 * @return the information for the resource 318 * 319 * @throws CmsRpcException if something goes wrong 320 */ 321 CmsRestoreInfoBean getRestoreInfo(CmsUUID structureId) throws CmsRpcException; 322 323 /** 324 * Returns the root entries of the VFS.<p> 325 * 326 * @return a list of root entries 327 * 328 * @throws CmsRpcException if something goes wrong 329 */ 330 List<CmsVfsEntryBean> getRootEntries() throws CmsRpcException; 331 332 /** 333 * Returns the site-path for the resource with the given id.<p> 334 * 335 * @param structureId the structure id 336 * 337 * @return the site-path or <code>null</code> if not available 338 * 339 * @throws CmsRpcException if something goes wrong 340 */ 341 String getSitePath(CmsUUID structureId) throws CmsRpcException; 342 343 /** 344 * Loads the external link info.<p> 345 * 346 * @param structureId the external link structure id 347 * 348 * @return the external link info 349 * 350 * @throws CmsRpcException if something goes wrong 351 */ 352 CmsExternalLinkInfoBean loadLinkInfo(CmsUUID structureId) throws CmsRpcException; 353 354 /** 355 * Load the data necessary to edit the properties of a resource.<p> 356 * 357 * @param id the structure id of a resource 358 * @return the property information for that resource 359 * @throws CmsRpcException if something goes wrong 360 */ 361 CmsPropertiesBean loadPropertyData(CmsUUID id) throws CmsRpcException; 362 363 /** 364 * Loads the items for the quick launch menu.<p> 365 * 366 * @param params the quick launch parameters 367 * 368 * @return the list of quick launch items 369 * 370 * @throws CmsRpcException if something goes wrong 371 */ 372 List<CmsQuickLaunchData> loadQuickLaunchItems(CmsQuickLaunchParams params) throws CmsRpcException; 373 374 /** 375 * Prepares to edit a file in the XML content editor.<p> 376 * 377 * @param currentPage the current page from which the editor should be opened 378 * @param fileNameWithMacros the file name, which may contain macros 379 * 380 * @return a bean with more information about the file to edit 381 * @throws CmsRpcException if something goes wrong 382 */ 383 CmsPrepareEditResponse prepareEdit(CmsUUID currentPage, String fileNameWithMacros) throws CmsRpcException; 384 385 /** 386 * Renames a resource.<p> 387 * 388 * @param structureId the structure id of the resource to rename 389 * @param newName the new resource name 390 * 391 * @return null or an error message 392 * 393 * @throws CmsRpcException if something goes wrong 394 */ 395 String renameResource(CmsUUID structureId, String newName) throws CmsRpcException; 396 397 /** 398 * Reverts a resource to a previous historic version.<p> 399 * 400 * @param structureId the structure id of the resource to revert 401 * @param version the version to which the resource should be reverted 402 * 403 * @throws CmsRpcException if something goes wrong 404 */ 405 void restoreResource(CmsUUID structureId, int version) throws CmsRpcException; 406 407 /** 408 * Saves aliases for a page.<p> 409 * 410 * @param structureId the structure id of the page 411 * 412 * @param aliases the aliases which should be saved for the page 413 * @throws CmsRpcException if something goes wrong 414 */ 415 void saveAliases(CmsUUID structureId, List<CmsAliasBean> aliases) throws CmsRpcException; 416 417 /** 418 * Saves the external link.<p> 419 * 420 * @param structureId the link structure id 421 * @param title the link title 422 * @param link the link 423 * @param fileName the file name 424 * 425 * @throws CmsRpcException if something goes wrong 426 */ 427 void saveExternalLink(CmsUUID structureId, String title, String link, String fileName) throws CmsRpcException; 428 429 /** 430 * Saves a set of property changes.<p> 431 * 432 * @param changes a set of property changes 433 * 434 * @throws CmsRpcException if something goes wrong 435 */ 436 void saveProperties(CmsPropertyChangeSet changes) throws CmsRpcException; 437 438 /** 439 * Returns the absolute link to the given root path.<p> 440 * 441 * @param currentSiteRoot the current site 442 * @param rootPath the root path 443 * 444 * @return the absolute link 445 * 446 * @throws CmsRpcException if something goes wrong processing the request 447 */ 448 String substituteLinkForRootPath(String currentSiteRoot, String rootPath) throws CmsRpcException; 449 450 /** 451 * Deletes a resource from the VFS.<p> 452 * 453 * @param structureId the structure id of the resource to delete 454 * 455 * @throws CmsRpcException if something goes wrong 456 */ 457 void syncDeleteResource(CmsUUID structureId) throws CmsRpcException; 458 459 /** 460 * Undeletes a resource.<p> 461 * 462 * @param structureId the structure id of the resource to undelete 463 * 464 * @throws CmsRpcException if something goes wrong 465 */ 466 void undelete(CmsUUID structureId) throws CmsRpcException; 467 468 /** 469 * Undoes the changes to a given resource, i.e. restores its online content to its offline version.<p> 470 * 471 * @param structureId the structure id of the resource to undo 472 * @param undoMove true if move operations should be undone 473 * 474 * @throws CmsRpcException if something goes wrong 475 */ 476 void undoChanges(CmsUUID structureId, boolean undoMove) throws CmsRpcException; 477 478 /** 479 * Validates alias paths for a page.<p> 480 * 481 * @param uuid the structure id of the page 482 * @param aliasPaths a map from (arbitrary) id strings to alias paths 483 * 484 * @return a map which maps the same id strings to validation results 485 * 486 * @throws CmsRpcException if something goes wrong 487 */ 488 Map<String, String> validateAliases(CmsUUID uuid, Map<String, String> aliasPaths) throws CmsRpcException; 489 490}