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