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