View Javadoc

1   /**
2    * Copyright 2005-2015 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         public static final String DEFAULT_VALUE = "defaultValue";
294         public static final String DEFAULT_VALUES = "defaultValues";
295     }
296 
297     public static class UrlParams {
298         public static final String ACTION_EVENT = "actionEvent";
299         public static final String FORM_KEY = "formKey";
300         public static final String VIEW_ID = "viewId";
301         public static final String PAGE_ID = "pageId";
302         public static final String HISTORY = "history";
303         public static final String LAST_FORM_KEY = "lastFormKey";
304         public static final String LOGIN_USER = "__login_user";
305     }
306 
307     public static class Messages {
308         public static final String VALIDATION_MSG_KEY_PREFIX = "validation.";
309         public static final String STATE_PREFIX = "validation.statePrefix";
310     }
311 
312     public static class MessageKeys {
313         public static final String QUERY_DATA_NOT_FOUND = "query.dataNotFound";
314         public static final String OPTION_ALL = "option.all";
315     }
316 
317     public static class ClientSideVariables {
318         public static final String KRAD_IMAGE_LOCATION = "kradImageLocation";
319         public static final String KRAD_URL = "kradUrl";
320         public static final String APPLICATION_URL = "applicationUrl";
321     }
322 
323     public static class RefreshCallerTypes {
324         public static final String LOOKUP = "LOOKUP";
325         public static final String MULTI_VALUE_LOOKUP = "MULTI_VALUE_LOOKUP";
326         public static final String QUESTION = "QUESTION";
327     }
328 
329     public static final class HistoryFlow {
330         public static final String HISTORY_MANAGER = "historyManager";
331         public static final String FLOW = "flow";
332         public static final String START = "start";
333         public static final String RETURN_TO_START = "returnToStart";
334         public static final String SEPARATOR = "@@";
335     }
336 
337     public static final class RoleTypes {
338         public static final String CONTROL = "Control";
339         public static final String INPUT_FIELD = "InputField";
340         public static final String GROUP = "Group";
341         public static final String ROW_GROUPING = "RowGrouping";
342     }
343 
344     public static final class DataAttributes {
345         public static final String TYPE = "type";
346         public static final String ROLE = "role";
347         public static final String ONCLICK = "onclick";
348         public static final String SUBMIT_DATA = "submit_data";
349         public static final String HAS_MESSAGES = "has_messages";
350         public static final String SERVER_MESSAGES = "server_messages";
351         public static final String VALIDATION_MESSAGES = "validation_messages";
352         public static final String GROUP_VALIDATION_DEFAULTS = "group_validation_defaults";
353         public static final String FIELD_VALIDATION_DEFAULTS = "field_validation_defaults";
354         public static final String MESSAGES_FOR = "messages_for";
355         public static final String PARENT = "parent";
356         public static final String SUMMARIZE = "summarize";
357         public static final String DISPLAY_MESSAGES = "displayMessages";
358         public static final String COLLAPSE_FIELD_MESSAGES = "collapseFieldMessages";
359         public static final String DISPLAY_LABEL = "displayLabel";
360         public static final String SHOW_PAGE_SUMMARY_HEADER = "showPageSummaryHeader";
361         public static final String DISPLAY_HEADER_SUMMARY = "displayHeaderSummary";
362         public static final String IS_TABLE_COLLECTION = "isTableCollection";
363         public static final String HAS_OWN_MESSAGES = "hasOwnMessages";
364         public static final String PAGE_LEVEL = "pageLevel";
365         public static final String FORCE_SHOW = "forceShow";
366         public static final String SECTIONS = "sections";
367         public static final String ORDER = "order";
368         public static final String SERVER_ERRORS = "serverErrors";
369         public static final String SERVER_WARNINGS = "serverWarnings";
370         public static final String SERVER_INFO = "serverInfo";
371         public static final String VIGNORE = "vignore";
372         public static final String TOTAL = "total";
373         public static final String SKIP_TOTAL = "skip_total";
374         public static final String LABEL = "label";
375         public static final String GROUP = "group";
376         public static final String LABEL_FOR = "label_for";
377         public static final String CONTROL_FOR = "control_for";
378         public static final String ADD_CONTROLS = "add_controls";
379         public static final String HEADER_FOR = "header_for";
380         public static final String STICKY_FOOTER = "sticky_footer";
381         public static final String DETAILS_DEFAULT_OPEN = "details_default_open";
382         public static final String TAB_FOR = "tabfor";
383     }
384 
385     public static final class CaseConstraintOperators {
386         public static final String HAS_VALUE = "has_value";
387         public static final String EQUALS = "equals";
388         public static final String GREATER_THAN_EQUAL = "greater_than_equal";
389         public static final String LESS_THAN_EQUAL = "less_than_equal";
390         public static final String NOT_EQUAL = "not_equal";
391         public static final String NOT_EQUALS = "not_equals";
392         public static final String GREATER_THAN = "greater_than";
393         public static final String LESS_THAN = "less_than";
394     }
395 
396     public static final class JsFunctions {
397         public static final String INITIALIZE_VIEW_STATE = "initializeViewState";
398         public static final String INITIALIZE_SESSION_TIMERS = "initializeSessionTimers";
399         public static final String SET_CONFIG_PARM = "setConfigParam";
400         public static final String SET_VALUE = "setValue";
401     }
402 
403     public static final String EVENT_NAMESPACE = "uif";
404 
405     public static final class JsEvents {
406         public static final String DIALOG_RESPONSE = "dialogresponse." + EVENT_NAMESPACE;
407         public static final String SHOW_DIALOG = "showdialog." + EVENT_NAMESPACE;
408     }
409 
410     public static final class ConfigProperties {
411         public static final String KRAD_IMAGES_URL = "krad.externalizable.images.url";
412         public static final String KRAD_URL = "krad.url";
413     }
414 
415     public static final class FileExtensions {
416         public static final String CSS = ".css";
417         public static final String JS = ".js";
418         public static final String MIN = ".min";
419     }
420 
421 }