Author: doogie
Date: Fri Mar 27 16:58:52 2009 New Revision: 759243 URL: http://svn.apache.org/viewvc?rev=759243&view=rev Log: Fix lines that *only* have whitespace. Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/AbstractJSONEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/BsfEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/DojoJSONServiceEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/EventHandlerException.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/FileUploadProgressListener.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JavaEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/RomeEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SimpleEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/TestEvent.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizAmountTransform.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCacheStorage.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/RenderWrappedTextTransform.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/SetRequestAttributeMethod.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/Region.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/RegionManager.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/RenderTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/Section.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/EntityFieldTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/FormatTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/I18nBundleTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/I18nMessageArgumentTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/I18nMessageTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/IfTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/InputValueTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/ObjectTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/PrintTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/UrlTag.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopWorker.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/DataVisionViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/FopPdfViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/GenericViewRenderer.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/HttpViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JPublishViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JPublishWrapper.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsJXlsViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsPdfViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsPoiXlsViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JasperReportsXmlViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/JspViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/RegionViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ViewFactory.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/WfsViewHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/xmlrpc/XmlRpcClient.java Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java Fri Mar 27 16:58:52 2009 @@ -50,7 +50,7 @@ public static final String module = ConfigXMLReader.class.getName(); public static final String controllerXmlFileName = "/WEB-INF/controller.xml"; - + public static UtilCache<URL, ControllerConfig> controllerCache = new UtilCache<URL, ControllerConfig>("webapp.ControllerConfig"); public static UtilCache<String, List<ControllerConfig>> controllerSearchResultsCache = new UtilCache<String, List<ControllerConfig>>("webapp.ControllerSearchResults"); @@ -62,7 +62,7 @@ return null; } } - + public static ControllerConfig getControllerConfig(URL url) { ControllerConfig controllerConfig = controllerCache.get(url); if (controllerConfig == null) { // don't want to block here @@ -77,22 +77,22 @@ } return controllerConfig; } - + public static class ControllerConfig { public URL url; - + public String errorpage; public String protectView; public String owner; public String securityClass; public String defaultRequest; - + public List<Event> firstVisitEventList = FastList.newInstance(); public List<Event> preprocessorEventList = FastList.newInstance(); public List<Event> postprocessorEventList = FastList.newInstance(); public List<Event> afterLoginEventList = FastList.newInstance(); public List<Event> beforeLogoutEventList = FastList.newInstance(); - + public Map<String, String> eventHandlerMap = FastMap.newInstance(); public Map<String, String> viewHandlerMap = FastMap.newInstance(); @@ -101,17 +101,17 @@ public ControllerConfig(URL url) { this.url = url; - + Element rootElement = loadDocument(url); if (rootElement != null) { long startTime = System.currentTimeMillis(); - + loadIncludes(rootElement); loadGeneralConfig(rootElement); loadHandlerMap(rootElement); loadRequestMap(rootElement); loadViewMap(rootElement); - + if (Debug.infoOn()) { double totalSeconds = (System.currentTimeMillis() - startTime)/1000.0; String locString = this.url.toExternalForm(); @@ -119,29 +119,29 @@ } } } - + protected void absorbControllerConfig(ControllerConfig controllerConfig) { // copy/add all data except the url - + this.errorpage = controllerConfig.errorpage; this.protectView = controllerConfig.protectView; this.owner = controllerConfig.owner; this.securityClass = controllerConfig.securityClass; this.defaultRequest = controllerConfig.defaultRequest; - + this.firstVisitEventList.addAll(controllerConfig.firstVisitEventList); this.preprocessorEventList.addAll(controllerConfig.preprocessorEventList); this.postprocessorEventList.addAll(controllerConfig.postprocessorEventList); this.afterLoginEventList.addAll(controllerConfig.afterLoginEventList); this.beforeLogoutEventList.addAll(controllerConfig.beforeLogoutEventList); - + this.eventHandlerMap.putAll(controllerConfig.eventHandlerMap); this.viewHandlerMap.putAll(controllerConfig.viewHandlerMap); - + this.requestMapMap.putAll(controllerConfig.requestMapMap); this.viewMapMap.putAll(controllerConfig.viewMapMap); } - + protected void loadIncludes(Element rootElement) { for (Element includeElement: UtilXml.childElementList(rootElement, "include")) { String includeLocation = includeElement.getAttribute("location"); @@ -160,7 +160,7 @@ if (rootElement == null) { rootElement = loadDocument(this.url); } - + this.errorpage = UtilXml.childElementValue(rootElement, "errorpage"); Element protectElement = UtilXml.firstChildElement(rootElement, "protect"); if (protectElement != null) { @@ -172,7 +172,7 @@ if (defaultRequestElement != null) { this.defaultRequest = defaultRequestElement.getAttribute("request-uri"); } - + // first visit event Element firstvisitElement = UtilXml.firstChildElement(rootElement, "firstvisit"); if (firstvisitElement != null) { @@ -213,7 +213,7 @@ } } } - + public void loadHandlerMap(Element rootElement) { if (rootElement == null) { rootElement = loadDocument(this.url); @@ -224,7 +224,7 @@ String name = handlerElement.getAttribute("name"); String type = handlerElement.getAttribute("type"); String className = handlerElement.getAttribute("class"); - + if ("view".equals(type)) { this.viewHandlerMap.put(name, className); } else { @@ -244,7 +244,7 @@ this.requestMapMap.put(requestMap.uri, requestMap); } } - + public void loadViewMap(Element rootElement) { if (rootElement == null) { rootElement = loadDocument(this.url); @@ -259,22 +259,22 @@ } } - + public static Set<String> findControllerFilesWithRequest(String requestUri, String controllerPartialPath) throws GeneralException { Set<String> allControllerRequestSet = FastSet.newInstance(); - + if (UtilValidate.isEmpty(requestUri)) { return allControllerRequestSet; } - + String cacheId = controllerPartialPath != null ? controllerPartialPath : "NOPARTIALPATH"; List<ControllerConfig> controllerConfigs = (List<ControllerConfig>) controllerSearchResultsCache.get(cacheId); - + if (controllerConfigs == null) { try { // find controller.xml file with webappMountPoint + "/WEB-INF" in the path List<File> controllerFiles = FileUtil.findXmlFiles(null, controllerPartialPath, "site-conf", "site-conf.xsd"); - + controllerConfigs = FastList.newInstance(); for (File controllerFile: controllerFiles) { URL controllerUrl = null; @@ -286,13 +286,13 @@ ControllerConfig cc = ConfigXMLReader.getControllerConfig(controllerUrl); controllerConfigs.add(cc); } - + controllerSearchResultsCache.put(cacheId, controllerConfigs); } catch (IOException e) { throw new GeneralException("Error finding controller XML files to lookup request references: " + e.toString(), e); } } - + if (controllerConfigs != null) { for (ControllerConfig cc: controllerConfigs) { // make sure it has the named request in it @@ -303,26 +303,26 @@ } } } - + return allControllerRequestSet; } - + public static Set<String> findControllerRequestUniqueForTargetType(String target, String urlMode) throws GeneralException { if (UtilValidate.isEmpty(urlMode)) { urlMode = "intra-app"; } - + int indexOfDollarSignCurlyBrace = target.indexOf("${"); int indexOfQuestionMark = target.indexOf("?"); if (indexOfDollarSignCurlyBrace >= 0 && (indexOfQuestionMark < 0 || indexOfQuestionMark > indexOfDollarSignCurlyBrace)) { // we have an expanded string in the requestUri part of the target, not much we can do about that... return null; } - + if ("intra-app".equals(urlMode)) { // look through all controller.xml files and find those with the request-uri referred to by the target String requestUri = UtilHttp.getRequestUriFromTarget(target); - + Set<String> controllerLocAndRequestSet = ConfigXMLReader.findControllerFilesWithRequest(requestUri, null); // if (controllerLocAndRequestSet.size() > 0) Debug.logInfo("============== In findRequestNamesLinkedtoInWidget, controllerLocAndRequestSet: " + controllerLocAndRequestSet, module); return controllerLocAndRequestSet; @@ -330,7 +330,7 @@ String webappMountPoint = UtilHttp.getWebappMountPointFromTarget(target); if (webappMountPoint != null) webappMountPoint += "/WEB-INF"; String requestUri = UtilHttp.getRequestUriFromTarget(target); - + Set<String> controllerLocAndRequestSet = ConfigXMLReader.findControllerFilesWithRequest(requestUri, webappMountPoint); // if (controllerLocAndRequestSet.size() > 0) Debug.logInfo("============== In findRequestNamesLinkedtoInWidget, controllerLocAndRequestSet: " + controllerLocAndRequestSet, module); return controllerLocAndRequestSet; @@ -353,22 +353,22 @@ } return null; } - + public static class RequestMap { public String uri; public boolean edit = true; public boolean trackVisit = true; public boolean trackServerHit = true; public String description; - + public Event event; - + public boolean securityHttps = false; public boolean securityAuth = false; public boolean securityCert = false; public boolean securityExternalView = true; public boolean securityDirectRequest = true; - + public Map<String, RequestResponse> requestResponseMap = FastMap.newInstance(); public RequestMap(Element requestMapElement) { @@ -405,7 +405,7 @@ } } } - + public static class Event { public String type; public String path; @@ -426,7 +426,7 @@ this.globalTransaction = globalTransaction; } } - + public static final RequestResponse emptyNoneRequestResponse = RequestResponse.createEmptyNoneRequestResponse(); public static class RequestResponse { public String name; @@ -436,7 +436,7 @@ public boolean saveCurrentView = false; public boolean saveHomeView = false; public Map<String, String> redirectParameterMap = FastMap.newInstance(); - + public RequestResponse(Element responseElement) { this.name = responseElement.getAttribute("name"); this.type = responseElement.getAttribute("type"); @@ -450,9 +450,9 @@ this.redirectParameterMap.put(redirectParameterElement.getAttribute("name"), from); } } - + public RequestResponse() { } - + public static RequestResponse createEmptyNoneRequestResponse() { RequestResponse requestResponse = new RequestResponse(); requestResponse.name = "empty-none"; @@ -461,7 +461,7 @@ return requestResponse; } } - + public static class ViewMap { public String viewMap; public String name; Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java Fri Mar 27 16:58:52 2009 @@ -65,12 +65,12 @@ public void sessionDestroyed(HttpSessionEvent event) { HttpSession session = event.getSession(); - + // Finalize the Visit boolean beganTransaction = false; try { beganTransaction = TransactionUtil.begin(); - + // instead of using this message, get directly from session attribute so it won't create a new one: GenericValue visit = VisitHandler.getVisit(session); GenericValue visit = (GenericValue) session.getAttribute("visit"); if (visit != null) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java Fri Mar 27 16:58:52 2009 @@ -111,7 +111,7 @@ if (userLogin != null) { GenericDelegator.pushUserIdentifier(userLogin.getString("userLoginId")); } - + // workaraound if we are in the root webapp String webappName = UtilHttp.getApplicationName(request); @@ -174,7 +174,7 @@ Debug.logError("[ControlServlet] ERROR: security not found in ServletContext", module); } request.setAttribute("security", security); - + request.setAttribute("_REQUEST_HANDLER_", requestHandler); // setup some things that should always be there @@ -223,7 +223,7 @@ if (request.getAttribute("_ERROR_OCCURRED_") == null && rd != null) { request.setAttribute("_ERROR_OCCURRED_", Boolean.TRUE); Debug.logError("Including errorPage: " + errorPage, module); - + // NOTE DEJ20070727 after having trouble with all of these, try to get the page out and as a last resort just send something back try { rd.include(request, response); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java Fri Mar 27 16:58:52 2009 @@ -70,7 +70,7 @@ * Common Workers */ public class LoginWorker { - + public final static String module = LoginWorker.class.getName(); public static final String resourceWebapp = "SecurityextUiLabels"; @@ -79,7 +79,7 @@ /** This Map is keyed by the randomly generated externalLoginKey and the value is a UserLogin GenericValue object */ public static Map<String, GenericValue> externalLoginKeys = FastMap.newInstance(); - + public static StringWrapper makeLoginUrl(PageContext pageContext) { return makeLoginUrl(pageContext, "checkLogin"); } @@ -87,7 +87,7 @@ public static StringWrapper makeLoginUrl(HttpServletRequest request) { return makeLoginUrl(request, "checkLogin"); } - + public static StringWrapper makeLoginUrl(PageContext pageContext, String requestName) { return makeLoginUrl((HttpServletRequest) pageContext.getRequest(), requestName); } @@ -109,7 +109,7 @@ return StringUtil.wrapString(loginUrl); } - + /** * Gets (and creates if necessary) a key to be used for an external login parameter */ @@ -154,7 +154,7 @@ if (UtilValidate.isEmpty(userLoginId)) { Debug.logWarning("Called setLogged out with empty userLoginId", module); } - + Transaction parentTx = null; boolean beganTransaction = false; @@ -256,10 +256,10 @@ // make sure this attribute is not in the request; this avoids infinite recursion when a login by less stringent criteria (like not checkout the hasLoggedOut field) passes; this is not a normal circumstance but can happen with custom code or in funny error situations when the userLogin service gets the userLogin object but runs into another problem and fails to return an error request.removeAttribute("_LOGIN_PASSED_"); - + // keep the previous request name in the session session.setAttribute("_PREVIOUS_REQUEST_", request.getPathInfo()); - + // NOTE: not using the old _PREVIOUS_PARAMS_ attribute at all because it was a security hole as it was used to put data in the URL (never encrypted) that was originally in a form field that may have been encrypted // keep 2 maps: one for URL parameters and one for form parameters Map<String, Object> urlParams = UtilHttp.getUrlOnlyParameterMap(request); @@ -290,7 +290,7 @@ */ public static String login(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); - + if (session.getAttribute("userLogin") != null) { // already logged in, do nothing... return "success"; @@ -301,7 +301,7 @@ if (username == null) username = (String) session.getAttribute("USERNAME"); if (password == null) password = (String) session.getAttribute("PASSWORD"); - + // allow a username and/or password in a request attribute to override the request parameter or the session attribute; this way a preprocessor can play with these a bit... if (UtilValidate.isNotEmpty((String) request.getAttribute("USERNAME"))) { username = (String) request.getAttribute("USERNAME"); @@ -321,7 +321,7 @@ request.setAttribute("_ERROR_MESSAGE_LIST_", unpwErrMsgList); return "error"; } - + if ((username != null) && ("true".equalsIgnoreCase(UtilProperties.getPropertyValue("security.properties", "username.lowercase")))) { username = username.toLowerCase(); @@ -644,7 +644,7 @@ // Shouldn't be here if all went well return "error"; } - + // preprocessor method to login a user from a HTTP request header (configured in security.properties) public static String checkRequestHeaderLogin(HttpServletRequest request, HttpServletResponse response) { String httpHeader = UtilProperties.getPropertyValue("security.properties", "security.login.http.header", null); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java Fri Mar 27 16:58:52 2009 @@ -41,13 +41,13 @@ * Common Workers */ public class ProtectViewWorker { - + private final static String module = ProtectViewWorker.class.getName(); private static final String resourceWebapp = "WebappUiLabels"; private static final FastMap<String, Long> hitsByViewAccessed = FastMap.newInstance(); private static final FastMap<String, Long> durationByViewAccessed = FastMap.newInstance(); private static final Long one = new Long(1); - + /** * An HTTP WebEvent handler that checks to see if an userLogin should be tarpitted * The decision is made in regard of number of hits in last period of time @@ -62,7 +62,7 @@ GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator"); String returnValue = "success"; - + if (userLogin != null) { String userLoginId = userLogin.getString("userLoginId"); try { @@ -71,7 +71,7 @@ // Any views to deal with ? if (UtilValidate.isNotEmpty(protectedViews)) { Long now = System.currentTimeMillis(); // we are not in a margin of some milliseconds - + // Is this login/view couple already tarpitted ? (ie denied access to view for login for a period of time) List<GenericValue> tarpittedLoginViews = delegator.findByAnd("TarpittedLoginView", UtilMisc.toMap("userLoginId", userLoginId, "viewNameId", viewNameId)); @@ -102,9 +102,9 @@ if (newMaxHits > maxHits) { // yes : block and set tarpitReleaseDateTime String blockedMessage = UtilProperties.getMessage(resourceWebapp, "protectedviewevents.blocked_message", UtilHttp.getLocale(request)); returnValue = ":_protect_:" + blockedMessage; - + Long tarpitDuration = (Long) protectedView.get("tarpitDuration") * 1000; - + GenericValue tarpittedLoginView = delegator.makeValue("TarpittedLoginView"); tarpittedLoginView.set("userLoginId", userLoginId); tarpittedLoginView.set("viewNameId", viewNameId); @@ -135,7 +135,7 @@ Debug.logError(e, errMsg, module); } } - + return returnValue; } } Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Fri Mar 27 16:58:52 2009 @@ -91,7 +91,7 @@ this.viewFactory = new ViewFactory(this); this.eventFactory = new EventFactory(this); } - + public ConfigXMLReader.ControllerConfig getControllerConfig() { return ConfigXMLReader.getControllerConfig(this.controllerConfigURL); } @@ -107,7 +107,7 @@ GenericValue userLogin, GenericDelegator delegator) throws RequestHandlerException { HttpSession session = request.getSession(); - + // get the controllerConfig once for this method so we don't have to get it over and over inside the method ConfigXMLReader.ControllerConfig controllerConfig = this.getControllerConfig(); @@ -123,9 +123,9 @@ request.setAttribute("targetRequestUri", "/" + defaultRequestUri); } } - + String overrideViewUri = RequestHandler.getOverrideViewUri(request.getPathInfo()); - + String requestMissingErrorMessage = "Unknown request [" + defaultRequestUri + "]; this request does not exist or cannot be called directly."; ConfigXMLReader.RequestMap requestMap = null; if (defaultRequestUri != null) { @@ -197,7 +197,7 @@ } } } - + // Check for HTTPS client (x.509) security if (request.isSecure() && requestMap.securityCert) { X509Certificate[] clientCerts = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate"); // 2.2 spec @@ -219,7 +219,7 @@ Debug.logInfo(clientCerts[i].getSubjectX500Principal().getName(), module); } } - + // check if this is a trusted cert if (SSLUtil.isClientTrusted(clientCerts, null)) { foundTrustedCert = true; @@ -294,7 +294,7 @@ if (Debug.verboseOn()) Debug.logVerbose("[Processing Request]: " + requestMap.uri + " sessionId=" + UtilHttp.getSessionId(request), module); request.setAttribute("thisRequestUri", requestMap.uri); // store the actual request URI - + // Perform security check. if (requestMap.securityAuth) { @@ -315,7 +315,7 @@ requestMap = controllerConfig.requestMapMap.get("checkLogin"); } } - + // after security check but before running the event, see if a post-login redirect has completed and we have data from the pre-login request form to use now // we know this is the case if the _PREVIOUS_PARAM_MAP_ attribute is there, but the _PREVIOUS_REQUEST_ attribute has already been removed if (request.getSession().getAttribute("_PREVIOUS_PARAM_MAP_FORM_") != null && request.getSession().getAttribute("_PREVIOUS_REQUEST_") == null) { @@ -330,7 +330,7 @@ // now we can start looking for the next request response to use ConfigXMLReader.RequestResponse nextRequestResponse = null; - + // Invoke the defined event (unless login failed) if (eventReturn == null && requestMap.event != null) { if (requestMap.event.type != null && requestMap.event.path != null && requestMap.event.invoke != null) { @@ -363,7 +363,7 @@ } } } - + // Process the eventReturn // at this point eventReturnString is finalized, so get the RequestResponse ConfigXMLReader.RequestResponse eventReturnBasedRequestResponse = eventReturn == null ? null : requestMap.requestResponseMap.get(eventReturn); @@ -394,7 +394,7 @@ // get the previous request info String previousRequest = (String) request.getSession().getAttribute("_PREVIOUS_REQUEST_"); String loginPass = (String) request.getAttribute("_LOGIN_PASSED_"); - + // restore previous redirected request's attribute, so redirected page can display previous request's error msg etc. String preReqAttStr = (String) request.getSession().getAttribute("_REQ_ATTR_MAP_"); Map<String, Object> previousRequestAttrMap = null; @@ -425,7 +425,7 @@ Debug.logWarning("Found special _PREVIOUS_REQUEST_ of [" + previousRequest + "], setting to null to avoid problems, not running request again", module); } else { if (Debug.infoOn()) Debug.logInfo("[Doing Previous Request]: " + previousRequest + " sessionId=" + UtilHttp.getSessionId(request), module); - + // note that the previous form parameters are not setup (only the URL ones here), they will be found in the session later and handled when the old request redirect comes back Map<String, Object> previousParamMap = UtilGenerics.checkMap(request.getSession().getAttribute("_PREVIOUS_PARAM_MAP_URL_"), String.class, Object.class); String queryString = UtilHttp.urlEncodeArgs(previousParamMap, false); @@ -434,9 +434,9 @@ redirectTarget += "?" + queryString; } callRedirect(makeLink(request, response, redirectTarget), response, request); - + // the old/uglier way: doRequest(request, response, previousRequest, userLogin, delegator); - + // this is needed as the request handled will be taking care of the view, etc return; } @@ -453,15 +453,15 @@ // Make sure we have some sort of response to go to if (nextRequestResponse == null) nextRequestResponse = successResponse; - + if (nextRequestResponse == null) { throw new RequestHandlerException("Illegal response; handler could not process request [" + requestMap.uri + "] and event return [" + eventReturn + "]."); } - + if (Debug.verboseOn()) Debug.logVerbose("[Event Response Selected] type=" + nextRequestResponse.type + ", value=" + nextRequestResponse.value + ", sessionId=" + UtilHttp.getSessionId(request), module); // ========== Handle the responses - chains/views ========== - + // if the request has the save-last-view attribute set, save it now before the view can be rendered or other chain done so that the _LAST* session attributes will represent the previous request if (nextRequestResponse.saveLastView) { // Debug.log("======save last view: " + session.getAttribute("_LAST_VIEW_NAME_")); @@ -471,14 +471,14 @@ String saveName = null; if (nextRequestResponse.saveCurrentView) { saveName = "SAVED"; } if (nextRequestResponse.saveHomeView) { saveName = "HOME"; } - + if (nextRequestResponse != null && "request".equals(nextRequestResponse.type)) { // chained request Debug.logInfo("[RequestHandler.doRequest]: Response is a chained request." + " sessionId=" + UtilHttp.getSessionId(request), module); doRequest(request, response, nextRequestResponse.value, userLogin, delegator); } else { // ======== handle views ======== - + // first invoke the post-processor events. for (ConfigXMLReader.Event event: controllerConfig.postprocessorEventList) { try { @@ -507,16 +507,16 @@ callRedirect(makeLink(request, response, nextRequestResponse.value), response, request); } else if ("view".equals(nextRequestResponse.type)) { if (Debug.verboseOn()) Debug.logVerbose("[RequestHandler.doRequest]: Response is a view." + " sessionId=" + UtilHttp.getSessionId(request), module); - + // check for an override view, only used if "success" = eventReturn String viewName = (UtilValidate.isNotEmpty(overrideViewUri) && (eventReturn == null || "success".equals(eventReturn))) ? overrideViewUri : nextRequestResponse.value; renderView(viewName, requestMap.securityExternalView, request, response, saveName); } else if ("view-last".equals(nextRequestResponse.type)) { if (Debug.verboseOn()) Debug.logVerbose("[RequestHandler.doRequest]: Response is a view." + " sessionId=" + UtilHttp.getSessionId(request), module); - + // check for an override view, only used if "success" = eventReturn String viewName = (UtilValidate.isNotEmpty(overrideViewUri) && (eventReturn == null || "success".equals(eventReturn))) ? overrideViewUri : nextRequestResponse.value; - + // as a further override, look for the _SAVED and then _LAST session attributes Map<String, Object> urlParams = null; if (session.getAttribute("_SAVED_VIEW_NAME_") != null) { @@ -534,10 +534,10 @@ renderView(viewName, requestMap.securityExternalView, request, response, null); } else if ("view-home".equals(nextRequestResponse.type)) { if (Debug.verboseOn()) Debug.logVerbose("[RequestHandler.doRequest]: Response is a view." + " sessionId=" + UtilHttp.getSessionId(request), module); - + // check for an override view, only used if "success" = eventReturn String viewName = (UtilValidate.isNotEmpty(overrideViewUri) && (eventReturn == null || "success".equals(eventReturn))) ? overrideViewUri : nextRequestResponse.value; - + // as a further override, look for the _HOME session attributes Map<String, Object> urlParams = null; if (session.getAttribute("_HOME_VIEW_NAME_") != null) { @@ -676,7 +676,7 @@ // before mapping the view, set a request attribute so we know where we are req.setAttribute("_CURRENT_VIEW_", view); - + // save the view in the session for the last view, plus the parameters Map (can use all parameters as they will never go into a URL, will only stay in the session and extra data will be ignored as we won't go to the original request just the view); note that this is saved after the request/view processing has finished so when those run they will get the value from the previous request Map<String, Object> paramMap = UtilHttp.getParameterMap(req); // add in the attributes as well so everything needed for the rendering context will be in place if/when we get back to this view @@ -684,24 +684,24 @@ UtilMisc.makeMapSerializable(paramMap); req.getSession().setAttribute("_LAST_VIEW_NAME_", view); req.getSession().setAttribute("_LAST_VIEW_PARAMS_", paramMap); - + if ("SAVED".equals(saveName)) { //Debug.log("======save current view: " + view); req.getSession().setAttribute("_SAVED_VIEW_NAME_", view); req.getSession().setAttribute("_SAVED_VIEW_PARAMS_", paramMap); } - + if ("HOME".equals(saveName)) { //Debug.log("======save home view: " + view); req.getSession().setAttribute("_HOME_VIEW_NAME_", view); req.getSession().setAttribute("_HOME_VIEW_PARAMS_", paramMap); } - + ConfigXMLReader.ViewMap viewMap = (view == null ? null : getControllerConfig().viewMapMap.get(view)); if (viewMap == null) { throw new RequestHandlerException("No definition found for view with name [" + view + "]"); } - + String nextPage; if (viewMap.page == null) { @@ -813,7 +813,7 @@ return newURL.toString(); } - + /** * Creates a query string based on the redirect parameters for a request response, if specified, or for all request parameters if no redirect parameters are specified. * @@ -833,12 +833,12 @@ for (Map.Entry<String, String> entry: requestResponse.redirectParameterMap.entrySet()) { String name = entry.getKey(); String from = entry.getValue(); - + Object value = request.getAttribute(from); if (value == null) { value = request.getParameter(from); } - + if (UtilValidate.isNotEmpty(value)) { if (queryString.length() > 1) { queryString.append("&"); @@ -914,7 +914,7 @@ if (requestUri != null) { requestMap = getControllerConfig().requestMapMap.get(requestUri); } - + StringBuilder newURL = new StringBuilder(); boolean didFullSecure = false; @@ -962,12 +962,12 @@ if (encode) { boolean forceManualJsessionid = "false".equals(getServletContext().getInitParameter("cookies")) ? true : false; boolean isSpider = false; - + // if the current request comes from a spider, we will not add the jsessionid to the link if (UtilHttp.checkURLforSpiders(request)) { isSpider = true; } - + // if this isn't a secure page, but we made a secure URL, make sure we manually add the jsessionid since the response.encodeURL won't do that if (!request.isSecure() && didFullSecure) { forceManualJsessionid = true; Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/AbstractJSONEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/AbstractJSONEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/AbstractJSONEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/AbstractJSONEventHandler.java Fri Mar 27 16:58:52 2009 @@ -48,14 +48,14 @@ String respCode = service.invoke(event, requestMap, request, response); // pull out the service response from the request attribute Map<String, Object> attrMap = UtilHttp.getJSONAttributeMap(request); - + // create a JSON Object for return JSONObject json = JSONObject.fromObject(attrMap); String jsonStr = json.toString(); if (jsonStr == null) { throw new EventHandlerException("JSON Object was empty; fatal error!"); } - + // set the X-JSON content type response.setContentType("application/x-json"); // jsonStr.length is not reliable for unicode characters @@ -64,7 +64,7 @@ } catch (UnsupportedEncodingException e) { throw new EventHandlerException("Problems with Json encoding", e); } - + // return the JSON String Writer out; try { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/BsfEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/BsfEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/BsfEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/BsfEventHandler.java Fri Mar 27 16:58:52 2009 @@ -37,7 +37,7 @@ * BsfEventHandler - BSF Event Handler */ public class BsfEventHandler implements EventHandler { - + public static final String module = BsfEventHandler.class.getName(); public static UtilCache<String, String> eventCache = new UtilCache<String, String>("webapp.BsfEvents"); @@ -55,23 +55,23 @@ ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) cl = this.getClass().getClassLoader(); - + if (context == null) { throw new EventHandlerException("Problem getting ServletContext"); } - + try { // create the BSF manager BSFManager bsfManager = new BSFManager(); bsfManager.setClassLoader(cl); - + // expose the event objects to the script bsfManager.declareBean("request", request, HttpServletRequest.class); bsfManager.declareBean("response", response, HttpServletResponse.class); - + // get the script type String scriptType = BSFManager.getLangFromFilename(event.invoke); - + // load the script InputStream scriptStream = null; String scriptString = null; @@ -110,15 +110,15 @@ } } } - + // execute the script Object result = bsfManager.eval(scriptType, cacheName, 0, 0, scriptString); - + // check the result if (result != null && !(result instanceof String)) { throw new EventHandlerException("Event did not return a String result, it returned a " + result.getClass().getName()); } - + return (String) result; } catch (BSFException e) { throw new EventHandlerException("BSF Error", e); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java Fri Mar 27 16:58:52 2009 @@ -61,7 +61,7 @@ * CoreEvents - WebApp Events Related To Framework pieces */ public class CoreEvents { - + public static final String module = CoreEvents.class.getName(); public static final String err_resource = "WebappUiLabels"; @@ -205,7 +205,7 @@ //GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator"); Locale locale = UtilHttp.getLocale(request); TimeZone timeZone = UtilHttp.getTimeZone(request); - + Map<String, Object> params = UtilHttp.getParameterMap(request); // get the schedule parameters String jobName = (String) params.remove("JOB_NAME"); @@ -261,7 +261,7 @@ request.setAttribute("_ERROR_MESSAGE_", "<li>" + errMsg + " [" + serviceName + "]"); return "error"; } - + // make the context valid; using the makeValid method from ModelService Map<String, Object> serviceContext = FastMap.newInstance(); Iterator<String> ci = modelService.getInParamNames().iterator(); @@ -272,7 +272,7 @@ if ("userLogin".equals(name)) continue; // don't include locale, that is also taken care of below if ("locale".equals(name)) continue; - + Object value = request.getParameter(name); // if the parameter wasn't passed and no other value found, don't pass on the null @@ -286,7 +286,7 @@ // still null, give up for this one continue; } - + if (value instanceof String && ((String) value).length() == 0) { // interpreting empty fields as null values for each in back end handling... value = null; @@ -296,21 +296,21 @@ serviceContext.put(name, value); } serviceContext = modelService.makeValid(serviceContext, ModelService.IN_PARAM, true, null, timeZone, locale); - + if (userLogin != null) { serviceContext.put("userLogin", userLogin); } - + if (locale != null) { serviceContext.put("locale", locale); } - + if (!modelService.export && !security.hasPermission("SERVICE_INVOKE_ANY", request.getSession())) { String errMsg = UtilProperties.getMessage(CoreEvents.err_resource, "coreEvents.not_authorized_to_call", locale); request.setAttribute("_ERROR_MESSAGE_", "<li>" + errMsg); return "error"; } - + // some conversions if (serviceTime != null && serviceTime.length() > 0) { try { @@ -403,7 +403,7 @@ request.setAttribute("_ERROR_MESSAGE_", errorBuf.toString()); return "error"; } - + Map<String, Object> syncServiceResult = null; // schedule service try { @@ -417,7 +417,7 @@ request.setAttribute("_ERROR_MESSAGE_", "<li>" + errMsg + e.getMessage()); return "error"; } - + String errMsg = UtilProperties.getMessage(CoreEvents.err_resource, "coreEvents.service_scheduled", locale); request.setAttribute("_EVENT_MESSAGE_", errMsg); if (null!=syncServiceResult) { @@ -426,7 +426,7 @@ } return "success"; } - + public static String saveServiceResultsToSession(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); Locale locale = UtilHttp.getLocale(request); @@ -436,13 +436,13 @@ request.setAttribute("_ERROR_MESSAGE_", "<li>" + errMsg); return "error"; } - + if (null!=request.getParameter("_CLEAR_PREVIOUS_PARAMS_") && request.getParameter("_CLEAR_PREVIOUS_PARAMS_").equalsIgnoreCase("on")) session.removeAttribute("_SAVED_SYNC_RESULT_"); - + Map<String, String[]> serviceFieldsToSave = checkMap(request.getParameterMap(), String.class, String[].class); Map<String, Object> savedFields = FastMap.newInstance(); - + for (String key: serviceFieldsToSave.keySet()) { if (null!=serviceFieldsToSave.get(key) && request.getParameter(key).equalsIgnoreCase("on") && !key.equals("_CLEAR_PREVIOUS_PARAMS_")) { String[] servicePath = key.split("\\|\\|"); @@ -458,7 +458,7 @@ session.setAttribute("_SAVED_SYNC_RESULT_", savedFields); return "success"; } - + //Tries to return a map, if Object is one of Map, GenericEntity, List public static Object getObjectFromServicePath(String servicePath, Map<String, ? extends Object> serviceResult) { String[] sp = servicePath.split("\\|\\|"); @@ -472,7 +472,7 @@ servicePathObject = servicePathMap.get(servicePathEntry); } servicePathMap = null; - + if (servicePathObject instanceof Map) { servicePathMap = checkMap(servicePathObject); }else if (servicePathObject instanceof GenericEntity) { @@ -514,7 +514,7 @@ String serviceName = request.getParameter("serviceName"); String mode = request.getParameter("mode"); Locale locale = UtilHttp.getLocale(request); - + if (UtilValidate.isEmpty(serviceName)) { String errMsg = UtilProperties.getMessage(CoreEvents.err_resource, "coreEvents.must_specify_service_name", locale); request.setAttribute("_ERROR_MESSAGE_", "<li>" + errMsg); @@ -524,12 +524,12 @@ if (UtilValidate.isEmpty(mode)) { mode = "sync"; } - + // now do a security check - + Security security = (Security) request.getAttribute("security"); LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); - + //lookup the service definition to see if this service is externally available, if not require the SERVICE_INVOKE_ANY permission ModelService modelService = null; try { @@ -551,9 +551,9 @@ request.setAttribute("_ERROR_MESSAGE_", "<li>" + errMsg + "."); return "error"; } - + Debug.logInfo("Running service named [" + serviceName + "] from event with mode [" + mode + "]", module); - + // call the service via the ServiceEventHandler which // adapts an event to a service. Event event = new Event("service", mode, serviceName, false); @@ -565,12 +565,12 @@ return "error"; } } - + public static String streamFile(HttpServletRequest request, HttpServletResponse response) { //RequestHandler rh = (RequestHandler) request.getAttribute("_REQUEST_HANDLER_"); String filePath = RequestHandler.getOverrideViewUri(request.getPathInfo()); //String fileName = filePath.substring(filePath.lastIndexOf("/")+1); - + // load the file File file = new File(filePath); if (file.exists()) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/DojoJSONServiceEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/DojoJSONServiceEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/DojoJSONServiceEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/DojoJSONServiceEventHandler.java Fri Mar 27 16:58:52 2009 @@ -112,7 +112,7 @@ if (jsonStr == null) { throw new EventHandlerException("JSON Object was empty; fatal error!"); } - + String htmlJsonStr = "<html><head></head><body><textarea style=\"width: 100%%; height: 100px;\">" + jsonStr + "</textarea></body></html>"; // set the X-JSON content type response.setContentType("text/html"); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/EventHandlerException.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/EventHandlerException.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/EventHandlerException.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/EventHandlerException.java Fri Mar 27 16:58:52 2009 @@ -30,7 +30,7 @@ public EventHandlerException(Throwable t) { super(t); } - + public EventHandlerException(String str) { super(str); } Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/FileUploadProgressListener.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/FileUploadProgressListener.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/FileUploadProgressListener.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/FileUploadProgressListener.java Fri Mar 27 16:58:52 2009 @@ -50,7 +50,7 @@ public long getBytesRead() { return bytesRead; } - + public int getItems() { return items; } Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/GroovyEventHandler.java Fri Mar 27 16:58:52 2009 @@ -34,7 +34,7 @@ import org.ofbiz.webapp.control.ConfigXMLReader.RequestMap; public class GroovyEventHandler implements EventHandler { - + public static final String module = GroovyEventHandler.class.getName(); public void init(ServletContext context) throws EventHandlerException { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JavaEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JavaEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JavaEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JavaEventHandler.java Fri Mar 27 16:58:52 2009 @@ -45,7 +45,7 @@ */ public void init(ServletContext context) throws EventHandlerException { } - + /** * @see org.ofbiz.webapp.event.EventHandler#invoke(Event, org.ofbiz.webapp.control.ConfigXMLReader.RequestMap, HttpServletRequest, HttpServletResponse) */ Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/RomeEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/RomeEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/RomeEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/RomeEventHandler.java Fri Mar 27 16:58:52 2009 @@ -53,7 +53,7 @@ if (this.handler == null) { throw new EventHandlerException("No request handler found in servlet context!"); } - + // get the service event handler this.service = new ServiceEventHandler(); this.service.init(context); @@ -92,7 +92,7 @@ } catch (FeedException e) { throw new EventHandlerException("Unable to write RSS feed", e); } - + return respCode; } } Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java Fri Mar 27 16:58:52 2009 @@ -65,7 +65,7 @@ */ public void init(ServletContext context) throws EventHandlerException { } - + /** * @see org.ofbiz.webapp.event.EventHandler#invoke(Event, org.ofbiz.webapp.control.ConfigXMLReader.RequestMap, HttpServletRequest, HttpServletResponse) */ @@ -145,7 +145,7 @@ } MessageContext mctx = new MessageContext(axisServer); mctx.setEncodingStyle(Constants.URI_LITERAL_ENC); // sets the response encoding - + // get the SOAP message Message msg = null; @@ -183,7 +183,7 @@ sendError(response, "Problem processing the service"); throw new EventHandlerException("Cannot get the envelope", e); } - + List<Object> bodies = null; try { @@ -319,7 +319,7 @@ uri.append(reqInfo); return uri.toString(); } - + public static String messageToString(Message msg) throws SOAPException, IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); msg.writeTo(out); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java Fri Mar 27 16:58:52 2009 @@ -275,7 +275,7 @@ // NOTTODO: may want to allow parameters that map to entity PK fields to be in the URL, but that might be a big security hole since there are certain security sensitive entities that are made of only PK fields, or that only need PK fields to function (like UserLoginSecurityGroup) // NOTTODO: we could allow URL parameters when it is not a POST (ie when !request.getMethod().equalsIgnoreCase("POST")), but that would open a security hole where sensitive parameters can be passed on the URL in a GET/etc and bypass this security constraint } - + // if the service modelParam has allow-html="any" then get this direct from the request instead of in the parameters Map so there will be no canonicalization possibly messing things up if ("any".equals(modelParam.allowHtml)) { value = request.getParameter(name); @@ -283,7 +283,7 @@ // use the rawParametersMap from UtilHttp in order to also get pathInfo parameters, do canonicalization, etc value = rawParametersMap.get(name); } - + // make any composite parameter data (e.g., from a set of parameters {name_c_date, name_c_hour, name_c_minutes}) if (value == null) { value = UtilHttp.makeParamValueFromComposite(request, name, locale); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java Fri Mar 27 16:58:52 2009 @@ -63,9 +63,9 @@ public static final String SYNC = "sync"; public static final String ASYNC = "async"; - + protected ServletContext servletContext; - + /** * @see org.ofbiz.webapp.event.EventHandler#init(javax.servlet.ServletContext) */ @@ -78,7 +78,7 @@ */ public String invoke(Event event, RequestMap requestMap, HttpServletRequest request, HttpServletResponse response) throws EventHandlerException { // TODO: consider changing this to use the new UtilHttp.parseMultiFormData method - + // make sure we have a valid reference to the Service Engine LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); if (dispatcher == null) { @@ -164,7 +164,7 @@ boolean eventGlobalTransaction = controllerConfig.requestMapMap.get(requestUri).event.globalTransaction; Set<String> urlOnlyParameterNames = UtilHttp.getUrlOnlyParameterMap(request).keySet(); - + // big try/finally to make sure commit or rollback are run boolean beganTrans = false; String returnString = null; @@ -199,7 +199,7 @@ Map<String, Object> serviceContext = FastMap.newInstance(); for (ModelParam modelParam: modelService.getInModelParamList()) { String paramName = modelParam.name; - + // Debug.logInfo("In ServiceMultiEventHandler processing input parameter [" + modelParam.name + (modelParam.optional?"(optional):":"(required):") + modelParam.mode + "] for service [" + serviceName + "]", module); // don't include userLogin, that's taken care of below @@ -223,7 +223,7 @@ // first check for request parameters if (value == null) { String name = paramName + curSuffix; - + // special case for security: if this is a request-map defined as secure in controller.xml then only accept body parameters coming in, ie don't allow the insecure URL parameters // NOTE: the RequestHandler will check the HttpSerletRequest security to make sure it is secure if the request-map -> security -> https=true, but we can't just look at the request.isSecure() method here because it is allowed to send secure requests for request-map with https=false if (requestMap != null && requestMap.securityHttps) { @@ -234,7 +234,7 @@ throw new EventHandlerException(errMsg); } } - + String[] paramArr = request.getParameterValues(name); if (paramArr != null) { if (paramArr.length > 1) { @@ -337,7 +337,7 @@ if (UtilValidate.isNotEmpty(errorMessage)) { errorMessages.add(errorMessage); } - + // get the success messages if (!UtilValidate.isEmpty((String)result.get(ModelService.SUCCESS_MESSAGE))) { String newSuccessMessage = (String)result.get(ModelService.SUCCESS_MESSAGE); @@ -403,7 +403,7 @@ returnString = "success"; } } - + return returnString; } } Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java Fri Mar 27 16:58:52 2009 @@ -75,7 +75,7 @@ context.put("outputStream", out); if (Debug.infoOn()) Debug.logInfo("Running service with context: " + context, module); - + Map<String, Object> resp; try { resp = dispatcher.runSync(event.invoke, context); @@ -100,7 +100,7 @@ throw new EventHandlerException(ServiceUtil.getErrorMessage(resp)); } } - + return null; } Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SimpleEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SimpleEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SimpleEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SimpleEventHandler.java Fri Mar 27 16:58:52 2009 @@ -46,7 +46,7 @@ */ public void init(ServletContext context) throws EventHandlerException { } - + /** * @see org.ofbiz.webapp.event.EventHandler#invoke(Event, org.ofbiz.webapp.control.ConfigXMLReader.RequestMap, HttpServletRequest, HttpServletResponse) */ @@ -54,7 +54,7 @@ String xmlResource = event.path; String eventName = event.invoke; Locale locale = UtilHttp.getLocale(request); - + if (Debug.verboseOn()) Debug.logVerbose("[Set path/method]: " + xmlResource + " / " + eventName, module); if (xmlResource == null) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/TestEvent.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/TestEvent.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/TestEvent.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/TestEvent.java Fri Mar 27 16:58:52 2009 @@ -30,7 +30,7 @@ public class TestEvent { public static final String module = TestEvent.class.getName(); - + public static String test(HttpServletRequest request, HttpServletResponse response) { request.setAttribute("MESSAGE", "Test Event Ran Fine."); Debug.log("Test Event Ran Fine.", module); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java Fri Mar 27 16:58:52 2009 @@ -63,7 +63,7 @@ public class WfsEventHandler implements EventHandler { public static final String module = WfsEventHandler.class.getName(); - + public static final String InputTemplateUrl ="component://webapp/script/org/ofbiz/webapp/event/processWfs.ftl"; /** @@ -71,7 +71,7 @@ */ public void init(ServletContext context) throws EventHandlerException { } - + /** Invoke the web event *@param eventPath The path or location of this event *@param eventMethod The method to invoke @@ -103,7 +103,7 @@ // Take "ogc:filter" element and transform it to a Simple Method query script String inputTmplUrl = UtilProperties.getPropertyValue("wfs", "input.template.path", WfsEventHandler.InputTemplateUrl); String xmlScript = processWfsEntity(typeName, queryElem, inputTmplUrl); - + // run simple method script to get a list of entities Document simpleDoc = UtilXml.readXmlDocument(xmlScript); Element simpleElem = simpleDoc.getDocumentElement(); @@ -112,7 +112,7 @@ String retStr = meth.exec(methodContext); //Need to check return string List entityList = (List) request.getAttribute("entityList"); request.setAttribute("entityList", entityList); - + } catch (TemplateException ioe) { sendError(response, "Problem handling event"); throw new EventHandlerException("Problem processing template", ioe); @@ -170,7 +170,7 @@ // uri.append(reqInfo); return uri.toString(); } - + public static String processWfsEntity(String entityName, Node domNode, String templatePath) throws TemplateException, FileNotFoundException, IOException, URISyntaxException { String result = null; NodeModel nodeModel = NodeModel.wrap(domNode); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java Fri Mar 27 16:58:52 2009 @@ -71,7 +71,7 @@ private Boolean enabledForExtensions = null; private Boolean enabledForExceptions = null; - + public void init(ServletContext context) throws EventHandlerException { String delegatorName = context.getInitParameter("entityDelegatorName"); this.delegator = GenericDelegator.getGenericDelegator(delegatorName); @@ -204,7 +204,7 @@ public ServiceRpcHandler() { this.setAuthenticationHandler(new OfbizRpcAuthHandler()); } - + public XmlRpcHandler getHandler(String method) throws XmlRpcNoSuchHandlerException, XmlRpcException { ModelService model = null; try { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java Fri Mar 27 16:58:52 2009 @@ -44,11 +44,11 @@ /** FreemarkerViewHandler - Freemarker Template Engine View Handler. */ public class FreeMarkerViewHandler extends AbstractViewHandler { - + public static final String module = FreeMarkerViewHandler.class.getName(); protected ServletContext servletContext = null; protected Configuration config = (Configuration) FreeMarkerWorker.getDefaultOfbizConfig().clone(); - + public void init(ServletContext context) throws ViewHandlerException { this.servletContext = context; config.setCacheStorage(new OfbizCacheStorage("unknown")); @@ -58,16 +58,16 @@ throw new ViewHandlerException("Could not create file for webapp root path", e); } } - + public void render(String name, String page, String info, String contentType, String encoding, HttpServletRequest request, HttpServletResponse response) throws ViewHandlerException { if (page == null || page.length() == 0) throw new ViewHandlerException("Invalid template source"); - + // make the root context (data model) for freemarker MapStack<String> context = MapStack.create(); prepOfbizRoot(context, request, response); - + // process the template & flush the output try { if (page.startsWith("component://")) { @@ -84,13 +84,13 @@ throw new ViewHandlerException("Problems writing to output stream", ie); } } - + public static void prepOfbizRoot(Map<String, Object> root, HttpServletRequest request, HttpServletResponse response) { ServletContext servletContext = (ServletContext) request.getAttribute("servletContext"); HttpSession session = request.getSession(); - + BeansWrapper wrapper = BeansWrapper.getDefaultInstance(); - + // add in the OFBiz objects root.put("delegator", request.getAttribute("delegator")); root.put("dispatcher", request.getAttribute("dispatcher")); @@ -99,13 +99,13 @@ // add the response object (for transforms) to the context as a BeanModel root.put("response", response); - + // add the application object (for transforms) to the context as a BeanModel root.put("application", servletContext); - + // add the servlet context -- this has been deprecated, and now requires servlet, do we really need it? //root.put("applicationAttributes", new ServletContextHashModel(servletContext, BeansWrapper.getDefaultInstance())); - + // add the session object (for transforms) to the context as a BeanModel root.put("session", session); @@ -121,7 +121,7 @@ // add the request parameters -- this now uses a Map from UtilHttp Map<String, Object> requestParameters = UtilHttp.getParameterMap(request); root.put("requestParameters", requestParameters); - + // add the TabLibFactory TaglibFactory JspTaglibs = new TaglibFactory(servletContext); root.put("JspTaglibs", JspTaglibs); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizAmountTransform.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizAmountTransform.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizAmountTransform.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizAmountTransform.java Fri Mar 27 16:58:52 2009 @@ -44,7 +44,7 @@ public static final String module = OfbizAmountTransform.class.getName(); public static final String SPELLED_OUT_FORMAT = "spelled-out"; - + private static String getArg(Map args, String key) { String result = ""; Object o = args.get(key); @@ -90,7 +90,7 @@ } return Double.valueOf(0.00); } - + public Writer getWriter(final Writer out, Map args) { final StringBuilder buf = new StringBuilder(); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCacheStorage.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCacheStorage.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCacheStorage.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCacheStorage.java Fri Mar 27 16:58:52 2009 @@ -28,23 +28,23 @@ public class OfbizCacheStorage implements CacheStorage { //can't have global cache because names/keys are relative to the webapp protected final UtilCache<Object, Object> localCache; - + public OfbizCacheStorage(String id) { this.localCache = new UtilCache<Object, Object>("webapp.FreeMarkerCache." + id, 0, 0, false); } - + public Object get(Object key) { return localCache.get(key); } - + public void put(Object key, Object value) { localCache.put(key, value); } - + public void remove(Object key) { localCache.remove(key); } - + public void clear() { localCache.clear(); } Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java Fri Mar 27 16:58:52 2009 @@ -38,9 +38,9 @@ * OfbizContentTransform - Freemarker Transform for content links */ public class OfbizContentTransform implements TemplateTransformModel { - + public final static String module = OfbizUrlTransform.class.getName(); - + public Writer getWriter(final Writer out, Map args) { final StringBuilder buf = new StringBuilder(); return new Writer(out) { @@ -57,9 +57,9 @@ Environment env = Environment.getCurrentEnvironment(); BeanModel req = (BeanModel)env.getVariable("request"); HttpServletRequest request = req == null ? null : (HttpServletRequest) req.getWrappedObject(); - + String requestUrl = buf.toString(); - + // make the link StringBuffer newURL = new StringBuffer(); ContentUrlTag.appendContentPrefix(request, newURL); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java Fri Mar 27 16:58:52 2009 @@ -109,7 +109,7 @@ } return 0; } - + public Writer getWriter(final Writer out, Map args) { final StringBuilder buf = new StringBuilder(); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java Fri Mar 27 16:58:52 2009 @@ -44,7 +44,7 @@ public class OfbizUrlTransform implements TemplateTransformModel { public final static String module = OfbizUrlTransform.class.getName(); - + public boolean checkArg(Map args, String key, boolean defaultValue) { if (!args.containsKey(key)) { return defaultValue; @@ -57,13 +57,13 @@ return defaultValue; } } - + public Writer getWriter(final Writer out, Map args) { final StringBuilder buf = new StringBuilder(); final boolean fullPath = checkArg(args, "fullPath", false); final boolean secure = checkArg(args, "secure", false); final boolean encode = checkArg(args, "encode", true); - + return new Writer(out) { public void write(char cbuf[], int off, int len) { buf.append(cbuf, off, len); @@ -86,9 +86,9 @@ if (res != null) { response = (HttpServletResponse) res.getWrappedObject(); } - + String requestUrl = buf.toString(); - + // make the link RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_"); out.write(rh.makeLink(request, response, requestUrl, fullPath, secure, encode)); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/RenderWrappedTextTransform.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/RenderWrappedTextTransform.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/RenderWrappedTextTransform.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/RenderWrappedTextTransform.java Fri Mar 27 16:58:52 2009 @@ -36,7 +36,7 @@ public class RenderWrappedTextTransform implements TemplateTransformModel { public static final String module = RenderWrappedTextTransform.class.getName(); - + public Writer getWriter(final Writer out, Map args) { final Environment env = Environment.getCurrentEnvironment(); Map<String, Object> ctx = checkMap(FreeMarkerWorker.getWrappedObject("context", env), String.class, Object.class); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/SetRequestAttributeMethod.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/SetRequestAttributeMethod.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/SetRequestAttributeMethod.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/SetRequestAttributeMethod.java Fri Mar 27 16:58:52 2009 @@ -33,7 +33,7 @@ * SetRequestAttributeMethod - Freemarker Method for setting request attributes */ public class SetRequestAttributeMethod implements TemplateMethodModelEx { - + public static final String module = SetRequestAttributeMethod.class.getName(); /* @@ -46,11 +46,11 @@ throw new TemplateModelException("First argument not an instance of TemplateScalarModel"); if (!(args.get(1) instanceof BeanModel) && !(args.get(1) instanceof TemplateNumberModel) && !(args.get(1) instanceof TemplateScalarModel)) throw new TemplateModelException("Second argument not an instance of BeanModel nor TemplateNumberModel nor TemplateScalarModel"); - + Environment env = Environment.getCurrentEnvironment(); BeanModel req = (BeanModel)env.getVariable("request"); HttpServletRequest request = (HttpServletRequest) req.getWrappedObject(); - + String name = ((TemplateScalarModel) args.get(0)).getAsString(); Object value = null; if (args.get(1) instanceof TemplateScalarModel) @@ -59,7 +59,7 @@ value = ((TemplateNumberModel) args.get(1)).getAsNumber(); if (args.get(1) instanceof BeanModel) value = ((BeanModel) args.get(1)).getWrappedObject(); - + request.setAttribute(name, value); return new SimpleScalar(""); } Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/Region.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/Region.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/Region.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/Region.java Fri Mar 27 16:58:52 2009 @@ -37,7 +37,7 @@ * <br/>Implements abstract render(PageContext) from Content */ public class Region extends Content { - + public static final String module = Region.class.getName(); private Map<String, Section> sections = FastMap.newInstance(); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/RegionManager.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/RegionManager.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/RegionManager.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/RegionManager.java Fri Mar 27 16:58:52 2009 @@ -35,22 +35,22 @@ * A class to manage the region cache and read a region XML file */ public class RegionManager { - + public static final String module = RegionManager.class.getName(); protected static UtilCache<URL, Map<String, Region>> regionCache = new UtilCache<URL, Map<String, Region>>("webapp.Regions.Config", 0, 0); - + protected URL regionFile = null; - + public RegionManager(URL regionFile) { this.regionFile = regionFile; if (regionFile == null) throw new IllegalArgumentException("regionFile cannot be null"); - + //This may seem a bit funny, but we want to keep it in the cache so that it can be reloaded easily // Also note that we do not check to see if it is already there, in all cases we want to re-load the definition regionCache.put(regionFile, readRegionXml(regionFile)); } - + public Map<String, Region> getRegions() { Map<String, Region> regions = regionCache.get(regionFile); if (regions == null) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/RenderTag.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/RenderTag.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/RenderTag.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/RenderTag.java Fri Mar 27 16:58:52 2009 @@ -27,9 +27,9 @@ * Tag to render a region */ public class RenderTag extends RegionTag { - + public static final String module = RenderTag.class.getName(); - + private String sectionName = null; private String role = null; private String permission = null; Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/Section.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/Section.java?rev=759243&r1=759242&r2=759243&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/Section.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/region/Section.java Fri Mar 27 16:58:52 2009 @@ -45,7 +45,7 @@ protected final String name; protected final String info; protected RegionManager regionManager; - + public final static String module = Section.class.getName(); public Section(String name, String info, String content, String type, RegionManager regionManager) { |
Free forum by Nabble | Edit this page |