|
Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionBegin.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionBegin.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionBegin.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionBegin.java Sat Aug 4 18:11:00 2012 @@ -31,6 +31,8 @@ import org.w3c.dom.Element; /** * Implements the <transaction-begin> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ctransactionbegin%3E}}">Mini-language Reference</a> */ public final class TransactionBegin extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionCommit.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionCommit.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionCommit.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionCommit.java Sat Aug 4 18:11:00 2012 @@ -31,6 +31,8 @@ import org.w3c.dom.Element; /** * Implements the <transaction-commit> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ctransactioncommit%3E}}">Mini-language Reference</a> */ public final class TransactionCommit extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionRollback.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionRollback.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionRollback.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/entityops/TransactionRollback.java Sat Aug 4 18:11:00 2012 @@ -31,6 +31,8 @@ import org.w3c.dom.Element; /** * Implements the <transaction-rollback> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ctransactionrollback%3E}}">Mini-language Reference</a> */ public final class TransactionRollback extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/AddError.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/AddError.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/AddError.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/AddError.java Sat Aug 4 18:11:00 2012 @@ -32,8 +32,10 @@ import org.ofbiz.minilang.method.MethodO import org.w3c.dom.Element; /** - * Adds an error message to an error message list. - */ + * Implements the <add-error> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cadderror%3E}}">Mini-language Reference</a> +*/ public final class AddError extends MethodOperation { private final FlexibleMapAccessor<List<String>> errorListFma; @@ -81,11 +83,16 @@ public final class AddError extends Meth return sb.toString(); } + /** + * A factory for the <add-error> element. + */ public static final class AddErrorFactory implements Factory<AddError> { + @Override public AddError createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new AddError(element, simpleMethod); } + @Override public String getName() { return "add-error"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Assert.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Assert.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Assert.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Assert.java Sat Aug 4 18:11:00 2012 @@ -37,7 +37,9 @@ import org.ofbiz.minilang.method.conditi import org.w3c.dom.Element; /** - * Adds an error to the error list for each condition that evaluates to false. + * Implements the <assert> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cassert%3E}}">Mini-language Reference</a> */ public final class Assert extends MethodOperation { @@ -68,11 +70,10 @@ public final class Assert extends Method @Override public boolean exec(MethodContext methodContext) throws MiniLangException { - List<Object> messages = errorListFma.get(methodContext.getEnvMap()); - if (messages == null) { - messages = FastList.newInstance(); - errorListFma.put(methodContext.getEnvMap(), messages); + if (methodContext.isTraceOn()) { + outputTraceMessage(methodContext, "Begin assert."); } + List<Object> messages = errorListFma.get(methodContext.getEnvMap()); String title = titleExdr.expandString(methodContext.getEnvMap()); for (Conditional condition : conditionalList) { if (!condition.checkCondition(methodContext)) { @@ -84,9 +85,19 @@ public final class Assert extends Method } messageBuffer.append("failed: "); condition.prettyPrint(messageBuffer, methodContext); + if (messages == null) { + messages = FastList.newInstance(); + errorListFma.put(methodContext.getEnvMap(), messages); + } messages.add(messageBuffer.toString()); + if (methodContext.isTraceOn()) { + outputTraceMessage(methodContext, "Condition evaluated to false: " + condition + ", adding error message."); + } } } + if (methodContext.isTraceOn()) { + outputTraceMessage(methodContext, "End assert."); + } return true; } @@ -106,11 +117,16 @@ public final class Assert extends Method return messageBuf.toString(); } + /** + * A factory for the <assert> element. + */ public static final class AssertFactory implements Factory<Assert> { + @Override public Assert createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new Assert(element, simpleMethod); } + @Override public String getName() { return "assert"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Break.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Break.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Break.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Break.java Sat Aug 4 18:11:00 2012 @@ -25,7 +25,9 @@ import org.ofbiz.minilang.method.MethodO import org.w3c.dom.Element; /** - * Causes script execution to exit the nearest loop element. + * Implements the <break> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cbreak%3E}}">Mini-language Reference</a> */ public class Break extends MethodOperation { @@ -60,11 +62,16 @@ public class Break extends MethodOperati } } + /** + * A factory for the <break> element. + */ public static final class BreakFactory implements Factory<Break> { + @Override public Break createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new Break(element, simpleMethod); } + @Override public String getName() { return "break"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CheckErrors.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CheckErrors.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CheckErrors.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CheckErrors.java Sat Aug 4 18:11:00 2012 @@ -29,7 +29,9 @@ import org.ofbiz.minilang.method.MethodO import org.w3c.dom.Element; /** - * Halts script execution if the error message list contains any messages. + * Implements the <check-errors> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccheckerrors%3E}}">Mini-language Reference</a> */ public final class CheckErrors extends MethodOperation { @@ -40,7 +42,6 @@ public final class CheckErrors extends M super(element, simpleMethod); if (MiniLangValidate.validationOn()) { MiniLangValidate.attributeNames(simpleMethod, element, "error-code", "error-list-name"); - MiniLangValidate.constantPlusExpressionAttributes(simpleMethod, element, "error-code"); MiniLangValidate.noChildElements(simpleMethod, element); } this.errorCodeFse = FlexibleStringExpander.getInstance(element.getAttribute("error-code")); @@ -49,6 +50,9 @@ public final class CheckErrors extends M @Override public boolean exec(MethodContext methodContext) throws MiniLangException { + if (methodContext.isTraceOn()) { + outputTraceMessage(methodContext, "Begin check-errors."); + } List<Object> messages = methodContext.getEnv(this.errorListNameFse.expandString(methodContext.getEnvMap())); if (messages != null && messages.size() > 0) { if (methodContext.getMethodType() == MethodContext.EVENT) { @@ -58,14 +62,22 @@ public final class CheckErrors extends M methodContext.putEnv(simpleMethod.getServiceErrorMessageListName(), messages); methodContext.putEnv(this.simpleMethod.getServiceResponseMessageName(), getErrorCode(methodContext)); } + if (methodContext.isTraceOn()) { + outputTraceMessage(methodContext, "Found error messages. Setting error status and halting script execution."); + outputTraceMessage(methodContext, "End check-errors."); + } return false; } + if (methodContext.isTraceOn()) { + outputTraceMessage(methodContext, "No error messages found. Continuing script execution."); + outputTraceMessage(methodContext, "End check-errors."); + } return true; } private String getErrorCode(MethodContext methodContext) { String errorCode = this.errorCodeFse.expandString(methodContext.getEnvMap()); - if (errorCode.length() == 0) { + if (errorCode.isEmpty()) { errorCode = this.simpleMethod.getDefaultErrorCode(); } return errorCode; @@ -84,11 +96,16 @@ public final class CheckErrors extends M return sb.toString(); } + /** + * A factory for the <check-errors> element. + */ public static final class CheckErrorsFactory implements Factory<CheckErrors> { + @Override public CheckErrors createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new CheckErrors(element, simpleMethod); } + @Override public String getName() { return "check-errors"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CheckId.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CheckId.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CheckId.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CheckId.java Sat Aug 4 18:11:00 2012 @@ -35,7 +35,9 @@ import org.ofbiz.minilang.method.MethodO import org.w3c.dom.Element; /** - * If the given ID field is not valid the fail-message or fail-property sub-elements are used to add a message to the error-list. + * Implements the <check-id> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccheckid%3E}}">Mini-language Reference</a> */ public final class CheckId extends MethodOperation { @@ -51,6 +53,7 @@ public final class CheckId extends Metho super(element, simpleMethod); if (MiniLangValidate.validationOn()) { MiniLangValidate.attributeNames(simpleMethod, element, "field", "error-list-name"); + MiniLangValidate.requiredAttributes(simpleMethod, element, "field"); MiniLangValidate.constantAttributes(simpleMethod, element, "error-list-name"); MiniLangValidate.expressionAttributes(simpleMethod, element, "field"); MiniLangValidate.childElements(simpleMethod, element, "fail-message", "fail-property"); @@ -134,11 +137,16 @@ public final class CheckId extends Metho return sb.toString(); } + /** + * A factory for the <check-id> element. + */ public static final class CheckIdFactory implements Factory<CheckId> { + @Override public CheckId createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new CheckId(element, simpleMethod); } + @Override public String getName() { return "check-id"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ClearField.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ClearField.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ClearField.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ClearField.java Sat Aug 4 18:11:00 2012 @@ -28,6 +28,8 @@ import org.w3c.dom.Element; /** * Implements the <clear-field> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{<clearfield>}}">Mini-language Reference</a> */ public final class ClearField extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Continue.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Continue.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Continue.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Continue.java Sat Aug 4 18:11:00 2012 @@ -25,7 +25,9 @@ import org.ofbiz.minilang.method.MethodO import org.w3c.dom.Element; /** - * Causes script execution to return to the beginning of the nearest enclosing loop element. + * Implements the <continue> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccontinue%3E}}">Mini-language Reference</a> */ public class Continue extends MethodOperation { @@ -60,11 +62,16 @@ public class Continue extends MethodOper } } + /** + * A factory for the <continue> element. + */ public static final class ContinueFactory implements Factory<Continue> { + @Override public Continue createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new Continue(element, simpleMethod); } + @Override public String getName() { return "continue"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CreateObject.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CreateObject.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CreateObject.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/CreateObject.java Sat Aug 4 18:11:00 2012 @@ -40,6 +40,8 @@ import org.w3c.dom.Element; /** * Implements the <create-object> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{<createobject>}}">Mini-language Reference</a> */ public final class CreateObject extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToList.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToList.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToList.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToList.java Sat Aug 4 18:11:00 2012 @@ -32,7 +32,9 @@ import org.w3c.dom.Element; /** * Implements the <field-to-list> element. - */ + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cfieldtolist%3E}}">Mini-language Reference</a> +*/ public final class FieldToList extends MethodOperation { private final FlexibleMapAccessor<Object> fieldFma; Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/FirstFromList.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/FirstFromList.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/FirstFromList.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/FirstFromList.java Sat Aug 4 18:11:00 2012 @@ -31,6 +31,8 @@ import org.w3c.dom.Element; /** * Implements the <first-from-list> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cfirstfromlist%3E}}">Mini-language Reference</a> */ public final class FirstFromList extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Iterate.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Iterate.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Iterate.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Iterate.java Sat Aug 4 18:11:00 2012 @@ -41,7 +41,9 @@ import org.ofbiz.minilang.method.envops. import org.w3c.dom.Element; /** - * Process sub-operations for each entry in the list + * Implements the <iterate> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Citerate%3E}}">Mini-language Reference</a> */ public final class Iterate extends MethodOperation { @@ -181,11 +183,16 @@ public final class Iterate extends Metho return sb.toString(); } + /** + * A factory for the <iterate> element. + */ public static final class IterateFactory implements Factory<Iterate> { + @Override public Iterate createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new Iterate(element, simpleMethod); } + @Override public String getName() { return "iterate"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/IterateMap.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/IterateMap.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/IterateMap.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/IterateMap.java Sat Aug 4 18:11:00 2012 @@ -36,7 +36,9 @@ import org.ofbiz.minilang.method.envops. import org.w3c.dom.Element; /** - * Process sub-operations for each entry in the map + * Implements the <iterate-map> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Citeratemap%3E}}">Mini-language Reference</a> */ public final class IterateMap extends MethodOperation { @@ -131,11 +133,16 @@ public final class IterateMap extends Me return sb.toString(); } + /** + * A factory for the <iterate-map> element. + */ public static final class IterateMapFactory implements Factory<IterateMap> { + @Override public IterateMap createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new IterateMap(element, simpleMethod); } + @Override public String getName() { return "iterate-map"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ListToList.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ListToList.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ListToList.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ListToList.java Sat Aug 4 18:11:00 2012 @@ -32,6 +32,8 @@ import org.w3c.dom.Element; /** * Implements the <list-to-list> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Clisttolist%3E}}">Mini-language Reference</a> */ public final class ListToList extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Loop.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Loop.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Loop.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Loop.java Sat Aug 4 18:11:00 2012 @@ -35,7 +35,9 @@ import org.ofbiz.minilang.method.envops. import org.w3c.dom.Element; /** - * Loop + * Implements the <loop> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cloop%3E}}">Mini-language Reference</a> */ public final class Loop extends MethodOperation { @@ -110,11 +112,16 @@ public final class Loop extends MethodOp return sb.toString(); } + /** + * A factory for the <loop> element. + */ public static final class LoopFactory implements Factory<Loop> { + @Override public Loop createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new Loop(element, simpleMethod); } + @Override public String getName() { return "loop"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/MapToMap.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/MapToMap.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/MapToMap.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/MapToMap.java Sat Aug 4 18:11:00 2012 @@ -32,6 +32,8 @@ import org.w3c.dom.Element; /** * Implements the <map-to-map> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cmaptomap%3E}}">Mini-language Reference</a> */ public final class MapToMap extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Now.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Now.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Now.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/Now.java Sat Aug 4 18:11:00 2012 @@ -36,6 +36,8 @@ import org.w3c.dom.Element; /** * Implements the <now>, <now-date-to-env>, and <now-timestamp> elements. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cnow%3E}}">Mini-language Reference</a> */ public final class Now extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/OrderMapList.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/OrderMapList.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/OrderMapList.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/OrderMapList.java Sat Aug 4 18:11:00 2012 @@ -36,6 +36,8 @@ import org.w3c.dom.Element; /** * Implements the <order-map-list> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cordermaplist%3E}}">Mini-language Reference</a> */ public final class OrderMapList extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java Sat Aug 4 18:11:00 2012 @@ -42,6 +42,8 @@ import com.ibm.icu.util.Calendar; /** * Implements the <set-calendar> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Csetcalendar%3E}}">Mini-language Reference</a> */ public final class SetCalendar extends MethodOperation { @@ -89,7 +91,6 @@ public final class SetCalendar extends M private final FlexibleStringExpander periodAlignEnd; private final FlexibleStringExpander periodAlignStart; private final FlexibleStringExpander secondsFse; - private final boolean setIfEmpty; private final boolean setIfNull; private final Scriptlet scriptlet; private final FlexibleStringExpander timeZoneFse; @@ -101,12 +102,12 @@ public final class SetCalendar extends M if (MiniLangValidate.validationOn()) { MiniLangValidate.deprecatedAttribute(simpleMethod, element, "from-field", "replace with \"from\""); MiniLangValidate.deprecatedAttribute(simpleMethod, element, "default-value", "replace with \"default\""); - MiniLangValidate.attributeNames(simpleMethod, element, "field", "from-field", "from", "value", "default-value", "default", "set-if-null", "set-if-empty", + MiniLangValidate.attributeNames(simpleMethod, element, "field", "from-field", "from", "value", "default-value", "default", "set-if-null", "years", "months", "days", "hours", "minutes", "seconds", "millis", "period-align-start", "period-align-end", "locale", "time-zone"); MiniLangValidate.requiredAttributes(simpleMethod, element, "field"); MiniLangValidate.requireAnyAttribute(simpleMethod, element, "from", "value"); MiniLangValidate.constantPlusExpressionAttributes(simpleMethod, element, "value"); - MiniLangValidate.constantAttributes(simpleMethod, element, "set-if-null", "set-if-empty"); + MiniLangValidate.constantAttributes(simpleMethod, element, "set-if-null"); MiniLangValidate.expressionAttributes(simpleMethod, element, "field", "from", "from-field"); MiniLangValidate.noChildElements(simpleMethod, element); } @@ -129,7 +130,6 @@ public final class SetCalendar extends M } this.defaultFse = FlexibleStringExpander.getInstance(element.getAttribute("default")); this.setIfNull = "true".equals(element.getAttribute("set-if-null")); - this.setIfEmpty = !"false".equals(element.getAttribute("set-if-empty")); this.yearsFse = FlexibleStringExpander.getInstance(element.getAttribute("years")); this.monthsFse = FlexibleStringExpander.getInstance(element.getAttribute("months")); this.daysFse = FlexibleStringExpander.getInstance(element.getAttribute("days")); @@ -163,9 +163,6 @@ public final class SetCalendar extends M if (!setIfNull && newValue == null) { return true; } - if (!setIfEmpty && ObjectType.isEmpty(newValue)) { - return true; - } Locale locale = null; TimeZone timeZone = null; Timestamp fromStamp = null; @@ -312,9 +309,6 @@ public final class SetCalendar extends M if (this.setIfNull) { sb.append("set-if-null=\"true\" "); } - if (!this.setIfEmpty) { - sb.append("set-if-empty=\"false\" "); - } sb.append("/>"); return sb.toString(); } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java Sat Aug 4 18:11:00 2012 @@ -37,6 +37,8 @@ import org.w3c.dom.Element; /** * Implements the <set> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cset%3E}}">Mini-language Reference</a> */ public final class SetOperation extends MethodOperation { @@ -114,7 +116,7 @@ public final class SetOperation extends this.formatFse = FlexibleStringExpander.getInstance(element.getAttribute("format")); this.type = element.getAttribute("type"); Class<?> targetClass = null; - if (!this.type.isEmpty()) { + if (!this.type.isEmpty() && !"NewList".equals(this.type) && !"NewMap".equals(this.type)) { try { targetClass = ObjectType.loadClass(this.type); } catch (ClassNotFoundException e) { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/StringAppend.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/StringAppend.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/StringAppend.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/StringAppend.java Sat Aug 4 18:11:00 2012 @@ -33,6 +33,8 @@ import org.w3c.dom.Element; /** * Implements the <string-append> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cstringappend%3E}}">Mini-language Reference</a> */ public final class StringAppend extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/StringToList.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/StringToList.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/StringToList.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/StringToList.java Sat Aug 4 18:11:00 2012 @@ -37,6 +37,8 @@ import org.w3c.dom.Element; /** * Implements the <string-to-list> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cstringtolist%3E}}">Mini-language Reference</a> */ public final class StringToList extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ToString.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ToString.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ToString.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/ToString.java Sat Aug 4 18:11:00 2012 @@ -31,6 +31,8 @@ import org.w3c.dom.Element; /** * Implements the <to-string> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ctostring%3E}}">Mini-language Reference</a> */ public final class ToString extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/While.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/While.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/While.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/envops/While.java Sat Aug 4 18:11:00 2012 @@ -35,7 +35,9 @@ import org.ofbiz.minilang.method.envops. import org.w3c.dom.Element; /** - * Continually processes sub-ops while the condition remains true + * Implements the <while> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cwhile%3E}}">Mini-language Reference</a> */ public final class While extends MethodOperation { @@ -91,11 +93,18 @@ public final class While extends MethodO return "<while><condition>" + messageBuf + "</condition></while>"; } + /** + * A factory for the <while> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cwhile%3E}}">Mini-language Reference</a> + */ public static final class WhileFactory implements Factory<While> { + @Override public While createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new While(element, simpleMethod); } + @Override public String getName() { return "while"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToRequest.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToRequest.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToRequest.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToRequest.java Sat Aug 4 18:11:00 2012 @@ -29,6 +29,8 @@ import org.w3c.dom.Element; /** * Implements the <field-to-request> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cfieldtorequest%3E}}">Mini-language Reference</a> */ public final class FieldToRequest extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToSession.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToSession.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToSession.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/FieldToSession.java Sat Aug 4 18:11:00 2012 @@ -29,6 +29,8 @@ import org.w3c.dom.Element; /** * Implements the <field-to-session> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cfieldtosession%3E}}">Mini-language Reference</a> */ public final class FieldToSession extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestParametersToList.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestParametersToList.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestParametersToList.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestParametersToList.java Sat Aug 4 18:11:00 2012 @@ -34,6 +34,8 @@ import org.w3c.dom.Element; /** * Implements the <request-parameters-to-list> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Crequestparameterstolist%3E}}">Mini-language Reference</a> */ public final class RequestParametersToList extends MethodOperation { @@ -50,7 +52,7 @@ public final class RequestParametersToLi } private final FlexibleMapAccessor<List<String>> listFma; - private final FlexibleStringExpander attributeNameFse; + private final FlexibleStringExpander parameterNameFse; public RequestParametersToList(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); @@ -65,20 +67,20 @@ public final class RequestParametersToLi if (elementModified && MiniLangUtil.autoCorrectOn()) { MiniLangUtil.flagDocumentAsCorrected(element); } - this.attributeNameFse = FlexibleStringExpander.getInstance(element.getAttribute("request-name")); - String attributeName = element.getAttribute("list"); - if (!attributeName.isEmpty()) { - this.listFma = FlexibleMapAccessor.getInstance(attributeName); + this.parameterNameFse = FlexibleStringExpander.getInstance(element.getAttribute("request-name")); + String listAttribute = element.getAttribute("list"); + if (!listAttribute.isEmpty()) { + this.listFma = FlexibleMapAccessor.getInstance(listAttribute); } else { - this.listFma = FlexibleMapAccessor.getInstance(attributeNameFse.toString()); + this.listFma = FlexibleMapAccessor.getInstance(parameterNameFse.toString()); } } @Override public boolean exec(MethodContext methodContext) throws MiniLangException { if (methodContext.getMethodType() == MethodContext.EVENT) { - String attributeName = attributeNameFse.expandString(methodContext.getEnvMap()); - String[] parameterValues = methodContext.getRequest().getParameterValues(attributeName); + String parameterName = parameterNameFse.expandString(methodContext.getEnvMap()); + String[] parameterValues = methodContext.getRequest().getParameterValues(parameterName); if (parameterValues != null) { List<String> valueList = listFma.get(methodContext.getEnvMap()); if (valueList == null) { @@ -96,7 +98,7 @@ public final class RequestParametersToLi @Override public String toString() { StringBuilder sb = new StringBuilder("<request-parameters-to-list "); - sb.append("request-name=\"").append(this.attributeNameFse).append("\" "); + sb.append("request-name=\"").append(this.parameterNameFse).append("\" "); if (!this.listFma.isEmpty()) { sb.append("list=\"").append(this.listFma).append("\" "); } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestToField.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestToField.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestToField.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/RequestToField.java Sat Aug 4 18:11:00 2012 @@ -29,6 +29,8 @@ import org.w3c.dom.Element; /** * Implements the <request-to-field> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Crequesttofield%3E}}">Mini-language Reference</a> */ public final class RequestToField extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/SessionToField.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/SessionToField.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/SessionToField.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/SessionToField.java Sat Aug 4 18:11:00 2012 @@ -29,6 +29,8 @@ import org.w3c.dom.Element; /** * Implements the <session-to-field> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Csessiontofield%3E}}">Mini-language Reference</a> */ public class SessionToField extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java Sat Aug 4 18:11:00 2012 @@ -35,6 +35,8 @@ import org.w3c.dom.Element; /** * Implements the <webapp-property-to-field> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cwebapppropertytofield%3E}}">Mini-language Reference</a> */ public final class WebappPropertyToField extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java Sat Aug 4 18:11:00 2012 @@ -35,11 +35,12 @@ import org.ofbiz.minilang.method.Message import org.ofbiz.minilang.method.MethodContext; import org.ofbiz.minilang.method.MethodOperation; import org.ofbiz.security.Security; -import org.ofbiz.security.authz.Authorization; import org.w3c.dom.Element; /** * Implements the <check-permission> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccheckpermission%3E}}">Mini-language Reference</a> */ public final class CheckPermission extends MethodOperation { @@ -76,12 +77,11 @@ public final class CheckPermission exten boolean hasPermission = false; GenericValue userLogin = methodContext.getUserLogin(); if (userLogin != null) { - Authorization authz = methodContext.getAuthz(); Security security = methodContext.getSecurity(); - hasPermission = this.primaryPermissionInfo.hasPermission(methodContext, userLogin, authz, security); + hasPermission = this.primaryPermissionInfo.hasPermission(methodContext, userLogin, security); if (!hasPermission && altPermissionInfoList != null) { for (PermissionInfo altPermInfo : altPermissionInfoList) { - if (altPermInfo.hasPermission(methodContext, userLogin, authz, security)) { + if (altPermInfo.hasPermission(methodContext, userLogin, security)) { hasPermission = true; break; } @@ -145,7 +145,7 @@ public final class CheckPermission exten this.actionFse = FlexibleStringExpander.getInstance(element.getAttribute("action")); } - private boolean hasPermission(MethodContext methodContext, GenericValue userLogin, Authorization authz, Security security) { + private boolean hasPermission(MethodContext methodContext, GenericValue userLogin, Security security) { String permission = permissionFse.expandString(methodContext.getEnvMap()); String action = actionFse.expandString(methodContext.getEnvMap()); if (!action.isEmpty()) { @@ -153,7 +153,7 @@ public final class CheckPermission exten return security.hasEntityPermission(permission, action, userLogin); } else { // run hasPermission - return authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap()); + return security.hasPermission(permission, userLogin); } } } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfInstanceOf.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfInstanceOf.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfInstanceOf.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfInstanceOf.java Sat Aug 4 18:11:00 2012 @@ -35,6 +35,8 @@ import org.w3c.dom.Element; /** * Implements the <if-instance-of> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cifinstanceof%3E}}">Mini-language Reference</a> */ public final class IfInstanceOf extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfNotEmpty.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfNotEmpty.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfNotEmpty.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfNotEmpty.java Sat Aug 4 18:11:00 2012 @@ -33,6 +33,8 @@ import org.w3c.dom.Element; /** * Implements the <if-not-empty> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cifnotempty%3E}}">Mini-language Reference</a> */ public final class IfNotEmpty extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java Sat Aug 4 18:11:00 2012 @@ -38,6 +38,8 @@ import org.w3c.dom.Element; /** * Implements the <calculate> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccalculate%3E}}">Mini-language Reference</a> */ public final class Calculate extends MethodOperation { @@ -55,7 +57,8 @@ public final class Calculate extends Met private final FlexibleStringExpander decimalScaleFse; private final FlexibleMapAccessor<Object> fieldFma; private final FlexibleStringExpander roundingModeFse; - private final FlexibleStringExpander typeFse; + private final int type; + private final String typeString; public Calculate(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); @@ -70,7 +73,22 @@ public final class Calculate extends Met this.decimalFormatFse = FlexibleStringExpander.getInstance(element.getAttribute("decimal-format")); this.decimalScaleFse = FlexibleStringExpander.getInstance(element.getAttribute("decimal-scale")); this.roundingModeFse = FlexibleStringExpander.getInstance(element.getAttribute("rounding-mode")); - this.typeFse = FlexibleStringExpander.getInstance(element.getAttribute("type")); + this.typeString = element.getAttribute("type"); + int type = Calculate.TYPE_BIG_DECIMAL; + if ("Double".equals(typeString)) { + type = Calculate.TYPE_DOUBLE; + } else if ("Float".equals(typeString)) { + type = Calculate.TYPE_FLOAT; + } else if ("Long".equals(typeString)) { + type = Calculate.TYPE_LONG; + } else if ("Integer".equals(typeString)) { + type = Calculate.TYPE_INTEGER; + } else if ("String".equals(typeString)) { + type = Calculate.TYPE_STRING; + } else if ("BigDecimal".equals(typeString)) { + type = Calculate.TYPE_BIG_DECIMAL; + } + this.type = type; List<? extends Element> calcopElements = UtilXml.childElementList(element); calcops = new Calculate.SubCalc[calcopElements.size()]; int i = 0; @@ -90,25 +108,8 @@ public final class Calculate extends Met @Override public boolean exec(MethodContext methodContext) throws MiniLangException { - String typeString = typeFse.expandString(methodContext.getEnvMap()); - int type; - if ("Double".equals(typeString)) { - type = Calculate.TYPE_DOUBLE; - } else if ("Float".equals(typeString)) { - type = Calculate.TYPE_FLOAT; - } else if ("Long".equals(typeString)) { - type = Calculate.TYPE_LONG; - } else if ("Integer".equals(typeString)) { - type = Calculate.TYPE_INTEGER; - } else if ("String".equals(typeString)) { - type = Calculate.TYPE_STRING; - } else if ("BigDecimal".equals(typeString)) { - type = Calculate.TYPE_BIG_DECIMAL; - } else { - type = Calculate.TYPE_BIG_DECIMAL; - } String roundingModeString = roundingModeFse.expandString(methodContext.getEnvMap()); - int roundingMode; + int roundingMode = BigDecimal.ROUND_HALF_EVEN; if ("Ceiling".equals(roundingModeString)) { roundingMode = BigDecimal.ROUND_CEILING; } else if ("Floor".equals(roundingModeString)) { @@ -121,24 +122,14 @@ public final class Calculate extends Met roundingMode = BigDecimal.ROUND_HALF_UP; } else if ("HalfDown".equals(roundingModeString)) { roundingMode = BigDecimal.ROUND_HALF_DOWN; - } else if ("HalfEven".equals(roundingModeString)) { - roundingMode = BigDecimal.ROUND_HALF_EVEN; } else if ("Unnecessary".equals(roundingModeString)) { roundingMode = BigDecimal.ROUND_UNNECESSARY; - } else { - // default to HalfEven, reduce cumulative errors - roundingMode = BigDecimal.ROUND_HALF_EVEN; } String decimalScaleString = decimalScaleFse.expandString(methodContext.getEnvMap()); int decimalScale = 2; if (!decimalScaleString.isEmpty()) { decimalScale = Integer.valueOf(decimalScaleString).intValue(); } - String decimalFormatString = decimalFormatFse.expandString(methodContext.getEnvMap()); - DecimalFormat df = null; - if (!decimalFormatString.isEmpty()) { - df = new DecimalFormat(decimalFormatString); - } BigDecimal resultValue = BigDecimal.ZERO.setScale(decimalScale, roundingMode); for (Calculate.SubCalc calcop : calcops) { resultValue = resultValue.add(calcop.calcValue(methodContext, decimalScale, roundingMode)); @@ -162,7 +153,12 @@ public final class Calculate extends Met break; case TYPE_STRING: // run the decimal-formatting - if (df != null && resultValue.compareTo(BigDecimal.ZERO) > 0) { + String decimalFormatString = decimalFormatFse.expandString(methodContext.getEnvMap()); + DecimalFormat df = null; + if (!decimalFormatString.isEmpty()) { + df = new DecimalFormat(decimalFormatString); + } + if (df != null && resultValue.compareTo(BigDecimal.ZERO) != 0) { resultObj = df.format(resultValue); } else { resultObj = resultValue.toString(); @@ -189,8 +185,8 @@ public final class Calculate extends Met if (!this.decimalFormatFse.isEmpty()) { sb.append("decimal-format=\"").append(this.decimalFormatFse).append("\" "); } - if (!typeFse.isEmpty()) { - sb.append("type=\"").append(this.typeFse).append("\" "); + if (!typeString.isEmpty()) { + sb.append("type=\"").append(this.typeString).append("\" "); } sb.append("/>"); return sb.toString(); @@ -205,6 +201,8 @@ public final class Calculate extends Met /** * Implements the <calcop> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ccalcop%3E}}">Mini-language Reference</a> */ public final class CalcOp extends MiniLangElement implements SubCalc { private static final int OPERATOR_ADD = 1; @@ -215,18 +213,29 @@ public final class Calculate extends Met private final Calculate.SubCalc calcops[]; private final FlexibleMapAccessor<Object> fieldFma; - private final FlexibleStringExpander operatorFse; + private final int operator; private CalcOp(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); if (MiniLangValidate.validationOn()) { MiniLangValidate.attributeNames(simpleMethod, element, "field", "operator"); - MiniLangValidate.requiredAttributes(simpleMethod, element, "field"); + MiniLangValidate.requiredAttributes(simpleMethod, element, "operator"); MiniLangValidate.expressionAttributes(simpleMethod, element, "field"); MiniLangValidate.childElements(simpleMethod, element, "calcop", "number"); } this.fieldFma = FlexibleMapAccessor.getInstance(element.getAttribute("field")); - this.operatorFse = FlexibleStringExpander.getInstance(element.getAttribute("operator")); + String operatorStr = element.getAttribute("operator"); + int operator = CalcOp.OPERATOR_ADD; + if ("subtract".equals(operatorStr)) { + operator = CalcOp.OPERATOR_SUBTRACT; + } else if ("multiply".equals(operatorStr)) { + operator = CalcOp.OPERATOR_MULTIPLY; + } else if ("divide".equals(operatorStr)) { + operator = CalcOp.OPERATOR_DIVIDE; + } else if ("negative".equals(operatorStr)) { + operator = CalcOp.OPERATOR_NEGATIVE; + } + this.operator = operator; List<? extends Element> calcopElements = UtilXml.childElementList(element); calcops = new Calculate.SubCalc[calcopElements.size()]; int i = 0; @@ -245,21 +254,6 @@ public final class Calculate extends Met @Override public BigDecimal calcValue(MethodContext methodContext, int scale, int roundingMode) throws MiniLangException { - String operatorStr = operatorFse.expandString(methodContext.getEnvMap()); - int operator = CalcOp.OPERATOR_ADD; - if ("get".equals(operatorStr)) { - operator = CalcOp.OPERATOR_ADD; - } else if ("add".equals(operatorStr)) { - operator = CalcOp.OPERATOR_ADD; - } else if ("subtract".equals(operatorStr)) { - operator = CalcOp.OPERATOR_SUBTRACT; - } else if ("multiply".equals(operatorStr)) { - operator = CalcOp.OPERATOR_MULTIPLY; - } else if ("divide".equals(operatorStr)) { - operator = CalcOp.OPERATOR_DIVIDE; - } else if ("negative".equals(operatorStr)) { - operator = CalcOp.OPERATOR_NEGATIVE; - } BigDecimal resultValue = BigDecimal.ZERO.setScale(scale, roundingMode); boolean isFirst = true; Object fieldObj = fieldFma.get(methodContext.getEnvMap()); @@ -311,6 +305,8 @@ public final class Calculate extends Met /** * Implements the <number> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cnumber%3E}}">Mini-language Reference</a> */ public final class NumberOp extends MiniLangElement implements SubCalc { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Log.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Log.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Log.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Log.java Sat Aug 4 18:11:00 2012 @@ -28,7 +28,9 @@ import org.ofbiz.minilang.method.MethodO import org.w3c.dom.Element; /** - * Logs a message. + * Implements the <log> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Clog%3E}}">Mini-language Reference</a> */ public final class Log extends MethodOperation { @@ -92,11 +94,16 @@ public final class Log extends MethodOpe return sb.toString(); } + /** + * A factory for the <log> element. + */ public static final class LogFactory implements Factory<Log> { + @Override public Log createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new Log(element, simpleMethod); } + @Override public String getName() { return "log"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/PropertyToField.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/PropertyToField.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/PropertyToField.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/PropertyToField.java Sat Aug 4 18:11:00 2012 @@ -35,6 +35,8 @@ import org.w3c.dom.Element; /** * Implements the <property-to-field> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cpropertytofield%3E}}">Mini-language Reference</a> */ public final class PropertyToField extends MethodOperation { Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Trace.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Trace.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Trace.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/otherops/Trace.java Sat Aug 4 18:11:00 2012 @@ -30,7 +30,9 @@ import org.ofbiz.minilang.method.MethodO import org.w3c.dom.Element; /** - * Enables trace log messages in sub-elements. + * Implements the <trace> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Ctrace%3E}}">Mini-language Reference</a> */ public final class Trace extends MethodOperation { @@ -75,11 +77,16 @@ public final class Trace extends MethodO return sb.toString(); } + /** + * A factory for the <trace> element. + */ public static final class TraceFactory implements Factory<Trace> { + @Override public Trace createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new Trace(element, simpleMethod); } + @Override public String getName() { return "trace"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/serviceops/FieldToResult.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/serviceops/FieldToResult.java?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/serviceops/FieldToResult.java (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/src/org/ofbiz/minilang/method/serviceops/FieldToResult.java Sat Aug 4 18:11:00 2012 @@ -27,7 +27,9 @@ import org.ofbiz.minilang.method.MethodO import org.w3c.dom.Element; /** - * Copies a field to the simple-method result Map. + * Implements the <field-to-request> element. + * + * @see <a href="https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{%3Cfieldtoresult%3E}}">Mini-language Reference</a> */ public final class FieldToResult extends MethodOperation { @@ -81,11 +83,16 @@ public final class FieldToResult extends return sb.toString(); } + /** + * A factory for the <field-to-request> element. + */ public static final class FieldToResultFactory implements Factory<FieldToResult> { + @Override public FieldToResult createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { return new FieldToResult(element, simpleMethod); } + @Override public String getName() { return "field-to-result"; } Modified: ofbiz/branches/20120329_portletWidget/framework/minilang/testdef/MinilangTests.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/minilang/testdef/MinilangTests.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/minilang/testdef/MinilangTests.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/minilang/testdef/MinilangTests.xml Sat Aug 4 18:11:00 2012 @@ -26,4 +26,8 @@ <junit-test-suite class-name="org.ofbiz.minilang.method.ifops.test.IfRegexpTest"/> </test-case> + <test-case case-name="MiniLangUnitTests"> + <junit-test-suite class-name="org.ofbiz.minilang.test.MiniLangTests"/> + </test-case> + </test-suite> Propchange: ofbiz/branches/20120329_portletWidget/framework/security/data/PasswordSecurityData.xml ------------------------------------------------------------------------------ Merged /ofbiz/trunk/framework/security/data/PasswordSecurityData.xml:r1307080-1307082,1340380-1340445,1340638-1340641,1347751-1347754,1351866,1356000-1369352 Modified: ofbiz/branches/20120329_portletWidget/framework/security/data/SecurityGroupDemoData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/security/data/SecurityGroupDemoData.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/security/data/SecurityGroupDemoData.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/security/data/SecurityGroupDemoData.xml Sat Aug 4 18:11:00 2012 @@ -26,22 +26,6 @@ under the License. <SecurityGroup groupId="VIEWADMIN" description="Demo Admin group, has all view permissions."/> <SecurityGroup groupId="BIZADMIN" description="Full Business Applications permission group, has all business app admin permissions, not technical permissions."/> - <!-- Security 2.0 base permissions --> - <SecurityPermission permissionId="access" description="Base ACCESS permission"/> - <SecurityPermission permissionId="create" description="Base CREATE permission"/> - <SecurityPermission permissionId="read" description="Base READ permission"/> - <SecurityPermission permissionId="update" description="Base UPDATE permission"/> - <SecurityPermission permissionId="delete" description="Base DELETE permission"/> - - <!-- base permissions to groups --> - <SecurityGroupPermission groupId="FULLADMIN" permissionId="access"/> - <SecurityGroupPermission groupId="FULLADMIN" permissionId="create"/> - <SecurityGroupPermission groupId="FULLADMIN" permissionId="read"/> - <SecurityGroupPermission groupId="FULLADMIN" permissionId="update"/> - <SecurityGroupPermission groupId="FULLADMIN" permissionId="delete"/> - <SecurityGroupPermission groupId="VIEWADMIN" permissionId="access"/> - <SecurityGroupPermission groupId="VIEWADMIN" permissionId="read"/> - <!-- general admin tools permission --> <SecurityPermission description="Permission to access the Stock OFBiz Manager Applications." permissionId="OFBTOOLS_VIEW"/> <SecurityGroupPermission groupId="FULLADMIN" permissionId="OFBTOOLS_VIEW"/> Modified: ofbiz/branches/20120329_portletWidget/framework/security/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/security/entitydef/entitymodel.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/security/entitydef/entitymodel.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/security/entitydef/entitymodel.xml Sat Aug 4 18:11:00 2012 @@ -157,21 +157,8 @@ under the License. title="Security Component - Security Permission Entity"> <field name="permissionId" type="id-long-ne"></field> <field name="description" type="description"></field> - <field name="dynamicAccess" type="value"></field> <prim-key field="permissionId"/> </entity> - <entity entity-name="SecurityPermissionAutoGrant" - package-name="org.ofbiz.security.securitygroup" - default-resource-name="SecurityEntityLabels" - title="Security Component - Security Permission Auto Grant Entity"> - <field name="permissionId" type="id-long-ne"></field> - <field name="grantPermission" type="id-vlong-ne"></field> - <prim-key field="permissionId"/> - <prim-key field="grantPermission"/> - <relation type="one" fk-name="SEC_PERM_AUTO_GRNT" rel-entity-name="SecurityPermission"> - <key-map field-name="permissionId"/> - </relation> - </entity> <view-entity entity-name="UserLoginAndSecurityGroup" package-name="org.ofbiz.security.securitygroup" never-cache="true" Modified: ofbiz/branches/20120329_portletWidget/framework/service/config/serviceengine.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/service/config/serviceengine.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/service/config/serviceengine.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/service/config/serviceengine.xml Sat Aug 4 18:11:00 2012 @@ -30,8 +30,6 @@ under the License. purge-job-days="4" failed-retry-min="3" ttl="18000000" - wait-millis="750" - jobs="10" min-threads="5" max-threads="15" poll-enabled="true" Modified: ofbiz/branches/20120329_portletWidget/framework/service/dtd/service-config.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/service/dtd/service-config.xsd?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/service/dtd/service-config.xsd (original) +++ ofbiz/branches/20120329_portletWidget/framework/service/dtd/service-config.xsd Sat Aug 4 18:11:00 2012 @@ -68,8 +68,8 @@ under the License. <xs:attribute type="xs:nonNegativeInteger" name="purge-job-days" default="30"/> <xs:attribute type="xs:nonNegativeInteger" name="failed-retry-min" default="30"/> <xs:attribute type="xs:nonNegativeInteger" name="ttl" use="required"/> - <xs:attribute type="xs:nonNegativeInteger" name="wait-millis" use="required"/> - <xs:attribute type="xs:nonNegativeInteger" name="jobs" use="required"/> + <xs:attribute type="xs:nonNegativeInteger" name="wait-millis"/> <!-- deprecated --> + <xs:attribute type="xs:nonNegativeInteger" name="jobs"/> <!-- deprecated --> <xs:attribute type="xs:nonNegativeInteger" name="min-threads" use="required"/> <xs:attribute type="xs:nonNegativeInteger" name="max-threads" use="required"/> <xs:attribute name="poll-enabled" default="true"> Modified: ofbiz/branches/20120329_portletWidget/framework/service/dtd/services.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/service/dtd/services.xsd?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/service/dtd/services.xsd (original) +++ ofbiz/branches/20120329_portletWidget/framework/service/dtd/services.xsd Sat Aug 4 18:11:00 2012 @@ -43,6 +43,7 @@ under the License. <xs:element minOccurs="0" maxOccurs="1" ref="permission-service"/> <xs:element minOccurs="0" maxOccurs="unbounded" ref="required-permissions"/> <xs:element minOccurs="0" maxOccurs="unbounded" ref="implements"/> + <xs:element minOccurs="0" ref="metric"/> <xs:choice maxOccurs="1" minOccurs="0"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="auto-attributes"/> @@ -117,7 +118,7 @@ under the License. <xs:attribute name="hideResultInLog" default="false"> <xs:annotation> <xs:documentation> - If set to true the result will be hidden from possible exposition in ServiceDispatcher.runSync() + If set to true the result will be hidden from possible exposition in LocalDispatcher.runSync() </xs:documentation> </xs:annotation> <xs:simpleType> @@ -260,6 +261,48 @@ under the License. </xs:attribute> </xs:attributeGroup> + <xs:element name="metric"> + <xs:annotation> + <xs:documentation> + Calculate and maintain an average response time for this service. Service metrics can be used + for monitoring and reporting. + <br/><br/> + The metric works by gathering statistics until a configurable maximum is reached (number of + requests or elapsed time), then the average is calculated. A smoothing factor is used to + smooth differences between calculations. + </xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:attribute name="name" type="xs:string" use="required"> + <xs:annotation> + <xs:documentation> + Each metric must have a unique name. + </xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="estimation-size" type="xs:string"> + <xs:annotation> + <xs:documentation> + Positive integer number of requests to include in the metrics calculation. Defaults to "100". + </xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="estimation-time" type="xs:string"> + <xs:annotation> + <xs:documentation> + Positive integer number of milliseconds to include in the metrics calculation. Defaults to "1000". + </xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="smoothing" type="xs:string"> + <xs:annotation> + <xs:documentation> + Positive decimal smoothing factor - used to smooth the differences between calculations. A value of "1" disables smoothing. Defaults to "0.7". + </xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + </xs:element> <xs:element name="auto-attributes"> <xs:complexType> <xs:sequence> Modified: ofbiz/branches/20120329_portletWidget/framework/service/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/service/ofbiz-component.xml?rev=1369382&r1=1369381&r2=1369382&view=diff ============================================================================== --- ofbiz/branches/20120329_portletWidget/framework/service/ofbiz-component.xml (original) +++ ofbiz/branches/20120329_portletWidget/framework/service/ofbiz-component.xml Sat Aug 4 18:11:00 2012 @@ -43,4 +43,45 @@ under the License. <keystore name="rmitrust" type="jks" password="changeit" is-truststore="true" is-certstore="false" loader="main" location="config/rmitrust.jks"/> + + <container name="service-container" loaders="main,rmi,pos,install,test" class="org.ofbiz.service.ServiceContainer"> + <property name="dispatcher-factory" value="org.ofbiz.service.GenericDispatcherFactory"/> + </container> + + <!-- RMI Service Dispatcher --> + <container name="rmi-dispatcher" loaders="rmi" class="org.ofbiz.service.rmi.RmiServiceContainer"> + <property name="bound-name" value="RMIDispatcher"/> + <property name="bound-host" value="127.0.0.1"/> + <property name="bound-port" value="1099"/> + <property name="delegator-name" value="default"/> + <property name="client-factory" value="org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory"/> + <property name="server-factory" value="org.ofbiz.service.rmi.socket.ssl.SSLServerSocketFactory"/> + <property name="ssl-keystore" value="framework/base/config/ofbizrmi.jks"/> + <property name="ssl-keystore-type" value="JKS"/> + <property name="ssl-keystore-pass" value="changeit"/> + <property name="ssl-keystore-alias" value="rmissl"/> + <property name="ssl-client-auth" value="false"/> + </container> + + <!-- JavaMail Listener Container - Triggers MCA Rules --> + <!-- if delete-mail is set to true, will delete messages after fetching them. otherwise, will try to mark them as seen + mail.store.protocol supports both imap and pop3, but pop3 will not be able to mark messages as seen, so you would need to delete them--> + <!-- To use the mail listerner just uncomment and go... + <container name="javamail-container" class="org.ofbiz.service.mail.JavaMailContainer"> + <property name="delegator-name" value="default"/> + <property name="dispatcher-name" value="JavaMailDispatcher"/> + <property name="run-as-user" value="system"/> + <property name="poll-delay" value="300000"/> + <property name="delete-mail" value="false"/> + <property name="maxSize" value="100000"/> + <property name="default-listener" value="store-listener"> + <property name="mail.store.protocol" value="imap"/> + <property name="mail.host" value="[host]"/> + <property name="mail.user" value="[user]"/> + <property name="mail.pass" value="[pass]"/> + <property name="mail.debug" value="false"/> + </property> + </container> + --> + </ofbiz-component> |
| Free forum by Nabble | Edit this page |
