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