Author: adrianc
Date: Fri Apr 27 07:15:14 2012 New Revision: 1331259 URL: http://svn.apache.org/viewvc?rev=1331259&view=rev Log: Renamed new <call-simple-method> attribute from memory-model to scope. Modified: ofbiz/trunk/framework/minilang/dtd/simple-methods-v2.xsd ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallSimpleMethod.java Modified: ofbiz/trunk/framework/minilang/dtd/simple-methods-v2.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/dtd/simple-methods-v2.xsd?rev=1331259&r1=1331258&r2=1331259&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/dtd/simple-methods-v2.xsd (original) +++ ofbiz/trunk/framework/minilang/dtd/simple-methods-v2.xsd Fri Apr 27 07:15:14 2012 @@ -956,12 +956,12 @@ under the License. </xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="memory-model"> + <xs:attribute name="scope"> <xs:annotation> <xs:documentation> - The memory model to use. In an "inline" memory model, fields declared or modified in the called method + The memory scope to use. In an "inline" memory scope, fields declared or modified in the called method will be reflected back to the calling method - as if the called method was inline. In a "function" memory - model, fields declared or modified in the called method are local to the called method - they are not + scope, fields declared or modified in the called method are local to the called method - they are not reflected back to the calling method. <br/><br/> Optional. Attribute type: constant. 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=1331259&r1=1331258&r2=1331259&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 Fri Apr 27 07:15:14 2012 @@ -47,24 +47,24 @@ public final class CallSimpleMethod exte private final String methodName; private final String xmlResource; - private final String memoryModel; + private final String scope; private final List<ResultToField> resultToFieldList; public CallSimpleMethod(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); if (MiniLangValidate.validationOn()) { - MiniLangValidate.attributeNames(simpleMethod, element, "method-name", "xml-resource", "memory-model"); + MiniLangValidate.attributeNames(simpleMethod, element, "method-name", "xml-resource", "scope"); MiniLangValidate.requiredAttributes(simpleMethod, element, "method-name"); - MiniLangValidate.constantAttributes(simpleMethod, element, "method-name", "xml-resource", "memory-model"); + MiniLangValidate.constantAttributes(simpleMethod, element, "method-name", "xml-resource", "scope"); MiniLangValidate.childElements(simpleMethod, element, "result-to-field"); } this.methodName = element.getAttribute("method-name"); this.xmlResource = element.getAttribute("xml-resource"); - this.memoryModel = element.getAttribute("memory-model"); + this.scope = element.getAttribute("scope"); List<? extends Element> resultToFieldElements = UtilXml.childElementList(element, "result-to-field"); if (UtilValidate.isNotEmpty(resultToFieldElements)) { - if (!"function".equals(this.memoryModel)) { - MiniLangValidate.handleError("Inline memory model cannot include <result-to-field> elements.", simpleMethod, element); + if (!"function".equals(this.scope)) { + MiniLangValidate.handleError("Inline scope cannot include <result-to-field> elements.", simpleMethod, element); } List<ResultToField> resultToFieldList = new ArrayList<ResultToField>(resultToFieldElements.size()); for (Element resultToFieldElement : resultToFieldElements) { @@ -92,7 +92,7 @@ public final class CallSimpleMethod exte throw new MiniLangRuntimeException("Could not find <simple-method name=\"" + this.methodName + "\"> in XML document " + this.xmlResource, this); } MethodContext localContext = methodContext; - if ("function".equals(this.memoryModel)) { + if ("function".equals(this.scope)) { Map<String, Object> localEnv = FastMap.newInstance(); localEnv.putAll(methodContext.getEnvMap()); localEnv.remove(this.simpleMethod.getEventResponseCodeName()); @@ -128,7 +128,7 @@ public final class CallSimpleMethod exte return false; } } - if ("function".equals(this.memoryModel) && this.resultToFieldList != null) { + if ("function".equals(this.scope) && this.resultToFieldList != null) { Map<String, Object> results = localContext.getResults(); if (results != null) { for (ResultToField resultToField : this.resultToFieldList) { @@ -177,8 +177,8 @@ public final class CallSimpleMethod exte if (this.xmlResource.length() > 0) { sb.append("xml-resource=\"").append(this.xmlResource).append("\" "); } - if (this.memoryModel.length() > 0) { - sb.append("memory-model=\"").append(this.memoryModel).append("\" "); + if (this.scope.length() > 0) { + sb.append("scope=\"").append(this.scope).append("\" "); } sb.append("/>"); return sb.toString(); |
Free forum by Nabble | Edit this page |