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.galleries.shared.rpc;
029
030import org.opencms.ade.galleries.shared.CmsGalleryActionInfo;
031import org.opencms.ade.galleries.shared.CmsGalleryConfiguration;
032import org.opencms.ade.galleries.shared.CmsGalleryDataBean;
033import org.opencms.ade.galleries.shared.CmsGalleryFolderBean;
034import org.opencms.ade.galleries.shared.CmsGallerySearchBean;
035import org.opencms.ade.galleries.shared.CmsResultItemBean;
036import org.opencms.ade.galleries.shared.CmsSitemapEntryBean;
037import org.opencms.ade.galleries.shared.CmsVfsEntryBean;
038import org.opencms.gwt.CmsRpcException;
039import org.opencms.util.CmsUUID;
040
041import java.util.List;
042import java.util.Set;
043
044import com.google.gwt.user.client.rpc.RemoteService;
045
046/**
047 * Handles all RPC services related to the gallery dialog.<p>
048 *
049 * @since 8.0.0
050 *
051 * @see org.opencms.ade.galleries.CmsGalleryService
052 * @see org.opencms.ade.galleries.shared.rpc.I_CmsGalleryService
053 * @see org.opencms.ade.galleries.shared.rpc.I_CmsGalleryServiceAsync
054 */
055public interface I_CmsGalleryService extends RemoteService {
056
057    /**
058     * Deletes the given resource.<p>
059     *
060     * @param resourcePath the resource path of the resource to delete
061     *
062     * @throws CmsRpcException if something goes wrong
063     */
064    void deleteResource(String resourcePath) throws CmsRpcException;
065
066    /**
067     * Loads the gallery configuration for the adeView mode.<p>
068     *
069     * @return the gallery configuration
070     */
071    CmsGalleryConfiguration getAdeViewModeConfiguration();
072
073    /**
074     * Returns the available galleries depending on the given resource types.<p>
075     *
076     *
077     * @param context URI of the current page or subsite
078     * @param resourceTypes the resource types
079     *
080     * @return the galleries
081     *
082     * @throws CmsRpcException if something goes wrong
083     */
084    List<CmsGalleryFolderBean> getGalleries(String context, List<String> resourceTypes) throws CmsRpcException;
085
086    /**
087     * Gets the gallery upload action information for the given path.
088     *
089     * @param sitePath the path of a gallery folder
090     * @return the gallery upload action information for that folder (may be null if no folder is found)
091     *
092     * @throws CmsRpcException if something goes wrong
093     */
094    CmsGalleryActionInfo getGalleryActionInfo(String sitePath) throws CmsRpcException;
095
096    /**
097     * Returns the resource info for a single resource.<p>
098     *
099     * @param path the resource path
100     * @param locale the content locale
101     *
102     * @return the resource info
103     *
104     * @throws CmsRpcException if something goes wrong
105     */
106    CmsResultItemBean getInfoForResource(String path, String locale) throws CmsRpcException;
107
108    /**
109     * Returns the initial data for the given gallery mode.<p>
110     *
111     * @param conf the gallery configuration
112     *
113     * @return the data bean
114     *
115     * @throws CmsRpcException if something goes wrong
116     */
117    CmsGalleryDataBean getInitialSettings(CmsGalleryConfiguration conf) throws CmsRpcException;
118
119    /**
120     * Performs an initial search based on the given data bean and the available parameters of the request.<p>
121     *
122     * @param data the data bean
123     *
124     * @return the search result
125     *
126     * @throws CmsRpcException if something goes wrong
127     */
128    CmsGallerySearchBean getSearch(CmsGalleryDataBean data) throws CmsRpcException;
129
130    /**
131     * Returns the gallery search object containing search results and the currant search parameter.<p>
132     *
133     * @param searchObj the current search object
134     * @return the search object containing search results
135     * @throws CmsRpcException is something goes wrong
136     */
137    CmsGallerySearchBean getSearch(CmsGallerySearchBean searchObj) throws CmsRpcException;
138
139    /**
140     * Returns the sub entries to the given sitemap path.<p>
141     *
142     * @param rootPath the root path
143     * @param isRoot <code>true</code> if the requested entry is the root entry
144     * @param filter the search filter string
145     *
146     * @return the sub entries
147     *
148     * @throws CmsRpcException if something goes wrong
149     */
150    List<CmsSitemapEntryBean> getSubEntries(String rootPath, boolean isRoot, String filter) throws CmsRpcException;
151
152    /**
153     * Gets the sub-folders of a folder.<p>
154     *
155     * @param path the path of a folder
156     *
157     * @return beans representing the sub-folders of the folder
158     *
159     * @throws CmsRpcException if something goes wrong
160     */
161    List<CmsVfsEntryBean> getSubFolders(String path) throws CmsRpcException;
162
163    /**
164     * Loads the root VFS entry bean for the given site root.
165     *
166     * @param path the site root
167     * @param filter the filter string
168     *
169     * @return the root VFS entry bean for the given site root
170     *
171     *  @throws CmsRpcException if something goes wrong
172     * */
173    CmsVfsEntryBean loadVfsEntryBean(String path, String filter) throws CmsRpcException;
174
175    /**
176     * Stores the result view type with the user.<p>
177     *
178     * @param resultViewType the result view type
179     */
180    void saveResultViewType(String resultViewType);
181
182    /**
183     * Saves the tree open state for a tree tab.<p>
184     *
185     * @param treeName the tree name for which to save the tree state
186     * @param treeToken the tree token for which to save the tree state
187     * @param siteRoot the site root
188     * @param openItems the set of structure ids of open tree items
189     *
190     * @throws CmsRpcException if something goes wrong
191     */
192    void saveTreeOpenState(String treeName, String treeToken, String siteRoot, Set<CmsUUID> openItems)
193    throws CmsRpcException;
194
195    /**
196     * Updates the offline indices.<p>
197     *
198     * @throws CmsRpcException if something goes wrong
199     */
200    void updateIndex() throws CmsRpcException;
201
202}