001    /*
002     * Copyright 2000-2004 The Apache Software Foundation.
003     * 
004     * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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    
017    
018    package org.apache.commons.scaffold.lang;
019    
020    
021    /**
022     * Language and programming tokens.
023     *
024     * @author Ted Husted
025     * @author Steve Raeburn
026     * @version $Revision: 155464 $ $Date: 2005-02-26 13:26:54 +0000 (Sat, 26 Feb 2005) $
027     */
028    public final class Tokens {
029    
030    
031        /**
032         * The wild card character to represent a blank select.
033         */
034        public static String PARAM_ANY = "*";
035    
036    
037        /**
038         * The equality indicator to represent name = value.
039         */
040        public static String PARAM_EQUALS = " = ";
041    
042    
043    // ---------------------------------------------------- Attribute Keys
044    
045        /**
046         * Default key for a result or list object.
047         */
048        public static final String LIST_KEY   = "LIST";
049    
050    
051        /**
052         * Default key for application properties.
053         */
054        public static final String PROPERTIES_KEY = "PROPERTIES";
055    
056    
057    
058    // ---------------------------------------- Error and exception phrases
059    
060        public static final String ABSTRACT_EXCEPTION =
061            "Required method not implemented.";
062    
063        public static final String INVALID_SCOPE =
064            " invalid scope.";
065    
066    // --------------------------------------- Common Action Mapping tokens
067    
068        public static final String CANCEL    = "cancel";
069        public static final String CONTINUE  = "continue";
070        public static final String DISPATCH  = "dispatch";
071        public static final String DONE      = "done";
072        public static final String EMPTY     = "empty";
073        public static final String ERROR     = "error";
074        public static final String EXIT      = "exit";
075        public static final String FAILURE   = "failure";
076        public static final String FORWARD   = "forward";
077        public static final String GET_TOKEN = "getToken";
078        public static final String LOGON     = "logon";
079        public static final String LOGOFF    = "logoff";
080        public static final String MENU      = "menu";
081        public static final String NEXT      = "next";
082        public static final String PREVIOUS  = "previous";
083        public static final String SET_TOKEN = "setToken";
084        public static final String SUCCESS   = "success";
085        public static final String WELCOME   = "welcome";
086    
087        public static final String APPLICATION  = "application";
088        public static final String RESULT   = "result";
089        public static final String REQUEST  = "request";
090        public static final String SESSION  = "session";
091    
092        public static final String PATH     = "path";
093        public static final String OK       = "ok";
094    
095    
096    // --------------------------------- Common Application Resource tokens
097    
098        public static final String ERROR_GENERAL =
099            "error.general";
100    
101        public static final String ERROR_DETAIL =
102            "error.detail";
103    
104        public static final String ERROR_CANCEL =
105            "error.cancel";
106    
107        public static final String ERROR_TOKEN =
108            "error.token";
109    
110        public static final String ERROR_DISPATCH =
111            "error.dispatch";
112    
113        public static final String ERROR_DISPATCH_RETURN =
114            "error.dispatch.return";
115    
116        public static final String ERRORS_REQUIRED =
117            "errors.required";
118    
119        public static final String HELPER_ACCESS_ERROR =
120            "data.access.error";
121    
122        public static final String DATA_ACCESS_DENIED =
123            "data.access.denied";
124    
125        public static final String DATA_ACCESS_ERROR =
126            "data.access.error";
127    
128        public static final String DATA_ACCESS_EMPTY =
129            "data.access.empty"; // not found
130    
131        public static final String DATA_RECORD_INSERTED =
132            "data.record.inserted";
133    
134        public static final String DATA_RECORD_UPDATED =
135            "data.record.updated";
136    
137        public static final String DATA_RECORD_DELETED =
138            "data.record.deleted";
139    
140        public static final String DATA_RECORD_RECYCLED =
141            "data.record.recycled";
142    
143        public static final String DATA_RECORD_RESTORED =
144            "data.record.restored";
145    
146        public static final String DATA_RECORD_RETRIEVED =
147            "data.record.retrieved";
148    
149        public static final String DATA_RECORD_DUPLICATE =
150            "data.record.duplicate";
151    
152        public static final String PROCESS_COMPLETE =
153            "process.complete";
154    
155    
156    
157    // --------------------------------- Common Application Resource tokens
158    
159    
160        public static final String DATA_TRANSFER_ERROR =
161            "data.transfer.error";
162    
163        public static final String PROCESS_MISSING_PARAMETER =
164            "process.missing.parameter";
165    
166    
167    // ------------------------------------------------------ Content types
168    
169        /**
170         * Plain text MIME type. Good for XML.
171         */
172        public static final String TEXT_PLAIN = "text/plain";
173    
174    
175    
176    // ------------------------------------------------- Exception messages
177    
178        /**
179         * Default message for throwing exception (en).
180         */
181        public static final String ALLOCATE_KEY_EXCEPTION =
182            "Unable to allocate key.";
183    
184        /**
185         * Default message for throwing exception (en).
186         */
187        public static final String STORE_EXCEPTION =
188            "Unable to insert or update record.";
189    
190        /**
191         * Default message for throwing exception (en).
192         */
193        public static final String SELECT_EXCEPTION =
194            "Unable to retrieve record.";
195    
196        /**
197         * Default message for throwing exception (en).
198         */
199        public static final String INSERT_EXCEPTION =
200            "Unable to insert record.";
201    
202        /**
203         * Default message for throwing exception (en).
204         */
205        public static final String UPDATE_EXCEPTION =
206            "Unable to update record.";
207    
208        /**
209         * Default message for throwing exception (en).
210         */
211        public static final String NOT_IMPLEMENTED_EXCEPTION =
212            "Method not implemented.";
213    
214        /**
215         * Default message for throwing exception (en).
216         */
217        public static final String INVALID_QUERY_EXCEPTION =
218            "Query not processed; are parameters valid?";
219    
220        /**
221         * Default message for throwing exception (en).
222         */
223        public static final String DATA_ACCESS_EXCEPTION =
224            "Unable to access data.";
225    
226        
227    //      ------------------------------------------------------- Log Phrases
228    
229        
230             /**
231              * Partial string for assembling a message.
232              */
233             public static final String CLASS =
234                     "class: ";
235    
236    
237             /**
238              * Partial string for assembling a message.
239              */
240             public static final String PATH_MSG =
241                     "path: ";
242    
243    
244             /**
245              * Partial string for assembling a message.
246              */
247             public static final String NAME =
248                     "name: ";
249    
250    
251             /**
252              * Partial string for assembling a message.
253              */
254             public static final String SPACE =
255                     " ";
256    
257    
258             /**
259              * Partial string for assembling a message.
260              */
261             public static final String NOT_FOUND =
262                     "was not found ";
263    
264    
265             /**
266              * Error creating object
267              */
268             public static final String CREATE_OBJECT_ERROR =
269                     "*** ERROR creating object ";
270    
271    
272             /**
273              * Prefix for logging exceptions.
274              */
275             public static final String ACTION_EXCEPTION =
276                     "*** ACTION EXCEPTION: ";
277    
278    
279             /**
280              * Prefix for logging exceptions.
281              */
282             public static final String ACTION_FORM_EXCEPTION =
283                     "*** ACTION FORM EXCEPTION: ";
284    
285    
286             /**
287              * Executing base logic.
288              */
289             public static final String BASE_LOGIC_EXECUTING =
290                     "Executing base logic ";
291    
292    
293             /**
294              * Parsing tokens.
295              */
296             public static final String TOKENS_PARSING =
297                     "Parsing tokens ";
298    
299    
300             /**
301              * Creating Helper.
302              */
303             public static final String HELPER_CREATING =
304                     "Creating Helper ";
305    
306    
307             /**
308              * Helper created.
309              */
310             public static final String HELPER_CREATED =
311                     "Helper created ";
312    
313    
314             /**
315              * Helper processing.
316              */
317             public static final String HELPER_PROCESSING =
318                     "Processing helper beans ";
319    
320    
321             /**
322              * Executing helpers.
323              */
324             public static final String HELPER_EXECUTING =
325                     "Executing helper beans ";
326    
327    
328             /**
329              * Populating helper
330              */
331             public static final String HELPER_POPULATE =
332                     "Populate helper bean ";
333    
334    
335             /**
336              * Checking outcome of helper
337              */
338             public static final String HELPER_OUTCOME =
339                     "Processing helper outcome ";
340    
341    
342             /**
343              * Bean helper
344              */
345             public static final String PROCESS_BEAN_NULL_SCOPE =
346                     "** ProcessAction: Process result indicates a null scope ";
347    
348    
349             /**
350              * Process action - Business method should not return null.
351              */
352             public static final String PROCESS_RESULT_NULL =
353                     "** ProcessAction: ProcessResult is NULL " ;    
354        
355        
356    // end Tokens
357    
358    }
359    
360    
361    /*
362     *
363     *    Copyright (c) 2002 Synthis Corporation.
364     *    430 10th Street NW, Suite S-108, Atlanta GA 30318, U.S.A.
365     *    All rights reserved.
366     *
367     *    This software is licensed to you free of charge under
368     *    the Apache Software License, so long as this copyright
369     *    statement, list of conditions, and comments,  remains
370     *    in the source code.  See bottom of file for more
371     *    license information.
372     *
373     *    This software was written to support code generation
374     *    for the Apache Struts J2EE architecture by Synthis'
375     *    visual application modeling tool Adalon.
376     *
377     *    For more information on Adalon and Struts code
378     *    generation please visit http://www.synthis.com
379     *
380     */