1 48 49 50 package com.caucho.portal.generic.context; 51 52 import com.caucho.portal.generic.Constraint; 53 import com.caucho.portal.generic.Invocation; 54 import com.caucho.portal.generic.Window; 55 56 import java.util.Locale ; 57 import java.util.Map ; 58 import java.util.Set ; 59 60 61 71 public class WindowContext { 72 private Window _window; 73 private String _namespace; 74 private int _stage; 75 76 private Invocation _invocation; 77 private Map <String , String []> _actionMap; 78 79 public boolean _didAction; 80 81 private boolean _isExcluded; 82 private int _constraintIndex; 83 private Constraint _constraintFailure; 84 private int _constraintFailureCode; 85 private Exception _exception; 86 87 private Map <String , String > _windowRequestAttributes; 88 89 private boolean _isPrivate; 90 private int _expirationCache; 91 92 private LinkingPortletPreferences _preferences; 93 private Map <String , String > _userAttributeMap; 94 95 private Locale _responseLocale; 96 private Set <Locale > _responseLocales; 97 private String _responseCharacterEncoding; 98 private Set <String > _responseCharacterEncodings; 99 private String _responseContentType; 100 private Set <String > _responseContentTypes; 101 102 private ResponseHandler _parentResponseHandler; 103 private ResponseHandler _responseHandler; 104 105 public void start( Window window, 106 String namespace ) 107 { 108 _window = window; 109 _namespace = namespace; 110 } 111 112 public void finish() 113 { 114 _invocation = null; 115 _actionMap = null; 116 _isExcluded = false; 117 _constraintIndex = 0; 118 _constraintFailure = null; 119 _constraintFailureCode = 0; 120 _exception = null; 121 _isPrivate = false; 122 _expirationCache = 0; 123 _preferences = null; 124 125 _responseLocale = null; 126 _responseLocales = null; 127 _responseCharacterEncoding = null; 128 _responseCharacterEncodings = null; 129 _responseContentType = null; 130 _responseContentTypes = null; 131 132 _responseHandler = null; 133 _parentResponseHandler = null; 134 135 _window = null; 136 _namespace = null; 137 } 138 139 public Window getWindow() 140 { 141 return _window; 142 } 143 144 public String getNamespace() 145 { 146 return _namespace; 147 } 148 149 public void setDidAction() 150 { 151 _didAction = true; 152 } 153 154 public boolean getDidAction() 155 { 156 return _didAction; 157 } 158 159 public void setInvocation(Invocation invocation) 160 { 161 _invocation = invocation; 162 } 163 164 public Invocation getInvocation() 165 { 166 return _invocation; 167 } 168 169 public void setActionMap(Map <String , String []> actionMap) 170 { 171 _actionMap = actionMap; 172 } 173 174 public Map <String , String []> getActionMap() 175 { 176 return _actionMap; 177 } 178 179 public void setExcluded() 180 { 181 _isExcluded = true; 182 } 183 184 public boolean isExcluded() 185 { 186 return _isExcluded; 187 } 188 189 public void setConstraintIndex(int constraintIndex) 190 { 191 _constraintIndex = constraintIndex; 192 } 193 194 public int getConstraintIndex() 195 { 196 return _constraintIndex; 197 } 198 199 public void setConstraintFailure(Constraint constraint, int failureCode) 200 { 201 _constraintFailure = constraint; 202 _constraintFailureCode = failureCode; 203 } 204 205 public boolean isConstraintFailure() 206 { 207 return _constraintFailure != null; 208 } 209 210 public Constraint getConstraintFailureConstraint() 211 { 212 return _constraintFailure; 213 } 214 215 public int getConstraintFailureCode() 216 { 217 return _constraintFailureCode; 218 } 219 220 public void setException(Exception ex) 221 { 222 _exception = ex; 223 } 224 225 public boolean isException() 226 { 227 return _exception != null; 228 } 229 230 public Exception getException() 231 { 232 return _exception; 233 } 234 235 public void setPrivate() 236 { 237 _isPrivate = true; 238 } 239 240 public boolean isPrivate() 241 { 242 return _isPrivate; 243 } 244 245 public void setExpirationCache(int expirationCache) 246 { 247 _expirationCache = expirationCache; 248 } 249 250 public int getExpirationCache() 251 { 252 return _expirationCache; 253 } 254 255 public void setPreferences(LinkingPortletPreferences preferences) 256 { 257 _preferences = preferences; 258 } 259 260 public LinkingPortletPreferences getPreferences() 261 { 262 return _preferences; 263 } 264 265 public void setUserAttributeMap(Map <String , String > userAttributeMap) 266 { 267 _userAttributeMap = userAttributeMap; 268 } 269 270 public Map <String , String > getUserAttributeMap() 271 { 272 return _userAttributeMap; 273 } 274 275 public void setResponseLocale(Locale responseLocale) 276 { 277 _responseLocale = responseLocale; 278 } 279 280 public Locale getResponseLocale() 281 { 282 return _responseLocale; 283 } 284 285 public void setResponseLocales(Set <Locale > responseLocales) 286 { 287 _responseLocales = responseLocales; 288 } 289 290 public Set <Locale > getResponseLocales() 291 { 292 return _responseLocales; 293 } 294 295 public void setResponseCharacterEncoding(String responseCharacterEncoding) 296 { 297 _responseCharacterEncoding = responseCharacterEncoding; 298 } 299 300 public String getResponseCharacterEncoding() 301 { 302 return _responseCharacterEncoding; 303 } 304 305 public void setResponseCharacterEncodings(Set <String > encodings) 306 { 307 _responseCharacterEncodings = encodings; 308 } 309 310 public Set <String > getResponseCharacterEncodings() 311 { 312 return _responseCharacterEncodings; 313 } 314 315 public void setResponseContentType(String responseContentType) 316 { 317 _responseContentType = responseContentType; 318 } 319 320 public String getResponseContentType() 321 { 322 return _responseContentType; 323 } 324 325 public void setResponseContentTypes(Set <String > responseContentTypes) 326 { 327 _responseContentTypes = responseContentTypes; 328 } 329 330 public Set <String > getResponseContentTypes() 331 { 332 return _responseContentTypes; 333 } 334 335 public void setParentResponseHandler(ResponseHandler parentResponseHandler) 336 { 337 _parentResponseHandler = parentResponseHandler; 338 } 339 340 public ResponseHandler getParentResponseHandler() 341 { 342 return _parentResponseHandler; 343 } 344 345 public void setResponseHandler(ResponseHandler responseHandler) 346 { 347 _responseHandler = responseHandler; 348 } 349 350 public ResponseHandler getResponseHandler() 351 { 352 return _responseHandler; 353 } 354 355 public void setWindowRequestAttributes(Map <String , String > windowRequestAttributes) 356 { 357 _windowRequestAttributes = windowRequestAttributes; 358 359 } 360 361 public Map <String , String > getWindowRequestAttributes() 362 { 363 return _windowRequestAttributes; 364 } 365 } 366 | Popular Tags |