Author: doogie
Date: Sat Mar 21 23:24:13 2009 New Revision: 757074 URL: http://svn.apache.org/viewvc?rev=757074&view=rev Log: Fix purely empty whitespace lines, and remove trailing whitespace. Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangException.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMapProcessor.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethodBsfEngine.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleServiceEngine.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ContextAccessor.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/FieldObject.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/FieldString.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodObject.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodOperation.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodString.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/StringObject.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/StringString.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/AddError.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallBsh.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallServiceAsynch.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMapProcessor.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CheckErrors.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CreateObject.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/FlexibleMessage.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/Return.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/SetServiceFields.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Assert.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/CombinedCondition.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareCondition.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/CompareFieldCondition.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Conditional.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/ConditionalFactory.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/ElseIf.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/EmptyCondition.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/MasterIf.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/RegexpCondition.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/ValidateMethodCondition.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/While.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/ClearCacheLine.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/ClearEntityCaches.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/CloneValue.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/CreateValue.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityAnd.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCondition.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityOne.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FilterListByAnd.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FilterListByDate.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelatedOne.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeNextSeqId.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeValue.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/NowDateToEnv.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/NowTimestampToEnv.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/OrderValueList.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/RefreshValue.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveByAnd.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveList.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveRelated.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveValue.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/SequencedIdToEnv.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/SetCurrentUserLogin.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/SetNonpkFields.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/SetPkFields.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreList.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreValue.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionBegin.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionCommit.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionRollback.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/ClearField.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/EnvToEnv.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/EnvToField.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToEnv.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToField.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToList.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/FirstFromList.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/Iterate.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/IterateMap.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/ListToList.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/Loop.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/MapToMap.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/OrderMapList.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/StringAppend.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/StringToField.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/StringToList.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/ToString.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToRequest.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToSession.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestParametersToList.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestToField.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/SessionToField.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckId.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfCompare.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfCompareField.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfEmpty.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfHasPermission.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfInstanceOf.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfNotEmpty.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfRegexp.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfValidateMethod.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/otherops/Log.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/otherops/PropertyToField.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/serviceops/FieldToResult.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/BaseCompare.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/Compare.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/CompareField.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/ConstantOper.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/Convert.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/Copy.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/InFieldOper.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/MakeInString.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/MakeInStringOperation.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/MapProcessor.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/NotEmpty.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/PropertyOper.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/Regexp.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/SimpleMapOperation.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/SimpleMapProcess.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/operation/ValidateMethod.java Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangException.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangException.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangException.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangException.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMapProcessor.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMapProcessor.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMapProcessor.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMapProcessor.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -96,7 +96,7 @@ } methodOperationFactories = Collections.unmodifiableMap(mapFactories); } - + public static final String module = SimpleMethod.class.getName(); public static final String err_resource = "MiniLangErrorUiLabels"; @@ -254,7 +254,7 @@ if (UtilValidate.isEmpty(fromLocation)) { fromLocation = "<location not known>"; } - + Map<String, SimpleMethod> simpleMethods = FastMap.newInstance(); // read in the file @@ -531,7 +531,7 @@ public String getUserLoginEnvName() { return this.userLoginName; } - + public Set<String> getAllServiceNamesCalled() throws MiniLangException { Set<String> allServiceNames = FastSet.newInstance(); Set<String> simpleMethodsVisited = FastSet.newInstance(); @@ -549,7 +549,7 @@ } else if (methodOperation instanceof SetServiceFields) { String svcName = ((SetServiceFields) methodOperation).getServiceName(); if (UtilValidate.isNotEmpty(svcName)) allServiceNames.add(svcName); - + } else if (methodOperation instanceof CallSimpleMethod) { CallSimpleMethod csm = (CallSimpleMethod) methodOperation; try { @@ -630,7 +630,7 @@ } else if (methodOperation instanceof GetRelatedOne) { String relationName = ((GetRelatedOne) methodOperation).getRelationName(); if (UtilValidate.isNotEmpty(relationName)) allEntityNames.add(relationName); - + } else if (methodOperation instanceof CallSimpleMethod) { CallSimpleMethod csm = (CallSimpleMethod) methodOperation; try { @@ -681,7 +681,7 @@ // always put the null field object in as "null" methodContext.putEnv("null", GenericEntity.NULL_FIELD); methodContext.putEnv("nullField", GenericEntity.NULL_FIELD); - + methodContext.putEnv(delegatorName, methodContext.getDelegator()); methodContext.putEnv(securityName, methodContext.getSecurity()); methodContext.putEnv(dispatcherName, methodContext.getDispatcher()); @@ -693,14 +693,14 @@ methodContext.putEnv(eventSessionName, methodContext.getRequest().getSession()); methodContext.putEnv(eventResponseName, methodContext.getResponse()); } - + methodContext.putEnv("methodName", this.getMethodName()); methodContext.putEnv("methodShortDescription", this.getShortDescription()); GenericValue userLogin = methodContext.getUserLogin(); Locale locale = methodContext.getLocale(); - + if (userLogin != null) { methodContext.putEnv(userLoginName, userLogin); } @@ -749,31 +749,31 @@ finished = runSubOps(methodOperations, methodContext); } catch (Throwable t) { // make SURE nothing gets thrown through - String errMsg = UtilProperties.getMessage(SimpleMethod.err_resource, "simpleMethod.error_running", locale) + ": " + t.getMessage(); + String errMsg = UtilProperties.getMessage(SimpleMethod.err_resource, "simpleMethod.error_running", locale) + ": " + t.getMessage(); Debug.logError(errMsg, module); finished = false; errorMsg += errMsg + "<br/>"; } - + String returnValue = null; String response = null; StringBuilder summaryErrorStringBuffer = new StringBuilder(); if (methodContext.getMethodType() == MethodContext.EVENT) { boolean forceError = false; - + String tempErrorMsg = (String) methodContext.getEnv(eventErrorMessageName); if (errorMsg.length() > 0 || (tempErrorMsg != null && tempErrorMsg.length() > 0)) { errorMsg += tempErrorMsg; methodContext.getRequest().setAttribute("_ERROR_MESSAGE_", errorMsg); forceError = true; - + summaryErrorStringBuffer.append(errorMsg); } List<Object> tempErrorMsgList = UtilGenerics.checkList(methodContext.getEnv(eventErrorMessageListName)); if (UtilValidate.isNotEmpty(tempErrorMsgList)) { methodContext.getRequest().setAttribute("_ERROR_MESSAGE_LIST_", tempErrorMsgList); forceError = true; - + summaryErrorStringBuffer.append("; "); summaryErrorStringBuffer.append(tempErrorMsgList.toString()); } @@ -803,7 +803,7 @@ returnValue = response; } else if (methodContext.getMethodType() == MethodContext.SERVICE) { boolean forceError = false; - + String tempErrorMsg = (String) methodContext.getEnv(serviceErrorMessageName); if (errorMsg.length() > 0 || (tempErrorMsg != null && tempErrorMsg.length() > 0)) { errorMsg += tempErrorMsg; @@ -817,7 +817,7 @@ if (UtilValidate.isNotEmpty(errorMsgList)) { methodContext.putResult(ModelService.ERROR_MESSAGE_LIST, errorMsgList); forceError = true; - + summaryErrorStringBuffer.append("; "); summaryErrorStringBuffer.append(errorMsgList.toString()); } @@ -826,7 +826,7 @@ if (UtilValidate.isNotEmpty(errorMsgMap)) { methodContext.putResult(ModelService.ERROR_MESSAGE_MAP, errorMsgMap); forceError = true; - + summaryErrorStringBuffer.append("; "); summaryErrorStringBuffer.append(errorMsgMap.toString()); } @@ -884,7 +884,7 @@ errorMsg += errMsg + "<br/>"; } } - + return returnValue; } @@ -912,7 +912,7 @@ } } - /** Execs the given operations returning true if all return true, or returning + /** Execs the given operations returning true if all return true, or returning * false and stopping if any return false. */ public static boolean runSubOps(List<MethodOperation> methodOperations, MethodContext methodContext) { Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethodBsfEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethodBsfEngine.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethodBsfEngine.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleMethodBsfEngine.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -36,31 +36,31 @@ * <P>This is the OFBiz MiniLang SimpleMethod adapter for IBM's Bean Scripting Famework. * It is an implementation of the BSFEngine class, allowing BSF aware * applications to use SimpleMethod as a scripting language. - * + * * <P>There should only be ONE simple-method in the XML file and it will be run as an event. */ public class SimpleMethodBsfEngine extends BSFEngineImpl { - + public static final String module = SimpleMethodBsfEngine.class.getName(); - + protected Map<String, Object> context = FastMap.newInstance(); - + public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); - + // declare the bsf manager for callbacks, etc. context.put("bsf", mgr); - + for(int i=0; i<declaredBeans.size(); i++) { BSFDeclaredBean bean = (BSFDeclaredBean)declaredBeans.get(i); declareBean(bean); } } - + public void setDebug(boolean debug) { //interpreter.DEBUG=debug; } - + /** * Invoke method name on the specified scripted object. * The object may be null to indicate the global namespace of the @@ -70,8 +70,8 @@ public Object call(Object object, String name, Object[] args) throws BSFException { throw new BSFException("The call method is not yet supported for SimpleMethods"); } - - + + /** * This is an implementation of the apply() method. * It exectutes the funcBody text in an "anonymous" method call with @@ -80,10 +80,10 @@ public Object apply(String source, int lineNo, int columnNo, Object funcBody, Vector namesVec, Vector argsVec) throws BSFException { //if (namesVec.size() != argsVec.size()) throw new BSFException("number of params/names mismatch"); //if (!(funcBody instanceof String)) throw new BSFException("apply: function body must be a string"); - + throw new BSFException("The apply method is not yet supported for simple-methods"); } - + public Object eval(String source, int lineNo, int columnNo, Object expr) throws BSFException { if (!(expr instanceof String)) throw new BSFException("simple-method expression must be a string"); @@ -105,13 +105,13 @@ return simpleMethod.exec(methodContext); //methodContext.getResults(); } - - + + public void exec(String source, int lineNo, int columnNo, Object script) throws BSFException { eval(source, lineNo, columnNo, script); } - - + + /* public void compileApply (String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments, CodeBuffer cb) @@ -123,17 +123,17 @@ public void compileScript (String source, int lineNo, int columnNo, Object script, CodeBuffer cb) throws BSFException; */ - + public void declareBean(BSFDeclaredBean bean) throws BSFException { context.put(bean.name, bean.bean); } - + public void undeclareBean(BSFDeclaredBean bean) throws BSFException { context.remove(bean.name); } - + public void terminate() { } - + private String sourceInfo(String source, int lineNo, int columnNo) { return "SimpleMethod: " + source + " at line: " + lineNo +" column: " + columnNo; } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleServiceEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleServiceEngine.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleServiceEngine.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/SimpleServiceEngine.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -39,7 +39,7 @@ /** Run the service synchronously and IGNORE the result * @param context Map of name, value pairs composing the context */ - public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { Map<String, Object> result = runSync(localName, modelService, context); } @@ -47,7 +47,7 @@ * @param context Map of name, value pairs composing the context * @return Map of name, value pairs composing the result */ - public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { Map<String, Object> result = serviceInvoker(localName, modelService, context); if (result == null) throw new GenericServiceException("Service did not return expected result"); @@ -55,7 +55,7 @@ } // Invoke the simple method from a service context - private Map<String, Object> serviceInvoker(String localName, ModelService modelService, Map<String, ? extends Object> context) throws GenericServiceException { + private Map<String, Object> serviceInvoker(String localName, ModelService modelService, Map<String, ? extends Object> context) throws GenericServiceException { // static java service methods should be: public Map methodName(DispatchContext dctx, Map context) DispatchContext dctx = dispatcher.getLocalContext(localName); @@ -69,7 +69,7 @@ if (dctx != null) classLoader = dctx.getClassLoader(); - // if the classLoader is null, no big deal, SimpleMethod will use the + // if the classLoader is null, no big deal, SimpleMethod will use the // current thread's ClassLoader by default if null passed in try { Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ContextAccessor.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ContextAccessor.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ContextAccessor.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ContextAccessor.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -36,7 +36,7 @@ public ContextAccessor(String name) { init(name); } - + public ContextAccessor(String name, String defaultName) { if (name == null || name.length() == 0) { init(defaultName); @@ -44,62 +44,62 @@ init(name); } } - + protected void init(String name) { this.name = name; this.fma = FlexibleMapAccessor.getInstance(name); } - + public boolean isEmpty() { return this.fma.isEmpty(); } - + /** Based on name get from Map or from List in Map */ public T get(MethodContext methodContext) { return UtilGenerics.<T>cast(methodContext.getEnv(fma)); } - + /** Based on name put in Map or from List in Map; * If the brackets for a list are empty the value will be appended to the list, * otherwise the value will be set in the position of the number in the brackets. - * If a "+" (plus sign) is included inside the square brackets before the index + * If a "+" (plus sign) is included inside the square brackets before the index * number the value will inserted/added at that point instead of set at the point. */ public void put(MethodContext methodContext, T value) { methodContext.putEnv(fma, value); } - + /** Based on name remove from Map or from List in Map */ public T remove(MethodContext methodContext) { return UtilGenerics.<T>cast(methodContext.removeEnv(fma)); } - + /** Based on name get from Map or from List in Map */ public T get(Map<String, ? extends Object> theMap, MethodContext methodContext) { return fma.get(theMap); } - + /** Based on name put in Map or from List in Map; * If the brackets for a list are empty the value will be appended to the list, * otherwise the value will be set in the position of the number in the brackets. - * If a "+" (plus sign) is included inside the square brackets before the index + * If a "+" (plus sign) is included inside the square brackets before the index * number the value will inserted/added at that point instead of set at the point. */ public void put(Map<String, Object> theMap, T value, MethodContext methodContext) { fma.put(theMap, value); } - + /** Based on name remove from Map or from List in Map */ public T remove(Map<String, ? extends Object> theMap, MethodContext methodContext) { return fma.remove(theMap); } - - /** The equals and hashCode methods are imnplemented just case this object is ever accidently used as a Map key */ + + /** The equals and hashCode methods are imnplemented just case this object is ever accidently used as a Map key */ public int hashCode() { return this.name.hashCode(); } - /** The equals and hashCode methods are imnplemented just case this object is ever accidently used as a Map key */ + /** The equals and hashCode methods are imnplemented just case this object is ever accidently used as a Map key */ public boolean equals(Object obj) { if (obj instanceof ContextAccessor) { ContextAccessor<?> contextAccessor = (ContextAccessor<?>) obj; @@ -116,7 +116,7 @@ } } - /** To be used for a string representation of the accessor, returns the original name. */ + /** To be used for a string representation of the accessor, returns the original name. */ public String toString() { return this.name; } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/FieldObject.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/FieldObject.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/FieldObject.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/FieldObject.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -28,9 +28,9 @@ * A type of MethodObject that represents an Object value in a certain location */ public class FieldObject<T> extends MethodObject<T> { - + public static final String module = FieldObject.class.getName(); - + ContextAccessor<T> fieldAcsr; ContextAccessor<Map<String, ? extends Object>> mapAcsr; String type; @@ -40,7 +40,7 @@ // the schema for this element now just has the "field" attribute, though the old "field-name" and "map-name" pair is still supported fieldAcsr = new ContextAccessor<T>(element.getAttribute("field"), element.getAttribute("field-name")); mapAcsr = new ContextAccessor<Map<String, ? extends Object>>(element.getAttribute("map-name")); - + type = element.getAttribute("type"); if (UtilValidate.isEmpty(type)) { type = "String"; @@ -51,7 +51,7 @@ public String getTypeName() { return type; } - + public Class<T> getTypeClass(ClassLoader loader) { try { return UtilGenerics.cast(ObjectType.loadClass(type, loader)); @@ -60,7 +60,7 @@ return null; } } - + public T getObject(MethodContext methodContext) { T fieldVal = null; @@ -80,7 +80,7 @@ if (Debug.infoOn()) Debug.logInfo("Field value not found with name " + fieldAcsr + " in Map with name " + mapAcsr + ", not getting Object value, returning null.", module); return null; } - + return fieldVal; } } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/FieldString.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/FieldString.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/FieldString.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/FieldString.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -28,9 +28,9 @@ * A type of MethodString that represents a String constant value */ public class FieldString extends MethodString { - + public static final String module = FieldString.class.getName(); - + ContextAccessor<Object> fieldAcsr; ContextAccessor<Map<String, ? extends Object>> mapAcsr; @@ -58,7 +58,7 @@ if (Debug.infoOn()) Debug.logInfo("Field value not found with name " + fieldAcsr + " in Map with name " + mapAcsr + ", not getting string value", module); return ""; } - + return fieldVal.toString(); } } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -44,7 +44,7 @@ * A single operation, does the specified operation on the given field */ public class MethodContext implements Iterable<Map.Entry<String, Object>> { - + public static final int EVENT = 1; public static final int SERVICE = 2; @@ -110,10 +110,10 @@ } /** - * This is a very simple constructor which assumes the needed objects (dispatcher, - * delegator, security, request, response, etc) are in the context. + * This is a very simple constructor which assumes the needed objects (dispatcher, + * delegator, security, request, response, etc) are in the context. * Will result in calling method as a service or event, as specified. - */ + */ public MethodContext(Map<String, ? extends Object> context, ClassLoader loader, int methodType) { this.methodType = methodType; this.parameters = UtilMisc.makeMapWritable(context); @@ -130,8 +130,8 @@ this.response = (HttpServletResponse) context.get("response"); if (this.locale == null) this.locale = UtilHttp.getLocale(request); if (this.timeZone == null) this.timeZone = UtilHttp.getTimeZone(request); - - //make sure the delegator and other objects are in place, getting from + + //make sure the delegator and other objects are in place, getting from // request if necessary; assumes this came through the ControlServlet // or something similar if (this.request != null) { @@ -143,7 +143,7 @@ } else if (methodType == MethodContext.SERVICE) { this.results = FastMap.newInstance(); } - + if (this.loader == null) { try { this.loader = Thread.currentThread().getContextClassLoader(); @@ -152,7 +152,7 @@ } } } - + public void setErrorReturn(String errMsg, SimpleMethod simpleMethod) { if (getMethodType() == MethodContext.EVENT) { putEnv(simpleMethod.getEventErrorMessageName(), errMsg); @@ -170,13 +170,13 @@ public Map<String, Object> getEnvMap() { return this.env; } - + /** Gets the named value from the environment. Supports the "." (dot) syntax to access Map members and the - * "[]" (bracket) syntax to access List entries. This value is expanded, supporting the insertion of other + * "[]" (bracket) syntax to access List entries. This value is expanded, supporting the insertion of other * environment values using the "${}" notation. - * + * * @param key The name of the environment value to get. Can contain "." and "[]" syntax elements as described above. - * @return The environment value if found, otherwise null. + * @return The environment value if found, otherwise null. */ public <T> T getEnv(String key) { String ekey = this.expandString(key); @@ -188,14 +188,14 @@ } /** Puts the named value in the environment. Supports the "." (dot) syntax to access Map members and the - * "[]" (bracket) syntax to access List entries. + * "[]" (bracket) syntax to access List entries. * If the brackets for a list are empty the value will be appended to end of the list, * otherwise the value will be set in the position of the number in the brackets. - * If a "+" (plus sign) is included inside the square brackets before the index + * If a "+" (plus sign) is included inside the square brackets before the index * number the value will inserted/added at that index instead of set at that index. - * This value is expanded, supporting the insertion of other + * This value is expanded, supporting the insertion of other * environment values using the "${}" notation. - * + * * @param key The name of the environment value to get. Can contain "." syntax elements as described above. * @param value The value to set in the named environment location. */ @@ -208,8 +208,8 @@ fma.put(this.env, value); } - /** Calls putEnv for each entry in the Map, thus allowing for the additional flexibility in naming - * supported in that method. + /** Calls putEnv for each entry in the Map, thus allowing for the additional flexibility in naming + * supported in that method. */ public void putAllEnv(Map<String, ? extends Object> values) { for (Map.Entry<String, ? extends Object> entry: values.entrySet()) { @@ -218,9 +218,9 @@ } /** Removes the named value from the environment. Supports the "." (dot) syntax to access Map members and the - * "[]" (bracket) syntax to access List entries. This value is expanded, supporting the insertion of other + * "[]" (bracket) syntax to access List entries. This value is expanded, supporting the insertion of other * environment values using the "${}" notation. - * + * * @param key The name of the environment value to get. Can contain "." syntax elements as described above. */ public <T> T removeEnv(String key) { @@ -255,7 +255,7 @@ public ClassLoader getLoader() { return this.loader; } - + public Locale getLocale() { return this.locale; } @@ -304,7 +304,7 @@ public Map<String, Object> getResults() { return this.results; } - + /** Expands environment variables delimited with ${} */ public String expandString(String original) { return FlexibleStringExpander.expandString(original, this.env); Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodObject.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodObject.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodObject.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodObject.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -25,7 +25,7 @@ * A single Object value to be used as a parameter or whatever */ public abstract class MethodObject<T> { - + protected SimpleMethod simpleMethod; public MethodObject(Element element, SimpleMethod simpleMethod) { @@ -34,10 +34,10 @@ /** Get the name for the type of the object */ public abstract String getTypeName(); - + /** Get the Class for the type of the object */ public abstract Class<T> getTypeClass(ClassLoader loader); - + /** Get the Object value */ public abstract T getObject(MethodContext methodContext); } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodOperation.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodOperation.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodOperation.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodOperation.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -41,13 +41,13 @@ public @interface DeprecatedOperation { String value(); } - + protected SimpleMethod simpleMethod; public MethodOperation(Element element, SimpleMethod simpleMethod) { this.simpleMethod = simpleMethod; } - + public SimpleMethod getSimpleMethod() { return this.simpleMethod; } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodString.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodString.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodString.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodString.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -25,7 +25,7 @@ * A single String value, generally meant to be combined with others */ public abstract class MethodString { - + protected SimpleMethod simpleMethod; public MethodString(Element element, SimpleMethod simpleMethod) { Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/StringObject.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/StringObject.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/StringObject.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/StringObject.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -27,7 +27,7 @@ * A type of MethodObject that represents a String constant value to be used as an Object */ public class StringObject extends MethodObject<String> { - + String value; String cdataValue; @@ -41,18 +41,18 @@ public String getTypeName() { return "java.lang.String"; } - + public Class<String> getTypeClass(ClassLoader loader) { return java.lang.String.class; } - + public String getObject(MethodContext methodContext) { String value = methodContext.expandString(this.value); String cdataValue = methodContext.expandString(this.cdataValue); - + boolean valueExists = UtilValidate.isNotEmpty(value); boolean cdataValueExists = UtilValidate.isNotEmpty(cdataValue); - + if (valueExists && cdataValueExists) { return value + cdataValue; } else { Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/StringString.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/StringString.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/StringString.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/StringString.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -26,7 +26,7 @@ * A type of MethodString that represents a String constant value */ public class StringString extends MethodString { - + String value; String cdataValue; @@ -39,10 +39,10 @@ public String getString(MethodContext methodContext) { String value = methodContext.expandString(this.value); String cdataValue = methodContext.expandString(this.cdataValue); - + boolean valueExists = UtilValidate.isNotEmpty(value); boolean cdataValueExists = UtilValidate.isNotEmpty(cdataValue); - + if (valueExists && cdataValueExists) { return value + cdataValue; } else { Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/AddError.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/AddError.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/AddError.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/AddError.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -78,7 +78,7 @@ public void addMessage(List<Object> messages, ClassLoader loader, MethodContext methodContext) { String message = methodContext.expandString(this.message); String propertyResource = methodContext.expandString(this.propertyResource); - + if (!isProperty && message != null) { messages.add(message); // if (Debug.infoOn()) Debug.logInfo("[SimpleMapOperation.addMessage] Adding message: " + message, module); Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallBsh.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallBsh.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallBsh.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallBsh.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -43,9 +43,9 @@ return "call-bsh"; } } - + public static final String module = CallBsh.class.getName(); - + public static final int bufferLength = 4096; String inline = null; Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -42,7 +42,7 @@ return "call-class-method"; } } - + public static final String module = CallClassMethod.class.getName(); String className; @@ -60,15 +60,15 @@ // the schema for this element now just has the "ret-field" attribute, though the old "ret-field-name" and "ret-map-name" pair is still supported retFieldAcsr = new ContextAccessor<Object>(element.getAttribute("ret-field"), element.getAttribute("ret-field-name")); retMapAcsr = new ContextAccessor<Map<String, Object>>(element.getAttribute("ret-map-name")); - + List<? extends Element> parameterElements = UtilXml.childElementList(element); if (parameterElements.size() > 0) { parameters = FastList.newInstance(); - + for (Element parameterElement: parameterElements) { MethodObject<?> methodObject = null; if ("string".equals(parameterElement.getNodeName())) { - methodObject = new StringObject(parameterElement, simpleMethod); + methodObject = new StringObject(parameterElement, simpleMethod); } else if ("field".equals(parameterElement.getNodeName())) { methodObject = new FieldObject<Object>(parameterElement, simpleMethod); } else { @@ -85,7 +85,7 @@ public boolean exec(MethodContext methodContext) { String className = methodContext.expandString(this.className); String methodName = methodContext.expandString(this.methodName); - + Class<?> methodClass = null; try { methodClass = ObjectType.loadClass(className, methodContext.getLoader()); @@ -96,7 +96,7 @@ methodContext.setErrorReturn(errMsg, simpleMethod); return false; } - + return CallObjectMethod.callMethod(simpleMethod, methodContext, parameters, methodClass, null, methodName, retFieldAcsr, retMapAcsr); } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -43,7 +43,7 @@ return "call-object-method"; } } - + public static final String module = CallClassMethod.class.getName(); ContextAccessor<Object> objFieldAcsr; @@ -60,21 +60,21 @@ // the schema for this element now just has the "obj-field" attribute, though the old "obj-field-name" and "obj-map-name" pair is still supported objFieldAcsr = new ContextAccessor<Object>(element.getAttribute("obj-field"), element.getAttribute("obj-field-name")); objMapAcsr = new ContextAccessor<Map<String, ? extends Object>>(element.getAttribute("obj-map-name")); - + methodName = element.getAttribute("method-name"); - + // the schema for this element now just has the "ret-field" attribute, though the old "ret-field-name" and "ret-map-name" pair is still supported retFieldAcsr = new ContextAccessor<Object>(element.getAttribute("ret-field"), element.getAttribute("ret-field-name")); retMapAcsr = new ContextAccessor<Map<String, Object>>(element.getAttribute("ret-map-name")); - + List<? extends Element> parameterElements = UtilXml.childElementList(element); if (parameterElements.size() > 0) { parameters = FastList.newInstance(); - + for (Element parameterElement: parameterElements) { MethodObject methodObject = null; if ("string".equals(parameterElement.getNodeName())) { - methodObject = new StringObject(parameterElement, simpleMethod); + methodObject = new StringObject(parameterElement, simpleMethod); } else if ("field".equals(parameterElement.getNodeName())) { methodObject = new FieldObject<Object>(parameterElement, simpleMethod); } else { @@ -96,7 +96,7 @@ Map<String, ? extends Object> fromMap = objMapAcsr.get(methodContext); if (fromMap == null) { Debug.logWarning("Map not found with name " + objMapAcsr + ", which should contain the object to execute a method on; not executing method, rerturning error.", module); - + String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process [Map not found with name " + objMapAcsr + ", which should contain the object to execute a method on]"; methodContext.setErrorReturn(errMsg, simpleMethod); return false; @@ -109,7 +109,7 @@ if (methodObject == null) { if (Debug.infoOn()) Debug.logInfo("Object not found to execute method on with name " + objFieldAcsr + " in Map with name " + objMapAcsr + ", not executing method, rerturning error.", module); - + String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process [Object not found to execute method on with name " + objFieldAcsr + " in Map with name " + objMapAcsr + "]"; methodContext.setErrorReturn(errMsg, simpleMethod); return false; @@ -118,7 +118,7 @@ Class<?> methodClass = methodObject.getClass(); return CallObjectMethod.callMethod(simpleMethod, methodContext, parameters, methodClass, methodObject, methodName, retFieldAcsr, retMapAcsr); } - + public static boolean callMethod(SimpleMethod simpleMethod, MethodContext methodContext, List<MethodObject<?>> parameters, Class<?> methodClass, Object methodObject, String methodName, ContextAccessor<Object> retFieldAcsr, ContextAccessor<Map<String, Object>> retMapAcsr) { Object[] args = null; Class<?>[] parameterTypes = null; @@ -126,7 +126,7 @@ if (parameters != null) { args = new Object[parameters.size()]; parameterTypes = new Class<?>[parameters.size()]; - + int i = 0; for (MethodObject<?> methodObjectDef: parameters) { args[i] = methodObjectDef.getObject(methodContext); @@ -143,12 +143,12 @@ i++; } } - + try { Method method = methodClass.getMethod(methodName, parameterTypes); try { Object retValue = method.invoke(methodObject, args); - + //if retFieldAcsr is empty, ignore return value if (!retFieldAcsr.isEmpty()) { if (!retMapAcsr.isEmpty()) { @@ -181,17 +181,17 @@ return false; } } catch (NoSuchMethodException e) { - Debug.logError(e, "Could not find method to execute in simple-method call method operation", module); + Debug.logError(e, "Could not find method to execute in simple-method call method operation", module); String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process [Could not find method to execute named " + methodName + ": " + e.toString() + "]"; methodContext.setErrorReturn(errMsg, simpleMethod); return false; } catch (SecurityException e) { - Debug.logError(e, "Security exception finding method to execute in simple-method call method operation", module); + Debug.logError(e, "Security exception finding method to execute in simple-method call method operation", module); String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process [Security exception finding method to execute named " + methodName + ": " + e.toString() + "]"; methodContext.setErrorReturn(errMsg, simpleMethod); return false; } - + return true; } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -53,16 +53,16 @@ return "call-service"; } } - + public static final String module = CallService.class.getName(); - + protected String serviceName; protected ContextAccessor<Map<String, Object>> inMapAcsr; protected String includeUserLoginStr; protected String breakOnErrorStr; protected String errorCode; protected String successCode; - + /** Require a new transaction for this service */ protected String requireNewTransactionStr; /** Override the default transaction timeout, only works if we start the transaction */ @@ -112,7 +112,7 @@ } } this.transactionTimeout = timeout; - + successCode = element.getAttribute("success-code"); if (successCode == null || successCode.length() == 0) successCode = "success"; @@ -139,7 +139,7 @@ rtfDef.resultName = resultToFieldElement.getAttribute("result-name"); rtfDef.mapAcsr = new ContextAccessor<Map<String, Object>>(resultToFieldElement.getAttribute("map-name")); String field = resultToFieldElement.getAttribute("field"); - if (UtilValidate.isEmpty(field)) field = resultToFieldElement.getAttribute("field-name"); + if (UtilValidate.isEmpty(field)) field = resultToFieldElement.getAttribute("field-name"); rtfDef.fieldAcsr = new ContextAccessor<Object>(field, rtfDef.resultName); resultToField.add(rtfDef); @@ -174,7 +174,7 @@ } } } - + public String getServiceName() { return this.serviceName; } @@ -182,7 +182,7 @@ public boolean exec(MethodContext methodContext) { boolean includeUserLogin = !"false".equals(methodContext.expandString(includeUserLoginStr)); boolean breakOnError = !"false".equals(methodContext.expandString(breakOnErrorStr)); - + String serviceName = methodContext.expandString(this.serviceName); String errorCode = methodContext.expandString(this.errorCode); @@ -221,7 +221,7 @@ inMap.put("userLogin", userLogin); } } - + // always add Locale to context unless null Locale locale = methodContext.getLocale(); if (locale != null) { Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallServiceAsynch.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallServiceAsynch.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallServiceAsynch.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallServiceAsynch.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -45,9 +45,9 @@ return "call-service-asynch"; } } - + public static final String module = CallServiceAsynch.class.getName(); - + protected String serviceName; protected ContextAccessor<Map<String, Object>> inMapAcsr; protected String includeUserLoginStr; @@ -62,7 +62,7 @@ public boolean exec(MethodContext methodContext) { String serviceName = methodContext.expandString(this.serviceName); boolean includeUserLogin = !"false".equals(methodContext.expandString(includeUserLoginStr)); - + Map<String, Object> inMap = null; if (inMapAcsr.isEmpty()) { inMap = FastMap.newInstance(); @@ -82,13 +82,13 @@ inMap.put("userLogin", userLogin); } } - + // always add Locale to context unless null Locale locale = methodContext.getLocale(); if (locale != null) { inMap.put("locale", locale); } - + // invoke the service try { methodContext.getDispatcher().runAsync(serviceName, inMap); Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMapProcessor.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMapProcessor.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMapProcessor.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMapProcessor.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -42,7 +42,7 @@ return "call-map-processor"; } } - + String xmlResource; String processorName; ContextAccessor<Map<String, Object>> inMapAcsr; Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -40,9 +40,9 @@ return "call-simple-method"; } } - + public static final String module = CallSimpleMethod.class.getName(); - + String xmlResource; String methodName; @@ -51,11 +51,11 @@ this.methodName = element.getAttribute("method-name"); this.xmlResource = element.getAttribute("xml-resource"); } - + public String getXmlResource() { return this.xmlResource; } - + public String getMethodName() { return this.methodName; } @@ -80,10 +80,10 @@ methodContext.setErrorReturn(errMsg, simpleMethod); return false; } - + String returnVal = simpleMethodToCall.exec(methodContext); if (Debug.verboseOn()) Debug.logVerbose("Called inline simple-method named [" + methodName + "] in resource [" + xmlResource + "], returnVal is [" + returnVal + "]", module); - + if (returnVal != null && returnVal.equals(simpleMethodToCall.getDefaultErrorCode())) { // in this case just set the error code just in case it hasn't already been set, the error messages will already be in place... if (methodContext.getMethodType() == MethodContext.EVENT) { @@ -93,7 +93,7 @@ } return false; } - + // if the response code/message is error, if so show the error and return false if (methodContext.getMethodType() == MethodContext.EVENT) { String responseCode = (String) methodContext.getEnv(simpleMethod.getEventResponseCodeName()); @@ -117,7 +117,7 @@ return true; } - + public SimpleMethod getSimpleMethodToCall(ClassLoader loader) throws MiniLangException { SimpleMethod simpleMethodToCall = null; if (xmlResource == null || xmlResource.length() == 0) { Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CheckErrors.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CheckErrors.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CheckErrors.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CheckErrors.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -41,7 +41,7 @@ return "check-errors"; } } - + ContextAccessor<List<Object>> errorListAcsr; String errorCode; @@ -54,7 +54,7 @@ super(element, simpleMethod); errorCode = element.getAttribute("error-code"); if (errorCode == null || errorCode.length() == 0) errorCode = "error"; - + errorListAcsr = new ContextAccessor<List<Object>>(element.getAttribute("error-list-name"), "error_list"); errorPrefix = new FlexibleMessage(UtilXml.firstChildElement(element, "error-prefix"), "check.error.prefix"); @@ -68,11 +68,11 @@ if (UtilValidate.isNotEmpty(messages)) { String errorCode = methodContext.expandString(this.errorCode); - + if (methodContext.getMethodType() == MethodContext.EVENT) { /* The OLD way, now puts formatting control in the template... String errMsg = errorPrefix.getMessage(methodContext.getLoader(), methodContext) + - ServiceUtil.makeMessageList(messages, messagePrefix.getMessage(methodContext.getLoader(), methodContext), + ServiceUtil.makeMessageList(messages, messagePrefix.getMessage(methodContext.getLoader(), methodContext), messageSuffix.getMessage(methodContext.getLoader(), methodContext)) + errorSuffix.getMessage(methodContext.getLoader(), methodContext); methodContext.putEnv(simpleMethod.getEventErrorMessageName(), errMsg); Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CreateObject.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CreateObject.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CreateObject.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CreateObject.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -43,7 +43,7 @@ return "create-object"; } } - + public static final String module = CreateObject.class.getName(); String className; @@ -56,18 +56,18 @@ public CreateObject(Element element, SimpleMethod simpleMethod) { super(element, simpleMethod); className = element.getAttribute("class-name"); - + // the schema for this element now just has the "field" attribute, though the old "field-name" and "map-name" pair is still supported fieldAcsr = new ContextAccessor<Object>(element.getAttribute("field"), element.getAttribute("field-name")); mapAcsr = new ContextAccessor<Map<String, Object>>(element.getAttribute("map-name")); - + List<? extends Element> parameterElements = UtilXml.childElementList(element); if (parameterElements.size() > 0) { parameters = FastList.newInstance(); for (Element parameterElement: parameterElements) { MethodObject methodObject = null; if ("string".equals(parameterElement.getNodeName())) { - methodObject = new StringObject(parameterElement, simpleMethod); + methodObject = new StringObject(parameterElement, simpleMethod); } else if ("field".equals(parameterElement.getNodeName())) { methodObject = new FieldObject<Object>(parameterElement, simpleMethod); } else { @@ -94,7 +94,7 @@ methodContext.setErrorReturn(errMsg, simpleMethod); return false; } - + Object[] args = null; Class<?>[] parameterTypes = null; if (parameters != null) { @@ -117,12 +117,12 @@ i++; } } - + try { Constructor constructor = methodClass.getConstructor(parameterTypes); try { Object newObject = constructor.newInstance(args); - + //if fieldAcsr is empty, ignore return value if (!fieldAcsr.isEmpty()) { if (!mapAcsr.isEmpty()) { @@ -165,18 +165,18 @@ } } catch (NoSuchMethodException e) { Debug.logError(e, "Could not find constructor to execute in simple-method create-object operation", module); - + String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process [Could not find constructor to execute: " + e.toString() + "]"; methodContext.setErrorReturn(errMsg, simpleMethod); return false; } catch (SecurityException e) { Debug.logError(e, "Security exception finding constructor to execute in simple-method create-object operation", module); - + String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process [Security exception finding constructor to execute: " + e.toString() + "]"; methodContext.setErrorReturn(errMsg, simpleMethod); return false; } - + return true; } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/FlexibleMessage.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/FlexibleMessage.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/FlexibleMessage.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/FlexibleMessage.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -29,9 +29,9 @@ * Simple class to wrap messages that come either from a straight string or a properties file */ public class FlexibleMessage implements Serializable { - + public static final String module = FlexibleMessage.class.getName(); - + String message = null; String propertyResource = null; boolean isProperty = false; @@ -65,7 +65,7 @@ public String getMessage(ClassLoader loader, MethodContext methodContext) { String message = methodContext.expandString(this.message); String propertyResource = methodContext.expandString(this.propertyResource); - + // if (Debug.infoOn()) Debug.logInfo("[FlexibleMessage.getMessage] isProperty: " + isProperty + ", message: " + message + ", propertyResource: " + propertyResource, module); if (!isProperty && message != null) { // if (Debug.infoOn()) Debug.logInfo("[FlexibleMessage.getMessage] Adding message: " + message, module); Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/Return.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/Return.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/Return.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/Return.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -36,7 +36,7 @@ return "return"; } } - + String responseCode; public Return(Element element, SimpleMethod simpleMethod) { @@ -48,7 +48,7 @@ public boolean exec(MethodContext methodContext) { String responseCode = methodContext.expandString(this.responseCode); - + if (methodContext.getMethodType() == MethodContext.EVENT) { methodContext.putEnv(simpleMethod.getEventResponseCodeName(), responseCode); return false; Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/SetServiceFields.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/SetServiceFields.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/SetServiceFields.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/SetServiceFields.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -53,9 +53,9 @@ return "set-service-fields"; } } - + public static final String module = CallService.class.getName(); - + String serviceName; ContextAccessor<Map<String, ? extends Object>> mapAcsr; ContextAccessor<Map<String, Object>> toMapAcsr; @@ -89,7 +89,7 @@ toMap = FastMap.newInstance(); toMapAcsr.put(methodContext, toMap); } - + LocalDispatcher dispatcher = methodContext.getDispatcher(); ModelService modelService = null; try { @@ -115,18 +115,18 @@ value = null; } } - + toMap.put(modelParam.name, value); } } - + return true; } public String getServiceName() { return this.serviceName; } - + public String rawString() { // TODO: something more than the empty tag return "<set-service-fields/>"; Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Assert.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Assert.java?rev=757074&r1=757073&r2=757074&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Assert.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Assert.java Sat Mar 21 23:24:13 2009 @@ -6,9 +6,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -52,14 +52,14 @@ protected FlexibleStringExpander titleExdr; /** List of Conditional objects */ - protected List<Conditional> conditionalList = FastList.newInstance(); + protected List<Conditional> conditionalList = FastList.newInstance(); public Assert(Element element, SimpleMethod simpleMethod) { super(element, simpleMethod); errorListAcsr = new ContextAccessor<List<Object>>(element.getAttribute("error-list-name"), "error_list"); titleExdr = FlexibleStringExpander.getInstance(element.getAttribute("title")); - + for (Element conditionalElement: UtilXml.childElementList(element)) { this.conditionalList.add(ConditionalFactory.makeConditional(conditionalElement, simpleMethod)); } @@ -73,11 +73,11 @@ } String title = this.titleExdr.expandString(methodContext.getEnvMap()); - + // check each conditional and if fails generate a message to add to the error list for (Conditional condition: conditionalList) { boolean conditionTrue = condition.checkCondition(methodContext); - + if (!conditionTrue) { // pretty print condition StringBuilder messageBuffer = new StringBuilder(); @@ -99,7 +99,7 @@ public String rawString() { return expandedString(null); } - + public String expandedString(MethodContext methodContext) { String title = this.titleExdr.expandString(methodContext.getEnvMap()); |
Free forum by Nabble | Edit this page |