001 /** 002 * Copyright 2005-2012 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 * General constants used within the User Interface Framework 020 * 021 * @author Kuali Rice Team (rice.collab@kuali.org) 022 */ 023 public class UifConstants { 024 public static final String CONTROLLER_METHOD_DISPATCH_PARAMETER_NAME = "methodToCall"; 025 public static final String DEFAULT_MODEL_NAME = "KualiForm"; 026 public static final String COMPONENT_MODEL_NAME = "Component"; 027 public static final String DEFAULT_VIEW_NAME = "default"; 028 public static final String COMPONENT_ID_PREFIX = "u"; 029 030 // uncomment for freemarker testing 031 public static final String SPRING_VIEW_ID = "/krad/WEB-INF/ftl/uifRender"; 032 public static final String SPRING_REDIRECT_ID = "/krad/WEB-INF/ftl/redirect"; 033 public static final String REDIRECT_PREFIX = "redirect:"; 034 035 public static final String EL_PLACEHOLDER_PREFIX = "@{"; 036 public static final String EL_PLACEHOLDER_SUFFIX = "}"; 037 public static final String NO_BIND_ADJUST_PREFIX = "#form."; 038 public static final String DEFAULT_PATH_BIND_ADJUST_PREFIX = "#dp."; 039 public static final String FIELD_PATH_BIND_ADJUST_PREFIX = "#fp."; 040 public static final String LINE_PATH_BIND_ADJUST_PREFIX = "#lp."; 041 public static final String NODE_PATH_BIND_ADJUST_PREFIX = "#np."; 042 043 public static final String DATA_ATTRIBUTE_CONTROL_FOR = "controlFor"; 044 public static final String REQUEST_FORM = "requestForm"; 045 046 public static final String BLOCKUI_NAVOPTS = "navigation"; 047 public static final String BLOCKUI_REFRESHOPTS = "refresh"; 048 049 public static enum Position { 050 BOTTOM, LEFT, RIGHT, TOP 051 } 052 053 public static enum Order { 054 FIRST 055 } 056 057 public static enum NavigationType { 058 VERTICAL_MENU, HORIZONTAL_TABS 059 } 060 061 public static enum Orientation { 062 HORIZONTAL, VERTICAL 063 } 064 065 public static enum ViewType { 066 DEFAULT, DOCUMENT, INQUIRY, LOOKUP, MAINTENANCE, INCIDENT; 067 } 068 069 public static enum ControlType { 070 CHECKBOX, CHECKBOXGROUP, FILE, GROUP, HIDDEN, RADIOGROUP, SELECT, 071 TEXTAREA, TEXT, USER 072 } 073 074 public static enum WorkflowAction { 075 SAVE, ROUTE, BLANKETAPPROVE, APPROVE, DISAPPROVE, CANCEL, FYI, ACKNOWLEDGE, COMPLETE 076 } 077 078 /** 079 * Enum of return types. Used to return the type of response being sent by the server to the client. 080 */ 081 public enum AjaxReturnTypes { 082 UPDATEPAGE("update-page"), UPDATECOMPONENT("update-component"), REDIRECT("redirect"), 083 UPDATEVIEW("update-view"), UPDATECOLLECTION("update-collection"), 084 UPDATENONE("update-none"), DISPLAYLIGHTBOX("display-lightbox"); 085 086 private String key; 087 088 AjaxReturnTypes(String key) { 089 this.key = key; 090 } 091 092 public String getKey() { 093 return key; 094 } 095 096 public void setKey(String key) { 097 this.key = key; 098 } 099 } 100 101 public static class MethodToCallNames { 102 public static final String NAVIGATE = "navigate"; 103 public static final String START = "start"; 104 public static final String SAVE = "save"; 105 public static final String SEARCH = "search"; 106 public static final String CLOSE = "close"; 107 public static final String ADD_LINE = "addLine"; 108 public static final String DELETE_LINE = "deleteLine"; 109 public static final String REFRESH = "refresh"; 110 public static final String CANCEL = "cancel"; 111 } 112 113 public static class ActionEvents { 114 public static final String ADD_LINE = "addLine"; 115 public static final String ADD_BLANK_LINE = "addBlankLine"; 116 } 117 118 public static class LayoutComponentOptions { 119 public static final String COLUMN_SPAN = "colSpan"; 120 public static final String ROW_SPAN = "rowSpan"; 121 } 122 123 public static class IdSuffixes { 124 public static final String ADD_LINE = "_add"; 125 public static final String CONTROL = "_control"; 126 public static final String ATTRIBUTE = "_attribute"; 127 public static final String COMPARE = "_comp"; 128 public static final String CONSTRAINT = "_constraint"; 129 public static final String DIRECT_INQUIRY = "_directinquiry"; 130 public static final String ERRORS = "_errors"; 131 public static final String INSTRUCTIONAL = "_instructional"; 132 public static final String LINE = "_line"; 133 public static final String LABEL = "_label"; 134 public static final String FIELDSET = "_fieldset"; 135 public static final String SUB = "_sub"; 136 public static final String SUGGEST = "_suggest"; 137 public static final String QUICK_FINDER = "_quickfinder"; 138 } 139 140 public static class ViewPhases { 141 public static final String INITIALIZE = "INITIALIZE"; 142 public static final String APPLY_MODEL = "APPLY_MODEL"; 143 public static final String FINALIZE = "FINALIZE"; 144 } 145 146 public static class ViewStatus { 147 public static final String CREATED = "C"; 148 public static final String INITIALIZED = "I"; 149 public static final String FINAL = "F"; 150 } 151 152 public static class ContextVariableNames { 153 public static final String COLLECTION_GROUP = "collectionGroup"; 154 public static final String CONFIG_PROPERTIES = "ConfigProperties"; 155 public static final String COMPONENT = "component"; 156 public static final String CONSTANTS = "Constants"; 157 public static final String DOCUMENT_ENTRY = "DocumentEntry"; 158 public static final String INDEX = "index"; 159 public static final String IS_ADD_LINE = "isAddLine"; 160 public static final String LINE = "line"; 161 public static final String READONLY_LINE = "readOnlyLine"; 162 public static final String MANAGER = "manager"; 163 public static final String NODE = "node"; 164 public static final String NODE_PATH = "nodePath"; 165 public static final String PARENT = "parent"; 166 public static final String UIF_CONSTANTS = "UifConstants"; 167 public static final String VIEW = "view"; 168 public static final String VIEW_HELPER = "ViewHelper"; 169 public static final String PARENT_LINE = "parentLine"; 170 } 171 172 public static class TableToolsKeys { 173 public static final String AASORTING = "aaSorting"; 174 public static final String BAUTO_TYPE = "bAutoType"; 175 public static final String SDOM = "sDom"; 176 public static final String LANGUAGE = "oLanguage"; 177 public static final String EMPTY_TABLE = "sEmptyTable"; 178 public static final String AO_COLUMNS = "aoColumns"; 179 public static final String AO_COLUMN_DEFS = "aoColumnDefs"; 180 public static final String SORT_SKIP_ROWS = "aiSortingSkipRows"; 181 public static final String SORT_DATA_TYPE = "sSortDataType"; 182 public static final String SORTABLE = "bSortable"; 183 public static final String TARGETS = "aTargets"; 184 public static final String VISIBLE = "bVisible"; 185 public static final String SORT_TYPE = "sType"; 186 public static final String TABLE_SORT = "bSort"; 187 public static final String SAJAX_SOURCE = "sAjaxSource"; 188 public static final String FOOTER_CALLBACK = "fnFooterCallback"; 189 } 190 191 public static class TableToolsValues { 192 public static final String DOM_TEXT = "dom-text"; 193 public static final String DOM_SELECT = "dom-select"; 194 public static final String DOM_CHECK = "dom-checkbox"; 195 public static final String DOM_RADIO = "dom-radio"; 196 public static final String NUMERIC = "numeric"; 197 public static final String STRING = "string"; 198 public static final String DATE = "kuali_date"; 199 public static final String PERCENT = "kuali_percent"; 200 public static final String CURRENCY = "kuali_currency"; 201 public static final String TIMESTAMP = "kuali_timestamp"; 202 public static final String FALSE = "false"; 203 204 public static final int ADD_ROW_DEFAULT_INDEX = 0; 205 } 206 207 public static class ReordererOptionKeys { 208 public static final String SELECTORS = "selectors"; 209 public static final String MOVABLES = "movables"; 210 } 211 212 public static class TitleAppendTypes { 213 public static final String DASH = "dash"; 214 public static final String PARENTHESIS = "parenthesis"; 215 public static final String REPLACE = "replace"; 216 public static final String NONE = "none"; 217 } 218 219 public static class UrlParams { 220 public static final String ACTION_EVENT = "actionEvent"; 221 public static final String SHOW_HISTORY = "showHistory"; 222 public static final String SHOW_HOME = "showHome"; 223 public static final String FORM_KEY = "formKey"; 224 public static final String PAGE_ID = "pageId"; 225 public static final String HISTORY = "history"; 226 public static final String LAST_FORM_KEY = "lastFormKey"; 227 } 228 229 public static class Messages { 230 public static final String VALIDATION_MSG_KEY_PREFIX = "validation."; 231 public static final String STATE_PREFIX = "validation.statePrefix"; 232 } 233 234 public static class MessageKeys { 235 public static final String QUERY_DATA_NOT_FOUND = "query.dataNotFound"; 236 } 237 238 public static class ClientSideVariables { 239 public static final String KRAD_IMAGE_LOCATION = "kradImageLocation"; 240 public static final String KRAD_URL = "kradUrl"; 241 } 242 243 public static class RefreshCallerTypes { 244 public static final String LOOKUP = "LOOKUP"; 245 public static final String MULTI_VALUE_LOOKUP = "MULTI_VALUE_LOOKUP"; 246 public static final String QUESTION = "QUESTION"; 247 } 248 249 public static final class DataAttributes { 250 public static final String SERVER_MESSAGES = "server-messages"; 251 public static final String VALIDATION_MESSAGES = "validationMessages"; 252 public static final String SUMMARIZE = "summarize"; 253 public static final String DISPLAY_MESSAGES = "displayMessages"; 254 public static final String COLLAPSE_FIELD_MESSAGES = "collapseFieldMessages"; 255 public static final String DISPLAY_LABEL = "displayLabel"; 256 public static final String HAS_OWN_MESSAGES = "hasOwnMessages"; 257 public static final String PAGE_LEVEL = "pageLevel"; 258 public static final String FORCE_SHOW = "forceShow"; 259 public static final String SECTIONS = "sections"; 260 public static final String ORDER = "order"; 261 public static final String SERVER_ERRORS = "serverErrors"; 262 public static final String SERVER_WARNINGS = "serverWarnings"; 263 public static final String SERVER_INFO = "serverInfo"; 264 public static final String VIGNORE = "vignore"; 265 } 266 267 public static final class CaseConstraintOperators { 268 public static final String HAS_VALUE = "has_value"; 269 public static final String EQUALS = "equals"; 270 public static final String GREATER_THAN_EQUAL = "greater_than_equal"; 271 public static final String LESS_THAN_EQUAL = "less_than_equal"; 272 public static final String NOT_EQUAL = "not_equal"; 273 public static final String NOT_EQUALS = "not_equals"; 274 public static final String GREATER_THAN = "greater_than"; 275 public static final String LESS_THAN = "less_than"; 276 } 277 278 }