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.contenteditor.shared.rpc; 029 030import org.opencms.acacia.shared.CmsEntity; 031import org.opencms.acacia.shared.CmsValidationResult; 032import org.opencms.ade.contenteditor.shared.CmsContentDefinition; 033import org.opencms.ade.contenteditor.shared.CmsEditHandlerData; 034import org.opencms.ade.contenteditor.shared.CmsSaveResult; 035import org.opencms.util.CmsUUID; 036 037import java.util.Collection; 038import java.util.List; 039import java.util.Map; 040 041import com.google.gwt.user.client.rpc.AsyncCallback; 042 043/** 044 * The content editor asynchronous service interface.<p> 045 */ 046public interface I_CmsContentServiceAsync extends org.opencms.acacia.shared.rpc.I_CmsContentServiceAsync { 047 048 /** 049 * Calls the editor change handlers.<p> 050 * 051 * @param entityId the edited entity id 052 * @param editedLocaleEntity the edited entity 053 * @param skipPaths the locale synchronization value paths to skip 054 * @param changedScopes the changed content value paths 055 * @param callback the asynchronous callback 056 */ 057 void callEditorChangeHandlers( 058 String entityId, 059 CmsEntity editedLocaleEntity, 060 Collection<String> skipPaths, 061 Collection<String> changedScopes, 062 AsyncCallback<CmsContentDefinition> callback); 063 064 /** 065 * Copies the given source locale to the target locales.<p> 066 * 067 * @param locales the target locales 068 * @param sourceLocale the source locale 069 * @param callback the asynchronous callback 070 */ 071 void copyLocale(Collection<String> locales, CmsEntity sourceLocale, AsyncCallback<Void> callback); 072 073 /** 074 * Loads the content definition for a given type.<p> 075 * 076 * @param entityId the entity id/URI 077 * @param clientId the container element client id if available 078 * @param editedLocaleEntity the edited locale entity 079 * @param skipPaths the paths to skip during locale synchronization 080 * @param settingPresets the presets for container element settings 081 * @param callback the asynchronous callback 082 */ 083 void loadDefinition( 084 String entityId, 085 String clientId, 086 CmsEntity editedLocaleEntity, 087 Collection<String> skipPaths, 088 Map<String, String> settingPresets, 089 AsyncCallback<CmsContentDefinition> callback); 090 091 /** 092 * Loads the content definition for a given type creating a new resource according to the new link and model file parameter.<p> 093 * 094 * @param entityId the entity id/URI 095 * @param clientId the container element client id if available 096 * @param newLink the new link 097 * @param modelFileId the optional model file id 098 * @param editContext the container page currently being edited (may be null) 099 * @param mainLocale the main language to copy in case the element language node does not exist yet 100 * @param mode the content creation mode 101 * @param postCreateHandler the post-create handler class name 102 * @param editHandlerData the edit handler data, if an edit handler is used for creating a new resource; null otherwise 103 * @param settingPresets the presets for container element settings 104 * @param editorStylesheet the path of the style sheet to use for the WYSIWYG editor 105 * @param callback the asynchronous callback 106 */ 107 void loadInitialDefinition( 108 String entityId, 109 String clientId, 110 String newLink, 111 CmsUUID modelFileId, 112 String editContext, 113 String mainLocale, 114 String mode, 115 String postCreateHandler, 116 CmsEditHandlerData editHandlerData, 117 Map<String, String> settingPresets, 118 String editorStylesheet, 119 AsyncCallback<CmsContentDefinition> callback); 120 121 /** 122 * Loads new entity definition.<p> 123 * This will load the entity representation of a new locale node.<p> 124 * 125 * @param entityId the entity id/URI 126 * @param clientId the container element client id if available 127 * @param editedLocaleEntity the edited locale entity 128 * @param skipPaths the paths to skip during locale synchronization 129 * @param settingPresets the presets for container element settings 130 * @param callback the asynchronous callback 131 */ 132 void loadNewDefinition( 133 String entityId, 134 String clientId, 135 CmsEntity editedLocaleEntity, 136 Collection<String> skipPaths, 137 Map<String, String> settingPresets, 138 AsyncCallback<CmsContentDefinition> callback); 139 140 /** 141 * Returns the content definition of the resource requested through parameter 'resource'.<p> 142 * 143 * @param callback the callback 144 */ 145 void prefetch(AsyncCallback<CmsContentDefinition> callback); 146 147 /** 148 * Saves and deletes the given entities. Returns the editor save result information.<p> 149 * 150 * @param lastEditedEntity the last edited entity 151 * @param clientId the container element client id if available 152 * @param deletedEntities the entity id's to delete 153 * @param skipPaths the paths to skip during locale synchronization 154 * @param lastEditedLocale the last edited locale 155 * @param clearOnSuccess <code>true</code> to unlock resource after saving 156 * @param failOnWarnings <code>true</code> to prevent saving when there are validation warnings 157 * @param callback the asynchronous callback 158 */ 159 void saveAndDeleteEntities( 160 CmsEntity lastEditedEntity, 161 String clientId, 162 List<String> deletedEntities, 163 Collection<String> skipPaths, 164 String lastEditedLocale, 165 boolean clearOnSuccess, 166 boolean failOnWarnings, 167 AsyncCallback<CmsSaveResult> callback); 168 169 /** 170 * Saves a value in an existing XML content.<p> 171 * 172 * @param contentId the structure id of the content 173 * @param contentPath the xpath of the value to set 174 * @param locale the locale in which to set the value 175 * @param value the value to set 176 * 177 * @param callback the callback to call with the result 178 */ 179 void saveValue(String contentId, String contentPath, String locale, String value, AsyncCallback<String> callback); 180 181 /** 182 * Validates the edited XML content, taking all current changes into account. Returns the validation result.<p> 183 * 184 * @param lastEditedEntity the last edited entity 185 * @param clientId the container element client id if available 186 * @param deletedEntities the entity id's to delete 187 * @param skipPaths the paths to skip during locale synchronization 188 * @param lastEditedLocale the last edited locale 189 * @param callback the asynchronous callback 190 */ 191 void validateEntities( 192 CmsEntity lastEditedEntity, 193 String clientId, 194 List<String> deletedEntities, 195 Collection<String> skipPaths, 196 String lastEditedLocale, 197 AsyncCallback<CmsValidationResult> callback); 198 199}