001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (C) Alkacon Software (https://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: https://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: https://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.gwt.shared;
029
030/**
031 * Common constants needed for client side code.<p>
032 */
033public final class CmsGwtConstants {
034
035    /** Parameters for favorite dialog. */
036    public static final class Favorites {
037
038        /** Request parameter. */
039        public static final String PARAM_DETAIL = "detail";
040
041        /** Request parameter. */
042        public static final String PARAM_PAGE = "page";
043
044        /** Request parameter. */
045        public static final String PARAM_PROJECT = "project";
046
047        /** Request parameter. */
048        public static final String PARAM_SITE = "site";
049    }
050
051    /**
052    * Quick launcher constants.<p>
053    */
054    public static final class QuickLaunch {
055
056        /** Context string. */
057        public static final String CONTEXT_PAGE = "page";
058
059        /** Context string. */
060        public static final String CONTEXT_SITEMAP = "sitemap";
061
062        /** Quick launch id. */
063        public static final String Q_ACCOUNTMANAGER = "accountmanager";
064
065        /** Quick launch id. */
066        public static final String Q_EXPLORER = "explorer";
067
068        /** Quick launch id. */
069        public static final String Q_LAUNCHPAD = "launchpad";
070
071        /** Quick launch id. */
072        public static final String Q_PAGEEDITOR = "pageeditor";
073
074        /** Quick launch id. */
075        public static final String Q_SITEMAP = "sitemap";
076
077        /** Quick launch id. */
078        public static final String Q_WORKPLACETOOLS = "workplacetools";
079
080    }
081
082    public static final class RpcContext {
083
084        public static final String PAGE_ID = "pageId";
085    }
086
087    public static final String PARAM_TARGET_LOCALE = "targetLocale";
088
089    /** Context menu action id. */
090    public static final String ACTION_EDITSMALLELEMENTS = "editsmallelements";
091
092    /** Context menu action parameter dialog id. */
093    public static final String ACTION_PARAM_DIALOG_ID = "dialogId";
094
095    /** Context menu action id. */
096    public static final String ACTION_SELECTELEMENTVIEW = "selectelementview";
097
098    /** Context menu action id. */
099    public static final String ACTION_SHOWLOCALE = "showlocale";
100
101    /** Context menu action id. */
102    public static final String ACTION_TEMPLATECONTEXTS = "templatecontexts";
103
104    /** Context menu action id. */
105    public static final String ACTION_TEMPLATECONTEXTS_ADVANCED = "templatecontexts_advanced";
106
107    /** Context menu action id. */
108    public static final String ACTION_VIEW_ONLINE = "viewonline";
109
110    /** Attribute for container id. */
111    public static final String ATTR_CONTAINER_ID = "ATTR_CONTAINER_ID";
112
113    /** JS property for accessing content editor locale from nested iframes. */
114    public static final String ATTR_CONTENT_EDITOR_LOCALE = "cmsContentEditorLocale";
115
116    /** Collector data attribute name. */
117    public static final String ATTR_DATA_COLLECTOR = "data-oc-collector";
118
119    /** Container data attribute name. */
120    public static final String ATTR_DATA_CONTAINER = "data-oc-container";
121
122    /** Editable data attribute name. */
123    public static final String ATTR_DATA_EDITABLE = "data-oc-editable";
124
125    /** Element data attribute name. */
126    public static final String ATTR_DATA_ELEMENT = "data-oc-element";
127
128    /** Content field data attribute name. */
129    public static final String ATTR_DATA_FIELD = "data-oc-field";
130
131    /** Entity id data attribute name. */
132    public static final String ATTR_DATA_ID = "data-oc-id";
133
134    /** Name for the attribute used to store list-add metadata. */
135    public static final String ATTR_DATA_LISTADD = "data-oc-listadd";
136
137    /** Marker attribute for dead links. */
138    public static final String ATTR_DEAD_LINK_MARKER = "data-oc-broken-link";
139
140    /** Key for the element id attribute. */
141    public static final String ATTR_ELEMENT_ID = "ATTR_ELEMENT_ID";
142
143    public static final String ATTR_EXTENSIONS = "ext";
144
145    /** Element data to enable / disable the favorite button. */
146    public static final String ATTR_FAVORITE = "fav";
147
148    /** Key for the page root path attribute. */
149    public static final String ATTR_PAGE_ROOT_PATH = "ATTR_PAGE_ROOT_PATH";
150
151    /** Data URL for 'broken image' image. */
152    public static final String BROKEN_IMAGE = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjE3MCIgdmlld0JveD0iMCAwIDIwMCAxNzAiPgo8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJhIiB4MT0iMCIgeDI9IjAiIHkxPSIwIiB5Mj0iMSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2RkZCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Y4ZjhmOCIvPjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0iYiIgeDE9IjAiIHgyPSIwIiB5MT0iMCIgeTI9IjEiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiM5OTkiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNkZGQiLz48L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+CjxyZWN0IGZpbGw9InVybCgjYSkiIHdpZHRoPSIyMDAiIGhlaWdodD0iMTcwIiByeT0iMCIvPgo8cGF0aCBmaWxsPSJ1cmwoI2IpIiBkPSJNNDIuMyAzNS41YTEuNiAxLjYgMCAwIDAtMS42IDEuN3YzaC04LjJjLTEuNSAwLTIuNiAxLTIuNiAyLjNWMTI0YzAgMS41IDEuMSAyLjQgMi42IDIuNEg5NmwuNC0xMS40YTMyLjEgMzIuMSAwIDAgMS0zMS4zLTMyIDMyLjEgMzIuMSAwIDAgMSAzMC41LTMybC00LjgtMTEuMi0zMS4zLjN2LTIuOWMwLTEtLjgtMS42LTEuNi0xLjZINDJabTY0IDUgMS4zIDEyYTMyLjEgMzIuMSAwIDAgMSAyMiAzMC41IDMyLjEgMzIuMSAwIDAgMS0yOSAzMS42TDk3IDEyNi4ybDYwLjQgOC4zYzEuMy4yIDIuNi0uOCAyLjctMmwxMC04MC44Yy4xLTEuNS0uOC0yLjYtMi4xLTIuN2wtNjEuNy04Ljd6bS02NS44IDQuOGgxOC42YzEuMyAwIDIuMyAxIDIuMyAyLjJ2N2MwIDEuMi0xIDIuMi0yLjMgMi4ySDQwLjVjLTEuMyAwLTIuMi0xLTIuMi0yLjN2LTYuOWMwLTEuMSAxLTIuMiAyLjItMi4yek05Ny43IDYxYTIyLjIgMjIuMiAwIDAgMC0xLjYgMGw3LjcgMTYuNy0xMi42IDE1LjYgNi44IDEyYTIyLjIgMjIuMiAwIDAgMCAyMi0yMi4yQTIyLjIgMjIuMiAwIDAgMCA5Ny43IDYxWm0tMTQgNS4xYTIyLjIgMjIuMiAwIDAgMC04IDE3IDIyLjIgMjIuMiAwIDAgMCAxNi44IDIxLjZsLTYuOS0xMC4yTDk1IDc3LjcgODMuNyA2NloiLz4KPC9zdmc+";
153
154    /** Name of the Javascript callback used to handle property changes triggered from the locale compare view. */
155    public static final String CALLBACK_HANDLE_CHANGED_PROPERTIES = "cmsHandleChangedProperties";
156
157    /** Javascript function name for showing the locale compare view. */
158    public static final String CALLBACK_REFRESH_LOCALE_COMPARISON = "cmsRefreshLocaleComparison";
159
160    /** The CSS class name used for the DOM elements containing collector information. */
161    public static final String CLASS_COLLECTOR_INFO = "oc-collector-info";
162
163    /** CSS class for containers inflated due to an element dragged into them that is of lower height than the empty container HTML. */
164    public static final String CLASS_CONTAINER_INFLATED = "oc-container-inflated";
165
166    /** CSS class for elements in detail containers which are used to transfer their settings to the detail eleemnt. */
167    public static final String CLASS_DETAIL_PREVIEW = "oc-detail-preview";
168
169    /** The CSS class name for data elements which precede the direct editable elements. */
170    public static final String CLASS_EDITABLE = "oc-editable";
171
172    /** The CSS class name for elements which end the direct editable elements. */
173    public static final String CLASS_EDITABLE_END = CLASS_EDITABLE + "-end";
174
175    /** The CSS class name for elements which mark elements to be skipped during direct edit. */
176    public static final String CLASS_EDITABLE_SKIP = CLASS_EDITABLE + "-skip";
177
178    /** Class for dnd placeholders which are too big. */
179    public static final String CLASS_PLACEHOLDER_TOO_BIG = "oc-placeholder-too-big";
180
181    /** Name for configuration  setting to limit collector results while computing publish lists for collectors. */
182    public static final String COLLECTOR_PUBLISH_LIST_LIMIT = "collectorPublishListLimit";
183
184    /** The context type sitemap toolbar. */
185    public static final String CONTEXT_TYPE_APP_TOOLBAR = "appToolbar";
186
187    /** The context type containerpage toolbar. */
188    public static final String CONTEXT_TYPE_CONTAINERPAGE_TOOLBAR = "containerpageToolbar";
189
190    /** The context type file table. */
191    public static final String CONTEXT_TYPE_FILE_TABLE = "fileTable";
192
193    /** The context type sitemap toolbar. */
194    public static final String CONTEXT_TYPE_SITEMAP_TOOLBAR = "sitemapToolbar";
195
196    /** Special 'type' name (that isn't actually a type) used to mark default detail pages in the sitemap configuration. */
197    public static final String DEFAULT_DETAILPAGE_TYPE = "##DEFAULT##";
198
199    public static final String EDITOR_PAGE_ID = "pageId";
200
201    /** A HTML comment that will cause the container page editor to reload the page if it is contained in HTML which is reloaded after the element or its settings have been edited. */
202    public static final String FORMATTER_RELOAD_MARKER = "<!--FORMATTER_RELOAD_g3jf9o0n-->";
203
204    /** Separator for separating the main part of a formatter key from the sub-key (the part in front of the separator will be used as a key if there is no formatter for the full key). */
205    public static final String FORMATTER_SUBKEY_SEPARATOR = "#";
206
207    /** Sub-path for the page unlock service. */
208    public static final String HANDLER_UNLOCK_PAGE = "/unlockPage";
209
210    /** Sub-path for the session update handler. */
211    public static final String HANDLER_UPDATE_SESSION = "/updateSession";
212
213    /** The settings widget name for hidden entries. */
214    public static final String HIDDEN_SETTINGS_WIDGET_NAME = "hidden";
215
216    /** Element id for locale comparison view. */
217    public static final String ID_LOCALE_COMPARISON = "cmsLocaleComparison";
218
219    /** Id of the element ussed to  display the sitemap header from Vaadin code. */
220    public static final String ID_LOCALE_HEADER_CONTAINER = "locale-header-container";
221
222    /** Json field name for typograf locale passed to input widget. */
223    public static final String JSON_INPUT_LOCALE = "locale";
224
225    /** Json field name for enabling typograf, passed to input widget. */
226    public static final String JSON_INPUT_TYPOGRAF = "typograf";
227
228    /** Field name for the internal textarea configuration. */
229    public static final String JSON_TEXTAREA_CONFIG = "config";
230
231    /** Field name for the internal textarea configuration. */
232    public static final String JSON_TEXTAREA_LOCALE = "locale";
233
234    /**
235     * Session storage key for memorizing the last opened container page.
236     */
237    public static final String LAST_CONTAINER_PAGE_ID = "lastContainerPageId";
238
239    /** Name of the Javascript callback used to open the locale comparison view. */
240    public static final String LOCALECOMPARE_EDIT_PROPERTIES = "cmsLocaleCompareEditProperties";
241
242    /** The maximum DND placeholder height. */
243    public static final int MAX_PLACEHOLDER_HEIGHT = 300;
244
245    /** Name of the meta tag used to set the editor stylesheet. */
246    public static final String META_EDITOR_STYLESHEET = "cms-editor-stylesheet";
247
248    /** Parameter to pass detail id to page editor context menu actions. */
249    public static final String PARAM_ADE_DETAIL_ID = "adeDetailId";
250
251    /** Parameter for the button left position. */
252    public static final String PARAM_BUTTON_LEFT = "__buttonLeft";
253
254    /** Parameter to disable direct edit. */
255    public static final String PARAM_DISABLE_DIRECT_EDIT = "__disableDirectEdit";
256
257    /** Name of the request parameter used to store the redirect target after login. */
258    public static final String PARAM_LOGIN_REDIRECT = "loginRedirect";
259
260    /** Parameter to force a specific template context. */
261    public static final String PARAM_TEMPLATE_CONTEXT = "__templateContext";
262
263    /** Marker for the 'prefill' context menu action. */
264    public static final String PREFILL_MENU_PLACEHOLDER = "PREFILL_MENU_PLACEHOLDER";
265
266    /** Name of property containing focal point for images. */
267    public static final String PROPERTY_IMAGE_FOCALPOINT = "image.focalpoint";
268
269    /** Tab id for the preference dialog. */
270    public static final String TAB_BASIC = "basic";
271
272    /** Tab id for the preference dialog. */
273    public static final String TAB_EXTENDED = "extended";
274
275    /** Tab id for the preference dialog. */
276    public static final String TAB_HIDDEN = "hidden";
277
278    /** Tag name for the edit button bars injected into the page HTML in the container page editor. */
279    public static final String TAG_OC_EDITPOINT = "oc-editpoint";
280
281    /** Custom tag for elements which were hidden because of mismatching device constraint. */
282    public static final String TAG_OC_HIDDEN_ELEMENT = "oc-hidden-element";
283
284    /** Tag name for the list-add metadata injected into the page. */
285    public static final String TAG_OC_LISTADD = "oc-listadd";
286
287    /** Action placeholder for the template contexts menu option. */
288    public static final String TEMPLATECONTEXT_MENU_PLACEHOLDER = "templatecontexts";
289
290    /** Type name for container pages. */
291    public static final String TYPE_CONTAINERPAGE = "containerpage";
292
293    /** The resource icon CSS class prefix. */
294    public static final String TYPE_ICON_CLASS = "cms_type_icon";
295
296    /** The image resource type name. */
297    public static final String TYPE_IMAGE = "image";
298
299    /** Name for the pseudo-type 'modelgroup'. */
300    public static final String TYPE_MODELGROUP = "modelgroup";
301
302    /** Name for the pseudo-type 'modelgroupreuse'. */
303    public static final String TYPE_MODELGROUP_COPY = "modelgroupcopy";
304
305    /** Name for the pseudo-type 'modelgrouppage'. */
306    public static final String TYPE_MODELGROUP_PAGE = "modelgrouppage";
307
308    /** Name for the type 'modelpage'. */
309    public static final String TYPE_MODELPAGE = "modelpage";
310
311    /** Name for the pseudo-type 'navlevel'. */
312    public static final String TYPE_NAVLEVEL = "navlevel";
313
314    /** Part of the URL used to unlock files. */
315    public static final String UNLOCK_FILE_PREFIX = "/unlockFile/";
316
317    /** Name of Javascript variable used to hold the structure id of the currently selected locale's root folder in the sitemap editor's locale comparison mode. */
318    public static final String VAR_LOCALE_ROOT = "cmsLocaleCompareRoot";
319
320    public static final String AUGMENTATION_TRANSLATION = "translation";
321
322    /**
323     * Hide constructor.<p>
324     */
325    private CmsGwtConstants() {
326
327        // nop
328
329    }
330
331    /**
332     * Maximum DND placeholder height, as a string for stylesheets.
333     *
334     * @return the maximum DND placeholder height as a string
335     */
336    public static String getPlaceholderMaxHeight() {
337
338        return MAX_PLACEHOLDER_HEIGHT + "px";
339    }
340}