View Javadoc

1   /**
2    * 2007, Digitalis Informatica. All rights reserved. Distribuicao e Gestao de Informatica, Lda. Estrada de Paco de Arcos
3    * num.9 - Piso -1 2780-666 Paco de Arcos Telefone: (351) 21 4408990 Fax: (351) 21 4408999 http://www.digitalis.pt
4    */
5   package pt.digitalis.dif.controller.http;
6   
7   import java.util.ArrayList;
8   import java.util.List;
9   
10  import pt.digitalis.dif.controller.interfaces.IDIFRequest;
11  
12  /**
13   * Defines a set of constants used on the HTTP service requests and responses.
14   * 
15   * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a>
16   * @author Rodrigo Gonçalves <a href="mailto:rgoncalves@digitalis.pt">rgoncalves@digitalis.pt</a>
17   * @created Dec 19, 2007
18   */
19  public class HTTPConstants {
20  
21      /** The HTTP parameter indicating that a stage is to be retrieved in component mode. */
22      final static public String AJAX_MODE_PARAMETER = "ajax_mode";
23  
24      /** The HTTP parameter indicating that we wish to retrieve an asset form the DiF's repository */
25      final static public String ASSET_ID_PARAMETER = "assetID";
26  
27      /** The HTTP parameter indicating that a stage is to be retrieved in component mode. */
28      final static public String COMPONENT_MODE_PARAMETER = "component_mode";
29  
30      /** The suffix for use in messages that define a Help text for components */
31      final static public String CONVENTIONED_HELP_SUFFIX = "Help";
32  
33      /** The suffix for use in messages that define a Hint text for components */
34      final static public String CONVENTIONED_HINT_SUFFIX = "Hint";
35  
36      /** The HTTP parameter indicating that the document is an attachment */
37      final static public String DOC_IS_ATTACHMENT_PARAMETER = "docIsAttachment";
38  
39      /** The HTTP parameter indicating that we wish to retrieve a document form the DiF's repository */
40      final static public String DOCID_PARAMETER = "docID";
41  
42      /** The parameter name to indicate after successful login stage */
43      final static public String ERROR_ATTRIBUTE = "errordescriptor";
44  
45      /** Event id called. */
46      final static public String EVENT_ID = "_event";
47  
48      /** Form complete field names, so we know all fields to invalidate session values on form submit */
49      final static public String FORM_FIELD_NAMES = "_formfieldnames";
50  
51      /** Form hidden field indicating the stage where the include stage was born. */
52      final static public String FORM_PARENT_STAGE_PARAMETER = "_formparentstage";
53  
54      /** Form configuration business id for the form submit occurred. */
55      final static public String FORM_SUBMIT__CONFIG_BUSINESS_ID = "_formsubmitnameconfigbusinessid";
56  
57      /** Form id where the form submit occurred. */
58      final static public String FORM_SUBMIT_NAME = "_formsubmitname";
59  
60      /** Stage id where the form submit occurred. */
61      final static public String FORM_SUBMIT_STAGE = "_formsubmitstage";
62  
63      /** Form validation request identifier for validation only AJAX action. */
64      final static public String FORM_VALIDATION = "_formvalidation";
65  
66      /** The HTTP parameter containing the stage name that will be invoked. */
67      final static public String FORMAT_PARAMETER = "format";
68  
69      /** The HTTP parameter indicating that a stage is to be retrieved in help mode. */
70      final static public String HELP_MODE_PARAMETER = "help_mode";
71  
72      /**  */
73      final static public String HTTP_CHANNEL_ID = "http";
74  
75      /** The HTTP parameter indicating that the form is in insert mode. */
76      final static public String INSERT_MODE_PARAMETER = "insert_mode";
77  
78      /** The HTTP parameter indicating the language. */
79      final static public String LANGUAGE = "language";
80  
81      /** The parameter name to indicate after successful login stage */
82      final static public String ON_SUCESS_LOGIN_STAGE = "afterloginstageid";
83  
84      /** The HTTP parameter indicating that parent page script already include, in component mode. */
85      final static public String PAGE_IMPORTED_IDS_PARAMETER = "pageScriptsIDs";
86  
87      /** The HTTP parameter indicating the stage where the include stage was born. */
88      final static public String PARENT_STAGE_PARAMETER = "_parentstage";
89  
90      /** The HTTP parameter indicating that a stage is to be retrieved in popup mode. */
91      final static public String POPUP_MODE_PARAMETER = "popup_mode";
92  
93      /** A list of private DIF parameters that will not be saved in the breadcrumb instance */
94      private static List<String> privateParameters;
95  
96      /** The attribute name to put DIFResponse into the HttpServletRequest. */
97      final static public String RESPONSE_ATTRIBUTE = "DIFResponseAttribute";
98  
99      /** The HTTP parameter indicating that a stage was called component mode. */
100     final static public String REST_URL_PARAMETER = "rest_call";
101 
102     /** The HTTP parameter containing the stage name that will be invoked. */
103     final static public String STAGE_PARAMETER = "stage";
104 
105     /** The submit action parameter name */
106     final static public String SUBMIT_ACTION = "submitAction";
107 
108     /** The Tab Index parameter, indicates which index the page should begin */
109     final static public String TAB_INDEX_PARAMETER = "tabIndexParam";
110 
111     /** The HTTP parameter indicating that a stage is to be retrieved in template mode. */
112     final static public String TEMPLATE_MODE_PARAMETER = "template_mode";
113 
114     /** the new theme ID */
115     public static final String THEME_ID = "themeID";
116 
117     /** The HTTP parameter indicating that an error occurred in upload file. */
118     final static public String UPLOAD_FILE_SIZE_ERROR = "Upload_File_Size_Error";
119 
120     /** The HTTP parameter indicating the compatibility mode for Rich Web UI. */
121     final static public String WEBUI_COMPAT_MODE = "webui_compat_mode";
122 
123     /** The HTTP parameter indicating the debug mode for Rich Web UI. */
124     final static public String WEBUI_DEBUG_MODE = "webui_debug_mode";
125 
126     /** The HTTP parameter indicating the mode to render the web page in. */
127     final static public String WEBUI_MODE = "webui_mode";
128 
129     /**
130      * Inspector for the 'privateParameters' attribute.
131      * 
132      * @return the privateParameters value
133      */
134     public static List<String> getPrivateParameters()
135     {
136         if (privateParameters == null)
137         {
138             privateParameters = new ArrayList<String>();
139             privateParameters.add(HTTPConstants.STAGE_PARAMETER);
140             privateParameters.add(HTTPConstants.HELP_MODE_PARAMETER);
141             privateParameters.add(HTTPConstants.COMPONENT_MODE_PARAMETER);
142             privateParameters.add(HTTPConstants.FORM_SUBMIT_STAGE);
143             privateParameters.add(HTTPConstants.FORM_SUBMIT_NAME);
144             privateParameters.add(HTTPConstants.EVENT_ID);
145             privateParameters.add(HTTPConstants.LANGUAGE);
146             privateParameters.add(HTTPConstants.WEBUI_MODE);
147             privateParameters.add(HTTPConstants.ON_SUCESS_LOGIN_STAGE);
148             privateParameters.add(IDIFRequest.USER_PARAMETER_ID);
149             privateParameters.add(IDIFRequest.PASSWORD_PARAMETER_ID);
150         }
151 
152         return privateParameters;
153     }
154 }