From 1a2a55e4be495ab356cb3ed310d91edea70a42fa Mon Sep 17 00:00:00 2001 From: Adrian Crum Date: Sun, 22 Apr 2012 07:43:44 +0000 Subject: [PATCH] Removed Mini-language elements that were deprecated in a previous release and are no longer used. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1328809 13f79535-47bb-0310-9956-ffa450edef68 --- ...iz.minilang.method.MethodOperation$Factory | 4 - .../minilang/method/envops/EnvToEnv.java | 72 ----------- .../minilang/method/envops/EnvToField.java | 97 -------------- .../minilang/method/envops/FieldToEnv.java | 102 --------------- .../minilang/method/envops/FieldToField.java | 122 ------------------ 5 files changed, 397 deletions(-) delete mode 100644 framework/minilang/src/org/ofbiz/minilang/method/envops/EnvToEnv.java delete mode 100644 framework/minilang/src/org/ofbiz/minilang/method/envops/EnvToField.java delete mode 100644 framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToEnv.java delete mode 100644 framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToField.java diff --git a/framework/minilang/src/META-INF/services/org.ofbiz.minilang.method.MethodOperation$Factory b/framework/minilang/src/META-INF/services/org.ofbiz.minilang.method.MethodOperation$Factory index 16a3e2646d..0182778312 100644 --- a/framework/minilang/src/META-INF/services/org.ofbiz.minilang.method.MethodOperation$Factory +++ b/framework/minilang/src/META-INF/services/org.ofbiz.minilang.method.MethodOperation$Factory @@ -68,10 +68,6 @@ org.ofbiz.minilang.method.entityops.TransactionBegin$TransactionBeginFactory org.ofbiz.minilang.method.entityops.TransactionCommit$TransactionCommitFactory org.ofbiz.minilang.method.entityops.TransactionRollback$TransactionRollbackFactory org.ofbiz.minilang.method.envops.ClearField$ClearFieldFactory -org.ofbiz.minilang.method.envops.EnvToEnv$EnvToEnvFactory -org.ofbiz.minilang.method.envops.EnvToField$EnvToFieldFactory -org.ofbiz.minilang.method.envops.FieldToEnv$FieldToEnvFactory -org.ofbiz.minilang.method.envops.FieldToField$FieldToFieldFactory org.ofbiz.minilang.method.envops.FieldToList$FieldToListFactory org.ofbiz.minilang.method.envops.FirstFromList$FirstFromListFactory org.ofbiz.minilang.method.envops.Iterate$IterateFactory diff --git a/framework/minilang/src/org/ofbiz/minilang/method/envops/EnvToEnv.java b/framework/minilang/src/org/ofbiz/minilang/method/envops/EnvToEnv.java deleted file mode 100644 index 865679d50a..0000000000 --- a/framework/minilang/src/org/ofbiz/minilang/method/envops/EnvToEnv.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - *******************************************************************************/ -package org.ofbiz.minilang.method.envops; - -import org.ofbiz.minilang.MiniLangException; -import org.ofbiz.minilang.SimpleMethod; -import org.ofbiz.minilang.method.ContextAccessor; -import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; -import org.w3c.dom.Element; - -/** - * Copies an environment field to a map field - */ -@Deprecated -@MethodOperation.DeprecatedOperation("set") -public class EnvToEnv extends MethodOperation { - - public static final String module = EnvToEnv.class.getName(); - - protected ContextAccessor envAcsr; - protected ContextAccessor toEnvAcsr; - - public EnvToEnv(Element element, SimpleMethod simpleMethod) throws MiniLangException { - super(element, simpleMethod); - envAcsr = new ContextAccessor(element.getAttribute("env-name")); - toEnvAcsr = new ContextAccessor(element.getAttribute("to-env-name")); - } - - @Override - public boolean exec(MethodContext methodContext) throws MiniLangException { - toEnvAcsr.put(methodContext, envAcsr.get(methodContext)); - return true; - } - - @Override - public String expandedString(MethodContext methodContext) { - // TODO: something more than a stub/dummy - return this.rawString(); - } - - @Override - public String rawString() { - return ""; - } - - public static final class EnvToEnvFactory implements Factory { - public EnvToEnv createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { - return new EnvToEnv(element, simpleMethod); - } - - public String getName() { - return "env-to-env"; - } - } -} diff --git a/framework/minilang/src/org/ofbiz/minilang/method/envops/EnvToField.java b/framework/minilang/src/org/ofbiz/minilang/method/envops/EnvToField.java deleted file mode 100644 index 5157ca483c..0000000000 --- a/framework/minilang/src/org/ofbiz/minilang/method/envops/EnvToField.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - *******************************************************************************/ -package org.ofbiz.minilang.method.envops; - -import java.util.*; - -import javolution.util.FastMap; - -import org.w3c.dom.*; -import org.ofbiz.base.util.*; -import org.ofbiz.minilang.*; -import org.ofbiz.minilang.method.*; - -/** - * Copies an environment field to a map field - */ -@Deprecated -@MethodOperation.DeprecatedOperation("set") -public class EnvToField extends MethodOperation { - - public static final String module = EnvToField.class.getName(); - - ContextAccessor envAcsr; - ContextAccessor fieldAcsr; - ContextAccessor> mapAcsr; - - public EnvToField(Element element, SimpleMethod simpleMethod) throws MiniLangException { - super(element, simpleMethod); - envAcsr = new ContextAccessor(element.getAttribute("env-name")); - mapAcsr = new ContextAccessor>(element.getAttribute("map-name")); - fieldAcsr = new ContextAccessor(element.getAttribute("field-name")); - // set fieldAcsr to their defualt value of envAcsr if empty - if (fieldAcsr.isEmpty()) { - fieldAcsr = envAcsr; - } - } - - @Override - public boolean exec(MethodContext methodContext) throws MiniLangException { - Object envVar = envAcsr.get(methodContext); - if (envVar == null) { - Debug.logWarning("Environment field not found with name " + envAcsr + ", not copying env field", module); - return true; - } - if (!mapAcsr.isEmpty()) { - Map toMap = mapAcsr.get(methodContext); - if (toMap == null) { - if (Debug.verboseOn()) - Debug.logVerbose("Map not found with name " + mapAcsr + ", creating new map", module); - toMap = FastMap.newInstance(); - mapAcsr.put(methodContext, toMap); - } - fieldAcsr.put(toMap, envVar, methodContext); - } else { - // no to-map, so put in env - fieldAcsr.put(methodContext, envVar); - } - return true; - } - - @Override - public String expandedString(MethodContext methodContext) { - // TODO: something more than a stub/dummy - return this.rawString(); - } - - @Override - public String rawString() { - return ""; - } - - public static final class EnvToFieldFactory implements Factory { - public EnvToField createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { - return new EnvToField(element, simpleMethod); - } - - public String getName() { - return "env-to-field"; - } - } -} diff --git a/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToEnv.java b/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToEnv.java deleted file mode 100644 index 70a2d9b286..0000000000 --- a/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToEnv.java +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - *******************************************************************************/ -package org.ofbiz.minilang.method.envops; - -import java.util.Map; - -import org.ofbiz.base.util.Debug; -import org.ofbiz.minilang.MiniLangException; -import org.ofbiz.minilang.SimpleMethod; -import org.ofbiz.minilang.method.ContextAccessor; -import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; -import org.w3c.dom.Element; - -/** - * Copies a map field to an environment field - */ -@Deprecated -@MethodOperation.DeprecatedOperation("set") -public class FieldToEnv extends MethodOperation { - - public static final String module = FieldToEnv.class.getName(); - - ContextAccessor envAcsr; - ContextAccessor fieldAcsr; - ContextAccessor> mapAcsr; - - public FieldToEnv(Element element, SimpleMethod simpleMethod) throws MiniLangException { - super(element, simpleMethod); - envAcsr = new ContextAccessor(element.getAttribute("env-name")); - mapAcsr = new ContextAccessor>(element.getAttribute("map-name")); - fieldAcsr = new ContextAccessor(element.getAttribute("field-name")); - // set fieldAcsr to their defualt value of envAcsr if empty - this is the way it USED to work, so still supporting it, but a parsing error will result - if (fieldAcsr.isEmpty()) { - fieldAcsr = envAcsr; - } - // this is the new way that makes more sense, ie the destination should default to the source - if (envAcsr.isEmpty()) { - envAcsr = fieldAcsr; - } - } - - @Override - public boolean exec(MethodContext methodContext) throws MiniLangException { - Object fieldVal = null; - if (!mapAcsr.isEmpty()) { - Map fromMap = mapAcsr.get(methodContext); - if (fromMap == null) { - Debug.logWarning("Map not found with name " + mapAcsr + ", not copying field", module); - return true; - } - fieldVal = fieldAcsr.get(fromMap, methodContext); - } else { - // no map name, try the env - fieldVal = fieldAcsr.get(methodContext); - } - if (fieldVal == null) { - if (Debug.verboseOn()) - Debug.logVerbose("Field value not found with name " + fieldAcsr + " in Map with name " + mapAcsr + ", not copying field", module); - return true; - } - envAcsr.put(methodContext, fieldVal); - return true; - } - - @Override - public String expandedString(MethodContext methodContext) { - // TODO: something more than a stub/dummy - return this.rawString(); - } - - @Override - public String rawString() { - return ""; - } - - public static final class FieldToEnvFactory implements Factory { - public FieldToEnv createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { - return new FieldToEnv(element, simpleMethod); - } - - public String getName() { - return "field-to-env"; - } - } -} diff --git a/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToField.java b/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToField.java deleted file mode 100644 index c644244bfd..0000000000 --- a/framework/minilang/src/org/ofbiz/minilang/method/envops/FieldToField.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - *******************************************************************************/ -package org.ofbiz.minilang.method.envops; - -import java.util.Map; - -import javolution.util.FastMap; - -import org.ofbiz.base.util.Debug; -import org.ofbiz.minilang.MiniLangException; -import org.ofbiz.minilang.SimpleMethod; -import org.ofbiz.minilang.method.ContextAccessor; -import org.ofbiz.minilang.method.MethodContext; -import org.ofbiz.minilang.method.MethodOperation; -import org.w3c.dom.Element; - -/** - * Copies a map field to a map field - */ -@Deprecated -@MethodOperation.DeprecatedOperation("set") -public class FieldToField extends MethodOperation { - - public static final String module = FieldToField.class.getName(); - - ContextAccessor fieldAcsr; - ContextAccessor> mapAcsr; - ContextAccessor toFieldAcsr; - ContextAccessor> toMapAcsr; - - public FieldToField(Element element, SimpleMethod simpleMethod) throws MiniLangException { - super(element, simpleMethod); - mapAcsr = new ContextAccessor>(element.getAttribute("map-name")); - fieldAcsr = new ContextAccessor(element.getAttribute("field-name")); - toMapAcsr = new ContextAccessor>(element.getAttribute("to-map-name")); - toFieldAcsr = new ContextAccessor(element.getAttribute("to-field-name")); - // set toMapAcsr and toFieldAcsr to their defualt values of mapAcsr and fieldAcsr if empty - if (toMapAcsr.isEmpty()) { - toMapAcsr = mapAcsr; - } - if (toFieldAcsr.isEmpty()) { - toFieldAcsr = fieldAcsr; - } - } - - @Override - public boolean exec(MethodContext methodContext) throws MiniLangException { - Object fieldVal = null; - if (!mapAcsr.isEmpty()) { - Map fromMap = mapAcsr.get(methodContext); - if (fromMap == null) { - if (Debug.infoOn()) - Debug.logInfo("Map not found with name " + mapAcsr + ", not copying from this map", module); - return true; - } - fieldVal = fieldAcsr.get(fromMap, methodContext); - } else { - // no map name, try the env - fieldVal = fieldAcsr.get(methodContext); - } - if (fieldVal == null) { - if (Debug.verboseOn()) - Debug.logVerbose("Field value not found with name " + fieldAcsr + " in Map with name " + mapAcsr + ", not copying field", module); - return true; - } - // note that going to an env field will only work if it came from an env - // field because if not specified the to-map-name will be set to the map-name - // to go from a map field to an env field, use the field-to-env operation - Map toMap = null; - if (!toMapAcsr.isEmpty()) { - toMap = toMapAcsr.get(methodContext); - if (toMap == null) { - if (Debug.verboseOn()) - Debug.logVerbose("Map not found with name " + toMapAcsr + ", creating new map", module); - toMap = FastMap.newInstance(); - toMapAcsr.put(methodContext, toMap); - } - toFieldAcsr.put(toMap, fieldVal, methodContext); - } else { - // no to-map, so put in env - toFieldAcsr.put(methodContext, fieldVal); - } - return true; - } - - @Override - public String expandedString(MethodContext methodContext) { - // TODO: something more than a stub/dummy - return this.rawString(); - } - - @Override - public String rawString() { - return ""; - } - - public static final class FieldToFieldFactory implements Factory { - public FieldToField createMethodOperation(Element element, SimpleMethod simpleMethod) throws MiniLangException { - return new FieldToField(element, simpleMethod); - } - - public String getName() { - return "field-to-field"; - } - } -}