Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java Mon Feb 10 09:33:25 2014 @@ -20,12 +20,10 @@ package org.ofbiz.minilang.method.entity import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; -import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.finder.EntityFinderUtil.Condition; import org.ofbiz.entity.finder.EntityFinderUtil.ConditionExpr; @@ -37,7 +35,6 @@ import org.ofbiz.minilang.MiniLangValida import org.ofbiz.minilang.SimpleMethod; import org.ofbiz.minilang.artifact.ArtifactInfoContext; import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; import org.w3c.dom.Element; /** @@ -45,12 +42,11 @@ import org.w3c.dom.Element; * * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Centitycount%3E}}">Mini-language Reference</a> */ -public final class EntityCount extends MethodOperation { +public final class EntityCount extends EntityOperation { public static final String module = EntityCount.class.getName(); private final FlexibleMapAccessor<Long> countFma; - private final FlexibleStringExpander delegatorNameFse; private final FlexibleStringExpander entityNameFse; private final Condition havingCondition; private final Condition whereCondition; @@ -60,12 +56,11 @@ public final class EntityCount extends M if (MiniLangValidate.validationOn()) { MiniLangValidate.attributeNames(simpleMethod, element, "entity-name", "count-field", "delegator-name"); MiniLangValidate.requiredAttributes(simpleMethod, element, "entity-name", "count-field"); - MiniLangValidate.expressionAttributes(simpleMethod, element, "count-field"); + MiniLangValidate.expressionAttributes(simpleMethod, element, "count-field", "delegator-name"); MiniLangValidate.childElements(simpleMethod, element, "condition-expr", "condition-list", "condition-object", "having-condition-list"); MiniLangValidate.requireAnyChildElement(simpleMethod, element, "condition-expr", "condition-list", "condition-object"); } this.entityNameFse = FlexibleStringExpander.getInstance(element.getAttribute("entity-name")); - this.delegatorNameFse = FlexibleStringExpander.getInstance(element.getAttribute("delegator-name")); this.countFma = FlexibleMapAccessor.getInstance(element.getAttribute("count-field")); int conditionElementCount = 0; Element conditionExprElement = UtilXml.firstChildElement(element, "condition-expr"); @@ -97,11 +92,7 @@ public final class EntityCount extends M @Override public boolean exec(MethodContext methodContext) throws MiniLangException { try { - String delegatorName = this.delegatorNameFse.expandString(methodContext.getEnvMap()); - Delegator delegator = methodContext.getDelegator(); - if (UtilValidate.isNotEmpty(delegatorName)) { - delegator = DelegatorFactory.getDelegator(delegatorName); - } + Delegator delegator = getDelegator(methodContext); String entityName = this.entityNameFse.expandString(methodContext.getEnvMap()); ModelEntity modelEntity = delegator.getModelEntity(entityName); EntityCondition whereEntityCondition = null; @@ -133,9 +124,6 @@ public final class EntityCount extends M StringBuilder sb = new StringBuilder("<entity-count "); sb.append("entity-name=\"").append(this.entityNameFse).append("\" "); sb.append("count-field=\"").append(this.countFma).append("\" "); - if (!this.delegatorNameFse.isEmpty()) { - sb.append("delegator-name=\"").append(this.delegatorNameFse).append("\" "); - } sb.append("/>"); return sb.toString(); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java Mon Feb 10 09:33:25 2014 @@ -44,11 +44,10 @@ import org.w3c.dom.Element; * * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Centitydata%3E}}">Mini-language Reference</a> */ -public final class EntityData extends MethodOperation { +public final class EntityData extends EntityOperation { public static final String module = EntityData.class.getName(); - private final FlexibleStringExpander delegatorNameFse; private final FlexibleMapAccessor<List<Object>> errorListFma; private final FlexibleStringExpander locationFse; private final String mode; @@ -59,11 +58,11 @@ public final class EntityData extends Me if (MiniLangValidate.validationOn()) { MiniLangValidate.attributeNames(simpleMethod, element, "location", "timeout", "delegator-name", "error-list-name", "mode"); MiniLangValidate.requiredAttributes(simpleMethod, element, "location"); + MiniLangValidate.expressionAttributes(simpleMethod, element, "delegator-name"); MiniLangValidate.constantAttributes(simpleMethod, element, "timeout", "mode"); MiniLangValidate.noChildElements(simpleMethod, element); } locationFse = FlexibleStringExpander.getInstance(element.getAttribute("location")); - delegatorNameFse = FlexibleStringExpander.getInstance(element.getAttribute("delegator-name")); mode = MiniLangValidate.checkAttribute(element.getAttribute("mode"), "load"); String timeoutAttribute = element.getAttribute("timeout"); if (!"load".equals(mode) && !timeoutAttribute.isEmpty()) { @@ -89,11 +88,7 @@ public final class EntityData extends Me errorListFma.put(methodContext.getEnvMap(), messages); } String location = this.locationFse.expandString(methodContext.getEnvMap()); - String delegatorName = this.delegatorNameFse.expandString(methodContext.getEnvMap()); - Delegator delegator = methodContext.getDelegator(); - if (UtilValidate.isNotEmpty(delegatorName)) { - delegator = DelegatorFactory.getDelegator(delegatorName); - } + Delegator delegator = getDelegator(methodContext); URL dataUrl = null; try { dataUrl = FlexibleLocation.resolveLocation(location, methodContext.getLoader()); @@ -135,9 +130,6 @@ public final class EntityData extends Me sb.append("location=\"").append(this.locationFse).append("\" "); sb.append("mode=\"").append(this.mode).append("\" "); sb.append("timeout=\"").append(this.timeout).append("\" "); - if (!this.delegatorNameFse.isEmpty()) { - sb.append("delegator-name=\"").append(this.delegatorNameFse).append("\" "); - } sb.append("error-list-name=\"").append(this.errorListFma).append("\" "); sb.append("/>"); return sb.toString(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityOne.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityOne.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityOne.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityOne.java Mon Feb 10 09:33:25 2014 @@ -27,7 +27,6 @@ import org.ofbiz.minilang.MiniLangValida import org.ofbiz.minilang.SimpleMethod; import org.ofbiz.minilang.artifact.ArtifactInfoContext; import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; import org.w3c.dom.Element; /** @@ -35,7 +34,7 @@ import org.w3c.dom.Element; * * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Centityone%3E}}">Mini-language Reference</a> */ -public final class EntityOne extends MethodOperation { +public final class EntityOne extends EntityOperation { public static final String module = EntityOne.class.getName(); @@ -44,9 +43,9 @@ public final class EntityOne extends Met public EntityOne(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); if (MiniLangValidate.validationOn()) { - MiniLangValidate.attributeNames(simpleMethod, element, "entity-name", "use-cache", "auto-field-map", "value-field"); + MiniLangValidate.attributeNames(simpleMethod, element, "entity-name", "use-cache", "auto-field-map", "value-field", "delegator-name"); MiniLangValidate.requiredAttributes(simpleMethod, element, "entity-name", "value-field"); - MiniLangValidate.expressionAttributes(simpleMethod, element, "value-field"); + MiniLangValidate.expressionAttributes(simpleMethod, element, "value-field", "delegator-name"); MiniLangValidate.childElements(simpleMethod, element, "field-map", "select-field"); } this.finder = new PrimaryKeyFinder(element); @@ -55,7 +54,7 @@ public final class EntityOne extends Met @Override public boolean exec(MethodContext methodContext) throws MiniLangException { try { - Delegator delegator = methodContext.getDelegator(); + Delegator delegator = getDelegator(methodContext); this.finder.runFind(methodContext.getEnvMap(), delegator); } catch (GeneralException e) { String errMsg = "Exception thrown while performing entity find: " + e.getMessage(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java Mon Feb 10 09:33:25 2014 @@ -27,7 +27,6 @@ import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.minilang.MiniLangException; @@ -35,7 +34,6 @@ import org.ofbiz.minilang.MiniLangValida import org.ofbiz.minilang.SimpleMethod; import org.ofbiz.minilang.artifact.ArtifactInfoContext; import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; import org.w3c.dom.Element; /** @@ -43,11 +41,10 @@ import org.w3c.dom.Element; * * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cfindbyand%3E}}">Mini-language Reference</a> */ -public final class FindByAnd extends MethodOperation { +public final class FindByAnd extends EntityOperation { public static final String module = FindByAnd.class.getName(); - private final FlexibleStringExpander delegatorNameFse; private final FlexibleStringExpander entityNameFse; private final FlexibleMapAccessor<Collection<String>> fieldsToSelectListFma; private final FlexibleMapAccessor<Object> listFma; @@ -61,7 +58,7 @@ public final class FindByAnd extends Met if (MiniLangValidate.validationOn()) { MiniLangValidate.attributeNames(simpleMethod, element, "entity-name", "use-cache", "fields-to-select-list", "use-iterator", "list", "map", "order-by-list", "delegator-name"); MiniLangValidate.requiredAttributes(simpleMethod, element, "entity-name", "list", "map"); - MiniLangValidate.expressionAttributes(simpleMethod, element, "list", "map", "fields-to-select-list", "order-by-list"); + MiniLangValidate.expressionAttributes(simpleMethod, element, "list", "map", "fields-to-select-list", "order-by-list", "delegator-name"); MiniLangValidate.noChildElements(simpleMethod, element); } entityNameFse = FlexibleStringExpander.getInstance(element.getAttribute("entity-name")); @@ -71,21 +68,16 @@ public final class FindByAnd extends Met fieldsToSelectListFma = FlexibleMapAccessor.getInstance(element.getAttribute("fields-to-select-list")); useCacheFse = FlexibleStringExpander.getInstance(element.getAttribute("use-cache")); useIteratorFse = FlexibleStringExpander.getInstance(element.getAttribute("use-iterator")); - delegatorNameFse = FlexibleStringExpander.getInstance(element.getAttribute("delegator-name")); } @Override public boolean exec(MethodContext methodContext) throws MiniLangException { String entityName = entityNameFse.expandString(methodContext.getEnvMap()); - String delegatorName = delegatorNameFse.expandString(methodContext.getEnvMap()); boolean useCache = "true".equals(useCacheFse.expandString(methodContext.getEnvMap())); boolean useIterator = "true".equals(useIteratorFse.expandString(methodContext.getEnvMap())); List<String> orderByNames = orderByListFma.get(methodContext.getEnvMap()); Collection<String> fieldsToSelectList = fieldsToSelectListFma.get(methodContext.getEnvMap()); - Delegator delegator = methodContext.getDelegator(); - if (!delegatorName.isEmpty()) { - delegator = DelegatorFactory.getDelegator(delegatorName); - } + Delegator delegator = getDelegator(methodContext); try { EntityCondition whereCond = null; Map<String, ? extends Object> fieldMap = mapFma.get(methodContext.getEnvMap()); @@ -129,9 +121,6 @@ public final class FindByAnd extends Met if (!useIteratorFse.isEmpty()) { sb.append("use-iterator=\"").append(this.useIteratorFse).append("\" "); } - if (!delegatorNameFse.isEmpty()) { - sb.append("delegator-name=\"").append(this.delegatorNameFse).append("\" "); - } sb.append("/>"); return sb.toString(); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java Mon Feb 10 09:33:25 2014 @@ -26,7 +26,6 @@ import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntity; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -36,7 +35,6 @@ import org.ofbiz.minilang.MiniLangValida import org.ofbiz.minilang.SimpleMethod; import org.ofbiz.minilang.artifact.ArtifactInfoContext; import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; import org.w3c.dom.Element; /** @@ -44,11 +42,10 @@ import org.w3c.dom.Element; * * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cfindbyprimarykey%3E}}">Mini-language Reference</a> */ -public final class FindByPrimaryKey extends MethodOperation { +public final class FindByPrimaryKey extends EntityOperation { public static final String module = FindByPrimaryKey.class.getName(); - private final FlexibleStringExpander delegatorNameFse; private final FlexibleStringExpander entityNameFse; private final FlexibleMapAccessor<Collection<String>> fieldsToSelectListFma; private final FlexibleMapAccessor<Map<String, ? extends Object>> mapFma; @@ -60,14 +57,13 @@ public final class FindByPrimaryKey exte if (MiniLangValidate.validationOn()) { MiniLangValidate.attributeNames(simpleMethod, element, "entity-name", "use-cache", "fields-to-select-list", "map", "value-field", "delegator-name"); MiniLangValidate.requiredAttributes(simpleMethod, element, "value-field", "map"); - MiniLangValidate.expressionAttributes(simpleMethod, element, "value-field", "map", "fields-to-select-list"); + MiniLangValidate.expressionAttributes(simpleMethod, element, "value-field", "map", "fields-to-select-list", "delegator-name"); MiniLangValidate.noChildElements(simpleMethod, element); } valueFma = FlexibleMapAccessor.getInstance(element.getAttribute("value-field")); entityNameFse = FlexibleStringExpander.getInstance(element.getAttribute("entity-name")); mapFma = FlexibleMapAccessor.getInstance(element.getAttribute("map")); fieldsToSelectListFma = FlexibleMapAccessor.getInstance(element.getAttribute("fields-to-select-list")); - delegatorNameFse = FlexibleStringExpander.getInstance(element.getAttribute("delegator-name")); useCacheFse = FlexibleStringExpander.getInstance(element.getAttribute("use-cache")); } @@ -75,11 +71,7 @@ public final class FindByPrimaryKey exte public boolean exec(MethodContext methodContext) throws MiniLangException { String entityName = entityNameFse.expandString(methodContext.getEnvMap()); boolean useCache = "true".equals(useCacheFse.expandString(methodContext.getEnvMap())); - Delegator delegator = methodContext.getDelegator(); - String delegatorName = delegatorNameFse.expandString(methodContext.getEnvMap()); - if (!delegatorName.isEmpty()) { - delegator = DelegatorFactory.getDelegator(delegatorName); - } + Delegator delegator = getDelegator(methodContext); Map<String, ? extends Object> inMap = mapFma.get(methodContext.getEnvMap()); if (inMap == null) { throw new MiniLangRuntimeException("Primary key map \"" + mapFma + "\" not found", this); @@ -124,9 +116,6 @@ public final class FindByPrimaryKey exte if (!useCacheFse.isEmpty()) { sb.append("use-cache=\"").append(this.useCacheFse).append("\" "); } - if (!delegatorNameFse.isEmpty()) { - sb.append("delegator-name=\"").append(this.delegatorNameFse).append("\" "); - } sb.append("/>"); return sb.toString(); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeNextSeqId.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeNextSeqId.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeNextSeqId.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeNextSeqId.java Mon Feb 10 09:33:25 2014 @@ -82,7 +82,7 @@ public final class MakeNextSeqId extends throw new MiniLangRuntimeException("Invalid number in \"increment-by\" attribute", this); } } - methodContext.getDelegator().setNextSubSeqId(value, seqFieldName, numericPadding, incrementBy); + value.getDelegator().setNextSubSeqId(value, seqFieldName, numericPadding, incrementBy); return true; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeValue.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeValue.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeValue.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/MakeValue.java Mon Feb 10 09:33:25 2014 @@ -22,6 +22,7 @@ import java.util.Map; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; +import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericValue; import org.ofbiz.minilang.MiniLangException; import org.ofbiz.minilang.MiniLangRuntimeException; @@ -29,7 +30,6 @@ import org.ofbiz.minilang.MiniLangValida import org.ofbiz.minilang.SimpleMethod; import org.ofbiz.minilang.artifact.ArtifactInfoContext; import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; import org.w3c.dom.Element; /** @@ -37,7 +37,7 @@ import org.w3c.dom.Element; * * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cmakevalue%3E}}">Mini-language Reference</a> */ -public final class MakeValue extends MethodOperation { +public final class MakeValue extends EntityOperation { private final FlexibleStringExpander entityNameFse; private final FlexibleMapAccessor<Map<String, ? extends Object>> mapFma; @@ -46,9 +46,9 @@ public final class MakeValue extends Met public MakeValue(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); if (MiniLangValidate.validationOn()) { - MiniLangValidate.attributeNames(simpleMethod, element, "value-field", "entity-name", "map"); + MiniLangValidate.attributeNames(simpleMethod, element, "value-field", "entity-name", "map", "delegator-name"); MiniLangValidate.requiredAttributes(simpleMethod, element, "value-field", "entity-name"); - MiniLangValidate.expressionAttributes(simpleMethod, element, "value-field", "map"); + MiniLangValidate.expressionAttributes(simpleMethod, element, "value-field", "map", "delegator-name"); MiniLangValidate.noChildElements(simpleMethod, element); } valueFma = FlexibleMapAccessor.getInstance(element.getAttribute("value-field")); @@ -62,7 +62,8 @@ public final class MakeValue extends Met if (entityName.isEmpty()) { throw new MiniLangRuntimeException("Entity name not found.", this); } - valueFma.put(methodContext.getEnvMap(), methodContext.getDelegator().makeValidValue(entityName, mapFma.get(methodContext.getEnvMap()))); + Delegator delegator = getDelegator(methodContext); + valueFma.put(methodContext.getEnvMap(), delegator.makeValidValue(entityName, mapFma.get(methodContext.getEnvMap()))); return true; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RefreshValue.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RefreshValue.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RefreshValue.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RefreshValue.java Mon Feb 10 09:33:25 2014 @@ -64,7 +64,7 @@ public final class RefreshValue extends } boolean doCacheClear = !"false".equals(doCacheClearFse.expandString(methodContext.getEnvMap())); try { - methodContext.getDelegator().refresh(value, doCacheClear); + value.getDelegator().refresh(value, doCacheClear); } catch (GenericEntityException e) { String errMsg = "Exception thrown while refreshing value: " + e.getMessage(); Debug.logWarning(e, errMsg, module); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveByAnd.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveByAnd.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveByAnd.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveByAnd.java Mon Feb 10 09:33:25 2014 @@ -23,13 +23,14 @@ import java.util.Map; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; +import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.minilang.MiniLangException; +import org.ofbiz.minilang.MiniLangRuntimeException; import org.ofbiz.minilang.MiniLangValidate; import org.ofbiz.minilang.SimpleMethod; import org.ofbiz.minilang.artifact.ArtifactInfoContext; import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; import org.w3c.dom.Element; /** @@ -37,7 +38,7 @@ import org.w3c.dom.Element; * * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cremovebyand%3E}}">Mini-language Reference</a> */ -public final class RemoveByAnd extends MethodOperation { +public final class RemoveByAnd extends EntityOperation { public static final String module = RemoveByAnd.class.getName(); @Deprecated @@ -48,9 +49,9 @@ public final class RemoveByAnd extends M public RemoveByAnd(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); if (MiniLangValidate.validationOn()) { - MiniLangValidate.attributeNames(simpleMethod, element, "entity-name", "map", "do-cache-clear"); + MiniLangValidate.attributeNames(simpleMethod, element, "entity-name", "map", "do-cache-clear", "delegator-name"); MiniLangValidate.requiredAttributes(simpleMethod, element, "entity-name", "map"); - MiniLangValidate.expressionAttributes(simpleMethod, element, "map"); + MiniLangValidate.expressionAttributes(simpleMethod, element, "map", "delegator-name"); MiniLangValidate.noChildElements(simpleMethod, element); } entityNameFse = FlexibleStringExpander.getInstance(element.getAttribute("entity-name")); @@ -63,8 +64,12 @@ public final class RemoveByAnd extends M @Deprecated boolean doCacheClear = !"false".equals(doCacheClearFse.expandString(methodContext.getEnvMap())); String entityName = entityNameFse.expandString(methodContext.getEnvMap()); + if (entityName.isEmpty()) { + throw new MiniLangRuntimeException("Entity name not found.", this); + } try { - methodContext.getDelegator().removeByAnd(entityName, mapFma.get(methodContext.getEnvMap()), doCacheClear); + Delegator delegator = getDelegator(methodContext); + delegator.removeByAnd(entityName, mapFma.get(methodContext.getEnvMap()), doCacheClear); } catch (GenericEntityException e) { String errMsg = "Exception thrown while removing entities: " + e.getMessage(); Debug.logWarning(e, errMsg, module); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveList.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveList.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveList.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveList.java Mon Feb 10 09:33:25 2014 @@ -23,6 +23,7 @@ import java.util.List; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; +import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.minilang.MiniLangException; @@ -30,7 +31,6 @@ import org.ofbiz.minilang.MiniLangRuntim import org.ofbiz.minilang.MiniLangValidate; import org.ofbiz.minilang.SimpleMethod; import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; import org.w3c.dom.Element; /** @@ -38,7 +38,7 @@ import org.w3c.dom.Element; * * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cremovelist%3E}}">Mini-language Reference</a> */ -public final class RemoveList extends MethodOperation { +public final class RemoveList extends EntityOperation { public static final String module = RemoveList.class.getName(); @Deprecated @@ -48,9 +48,9 @@ public final class RemoveList extends Me public RemoveList(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); if (MiniLangValidate.validationOn()) { - MiniLangValidate.attributeNames(simpleMethod, element, "list", "do-cache-clear"); + MiniLangValidate.attributeNames(simpleMethod, element, "list", "do-cache-clear", "delegator-name"); MiniLangValidate.requiredAttributes(simpleMethod, element, "list"); - MiniLangValidate.expressionAttributes(simpleMethod, element, "list"); + MiniLangValidate.expressionAttributes(simpleMethod, element, "list", "delegator-name"); MiniLangValidate.noChildElements(simpleMethod, element); } listFma = FlexibleMapAccessor.getInstance(element.getAttribute("list")); @@ -66,7 +66,8 @@ public final class RemoveList extends Me @Deprecated boolean doCacheClear = !"false".equals(doCacheClearFse.expandString(methodContext.getEnvMap())); try { - methodContext.getDelegator().removeAll(values, doCacheClear); + Delegator delegator = getDelegator(methodContext); + delegator.removeAll(values, doCacheClear); } catch (GenericEntityException e) { String errMsg = "Exception thrown while removing entities: " + e.getMessage(); Debug.logWarning(e, errMsg, module); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveRelated.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveRelated.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveRelated.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveRelated.java Mon Feb 10 09:33:25 2014 @@ -68,7 +68,7 @@ public final class RemoveRelated extends @Deprecated boolean doCacheClear = !"false".equals(doCacheClearFse.expandString(methodContext.getEnvMap())); try { - methodContext.getDelegator().removeRelated(relationName, value, doCacheClear); + value.getDelegator().removeRelated(relationName, value, doCacheClear); } catch (GenericEntityException e) { String errMsg = "Exception thrown while removing related entities: " + e.getMessage(); Debug.logWarning(e, errMsg, module); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveValue.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveValue.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveValue.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/RemoveValue.java Mon Feb 10 09:33:25 2014 @@ -64,7 +64,7 @@ public final class RemoveValue extends M @Deprecated boolean doCacheClear = !"false".equals(doCacheClearFse.expandString(methodContext.getEnvMap())); try { - methodContext.getDelegator().removeValue(value, doCacheClear); + value.getDelegator().removeValue(value, doCacheClear); } catch (GenericEntityException e) { String errMsg = "Exception thrown while removing entity value: " + e.getMessage(); Debug.logWarning(e, errMsg, module); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/SequencedIdToEnv.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/SequencedIdToEnv.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/SequencedIdToEnv.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/SequencedIdToEnv.java Mon Feb 10 09:33:25 2014 @@ -20,11 +20,11 @@ package org.ofbiz.minilang.method.entity import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; +import org.ofbiz.entity.Delegator; import org.ofbiz.minilang.MiniLangException; import org.ofbiz.minilang.MiniLangValidate; import org.ofbiz.minilang.SimpleMethod; import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; import org.w3c.dom.Element; /** @@ -32,7 +32,7 @@ import org.w3c.dom.Element; * * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Csequencedid%3E}}">Mini-language Reference</a> */ -public final class SequencedIdToEnv extends MethodOperation { +public final class SequencedIdToEnv extends EntityOperation { private final FlexibleMapAccessor<Object> fieldFma; private final boolean getLongOnly; @@ -42,9 +42,9 @@ public final class SequencedIdToEnv exte public SequencedIdToEnv(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); if (MiniLangValidate.validationOn()) { - MiniLangValidate.attributeNames(simpleMethod, element, "sequence-name", "field", "get-long-only", "stagger-max"); + MiniLangValidate.attributeNames(simpleMethod, element, "sequence-name", "field", "get-long-only", "stagger-max", "delegator-name"); MiniLangValidate.requiredAttributes(simpleMethod, element, "sequence-name", "field"); - MiniLangValidate.expressionAttributes(simpleMethod, element, "field"); + MiniLangValidate.expressionAttributes(simpleMethod, element, "field", "delegator-name"); MiniLangValidate.noChildElements(simpleMethod, element); } sequenceNameFse = FlexibleStringExpander.getInstance(element.getAttribute("sequence-name")); @@ -68,10 +68,11 @@ public final class SequencedIdToEnv exte @Override public boolean exec(MethodContext methodContext) throws MiniLangException { String seqName = sequenceNameFse.expandString(methodContext.getEnvMap()); + Delegator delegator = getDelegator(methodContext); if (getLongOnly) { - fieldFma.put(methodContext.getEnvMap(), methodContext.getDelegator().getNextSeqIdLong(seqName, staggerMax)); + fieldFma.put(methodContext.getEnvMap(), delegator.getNextSeqIdLong(seqName, staggerMax)); } else { - fieldFma.put(methodContext.getEnvMap(), methodContext.getDelegator().getNextSeqId(seqName, staggerMax)); + fieldFma.put(methodContext.getEnvMap(), delegator.getNextSeqId(seqName, staggerMax)); } return true; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreList.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreList.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreList.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreList.java Mon Feb 10 09:33:25 2014 @@ -23,6 +23,7 @@ import java.util.List; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; +import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.minilang.MiniLangException; @@ -30,7 +31,6 @@ import org.ofbiz.minilang.MiniLangRuntim import org.ofbiz.minilang.MiniLangValidate; import org.ofbiz.minilang.SimpleMethod; import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; import org.w3c.dom.Element; /** @@ -38,7 +38,7 @@ import org.w3c.dom.Element; * * @see <a href="https://cwiki.apache.org/confluence/display/OFBADMIN/Mini-language+Reference#Mini-languageReference-{{%3Cstorelist%3E}}">Mini-language Reference</a> */ -public final class StoreList extends MethodOperation { +public final class StoreList extends EntityOperation { public static final String module = StoreList.class.getName(); @Deprecated @@ -48,9 +48,9 @@ public final class StoreList extends Met public StoreList(Element element, SimpleMethod simpleMethod) throws MiniLangException { super(element, simpleMethod); if (MiniLangValidate.validationOn()) { - MiniLangValidate.attributeNames(simpleMethod, element, "list", "do-cache-clear"); + MiniLangValidate.attributeNames(simpleMethod, element, "list", "do-cache-clear", "delegator-name"); MiniLangValidate.requiredAttributes(simpleMethod, element, "list"); - MiniLangValidate.expressionAttributes(simpleMethod, element, "list"); + MiniLangValidate.expressionAttributes(simpleMethod, element, "list", "delegator-name"); MiniLangValidate.noChildElements(simpleMethod, element); } listFma = FlexibleMapAccessor.getInstance(element.getAttribute("list")); @@ -66,7 +66,8 @@ public final class StoreList extends Met @Deprecated boolean doCacheClear = !"false".equals(doCacheClearFse.expandString(methodContext.getEnvMap())); try { - methodContext.getDelegator().storeAll(values, doCacheClear); + Delegator delegator = getDelegator(methodContext); + delegator.storeAll(values, doCacheClear); } catch (GenericEntityException e) { String errMsg = "Exception thrown while storing entities: " + e.getMessage(); Debug.logWarning(e, errMsg, module); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreValue.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreValue.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreValue.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/framework/minilang/src/org/ofbiz/minilang/method/entityops/StoreValue.java Mon Feb 10 09:33:25 2014 @@ -64,7 +64,7 @@ public final class StoreValue extends Me @Deprecated boolean doCacheClear = !"false".equals(doCacheClearFse.expandString(methodContext.getEnvMap())); try { - methodContext.getDelegator().store(value, doCacheClear); + value.getDelegator().store(value, doCacheClear); } catch (GenericEntityException e) { String errMsg = "Exception thrown while storing entity value: " + e.getMessage(); Debug.logWarning(e, errMsg, module); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/LICENSE URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/LICENSE?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/LICENSE (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/LICENSE Mon Feb 10 09:33:25 2014 @@ -1373,26 +1373,26 @@ specialpurpose/birt/lib/jaxrpc.jar specialpurpose/birt/lib/js.jar specialpurpose/birt/lib/org.apache.xml.resolver_1.2.0.v201005080400.jar specialpurpose/birt/lib/org.apache.xml.serializer_2.7.1.v201005080400.jar -specialpurpose/birt/lib/org.eclipse.birt.runtime_3.7.2.v20120214-1408.jar -specialpurpose/birt/lib/org.eclipse.core.contenttype_3.4.100.v20110423-0524.jar -specialpurpose/birt/lib/org.eclipse.core.expressions_3.4.300.v20110228.jar -specialpurpose/birt/lib/org.eclipse.core.filesystem_1.3.100.v20110423-0524.jar -specialpurpose/birt/lib/org.eclipse.core.jobs_3.5.101.v20120113-1953.jar -specialpurpose/birt/lib/org.eclipse.core.resources_3.7.101.v20120125-1505.jar -specialpurpose/birt/lib/org.eclipse.core.runtime_3.7.0.v20110110.jar -specialpurpose/birt/lib/org.eclipse.datatools.connectivity.oda_3.3.3.v201110130935.jar -specialpurpose/birt/lib/org.eclipse.emf_2.6.0.v20120123-1045.jar -specialpurpose/birt/lib/org.eclipse.emf.common_2.7.0.v20120123-0926.jar -specialpurpose/birt/lib/org.eclipse.emf.ecore_2.7.0.v20120123-0926.jar -specialpurpose/birt/lib/org.eclipse.emf.ecore.change_2.7.1.v20120123-0926.jar -specialpurpose/birt/lib/org.eclipse.emf.ecore.xmi_2.7.0.v20120123-0926.jar -specialpurpose/birt/lib/org.eclipse.equinox.app_1.3.100.v20110321.jar -specialpurpose/birt/lib/org.eclipse.equinox.common_3.6.0.v20110523.jar -specialpurpose/birt/lib/org.eclipse.equinox.preferences_3.4.2.v20120111-2020.jar -specialpurpose/birt/lib/org.eclipse.equinox.registry_3.5.101.R37x_v20110810-1611.jar -specialpurpose/birt/lib/org.eclipse.osgi_3.7.2.v20120110-1415.jar -specialpurpose/birt/lib/org.eclipse.osgi.services_3.3.0.v20110513.jar -specialpurpose/birt/lib/org.eclipse.update.configurator_3.3.100.v20100512.jar +specialpurpose/birt/lib/org.eclipse.birt.runtime_4.3.1.v20130918-1142.jar +specialpurpose/birt/lib/org.eclipse.core.contenttype_3.4.200.v20130326-1255.jar +specialpurpose/birt/lib/org.eclipse.core.expressions_3.4.500.v20130515-1343.jar +specialpurpose/birt/lib/org.eclipse.core.filesystem_1.4.0.v20130514-1240.jar +specialpurpose/birt/lib/org.eclipse.core.jobs_3.5.300.v20130429-1813.jar +specialpurpose/birt/lib/org.eclipse.core.resources_3.8.101.v20130717-0806.jar +specialpurpose/birt/lib/org.eclipse.core.runtime_3.9.0.v20130326-1255.jar +specialpurpose/birt/lib/org.eclipse.datatools.connectivity.oda_3.4.1.v201308160907.jar +specialpurpose/birt/lib/org.eclipse.emf_2.6.0.v20130902-0605.jar +specialpurpose/birt/lib/org.eclipse.emf.common_2.9.1.v20130827-0309.jar +specialpurpose/birt/lib/org.eclipse.emf.ecore_2.9.1.v20130827-0309.jar +specialpurpose/birt/lib/org.eclipse.emf.ecore.change_2.9.0.v20130827-0309.jar +specialpurpose/birt/lib/org.eclipse.emf.ecore.xmi_2.9.1.v20130827-0309.jar +specialpurpose/birt/lib/org.eclipse.equinox.app_1.3.100.v20130327-1442.jar +specialpurpose/birt/lib/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar +specialpurpose/birt/lib/org.eclipse.equinox.preferences_3.5.100.v20130422-1538.jar +specialpurpose/birt/lib/org.eclipse.equinox.registry_3.5.301.v20130717-1549.jar +specialpurpose/birt/lib/org.eclipse.osgi_3.9.1.v20130814-1242.jar +specialpurpose/birt/lib/org.eclipse.osgi.services_3.3.100.v20130513-1956.jar +specialpurpose/birt/lib/org.eclipse.update.configurator_3.3.200.v20130326-1319.jar specialpurpose/birt/lib/org.w3c.css.sac_1.3.0.v200805290154.jar specialpurpose/birt/lib/org.w3c.dom.smil_1.0.0.v200806040011.jar specialpurpose/birt/lib/org.w3c.dom.svg_1.1.0.v201011041433.jar Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/example/data/ExampleHelpData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/example/data/ExampleHelpData.xml?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/example/data/ExampleHelpData.xml (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/example/data/ExampleHelpData.xml Mon Feb 10 09:33:25 2014 @@ -26,12 +26,13 @@ under the License. dataResourceId="HELP_EXAMPLE" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/> <ContentAssoc contentId="HELP_ROOT" contentIdTo="HELP_EXAMPLE" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000"/> - <DataResource dataResourceId="HELP_EXAMPLE_FR" localeString="fr" dataResourceTypeId="OFBIZ_FILE" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/xml" isPublic="Y" - objectInfo="specialpurpose/example/data/helpdata/HELP_EXAMPLE_FR.xml" - dataResourceName="Exemple pour le développement" /> - <Content contentId="HELP_EXAMPLE_FR" dataResourceId="HELP_EXAMPLE_FR" contentName="Exemple pour le développement" localeString="fr" contentTypeId="DOCUMENT" templateDataResourceId="HELP_TEMPL" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/> + <DataResource dataResourceId="HELP_EXAMPLE_FR" localeString="fr" dataResourceTypeId="OFBIZ_FILE" + objectInfo="specialpurpose/example/data/helpdata/HELP_EXAMPLE_FR.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" + dataResourceName="Exemple pour le développement" mimeTypeId="text/xml" isPublic="Y" /> + <Content contentId="HELP_EXAMPLE_FR" contentTypeId="DOCUMENT" contentName="Exemple pour le développement" templateDataResourceId="HELP_TEMPL" + dataResourceId="HELP_EXAMPLE_FR" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html" localeString="fr" /> <ContentAssoc contentId="HELP_EXAMPLE" contentIdTo="HELP_EXAMPLE_FR" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2006-01-12 01:01:01"/> - + <DataResource dataResourceId="EXAMPLE_main" localeString="en" dataResourceTypeId="OFBIZ_FILE" objectInfo="specialpurpose/example/data/helpdata/HELP_EXAMPLE_main.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Example help main page" mimeTypeId="text/xml" isPublic="Y" /> <Content contentId="EXAMPLE_main" contentTypeId="DOCUMENT" contentName="Example main menu." templateDataResourceId="HELP_TEMPL" dataResourceId="EXAMPLE_main" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/> Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Mon Feb 10 09:33:25 2014 @@ -118,7 +118,6 @@ public class PosTransaction implements S protected int drawerIdx = 0; private GenericValue shipAddress = null; - private Map<String, Integer> skuDiscounts = FastMap.newInstance(); private int cartDiscount = -1; @@ -419,13 +418,14 @@ public class PosTransaction implements S return payInfo; } - public BigDecimal getItemQuantity(String productId) { - trace("request item quantity", productId); - ShoppingCartItem item = cart.findCartItem(productId, null, null, null, BigDecimal.ZERO); + public BigDecimal getItemQuantity(String cartIndex) { + trace("request item quantity", cartIndex); + int index = Integer.parseInt(cartIndex); + ShoppingCartItem item = cart.findCartItem(index); if (item != null) { return item.getQuantity(); } else { - trace("item not found", productId); + trace("item not found", cartIndex); return BigDecimal.ZERO; } } @@ -517,11 +517,11 @@ public class PosTransaction implements S } } - public void addItem(String productId, ProductConfigWrapper pcw) + public void addItem(String productId, BigDecimal quantity, ProductConfigWrapper pcw) throws ItemNotFoundException, CartItemModifyException { - trace("add item with ProductConfigWrapper", productId); + trace("add item with ProductConfigWrapper", productId + "/" + quantity); try { - cart.addOrIncreaseItem(productId, null, BigDecimal.ONE, null, null, null, null, null, null, null, null, pcw, null, null, null, session.getDispatcher()); + cart.addOrIncreaseItem(productId, null, quantity, null, null, null, null, null, null, null, null, pcw, null, null, null, session.getDispatcher()); } catch (ItemNotFoundException e) { trace("item not found", e); throw e; @@ -557,9 +557,10 @@ public class PosTransaction implements S return; } - public void modifyQty(String productId, BigDecimal quantity) throws CartItemModifyException { - trace("modify item quantity", productId + "/" + quantity); - ShoppingCartItem item = cart.findCartItem(productId, null, null, null, BigDecimal.ZERO); + public void modifyQty(String cartIndex, BigDecimal quantity) throws CartItemModifyException { + trace("modify item quantity", cartIndex + "/" + quantity); + int index = Integer.parseInt(cartIndex); + ShoppingCartItem item = cart.findCartItem(index); if (item != null) { try { item.setQuantity(quantity, session.getDispatcher(), cart, true); @@ -569,21 +570,22 @@ public class PosTransaction implements S throw e; } } else { - trace("item not found", productId); + trace("item not found", cartIndex); } } - public void modifyPrice(String productId, BigDecimal price) { - trace("modify item price", productId + "/" + price); - ShoppingCartItem item = cart.findCartItem(productId, null, null, null, BigDecimal.ZERO); + public void modifyPrice(String cartIndex, BigDecimal price) { + trace("modify item price", cartIndex + "/" + price); + int index = Integer.parseInt(cartIndex); + ShoppingCartItem item = cart.findCartItem(index); if (item != null) { item.setBasePrice(price); } else { - trace("item not found", productId); + trace("item not found", cartIndex); } } - public void addDiscount(String productId, BigDecimal discount, boolean percent) { + public void addDiscount(String cartIndex, BigDecimal discount, boolean percent) { GenericValue adjustment = session.getDelegator().makeValue("OrderAdjustment"); adjustment.set("orderAdjustmentTypeId", "DISCOUNT_ADJUSTMENT"); if (percent) { @@ -592,15 +594,15 @@ public class PosTransaction implements S adjustment.set("amount", discount); } - if (productId != null) { + if (cartIndex != null) { trace("add item adjustment"); - ShoppingCartItem item = cart.findCartItem(productId, null, null, null, BigDecimal.ZERO); - Integer itemAdj = skuDiscounts.get(productId); - if (itemAdj != null) { - item.removeAdjustment(itemAdj.intValue()); + int iCartIndex = Integer.parseInt(cartIndex); + ShoppingCartItem item = cart.findCartItem(iCartIndex); + List<GenericValue> adjustments = item.getAdjustments(); + for (GenericValue gvAdjustment : adjustments){ + item.removeAdjustment(gvAdjustment); } int idx = item.addAdjustment(adjustment); - skuDiscounts.put(productId, idx); } else { trace("add sale adjustment"); if (cartDiscount > -1) { @@ -615,11 +617,13 @@ public class PosTransaction implements S cart.removeAdjustment(cartDiscount); cartDiscount = -1; } - for (String productId : skuDiscounts.keySet()) { - ShoppingCartItem item = cart.findCartItem(productId, null, null, null, BigDecimal.ZERO); - Integer itemAdj = skuDiscounts.remove(productId); - if (itemAdj != null) { - item.removeAdjustment(itemAdj.intValue()); + + Iterator<ShoppingCartItem> cartIterator = cart.iterator(); + while(cartIterator.hasNext()){ + ShoppingCartItem item = (ShoppingCartItem) cartIterator.next(); + List<GenericValue> adjustments = item.getAdjustments(); + for (GenericValue gvAdjustment : adjustments){ + item.removeAdjustment(gvAdjustment); } } } @@ -628,22 +632,18 @@ public class PosTransaction implements S return cart.getOrderOtherAdjustmentTotal(); } - public void voidItem(String productId) throws CartItemModifyException { - trace("void item", productId); - ShoppingCartItem item = cart.findCartItem(productId, null, null, null, BigDecimal.ZERO); - if (item != null) { + public void voidItem(String cartIndex) throws CartItemModifyException { + trace("void item", cartIndex); + int index; try { - int itemIdx = cart.getItemIndex(item); - cart.removeCartItem(itemIdx, session.getDispatcher()); + index = Integer.parseInt(cartIndex); + cart.removeCartItem(index, session.getDispatcher()); } catch (CartItemModifyException e) { Debug.logError(e, module); - trace("void item error", productId, e); + trace("void item error", cartIndex, e); throw e; } - } else { - trace("item not found", productId); } - } public void voidSale(PosScreen pos) { trace("void sale"); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java Mon Feb 10 09:33:25 2014 @@ -72,13 +72,13 @@ public class ManagerEvents { public static synchronized void modifyPrice(PosScreen pos) { PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession()); - String sku = null; + String cartIndex = null; try { - sku = MenuEvents.getSelectedItem(pos); + cartIndex = MenuEvents.getSelectedIdx(pos); } catch (ArrayIndexOutOfBoundsException e) { } - if (sku == null) { + if (cartIndex == null) { pos.getOutput().print(UtilProperties.getMessage(PosTransaction.resource,"PosInvalidSelection",Locale.getDefault())); pos.getJournal().refresh(pos); pos.getInput().clear(); @@ -97,7 +97,7 @@ public class ManagerEvents { if (parsed) { price = price.movePointLeft(2); - trans.modifyPrice(sku, price); + trans.modifyPrice(cartIndex, price); // re-calc tax trans.calcTax(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/MenuEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/MenuEvents.java?rev=1566542&r1=1566541&r2=1566542&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/MenuEvents.java (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/pos/src/org/ofbiz/pos/event/MenuEvents.java Mon Feb 10 09:33:25 2014 @@ -216,7 +216,7 @@ public class MenuEvents { if (!aggregatedItem) { trans.addItem(productId, quantity); } else { - trans.addItem(productId, pcw); + trans.addItem(productId, quantity, pcw); } } catch (CartItemModifyException e) { Debug.logError(e, module); @@ -241,13 +241,13 @@ public class MenuEvents { public static synchronized void changeQty(PosScreen pos) { PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession()); - String sku = null; + String index = null; try { - sku = getSelectedItem(pos); + index = getSelectedIdx(pos); } catch (ArrayIndexOutOfBoundsException e) { } - if (sku == null) { + if (index == null) { pos.getOutput().print("Invalid Selection!"); pos.getJournal().refresh(pos); pos.getInput().clear(); @@ -271,16 +271,16 @@ public class MenuEvents { try { quantity = new BigDecimal(func[1]); } catch (NumberFormatException e) { - quantity = trans.getItemQuantity(sku); + quantity = trans.getItemQuantity(index); } } } // adjust the quantity - quantity = (increment ? trans.getItemQuantity(sku).add(quantity) : quantity); + quantity = (increment ? trans.getItemQuantity(index).add(quantity) : quantity); try { - trans.modifyQty(sku, quantity); + trans.modifyQty(index, quantity); } catch (CartItemModifyException e) { Debug.logError(e, module); pos.showDialog("dialog/error/producterror"); @@ -328,13 +328,13 @@ public class MenuEvents { if (!trans.isOpen()) { pos.showDialog("dialog/error/terminalclosed"); } else { - String sku = null; + String index = null; try { - sku = getSelectedItem(pos); + index = getSelectedIdx(pos); } catch (ArrayIndexOutOfBoundsException e) { } - if (sku == null) { + if (index == null) { pos.getOutput().print("Invalid Selection!"); pos.getJournal().refresh(pos); pos.getInput().clear(); @@ -355,7 +355,7 @@ public class MenuEvents { } amount = amount.movePointLeft(2).negate(); - trans.addDiscount(sku, amount, percent); + trans.addDiscount(index, amount, percent); trans.calcTax(); } } @@ -379,20 +379,20 @@ public class MenuEvents { public static synchronized void voidItem(PosScreen pos) { PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession()); - String sku = null; + String index = null; try { - sku = getSelectedItem(pos); + index = getSelectedIdx(pos); } catch (ArrayIndexOutOfBoundsException e) { } - if (sku == null) { + if (index == null) { pos.getOutput().print("Invalid Selection!"); pos.getJournal().refresh(pos); pos.getInput().clear(); } try { - trans.voidItem(sku); + trans.voidItem(index); } catch (CartItemModifyException e) { pos.getOutput().print(e.getMessage()); } @@ -425,6 +425,11 @@ public class MenuEvents { return journal.getSelectedSku(); } + public static synchronized String getSelectedIdx(PosScreen pos) { + Journal journal = pos.getJournal(); + return journal.getSelectedIdx(); + } + public static synchronized void configureItem(PosScreen pos) { PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession()); Journal journal = pos.getJournal(); |
Free forum by Nabble | Edit this page |