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;
029
030import com.google.gwt.user.client.rpc.IsSerializable;
031
032/**
033 * Shared constants interface.<p>
034 *
035 * @since 8.0.0
036 */
037public interface I_CmsGalleryProviderConstants {
038
039    /** Gallery mode constants. */
040    enum GalleryMode implements IsSerializable {
041
042        /** The advanced direct edit mode. */
043        ade(CmsGalleryTabConfiguration.resolve(CmsGalleryTabConfiguration.TC_ADE_ADD)),
044
045        /** The mode for showing all galleries in ADE. */
046        adeView(CmsGalleryTabConfiguration.resolve(CmsGalleryTabConfiguration.TC_SELECT_DOC)),
047
048        /** The wysiwyg editor mode. */
049        editor(CmsGalleryTabConfiguration.resolve(
050            CmsGalleryTabConfiguration.TC_SELECT_DOC) /* may be overwritten by configuration */),
051
052        /** The explorer mode. */
053        view(CmsGalleryTabConfiguration.resolve(CmsGalleryTabConfiguration.TC_SELECT_DOC)),
054
055        /** The widget mode. */
056        widget(CmsGalleryTabConfiguration.resolve(CmsGalleryTabConfiguration.TC_SELECT_DOC));
057
058        /** The configuration. */
059        private CmsGalleryTabConfiguration m_tabConfig;
060
061        /** Constructor.<p>
062         *
063         * @param tabConfig the tab configuration
064         */
065        private GalleryMode(CmsGalleryTabConfiguration tabConfig) {
066
067            m_tabConfig = tabConfig;
068        }
069
070        /**
071         * Returns the configured tabs.<p>
072         *
073         * @return the configured tabs
074         */
075        public GalleryTabId[] getTabs() {
076
077            GalleryTabId[] tabs = new GalleryTabId[m_tabConfig.getTabs().size()];
078            for (int i = 0; i < tabs.length; i++) {
079                tabs[i] = m_tabConfig.getTabs().get(i);
080            }
081            return tabs;
082        }
083
084    }
085
086    /** Tab ids used for tab configuration. */
087    public enum GalleryTabId implements IsSerializable {
088
089        /** The id for categories tab. */
090        cms_tab_categories,
091
092        /** The id for containerpage tab. */
093        cms_tab_containerpage,
094
095        /** The id for galleries tab. */
096        cms_tab_galleries,
097
098        /** The id for types tab. */
099        cms_tab_results,
100
101        /** The id for search tab. */
102        cms_tab_search,
103
104        /** The id for sitemap tab. */
105        cms_tab_sitemap,
106
107        /** The id for types tab. */
108        cms_tab_types,
109
110        /** The id for vfs-tree tab. */
111        cms_tab_vfstree;
112    }
113
114    /** Image parameteres. */
115    public enum ImageParams implements IsSerializable {
116
117        /** The last modified date. */
118        dateLastModified,
119
120        /** The image file name. */
121        file_name,
122
123        /** The file size. */
124        file_size,
125
126        /** Image type. */
127        file_type,
128
129        /** The image height. */
130        height,
131
132        /** The image path. */
133        path,
134
135        /** Property title. */
136        title,
137
138        /** The image width. */
139        width;
140
141    }
142
143    /** Sorting parameters. */
144    public enum SortParams implements IsSerializable {
145
146        /** Date last modified ascending. */
147        dateLastModified_asc,
148
149        /** Date last modified descending. */
150        dateLastModified_desc,
151
152        /** Resource path ascending sorting. */
153        path_asc,
154
155        /** Resource path descending sorting.*/
156        path_desc,
157
158        /** Title ascending sorting. */
159        title_asc,
160
161        /** Title descending sorting. */
162        title_desc,
163
164        /** Tree.*/
165        tree,
166
167        /** Resource type ascending sorting. */
168        type_asc,
169
170        /** Resource type descending sorting. */
171        type_desc;
172    }
173
174    /** The request attribute name for the close link. */
175    String ATTR_CLOSE_LINK = "closeLink";
176
177    /** Configuration key. */
178    String CONFIG_CURRENT_ELEMENT = "currentelement";
179
180    /** Configuration key. */
181    String CONFIG_GALLERY_MODE = "gallerymode";
182
183    /** Configuration key. */
184    String CONFIG_GALLERY_NAME = "galleryname";
185
186    /** Configuration key. */
187    String CONFIG_GALLERY_PATH = "gallerypath";
188
189    /** Configuration key. */
190    String CONFIG_GALLERY_STORAGE_PREFIX = "galleryprefix";
191
192    /** Configuration key. */
193    String CONFIG_GALLERY_TYPES = "gallerytypes";
194
195    /** Configuration key. */
196    String CONFIG_IMAGE_FORMAT_NAMES = "imageformatnames";
197
198    /** Configuration key. */
199    String CONFIG_IMAGE_FORMATS = "imageformats";
200
201    /** Configuration key. */
202    String CONFIG_LOCALE = "locale";
203
204    /** Configuration key. */
205    String CONFIG_REFERENCE_PATH = "resource";
206
207    /** Configuration key. */
208    String CONFIG_RESOURCE_TYPES = "resourcetypes";
209
210    /** Configuration key. */
211    String CONFIG_SEARCH_TYPES = "searchtypes";
212
213    /** Configuration key. */
214    String CONFIG_SHOW_SITE_SELECTOR = "showsiteselector";
215
216    /** Configuration key. */
217    String CONFIG_START_FOLDER = "startfolder";
218
219    /** Configuration key. */
220    String CONFIG_START_SITE = "startsite";
221
222    /** Configuration key. */
223    String CONFIG_TAB_CONFIG = "tabconfig";
224
225    /** The key for the tree token. */
226    String CONFIG_TREE_TOKEN = "treeToken";
227
228    /** Configuration key. */
229    String CONFIG_UPLOAD_FOLDER = "uploadfolder";
230
231    /** Configuration key. */
232    String CONFIG_USE_FORMATS = "useformats";
233
234    /** The id for the HTML div containing the gallery dialog. */
235    String GALLERY_DIALOG_ID = "galleryDialog";
236
237    /** The widget field id. */
238    String KEY_FIELD_ID = "fieldId";
239
240    /** The widget field id hash. */
241    String KEY_HASH_ID = "hashId";
242
243    /** The key for the flag which controls whether the select button should be shown. */
244    String KEY_SHOW_SELECT = "showSelect";
245
246    /** The parameter used to tell the gallery dialog to use the standard set of resource types from the VfsFileWidget. */
247    String PARAM_USE_LINK_DEFAULT_TYPES = "useLinkDefaultTypes";
248
249    /** The folder resource type name. */
250    String RESOURCE_TYPE_FOLDER = "folder";
251
252    /** Sitemap tree state session attribute name prefix. */
253    String TREE_SITEMAP = "sitemap";
254
255    /** VFS tree state session attribute name prefix. */
256    String TREE_VFS = "vfs";
257
258    /** Path to the host page. */
259    String VFS_OPEN_GALLERY_PATH = "/system/workplace/commons/gallery.jsp";
260
261    /** Option to enable/disable gallery selection. */
262    String CONFIG_GALLERIES_SELECTABLE = "galleriesSelectable";
263
264    /** Option to disable result selection if set to false. */
265    String CONFIG_RESULTS_SELECTABLE = "resultsSelectable";
266
267}