View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.uif;
17  
18  /**
19   * General constants used within the User Interface Framework
20   *
21   * @author Kuali Rice Team (rice.collab@kuali.org)
22   */
23  public class UifConstants {
24      public static final String CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME = "methodToCall";
25      public static final String DEFAULT_MODEL_NAME = "KualiForm";
26      public static final String COMPONENT_MODEL_NAME = "Component";
27      public static final String DEFAULT_VIEW_NAME = "default";
28      public static final String COMPONENT_ID_PREFIX = "u";
29  
30      public static final String DEFAULT_THEMES_DIRECTORY = "/themes";
31      public static final String DEFAULT_IMAGES_DIRECTORY = "images";
32      public static final String DEFAULT_SCRIPTS_DIRECTORY = "scripts";
33      public static final String DEFAULT_STYLESHEETS_DIRECTORY = "stylesheets";
34      public static final String THEME_DERIVED_PROPERTY_FILE = "theme-derived.properties";
35      public static final String THEME_CSS_FILES = "themeCssFiles";
36      public static final String THEME_JS_FILES = "themeJsFiles";
37  
38      // uncomment for freemarker testing
39      public static final String SPRING_VIEW_ID = "/krad/WEB-INF/ftl/uifRender";
40      public static final String SPRING_REDIRECT_ID = "/krad/WEB-INF/ftl/redirect";
41      public static final String REDIRECT_PREFIX = "redirect:";
42  
43      public static final String EL_PLACEHOLDER_PREFIX = "@{";
44      public static final String EL_PLACEHOLDER_SUFFIX = "}";
45      public static final String NO_BIND_ADJUST_PREFIX = "#form.";
46      public static final String DEFAULT_PATH_BIND_ADJUST_PREFIX = "#dp.";
47      public static final String FIELD_PATH_BIND_ADJUST_PREFIX = "#fp.";
48      public static final String LINE_PATH_BIND_ADJUST_PREFIX = "#lp.";
49      public static final String NODE_PATH_BIND_ADJUST_PREFIX = "#np.";
50      public static final String STRING_TEMPLATE_PARAMETER_PLACEHOLDER = "@";
51  
52      public static final String SPACE = " ";
53  
54      public static final String REQUEST_FORM = "requestForm";
55  
56      public static final String BLOCKUI_NAVOPTS = "navigation";
57      public static final String BLOCKUI_REFRESHOPTS = "refresh";
58  
59      public static final String VALIDATE_VIEWS_ONBUILD = "validate.views.onbuild";
60  
61      public static final String MESSAGE_VIEW_ID = "Uif-MessageView";
62      public static final String SESSION_TIMEOUT_VIEW_ID = "Uif-SessionTimeoutView";
63      public static final String LOGGED_OUT_VIEW_ID = "Uif-LoggedOutView";
64      public static final String GROUP_VALIDATION_DEFAULTS_MAP_ID = "Uif-GroupValidationMessages-DataDefaults";
65      public static final String FIELD_VALIDATION_DEFAULTS_MAP_ID = "Uif-FieldValidationMessages-DataDefaults";
66      public static final String REFERER = "Referer";
67      public static final String NO_RETURN = "NO_RETURN";
68  
69      public static enum ReadOnlyListTypes {
70          DELIMITED, BREAK, OL, UL
71      }
72  
73      public static enum Position {
74          BOTTOM, LEFT, RIGHT, TOP
75      }
76  
77      public static enum Order {
78          FIRST, LINE_FIRST, NEXT_INPUT, SELF
79      }
80  
81      public static enum NavigationType {
82          VERTICAL_MENU, HORIZONTAL_TABS
83      }
84  
85      public static enum Orientation {
86          HORIZONTAL, VERTICAL
87      }
88  
89      public static enum ViewType {
90          DEFAULT, DOCUMENT, INQUIRY, LOOKUP, MAINTENANCE, INCIDENT, TRANSACTIONAL;
91      }
92  
93      public static enum ControlType {
94          CHECKBOX, CHECKBOXGROUP, FILE, GROUP, HIDDEN, RADIOGROUP, SELECT,
95          TEXTAREA, TEXT, USER
96      }
97  
98      public static enum WorkflowAction {
99          SAVE, ROUTE, BLANKETAPPROVE, APPROVE, DISAPPROVE, CANCEL, FYI, ACKNOWLEDGE, COMPLETE, SENDADHOCREQUESTS
100     }
101 
102     /**
103      * Enum of return types. Used to return the type of response being sent by the server to the client.
104      */
105     public enum AjaxReturnTypes {
106         UPDATEPAGE("update-page"), UPDATECOMPONENT("update-component"), REDIRECT("redirect"),
107         UPDATEVIEW("update-view"), UPDATECOLLECTION("update-collection"),
108         UPDATENONE("update-none"), DISPLAYLIGHTBOX("display-lightbox"),
109         UPDATEDIALOG("update-dialog");
110 
111         private String key;
112 
113         AjaxReturnTypes(String key) {
114             this.key = key;
115         }
116 
117         public String getKey() {
118             return key;
119         }
120 
121         public void setKey(String key) {
122             this.key = key;
123         }
124     }
125 
126     public static class MethodToCallNames {
127         public static final String NAVIGATE = "navigate";
128         public static final String START = "start";
129         public static final String SAVE = "save";
130         public static final String SEARCH = "search";
131         public static final String CLOSE = "close";
132         public static final String ADD_LINE = "addLine";
133         public static final String DELETE_LINE = "deleteLine";
134         public static final String REFRESH = "refresh";
135         public static final String CANCEL = "cancel";
136         public static final String SESSION_TIMEOUT = "sessionTimeout";
137         public static final String TABLE_JSON = "tableJsonRetrieval";
138         public static final String TABLE_DATA = "tableDataRetrieval";
139         public static final String TABLE_XML = "tableXmlRetrieval";
140         public static final String TABLE_CSV = "tableCsvRetrieval";
141         public static final String TABLE_XLS = "tableXlsRetrieval";
142     }
143 
144     public static class ActionEvents {
145         public static final String ADD_LINE = "addLine";
146         public static final String ADD_BLANK_LINE = "addBlankLine";
147     }
148 
149     public static class LayoutComponentOptions {
150         public static final String COLUMN_SPAN = "colSpan";
151         public static final String ROW_SPAN = "rowSpan";
152     }
153 
154     public static class RowSelection {
155         public static final String ALL = "all";
156         public static final String ODD = "odd";
157         public static final String EVEN = "even";
158     }
159 
160     public static class IdSuffixes {
161         public static final String ADD_LINE = "_add";
162         public static final String CONTROL = "_control";
163         public static final String ATTRIBUTE = "_attribute";
164         public static final String COLUMN = "_c";
165         public static final String COLUMN_SORTS = "_columnSorts";
166         public static final String COMPARE = "_comp";
167         public static final String CONSTRAINT = "_constraint";
168         public static final String DETAIL_LINK = "_detLink";
169         public static final String DETAIL_GROUP = "_detGroup";
170         public static final String DISCLOSURE_CONTENT = "_disclosureContent";
171         public static final String DIRECT_INQUIRY = "_directinquiry";
172         public static final String ERRORS = "_errors";
173         public static final String INSTRUCTIONAL = "_instructional";
174         public static final String LINE = "_line";
175         public static final String LABEL = "_label";
176         public static final String FIELDSET = "_fieldset";
177         public static final String SUB = "_sub";
178         public static final String SUGGEST = "_suggest";
179         public static final String QUICK_FINDER = "_quickfinder";
180         public static final String SPAN = "_span";
181         public static final String TAB = "_tab";
182     }
183 
184     public static class ViewPhases {
185         public static final String INITIALIZE = "INITIALIZE";
186         public static final String APPLY_MODEL = "APPLY_MODEL";
187         public static final String FINALIZE = "FINALIZE";
188     }
189 
190     public static class ViewStatus {
191         public static final String CREATED = "C";
192         public static final String INITIALIZED = "I";
193         public static final String FINAL = "F";
194     }
195 
196     public static class ContextVariableNames {
197         public static final String COLLECTION_GROUP = "collectionGroup";
198         public static final String CONFIG_PROPERTIES = "ConfigProperties";
199         public static final String COMPONENT = "component";
200         public static final String CONSTANTS = "Constants";
201         public static final String DOCUMENT_ENTRY = "DocumentEntry";
202         public static final String INDEX = "index";
203         public static final String IS_ADD_LINE = "isAddLine";
204         public static final String LINE = "line";
205         public static final String LINE_SUFFIX = "lineSuffix";
206         public static final String READONLY_LINE = "readOnlyLine";
207         public static final String MANAGER = "manager";
208         public static final String NODE = "node";
209         public static final String NODE_PATH = "nodePath";
210         public static final String PARENT = "parent";
211         public static final String THEME_IMAGES = "ThemeImages";
212         public static final String UIF_CONSTANTS = "UifConstants";
213         public static final String VIEW = "view";
214         public static final String VIEW_HELPER = "ViewHelper";
215         public static final String PARENT_LINE = "parentLine";
216     }
217 
218     public static class TableToolsKeys {
219         public static final String AASORTING = "aaSorting";
220         public static final String BAUTO_TYPE = "bAutoType";
221         public static final String BPROCESSING = "bProcessing";
222         public static final String BSERVER_SIDE = "bServerSide";
223         public static final String SDOM = "sDom";
224         public static final String CELL_CLASS = "sClass";
225         public static final String MDATA = "mDataProp";
226         public static final String LANGUAGE = "oLanguage";
227         public static final String EMPTY_TABLE = "sEmptyTable";
228         public static final String AO_COLUMNS = "aoColumns";
229         public static final String AO_COLUMN_DEFS = "aoColumnDefs";
230         public static final String SORT_SKIP_ROWS = "aiSortingSkipRows";
231         public static final String SORT_DATA_TYPE = "sSortDataType";
232         public static final String SORTABLE = "bSortable";
233         public static final String TARGETS = "aTargets";
234         public static final String VISIBLE = "bVisible";
235         public static final String SORT_TYPE = "sType";
236         public static final String TABLE_SORT = "bSort";
237         public static final String SAJAX_SOURCE = "sAjaxSource";
238         public static final String FOOTER_CALLBACK = "fnFooterCallback";
239         public static final String AA_DATA = "aaData";
240         public static final String DEFER_RENDER = "bDeferRender";
241         public static final String SDOWNLOAD_SOURCE = "sDownloadSource";
242     }
243 
244     public static class TableToolsValues {
245         public static final String DOM_TEXT = "dom-text";
246         public static final String DOM_SELECT = "dom-select";
247         public static final String DOM_CHECK = "dom-checkbox";
248         public static final String DOM_RADIO = "dom-radio";
249 
250         // sort types:
251 
252         public static final String NUMERIC = "numeric";
253         public static final String STRING = "string";
254         public static final String DATE = "kuali_date";
255         public static final String PERCENT = "kuali_percent";
256         public static final String CURRENCY = "kuali_currency";
257         public static final String TIMESTAMP = "kuali_timestamp";
258 
259         public static final String FALSE = "false";
260         public static final String TRUE = "true";
261 
262         public static final int ADD_ROW_DEFAULT_INDEX = 0;
263         public static final String JSON_TEMPLATE = "dataTablesJson.ftl";
264     }
265 
266     public static class TableLayoutValues {
267         public static final int ACTIONS_COLUMN_LEFT_INDEX = 1;
268         public static final int ACTIONS_COLUMN_RIGHT_INDEX = -1;
269     }
270 
271     public static class PageRequest {
272         public static final String PREV = "prev";
273         public static final String NEXT = "next";
274         public static final String FIRST = "first";
275         public static final String LAST = "last";
276         public static final String PAGE_NUMBER = "pageNumber";
277         public static final String DISPLAY_START_PROP = "#displayStart";
278     }
279 
280     public static class TabOptionKeys {
281         public static final String ACTIVE = "active";
282     }
283 
284     public static class TitleAppendTypes {
285         public static final String DASH = "dash";
286         public static final String PARENTHESIS = "parenthesis";
287         public static final String REPLACE = "replace";
288         public static final String NONE = "none";
289     }
290 
291     public static class ComponentProperties {
292         public static final String HEADER_TEXT = "headerText";
293     }
294 
295     public static class UrlParams {
296         public static final String ACTION_EVENT = "actionEvent";
297         public static final String FORM_KEY = "formKey";
298         public static final String VIEW_ID = "viewId";
299         public static final String PAGE_ID = "pageId";
300         public static final String HISTORY = "history";
301         public static final String LAST_FORM_KEY = "lastFormKey";
302         public static final String LOGIN_USER = "__login_user";
303     }
304 
305     public static class Messages {
306         public static final String VALIDATION_MSG_KEY_PREFIX = "validation.";
307         public static final String STATE_PREFIX = "validation.statePrefix";
308     }
309 
310     public static class MessageKeys {
311         public static final String QUERY_DATA_NOT_FOUND = "query.dataNotFound";
312         public static final String OPTION_ALL = "option.all";
313     }
314 
315     public static class ClientSideVariables {
316         public static final String KRAD_IMAGE_LOCATION = "kradImageLocation";
317         public static final String KRAD_URL = "kradUrl";
318         public static final String APPLICATION_URL = "applicationUrl";
319     }
320 
321     public static class RefreshCallerTypes {
322         public static final String LOOKUP = "LOOKUP";
323         public static final String MULTI_VALUE_LOOKUP = "MULTI_VALUE_LOOKUP";
324         public static final String QUESTION = "QUESTION";
325     }
326 
327     public static final class HistoryFlow {
328         public static final String HISTORY_MANAGER = "historyManager";
329         public static final String FLOW = "flow";
330         public static final String START = "start";
331         public static final String RETURN_TO_START = "returnToStart";
332         public static final String SEPARATOR = "@@";
333     }
334 
335     public static final class RoleTypes {
336         public static final String CONTROL = "Control";
337         public static final String INPUT_FIELD = "InputField";
338         public static final String GROUP = "Group";
339         public static final String ROW_GROUPING = "RowGrouping";
340     }
341 
342     public static final class DataAttributes {
343         public static final String TYPE = "type";
344         public static final String ROLE = "role";
345         public static final String ONCLICK = "onclick";
346         public static final String SUBMIT_DATA = "submit_data";
347         public static final String HAS_MESSAGES = "has_messages";
348         public static final String SERVER_MESSAGES = "server_messages";
349         public static final String VALIDATION_MESSAGES = "validation_messages";
350         public static final String GROUP_VALIDATION_DEFAULTS = "group_validation_defaults";
351         public static final String FIELD_VALIDATION_DEFAULTS = "field_validation_defaults";
352         public static final String MESSAGES_FOR = "messages_for";
353         public static final String PARENT = "parent";
354         public static final String SUMMARIZE = "summarize";
355         public static final String DISPLAY_MESSAGES = "displayMessages";
356         public static final String COLLAPSE_FIELD_MESSAGES = "collapseFieldMessages";
357         public static final String DISPLAY_LABEL = "displayLabel";
358         public static final String SHOW_PAGE_SUMMARY_HEADER = "showPageSummaryHeader";
359         public static final String DISPLAY_HEADER_SUMMARY = "displayHeaderSummary";
360         public static final String IS_TABLE_COLLECTION = "isTableCollection";
361         public static final String HAS_OWN_MESSAGES = "hasOwnMessages";
362         public static final String PAGE_LEVEL = "pageLevel";
363         public static final String FORCE_SHOW = "forceShow";
364         public static final String SECTIONS = "sections";
365         public static final String ORDER = "order";
366         public static final String SERVER_ERRORS = "serverErrors";
367         public static final String SERVER_WARNINGS = "serverWarnings";
368         public static final String SERVER_INFO = "serverInfo";
369         public static final String VIGNORE = "vignore";
370         public static final String TOTAL = "total";
371         public static final String SKIP_TOTAL = "skip_total";
372         public static final String LABEL = "label";
373         public static final String GROUP = "group";
374         public static final String LABEL_FOR = "label_for";
375         public static final String CONTROL_FOR = "control_for";
376         public static final String ADD_CONTROLS = "add_controls";
377         public static final String HEADER_FOR = "header_for";
378         public static final String STICKY_FOOTER = "sticky_footer";
379         public static final String DETAILS_DEFAULT_OPEN = "details_default_open";
380         public static final String TAB_FOR = "tabfor";
381     }
382 
383     public static final class CaseConstraintOperators {
384         public static final String HAS_VALUE = "has_value";
385         public static final String EQUALS = "equals";
386         public static final String GREATER_THAN_EQUAL = "greater_than_equal";
387         public static final String LESS_THAN_EQUAL = "less_than_equal";
388         public static final String NOT_EQUAL = "not_equal";
389         public static final String NOT_EQUALS = "not_equals";
390         public static final String GREATER_THAN = "greater_than";
391         public static final String LESS_THAN = "less_than";
392     }
393 
394     public static final class JsFunctions {
395         public static final String INITIALIZE_VIEW_STATE = "initializeViewState";
396         public static final String INITIALIZE_SESSION_TIMERS = "initializeSessionTimers";
397         public static final String SET_CONFIG_PARM = "setConfigParam";
398         public static final String SET_VALUE = "setValue";
399     }
400 
401     public static final String EVENT_NAMESPACE = "uif";
402 
403     public static final class JsEvents {
404         public static final String DIALOG_RESPONSE = "dialogresponse." + EVENT_NAMESPACE;
405         public static final String SHOW_DIALOG = "showdialog." + EVENT_NAMESPACE;
406     }
407 
408     public static final class ConfigProperties {
409         public static final String KRAD_IMAGES_URL = "krad.externalizable.images.url";
410         public static final String KRAD_URL = "krad.url";
411     }
412 
413     public static final class FileExtensions {
414         public static final String CSS = ".css";
415         public static final String JS = ".js";
416         public static final String MIN = ".min";
417     }
418 
419 }