001    /**
002     * Copyright 2005-2014 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.rice.krad.uif;
017    
018    
019    /**
020     * General constants used within the User Interface Framework.
021     *
022     * @author Kuali Rice Team (rice.collab@kuali.org)
023     */
024    public class UifConstants {
025        public static final String CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME = "methodToCall";
026        public static final String DEFAULT_MODEL_NAME = "KualiForm";
027        public static final String COMPONENT_MODEL_NAME = "Component";
028        public static final String DEFAULT_VIEW_NAME = "default";
029        public static final String COMPONENT_ID_PREFIX = "u";
030        public static final String SUFFIX_SEPARATOR = "_";
031    
032        public static final String DEFAULT_THEMES_DIRECTORY = "/themes";
033        public static final String DEFAULT_IMAGES_DIRECTORY = "images";
034        public static final String DEFAULT_SCRIPTS_DIRECTORY = "scripts";
035        public static final String DEFAULT_STYLESHEETS_DIRECTORY = "stylesheets";
036        public static final String THEME_DERIVED_PROPERTY_FILE = "theme-derived.properties";
037        public static final String THEME_CSS_FILES = "themeCssFiles";
038        public static final String THEME_JS_FILES = "themeJsFiles";
039        public static final String THEME_DEV_JS_FILES = "devJsIncludes";
040        public static final String THEME_LESS_FILES = "themeLessFiles";
041    
042        public static final String SPRING_VIEW_ID = "/krad/WEB-INF/ftl/uifRender";
043        public static final String SPRING_REDIRECT_ID = "/krad/WEB-INF/ftl/redirect";
044        public static final String REDIRECT_PREFIX = "redirect:";
045    
046        public static final String EL_PLACEHOLDER_PREFIX = "@{";
047        public static final String EL_PLACEHOLDER_SUFFIX = "}";
048        public static final String NO_BIND_ADJUST_PREFIX = "#form.";
049        public static final String DEFAULT_PATH_BIND_ADJUST_PREFIX = "#dp.";
050        public static final String FIELD_PATH_BIND_ADJUST_PREFIX = "#fp.";
051        public static final String LINE_PATH_BIND_ADJUST_PREFIX = "#lp.";
052        public static final String NODE_PATH_BIND_ADJUST_PREFIX = "#np.";
053        public static final String STRING_TEMPLATE_PARAMETER_PLACEHOLDER = "@";
054    
055        public static final String SPACE = " ";
056    
057        public static final String REQUEST_FORM = "requestForm";
058    
059        public static final String BLOCKUI_NAVOPTS = "navigation";
060        public static final String BLOCKUI_REFRESHOPTS = "refresh";
061    
062        public static final String VALIDATE_VIEWS_ONBUILD = "validate.views.onbuild";
063    
064        public static final String MESSAGE_VIEW_ID = "Uif-MessageView";
065        public static final String SESSION_TIMEOUT_VIEW_ID = "Uif-SessionTimeoutView";
066        public static final String LOGGED_OUT_VIEW_ID = "Uif-LoggedOutView";
067        public static final String GROUP_VALIDATION_DEFAULTS_MAP_ID = "Uif-GroupValidationMessages-DataDefaults";
068        public static final String FIELD_VALIDATION_DEFAULTS_MAP_ID = "Uif-FieldValidationMessages-DataDefaults";
069        public static final String ACTION_DEFAULTS_MAP_ID = "Uif-Action-DataDefaults";
070        public static final String REQUIRED_INDICATOR_ID = "Uif-RequiredIndicator";
071        public static final String REQUIRED_NEXT_STATE_INDICATOR_ID = "Uif-RequiredIndicator-ForNextState";
072        public static final String REFERER = "Referer";
073        public static final String NO_RETURN = "NO_RETURN";
074    
075        public static final String EXPORT_FILE_NAME = "export.xml";
076        public static final String KUALI_FORM_ATTR = "KualiForm";
077    
078        public static final String ICON_ONLY_PLACEMENT = "ICON_ONLY";
079    
080        public static enum ReadOnlyListTypes {
081            DELIMITED, BREAK, OL, UL
082        }
083    
084        public static enum Position {
085            BOTTOM, LEFT, RIGHT, TOP
086        }
087    
088        public static enum Order {
089            FIRST, LINE_FIRST, NEXT_INPUT, SELF
090        }
091    
092        public static enum NavigationType {
093            VERTICAL_MENU, HORIZONTAL_TABS
094        }
095    
096        public static enum Orientation {
097            HORIZONTAL, VERTICAL
098        }
099    
100        public static enum ViewType {
101            DEFAULT, DOCUMENT, INQUIRY, LOOKUP, MAINTENANCE, INCIDENT, TRANSACTIONAL;
102        }
103    
104        public static enum ControlType {
105            CHECKBOX, CHECKBOXGROUP, FILE, GROUP, HIDDEN, RADIOGROUP, SELECT,
106            TEXTAREA, TEXT, USER
107        }
108    
109        public static enum WorkflowAction {
110            SAVE, ROUTE, BLANKETAPPROVE, APPROVE, DISAPPROVE, CANCEL, FYI, ACKNOWLEDGE, COMPLETE, SENDADHOCREQUESTS
111        }
112    
113        /**
114         * Enum of return types. Used to return the type of response being sent by the server to the client.
115         */
116        public enum AjaxReturnTypes {
117            UPDATEPAGE("update-page"), UPDATECOMPONENT("update-component"), REDIRECT("redirect"),
118            UPDATEVIEW("update-view"), UPDATENONE("update-none"), DISPLAYLIGHTBOX("display-lightbox"),
119            UPDATEDIALOG("update-dialog");
120    
121            private String key;
122    
123            AjaxReturnTypes(String key) {
124                this.key = key;
125            }
126    
127            public String getKey() {
128                return key;
129            }
130    
131            public void setKey(String key) {
132                this.key = key;
133            }
134        }
135    
136        public static enum WindowTargets {
137            _blank, _self, _parent, _top
138        }
139    
140        public static class ControllerMappings {
141            public static final String EXPORT = "export";
142        }
143    
144        public static class MethodToCallNames {
145            public static final String NAVIGATE = "navigate";
146            public static final String START = "start";
147            public static final String SAVE = "save";
148            public static final String SEARCH = "search";
149            public static final String CLOSE = "close";
150            public static final String ADD_LINE = "addLine";
151            public static final String DELETE_LINE = "deleteLine";
152            public static final String REFRESH = "refresh";
153            public static final String CANCEL = "cancel";
154            public static final String SESSION_TIMEOUT = "sessionTimeout";
155            public static final String TABLE_JSON = "tableJsonRetrieval";
156            public static final String TABLE_DATA = "tableDataRetrieval";
157            public static final String TABLE_XML = "tableXmlRetrieval";
158            public static final String TABLE_CSV = "tableCsvRetrieval";
159            public static final String TABLE_XLS = "tableXlsRetrieval";
160        }
161    
162        public static class ActionEvents {
163            public static final String ADD_LINE = "addLine";
164            public static final String ADD_BLANK_LINE = "addBlankLine";
165        }
166    
167        public static class LayoutComponentOptions {
168            public static final String COLUMN_SPAN = "colSpan";
169            public static final String ROW_SPAN = "rowSpan";
170        }
171    
172        public static class RowSelection {
173            public static final String ALL = "all";
174            public static final String ODD = "odd";
175            public static final String EVEN = "even";
176        }
177    
178        public static class IdSuffixes {
179            public static final String ACTION = "_act";
180            public static final String ADD_LINE = "_add";
181            public static final String CONTROL = "_control";
182            public static final String ATTRIBUTE = "_attribute";
183            public static final String COLUMN = "_c";
184            public static final String COLUMN_SORTS = "_columnSorts";
185            public static final String COMPARE = "_comp";
186            public static final String CONSTRAINT = "_constraint";
187            public static final String DETAIL_LINK = "_detLink";
188            public static final String DETAIL_GROUP = "_detGroup";
189            public static final String DIRECT_INQUIRY = "_directinquiry";
190            public static final String DISCLOSURE_CONTENT = "_disclosureContent";
191            public static final String ERRORS = "_errors";
192            public static final String INSTRUCTIONAL = "_instructional";
193            public static final String LINE = "_line";
194            public static final String LABEL = "_label";
195            public static final String FIELDSET = "_fieldset";
196            public static final String SUB = "_sub";
197            public static final String SUGGEST = "_suggest";
198            public static final String QUICK_FINDER = "_quickfinder";
199            public static final String SPAN = "_span";
200            public static final String TAB = "_tab";
201        }
202    
203        public static class ViewPhases {
204            public static final String INITIALIZE = "INITIALIZE";
205            public static final String APPLY_MODEL = "APPLY_MODEL";
206            public static final String FINALIZE = "FINALIZE";
207            public static final String RENDER = "RENDER";
208            public static final String PRE_PROCESS = "PRE_PROCESS";
209        }
210    
211        public static class ViewStatus {
212            public static final String CACHED = "X";
213            public static final String CREATED = "C";
214            public static final String INITIALIZED = "I";
215            public static final String MODEL_APPLIED = "M";
216            public static final String FINAL = "F";
217            public static final String RENDERED = "R";
218        }
219        
220        public static class PostMetadata {
221            public static final String INPUT_FIELD_ATTRIBUTE_QUERY = "attributeQuery";
222    
223            public static final String INPUT_FIELD_IS_UPPERCASE = "isUppercase";
224            public static final String LABEL = "label";
225            public static final String PATH = "path";
226            public static final String SIMPLE_CONSTRAINT = "simpleConstraint";
227            public static final String VALID_CHARACTER_CONSTRAINT = "validCharacterConstraint";
228            public static final String CASE_CONSTRAINT = "caseConstraint";
229            public static final String MUST_OCCUR_CONSTRAINTS = "mustOccurConstraints";
230            public static final String PREREQ_CONSTSTRAINTS = "prerequisiteConstraints";
231            public static final String BINDING_PATH = "bindingPath";
232            public static final String BINDING_INFO = "bindingInfo";
233            public static final String ADD_LINE_BINDING_INFO = "addLineBindingInfo";
234            public static final String ADD_LINE_PLACEMENT = "addLinePlacement";
235            public static final String COLL_DISPLAY_START = "displayStart";
236            public static final String COLL_DISPLAY_LENGTH = "displayLength";
237            public static final String COLL_LABEL = "collectionLabel";
238            public static final String COLL_LOOKUP_FIELD_CONVERSIONS = "collectionLookup.fieldConversions";
239            public static final String COLL_OBJECT_CLASS = "collectionObjectClass";
240            public static final String DUPLICATE_LINE_PROPERTY_NAMES = "duplicateLinePropertyNames";
241            public static final String DUPLICATE_LINE_LABEL_STRING = "duplicateLineLabelString";
242            public static final String STATE_MAPPING = "stateMapping";
243            public static final String STATE_OBJECT_BINDING_PATH = "stateObjectBindingPath";
244            public static final String SUGGEST = "suggest";
245            public static final String QUICKFINDER_FOCUS_ID = "quickfinderFocusId";
246            public static final String QUICKFINDER_JUMP_TO_ID = "quickfinderJumpToId";
247            public static final String FILTERABLE_LOOKUP_CRITERIA = "filterableLookupCriteria";
248        }
249    
250        public static class ContextVariableNames {
251            public static final String COLLECTION_GROUP = "collectionGroup";
252            public static final String CONFIG_PROPERTIES = "ConfigProperties";
253            public static final String COMPONENT = "component";
254            public static final String CONSTANTS = "Constants";
255            public static final String DOCUMENT_ENTRY = "DocumentEntry";
256            public static final String INDEX = "index";
257            public static final String IS_ADD_LINE = "isAddLine";
258            public static final String LINE = "line";
259            public static final String LINE_SUFFIX = "lineSuffix";
260            public static final String READONLY_LINE = "readOnlyLine";
261            public static final String MANAGER = "manager";
262            public static final String NODE = "node";
263            public static final String NODE_PATH = "nodePath";
264            public static final String PARENT = "parent";
265            public static final String THEME_IMAGES = "ThemeImages";
266            public static final String UIF_CONSTANTS = "UifConstants";
267            public static final String VIEW = "view";
268            public static final String VIEW_HELPER = "ViewHelper";
269            public static final String PARENT_LINE = "parentLine";
270        }
271    
272        public static class TableToolsKeys {
273            public static final String AASORTING = "aaSorting";
274            public static final String BAUTO_TYPE = "bAutoType";
275            public static final String BPROCESSING = "bProcessing";
276            public static final String BSERVER_SIDE = "bServerSide";
277            public static final String SDOM = "sDom";
278            public static final String CELL_CLASS = "sClass";
279            public static final String MDATA = "mDataProp";
280            public static final String LANGUAGE = "oLanguage";
281            public static final String EMPTY_TABLE = "sEmptyTable";
282            public static final String AO_COLUMNS = "aoColumns";
283            public static final String AO_COLUMN_DEFS = "aoColumnDefs";
284            public static final String SORT_SKIP_ROWS = "aiSortingSkipRows";
285            public static final String SORT_DATA_TYPE = "sSortDataType";
286            public static final String SORTABLE = "bSortable";
287            public static final String TARGETS = "aTargets";
288            public static final String VISIBLE = "bVisible";
289            public static final String SORT_TYPE = "sType";
290            public static final String TABLE_SORT = "bSort";
291            public static final String SAJAX_SOURCE = "sAjaxSource";
292            public static final String FOOTER_CALLBACK = "fnFooterCallback";
293            public static final String AA_DATA = "aaData";
294            public static final String DEFER_RENDER = "bDeferRender";
295            public static final String SDOWNLOAD_SOURCE = "sDownloadSource";
296            public static final String SERVER_PARAMS = "fnServerParams";
297        }
298    
299        public static class TableToolsValues {
300            public static final String DOM_TEXT = "dom-text";
301            public static final String DOM_SELECT = "dom-select";
302            public static final String DOM_CHECK = "dom-checkbox";
303            public static final String DOM_RADIO = "dom-radio";
304    
305            // sort types:
306    
307            public static final String NUMERIC = "numeric";
308            public static final String STRING = "string";
309            public static final String DATE = "kuali_date";
310            public static final String PERCENT = "kuali_percent";
311            public static final String CURRENCY = "kuali_currency";
312            public static final String TIMESTAMP = "kuali_timestamp";
313    
314            public static final String FALSE = "false";
315            public static final String TRUE = "true";
316    
317            public static final int ADD_ROW_DEFAULT_INDEX = 0;
318            public static final String JSON_TEMPLATE = "components/element/dataTablesJson.ftl";
319        }
320    
321        public static class TableLayoutValues {
322            public static final int ACTIONS_COLUMN_LEFT_INDEX = 1;
323            public static final int ACTIONS_COLUMN_RIGHT_INDEX = -1;
324        }
325    
326        public static class PageRequest {
327            public static final String PREV = "prev";
328            public static final String NEXT = "next";
329            public static final String FIRST = "first";
330            public static final String LAST = "last";
331            public static final String PAGE_NUMBER = "pageNumber";
332        }
333    
334        public static class TabOptionKeys {
335            public static final String ACTIVE = "active";
336        }
337    
338        public static class TitleAppendTypes {
339            public static final String DASH = "dash";
340            public static final String PARENTHESIS = "parenthesis";
341            public static final String REPLACE = "replace";
342            public static final String NONE = "none";
343        }
344    
345        public static class ComponentProperties {
346            public static final String HEADER_TEXT = "headerText";
347            public static final String DEFAULT_VALUE = "defaultValue";
348            public static final String DEFAULT_VALUES = "defaultValues";
349        }
350    
351        public static class UrlParams {
352            public static final String ACTION_EVENT = "actionEvent";
353            public static final String FORM_KEY = "formKey";
354            public static final String VIEW_ID = "viewId";
355            public static final String PAGE_ID = "pageId";
356            public static final String HISTORY = "history";
357            public static final String LAST_FORM_KEY = "lastFormKey";
358            public static final String LOGIN_USER = "__login_user";
359        }
360    
361        public static class Messages {
362            public static final String VALIDATION_MSG_KEY_PREFIX = "validation.";
363            public static final String STATE_PREFIX = "validation.statePrefix";
364        }
365    
366        public static class MessageKeys {
367            public static final String LOOKUP_RESULT_MESSAGES = "LookupResultMessages";
368            public static final String QUERY_DATA_NOT_FOUND = "query.dataNotFound";
369            public static final String OPTION_ALL = "option.all";
370        }
371    
372        public static class ClientSideVariables {
373            public static final String KRAD_IMAGE_LOCATION = "kradImageLocation";
374            public static final String KRAD_SCRIPT_CLEANUP = "scriptCleanup";
375            public static final String KRAD_URL = "kradUrl";
376            public static final String APPLICATION_URL = "applicationUrl";
377        }
378    
379        public static class RefreshCallerTypes {
380            public static final String LOOKUP = "LOOKUP";
381            public static final String MULTI_VALUE_LOOKUP = "MULTI_VALUE_LOOKUP";
382            public static final String QUESTION = "QUESTION";
383        }
384    
385        public static final class HistoryFlow {
386            public static final String HISTORY_MANAGER = "historyManager";
387            public static final String FLOW = "flow";
388            public static final String START = "start";
389            public static final String RETURN_TO_START = "returnToStart";
390            public static final String SEPARATOR = "@@";
391        }
392    
393        public static final class RoleTypes {
394            public static final String ACTION = "Action";
395            public static final String CONTROL = "Control";
396            public static final String DATA_SCRIPT = "dataScript";
397            public static final String INPUT_FIELD = "InputField";
398            public static final String GROUP = "Group";
399            public static final String GROUP_TOTAL = "groupTotal";
400            public static final String TOTAL = "total";
401            public static final String TOTALS_BLOCK = "totalsBlock";
402            public static final String PAGE = "Page";
403            public static final String PAGE_TOTAL = "pageTotal";
404            public static final String ROW_GROUPING = "RowGrouping";
405            public static final String VIEW = "View";
406        }
407    
408        public static final class DataAttributes {
409            public static final String TYPE = "type";
410            public static final String ROLE = "role";
411            public static final String REQ_INDICATOR = "req_indicator";
412            public static final String ONCLICK = "onClick";
413            public static final String SUBMIT_DATA = "submit_data";
414            public static final String HAS_MESSAGES = "has_messages";
415            public static final String SERVER_MESSAGES = "server_messages";
416            public static final String VALIDATION_MESSAGES = "validation_messages";
417            public static final String ACTION_DEFAULTS = "action_defaults";
418            public static final String GROUP_VALIDATION_DEFAULTS = "group_validation_defaults";
419            public static final String FIELD_VALIDATION_DEFAULTS = "field_validation_defaults";
420            public static final String MESSAGES_FOR = "messages_for";
421            public static final String PARENT = "parent";
422            public static final String SUMMARIZE = "summarize";
423            public static final String DISPLAY_MESSAGES = "displayMessages";
424            public static final String COLLAPSE_FIELD_MESSAGES = "collapseFieldMessages";
425            public static final String DISPLAY_LABEL = "displayLabel";
426            public static final String SHOW_PAGE_SUMMARY_HEADER = "showPageSummaryHeader";
427            public static final String DISPLAY_HEADER_SUMMARY = "displayHeaderSummary";
428            public static final String IS_TABLE_COLLECTION = "isTableCollection";
429            public static final String HAS_OWN_MESSAGES = "hasOwnMessages";
430            public static final String PAGE_LEVEL = "pageLevel";
431            public static final String FORCE_SHOW = "forceShow";
432            public static final String SECTIONS = "sections";
433            public static final String ORDER = "order";
434            public static final String RETURN = "return";
435            public static final String SERVER_ERRORS = "serverErrors";
436            public static final String SERVER_WARNINGS = "serverWarnings";
437            public static final String SERVER_INFO = "serverInfo";
438            public static final String VIGNORE = "vignore";
439            public static final String TOTAL = "total";
440            public static final String SKIP_TOTAL = "skip_total";
441            public static final String LABEL = "label";
442            public static final String GROUP = "group";
443            public static final String LABEL_FOR = "label_for";
444            public static final String CONTROL_FOR = "control_for";
445            public static final String ADD_CONTROLS = "add_controls";
446            public static final String HEADER_FOR = "header_for";
447            public static final String STICKY = "sticky";
448            public static final String STICKY_FOOTER = "sticky_footer";
449            public static final String DETAILS_DEFAULT_OPEN = "details_default_open";
450            public static final String TAB_FOR = "tabfor";
451            public static final String CHECKED = "checked";
452        }
453    
454        public static final String JS_REGEX_SPECIAL_CHARS = new String("$[\\^.|?*+()");
455    
456        public static final class ActionDataAttributes {
457            public static final String AJAX_SUBMIT = "ajaxSubmit";
458            public static final String SUCCESS_CALLBACK = "successCallback";
459            public static final String ERROR_CALLBACK = "errorCallback";
460            public static final String PRE_SUBMIT_CALL = "preSubmitCall";
461            public static final String LOADING_MESSAGE = "loadingMessage";
462            public static final String DISABLE_BLOCKING = "disableBlocking";
463            public static final String AJAX_RETURN_TYPE = "ajaxReturnType";
464            public static final String REFRESH_ID = "refreshId";
465            public static final String VALIDATE = "validate";
466            public static final String DIRTY_ON_ACTION = "dirtyOnAction";
467            public static final String CLEAR_DIRTY = "clearDirtyOnAction";
468            public static final String PERFORM_DIRTY_VALIDATION = "performDirtyValidation";
469            public static final String FOCUS_ID = "focusId";
470            public static final String JUMP_TO_ID = "jumpToId";
471            public static final String JUMP_TO_NAME = "jumpToName";
472        }
473    
474        public static final class CaseConstraintOperators {
475            public static final String HAS_VALUE = "has_value";
476            public static final String EQUALS = "equals";
477            public static final String GREATER_THAN_EQUAL = "greater_than_equal";
478            public static final String LESS_THAN_EQUAL = "less_than_equal";
479            public static final String NOT_EQUAL = "not_equal";
480            public static final String NOT_EQUALS = "not_equals";
481            public static final String GREATER_THAN = "greater_than";
482            public static final String LESS_THAN = "less_than";
483        }
484    
485        public static final class JsFunctions {
486            public static final String COLLECTION_LINE_CHANGED = "collectionLineChanged";
487            public static final String CREATE_LIGHTBOX_POST = "createLightBoxPost";
488            public static final String INITIALIZE_VIEW_STATE = "initializeViewState";
489            public static final String INITIALIZE_SESSION_TIMERS = "initializeSessionTimers";
490            public static final String REDIRECT = "redirect";
491            public static final String SET_CONFIG_PARM = "setConfigParam";
492            public static final String SET_VALUE = "setValue";
493            public static final String SHOW_GROWL = "showGrowl";
494        }
495    
496        public static final String EVENT_NAMESPACE = "uif";
497        
498        public static final String BOX_LAYOUT_HORIZONTAL_ITEM_CSS = "uif-boxLayoutHorizontalItem";
499        public static final String BOX_LAYOUT_VERTICAL_ITEM_CSS = "uif-boxLayoutVerticalItem";
500    
501        public static final class JsEvents {
502            public static final String DIALOG_RESPONSE = "dialogresponse." + EVENT_NAMESPACE;
503            public static final String SHOW_DIALOG = "showdialog." + EVENT_NAMESPACE;
504        }
505    
506        public static final class ConfigProperties {
507            public static final String KRAD_IMAGES_URL = "krad.externalizable.images.url";
508            public static final String KRAD_URL = "krad.url";
509        }
510    
511        public static final class FileExtensions {
512            public static final String CSS = ".css";
513            public static final String JS = ".js";
514            public static final String MIN = ".min";
515            public static final String LESS = ".less";
516        }
517    
518        public static final class WrapperTags {
519            public static final String DIV = "div";
520            public static final String SPAN = "span";
521            public static final String P = "p";
522            public static final String MAIN = "main";
523            public static final String SECTION = "section";
524            public static final String HEADER = "header";
525            public static final String FOOTER = "footer";
526            public static final String NAV = "nav";
527        }
528    }