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     * 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 final String VALIDATE_VIEWS_ONBUILD = "validate.views.onbuild";
050    
051        public static final String MESSAGE_VIEW_ID = "Uif-MessageView";
052    
053        public static enum ReadOnlyListTypes {
054            DELIMITED, BREAK, OL, UL
055        }
056    
057        public static enum Position {
058            BOTTOM, LEFT, RIGHT, TOP
059        }
060    
061        public static enum Order {
062            FIRST, LINE_FIRST, NEXT_INPUT, SELF
063        }
064    
065        public static enum NavigationType {
066            VERTICAL_MENU, HORIZONTAL_TABS
067        }
068    
069        public static enum Orientation {
070            HORIZONTAL, VERTICAL
071        }
072    
073        public static enum ViewType {
074            DEFAULT, DOCUMENT, INQUIRY, LOOKUP, MAINTENANCE, INCIDENT, TRANSACTIONAL;
075        }
076    
077        public static enum ControlType {
078            CHECKBOX, CHECKBOXGROUP, FILE, GROUP, HIDDEN, RADIOGROUP, SELECT,
079            TEXTAREA, TEXT, USER
080        }
081    
082        public static enum WorkflowAction {
083            SAVE, ROUTE, BLANKETAPPROVE, APPROVE, DISAPPROVE, CANCEL, FYI, ACKNOWLEDGE, COMPLETE
084        }
085    
086        /**
087         * Enum of return types. Used to return the type of response being sent by the server to the client.
088         */
089        public enum AjaxReturnTypes {
090            UPDATEPAGE("update-page"), UPDATECOMPONENT("update-component"), REDIRECT("redirect"),
091            UPDATEVIEW("update-view"), UPDATECOLLECTION("update-collection"),
092            UPDATENONE("update-none"), DISPLAYLIGHTBOX("display-lightbox"),
093            UPDATEDIALOG("update-dialog");
094    
095            private String key;
096    
097            AjaxReturnTypes(String key) {
098                this.key = key;
099            }
100    
101            public String getKey() {
102                return key;
103            }
104    
105            public void setKey(String key) {
106                this.key = key;
107            }
108        }
109    
110        public static class MethodToCallNames {
111            public static final String NAVIGATE = "navigate";
112            public static final String START = "start";
113            public static final String SAVE = "save";
114            public static final String SEARCH = "search";
115            public static final String CLOSE = "close";
116            public static final String ADD_LINE = "addLine";
117            public static final String DELETE_LINE = "deleteLine";
118            public static final String REFRESH = "refresh";
119            public static final String CANCEL = "cancel";
120        }
121    
122        public static class ActionEvents {
123            public static final String ADD_LINE = "addLine";
124            public static final String ADD_BLANK_LINE = "addBlankLine";
125        }
126    
127        public static class LayoutComponentOptions {
128            public static final String COLUMN_SPAN = "colSpan";
129            public static final String ROW_SPAN = "rowSpan";
130        }
131    
132        public static class IdSuffixes {
133            public static final String ADD_LINE = "_add";
134            public static final String CONTROL = "_control";
135            public static final String ATTRIBUTE = "_attribute";
136            public static final String COMPARE = "_comp";
137            public static final String CONSTRAINT = "_constraint";
138            public static final String DIRECT_INQUIRY = "_directinquiry";
139            public static final String ERRORS = "_errors";
140            public static final String INSTRUCTIONAL = "_instructional";
141            public static final String LINE = "_line";
142            public static final String LABEL = "_label";
143            public static final String FIELDSET = "_fieldset";
144            public static final String SUB = "_sub";
145            public static final String SUGGEST = "_suggest";
146            public static final String QUICK_FINDER = "_quickfinder";
147            public static final String SPAN = "_span";
148        }
149    
150        public static class ViewPhases {
151            public static final String INITIALIZE = "INITIALIZE";
152            public static final String APPLY_MODEL = "APPLY_MODEL";
153            public static final String FINALIZE = "FINALIZE";
154        }
155    
156        public static class ViewStatus {
157            public static final String CREATED = "C";
158            public static final String INITIALIZED = "I";
159            public static final String FINAL = "F";
160        }
161    
162        public static class ContextVariableNames {
163            public static final String COLLECTION_GROUP = "collectionGroup";
164            public static final String CONFIG_PROPERTIES = "ConfigProperties";
165            public static final String COMPONENT = "component";
166            public static final String CONSTANTS = "Constants";
167            public static final String DOCUMENT_ENTRY = "DocumentEntry";
168            public static final String INDEX = "index";
169            public static final String IS_ADD_LINE = "isAddLine";
170            public static final String LINE = "line";
171            public static final String LINE_SUFFIX = "lineSuffix";
172            public static final String READONLY_LINE = "readOnlyLine";
173            public static final String MANAGER = "manager";
174            public static final String NODE = "node";
175            public static final String NODE_PATH = "nodePath";
176            public static final String PARENT = "parent";
177            public static final String THEME_IMAGES = "ThemeImages";
178            public static final String UIF_CONSTANTS = "UifConstants";
179            public static final String VIEW = "view";
180            public static final String VIEW_HELPER = "ViewHelper";
181            public static final String PARENT_LINE = "parentLine";
182        }
183    
184        public static class TableToolsKeys {
185            public static final String AASORTING = "aaSorting";
186            public static final String BAUTO_TYPE = "bAutoType";
187            public static final String SDOM = "sDom";
188            public static final String LANGUAGE = "oLanguage";
189            public static final String EMPTY_TABLE = "sEmptyTable";
190            public static final String AO_COLUMNS = "aoColumns";
191            public static final String AO_COLUMN_DEFS = "aoColumnDefs";
192            public static final String SORT_SKIP_ROWS = "aiSortingSkipRows";
193            public static final String SORT_DATA_TYPE = "sSortDataType";
194            public static final String SORTABLE = "bSortable";
195            public static final String TARGETS = "aTargets";
196            public static final String VISIBLE = "bVisible";
197            public static final String SORT_TYPE = "sType";
198            public static final String TABLE_SORT = "bSort";
199            public static final String SAJAX_SOURCE = "sAjaxSource";
200            public static final String FOOTER_CALLBACK = "fnFooterCallback";
201        }
202    
203        public static class TableToolsValues {
204            public static final String DOM_TEXT = "dom-text";
205            public static final String DOM_SELECT = "dom-select";
206            public static final String DOM_CHECK = "dom-checkbox";
207            public static final String DOM_RADIO = "dom-radio";
208            public static final String NUMERIC = "numeric";
209            public static final String STRING = "string";
210            public static final String DATE = "kuali_date";
211            public static final String PERCENT = "kuali_percent";
212            public static final String CURRENCY = "kuali_currency";
213            public static final String TIMESTAMP = "kuali_timestamp";
214            public static final String FALSE = "false";
215    
216            public static final int ADD_ROW_DEFAULT_INDEX = 0;
217        }
218    
219        public static class ReordererOptionKeys {
220            public static final String SELECTORS = "selectors";
221            public static final String MOVABLES = "movables";
222        }
223    
224        public static class TitleAppendTypes {
225            public static final String DASH = "dash";
226            public static final String PARENTHESIS = "parenthesis";
227            public static final String REPLACE = "replace";
228            public static final String NONE = "none";
229        }
230    
231        public static class UrlParams {
232            public static final String ACTION_EVENT = "actionEvent";
233            public static final String SHOW_HISTORY = "showHistory";
234            public static final String SHOW_HOME = "showHome";
235            public static final String FORM_KEY = "formKey";
236            public static final String PAGE_ID = "pageId";
237            public static final String HISTORY = "history";
238            public static final String LAST_FORM_KEY = "lastFormKey";
239        }
240    
241        public static class Messages {
242            public static final String VALIDATION_MSG_KEY_PREFIX = "validation.";
243            public static final String STATE_PREFIX = "validation.statePrefix";
244        }
245    
246        public static class MessageKeys {
247            public static final String QUERY_DATA_NOT_FOUND = "query.dataNotFound";
248        }
249    
250        public static class ClientSideVariables {
251            public static final String KRAD_IMAGE_LOCATION = "kradImageLocation";
252            public static final String KRAD_URL = "kradUrl";
253        }
254    
255        public static class RefreshCallerTypes {
256            public static final String LOOKUP = "LOOKUP";
257            public static final String MULTI_VALUE_LOOKUP = "MULTI_VALUE_LOOKUP";
258            public static final String QUESTION = "QUESTION";
259        }
260    
261        public static final class DataAttributes {
262            public static final String SERVER_MESSAGES = "server-messages";
263            public static final String VALIDATION_MESSAGES = "validationMessages";
264            public static final String SUMMARIZE = "summarize";
265            public static final String DISPLAY_MESSAGES = "displayMessages";
266            public static final String COLLAPSE_FIELD_MESSAGES = "collapseFieldMessages";
267            public static final String DISPLAY_LABEL = "displayLabel";
268            public static final String HAS_OWN_MESSAGES = "hasOwnMessages";
269            public static final String PAGE_LEVEL = "pageLevel";
270            public static final String FORCE_SHOW = "forceShow";
271            public static final String SECTIONS = "sections";
272            public static final String ORDER = "order";
273            public static final String SERVER_ERRORS = "serverErrors";
274            public static final String SERVER_WARNINGS = "serverWarnings";
275            public static final String SERVER_INFO = "serverInfo";
276            public static final String VIGNORE = "vignore";
277        }
278    
279        public static final class CaseConstraintOperators {
280            public static final String HAS_VALUE = "has_value";
281            public static final String EQUALS = "equals";
282            public static final String GREATER_THAN_EQUAL = "greater_than_equal";
283            public static final String LESS_THAN_EQUAL = "less_than_equal";
284            public static final String NOT_EQUAL = "not_equal";
285            public static final String NOT_EQUALS = "not_equals";
286            public static final String GREATER_THAN = "greater_than";
287            public static final String LESS_THAN = "less_than";
288        }
289        
290        public static final class JsFunctions {
291            public static final String INITIALIZE_VIEW_STATE = "initializeViewState";
292            public static final String SET_CONFIG_PARM = "setConfigParam";
293        }
294    
295        public static final class ConfigProperties {
296            public static final String KRAD_IMAGES_URL = "krad.externalizable.images.url";
297            public static final String KRAD_URL = "krad.url";
298        }
299    
300    }