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