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.CmsImageInfoBean;
031import org.opencms.ade.galleries.shared.CmsResourceInfoBean;
032import org.opencms.gwt.CmsRpcException;
033
034import java.util.Map;
035
036import com.google.gwt.user.client.rpc.RemoteService;
037
038/**
039 * Handles the common RPC services related to the gallery preview dialog.<p>
040 *
041 * @since 8.0.0
042 *
043 * @see org.opencms.ade.galleries.CmsPreviewService
044 * @see org.opencms.ade.galleries.shared.rpc.I_CmsPreviewService
045 * @see org.opencms.ade.galleries.shared.rpc.I_CmsPreviewServiceAsync
046 */
047public interface I_CmsPreviewService extends RemoteService {
048
049    /**
050     * Returns the image resource data to be displayed in the preview dialog.<p>
051     *
052     * @param resourcePath the resource path
053     * @param locale the content locale
054     *
055     * @return the image resource data
056     *
057     * @throws CmsRpcException  if something goes wrong
058     */
059    CmsImageInfoBean getImageInfo(String resourcePath, String locale) throws CmsRpcException;
060
061    /**
062     * Returns the data to be displayed in the preview dialog.<p>
063     *
064     * @param resourcePath the path to the selected resource
065     * @param locale the content locale
066     *
067     * @return the preview data
068     *
069     * @throws CmsRpcException if something goes wrong
070     */
071    CmsResourceInfoBean getResourceInfo(String resourcePath, String locale) throws CmsRpcException;
072
073    /**
074     * Saves the given properties to the resource and returns the data to be displayed in the preview dialog.<p>
075     *
076     * @param resourcePath the path to the selected resource
077     * @param locale the content locale
078     * @param properties a map with the key/value pairs of the properties to be updated
079     *
080     * @return the updates preview data
081     *
082     * @throws CmsRpcException if something goes wrong
083     */
084    CmsImageInfoBean updateImageProperties(String resourcePath, String locale, Map<String, String> properties)
085    throws CmsRpcException;
086
087    /**
088     * Saves the given properties to the resource and returns the data to be displayed in the preview dialog.<p>
089     *
090     * @param resourcePath the path to the selected resource
091     * @param locale the content locale
092     * @param properties a map with the key/value pairs of the properties to be updated
093     *
094     * @return the updates preview data
095     *
096     * @throws CmsRpcException if something goes wrong
097     */
098    CmsResourceInfoBean updateResourceProperties(String resourcePath, String locale, Map<String, String> properties)
099    throws CmsRpcException;
100
101}