Convert javolution FastMap, FastSet and FastList by standard java.util.*

Related to OFBIZ-5781 Convert Javolution collections into Java collections
Thanks to Deepak Dixit and Adrian Crum for their help.

By defautl converted :
 * FastMap by HashMap
 * FastList by LinkedList
 * FastSet by HashSet

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1672752 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nicolas Malin
2015-04-10 20:22:54 +00:00
parent fb0f2d3d1d
commit 7d94967a68
331 changed files with 2762 additions and 3148 deletions
@@ -20,12 +20,11 @@
package org.ofbiz.accounting.agreement;
import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilNumber;
@@ -79,7 +78,7 @@ public class AgreementServices {
Delegator delegator = ctx.getDelegator();
Locale locale = (Locale) context.get("locale");
String errMsg = null;
List<Map<String, Object>> commissions = FastList.newInstance();
List<Map<String, Object>> commissions = new LinkedList<Map<String,Object>>();
try {
BigDecimal amount = ((BigDecimal)context.get("amount"));
@@ -21,11 +21,10 @@ package org.ofbiz.accounting.finaccount;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastMap;
import org.ofbiz.accounting.payment.PaymentGatewayServices;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
@@ -404,7 +403,7 @@ public class FinAccountPaymentServices {
}
// build the withdraw context
Map<String, Object> withdrawCtx = FastMap.newInstance();
Map<String, Object> withdrawCtx = new HashMap<String, Object>();
withdrawCtx.put("finAccountId", finAccountId);
withdrawCtx.put("productStoreId", productStoreId);
withdrawCtx.put("currency", currency);
@@ -478,7 +477,7 @@ public class FinAccountPaymentServices {
}
// call the deposit service
Map<String, Object> depositCtx = FastMap.newInstance();
Map<String, Object> depositCtx = new HashMap<String, Object>();
depositCtx.put("finAccountId", finAccountId);
depositCtx.put("productStoreId", productStoreId);
depositCtx.put("isRefund", Boolean.TRUE);
@@ -843,7 +842,7 @@ public class FinAccountPaymentServices {
// hit the payment method for the amount to replenish
Map<String, BigDecimal> orderItemMap = UtilMisc.toMap("Auto-Replenishment FA #" + finAccountId, depositAmount);
Map<String, Object> replOrderCtx = FastMap.newInstance();
Map<String, Object> replOrderCtx = new HashMap<String, Object>();
replOrderCtx.put("productStoreId", productStoreId);
replOrderCtx.put("paymentMethodId", paymentMethod.getString("paymentMethodId"));
replOrderCtx.put("currency", currency);
@@ -863,7 +862,7 @@ public class FinAccountPaymentServices {
String orderId = (String) replResp.get("orderId");
// create the deposit
Map<String, Object> depositCtx = FastMap.newInstance();
Map<String, Object> depositCtx = new HashMap<String, Object>();
depositCtx.put("productStoreId", productStoreId);
depositCtx.put("finAccountId", finAccountId);
depositCtx.put("currency", currency);
@@ -19,6 +19,12 @@
package org.ofbiz.accounting.finaccount;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ServiceUtil;
@@ -29,16 +35,15 @@ import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.entity.util.EntityUtilProperties;
import org.ofbiz.base.util.*;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.base.util.string.FlexibleStringExpander;
import org.ofbiz.order.order.OrderReadHelper;
import org.ofbiz.order.finaccount.FinAccountHelper;
import java.util.*;
import java.math.BigDecimal;
import javolution.util.FastMap;
/**
* FinAccountProductServices - Financial Accounts created from product purchases (i.e. gift certificates)
*/
@@ -169,7 +174,7 @@ public class FinAccountProductServices {
}
// create the context for FSE
Map<String, Object> expContext = FastMap.newInstance();
Map<String, Object> expContext = new HashMap<String, Object>();
expContext.put("orderHeader", orderHeader);
expContext.put("orderItem", orderItem);
expContext.put("party", party);
@@ -186,7 +191,7 @@ public class FinAccountProductServices {
BigDecimal deposit = price.multiply(quantity).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding);
// create the financial account
Map<String, Object> createCtx = FastMap.newInstance();
Map<String, Object> createCtx = new HashMap<String, Object>();
String finAccountId;
createCtx.put("finAccountTypeId", finAccountTypeId);
@@ -218,7 +223,7 @@ public class FinAccountProductServices {
finAccountId = (String) createResp.get("finAccountId");
// create the owner role
Map<String, Object> roleCtx = FastMap.newInstance();
Map<String, Object> roleCtx = new HashMap<String, Object>();
roleCtx.put("partyId", partyId);
roleCtx.put("roleTypeId", "OWNER");
roleCtx.put("finAccountId", finAccountId);
@@ -237,7 +242,7 @@ public class FinAccountProductServices {
}
// create the initial deposit
Map<String, Object> depositCtx = FastMap.newInstance();
Map<String, Object> depositCtx = new HashMap<String, Object>();
depositCtx.put("finAccountId", finAccountId);
depositCtx.put("productStoreId", productStoreId);
depositCtx.put("currency", currency);
@@ -21,12 +21,11 @@ package org.ofbiz.accounting.finaccount;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
@@ -128,7 +127,7 @@ public class FinAccountServices {
creditAccount = EntityQuery.use(delegator).from("FinAccount").where("finAccountId", creditAccountId).queryOne();
// create the owner role
Map<String, Object> roleCtx = FastMap.newInstance();
Map<String, Object> roleCtx = new HashMap<String, Object>();
roleCtx.put("partyId", partyId);
roleCtx.put("roleTypeId", "OWNER");
roleCtx.put("finAccountId", creditAccountId);
@@ -153,7 +152,7 @@ public class FinAccountServices {
}
// create the credit transaction
Map<String, Object> transactionMap = FastMap.newInstance();
Map<String, Object> transactionMap = new HashMap<String, Object>();
transactionMap.put("finAccountTransTypeId", "ADJUSTMENT");
transactionMap.put("finAccountId", creditAccount.getString("finAccountId"));
transactionMap.put("partyId", partyId);
@@ -413,7 +412,7 @@ public class FinAccountServices {
String returnId = (String) rhResp.get("returnId");
// create the return item
Map<String, Object> returnItemCtx = FastMap.newInstance();
Map<String, Object> returnItemCtx = new HashMap<String, Object>();
returnItemCtx.put("returnId", returnId);
returnItemCtx.put("orderId", orderId);
returnItemCtx.put("description", orderItem.getString("itemDescription"));
@@ -455,7 +454,7 @@ public class FinAccountServices {
String paymentId = response.getString("paymentId");
// create the adjustment transaction
Map<String, Object> txCtx = FastMap.newInstance();
Map<String, Object> txCtx = new HashMap<String, Object>();
txCtx.put("finAccountTransTypeId", "ADJUSTMENT");
txCtx.put("finAccountId", finAccountId);
txCtx.put("orderId", orderId);
@@ -26,15 +26,14 @@ import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVRecord;
@@ -236,7 +235,7 @@ public class InvoiceServices {
// create the invoice record
if (UtilValidate.isEmpty(invoiceId)) {
Map<String, Object> createInvoiceContext = FastMap.newInstance();
Map<String, Object> createInvoiceContext = new HashMap<String, Object>();
createInvoiceContext.put("partyId", billToCustomerPartyId);
createInvoiceContext.put("partyIdFrom", billFromVendorPartyId);
createInvoiceContext.put("billingAccountId", billingAccountId);
@@ -261,7 +260,7 @@ public class InvoiceServices {
// order roles to invoice roles
List<GenericValue> orderRoles = orderHeader.getRelated("OrderRole", null, null, false);
Map<String, Object> createInvoiceRoleContext = FastMap.newInstance();
Map<String, Object> createInvoiceRoleContext = new HashMap<String, Object>();
createInvoiceRoleContext.put("invoiceId", invoiceId);
createInvoiceRoleContext.put("userLogin", userLogin);
for (GenericValue orderRole : orderRoles) {
@@ -423,7 +422,7 @@ public class InvoiceServices {
BigDecimal billingAmount = orderItem.getBigDecimal("unitPrice").setScale(invoiceTypeDecimals, ROUNDING);
Map<String, Object> createInvoiceItemContext = FastMap.newInstance();
Map<String, Object> createInvoiceItemContext = new HashMap<String, Object>();
createInvoiceItemContext.put("invoiceId", invoiceId);
createInvoiceItemContext.put("invoiceItemSeqId", invoiceItemSeqId);
createInvoiceItemContext.put("invoiceItemTypeId", getInvoiceItemType(delegator, (orderItem.getString("orderItemTypeId")), (product == null ? null : product.getString("productTypeId")), invoiceType, "INV_FPROD_ITEM"));
@@ -467,7 +466,7 @@ public class InvoiceServices {
invoiceQuantity = invoiceQuantity.add(billingQuantity).setScale(invoiceTypeDecimals, ROUNDING);
// create the OrderItemBilling record
Map<String, Object> createOrderItemBillingContext = FastMap.newInstance();
Map<String, Object> createOrderItemBillingContext = new HashMap<String, Object>();
createOrderItemBillingContext.put("invoiceId", invoiceId);
createOrderItemBillingContext.put("invoiceItemSeqId", invoiceItemSeqId);
createOrderItemBillingContext.put("orderId", orderItem.get("orderId"));
@@ -558,7 +557,7 @@ public class InvoiceServices {
}
}
if (amount.signum() != 0) {
Map<String, Object> createInvoiceItemAdjContext = FastMap.newInstance();
Map<String, Object> createInvoiceItemAdjContext = new HashMap<String, Object>();
createInvoiceItemAdjContext.put("invoiceId", invoiceId);
createInvoiceItemAdjContext.put("invoiceItemSeqId", invoiceItemSeqId);
createInvoiceItemAdjContext.put("invoiceItemTypeId", getInvoiceItemType(delegator, adj.getString("orderAdjustmentTypeId"), null, invoiceType, "INVOICE_ITM_ADJ"));
@@ -607,7 +606,7 @@ public class InvoiceServices {
}
// Create the OrderAdjustmentBilling record
Map<String, Object> createOrderAdjustmentBillingContext = FastMap.newInstance();
Map<String, Object> createOrderAdjustmentBillingContext = new HashMap<String, Object>();
createOrderAdjustmentBillingContext.put("orderAdjustmentId", adj.getString("orderAdjustmentId"));
createOrderAdjustmentBillingContext.put("invoiceId", invoiceId);
createOrderAdjustmentBillingContext.put("invoiceItemSeqId", invoiceItemSeqId);
@@ -643,8 +642,8 @@ public class InvoiceServices {
}
// create header adjustments as line items -- always to tax/shipping last
Map<GenericValue, BigDecimal> shipAdjustments = FastMap.newInstance();
Map<GenericValue, BigDecimal> taxAdjustments = FastMap.newInstance();
Map<GenericValue, BigDecimal> shipAdjustments = new HashMap<GenericValue, BigDecimal>();
Map<GenericValue, BigDecimal> taxAdjustments = new HashMap<GenericValue, BigDecimal>();
List<GenericValue> headerAdjustments = orh.getOrderHeaderAdjustments();
for (GenericValue adj : headerAdjustments) {
@@ -765,7 +764,7 @@ public class InvoiceServices {
.where(EntityCondition.makeCondition("orderId", EntityOperator.EQUALS, orderId),
EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_CANCELLED")
).queryList();
List<GenericValue> currentPayments = FastList.newInstance();
List<GenericValue> currentPayments = new LinkedList<GenericValue>();
for (GenericValue paymentPref : orderPaymentPrefs) {
List<GenericValue> payments = paymentPref.getRelated("Payment", null, null, false);
currentPayments.addAll(payments);
@@ -777,7 +776,7 @@ public class InvoiceServices {
}
BigDecimal notApplied = PaymentWorker.getPaymentNotApplied(payment);
if (notApplied.signum() > 0) {
Map<String, Object> appl = FastMap.newInstance();
Map<String, Object> appl = new HashMap<String, Object>();
appl.put("paymentId", payment.get("paymentId"));
appl.put("invoiceId", invoiceId);
appl.put("billingAccountId", billingAccountId);
@@ -826,8 +825,8 @@ public class InvoiceServices {
GenericValue userLogin = (GenericValue) context.get("userLogin");
Locale locale = (Locale) context.get("locale");
List<String> salesInvoiceIds = UtilGenerics.checkList(context.get("invoiceIds"));
List<Map<String, String>> invoicesCreated = FastList.newInstance();
Map<String, List<Map<String, Object>>> commissionParties = FastMap.newInstance();
List<Map<String, String>> invoicesCreated = new LinkedList<Map<String,String>>();
Map<String, List<Map<String, Object>>> commissionParties = new HashMap<String, List<Map<String,Object>>>();
for (String salesInvoiceId : salesInvoiceIds) {
List<String> salesRepPartyIds = UtilGenerics.checkList(context.get("partyIds"));
BigDecimal amountTotal = InvoiceWorker.getInvoiceTotal(delegator, salesInvoiceId);
@@ -927,7 +926,7 @@ public class InvoiceServices {
Timestamp now = UtilDateTime.nowTimestamp();
// Create invoice for each commission receiving party
for (Map.Entry<String, List<Map<String, Object>>> commissionParty : commissionParties.entrySet()) {
List<GenericValue> toStore = FastList.newInstance();
List<GenericValue> toStore = new LinkedList<GenericValue>();
List<Map<String, Object>> commList = commissionParty.getValue();
// get the billing parties
if (UtilValidate.isEmpty(commList)) {
@@ -941,7 +940,7 @@ public class InvoiceServices {
Long days = (Long) (commList.get(0)).get("days");
// create the invoice record
// To and From are in commission's sense, opposite for invoice
Map<String, Object> createInvoiceMap = FastMap.newInstance();
Map<String, Object> createInvoiceMap = new HashMap<String, Object>();
createInvoiceMap.put("partyId", partyIdBillTo);
createInvoiceMap.put("partyIdFrom", partyIdBillFrom);
createInvoiceMap.put("invoiceDate", now);
@@ -1075,7 +1074,7 @@ public class InvoiceServices {
LocalDispatcher dispatcher = dctx.getDispatcher();
String shipmentId = (String) context.get("shipmentId");
Locale locale = (Locale) context.get("locale");
List<String> invoicesCreated = FastList.newInstance();
List<String> invoicesCreated = new LinkedList<String>();
Map<String, Object> response = ServiceUtil.returnSuccess();
GenericValue orderShipment = null;
String invoicePerShipment = null;
@@ -1138,7 +1137,7 @@ public class InvoiceServices {
"AccountingTroubleGettingShipmentEntity",
UtilMisc.toMap("shipmentId", shipmentId), locale));
}
List<GenericValue> itemIssuances = FastList.newInstance();
List<GenericValue> itemIssuances = new LinkedList<GenericValue>();
try {
itemIssuances = EntityQuery.use(delegator).select("orderId", "shipmentId")
.from("ItemIssuance").orderBy("orderId").distinct().queryList();
@@ -1154,11 +1153,11 @@ public class InvoiceServices {
// The orders can now be placed in separate groups, each for
// 1. The group of orders for which payment is already captured. No grouping and action required.
// 2. The group of orders for which invoice is IN-Process status.
Map<String, GenericValue> ordersWithInProcessInvoice = FastMap.newInstance();
Map<String, GenericValue> ordersWithInProcessInvoice = new HashMap<String, GenericValue>();
for (GenericValue itemIssuance : itemIssuances) {
String orderId = itemIssuance.getString("orderId");
Map<String, Object> billFields = FastMap.newInstance();
Map<String, Object> billFields = new HashMap<String, Object>();
billFields.put("orderId", orderId);
GenericValue orderItemBilling = null;
@@ -1191,7 +1190,7 @@ public class InvoiceServices {
// For In-Process invoice, move the status to ready and capture the payment
for (GenericValue invoice : ordersWithInProcessInvoice.values()) {
String invoiceId = invoice.getString("invoiceId");
Map<String, Object> setInvoiceStatusResult = FastMap.newInstance();
Map<String, Object> setInvoiceStatusResult = new HashMap<String, Object>();
try {
setInvoiceStatusResult = dispatcher.runSync("setInvoiceStatus", UtilMisc.<String, Object>toMap("invoiceId", invoiceId, "statusId", "INVOICE_READY", "userLogin", userLogin));
} catch (GenericServiceException e) {
@@ -1238,7 +1237,7 @@ public class InvoiceServices {
boolean purchaseShipmentFound = false;
boolean dropShipmentFound = false;
List<String> invoicesCreated = FastList.newInstance();
List<String> invoicesCreated = new LinkedList<String>();
//DEJ20060520: not used? planned to be used? List shipmentIdList = new LinkedList();
for (String tmpShipmentId : shipmentIds) {
@@ -1321,17 +1320,17 @@ public class InvoiceServices {
}
// group items by order
Map<String, List<GenericValue>> shippedOrderItems = FastMap.newInstance();
Map<String, List<GenericValue>> shippedOrderItems = new HashMap<String, List<GenericValue>>();
for (GenericValue item : items) {
String orderId = item.getString("orderId");
String orderItemSeqId = item.getString("orderItemSeqId");
List<GenericValue> itemsByOrder = shippedOrderItems.get(orderId);
if (itemsByOrder == null) {
itemsByOrder = FastList.newInstance();
itemsByOrder = new LinkedList<GenericValue>();
}
// check and make sure we haven't already billed for this issuance or shipment receipt
List<EntityCondition> billFields = FastList.newInstance();
List<EntityCondition> billFields = new LinkedList<EntityCondition>();
billFields.add(EntityCondition.makeCondition("orderId", orderId));
billFields.add(EntityCondition.makeCondition("orderItemSeqId", orderItemSeqId));
billFields.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "INVOICE_CANCELLED"));
@@ -1374,10 +1373,10 @@ public class InvoiceServices {
List<GenericValue> billItems = shippedOrderItems.get(orderId);
// a new list to be used to pass to the create invoice service
List<GenericValue> toBillItems = FastList.newInstance();
List<GenericValue> toBillItems = new LinkedList<GenericValue>();
// map of available quantities so we only have to calc once
Map<String, BigDecimal> itemQtyAvail = FastMap.newInstance();
Map<String, BigDecimal> itemQtyAvail = new HashMap<String, BigDecimal>();
// now we will check each issuance and make sure it hasn't already been billed
for (GenericValue issue : billItems) {
@@ -1391,7 +1390,7 @@ public class InvoiceServices {
BigDecimal billAvail = itemQtyAvail.get(issue.getString("orderItemSeqId"));
if (billAvail == null) {
List<EntityCondition> lookup = FastList.newInstance();
List<EntityCondition> lookup = new LinkedList<EntityCondition>();
lookup.add(EntityCondition.makeCondition("orderId", orderId));
lookup.add(EntityCondition.makeCondition("orderItemSeqId", issue.get("orderItemSeqId")));
lookup.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "INVOICE_CANCELLED"));
@@ -1514,7 +1513,7 @@ public class InvoiceServices {
}
// Total the additional shipping charges for the shipments
Map<GenericValue, BigDecimal> additionalShippingCharges = FastMap.newInstance();
Map<GenericValue, BigDecimal> additionalShippingCharges = new HashMap<GenericValue, BigDecimal>();
BigDecimal totalAdditionalShippingCharges = ZERO;
if (UtilValidate.isNotEmpty(invoiceableShipments)) {
for (GenericValue shipment : invoiceableShipments) {
@@ -1533,7 +1532,7 @@ public class InvoiceServices {
GenericValue shipment = entry.getKey();
BigDecimal additionalShippingCharge = entry.getValue();
String shipmentId = shipment.getString("shipmentId");
Map<String, Object> createOrderAdjustmentContext = FastMap.newInstance();
Map<String, Object> createOrderAdjustmentContext = new HashMap<String, Object>();
createOrderAdjustmentContext.put("orderId", orderId);
createOrderAdjustmentContext.put("orderAdjustmentTypeId", "SHIPPING_CHARGES");
String addtlChargeDescription = shipment.getString("addtlShippingChargeDesc");
@@ -1566,8 +1565,8 @@ public class InvoiceServices {
"AccountingTroubleCallingCreateInvoicesFromShipmentService", locale));
}
List<Object> emptyList = FastList.newInstance();
Map<String, Object> calcTaxContext = FastMap.newInstance();
List<Object> emptyList = new LinkedList<Object>();
Map<String, Object> calcTaxContext = new HashMap<String, Object>();
calcTaxContext.put("productStoreId", orh.getProductStoreId());
calcTaxContext.put("payToPartyId", payToParty.getString("partyId"));
calcTaxContext.put("billToPartyId", billToParty.getString("partyId"));
@@ -1761,7 +1760,7 @@ public class InvoiceServices {
boolean salesReturnFound = false;
boolean purchaseReturnFound = false;
List<String> invoicesCreated = FastList.newInstance();
List<String> invoicesCreated = new LinkedList<String>();
try {
// get the shipment and validate that it is a sales return
@@ -1792,7 +1791,7 @@ public class InvoiceServices {
}
// group the shipments by returnId (because we want a seperate itemized invoice for each return)
Map<String, List<GenericValue>> itemsShippedGroupedByReturn = FastMap.newInstance();
Map<String, List<GenericValue>> itemsShippedGroupedByReturn = new HashMap<String, List<GenericValue>>();
for (GenericValue item : shippedItems) {
String returnId = null;
@@ -1824,7 +1823,7 @@ public class InvoiceServices {
// get the List of items shipped to/from this returnId
List<GenericValue> billItems = itemsShippedGroupedByReturn.get(returnId);
if (billItems == null) {
billItems = FastList.newInstance();
billItems = new LinkedList<GenericValue>();
}
// add our item to the group and put it back in the map
@@ -2180,7 +2179,7 @@ public class InvoiceServices {
UtilMisc.toMap("invoiceId", invoiceId), locale));
}
Map<String, BigDecimal> payments = FastMap.newInstance();
Map<String, BigDecimal> payments = new HashMap<String, BigDecimal>();
Timestamp paidDate = null;
for (GenericValue payAppl : paymentAppl) {
payments.put(payAppl.getString("paymentId"), payAppl.getBigDecimal("amountApplied"));
@@ -2239,7 +2238,7 @@ public class InvoiceServices {
amount = baseAmount.multiply(multiplier).divide(divisor, decimals, rounding);
}
if (amount.signum() != 0) {
Map<String, Object> createInvoiceItemContext = FastMap.newInstance();
Map<String, Object> createInvoiceItemContext = new HashMap<String, Object>();
createInvoiceItemContext.put("invoiceId", invoiceId);
createInvoiceItemContext.put("invoiceItemSeqId", invoiceItemSeqId);
createInvoiceItemContext.put("invoiceItemTypeId", getInvoiceItemType(delegator, adj.getString("orderAdjustmentTypeId"), null, invoiceTypeId, "INVOICE_ADJ"));
@@ -2268,7 +2267,7 @@ public class InvoiceServices {
}
// Create the OrderAdjustmentBilling record
Map<String, Object> createOrderAdjustmentBillingContext = FastMap.newInstance();
Map<String, Object> createOrderAdjustmentBillingContext = new HashMap<String, Object>();
createOrderAdjustmentBillingContext.put("orderAdjustmentId", adj.getString("orderAdjustmentId"));
createOrderAdjustmentBillingContext.put("invoiceId", invoiceId);
createOrderAdjustmentBillingContext.put("invoiceItemSeqId", invoiceItemSeqId);
@@ -2295,7 +2294,7 @@ public class InvoiceServices {
amount = percent.multiply(divisor);
}
if (amount.signum() != 0) {
Map<String, Object> createInvoiceItemContext = FastMap.newInstance();
Map<String, Object> createInvoiceItemContext = new HashMap<String, Object>();
createInvoiceItemContext.put("invoiceId", invoiceId);
createInvoiceItemContext.put("invoiceItemSeqId", invoiceItemSeqId);
createInvoiceItemContext.put("invoiceItemTypeId", getInvoiceItemType(delegator, adj.getString("orderAdjustmentTypeId"), null, invoiceTypeId, "INVOICE_ADJ"));
@@ -2324,7 +2323,7 @@ public class InvoiceServices {
}
// Create the OrderAdjustmentBilling record
Map<String, Object> createOrderAdjustmentBillingContext = FastMap.newInstance();
Map<String, Object> createOrderAdjustmentBillingContext = new HashMap<String, Object>();
createOrderAdjustmentBillingContext.put("orderAdjustmentId", adj.getString("orderAdjustmentId"));
createOrderAdjustmentBillingContext.put("invoiceId", invoiceId);
createOrderAdjustmentBillingContext.put("invoiceItemSeqId", invoiceItemSeqId);
@@ -2353,7 +2352,7 @@ public class InvoiceServices {
if (terms != null) {
for (GenericValue term : terms) {
Map<String, Object> createInvoiceTermContext = FastMap.newInstance();
Map<String, Object> createInvoiceTermContext = new HashMap<String, Object>();
createInvoiceTermContext.put("invoiceId", invoiceId);
createInvoiceTermContext.put("invoiceItemSeqId", "_NA_");
createInvoiceTermContext.put("termTypeId", term.get("termTypeId"));
@@ -2443,7 +2442,7 @@ public class InvoiceServices {
String taxAuthGeoId = (String) context.get("taxAuthGeoId");
String useHighestAmount = (String) context.get("useHighestAmount");
List<String> errorMessageList = FastList.newInstance();
List<String> errorMessageList = new LinkedList<String>();
if (debug) Debug.logInfo("updatePaymentApplicationDefBd input parameters..." +
" defaultInvoiceProcessing: " + defaultInvoiceProcessing +
@@ -3357,8 +3356,8 @@ public class InvoiceServices {
String csvString = Charset.forName(encoding).decode(fileBytes).toString();
final BufferedReader csvReader = new BufferedReader(new StringReader(csvString));
CSVFormat fmt = CSVFormat.DEFAULT.withHeader();
List<String> errMsgs = FastList.newInstance();
List<String> newErrMsgs = FastList.newInstance();
List<String> errMsgs = new LinkedList<String>();
List<String> newErrMsgs = new LinkedList<String>();
String lastInvoiceId = null;
String currentInvoiceId = null;
String newInvoiceId = null;
@@ -3395,7 +3394,7 @@ public class InvoiceServices {
// invoice validation
try {
newErrMsgs = FastList.newInstance();
newErrMsgs = new LinkedList<String>();
if (UtilValidate.isEmpty(invoice.get("partyIdFrom"))) {
newErrMsgs.add("Line number " + rec.getRecordNumber() + ": Mandatory Party Id From and Party Id From Trans missing for invoice: " + currentInvoiceId);
} else if (EntityQuery.use(delegator).from("Party").where("partyId", invoice.get("partyIdFrom")).queryOne() == null) {
@@ -3459,7 +3458,7 @@ public class InvoiceServices {
}
// invoice item validation
try {
newErrMsgs = FastList.newInstance();
newErrMsgs = new LinkedList<String>();
if (UtilValidate.isEmpty(invoiceItem.get("invoiceItemSeqId"))) {
newErrMsgs.add("Line number " + rec.getRecordNumber() + ": Mandatory item sequence Id missing for invoice: " + currentInvoiceId);
}
@@ -21,14 +21,13 @@ package org.ofbiz.accounting.invoice;
import java.math.BigDecimal;
import java.math.MathContext;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javolution.util.FastList;
import javolution.util.FastMap;
import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
@@ -114,7 +113,7 @@ public class InvoiceWorker {
/** Method to get the taxable invoice item types as a List of invoiceItemTypeIds. These are identified in Enumeration with enumTypeId TAXABLE_INV_ITM_TY. */
public static List<String> getTaxableInvoiceItemTypeIds(Delegator delegator) throws GenericEntityException {
List<String> typeIds = FastList.newInstance();
List<String> typeIds = new LinkedList<String>();
List<GenericValue> invoiceItemTaxTypes = EntityQuery.use(delegator).from("Enumeration").where("enumTypeId", "TAXABLE_INV_ITM_TY")
.cache().queryList();
for (GenericValue invoiceItemTaxType : invoiceItemTaxTypes) {
@@ -586,7 +585,7 @@ public class InvoiceWorker {
@Deprecated
public static Map<String, Object> getInvoiceTaxByTaxAuthGeoAndParty(GenericValue invoice) {
BigDecimal taxGrandTotal = ZERO;
List<Map<String, Object>> taxByTaxAuthGeoAndPartyList = FastList.newInstance();
List<Map<String, Object>> taxByTaxAuthGeoAndPartyList = new LinkedList<Map<String,Object>>();
List<GenericValue> invoiceItems = null;
if (UtilValidate.isNotEmpty(invoice)) {
try {
@@ -634,7 +633,7 @@ public class InvoiceWorker {
}
}
}
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
result.put("taxByTaxAuthGeoAndPartyList", taxByTaxAuthGeoAndPartyList);
result.put("taxGrandTotal", taxGrandTotal);
return result;
@@ -647,7 +646,7 @@ public class InvoiceWorker {
* will not account for tax lines that do not contain a taxAuthPartyId
*/
public static Map<String, Set<String>> getInvoiceTaxAuthPartyAndGeos (GenericValue invoice) {
Map<String, Set<String>> result = FastMap.newInstance();
Map<String, Set<String>> result = new HashMap<String, Set<String>>();
if (invoice == null)
throw new IllegalArgumentException("Invoice cannot be null.");
@@ -668,7 +667,7 @@ public class InvoiceWorker {
String taxAuthGeoId = invoiceItem.getString("taxAuthGeoId");
if (UtilValidate.isNotEmpty(taxAuthPartyId)) {
if (!result.containsKey(taxAuthPartyId)) {
Set<String> taxAuthGeos = FastSet.newInstance();
Set<String> taxAuthGeos = new HashSet<String>();
taxAuthGeos.add(taxAuthGeoId);
result.put(taxAuthPartyId, taxAuthGeos);
} else {
@@ -23,12 +23,11 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
@@ -66,7 +65,7 @@ public class BillingAccountWorker {
}
public static List<Map<String, Object>> makePartyBillingAccountList(GenericValue userLogin, String currencyUomId, String partyId, Delegator delegator, LocalDispatcher dispatcher) throws GeneralException {
List<Map<String, Object>> billingAccountList = FastList.newInstance();
List<Map<String, Object>> billingAccountList = new LinkedList<Map<String,Object>>();
Map<String, Object> agentResult = dispatcher.runSync("getRelatedParties", UtilMisc.<String, Object>toMap("userLogin", userLogin, "partyIdFrom", partyId,
"roleTypeIdFrom", "AGENT", "roleTypeIdTo", "CUSTOMER", "partyRelationshipTypeId", "AGENT", "includeFromToSwitched", "Y"));
@@ -20,13 +20,12 @@ package org.ofbiz.accounting.payment;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
@@ -412,7 +411,7 @@ public class GiftCertificateServices {
// obtain the order information
OrderReadHelper orh = new OrderReadHelper(delegator, orderPaymentPreference.getString("orderId"));
Map<String, Object> redeemCtx = FastMap.newInstance();
Map<String, Object> redeemCtx = new HashMap<String, Object>();
redeemCtx.put("userLogin", userLogin);
redeemCtx.put("productStoreId", orh.getProductStoreId());
redeemCtx.put("cardNumber", giftCard.get("finAccountId"));
@@ -657,7 +656,7 @@ public class GiftCertificateServices {
currency = EntityUtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD", delegator);
}
Map<String, Object> refundCtx = FastMap.newInstance();
Map<String, Object> refundCtx = new HashMap<String, Object>();
refundCtx.put("productStoreId", productStoreId);
refundCtx.put("currency", currency);
refundCtx.put("partyId", partyId);
@@ -803,7 +802,7 @@ public class GiftCertificateServices {
}
// make a map of answer info
Map<String, Object> answerMap = FastMap.newInstance();
Map<String, Object> answerMap = new HashMap<String, Object>();
if (responseAnswers != null) {
for (GenericValue answer : responseAnswers) {
GenericValue question = null;
@@ -836,7 +835,7 @@ public class GiftCertificateServices {
int qtyLoop = quantity.intValue();
for (int i = 0; i < qtyLoop; i++) {
// create a gift certificate
Map<String, Object> createGcCtx = FastMap.newInstance();
Map<String, Object> createGcCtx = new HashMap<String, Object>();
//createGcCtx.put("paymentConfig", paymentConfig);
createGcCtx.put("productStoreId", productStoreId);
createGcCtx.put("currency", currency);
@@ -860,7 +859,7 @@ public class GiftCertificateServices {
}
// create the fulfillment record
Map<String, Object> gcFulFill = FastMap.newInstance();
Map<String, Object> gcFulFill = new HashMap<String, Object>();
gcFulFill.put("typeEnumId", "GC_ACTIVATE");
gcFulFill.put("partyId", partyId);
gcFulFill.put("orderId", orderId);
@@ -908,7 +907,7 @@ public class GiftCertificateServices {
bcc = orderEmails;
}
}
Map<String, Object> emailCtx = FastMap.newInstance();
Map<String, Object> emailCtx = new HashMap<String, Object>();
String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
if (UtilValidate.isEmpty(bodyScreenLocation)) {
bodyScreenLocation = ProductStoreWorker.getDefaultProductStoreEmailScreenLocation(emailType);
@@ -1031,7 +1030,7 @@ public class GiftCertificateServices {
}
// make a map of answer info
Map<String, Object> answerMap = FastMap.newInstance();
Map<String, Object> answerMap = new HashMap<String, Object>();
if (responseAnswers != null) {
for (GenericValue answer : responseAnswers) {
GenericValue question = null;
@@ -1056,7 +1055,7 @@ public class GiftCertificateServices {
String pinNumber = (String) answerMap.get(pinNumberKey);
// reload the gift card
Map<String, Object> reloadCtx = FastMap.newInstance();
Map<String, Object> reloadCtx = new HashMap<String, Object>();
reloadCtx.put("productStoreId", productStoreId);
reloadCtx.put("currency", currency);
reloadCtx.put("partyId", partyId);
@@ -1079,7 +1078,7 @@ public class GiftCertificateServices {
}
// create the fulfillment record
Map<String, Object> gcFulFill = FastMap.newInstance();
Map<String, Object> gcFulFill = new HashMap<String, Object>();
gcFulFill.put("typeEnumId", "GC_RELOAD");
gcFulFill.put("userLogin", userLogin);
gcFulFill.put("partyId", partyId);
@@ -1137,7 +1136,7 @@ public class GiftCertificateServices {
} else {
answerMap.put("locale", locale);
Map<String, Object> emailCtx = FastMap.newInstance();
Map<String, Object> emailCtx = new HashMap<String, Object>();
String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
if (UtilValidate.isEmpty(bodyScreenLocation)) {
bodyScreenLocation = ProductStoreWorker.getDefaultProductStoreEmailScreenLocation(emailType);
@@ -1231,7 +1230,7 @@ public class GiftCertificateServices {
Debug.logInfo("Returnable INFO : " + returnableQuantity + " @ " + returnablePrice + " :: " + orderItem, module);
// create the return header
Map<String, Object> returnHeaderInfo = FastMap.newInstance();
Map<String, Object> returnHeaderInfo = new HashMap<String, Object>();
returnHeaderInfo.put("fromPartyId", partyId);
returnHeaderInfo.put("userLogin", userLogin);
Map<String, Object> returnHeaderResp = null;
@@ -1261,7 +1260,7 @@ public class GiftCertificateServices {
}
// create the return item
Map<String, Object> returnItemInfo = FastMap.newInstance();
Map<String, Object> returnItemInfo = new HashMap<String, Object>();
returnItemInfo.put("returnId", returnId);
returnItemInfo.put("returnReasonId", "RTN_DIG_FILL_FAIL");
returnItemInfo.put("returnTypeId", "RTN_REFUND");
@@ -1311,7 +1310,7 @@ public class GiftCertificateServices {
}
// update the status to received so it can process
Map<String, Object> updateReturnInfo = FastMap.newInstance();
Map<String, Object> updateReturnInfo = new HashMap<String, Object>();
updateReturnInfo.put("returnId", returnId);
updateReturnInfo.put("statusId", "RETURN_RECEIVED");
updateReturnInfo.put("currentStatusId", "RETURN_REQUESTED");
@@ -22,16 +22,15 @@ import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.accounting.invoice.InvoiceWorker;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
@@ -320,7 +319,7 @@ public class PaymentGatewayServices {
LocalDispatcher dispatcher = dctx.getDispatcher();
String orderId = (String) context.get("orderId");
Locale locale = (Locale) context.get("locale");
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
boolean reAuth = false;
if (context.get("reAuth") != null) {
reAuth = ((Boolean)context.get("reAuth")).booleanValue();
@@ -362,7 +361,7 @@ public class PaymentGatewayServices {
// loop through and auth each order payment preference
int finished = 0;
int hadError = 0;
List<String> messages = FastList.newInstance();
List<String> messages = new LinkedList<String>();
for (GenericValue paymentPref : paymentPrefs) {
if (reAuth && "PAYMENT_AUTHORIZED".equals(paymentPref.getString("statusId"))) {
String paymentConfig = null;
@@ -380,7 +379,7 @@ public class PaymentGatewayServices {
continue;
}
}
Map<String, Object> authContext = FastMap.newInstance();
Map<String, Object> authContext = new HashMap<String, Object>();
authContext.put("orderPaymentPreferenceId", paymentPref.getString("orderPaymentPreferenceId"));
authContext.put("userLogin", context.get("userLogin"));
@@ -473,7 +472,7 @@ public class PaymentGatewayServices {
}
// make the process context
Map<String, Object> processContext = FastMap.newInstance();
Map<String, Object> processContext = new HashMap<String, Object>();
// get the visit record to obtain the client's IP address
GenericValue orderHeader = orh.getOrderHeader();
@@ -757,7 +756,7 @@ public class PaymentGatewayServices {
}
// iterate over the prefs and release each one
List<GenericValue> finished = FastList.newInstance();
List<GenericValue> finished = new LinkedList<GenericValue>();
for (GenericValue pPref : paymentPrefs) {
Map<String, Object> releaseContext = UtilMisc.toMap("userLogin", userLogin, "orderPaymentPreferenceId", pPref.getString("orderPaymentPreferenceId"));
Map<String, Object> releaseResult = null;
@@ -814,7 +813,7 @@ public class PaymentGatewayServices {
pgCredit.set("transactionDate", UtilDateTime.nowTimestamp());
pgCredit.set("currencyUomId", currencyUomId);
// create the internal messages
List<GenericValue> messageEntities = FastList.newInstance();
List<GenericValue> messageEntities = new LinkedList<GenericValue>();
List<String> messages = UtilGenerics.cast(context.get("internalRespMsgs"));
if (UtilValidate.isNotEmpty(messages)) {
for (String message : messages) {
@@ -943,13 +942,13 @@ public class PaymentGatewayServices {
Debug.logWarning("No payment release settings found for - " + paymentPref.getString("paymentMethodTypeId"), module);
return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrder,
"AccountingTroubleCallingReleaseOrderPaymentPreferenceService", locale) + " " +
paymentPref.getString("paymentMethodTypeId"));
paymentPref.getString("paymentMethodTypeId"));
}
if (UtilValidate.isEmpty(paymentConfig)) {
paymentConfig = "payment.properties";
}
GenericValue authTransaction = PaymentGatewayServices.getAuthTransaction(paymentPref);
Map<String, Object> releaseContext = FastMap.newInstance();
Map<String, Object> releaseContext = new HashMap<String, Object>();
releaseContext.put("orderPaymentPreference", paymentPref);
releaseContext.put("releaseAmount", authTransaction.getBigDecimal("amount"));
releaseContext.put("currency", currency);
@@ -963,8 +962,7 @@ public class PaymentGatewayServices {
} catch (GenericServiceException e) {
Debug.logError(e,"Problem releasing payment", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrder,
"AccountingTroubleCallingReleaseOrderPaymentPreferenceService", locale));
"AccountingTroubleCallingReleaseOrderPaymentPreferenceService", locale));
}
// get the release result code
if (releaseResult != null && !ServiceUtil.isError(releaseResult)) {
@@ -1712,7 +1710,7 @@ public class PaymentGatewayServices {
}
// prepare the context for the capture service (must follow the ccCaptureInterface
Map<String, Object> captureContext = FastMap.newInstance();
Map<String, Object> captureContext = new HashMap<String, Object>();
captureContext.put("userLogin", userLogin);
captureContext.put("orderPaymentPreference", paymentPref);
captureContext.put("paymentConfig", paymentConfig);
@@ -1786,7 +1784,7 @@ public class PaymentGatewayServices {
}
private static void saveError(LocalDispatcher dispatcher, GenericValue userLogin, GenericValue paymentPref, Map<String, Object> result, String serviceType, String transactionCode) {
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.put("paymentServiceTypeEnumId", serviceType);
serviceContext.put("orderPaymentPreference", paymentPref);
serviceContext.put("transCodeEnumId", transactionCode);
@@ -1941,7 +1939,7 @@ public class PaymentGatewayServices {
if (Boolean.TRUE.equals(context.get("resultBadCardNumber"))) response.set("resultBadCardNumber", "Y");
// create the internal messages
List<GenericValue> messageEntities = FastList.newInstance();
List<GenericValue> messageEntities = new LinkedList<GenericValue>();
List<String> messages = UtilGenerics.cast(context.get("internalRespMsgs"));
if (UtilValidate.isNotEmpty(messages)) {
Iterator<String> i = messages.iterator();
@@ -2385,7 +2383,7 @@ public class PaymentGatewayServices {
// call the service refundPayment
Map<String, Object> refundResponse = null;
try {
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.put("orderPaymentPreference", orderPaymentPreference);
serviceContext.put("refundAmount", amount);
serviceContext.put("userLogin", userLogin);
@@ -2438,7 +2436,7 @@ public class PaymentGatewayServices {
paymentGatewayConfigId = paymentSettings.getString("paymentGatewayConfigId");
if (serviceName != null) {
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.put("orderPaymentPreference", paymentPref);
serviceContext.put("paymentConfig", paymentConfig);
serviceContext.put("paymentGatewayConfigId", paymentGatewayConfigId);
@@ -2447,7 +2445,7 @@ public class PaymentGatewayServices {
// get the creditCard/address/email
String payToPartyId = null;
try {
payToPartyId = getBillingInformation(orh, paymentPref, FastMap.<String, Object>newInstance());
payToPartyId = getBillingInformation(orh, paymentPref, new HashMap<String, Object>());
} catch (GenericEntityException e) {
Debug.logError(e, "Problems getting billing information", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
@@ -2701,7 +2699,7 @@ public class PaymentGatewayServices {
.where(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PAYMENT_NOT_AUTH"),
EntityCondition.makeCondition("processAttempt", EntityOperator.GREATER_THAN, Long.valueOf(0)))
.orderBy("orderId").queryIterator();
List<String> processList = FastList.newInstance();
List<String> processList = new LinkedList<String>();
if (eli != null) {
Debug.logInfo("Processing failed order re-auth(s)", module);
GenericValue value = null;
@@ -2751,7 +2749,7 @@ public class PaymentGatewayServices {
EntityCondition.makeCondition(ModelEntity.STAMP_FIELD, EntityOperator.LESS_THAN_EQUAL_TO, oneWeekAgo))
.orderBy("orderId").queryIterator();
List<String> processList = FastList.newInstance();
List<String> processList = new LinkedList<String>();
if (eli != null) {
Debug.logInfo("Processing failed order re-auth(s)", module);
GenericValue value = null;
@@ -3063,7 +3061,7 @@ public class PaymentGatewayServices {
}
// prepare the order payment preference (facade)
GenericValue orderPaymentPref = delegator.makeValue("OrderPaymentPreference", FastMap.newInstance());
GenericValue orderPaymentPref = delegator.makeValue("OrderPaymentPreference", new HashMap());
orderPaymentPref.set("orderPaymentPreferenceId", "_NA_");
orderPaymentPref.set("orderId", "_NA_");
orderPaymentPref.set("presentFlag", "N");
@@ -3079,9 +3077,9 @@ public class PaymentGatewayServices {
String currency = EntityUtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD", delegator);
// prepare the auth context
Map<String, Object> authContext = FastMap.newInstance();
Map<String, Object> authContext = new HashMap<String, Object>();
authContext.put("orderId", "_NA_");
authContext.put("orderItems", FastList.newInstance());
authContext.put("orderItems", new LinkedList());
authContext.put("orderPaymentPreference", orderPaymentPref);
authContext.put("creditCard", creditCard);
authContext.put("billToParty", billToParty);
@@ -3180,7 +3178,7 @@ public class PaymentGatewayServices {
"AccountingPaymentTransactionNotYetSupported", locale));
}
// transaction request context
Map<String, Object> requestContext = FastMap.newInstance();
Map<String, Object> requestContext = new HashMap<String, Object>();
String paymentService = null;
String paymentConfig = null;
String paymentGatewayConfigId = null;
@@ -3326,7 +3324,7 @@ public class PaymentGatewayServices {
if (UtilValidate.isNotEmpty(amount)) {
BigDecimal authAmount = new BigDecimal(amount);
if (authAmount.compareTo(BigDecimal.ZERO) > 0) {
Map<String, Object> ccAuthContext = FastMap.newInstance();
Map<String, Object> ccAuthContext = new HashMap<String, Object>();
ccAuthContext.put("paymentMethodId", paymentMethodId);
ccAuthContext.put("productStoreId", productStoreId);
ccAuthContext.put("amount", authAmount);
@@ -3359,7 +3357,7 @@ public class PaymentGatewayServices {
*/
public static Map<String, Object> testProcessor(DispatchContext dctx, Map<String, ? extends Object> context) {
Locale locale = (Locale) context.get("locale");
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
BigDecimal processAmount = (BigDecimal) context.get("processAmount");
if (processAmount != null && processAmount.compareTo(new BigDecimal("100.00")) >= 0)
@@ -3389,7 +3387,7 @@ public class PaymentGatewayServices {
*/
public static Map<String, Object> testProcessorWithCapture(DispatchContext dctx, Map<String, ? extends Object> context) {
Locale locale = (Locale) context.get("locale");
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
BigDecimal processAmount = (BigDecimal) context.get("processAmount");
if (processAmount != null && processAmount.compareTo(new BigDecimal("100.00")) >= 0)
@@ -3452,7 +3450,7 @@ public class PaymentGatewayServices {
*/
public static Map<String, Object> alwaysApproveProcessor(DispatchContext dctx, Map<String, ? extends Object> context) {
Locale locale = (Locale) context.get("locale");
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Debug.logInfo("Test Processor Approving Credit Card", module);
String refNum = UtilDateTime.nowAsString();
@@ -3470,7 +3468,7 @@ public class PaymentGatewayServices {
public static Map<String, Object> alwaysApproveWithCapture(DispatchContext dctx, Map<String, ? extends Object> context) {
Locale locale = (Locale) context.get("locale");
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
String refNum = UtilDateTime.nowAsString();
Debug.logInfo("Test Processor Approving Credit Card with Capture", module);
@@ -3741,7 +3739,7 @@ public class PaymentGatewayServices {
public static boolean isReplacementOrder(GenericValue orderHeader) {
boolean replacementOrderFlag = false;
List<GenericValue> returnItemResponses = FastList.newInstance();
List<GenericValue> returnItemResponses = new LinkedList<GenericValue>();
try {
returnItemResponses = orderHeader.getRelated("ReplacementReturnItemResponse", null, null, false);
} catch (GenericEntityException e) {
@@ -19,13 +19,12 @@
package org.ofbiz.accounting.payment;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilDateTime;
@@ -61,7 +60,7 @@ public class PaymentMethodServices {
* @return Map with the result of the service, the output parameters
*/
public static Map<String, Object> deletePaymentMethod(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
Security security = ctx.getSecurity();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -111,7 +110,7 @@ public class PaymentMethodServices {
}
public static Map<String, Object> makeExpireDate(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
String expMonth = (String) context.get("expMonth");
String expYear = (String) context.get("expYear");
@@ -132,7 +131,7 @@ public class PaymentMethodServices {
* @return Map with the result of the service, the output parameters
*/
public static Map<String, Object> createCreditCard(DispatchContext ctx, Map<String, Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
Security security = ctx.getSecurity();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -145,7 +144,7 @@ public class PaymentMethodServices {
if (result.size() > 0) return result;
// do some more complicated/critical validation...
List<String> messages = FastList.newInstance();
List<String> messages = new LinkedList<String>();
// first remove all spaces from the credit card number
context.put("cardNumber", StringUtil.removeSpaces((String) context.get("cardNumber")));
@@ -166,7 +165,7 @@ public class PaymentMethodServices {
return ServiceUtil.returnError(messages);
}
List<GenericValue> toBeStored = FastList.newInstance();
List<GenericValue> toBeStored = new LinkedList<GenericValue>();
GenericValue newPm = delegator.makeValue("PaymentMethod");
toBeStored.add(newPm);
@@ -254,7 +253,7 @@ public class PaymentMethodServices {
* @return Map with the result of the service, the output parameters
*/
public static Map<String, Object> updateCreditCard(DispatchContext ctx, Map<String, Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
Security security = ctx.getSecurity();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -266,7 +265,7 @@ public class PaymentMethodServices {
if (result.size() > 0) return result;
List<GenericValue> toBeStored = FastList.newInstance();
List<GenericValue> toBeStored = new LinkedList<GenericValue>();
boolean isModified = false;
GenericValue paymentMethod = null;
@@ -295,7 +294,7 @@ public class PaymentMethodServices {
}
// do some more complicated/critical validation...
List<String> messages = FastList.newInstance();
List<String> messages = new LinkedList<String>();
// first remove all spaces from the credit card number
String updatedCardNumber = StringUtil.removeSpaces((String) context.get("cardNumber"));
@@ -484,7 +483,7 @@ public class PaymentMethodServices {
}
public static Map<String, Object> createGiftCard(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
Security security = ctx.getSecurity();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -497,7 +496,7 @@ public class PaymentMethodServices {
if (result.size() > 0)
return result;
List<GenericValue> toBeStored = FastList.newInstance();
List<GenericValue> toBeStored = new LinkedList<GenericValue>();
GenericValue newPm = delegator.makeValue("PaymentMethod");
toBeStored.add(newPm);
GenericValue newGc = delegator.makeValue("GiftCard");
@@ -541,7 +540,7 @@ public class PaymentMethodServices {
}
public static Map<String, Object> updateGiftCard(DispatchContext ctx, Map<String, Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
Security security = ctx.getSecurity();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -554,7 +553,7 @@ public class PaymentMethodServices {
if (result.size() > 0)
return result;
List<GenericValue> toBeStored = FastList.newInstance();
List<GenericValue> toBeStored = new LinkedList<GenericValue>();
boolean isModified = false;
GenericValue paymentMethod = null;
@@ -675,7 +674,7 @@ public class PaymentMethodServices {
* @return Map with the result of the service, the output parameters
*/
public static Map<String, Object> createEftAccount(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
Security security = ctx.getSecurity();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -687,7 +686,7 @@ public class PaymentMethodServices {
if (result.size() > 0) return result;
List<GenericValue> toBeStored = FastList.newInstance();
List<GenericValue> toBeStored = new LinkedList<GenericValue>();
GenericValue newPm = delegator.makeValue("PaymentMethod");
toBeStored.add(newPm);
@@ -774,7 +773,7 @@ public class PaymentMethodServices {
* @return Map with the result of the service, the output parameters
*/
public static Map<String, Object> updateEftAccount(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
Security security = ctx.getSecurity();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -786,7 +785,7 @@ public class PaymentMethodServices {
if (result.size() > 0) return result;
List<GenericValue> toBeStored = FastList.newInstance();
List<GenericValue> toBeStored = new LinkedList<GenericValue>();
boolean isModified = false;
GenericValue paymentMethod = null;
@@ -20,14 +20,13 @@ package org.ofbiz.accounting.payment;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletRequest;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilFormatOut;
import org.ofbiz.base.util.UtilMisc;
@@ -58,14 +57,14 @@ public class PaymentWorker {
}
public static List<Map<String, GenericValue>> getPartyPaymentMethodValueMaps(Delegator delegator, String partyId, Boolean showOld) {
List<Map<String, GenericValue>> paymentMethodValueMaps = FastList.newInstance();
List<Map<String, GenericValue>> paymentMethodValueMaps = new LinkedList<Map<String,GenericValue>>();
try {
List<GenericValue> paymentMethods = EntityQuery.use(delegator).from("PaymentMethod").where("partyId", partyId).queryList();
if (!showOld) paymentMethods = EntityUtil.filterByDate(paymentMethods, true);
for (GenericValue paymentMethod : paymentMethods) {
Map<String, GenericValue> valueMap = FastMap.newInstance();
Map<String, GenericValue> valueMap = new HashMap<String, GenericValue>();
paymentMethodValueMaps.add(valueMap);
valueMap.put("paymentMethod", paymentMethod);
@@ -88,7 +87,7 @@ public class PaymentWorker {
public static Map<String, Object> getPaymentMethodAndRelated(ServletRequest request, String partyId) {
Delegator delegator = (Delegator) request.getAttribute("delegator");
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Boolean tryEntity = true;
if (request.getAttribute("_ERROR_MESSAGE_") != null) tryEntity = false;
@@ -20,15 +20,14 @@ package org.ofbiz.accounting.tax;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javolution.util.FastList;
import javolution.util.FastMap;
import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilGenerics;
@@ -89,7 +88,7 @@ public class TaxAuthorityServices {
}
if ("Y".equals(productStore.getString("showPricesWithVatTax"))) {
Set<GenericValue> taxAuthoritySet = FastSet.newInstance();
Set<GenericValue> taxAuthoritySet = new HashSet<GenericValue>();
if (productStore.get("vatTaxAuthPartyId") == null) {
List<GenericValue> taxAuthorityRawList = EntityQuery.use(delegator).from("TaxAuthority")
.where("taxAuthGeoId", productStore.get("vatTaxAuthGeoId")).cache().queryList();
@@ -191,7 +190,7 @@ public class TaxAuthorityServices {
}
// without knowing the TaxAuthority parties, just find all TaxAuthories for the set of IDs...
Set<GenericValue> taxAuthoritySet = FastSet.newInstance();
Set<GenericValue> taxAuthoritySet = new HashSet<GenericValue>();
try {
getTaxAuthorities(delegator, shippingAddress, taxAuthoritySet);
} catch (GenericEntityException e) {
@@ -200,8 +199,8 @@ public class TaxAuthorityServices {
}
// Setup the return lists.
List<GenericValue> orderAdjustments = FastList.newInstance();
List<List<GenericValue>> itemAdjustments = FastList.newInstance();
List<GenericValue> orderAdjustments = new LinkedList<GenericValue>();
List<List<GenericValue>> itemAdjustments = new LinkedList<List<GenericValue>>();
// Loop through the products; get the taxCategory; and lookup each in the cache.
for (int i = 0; i < itemProductList.size(); i++) {
@@ -234,7 +233,7 @@ public class TaxAuthorityServices {
}
private static void getTaxAuthorities(Delegator delegator, GenericValue shippingAddress, Set<GenericValue> taxAuthoritySet) throws GenericEntityException {
Map<String, String> geoIdByTypeMap = FastMap.newInstance();
Map<String, String> geoIdByTypeMap = new HashMap<String, String>();
if (shippingAddress != null) {
if (UtilValidate.isNotEmpty(shippingAddress.getString("countryGeoId"))) {
geoIdByTypeMap.put("COUNTRY", shippingAddress.getString("countryGeoId"));
@@ -269,7 +268,7 @@ public class TaxAuthorityServices {
BigDecimal itemPrice, BigDecimal itemQuantity, BigDecimal itemAmount,
BigDecimal shippingAmount, BigDecimal orderPromotionsAmount) {
Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
List<GenericValue> adjustments = FastList.newInstance();
List<GenericValue> adjustments = new LinkedList<GenericValue>();
if (payToPartyId == null) {
if (productStore != null) {
@@ -289,7 +288,7 @@ public class TaxAuthorityServices {
}
// build the TaxAuthority expressions (taxAuthGeoId, taxAuthPartyId)
List<EntityCondition> taxAuthCondOrList = FastList.newInstance();
List<EntityCondition> taxAuthCondOrList = new LinkedList<EntityCondition>();
// start with the _NA_ TaxAuthority...
taxAuthCondOrList.add(EntityCondition.makeCondition(
EntityCondition.makeCondition("taxAuthPartyId", EntityOperator.EQUALS, "_NA_"),
@@ -315,7 +314,7 @@ public class TaxAuthorityServices {
if ("Y".equals(product.getString("isVariant"))) {
virtualProductId = ProductWorker.getVariantVirtualId(product);
}
Set<String> productCategoryIdSet = FastSet.newInstance();
Set<String> productCategoryIdSet = new HashSet<String>();
EntityCondition productIdCond = null;
if (virtualProductId != null) {
productIdCond = EntityCondition.makeCondition(
@@ -464,7 +463,7 @@ public class TaxAuthorityServices {
if (UtilValidate.isNotEmpty(billToPartyId) && UtilValidate.isNotEmpty(taxAuthGeoId)) {
// see if partyId is a member of any groups, if so honor their tax exemptions
// look for PartyRelationship with partyRelationshipTypeId=GROUP_ROLLUP, the partyIdTo is the group member, so the partyIdFrom is the groupPartyId
Set<String> billToPartyIdSet = FastSet.newInstance();
Set<String> billToPartyIdSet = new HashSet<String>();
billToPartyIdSet.add(billToPartyId);
List<GenericValue> partyRelationshipList = EntityQuery.use(delegator).from("PartyRelationship")
.where("partyIdTo", billToPartyId, "partyRelationshipTypeId", "GROUP_ROLLUP")
@@ -528,7 +527,7 @@ public class TaxAuthorityServices {
}
} catch (GenericEntityException e) {
Debug.logError(e, "Problems looking up tax rates", module);
return FastList.newInstance();
return new LinkedList<GenericValue>();
}
return adjustments;
@@ -21,13 +21,12 @@ package org.ofbiz.accounting.thirdparty.authorizedotnet;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import javolution.util.FastMap;
import org.ofbiz.accounting.payment.PaymentGatewayServices;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.HttpClient;
@@ -82,7 +81,7 @@ public class AIMPaymentServices {
Delegator delegator = ctx.getDelegator();
Locale locale = (Locale) context.get("locale");
Map<String, Object> results = ServiceUtil.returnSuccess();
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
Properties props = buildAIMProperties(context, delegator);
buildMerchantInfo(context, props, request);
buildGatewayResponeConfig(context, props, request);
@@ -123,7 +122,7 @@ public class AIMPaymentServices {
context.put("creditCard", creditCard);
context.put("authTransaction", authTransaction);
Map<String, Object> results = ServiceUtil.returnSuccess();
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
Properties props = buildAIMProperties(context, delegator);
buildMerchantInfo(context, props, request);
buildGatewayResponeConfig(context, props, request);
@@ -171,7 +170,7 @@ public class AIMPaymentServices {
context.put("creditCard",creditCard);
context.put("authTransaction",authTransaction);
Map<String, Object> results = ServiceUtil.returnSuccess();
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
Properties props = buildAIMProperties(context, delegator);
buildMerchantInfo(context, props, request);
buildGatewayResponeConfig(context, props, request);
@@ -262,7 +261,7 @@ public class AIMPaymentServices {
Locale locale = (Locale) context.get("locale");
context.put("authTransaction", authTransaction);
Map<String, Object> results = ServiceUtil.returnSuccess();
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
Properties props = buildAIMProperties(context, delegator);
buildMerchantInfo(context, props, request);
buildGatewayResponeConfig(context, props, request);
@@ -279,7 +278,7 @@ public class AIMPaymentServices {
}
public static Map<String, Object> ccCredit(DispatchContext ctx, Map<String, Object> context) {
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
results.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
results.put(ModelService.ERROR_MESSAGE, "Authorize.net ccCredit unsupported with version 3.1");
return results;
@@ -289,7 +288,7 @@ public class AIMPaymentServices {
Delegator delegator = ctx.getDelegator();
Locale locale = (Locale) context.get("locale");
Map<String, Object> results = ServiceUtil.returnSuccess();
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
Properties props = buildAIMProperties(context, delegator);
buildMerchantInfo(context, props, request);
buildGatewayResponeConfig(context, props, request);
@@ -315,7 +314,7 @@ public class AIMPaymentServices {
}
private static Map<String, Object> processCard(Map<String, Object> request, Properties props, Locale locale) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
String url = props.getProperty("url");
if (UtilValidate.isEmpty(url)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
@@ -637,7 +636,7 @@ public class AIMPaymentServices {
}
private static Map<String, Object> validateRequest(Map<String, Object> params, Properties props, Map<String, Object> AIMRequest) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
return result;
}
@@ -699,7 +698,7 @@ public class AIMPaymentServices {
}
private static Map<String, Object> processRefundTransResult(Map<String, Object> request, Map<String, Object> reply) {
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse");
try {
Boolean captureResult = (Boolean) reply.get("authResult");
@@ -726,7 +725,7 @@ public class AIMPaymentServices {
}
private static Map<String, Object> processReleaseTransResult(Map<String, Object> request, Map<String, Object> reply) {
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse");
try {
Boolean captureResult = (Boolean) reply.get("authResult");
@@ -19,14 +19,13 @@
package org.ofbiz.accounting.thirdparty.authorizedotnet;
import java.util.LinkedHashMap;
import java.util.Map;
import javolution.util.FastMap;
public class AIMRespPositions extends AuthorizeResponse.RespPositions {
// AIM v3.1 response positions
private static Map<String, Integer> positions = FastMap.newInstance();
private static Map<String, Integer> positions = new LinkedHashMap<String, Integer>();
static {
positions.put(AuthorizeResponse.RESPONSE_CODE, 1);
positions.put(AuthorizeResponse.REASON_CODE, 3);
@@ -35,7 +34,7 @@ public class AIMRespPositions extends AuthorizeResponse.RespPositions {
positions.put(AuthorizeResponse.AVS_RESULT_CODE, 6);
positions.put(AuthorizeResponse.CVV_RESULT_CODE, 39);
positions.put(AuthorizeResponse.TRANSACTION_ID, 7);
positions.put(AuthorizeResponse.AMOUNT, 10);
positions.put(AuthorizeResponse.AMOUNT, 10);
}
@Override
@@ -19,14 +19,13 @@
package org.ofbiz.accounting.thirdparty.authorizedotnet;
import java.util.LinkedHashMap;
import java.util.Map;
import javolution.util.FastMap;
public class CPRespPositions extends AuthorizeResponse.RespPositions {
// Card-Present v1.0 response positions
private static Map<String, Integer> positions = FastMap.newInstance();
private static Map<String, Integer> positions = new LinkedHashMap<String, Integer>();
static {
positions.put(AuthorizeResponse.RESPONSE_CODE, 2);
positions.put(AuthorizeResponse.REASON_CODE, 3);
@@ -35,9 +34,9 @@ public class CPRespPositions extends AuthorizeResponse.RespPositions {
positions.put(AuthorizeResponse.AVS_RESULT_CODE, 6);
positions.put(AuthorizeResponse.CVV_RESULT_CODE, 7);
positions.put(AuthorizeResponse.TRANSACTION_ID, 8);
positions.put(AuthorizeResponse.AMOUNT, 25);
positions.put(AuthorizeResponse.AMOUNT, 25);
}
@Override
public int getPosition(String name) {
if (positions.containsKey(name)) {
@@ -19,13 +19,12 @@
package org.ofbiz.accounting.thirdparty.cybersource;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import javolution.util.FastMap;
import org.ofbiz.accounting.payment.PaymentGatewayServices;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.SSLUtil;
@@ -304,7 +303,7 @@ public class IcsPaymentServices {
// make the request map
String capture = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "autoBill", configString, "payment.cybersource.autoBill", "false");
String orderId = (String) context.get("orderId");
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
request.put("ccAuthService_run", "true"); // run auth service
request.put("ccCaptureService_run", capture); // run capture service (i.e. sale)
request.put("merchantReferenceCode", orderId); // set the order ref number
@@ -325,7 +324,7 @@ public class IcsPaymentServices {
}
String merchantDesc = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "merchantDescr", configString, "payment.cybersource.merchantDescr", null);
String merchantCont = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "merchantContact", configString, "payment.cybersource.merchantContact", null);
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
request.put("ccCaptureService_run", "true");
request.put("ccCaptureService_authRequestID", authTransaction.getString("referenceNum"));
request.put("item_0_unitPrice", getAmountString(context, "captureAmount"));
@@ -345,7 +344,7 @@ public class IcsPaymentServices {
}
private static Map<String, Object> buildReleaseRequest(Map<String, ? extends Object> context, GenericValue authTransaction) {
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference");
String currency = (String) context.get("currency");
request.put("ccAuthReversalService_run", "true");
@@ -366,7 +365,7 @@ public class IcsPaymentServices {
String currency = (String) context.get("currency");
String merchantDesc = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "merchantDescr", configString, "payment.cybersource.merchantDescr", null);
String merchantCont = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "merchantContact", configString, "payment.cybersource.merchantContact", null);
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
request.put("ccCreditService_run", "true");
request.put("ccCreditService_captureRequestID", authTransaction.getString("referenceNum"));
request.put("item_0_unitPrice", getAmountString(context, "refundAmount"));
@@ -383,7 +382,7 @@ public class IcsPaymentServices {
private static Map<String, Object> buildCreditRequest(Map<String, ? extends Object> context) {
String refCode = (String) context.get("referenceCode");
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
request.put("ccCreditService_run", "true"); // run credit service
request.put("merchantReferenceCode", refCode); // set the ref number could be order id
appendFullBillingInfo(request, context); // add in all address info
@@ -19,10 +19,9 @@
package org.ofbiz.accounting.thirdparty.gosoftware;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.HttpClient;
@@ -99,13 +98,13 @@ public class RitaApi {
protected int mode = 0;
public RitaApi(Map<String, String> document) {
this.document = FastMap.newInstance();
this.document = new HashMap<String, String>();
this.document.putAll(document);
this.mode = MODE_OUT;
}
public RitaApi() {
this.document = FastMap.newInstance();
this.document = new HashMap<String, String>();
this.mode = MODE_IN;
}
@@ -226,7 +225,7 @@ public class RitaApi {
br.close();
*/
Map<String, String> docMap = FastMap.newInstance();
Map<String, String> docMap = new HashMap<String, String>();
String resp = null;
try {
resp = http.post(stream);
@@ -32,9 +32,6 @@ import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilDateTime;
@@ -140,7 +137,7 @@ public class IdealEvents {
return "error";
}
List<String> descriptionList = FastList.newInstance();
List<String> descriptionList = new LinkedList<String>();
for (GenericValue orderItem : orderItemList) {
if (UtilValidate.isNotEmpty(orderItem.get("itemDescription"))){
descriptionList.add((String) orderItem.get("itemDescription"));
@@ -427,7 +424,7 @@ public class IdealEvents {
}
public static List<Issuer> getIssuerList() {
List<Issuer> issuerList = FastList.newInstance();
List<Issuer> issuerList = new LinkedList<Issuer>();
try {
IdealConnector connector = new IdealConnector("payment");
Issuers issuers = connector.getIssuerList();
@@ -19,11 +19,10 @@
package org.ofbiz.accounting.thirdparty.orbital;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastMap;
import org.ofbiz.accounting.payment.PaymentGatewayServices;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilFormatOut;
@@ -260,7 +259,7 @@ public class OrbitalPaymentServices {
//TODO: Will move this to property file and then will read it from there.
String configFile = "/applications/accounting/config/linehandler.properties";
String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId");
Map<String, Object> buildConfiguratorContext = FastMap.newInstance();
Map<String, Object> buildConfiguratorContext = new HashMap<String, Object>();
try {
buildConfiguratorContext.put("OrbitalConnectionUsername", getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "username"));
buildConfiguratorContext.put("OrbitalConnectionPassword", getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "connectionPassword"));
@@ -496,7 +495,7 @@ public class OrbitalPaymentServices {
}
private static Map<String, Object> processCard(RequestIF request) {
Map<String, Object> processCardResult = FastMap.newInstance();
Map<String, Object> processCardResult = new HashMap<String, Object>();
try {
response = tp.process(request);
if (response.isApproved()) {
@@ -606,7 +605,7 @@ public class OrbitalPaymentServices {
}
private static void printTransResult(ResponseIF response) {
Map<String, Object> generatedResponse = FastMap.newInstance();
Map<String, Object> generatedResponse = new HashMap<String, Object>();
generatedResponse.put("isGood", response.isGood());
generatedResponse.put("isError", response.isError());
generatedResponse.put("isQuickResponse", response.isQuickResponse());
@@ -650,7 +649,7 @@ public class OrbitalPaymentServices {
}
private static Map<String, Object> validateRequest(Map<String, Object> params, Map props, RequestIF request) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
return result;
}
@@ -24,6 +24,8 @@ import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.lang.ref.WeakReference;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -33,9 +35,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.transaction.Transaction;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.apache.commons.lang.StringUtils;
import org.ofbiz.accounting.payment.PaymentGatewayServices;
import org.ofbiz.base.util.Debug;
@@ -192,7 +191,7 @@ public class PayPalServices {
// Since most if not all of the shipping estimate codes requires a persisted contactMechId we'll create one and
// then delete once we're done, now is not the time to worry about updating everything
String contactMechId = null;
Map<String, Object> inMap = FastMap.newInstance();
Map<String, Object> inMap = new HashMap<String, Object>();
inMap.put("address1", paramMap.get("SHIPTOSTREET"));
inMap.put("address2", paramMap.get("SHIPTOSTREET2"));
inMap.put("city", paramMap.get("SHIPTOCITY"));
@@ -302,7 +301,7 @@ public class PayPalServices {
String ack = decoder.get("ACK");
Map<String, String> result = null;
if (!"Success".equals(ack)) {
result = FastMap.newInstance();
result = new HashMap<String, Object>();
int i = 0;
while (UtilValidate.isNotEmpty(decoder.get("L_ERRORCODE" + i))) {
String errorCode = decoder.get("L_ERRORCODE" + i);
@@ -416,7 +415,7 @@ public class PayPalServices {
}
}
Map<String, Object> inMap = FastMap.newInstance();
Map<String, Object> inMap = new HashMap<String, Object>();
Map<String, Object> outMap = null;
// Create the person if necessary
boolean newParty = false;
@@ -523,7 +522,7 @@ public class PayPalServices {
boolean needsShippingPurpose = true;
// if the cart for some reason already has a billing address, we'll leave it be
boolean needsBillingPurpose = (cart.getContactMech("BILLING_LOCATION") == null);
Map<String, Object> postalMap = FastMap.newInstance();
Map<String, Object> postalMap = new HashMap<String, Object>();
postalMap.put("toName", decoder.get("SHIPTONAME"));
postalMap.put("address1", decoder.get("SHIPTOSTREET"));
postalMap.put("address2", decoder.get("SHIPTOSTREET2"));
@@ -731,7 +730,7 @@ public class PayPalServices {
return ServiceUtil.returnError(UtilMisc.toList(errorMessages.values()));
}
Map<String, Object> inMap = FastMap.newInstance();
Map<String, Object> inMap = new HashMap<String, Object>();
inMap.put("userLogin", userLogin);
inMap.put("paymentMethodId", payPalPaymentMethod.get("paymentMethodId"));
inMap.put("transactionId", decoder.get("TRANSACTIONID"));
@@ -1035,7 +1034,7 @@ public class PayPalServices {
private static String parseStateProvinceGeoId(String payPalShipToState, String countryGeoId, Delegator delegator) {
String lookupField = "geoName";
List<EntityCondition> conditionList = FastList.newInstance();
List<EntityCondition> conditionList = new LinkedList<EntityCondition>();
conditionList.add(EntityCondition.makeCondition("geoAssocTypeId", "REGIONS"));
if ("USA".equals(countryGeoId) || "CAN".equals(countryGeoId)) {
// PayPal returns two letter code for US and Canadian States/Provinces
@@ -22,12 +22,11 @@ package org.ofbiz.accounting.thirdparty.sagepay;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastMap;
import org.ofbiz.accounting.payment.PaymentGatewayServices;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
@@ -53,7 +52,7 @@ public class SagePayPaymentServices {
Debug.logInfo("SagePay - Entered buildCustomerBillingInfo", module);
Debug.logInfo("SagePay buildCustomerBillingInfo context : " + context, module);
Map<String, String> billingInfo = FastMap.newInstance();
Map<String, String> billingInfo = new HashMap<String, String>();
String orderId = null;
BigDecimal processAmount = null;
@@ -31,8 +31,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import javolution.util.FastMap;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
@@ -54,7 +52,7 @@ public class SagePayUtil
public static Map<String, Object> buildCardAuthorisationPaymentResponse
(Boolean authResult, String authCode, String authFlag, BigDecimal processAmount, String authRefNum, String authAltRefNum, String authMessage) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
if(authResult != null) { result.put("authResult", authResult); }
if(authCode != null) { result.put("authCode", authCode); }
if(authFlag != null) { result.put("authFlag", authFlag); }
@@ -68,7 +66,7 @@ public class SagePayUtil
public static Map<String, Object> buildCardCapturePaymentResponse
(Boolean captureResult, String captureCode, String captureFlag, BigDecimal captureAmount, String captureRefNum, String captureAltRefNum, String captureMessage) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
if(captureResult != null) { result.put("captureResult", captureResult); }
if(captureCode != null) { result.put("captureCode", captureCode); }
if(captureFlag != null) { result.put("captureFlag", captureFlag); }
@@ -82,7 +80,7 @@ public class SagePayUtil
public static Map<String, Object> buildCardReleasePaymentResponse
(Boolean releaseResult, String releaseCode, BigDecimal releaseAmount, String releaseRefNum, String releaseAltRefNum, String releaseMessage) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
if(releaseResult != null) { result.put("releaseResult", releaseResult); }
if(releaseCode != null) { result.put("releaseCode", releaseCode); }
if(releaseAmount != null) { result.put("releaseAmount", releaseAmount); }
@@ -95,7 +93,7 @@ public class SagePayUtil
public static Map<String, Object> buildCardVoidPaymentResponse
(Boolean refundResult, BigDecimal refundAmount, String refundRefNum, String refundAltRefNum, String refundMessage) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
if(refundResult != null) { result.put("refundResult", refundResult); }
if(refundAmount != null) { result.put("refundAmount", refundAmount); }
if(refundRefNum != null) { result.put("refundRefNum", refundRefNum); }
@@ -107,7 +105,7 @@ public class SagePayUtil
public static Map<String, Object> buildCardRefundPaymentResponse
(Boolean refundResult, String refundCode, BigDecimal refundAmount, String refundRefNum, String refundAltRefNum, String refundMessage) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
if(refundResult != null) { result.put("refundResult", refundResult); }
if(refundCode != null) { result.put("refundCode", refundCode); }
if(refundAmount != null) { result.put("refundAmount", refundAmount); }
@@ -32,6 +32,8 @@ import java.security.PublicKey;
import java.security.spec.InvalidKeySpecException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -54,9 +56,6 @@ import javax.crypto.spec.DHPrivateKeySpec;
import javax.crypto.spec.DHPublicKeySpec;
import javax.crypto.spec.IvParameterSpec;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.HttpClient;
import org.ofbiz.base.util.HttpClientException;
@@ -75,7 +74,7 @@ public class ValueLinkApi {
public static final String module = ValueLinkApi.class.getName();
// static object cache
private static Map<String, Object> objectCache = FastMap.newInstance();
private static Map<String, Object> objectCache = new HashMap<String, Object>();
// instance variables
protected Delegator delegator = null;
@@ -696,7 +695,7 @@ public class ValueLinkApi {
* @return Map containing the inital request values
*/
public Map<String, Object> getInitialRequestMap(Map<String, Object> context) {
Map<String, Object> request = FastMap.newInstance();
Map<String, Object> request = new HashMap<String, Object>();
// merchant information
request.put("MerchID", merchantId + terminalId);
@@ -941,7 +940,7 @@ public class ValueLinkApi {
subResponse = StringUtil.replaceString(subResponse, "</td>", "");
// make the map
Map<String, Object> responseMap = FastMap.newInstance();
Map<String, Object> responseMap = new HashMap<String, Object>();
responseMap.putAll(StringUtil.strToMap(subResponse, true));
// add the raw html back in just in case we need it later
@@ -997,7 +996,7 @@ public class ValueLinkApi {
List<String> valueList = StringUtil.split(values, "&");
// create a List of Maps for each set of values
List<Map<String, String>> valueMap = FastList.newInstance();
List<Map<String, String>> valueMap = new LinkedList<Map<String,String>>();
for (int i = 0; i < valueList.size(); i++) {
valueMap.add(StringUtil.createMap(StringUtil.split(keys, "|"), StringUtil.split(valueList.get(i), "|")));
}
@@ -19,13 +19,12 @@
package org.ofbiz.accounting.thirdparty.valuelink;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.HttpClientException;
import org.ofbiz.base.util.StringUtil;
@@ -770,7 +769,7 @@ public class ValueLinkServices {
private static void setTimeoutReversal(DispatchContext dctx, Map<String, Object> ctx, Map<String, Object> request) {
String vlInterface = (String) request.get("Interface");
// clone the context
Map<String, Object> context = FastMap.newInstance();
Map<String, Object> context = new HashMap<String, Object>();
context.putAll(ctx);
// append the rollback interface
@@ -826,7 +825,7 @@ public class ValueLinkServices {
currency = EntityUtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD", delegator);
}
Map<String, Object> redeemCtx = FastMap.newInstance();
Map<String, Object> redeemCtx = new HashMap<String, Object>();
redeemCtx.put("userLogin", userLogin);
redeemCtx.put("paymentConfig", paymentConfig);
redeemCtx.put("cardNumber", giftCard.get("cardNumber"));
@@ -919,7 +918,7 @@ public class ValueLinkServices {
currency = EntityUtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD", delegator);
}
Map<String, Object> redeemCtx = FastMap.newInstance();
Map<String, Object> redeemCtx = new HashMap<String, Object>();
redeemCtx.put("userLogin", userLogin);
redeemCtx.put("paymentConfig", paymentConfig);
redeemCtx.put("cardNumber", giftCard.get("cardNumber"));
@@ -984,7 +983,7 @@ public class ValueLinkServices {
currency = EntityUtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD", delegator);
}
Map<String, Object> refundCtx = FastMap.newInstance();
Map<String, Object> refundCtx = new HashMap<String, Object>();
refundCtx.put("userLogin", userLogin);
refundCtx.put("paymentConfig", paymentConfig);
refundCtx.put("cardNumber", giftCard.get("cardNumber"));
@@ -1149,7 +1148,7 @@ public class ValueLinkServices {
}
// make a map of answer info
Map<String, Object> answerMap = FastMap.newInstance();
Map<String, Object> answerMap = new HashMap<String, Object>();
if (responseAnswers != null) {
for (GenericValue answer : responseAnswers) {
GenericValue question = null;
@@ -1181,7 +1180,7 @@ public class ValueLinkServices {
int qtyLoop = quantity.intValue();
for (int i = 0; i < qtyLoop; i++) {
// activate a gift card
Map<String, Object> activateCtx = FastMap.newInstance();
Map<String, Object> activateCtx = new HashMap<String, Object>();
activateCtx.put("paymentConfig", paymentConfig);
activateCtx.put("vlPromoCode", promoCode);
activateCtx.put("currency", currency);
@@ -1215,7 +1214,7 @@ public class ValueLinkServices {
}
// create the fulfillment record
Map<String, Object> vlFulFill = FastMap.newInstance();
Map<String, Object> vlFulFill = new HashMap<String, Object>();
vlFulFill.put("typeEnumId", "GC_ACTIVATE");
vlFulFill.put("merchantId", EntityUtilProperties.getPropertyValue(paymentConfig, "payment.valuelink.merchantId", delegator));
vlFulFill.put("partyId", partyId);
@@ -1271,7 +1270,7 @@ public class ValueLinkServices {
}
}
Map<String, Object> emailCtx = FastMap.newInstance();
Map<String, Object> emailCtx = new HashMap<String, Object>();
String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
if (UtilValidate.isEmpty(bodyScreenLocation)) {
bodyScreenLocation = ProductStoreWorker.getDefaultProductStoreEmailScreenLocation(emailType);
@@ -1394,7 +1393,7 @@ public class ValueLinkServices {
}
// make a map of answer info
Map<String, Object> answerMap = FastMap.newInstance();
Map<String, Object> answerMap = new HashMap<String, Object>();
if (responseAnswers != null) {
for (GenericValue answer : responseAnswers) {
GenericValue question = null;
@@ -1419,7 +1418,7 @@ public class ValueLinkServices {
String pinNumber = (String) answerMap.get(pinNumberKey);
// reload the gift card
Map<String, Object> reloadCtx = FastMap.newInstance();
Map<String, Object> reloadCtx = new HashMap<String, Object>();
reloadCtx.put("paymentConfig", paymentConfig);
reloadCtx.put("currency", currency);
reloadCtx.put("partyId", partyId);
@@ -1439,7 +1438,7 @@ public class ValueLinkServices {
}
// create the fulfillment record
Map<String, Object> vlFulFill = FastMap.newInstance();
Map<String, Object> vlFulFill = new HashMap<String, Object>();
vlFulFill.put("typeEnumId", "GC_RELOAD");
vlFulFill.put("merchantId", EntityUtilProperties.getPropertyValue(paymentConfig, "payment.valuelink.merchantId", delegator));
vlFulFill.put("partyId", partyId);
@@ -1506,7 +1505,7 @@ public class ValueLinkServices {
if (productStoreEmail == null) {
Debug.logError("No gift card purchase email setting found for this store; cannot send gift card information", module);
} else {
Map<String, Object> emailCtx = FastMap.newInstance();
Map<String, Object> emailCtx = new HashMap<String, Object>();
answerMap.put("locale", locale);
String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
@@ -21,13 +21,12 @@ package org.ofbiz.accounting.thirdparty.verisign;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Iterator;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javolution.util.FastMap;
import org.apache.commons.lang.StringUtils;
import org.ofbiz.accounting.payment.PaymentGatewayServices;
import org.ofbiz.base.util.Debug;
@@ -90,7 +89,7 @@ public class PayflowPro {
isPayPal = true;
}
Map<String, String> data = FastMap.newInstance();
Map<String, String> data = new HashMap<String, Object>();
boolean isReAuth = false;
if (isPayPal) {
@@ -433,7 +432,7 @@ public class PayflowPro {
"AccountingPayPalShoppingCartIsEmpty", locale));
}
Map<String, String> data = FastMap.newInstance();
Map<String, String> data = new HashMap<String, Object>();
data.put("TRXTYPE", "O");
data.put("TENDER", "P");
@@ -543,7 +542,7 @@ public class PayflowPro {
String paymentGatewayConfigId = payPalPaymentSetting.getString("paymentGatewayConfigId");
String configString = "payment.properties";
Map<String, String> data = FastMap.newInstance();
Map<String, String> data = new HashMap<String, Object>();
data.put("TRXTYPE", "O");
data.put("TENDER", "P");
data.put("ACTION", "G");
@@ -576,7 +575,7 @@ public class PayflowPro {
"AccountingPayPalCommunicationError", locale));
}
Map<String, Object> inMap = FastMap.newInstance();
Map<String, Object> inMap = new HashMap<String, Object>();
inMap.put("userLogin", cart.getUserLogin());
inMap.put("partyId", cart.getOrderPartyId());
inMap.put("contactMechId", cart.getShippingContactMechId());
@@ -622,7 +621,7 @@ public class PayflowPro {
}
BigDecimal processAmount = paymentPref.getBigDecimal("maxAmount");
Map<String, String> data = FastMap.newInstance();
Map<String, String> data = new HashMap<String, Object>();
data.put("TRXTYPE", "O");
data.put("TENDER", "P");
data.put("PAYERID", payPalPaymentMethod.getString("payerId"));
@@ -650,7 +649,7 @@ public class PayflowPro {
Map<String, String> responseMap = parseResponse(resp);
Map<String, Object> inMap = FastMap.newInstance();
Map<String, Object> inMap = new HashMap<String, Object>();
inMap.put("userLogin", userLogin);
inMap.put("paymentMethodId", payPalPaymentMethod.get("paymentMethodId"));
inMap.put("transactionId", responseMap.get("PNREF"));
@@ -670,7 +669,7 @@ public class PayflowPro {
private static Map<String, String> parseResponse(String resp) {
Debug.logInfo("Verisign response string: " + resp, module);
Map<String, String> parameters = FastMap.newInstance();
Map<String, String> parameters = new HashMap<String, Object>();
List<String> params = StringUtil.split(resp, "&");
for (String str : params) {
if (str.length() > 0) {
@@ -20,6 +20,7 @@ package org.ofbiz.accounting.thirdparty.worldpay;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
@@ -28,8 +29,6 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilFormatOut;
@@ -250,7 +249,7 @@ public class WorldPayEvents {
}
}
// create the redirect string
Map<String, Object> parameters = FastMap.newInstance();
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("instId", instId);
parameters.put("cartId", orderId);
parameters.put("currency", defCur);
@@ -20,10 +20,9 @@
package org.ofbiz.accounting.util;
import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;
import javolution.util.FastList;
import org.ofbiz.accounting.AccountingException;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilNumber;
@@ -96,7 +95,7 @@ public class UtilAccounting {
}
public static List<String> getDescendantGlAccountClassIds(GenericValue glAccountClass) throws GenericEntityException {
List<String> glAccountClassIds = FastList.newInstance();
List<String> glAccountClassIds = new LinkedList<String>();
getGlAccountClassChildren(glAccountClass, glAccountClassIds);
return glAccountClassIds;
}
@@ -18,7 +18,6 @@
*/
import org.ofbiz.base.util.UtilMisc;
import javolution.util.FastList;
taxAuthorities = from('TaxAuthority').orderBy("taxAuthGeoId", "taxAuthPartyId").queryList();
@@ -28,9 +28,6 @@ import java.text.SimpleDateFormat;
import java.math.BigDecimal;
import java.math.MathContext;
import org.ofbiz.base.util.UtilNumber;
import javolution.util.FastList;
import javolution.util.FastMap;
invoiceId = parameters.get("invoiceId");
@@ -68,8 +65,8 @@ if (invoice) {
}
invoiceItems = invoice.getRelated("InvoiceItem", null, ["invoiceItemSeqId"], false);
invoiceItemsConv = FastList.newInstance();
vatTaxesByType = FastMap.newInstance();
invoiceItemsConv = [];
vatTaxesByType = [:];
invoiceItems.each { invoiceItem ->
invoiceItem.amount = invoiceItem.getBigDecimal("amount").multiply(conversionRate).setScale(decimals, rounding);
invoiceItemsConv.add(invoiceItem);
@@ -25,8 +25,6 @@ import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.entity.condition.EntityExpr;
import org.ofbiz.entity.condition.EntityOperator;
import javolution.util.FastList;
exprBldr = new EntityConditionBuilder();
invoice = context.invoice;
if (!invoice) return;
@@ -26,8 +26,6 @@ import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.entity.util.EntityFindOptions;
import javolution.util.FastList;
exprBldr = new org.ofbiz.entity.condition.EntityConditionBuilder();
if (invoiceTypeId) {
@@ -19,7 +19,6 @@
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.entity.util.EntityUtil;
import javolution.util.FastMap;
if (billingAccountId) {
orderPaymentPreferencesList = [];
@@ -28,7 +27,7 @@ if (billingAccountId) {
orderList.each { orderHeader ->
orderId = orderHeader.orderId;
orderBillingAcc = from("OrderHeaderAndPaymentPref").where("orderId", orderId).queryFirst();
orderBillingAccMap = FastMap.newInstance();
orderBillingAccMap = [:];
if (orderBillingAcc.paymentMethodTypeId.equals("EXT_BILLACT") && orderBillingAcc.paymentStatusId.equals("PAYMENT_NOT_RECEIVED")) {
orderBillingAccMap.putAll(orderBillingAcc);
orderId = orderBillingAcc.orderId;
@@ -29,8 +29,6 @@ import org.ofbiz.party.party.PartyWorker;
import java.sql.Date;
import java.sql.Timestamp;
import javolution.util.FastList;
uiLabelMap = UtilProperties.getResourceBundleMap("AccountingUiLabels", locale);
if (!thruDate) {
@@ -80,7 +78,7 @@ Map liabilityOpeningBalances = [:];
Map currentLiabilityOpeningBalances = [:];
Map equityOpeningBalances = [:];
if (lastClosedTimePeriod) {
List timePeriodAndExprs = FastList.newInstance();
List timePeriodAndExprs = [];
timePeriodAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, assetAccountClassIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("endingBalance", EntityOperator.NOT_EQUAL, BigDecimal.ZERO));
@@ -90,7 +88,7 @@ if (lastClosedTimePeriod) {
Map accountMap = UtilMisc.toMap("glAccountId", lastTimePeriodHistory.glAccountId, "accountCode", lastTimePeriodHistory.accountCode, "accountName", lastTimePeriodHistory.accountName, "balance", lastTimePeriodHistory.getBigDecimal("endingBalance"), "D", lastTimePeriodHistory.getBigDecimal("postedDebits"), "C", lastTimePeriodHistory.getBigDecimal("postedCredits"));
assetOpeningBalances.put(lastTimePeriodHistory.glAccountId, accountMap);
}
timePeriodAndExprs = FastList.newInstance();
timePeriodAndExprs = [];
timePeriodAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, contraAssetAccountClassIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("endingBalance", EntityOperator.NOT_EQUAL, BigDecimal.ZERO));
@@ -100,7 +98,7 @@ if (lastClosedTimePeriod) {
Map accountMap = UtilMisc.toMap("glAccountId", lastTimePeriodHistory.glAccountId, "accountCode", lastTimePeriodHistory.accountCode, "accountName", lastTimePeriodHistory.accountName, "balance", lastTimePeriodHistory.getBigDecimal("endingBalance"), "D", lastTimePeriodHistory.getBigDecimal("postedDebits"), "C", lastTimePeriodHistory.getBigDecimal("postedCredits"));
contraAssetOpeningBalances.put(lastTimePeriodHistory.glAccountId, accountMap);
}
timePeriodAndExprs = FastList.newInstance();
timePeriodAndExprs = [];
timePeriodAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, liabilityAccountClassIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("endingBalance", EntityOperator.NOT_EQUAL, BigDecimal.ZERO));
@@ -110,7 +108,7 @@ if (lastClosedTimePeriod) {
Map accountMap = UtilMisc.toMap("glAccountId", lastTimePeriodHistory.glAccountId, "accountCode", lastTimePeriodHistory.accountCode, "accountName", lastTimePeriodHistory.accountName, "balance", lastTimePeriodHistory.getBigDecimal("endingBalance"), "D", lastTimePeriodHistory.getBigDecimal("postedDebits"), "C", lastTimePeriodHistory.getBigDecimal("postedCredits"));
liabilityOpeningBalances.put(lastTimePeriodHistory.glAccountId, accountMap);
}
timePeriodAndExprs = FastList.newInstance();
timePeriodAndExprs = [];
timePeriodAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, equityAccountClassIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("endingBalance", EntityOperator.NOT_EQUAL, BigDecimal.ZERO));
@@ -120,7 +118,7 @@ if (lastClosedTimePeriod) {
Map accountMap = UtilMisc.toMap("glAccountId", lastTimePeriodHistory.glAccountId, "accountCode", lastTimePeriodHistory.accountCode, "accountName", lastTimePeriodHistory.accountName, "balance", lastTimePeriodHistory.getBigDecimal("endingBalance"), "D", lastTimePeriodHistory.getBigDecimal("postedDebits"), "C", lastTimePeriodHistory.getBigDecimal("postedCredits"));
equityOpeningBalances.put(lastTimePeriodHistory.glAccountId, accountMap);
}
timePeriodAndExprs = FastList.newInstance();
timePeriodAndExprs = [];
timePeriodAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, currentAssetAccountClassIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("endingBalance", EntityOperator.NOT_EQUAL, BigDecimal.ZERO));
@@ -130,7 +128,7 @@ if (lastClosedTimePeriod) {
Map accountMap = UtilMisc.toMap("glAccountId", lastTimePeriodHistory.glAccountId, "accountCode", lastTimePeriodHistory.accountCode, "accountName", lastTimePeriodHistory.accountName, "balance", lastTimePeriodHistory.getBigDecimal("endingBalance"), "D", lastTimePeriodHistory.getBigDecimal("postedDebits"), "C", lastTimePeriodHistory.getBigDecimal("postedCredits"));
currentAssetOpeningBalances.put(lastTimePeriodHistory.glAccountId, accountMap);
}
timePeriodAndExprs = FastList.newInstance();
timePeriodAndExprs = [];
timePeriodAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, longtermAssetAccountClassIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("endingBalance", EntityOperator.NOT_EQUAL, BigDecimal.ZERO));
@@ -140,7 +138,7 @@ if (lastClosedTimePeriod) {
Map accountMap = UtilMisc.toMap("glAccountId", lastTimePeriodHistory.glAccountId, "accountCode", lastTimePeriodHistory.accountCode, "accountName", lastTimePeriodHistory.accountName, "balance", lastTimePeriodHistory.getBigDecimal("endingBalance"), "D", lastTimePeriodHistory.getBigDecimal("postedDebits"), "C", lastTimePeriodHistory.getBigDecimal("postedCredits"));
longtermAssetOpeningBalances.put(lastTimePeriodHistory.glAccountId, accountMap);
}
timePeriodAndExprs = FastList.newInstance();
timePeriodAndExprs = [];
timePeriodAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, currentLiabilityAccountClassIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("endingBalance", EntityOperator.NOT_EQUAL, BigDecimal.ZERO));
@@ -154,7 +152,7 @@ if (lastClosedTimePeriod) {
List balanceTotalList = [];
List mainAndExprs = FastList.newInstance();
List mainAndExprs = [];
mainAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
mainAndExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"));
mainAndExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
@@ -167,7 +165,7 @@ mainAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List assetAndExprs = FastList.newInstance(mainAndExprs);
List assetAndExprs = mainAndExprs as LinkedList;
assetAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, assetAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(assetAndExprs).orderBy("glAccountId").queryList();
transactionTotalsMap = [:];
@@ -203,7 +201,7 @@ context.assetBalanceTotal = balanceTotal;
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List currentAssetAndExprs = FastList.newInstance(mainAndExprs);
List currentAssetAndExprs = mainAndExprs as LinkedList;
currentAssetAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, currentAssetAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(currentAssetAndExprs).orderBy("glAccountId").queryList();
transactionTotalsMap = [:];
@@ -238,7 +236,7 @@ balanceTotalList.add(UtilMisc.toMap("totalName", "AccountingCurrentAssets", "bal
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List longtermAssetAndExprs = FastList.newInstance(mainAndExprs);
List longtermAssetAndExprs = mainAndExprs as LinkedList;
longtermAssetAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, longtermAssetAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").orderBy("glAccountId").queryList();
transactionTotalsMap = [:];
@@ -273,7 +271,7 @@ balanceTotalList.add(UtilMisc.toMap("totalName", "AccountingLongTermAssets", "ba
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List contraAssetAndExprs = FastList.newInstance(mainAndExprs);
List contraAssetAndExprs = mainAndExprs as LinkedList;
contraAssetAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, contraAssetAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(contraAssetAndExprs).orderBy("glAccountId").queryList();
@@ -314,7 +312,7 @@ balanceTotalList.add(UtilMisc.toMap("totalName", "AccountingTotalAssets", "balan
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List liabilityAndExprs = FastList.newInstance(mainAndExprs);
List liabilityAndExprs = mainAndExprs as LinkedList;
liabilityAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, liabilityAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(liabilityAndExprs).orderBy("glAccountId").queryList();
transactionTotalsMap = [:];
@@ -350,7 +348,7 @@ context.liabilityBalanceTotal = balanceTotal;
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List currentLiabilityAndExprs = FastList.newInstance(mainAndExprs);
List currentLiabilityAndExprs = mainAndExprs as LinkedList;
currentLiabilityAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, currentLiabilityAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(currentLiabilityAndExprs).orderBy("glAccountId").queryList();
transactionTotalsMap = [:];
@@ -385,7 +383,7 @@ balanceTotalList.add(UtilMisc.toMap("totalName", "AccountingCurrentLiabilities",
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List equityAndExprs = FastList.newInstance(mainAndExprs);
List equityAndExprs = mainAndExprs as LinkedList;
equityAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, equityAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(equityAndExprs).orderBy("glAccountId").queryList();
transactionTotalsMap = [:];
@@ -29,9 +29,6 @@ import org.ofbiz.party.party.PartyWorker;
import java.sql.Date;
import java.sql.Timestamp;
import javolution.util.FastList;
import javolution.util.FastMap;
if (!fromDate) {
return;
}
@@ -65,7 +62,7 @@ GenericValue lastClosedTimePeriod = (GenericValue)lastClosedTimePeriodResult.las
// Get the opening balances of Cash Account
Map openingCashBalances = [:];
if (lastClosedTimePeriod) {
List timePeriodAndExprs = FastList.newInstance();
List timePeriodAndExprs = [];
timePeriodAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, glAccountClassIds));
timePeriodAndExprs.add(EntityCondition.makeCondition("endingBalance", EntityOperator.NOT_EQUAL, BigDecimal.ZERO));
@@ -76,7 +73,7 @@ if (lastClosedTimePeriod) {
openingCashBalances.(lastTimePeriodHistory.glAccountId) = accountMap;
}
}
List mainAndExprs = FastList.newInstance();
List mainAndExprs = [];
mainAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
mainAndExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"));
mainAndExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, parameters.glFiscalTypeId));
@@ -87,7 +84,7 @@ mainAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperato
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List openingCashBalanceAndExprs = FastList.newInstance(mainAndExprs);
List openingCashBalanceAndExprs = mainAndExprs as LinkedList;
openingCashBalanceAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, periodClosingFromDate));
openingCashBalanceAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN, parametersFromDate));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(openingCashBalanceAndExprs).orderBy("glAccountId").queryList();
@@ -132,7 +129,7 @@ openingTransactionKeySet = transactionTotalsMap.keySet();
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List periodCashBalanceAndExprs = FastList.newInstance(mainAndExprs);
List periodCashBalanceAndExprs = mainAndExprs as LinkedList;
periodCashBalanceAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, parametersFromDate));
periodCashBalanceAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN, thruDate));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(periodCashBalanceAndExprs).orderBy("glAccountId").queryList();
@@ -174,9 +171,9 @@ cashFlowBalanceTotalList.add("totalName":"AccountingPeriodCashBalance", "balance
// GlAccounts from parameter's fromDate to parameter's thruDate.
accountBalanceList = [];
balanceTotal = BigDecimal.ZERO;
List transactionTotals = FastList.newInstance();
transactionTotals.addAll(FastList.newInstance(context.openingCashBalanceList));
transactionTotals.addAll(FastList.newInstance(context.periodCashBalanceList));
List transactionTotals = [];
transactionTotals.addAll(new LinkedList(context.openingCashBalanceList));
transactionTotals.addAll(new LinkedList(context.periodCashBalanceList));
transactionTotals = UtilMisc.sortMaps(transactionTotals, UtilMisc.toList("accountCode"));
closingTransactionKeySet = [];
if (transactionTotals) {
@@ -196,7 +193,7 @@ if (transactionTotals) {
transactionTotalsMap.(transactionTotal.glAccountId).balance = totalDebitBalance.subtract(totalCreditBalance);
}
} else {
transactionTotalsMap.(transactionTotal.glAccountId) = FastMap.newInstance(transactionTotal);
transactionTotalsMap.(transactionTotal.glAccountId) = transactionTotal as LinkedList;
}
accountBalanceList = UtilMisc.sortMaps(transactionTotalsMap.values().asList(), UtilMisc.toList("accountCode"));
}
@@ -24,9 +24,6 @@ import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.util.EntityUtil;
import javolution.util.FastList;
import javolution.util.FastMap;
if (!fromDate) {
return;
}
@@ -41,7 +38,7 @@ if (!parameters.glFiscalTypeId) {
// Posted transactions totals and grand totals
postedTotalDebit = BigDecimal.ZERO;
postedTotalCredit = BigDecimal.ZERO;
andExprs = FastList.newInstance();
andExprs = [];
andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"));
andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, parameters.glFiscalTypeId));
@@ -25,8 +25,6 @@ import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.accounting.util.UtilAccounting;
import org.ofbiz.party.party.PartyWorker;
import javolution.util.FastList;
if (!fromDate) {
return;
}
@@ -57,7 +55,7 @@ List sgaExpenseAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(s
GenericValue depreciationGlAccountClass = from("GlAccountClass").where("glAccountClassId", "DEPRECIATION").cache(true).queryOne();
List depreciationAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(depreciationGlAccountClass);
List mainAndExprs = FastList.newInstance();
List mainAndExprs = [];
mainAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
mainAndExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"));
mainAndExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
@@ -72,7 +70,7 @@ List balanceTotalList = [];
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List revenueAndExprs = FastList.newInstance(mainAndExprs);
List revenueAndExprs = mainAndExprs as LinkedList;
revenueAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, revenueAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(revenueAndExprs).orderBy("glAccountId").queryList();
if (transactionTotals) {
@@ -115,7 +113,7 @@ context.revenueBalanceTotal = balanceTotal;
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List contraRevenueAndExprs = FastList.newInstance(mainAndExprs);
List contraRevenueAndExprs = mainAndExprs as LinkedList;
contraRevenueAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, contraRevenueAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(contraRevenueAndExprs).orderBy("glAccountId").queryList();
if (transactionTotals) {
@@ -157,7 +155,7 @@ balanceTotalList.add(UtilMisc.toMap("totalName", "TOTAL CONTRA REVENUE", "balanc
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List expenseAndExprs = FastList.newInstance(mainAndExprs);
List expenseAndExprs = mainAndExprs as LinkedList;
expenseAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, expenseAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(expenseAndExprs).queryList();
if (transactionTotals) {
@@ -200,7 +198,7 @@ context.expenseBalanceTotal = balanceTotal;
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List cogsExpenseAndExprs = FastList.newInstance(mainAndExprs);
List cogsExpenseAndExprs = mainAndExprs as LinkedList;
cogsExpenseAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, cogsExpenseAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(cogsExpenseAndExprs).orderBy("glAccountId").queryList();
if (transactionTotals) {
@@ -242,7 +240,7 @@ balanceTotalList.add(UtilMisc.toMap("totalName", "AccountingCostOfGoodsSold", "b
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List sgaExpenseAndExprs = FastList.newInstance(mainAndExprs);
List sgaExpenseAndExprs = mainAndExprs as LinkedList;
sgaExpenseAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, sgaExpenseAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(sgaExpenseAndExprs).orderBy("glAccountId").queryList();
if (transactionTotals) {
@@ -283,7 +281,7 @@ sgaExpense = balanceTotal;
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List depreciationAndExprs = FastList.newInstance(mainAndExprs);
List depreciationAndExprs = mainAndExprs as LinkedList;
depreciationAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, depreciationAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(depreciationAndExprs).orderBy("glAccountId").queryList();
if (transactionTotals) {
@@ -324,7 +322,7 @@ depreciation = balanceTotal;
accountBalanceList = [];
transactionTotals = [];
balanceTotal = BigDecimal.ZERO;
List incomeAndExprs = FastList.newInstance(mainAndExprs);
List incomeAndExprs = mainAndExprs as LinkedList;
incomeAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, incomeAccountClassIds));
transactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(incomeAndExprs).orderBy("glAccountId").queryList();
if (transactionTotals) {
@@ -17,9 +17,6 @@
* under the License.
*/
import javolution.util.FastList;
import javolution.util.FastSet;
import javolution.util.FastMap;
import org.ofbiz.base.util.*;
import org.ofbiz.entity.*;
import org.ofbiz.entity.condition.*;
@@ -35,12 +32,12 @@ productMemberList = from("ProductCategoryMember").where("productCategoryId", roo
categoryRollupList = from("ProductCategoryRollup").where("parentProductCategoryId", rootProductCategoryId).orderBy("sequenceNum").queryList();
// for use in the queries
productIdSet = FastSet.newInstance();
productCategoryIdSet = FastSet.newInstance();
productIdSet = [];
productCategoryIdSet = [];
// for use in the templates
productList = FastList.newInstance();
productCategoryList = FastList.newInstance();
productList = [];
productCategoryList = [];
productMemberList.each { productMember ->
if (!productIdSet.contains(productMember.productId)) {
@@ -56,14 +53,14 @@ categoryRollupList.each { categoryRollup ->
}
//NOTE: tax, etc also have productId on them, so restrict by type INV_PROD_ITEM, INV_FPROD_ITEM, INV_DPROD_ITEM, others?
baseProductAndExprs = FastList.newInstance();
baseProductAndExprs = [];
baseProductAndExprs.add(EntityCondition.makeCondition("invoiceTypeId", EntityOperator.EQUALS, "SALES_INVOICE"));
baseProductAndExprs.add(EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.IN, ["INV_PROD_ITEM", "INV_FPROD_ITEM", "INV_DPROD_ITEM"]));
baseProductAndExprs.add(EntityCondition.makeCondition("statusId", EntityOperator.IN, ["INVOICE_READY", "INVOICE_PAID"]));
if (organizationPartyId) baseProductAndExprs.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, organizationPartyId));
if (currencyUomId) baseProductAndExprs.add(EntityCondition.makeCondition("currencyUomId", EntityOperator.EQUALS, currencyUomId));
baseCategoryAndExprs = FastList.newInstance();
baseCategoryAndExprs = [];
baseCategoryAndExprs.add(EntityCondition.makeCondition("invoiceTypeId", EntityOperator.EQUALS, "SALES_INVOICE"));
baseCategoryAndExprs.add(EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.IN, ["INV_PROD_ITEM", "INV_FPROD_ITEM", "INV_DPROD_ITEM"]));
baseCategoryAndExprs.add(EntityCondition.makeCondition("statusId", EntityOperator.IN, ["INVOICE_READY", "INVOICE_PAID"]));
@@ -83,13 +80,13 @@ nextMonthCal.setTimeInMillis(monthCal.getTimeInMillis());
nextMonthCal.add(Calendar.MONTH, 1);
// iterate through the days and do the queries
productResultMapByDayList = FastList.newInstance();
productNullResultByDayList = FastList.newInstance();
categoryResultMapByDayList = FastList.newInstance();
productResultMapByDayList = [];
productNullResultByDayList = [];
categoryResultMapByDayList = [];
monthProductResultMap = FastMap.newInstance();
monthCategoryResultMap = FastMap.newInstance();
monthProductNullResult = FastMap.newInstance();
monthProductResultMap = [:];
monthCategoryResultMap = [:];
monthProductNullResult = [:];
daysInMonth = monthCal.getActualMaximum(Calendar.DAY_OF_MONTH);
for (int currentDay = 0; currentDay <= daysInMonth; currentDay++) {
@@ -101,14 +98,14 @@ for (int currentDay = 0; currentDay <= daysInMonth; currentDay++) {
nextDayBegin = new java.sql.Timestamp(currentDayCal.getTimeInMillis());
// do the product find
productAndExprs = FastList.newInstance();
productAndExprs = [];
productAndExprs.addAll(baseProductAndExprs);
if (productIdSet) productAndExprs.add(EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet));
productAndExprs.add(EntityCondition.makeCondition("invoiceDate", EntityOperator.GREATER_THAN_EQUAL_TO, currentDayBegin));
productAndExprs.add(EntityCondition.makeCondition("invoiceDate", EntityOperator.LESS_THAN, nextDayBegin));
productResultListIterator = select("productId", "quantityTotal", "amountTotal").from("InvoiceItemProductSummary").where(productAndExprs).cursorScrollInsensitive().cache(true).queryIterator();
productResultMap = FastMap.newInstance();
productResultMap = [:];
while ((productResult = productResultListIterator.next())) {
productResultMap[productResult.productId] = productResult;
monthProductResult = UtilMisc.getMapFromMap(monthProductResultMap, productResult.productId);
@@ -119,13 +116,13 @@ for (int currentDay = 0; currentDay <= daysInMonth; currentDay++) {
productResultMapByDayList.add(productResultMap);
// do the category find
categoryAndExprs = FastList.newInstance();
categoryAndExprs = [];
categoryAndExprs.addAll(baseCategoryAndExprs);
categoryAndExprs.add(EntityCondition.makeCondition("invoiceDate", EntityOperator.GREATER_THAN_EQUAL_TO, currentDayBegin));
categoryAndExprs.add(EntityCondition.makeCondition("invoiceDate", EntityOperator.LESS_THAN, nextDayBegin));
categoryResultListIterator = select("productCategoryId", "quantityTotal", "amountTotal").from(InvoiceItemCategorySummary).where(categoryAndExprs).cursorScrollInsensitive().cache(true).queryIterator();
categoryResultMap = FastMap.newInstance();
categoryResultMap = [:];
while ((categoryResult = categoryResultListIterator.next())) {
categoryResultMap[categoryResult.productCategoryId] = categoryResult;
monthCategoryResult = UtilMisc.getMapFromMap(monthCategoryResultMap, categoryResult.productCategoryId);
@@ -136,7 +133,7 @@ for (int currentDay = 0; currentDay <= daysInMonth; currentDay++) {
categoryResultMapByDayList.add(categoryResultMap);
// do a find for InvoiceItem with a null productId
productNullAndExprs = FastList.newInstance();
productNullAndExprs = [];
productNullAndExprs.addAll(baseProductAndExprs);
productNullAndExprs.add(EntityCondition.makeCondition("productId", EntityOperator.EQUALS, null));
productNullAndExprs.add(EntityCondition.makeCondition("invoiceDate", EntityOperator.GREATER_THAN_EQUAL_TO, currentDayBegin));
@@ -151,7 +148,7 @@ for (int currentDay = 0; currentDay <= daysInMonth; currentDay++) {
UtilMisc.addToBigDecimalInMap(monthProductNullResult, "amountTotal", productNullResult.getBigDecimal("amountTotal"));
} else {
// no result, add an empty Map place holder
productNullResultByDayList.add(FastMap.newInstance());
productNullResultByDayList.add([:]);
}
}
@@ -28,8 +28,6 @@ import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.accounting.util.UtilAccounting;
import javolution.util.FastList;
import java.sql.Date;
if (!fromDate) {
@@ -55,7 +53,7 @@ if (lastClosedDate) {
postedTotals = [];
postedTotalDebit = BigDecimal.ZERO;
postedTotalCredit = BigDecimal.ZERO;
andExprs = FastList.newInstance();
andExprs = [];
andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"));
andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
@@ -89,7 +87,7 @@ if (postedTransactionTotals) {
accountMap.put("balance", BigDecimal.ZERO);
}
//
List mainAndExprs = FastList.newInstance();
List mainAndExprs = [];
mainAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
mainAndExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"));
mainAndExprs.add(EntityCondition.makeCondition("glAccountId", EntityOperator.EQUALS, postedTransactionTotal.glAccountId));
@@ -108,7 +106,7 @@ if (postedTransactionTotals) {
postedTotals = postedTransactionTotalsMap.values().asList();
}
// Posted grand total for Debits
andExprs = FastList.newInstance();
andExprs = [];
andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"));
andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
@@ -123,7 +121,7 @@ if (postedDebitTransactionTotals) {
}
}
// Posted grand total for Credits
andExprs = FastList.newInstance();
andExprs = [];
andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"));
andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
@@ -145,7 +143,7 @@ context.postedTransactionTotals = postedTotals;
unpostedTotals = [];
unpostedTotalDebit = BigDecimal.ZERO;
unpostedTotalCredit = BigDecimal.ZERO;
andExprs = FastList.newInstance();
andExprs = [];
andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "N"));
andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
@@ -180,7 +178,7 @@ if (unpostedTransactionTotals) {
accountMap.put("balance", BigDecimal.ZERO);
}
//
List mainAndExprs = FastList.newInstance();
List mainAndExprs = [];
mainAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
mainAndExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "N"));
mainAndExprs.add(EntityCondition.makeCondition("glAccountId", EntityOperator.EQUALS, unpostedTransactionTotal.glAccountId));
@@ -199,7 +197,7 @@ if (unpostedTransactionTotals) {
unpostedTotals = unpostedTransactionTotalsMap.values().asList();
}
// Unposted grand total for Debits
andExprs = FastList.newInstance();
andExprs = [];
andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "N"));
andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
@@ -214,7 +212,7 @@ if (unpostedDebitTransactionTotals) {
}
}
// Unposted grand total for Credits
andExprs = FastList.newInstance();
andExprs = [];
andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "N"));
andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
@@ -237,7 +235,7 @@ context.unpostedTransactionTotals = unpostedTotals;
allTotals = [];
allTotalDebit = BigDecimal.ZERO;
allTotalCredit = BigDecimal.ZERO;
andExprs = FastList.newInstance();
andExprs = [];
andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
@@ -255,7 +253,7 @@ if (allTransactionTotals) {
// Get the opening balances at the end of the last closed time period
if (UtilAccounting.isAssetAccount(glAccount) || UtilAccounting.isLiabilityAccount(glAccount) || UtilAccounting.isEquityAccount(glAccount)) {
if (lastClosedTimePeriod) {
List timePeriodAndExprs = FastList.newInstance();
List timePeriodAndExprs = [];
timePeriodAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.EQUALS, organizationPartyId));
timePeriodAndExprs.add(EntityCondition.makeCondition("glAccountId", EntityOperator.EQUALS, allTransactionTotal.glAccountId));
timePeriodAndExprs.add(EntityCondition.makeCondition("customTimePeriodId", EntityOperator.EQUALS, lastClosedTimePeriod.customTimePeriodId));
@@ -275,7 +273,7 @@ if (allTransactionTotals) {
accountMap.put("balance", BigDecimal.ZERO);
}
//
List mainAndExprs = FastList.newInstance();
List mainAndExprs = [];
mainAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
mainAndExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "N"));
mainAndExprs.add(EntityCondition.makeCondition("glAccountId", EntityOperator.EQUALS, allTransactionTotal.glAccountId));
@@ -294,7 +292,7 @@ if (allTransactionTotals) {
allTotals = allTransactionTotalsMap.values().asList();
}
// Posted and unposted grand total for Debits
andExprs = FastList.newInstance();
andExprs = [];
andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
andExprs.add(EntityCondition.makeCondition("debitCreditFlag", EntityOperator.EQUALS, "D"));
@@ -308,7 +306,7 @@ if (allDebitTransactionTotals) {
}
}
// Posted and unposted grand total for Credits
andExprs = FastList.newInstance();
andExprs = [];
andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds));
andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId));
andExprs.add(EntityCondition.makeCondition("debitCreditFlag", EntityOperator.EQUALS, "C"));
@@ -18,13 +18,12 @@
*/
import org.ofbiz.base.util.*
import org.ofbiz.entity.util.EntityUtil;
import javolution.util.FastList;
import org.ofbiz.product.catalog.*;
prodCatalog = null;
prodCatalogId = parameters.prodCatalogId;
showScreen = "origin";
List errMsgList = FastList.newInstance();
List errMsgList = [];
productStore = EntityUtil.getFirst(delegator.findByAnd("ProductStore", [payToPartyId: partyId], null, false));
if(productStore){
@@ -33,7 +32,7 @@
if(UtilValidate.isEmpty(productStore)){
errMsgList.add("Product Store not set!");
showScreen = "message";
}else{
} else {
facility = delegator.findOne("Facility", [facilityId : productStore.inventoryFacilityId], false);
webSite = EntityUtil.getFirst(delegator.findByAnd("WebSite", [productStoreId: productStore.productStoreId], null, false));
@@ -18,8 +18,6 @@
*/
import org.ofbiz.base.util.*
import org.ofbiz.entity.util.EntityUtil;
import javolution.util.FastList;
import javolution.util.FastMap;
productStoreId = null;
@@ -1390,7 +1390,7 @@
</entity-and>
<!-- Get all categories -->
<call-class-method method-name="newInstance" class-name="javolution.util.FastList" ret-field="parameters.productCategories"/>
<set field="parameters.productCategories" value="${groovy: [];}" type="List"/>
<iterate entry="prodCatalogCategory" list="prodCatalogCategoryList">
<set field="rootProductCategoryId" from-field="prodCatalogCategory.productCategoryId"/>
<entity-and list="productCategoryRollupList" entity-name="ProductCategoryRollup" filter-by-date="true">
+3 -4
View File
@@ -28,11 +28,10 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import javolution.util.FastMap;
import org.ofbiz.base.util.UtilValidate;
/**
@@ -132,7 +131,7 @@ public class ControlApplet extends Applet implements Runnable {
}
protected void pull() {
Map<String, Object> params = FastMap.newInstance();
Map<String, Object> params = new HashMap<String, Object>();
params.put("sessionId", this.sessionId.trim());
params.put("visitId", this.visitId.trim());
@@ -162,7 +161,7 @@ public class ControlApplet extends Applet implements Runnable {
}
protected void push() {
Map<String, Object> params = FastMap.newInstance();
Map<String, Object> params = new HashMap<String, Object>();
params.put("sessionId", this.sessionId.trim());
params.put("visitId", this.visitId.trim());
params.put("currentPage", this.currentPage.trim());
@@ -19,6 +19,7 @@
package org.ofbiz.content;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -27,8 +28,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.StringUtil;
@@ -86,7 +85,7 @@ public class ContentManagementEvents {
/*
Set keySet = paramMap.keySet();
Iterator itKeySet = keySet.iterator();
Map contentIdLookup = FastMap.newInstance();
Map contentIdLookup = new HashMap<String, Object>();
while (itKeySet.hasNext()) {
String idxAndContentId = (String)itKeySet.next();
int pos = idxAndContentId.indexOf("_");
@@ -110,7 +109,7 @@ public class ContentManagementEvents {
String paramName = Integer.toString(counter) + "_" + pubContentId;
String paramValue = (String)paramMap.get(paramName);
//if (Debug.infoOn()) Debug.logInfo("in updateStaticValues, contentId:" + contentId + " pubContentId:" + pubContentId + " pubValue:" + pubValue + " paramName:" + paramName + " paramValue:" + paramValue, module);
Map<String, Object> serviceIn = FastMap.newInstance();
Map<String, Object> serviceIn = new HashMap<String, Object>();
serviceIn.put("userLogin", userLogin);
serviceIn.put("contentIdTo", contentId);
serviceIn.put("contentId", pubContentId);
@@ -208,7 +207,7 @@ public class ContentManagementEvents {
// make a map of the values that are passed in using the top subSite as the key.
// Content can only be linked to one subsite under a top site (ends with "_MASTER")
Map<String, String> siteIdLookup = FastMap.newInstance();
Map<String, String> siteIdLookup = new HashMap<String, String>();
for (String param : paramMap.keySet()) {
int pos = param.indexOf("select_");
//if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, param:" + param + " pos:" + pos , module);
@@ -268,7 +267,7 @@ public class ContentManagementEvents {
}
}
// create new link
Map<String, Object> serviceIn = FastMap.newInstance();
Map<String, Object> serviceIn = new HashMap<String, Object>();
serviceIn.put("userLogin", userLogin);
serviceIn.put("contentId", targContentId);
serviceIn.put("contentAssocTypeId", "PUBLISH_LINK");
@@ -287,7 +286,7 @@ public class ContentManagementEvents {
return "error";
}
serviceIn = FastMap.newInstance();
serviceIn = new HashMap<String, Object>();
serviceIn.put("userLogin", userLogin);
serviceIn.put("contentId", targContentId);
serviceIn.put("contentAssocTypeId", "PUBLISH_LINK");
@@ -21,15 +21,14 @@ package org.ofbiz.content;
import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javolution.util.FastList;
import javolution.util.FastMap;
import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilDateTime;
@@ -85,7 +84,7 @@ public class ContentManagementServices {
if (UtilValidate.isNotEmpty(assocTypesString)) {
List<String> lst = StringUtil.split(assocTypesString, "|");
if (assocTypes == null) {
assocTypes = FastList.newInstance();
assocTypes = new LinkedList<String>();
}
assocTypes.addAll(lst);
}
@@ -162,7 +161,7 @@ public class ContentManagementServices {
// ContentPurposes can get passed in as a delimited string or a list. Combine.
List<String> contentPurposeList = UtilGenerics.checkList(context.get("contentPurposeList"));
if (contentPurposeList == null) {
contentPurposeList = FastList.newInstance();
contentPurposeList = new LinkedList<String>();
}
String contentPurposeString = (String) context.get("contentPurposeString");
if (UtilValidate.isNotEmpty(contentPurposeString)) {
@@ -255,7 +254,7 @@ public class ContentManagementServices {
Debug.logInfo("in persist... dataResourceTypeId(0):" + dataResourceTypeId, null);
}
if (UtilValidate.isNotEmpty(dataResourceTypeId)) {
Map<String, Object> dataResourceResult = FastMap.newInstance();
Map<String, Object> dataResourceResult = new HashMap<String, Object>();
try {
dataResourceResult = persistDataResourceAndDataMethod(dctx, context);
} catch (GenericServiceException e) {
@@ -297,12 +296,12 @@ public class ContentManagementServices {
return ServiceUtil.returnError(e.toString());
}
}
//List targetOperations = FastList.newInstance();
//List targetOperations = new LinkedList<String>();
//context.put("targetOperations", targetOperations);
context.putAll(content);
if (contentExists) {
//targetOperations.add("CONTENT_UPDATE");
Map<String, Object> contentContext = FastMap.newInstance();
Map<String, Object> contentContext = new HashMap<String, Object>();
ModelService contentModel = dispatcher.getDispatchContext().getModelService("updateContent");
contentContext.putAll(contentModel.makeValid(content, "IN"));
contentContext.put("userLogin", userLogin);
@@ -316,7 +315,7 @@ public class ContentManagementServices {
//Map thisResult = ContentServices.updateContentMethod(dctx, context);
} else {
//targetOperations.add("CONTENT_CREATE");
Map<String, Object> contentContext = FastMap.newInstance();
Map<String, Object> contentContext = new HashMap<String, Object>();
ModelService contentModel = dispatcher.getDispatchContext().getModelService("createContent");
contentContext.putAll(contentModel.makeValid(content, "IN"));
contentContext.put("userLogin", userLogin);
@@ -353,7 +352,7 @@ public class ContentManagementServices {
} else if (UtilValidate.isNotEmpty(dataResourceTypeId) && UtilValidate.isNotEmpty(contentId)) {
// If dataResource was not previously existing, then update the associated content with its id
if (UtilValidate.isNotEmpty(dataResourceId) && !dataResourceExists) {
Map<String, Object> map = FastMap.newInstance();
Map<String, Object> map = new HashMap<String, Object>();
map.put("userLogin", userLogin);
map.put("dataResourceId", dataResourceId);
map.put("contentId", contentId);
@@ -374,7 +373,7 @@ public class ContentManagementServices {
if (UtilValidate.isNotEmpty(contentAssocTypeId) && contentAssoc.get("contentId") != null && contentAssoc.get("contentIdTo") != null) {
if (Debug.infoOn())
Debug.logInfo("in persistContentAndAssoc, deactivateExisting:" + deactivateExisting, null);
Map<String, Object> contentAssocContext = FastMap.newInstance();
Map<String, Object> contentAssocContext = new HashMap<String, Object>();
contentAssocContext.put("userLogin", userLogin);
contentAssocContext.put("displayFailCond", bDisplayFailCond);
contentAssocContext.put("skipPermissionCheck", context.get("skipPermissionCheck"));
@@ -447,7 +446,7 @@ public class ContentManagementServices {
Delegator delegator = dctx.getDelegator();
GenericValue userLogin = (GenericValue)context.get("userLogin");
//String userLoginPartyId = userLogin.getString("partyId");
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
// siteContentId will equal "ADMIN_MASTER", "AGINC_MASTER", etc.
// Remember that this service is called in the "multi" mode,
// with a new siteContentId each time.
@@ -469,7 +468,7 @@ public class ContentManagementServices {
}
for (GenericValue roleType : siteRoles) {
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.put("partyId", partyId);
serviceContext.put("contentId", siteContentId);
serviceContext.put("userLogin", userLogin);
@@ -494,7 +493,7 @@ public class ContentManagementServices {
//return ServiceUtil.returnError(e.toString());
if (fromDate == null) {
try {
Map<String, Object> newContext = FastMap.newInstance();
Map<String, Object> newContext = new HashMap<String, Object>();
newContext.put("contentId", serviceContext.get("contentId"));
newContext.put("partyId", serviceContext.get("partyId"));
newContext.put("roleTypeId", serviceContext.get("roleTypeId"));
@@ -525,7 +524,7 @@ public class ContentManagementServices {
//Timestamp thruDate = UtilDateTime.nowTimestamp();
//serviceContext.put("thruDate", thruDate);
//serviceContext.put("fromDate", fromDate);
Map<String, Object> newContext = FastMap.newInstance();
Map<String, Object> newContext = new HashMap<String, Object>();
newContext.put("contentId", serviceContext.get("contentId"));
newContext.put("partyId", serviceContext.get("partyId"));
newContext.put("roleTypeId", serviceContext.get("roleTypeId"));
@@ -552,7 +551,7 @@ public class ContentManagementServices {
LocalDispatcher dispatcher = dctx.getDispatcher();
//String contentId = (String)context.get("contentId");
Locale locale = (Locale) context.get("locale");
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
try {
//GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne();
ModelService checkPermModel = dispatcher.getDispatchContext().getModelService("checkContentPermission");
@@ -586,8 +585,8 @@ public class ContentManagementServices {
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> newDrContext = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> newDrContext = new HashMap<String, Object>();
GenericValue dataResource = delegator.makeValue("DataResource");
dataResource.setPKFields(context);
dataResource.setNonPKFields(context);
@@ -648,7 +647,7 @@ public class ContentManagementServices {
Debug.logInfo("in persist... dataResourceId(0):" + dataResourceId, null);
}
dataResource = (GenericValue)thisResult.get("dataResource");
Map<String, Object> fileContext = FastMap.newInstance();
Map<String, Object> fileContext = new HashMap<String, Object>();
fileContext.put("userLogin", userLogin);
if (dataResourceTypeId.equals("IMAGE_OBJECT")) {
if (imageDataBytes != null) {
@@ -680,7 +679,7 @@ public class ContentManagementServices {
if (UtilValidate.isNotEmpty(errorMsg)) {
return ServiceUtil.returnError(errorMsg);
}
Map<String, Object> fileContext = FastMap.newInstance();
Map<String, Object> fileContext = new HashMap<String, Object>();
fileContext.put("userLogin", userLogin);
String forceElectronicText = (String)context.get("forceElectronicText");
if (dataResourceTypeId.equals("IMAGE_OBJECT")) {
@@ -708,7 +707,7 @@ public class ContentManagementServices {
}
}
if (dataResourceTypeId.indexOf("_FILE") >=0) {
Map<String, Object> uploadImage = FastMap.newInstance();
Map<String, Object> uploadImage = new HashMap<String, Object>();
uploadImage.put("userLogin", userLogin);
uploadImage.put("dataResourceId", dataResourceId);
uploadImage.put("dataResourceTypeId", dataResourceTypeId);
@@ -736,8 +735,8 @@ public class ContentManagementServices {
public static Map<String, Object> updateSiteRolesDyn(DispatchContext dctx, Map<String, ? extends Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dctx.getDelegator();
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Map<String, Object> serviceContext = new HashMap<String, Object>();
// siteContentId will equal "ADMIN_MASTER", "AGINC_MASTER", etc.
// Remember that this service is called in the "multi" mode,
// with a new siteContentId each time.
@@ -790,7 +789,7 @@ public class ContentManagementServices {
//Timestamp thruDate = UtilDateTime.nowTimestamp();
//serviceContext.put("thruDate", thruDate);
//serviceContext.put("fromDate", fromDate);
Map<String, Object> newContext = FastMap.newInstance();
Map<String, Object> newContext = new HashMap<String, Object>();
newContext.put("contentId", serviceContext.get("contentId"));
newContext.put("partyId", serviceContext.get("partyId"));
newContext.put("roleTypeId", serviceContext.get("roleTypeId"));
@@ -807,12 +806,12 @@ public class ContentManagementServices {
}
public static Map<String, Object> updateOrRemove(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
String entityName = (String)context.get("entityName");
String action = (String)context.get("action");
String pkFieldCount = (String)context.get("pkFieldCount");
Map<String, String> pkFields = FastMap.newInstance();
Map<String, String> pkFields = new HashMap<String, String>();
int fieldCount = Integer.parseInt(pkFieldCount);
for (int i=0; i<fieldCount; i++) {
String fieldName = (String)context.get("fieldName" + i);
@@ -861,7 +860,7 @@ public class ContentManagementServices {
}
public static Map<String, Object> resequence(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
String contentIdTo = (String)context.get("contentIdTo");
Integer seqInc = (Integer)context.get("seqInc");
@@ -871,7 +870,7 @@ public class ContentManagementServices {
int seqIncrement = seqInc.intValue();
List<String> typeList = UtilGenerics.checkList(context.get("typeList"));
if (typeList == null) {
typeList = FastList.newInstance();
typeList = new LinkedList<String>();
}
String contentAssocTypeId = (String)context.get("contentAssocTypeId");
if (UtilValidate.isNotEmpty(contentAssocTypeId)) {
@@ -941,7 +940,7 @@ public class ContentManagementServices {
}
public static Map<String, Object> changeLeafToNode(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
String contentId = (String)context.get("contentId");
@@ -1007,7 +1006,7 @@ public class ContentManagementServices {
}
public static Map<String, Object> updateLeafCount(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
List<String> typeList = UtilGenerics.checkList(context.get("typeList"));
if (typeList == null) {
@@ -1027,7 +1026,7 @@ public class ContentManagementServices {
/*
public static Map<String, Object> updateLeafChange(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map result = FastMap.newInstance();
Map result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
List typeList = (List)context.get("typeList");
if (typeList == null)
@@ -1090,11 +1089,11 @@ public class ContentManagementServices {
public static Map<String, Object> updatePageType(DispatchContext dctx, Map<String, ? extends Object> rcontext) throws GenericServiceException{
Delegator delegator = dctx.getDelegator();
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Locale locale = (Locale) context.get("locale");
Set<String> visitedSet = UtilGenerics.checkSet(context.get("visitedSet"));
if (visitedSet == null) {
visitedSet = FastSet.newInstance();
visitedSet = new HashSet<String>();
context.put("visitedSet", visitedSet);
}
String pageMode = (String)context.get("pageMode");
@@ -1130,11 +1129,11 @@ public class ContentManagementServices {
public static Map<String, Object> resetToOutlineMode(DispatchContext dctx, Map<String, ? extends Object> rcontext) throws GenericServiceException{
Delegator delegator = dctx.getDelegator();
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Locale locale = (Locale) context.get("locale");
Set<String> visitedSet = UtilGenerics.checkSet(context.get("visitedSet"));
if (visitedSet == null) {
visitedSet = FastSet.newInstance();
visitedSet = new HashSet<String>();
context.put("visitedSet", visitedSet);
}
String contentId = (String)context.get("contentId");
@@ -1173,7 +1172,7 @@ public class ContentManagementServices {
}
public static Map<String, Object> clearContentAssocViewCache(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
UtilCache<?, ?> utilCache = UtilCache.findCache("entitycache.entity-list.default.ContentAssocViewFrom");
if (utilCache != null) {
@@ -1189,7 +1188,7 @@ public class ContentManagementServices {
}
public static Map<String, Object> clearContentAssocDataResourceViewCache(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
UtilCache<?, ?> utilCache = UtilCache.findCache("entitycache.entity-list.default.ContentAssocViewDataResourceFrom");
if (utilCache != null) {
@@ -1208,7 +1207,7 @@ public class ContentManagementServices {
String contentId = content.getString("contentId");
Set<String> visitedSet = UtilGenerics.checkSet(context.get("visitedSet"));
if (visitedSet == null) {
visitedSet = FastSet.newInstance();
visitedSet = new HashSet<String>();
context.put("visitedSet", visitedSet);
} else {
if (visitedSet.contains(contentId)) {
@@ -1241,7 +1240,7 @@ public class ContentManagementServices {
String contentId = content.getString("contentId");
Set<String> visitedSet = UtilGenerics.checkSet(context.get("visitedSet"));
if (visitedSet == null) {
visitedSet = FastSet.newInstance();
visitedSet = new HashSet<String>();
context.put("visitedSet", visitedSet);
} else {
if (visitedSet.contains(contentId)) {
@@ -1280,7 +1279,7 @@ public class ContentManagementServices {
}
public static Map<String, Object> findSubNodes(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
String contentIdTo = (String)context.get("contentId");
try {
@@ -1315,7 +1314,7 @@ public class ContentManagementServices {
}
public static Map<String, Object> initContentChildCounts(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Locale locale = (Locale) context.get("locale");
GenericValue content = (GenericValue)context.get("content");
if (content == null) {
@@ -1336,7 +1335,7 @@ public class ContentManagementServices {
}
public static Map<String, Object> incrementContentChildStats(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
Locale locale = (Locale) context.get("locale");
String contentId = (String)context.get("contentId");
@@ -1362,7 +1361,7 @@ public class ContentManagementServices {
}
public static Map<String, Object> decrementContentChildStats(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
Locale locale = (Locale) context.get("locale");
String contentId = (String)context.get("contentId");
@@ -1388,12 +1387,12 @@ public class ContentManagementServices {
}
public static Map<String, Object> updateContentChildStats(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
String contentId = (String)context.get("contentId");
String contentAssocTypeId = (String)context.get("contentAssocTypeId");
List<String> typeList = FastList.newInstance();
List<String> typeList = new LinkedList<String>();
if (UtilValidate.isNotEmpty(contentAssocTypeId)) {
typeList.add(contentAssocTypeId);
} else {
@@ -1409,7 +1408,7 @@ public class ContentManagementServices {
}
public static Map<String, Object> updateContentSubscription(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
@@ -1475,7 +1474,7 @@ public class ContentManagementServices {
if (hasExistingContentRole) {
contentRole.store();
} else {
Map<String, Object> map = FastMap.newInstance();
Map<String, Object> map = new HashMap<String, Object>();
map.put("partyId", partyId);
map.put("roleTypeId", roleTypeId);
map.put("userLogin", userLogin);
@@ -1490,7 +1489,7 @@ public class ContentManagementServices {
public static Map<String, Object> updateContentSubscriptionByProduct(DispatchContext dctx, Map<String, ? extends Object> rcontext) throws GenericServiceException{
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
String productId = (String) context.get("productId");
@@ -1542,7 +1541,7 @@ public class ContentManagementServices {
public static Map<String, Object> updateContentSubscriptionByOrder(DispatchContext dctx, Map<String, ? extends Object> rcontext) throws GenericServiceException{
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
String orderId = (String) context.get("orderId");
@@ -1604,14 +1603,14 @@ public class ContentManagementServices {
String contentId = (String)context.get("contentId");
String serviceName = (String)context.get("serviceName");
String contentAssocTypeId = (String)context.get("contentAssocTypeId");
List<String> contentAssocTypeIdList = FastList.newInstance();
List<String> contentAssocTypeIdList = new LinkedList<String>();
if (UtilValidate.isNotEmpty(contentAssocTypeId)) {
contentAssocTypeIdList = StringUtil.split(contentAssocTypeId, "|");
}
if (contentAssocTypeIdList.size() == 0) {
contentAssocTypeIdList.add("SUB_CONTENT");
}
Map<String, Object> ctx = FastMap.newInstance();
Map<String, Object> ctx = new HashMap<String, Object>();
ctx.put("userLogin", userLogin);
ctx.put("contentAssocTypeIdList", contentAssocTypeIdList);
try {
@@ -1631,7 +1630,7 @@ public class ContentManagementServices {
Locale locale = (Locale) context.get("locale");
Set<String> visitedSet = UtilGenerics.checkSet(context.get("visitedSet"));
if (visitedSet == null) {
visitedSet = FastSet.newInstance();
visitedSet = new HashSet<String>();
context.put("visitedSet", visitedSet);
} else {
if (visitedSet.contains(contentId)) {
@@ -1686,9 +1685,9 @@ public class ContentManagementServices {
return ServiceUtil.returnError(errorMsg);
}
String contentId = (String)result.get("contentId");
List<String> parentList = FastList.newInstance();
List<String> parentList = new LinkedList<String>();
if (UtilValidate.isEmpty(masterRevisionContentId)) {
Map<String, Object> traversMap = FastMap.newInstance();
Map<String, Object> traversMap = new HashMap<String, Object>();
traversMap.put("contentId", contentId);
traversMap.put("direction", "To");
traversMap.put("contentAssocTypeId", "COMPDOC_PART");
@@ -1699,7 +1698,7 @@ public class ContentManagementServices {
}
// Update ContentRevision and ContentRevisonItem
Map<String, Object> contentRevisionMap = FastMap.newInstance();
Map<String, Object> contentRevisionMap = new HashMap<String, Object>();
contentRevisionMap.put("itemContentId", contentId);
contentRevisionMap.put("newDataResourceId", result.get("dataResourceId"));
contentRevisionMap.put("oldDataResourceId", oldDataResourceId);
@@ -22,16 +22,15 @@ import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.StringUtil;
@@ -61,8 +60,8 @@ import org.ofbiz.security.Security;
public class ContentManagementWorker {
public static final String module = ContentManagementWorker.class.getName();
public static Map<String, GenericValue> cachedWebSitePublishPoints = FastMap.newInstance();
public static Map<String, Map<String, Object>> cachedStaticValues = FastMap.newInstance();
public static Map<String, GenericValue> cachedWebSitePublishPoints = new HashMap<String, GenericValue>();
public static Map<String, Map<String, Object>> cachedStaticValues = new HashMap<String, Map<String,Object>>();
public static void mruAdd(HttpServletRequest request, GenericEntity pk, String suffix) {
HttpSession session = request.getSession();
@@ -81,7 +80,7 @@ public class ContentManagementWorker {
Map<String, LifoSet<Object>> lookupCaches = UtilGenerics.checkMap(session.getAttribute("lookupCaches"));
if (lookupCaches == null) {
lookupCaches = FastMap.newInstance();
lookupCaches = new HashMap<String, LifoSet<Object>>();
session.setAttribute("lookupCaches", lookupCaches);
}
String entityName = pk.getEntityName();
@@ -154,7 +153,7 @@ public class ContentManagementWorker {
HttpSession session = request.getSession();
Map<String, GenericEntity> currentEntityMap = UtilGenerics.checkMap(session.getAttribute("currentEntityMap"));
if (currentEntityMap == null) {
currentEntityMap = FastMap.newInstance();
currentEntityMap = new HashMap<String, GenericEntity>();
session.setAttribute("currentEntityMap", currentEntityMap);
}
currentEntityMap.put(entityName, ent);
@@ -183,7 +182,7 @@ public class ContentManagementWorker {
HttpSession session = request.getSession();
Map<String, GenericPK> currentEntityMap = UtilGenerics.checkMap(session.getAttribute("currentEntityMap"));
if (currentEntityMap == null) {
currentEntityMap = FastMap.newInstance();
currentEntityMap = new HashMap<String, GenericPK>();
session.setAttribute("currentEntityMap", currentEntityMap);
}
Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
@@ -276,7 +275,7 @@ public class ContentManagementWorker {
}
public static List<String []> getPermittedPublishPoints(Delegator delegator, List<GenericValue> allPublishPoints, GenericValue userLogin, Security security, String permittedAction, String permittedOperations, String passedRoles) throws GeneralException {
List<String []> permittedPublishPointList = FastList.newInstance();
List<String []> permittedPublishPointList = new LinkedList<String[]>();
// Check that user has permission to admin sites
for (GenericValue webSitePP : allPublishPoints) {
@@ -290,7 +289,7 @@ public class ContentManagementWorker {
}
List<String> passedPurposes = UtilMisc.toList("ARTICLE");
List<String> roles = StringUtil.split(passedRoles, "|");
List<String> targetOperationList = FastList.newInstance();
List<String> targetOperationList = new LinkedList<String>();
if (UtilValidate.isEmpty(permittedOperations)) {
targetOperationList.add("CONTENT" + entityAction);
} else {
@@ -323,7 +322,7 @@ public class ContentManagementWorker {
} catch (GenericEntityException e) {
throw new GeneralException(e.getMessage());
}
List<GenericValue> allPublishPoints = FastList.newInstance();
List<GenericValue> allPublishPoints = new LinkedList<GenericValue>();
GenericValue webSitePublishPoint = null;
for (GenericValue contentAssoc : relatedPubPts) {
String pub = (String)contentAssoc.get("contentId");
@@ -336,7 +335,7 @@ public class ContentManagementWorker {
public static Map<String, GenericValue> getPublishPointMap(Delegator delegator, String pubPtId) throws GeneralException {
List<GenericValue> publishPointList = getAllPublishPoints(delegator, pubPtId);
Map<String, GenericValue> publishPointMap = FastMap.newInstance();
Map<String, GenericValue> publishPointMap = new HashMap<String, GenericValue>();
for (GenericValue webSitePublishPoint : publishPointList) {
String pub = (String)webSitePublishPoint.get("contentId");
publishPointMap.put(pub, webSitePublishPoint);
@@ -355,7 +354,7 @@ public class ContentManagementWorker {
}
public static Map<String, GenericValue> getPublishPointMap(Delegator delegator, List<GenericValue> publishPointList) {
Map<String, GenericValue> publishPointMap = FastMap.newInstance();
Map<String, GenericValue> publishPointMap = new HashMap<String, GenericValue>();
for (GenericValue webSitePublishPoint : publishPointList) {
String pub = (String)webSitePublishPoint.get("contentId");
publishPointMap.put(pub, webSitePublishPoint);
@@ -371,13 +370,13 @@ public class ContentManagementWorker {
throw new GeneralException(e.getMessage());
}
List<Map<String, Object>> staticValueList = FastList.newInstance();
List<Map<String, Object>> staticValueList = new LinkedList<Map<String,Object>>();
int counter = 0;
for (GenericValue content : assocValueList) {
String contentId = (String)content.get("contentId");
String contentName = (String)content.get("contentName");
String description = (String)content.get("description");
Map<String, Object> map = FastMap.newInstance();
Map<String, Object> map = new HashMap<String, Object>();
map.put("contentId", contentId);
map.put("contentName", contentName);
map.put("description", description);
@@ -465,7 +464,7 @@ public class ContentManagementWorker {
if (!ignoreCache) {
Map<String, Object> subStaticValueMap = cachedStaticValues.get(parentPlaceholderId);
if (subStaticValueMap == null) {
subStaticValueMap = FastMap.newInstance();
subStaticValueMap = new HashMap<String, Object>();
cachedStaticValues.put(parentPlaceholderId, subStaticValueMap);
}
//Map staticValueMap = (GenericValue)cachedStaticValues.get(web);
@@ -491,15 +490,15 @@ public class ContentManagementWorker {
List<GenericValue> allPublishPointList = getAllPublishPoints(delegator, rootPubId);
//if (Debug.infoOn()) Debug.logInfo("in getPublishLinks, allPublishPointList:" + allPublishPointList, module);
List<String []> publishPointList = getPermittedPublishPoints(delegator, allPublishPointList, userLogin, security , permittedAction, permittedOperations, passedRoles);
Map<String, Object> publishPointMap = FastMap.newInstance();
Map<String, Object> publishPointMapAll = FastMap.newInstance();
Map<String, Object> publishPointMap = new HashMap<String, Object>();
Map<String, Object> publishPointMapAll = new HashMap<String, Object>();
for (String [] arr : publishPointList) {
//GenericValue webSitePublishPoint = (GenericValue)it.next();
//String contentId = (String)webSitePublishPoint.get("contentId");
//String description = (String)webSitePublishPoint.get("description");
String contentId = arr[0];
String description = arr[1];
List<Object []> subPointList = FastList.newInstance();
List<Object []> subPointList = new LinkedList<Object[]>();
Object nullObj = null;
Object [] subArr = {contentId, subPointList, description, nullObj};
publishPointMap.put(contentId, subArr);
@@ -549,7 +548,7 @@ public class ContentManagementWorker {
}
}
List<Object []> publishedLinkList = FastList.newInstance();
List<Object []> publishedLinkList = new LinkedList<Object[]>();
for (String contentId : publishPointMap.keySet()) {
Object [] subPointArr = (Object [])publishPointMap.get(contentId);
publishedLinkList.add(subPointArr);
@@ -581,7 +580,7 @@ public class ContentManagementWorker {
}
public static List<String []> getPermittedDepartmentPoints(Delegator delegator, List<GenericValue> allDepartmentPoints, GenericValue userLogin, Security security, String permittedAction, String permittedOperations, String passedRoles) throws GeneralException {
List<String []> permittedDepartmentPointList = FastList.newInstance();
List<String []> permittedDepartmentPointList = new LinkedList<String[]>();
// Check that user has permission to admin sites
for (GenericValue content : allDepartmentPoints) {
@@ -593,7 +592,7 @@ public class ContentManagementWorker {
entityAction = "_ADMIN";
List<String> passedPurposes = UtilMisc.<String>toList("ARTICLE");
List<String> roles = StringUtil.split(passedRoles, "|");
List<String> targetOperationList = FastList.newInstance();
List<String> targetOperationList = new LinkedList<String>();
if (UtilValidate.isEmpty(permittedOperations)) {
targetOperationList.add("CONTENT" + entityAction);
} else {
@@ -627,7 +626,7 @@ public class ContentManagementWorker {
} catch (GenericEntityException e) {
throw new GeneralException(e.getMessage());
}
List<GenericValue> allDepartmentPoints = FastList.newInstance();
List<GenericValue> allDepartmentPoints = new LinkedList<GenericValue>();
GenericValue departmentContent = null;
for (GenericValue contentAssoc : relatedPubPts) {
String pub = (String)contentAssoc.get("contentId");
@@ -21,12 +21,11 @@ package org.ofbiz.content;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
@@ -109,7 +108,7 @@ In order ta make this service active add the following to the service definition
Entity.set("createdTxStamp", UtilDateTime.nowTimestamp());
delegator.create(Entity);
Map<String, Object> contentAssoc = FastMap.newInstance();
Map<String, Object> contentAssoc = new HashMap<String, Object>();
contentAssoc.put("contentId", "HOME_DUCUMENT");
contentAssoc.put("contentAssocTypeId", "TREE_CHILD");
contentAssoc.put("contentIdTo", "ROOT");
@@ -193,7 +192,7 @@ In order ta make this service active add the following to the service definition
.queryList();
if (contentAssocs.size() == 0) {
contentAssoc = FastMap.newInstance();
contentAssoc = new HashMap<String, Object>();
contentAssoc.put("contentId", contentId);
contentAssoc.put("contentAssocTypeId", "TREE_CHILD");
contentAssoc.put("contentIdTo", rootContent);
@@ -284,7 +283,7 @@ In order ta make this service active add the following to the service definition
contentId = null;
if (contentNameMatch == false) {
//create DataResource
Map<String,Object> data = FastMap.newInstance();
Map<String,Object> data = new HashMap<String, Object>();
data.put("userLogin", userLogin);
String dataResourceId = dispatcher.runSync("createDataResource", data).get("dataResourceId").toString();
//Debug.logInfo("==dataResourceId" + dataResourceId);
@@ -307,7 +306,7 @@ In order ta make this service active add the following to the service definition
delegator.create(Entity);
//Relation Content
Map<String,Object> contentAssoc = FastMap.newInstance();
Map<String,Object> contentAssoc = new HashMap<String, Object>();
contentAssoc.put("contentId", contentId);
contentAssoc.put("contentAssocTypeId", "SUB_CONTENT");
contentAssoc.put("contentIdTo", rootContent);
@@ -346,7 +345,7 @@ In order ta make this service active add the following to the service definition
contentId = null;
if (contentNameMatch == false) {
//create DataResource
Map<String,Object> data = FastMap.newInstance();
Map<String,Object> data = new HashMap<String, Object>();
data.put("userLogin", userLogin);
String dataResourceId = dispatcher.runSync("createDataResource",data).get("dataResourceId").toString();
//Debug.logInfo("==dataResourceId" + dataResourceId);
@@ -369,7 +368,7 @@ In order ta make this service active add the following to the service definition
delegator.create(Entity);
//create ContentAssoc
Map<String,Object> contentAssoc = FastMap.newInstance();
Map<String,Object> contentAssoc = new HashMap<String, Object>();
contentAssoc.put("contentId", contentId);
contentAssoc.put("contentAssocTypeId", "SUB_CONTENT");
contentAssoc.put("contentIdTo", rootContent);
@@ -20,13 +20,12 @@
package org.ofbiz.content.blog;
import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilMisc;
@@ -100,7 +99,7 @@ public class BlogRssServices {
}
public static List<SyndEntry> generateEntryList(LocalDispatcher dispatcher, Delegator delegator, String contentId, String entryLink, Locale locale, GenericValue userLogin) {
List<SyndEntry> entries = FastList.newInstance();
List<SyndEntry> entries = new LinkedList<SyndEntry>();
List<GenericValue> contentRecs = null;
try {
@@ -117,7 +116,7 @@ public class BlogRssServices {
for (GenericValue v : contentRecs) {
String sub = null;
try {
Map<String, Object> dummy = FastMap.newInstance();
Map<String, Object> dummy = new HashMap<String, Object>();
sub = ContentWorker.renderSubContentAsText(dispatcher, delegator, v.getString("contentId"), mapKey, dummy, locale, mimeTypeId, true);
} catch (GeneralException e) {
Debug.logError(e, module);
@@ -21,6 +21,7 @@ package org.ofbiz.content.compdoc;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@@ -29,8 +30,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilFormatOut;
import org.ofbiz.base.util.UtilHttp;
@@ -108,7 +107,7 @@ public class CompDocEvents {
request.setAttribute(obj.toString(), val);
}
// Update ContentRevision and ContentRevisonItem
Map<String, Object> contentRevisionMap = FastMap.newInstance();
Map<String, Object> contentRevisionMap = new HashMap<String, Object>();
contentRevisionMap.put("itemContentId", contentId);
contentRevisionMap.put("contentId", contentId);
contentRevisionMap.put("userLogin", userLogin);
@@ -160,7 +159,7 @@ public class CompDocEvents {
https = (String) servletContext.getAttribute("https");
}
Map<String, Object> mapIn = FastMap.newInstance();
Map<String, Object> mapIn = new HashMap<String, Object>();
mapIn.put("contentId", contentId);
mapIn.put("locale", locale);
mapIn.put("rootDir", rootDir);
@@ -231,7 +230,7 @@ public class CompDocEvents {
https = (String) servletContext.getAttribute("https");
}
Map<String, Object> mapIn = FastMap.newInstance();
Map<String, Object> mapIn = new HashMap<String, Object>();
mapIn.put("contentId", contentId);
mapIn.put("locale", locale);
mapIn.put("rootDir", rootDir);
@@ -21,13 +21,12 @@ package org.ofbiz.content.compdoc;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
@@ -72,7 +71,7 @@ public class CompDocServices {
*/
public static Map<String, Object> persistRootCompDoc(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Locale locale = (Locale)context.get("locale");
@@ -109,7 +108,7 @@ public class CompDocServices {
//request.setAttribute("contentId", contentId);
// Update ContentRevision and ContentRevisonItem
Map<String, Object> contentRevisionMap = FastMap.newInstance();
Map<String, Object> contentRevisionMap = new HashMap<String, Object>();
contentRevisionMap.put("itemContentId", contentId);
contentRevisionMap.put("contentId", contentId);
contentRevisionMap.put("userLogin", userLogin);
@@ -144,7 +143,7 @@ public class CompDocServices {
GenericValue userLogin = (GenericValue) context.get("userLogin");
try {
List<EntityCondition> exprList = FastList.newInstance();
List<EntityCondition> exprList = new LinkedList<EntityCondition>();
exprList.add(EntityCondition.makeCondition("contentIdTo", EntityOperator.EQUALS, contentId));
exprList.add(EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.EQUALS, "COMPDOC_PART"));
exprList.add(EntityCondition.makeCondition("rootRevisionContentId", EntityOperator.EQUALS, contentId));
@@ -19,13 +19,12 @@
package org.ofbiz.content.content;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import javolution.util.FastList;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilMisc;
@@ -68,7 +67,7 @@ public class ContentKeywordIndex {
Set<String> stemSet = KeywordSearchUtil.getStemSet();
Map<String, Long> keywords = new TreeMap<String, Long>();
List<String> strings = FastList.newInstance();
List<String> strings = new LinkedList<String>();
int pidWeight = 1;
keywords.put(content.getString("contentId").toLowerCase(), Long.valueOf(pidWeight));
@@ -198,7 +197,7 @@ public class ContentKeywordIndex {
}
}
List<GenericValue> toBeStored = FastList.newInstance();
List<GenericValue> toBeStored = new LinkedList<GenericValue>();
int keywordMaxLength = Integer.parseInt(EntityUtilProperties.getPropertyValue("contentsearch", "content.keyword.max.length", delegator));
for (Map.Entry<String, Long> entry: keywords.entrySet()) {
if (entry.getKey().length() <= keywordMaxLength) {
@@ -21,6 +21,9 @@ package org.ofbiz.content.content;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -29,10 +32,6 @@ import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javolution.util.FastList;
import javolution.util.FastMap;
import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilGenerics;
@@ -52,7 +51,7 @@ public class ContentMapFacade implements Map<Object, Object> {
public static final String module = ContentMapFacade.class.getName();
protected static final Set<String> mapKeySet = FastSet.newInstance();
protected static final Set<String> mapKeySet = new HashSet<String>();
static {
mapKeySet.add("fields");
mapKeySet.add("link");
@@ -279,10 +278,10 @@ public class ContentMapFacade implements Map<Object, Object> {
return dataResource;
} else if ("subcontent_all".equalsIgnoreCase(name)) {
// subcontent list of ordered subcontent
List<ContentMapFacade> subContent = FastList.newInstance();
List<ContentMapFacade> subContent = new LinkedList<ContentMapFacade>();
List<GenericValue> subs = null;
try {
Map<String, Object> expressions = FastMap.newInstance();
Map<String, Object> expressions = new HashMap<String, Object>();
expressions.put("contentIdStart", contentId);
if(!this.mapKeyFilter.equals("")) {
expressions.put("caMapKey", this.mapKeyFilter);
@@ -329,7 +328,7 @@ public class ContentMapFacade implements Map<Object, Object> {
return "=========> " + errorMsg + " <=========";
}
// TODO: change to use the MapStack instead of a cloned Map
Map<String, Object> renderCtx = FastMap.newInstance();
Map<String, Object> renderCtx = new HashMap<String, Object>();
renderCtx.putAll(context);
if (this.decoratedContent != null) {
renderCtx.put("decoratedContent", decoratedContent);
@@ -457,7 +456,7 @@ public class ContentMapFacade implements Map<Object, Object> {
// key is the mapKey
GenericValue sub = null;
try {
Map<String, Object> expressions = FastMap.newInstance();
Map<String, Object> expressions = new HashMap<String, Object>();
expressions.put("contentIdStart", contentId);
expressions.put("caMapKey", name);
if(!this.statusFilter.equals("")) {
@@ -18,13 +18,12 @@
*******************************************************************************/
package org.ofbiz.content.content;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilGenerics;
@@ -115,7 +114,7 @@ public class ContentPermissionServices {
displayPassCond = true;
}
Debug.logInfo("displayPassCond(0):" + displayPassCond, "");
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
GenericValue userLogin = (GenericValue) context.get("userLogin");
String partyId = (String) context.get("partyId");
if (UtilValidate.isEmpty(partyId)) {
@@ -147,7 +146,7 @@ public class ContentPermissionServices {
if (UtilValidate.isNotEmpty(contentPurposeString)) {
List<String> purposesFromString = StringUtil.split(contentPurposeString, "|");
if (passedPurposes == null) {
passedPurposes = FastList.newInstance();
passedPurposes = new LinkedList<String>();
}
passedPurposes.addAll(purposesFromString);
}
@@ -164,7 +163,7 @@ public class ContentPermissionServices {
if (UtilValidate.isNotEmpty(targetOperationString)) {
List<String> operationsFromString = StringUtil.split(targetOperationString, "|");
if (targetOperations == null) {
targetOperations = FastList.newInstance();
targetOperations = new LinkedList<String>();
}
targetOperations.addAll(operationsFromString);
}
@@ -175,7 +174,7 @@ public class ContentPermissionServices {
EntityPermissionChecker.StdRelatedRoleGetter roleGetter = new EntityPermissionChecker.StdRelatedRoleGetter("Content", "roleTypeId", "contentId", "partyId", "ownerContentId", "ContentRole");
//Debug.logInfo("targetOperations(b):" + targetOperations, "");
List<String> passedRoles = UtilGenerics.checkList(context.get("roleTypeList"));
if (passedRoles == null) passedRoles = FastList.newInstance();
if (passedRoles == null) passedRoles = new LinkedList<String>();
String roleTypeString = (String) context.get("roleTypeString");
if (UtilValidate.isNotEmpty(roleTypeString)) {
List<String> rolesFromString = StringUtil.split(roleTypeString, "|");
@@ -191,7 +190,7 @@ public class ContentPermissionServices {
StringBuilder errBuf = new StringBuilder();
String permissionStatus = null;
List<Object> entityIds = FastList.newInstance();
List<Object> entityIds = new LinkedList<Object>();
if (passed) {
results.put("permissionStatus", "granted");
permissionStatus = "granted";
@@ -261,7 +260,7 @@ public class ContentPermissionServices {
}
public static Map<String, Object> checkAssocPermission(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
// Security security = dctx.getSecurity();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
@@ -291,12 +290,12 @@ public class ContentPermissionServices {
// boolean isMatch = false;
// boolean isMatchTo = false;
// boolean isMatchFrom = false;
Map<String, Object> permResults = FastMap.newInstance();
Map<String, Object> permResults = new HashMap<String, Object>();
// Use the purposes from the from entity for both cases.
List<String> relatedPurposes = EntityPermissionChecker.getRelatedPurposes(contentFrom, null);
List<String> relatedPurposesTo = EntityPermissionChecker.getRelatedPurposes(contentTo, relatedPurposes);
Map<String, Object> serviceInMap = FastMap.newInstance();
Map<String, Object> serviceInMap = new HashMap<String, Object>();
serviceInMap.put("userLogin", userLogin);
serviceInMap.put("targetOperationList", UtilMisc.toList("CONTENT_LINK_TO"));
serviceInMap.put("contentPurposeList", relatedPurposesTo);
@@ -20,16 +20,15 @@ package org.ofbiz.content.content;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import javolution.util.FastList;
import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
@@ -114,17 +113,17 @@ public class ContentSearch {
public static class ContentSearchContext {
public int index = 1;
public List<EntityCondition> entityConditionList = FastList.newInstance();
public List<String> orderByList = FastList.newInstance();
public List<EntityCondition> entityConditionList = new LinkedList<EntityCondition>();
public List<String> orderByList = new LinkedList<String>();
public Set<String> fieldsToSelect = UtilMisc.toSet("contentId");
public DynamicViewEntity dynamicViewEntity = new DynamicViewEntity();
public boolean contentIdGroupBy = false;
public boolean includedKeywordSearch = false;
public Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
public List<Set<String>> keywordFixedOrSetAndList = FastList.newInstance();
public Set<String> orKeywordFixedSet = FastSet.newInstance();
public Set<String> andKeywordFixedSet = FastSet.newInstance();
public List<GenericValue> contentSearchConstraintList = FastList.newInstance();
public List<Set<String>> keywordFixedOrSetAndList = new LinkedList<Set<String>>();
public Set<String> orKeywordFixedSet = new HashSet<String>();
public Set<String> andKeywordFixedSet = new HashSet<String>();
public List<GenericValue> contentSearchConstraintList = new LinkedList<GenericValue>();
public ResultSortOrder resultSortOrder = null;
public Integer resultOffset = null;
public Integer maxResults = null;
@@ -254,7 +253,7 @@ public class ContentSearch {
dynamicViewEntity.addMemberEntity(entityAlias, "ContentKeyword");
dynamicViewEntity.addAlias(entityAlias, prefix + "Keyword", "keyword", null, null, null, null);
dynamicViewEntity.addViewLink("CNT", entityAlias, Boolean.FALSE, ModelKeyMap.makeKeyMapList("contentId"));
List<EntityExpr> keywordOrList = FastList.newInstance();
List<EntityExpr> keywordOrList = new LinkedList<EntityExpr>();
for (String keyword: keywordFixedOrSet) {
keywordOrList.add(EntityCondition.makeCondition(prefix + "Keyword", EntityOperator.LIKE, keyword));
}
@@ -362,7 +361,7 @@ public class ContentSearch {
int numRetreived = 1;
int duplicatesFound = 0;
Set<String> contentIdSet = FastSet.newInstance();
Set<String> contentIdSet = new HashSet<String>();
contentIds.add(searchResult.getString("contentId"));
contentIdSet.add(searchResult.getString("contentId"));
@@ -484,7 +483,7 @@ public class ContentSearch {
@Override
public void addConstraint(ContentSearchContext contentSearchContext) {
Set<String> contentIdSet = FastSet.newInstance();
Set<String> contentIdSet = new HashSet<String>();
if (includeSubContents) {
// find all sub-categories recursively, make a Set of contentId
ContentSearch.getAllSubContentIds(contentId, contentIdSet, contentSearchContext.getDelegator(), contentSearchContext.nowTimestamp);
@@ -511,7 +510,7 @@ public class ContentSearch {
contentSearchContext.dynamicViewEntity.addAlias(entityAlias, prefix + "ThruDate", "thruDate", null, null, null, null);
contentSearchContext.dynamicViewEntity.addViewLink("CNT", entityAlias, Boolean.TRUE, ModelKeyMap.makeKeyMapList("contentId","contentIdFrom"));
List<EntityExpr> assocConditionFromTo = FastList.newInstance();
List<EntityExpr> assocConditionFromTo = new LinkedList<EntityExpr>();
assocConditionFromTo.add(EntityCondition.makeCondition(prefix + "ContentIdTo", EntityOperator.IN, contentIdSet));
if (UtilValidate.isNotEmpty(contentAssocTypeId)) {
assocConditionFromTo.add(EntityCondition.makeCondition(prefix + "ContentAssocTypeId", EntityOperator.EQUALS, contentAssocTypeId));
@@ -532,7 +531,7 @@ public class ContentSearch {
contentSearchContext.dynamicViewEntity.addAlias(entityAlias, prefix + "ThruDate", "thruDate", null, null, null, null);
contentSearchContext.dynamicViewEntity.addViewLink("CNT", entityAlias, Boolean.TRUE, ModelKeyMap.makeKeyMapList("contentId","contentIdTo"));
List<EntityExpr> assocConditionToFrom = FastList.newInstance();
List<EntityExpr> assocConditionToFrom = new LinkedList<EntityExpr>();
assocConditionToFrom.add(EntityCondition.makeCondition(prefix + "ContentIdFrom", EntityOperator.IN, contentIdSet));
if (UtilValidate.isNotEmpty(contentAssocTypeId)) {
assocConditionToFrom.add(EntityCondition.makeCondition(prefix + "ContentAssocTypeId", EntityOperator.EQUALS, contentAssocTypeId));
@@ -678,7 +677,7 @@ public class ContentSearch {
expandedSet.add(keyword);
}
Set<String> fixedSet = KeywordSearchUtil.fixKeywordsForSearch(expandedSet, anyPrefix, anySuffix, removeStems, isAnd);
Set<String> fixedKeywordSet = FastSet.newInstance();
Set<String> fixedKeywordSet = new HashSet<String>();
fixedKeywordSet.addAll(fixedSet);
contentSearchContext.keywordFixedOrSetAndList.add(fixedKeywordSet);
}
@@ -19,14 +19,13 @@
package org.ofbiz.content.content;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javolution.util.FastMap;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
import org.ofbiz.webapp.stats.VisitHandler;
@@ -99,7 +98,7 @@ public class ContentSearchEvents {
String searchSortOrderString = ContentSearchSession.searchGetSortOrderString(false, request);
// ========== populate the result Map
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
result.put("contentIds", contentIds);
result.put("viewIndex", Integer.valueOf(viewIndex));
@@ -19,6 +19,7 @@
package org.ofbiz.content.content;
import java.sql.Timestamp;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -26,8 +27,6 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javolution.util.FastList;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilHttp;
@@ -69,7 +68,7 @@ public class ContentSearchSession {
public static void addConstraint(ContentSearchConstraint contentSearchConstraint, HttpSession session) {
ContentSearchOptions contentSearchOptions = getContentSearchOptions(session);
if (contentSearchOptions.constraintList == null) {
contentSearchOptions.constraintList = FastList.newInstance();
contentSearchOptions.constraintList = new LinkedList<ContentSearch.ContentSearchConstraint>();
}
if (!contentSearchOptions.constraintList.contains(contentSearchConstraint)) {
contentSearchOptions.constraintList.add(contentSearchConstraint);
@@ -132,7 +131,7 @@ public class ContentSearchSession {
public List<String> searchGetConstraintStrings(boolean detailed, Delegator delegator, Locale locale) {
List<ContentSearchConstraint> contentSearchConstraintList = this.getConstraintList();
List<String> constraintStrings = FastList.newInstance();
List<String> constraintStrings = new LinkedList<String>();
if (contentSearchConstraintList == null) {
return constraintStrings;
}
@@ -268,7 +267,7 @@ public class ContentSearchSession {
public static List<ContentSearchOptions> getSearchOptionsHistoryList(HttpSession session) {
List<ContentSearchOptions> optionsHistoryList = UtilGenerics.checkList(session.getAttribute("_CONTENT_SEARCH_OPTIONS_HISTORY_"));
if (optionsHistoryList == null) {
optionsHistoryList = FastList.newInstance();
optionsHistoryList = new LinkedList<ContentSearchSession.ContentSearchOptions>();
session.setAttribute("_CONTENT_SEARCH_OPTIONS_HISTORY_", optionsHistoryList);
}
return optionsHistoryList;
@@ -22,14 +22,13 @@ import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.StringUtil;
@@ -66,7 +65,7 @@ public class ContentServices {
*/
public static Map<String, Object> findRelatedContent(DispatchContext dctx, Map<String, ? extends Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
GenericValue currentContent = (GenericValue) context.get("currentContent");
String fromDate = (String) context.get("fromDate");
@@ -95,12 +94,12 @@ public class ContentServices {
return results;
}
Map<String, Object> serviceInMap = FastMap.newInstance();
Map<String, Object> serviceInMap = new HashMap<String, Object>();
serviceInMap.put("userLogin", context.get("userLogin"));
serviceInMap.put("targetOperationList", targetOperations);
serviceInMap.put("entityOperation", context.get("entityOperation"));
List<GenericValue> permittedList = FastList.newInstance();
List<GenericValue> permittedList = new LinkedList<GenericValue>();
Map<String, Object> permResults = null;
for (GenericValue content : contentList) {
serviceInMap.put("currentContent", content);
@@ -125,8 +124,8 @@ public class ContentServices {
* This is a generic service for traversing a Content tree, typical of a blog response tree. It calls the ContentWorker.traverse method.
*/
public static Map<String, Object> findContentParents(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> results = FastMap.newInstance();
List<Object> parentList = FastList.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
List<Object> parentList = new LinkedList<Object>();
results.put("parentList", parentList);
LocalDispatcher dispatcher = dctx.getDispatcher();
String contentId = (String)context.get("contentId");
@@ -135,7 +134,7 @@ public class ContentServices {
if (UtilValidate.isEmpty(direction)) {
direction="To";
}
Map<String, Object> traversMap = FastMap.newInstance();
Map<String, Object> traversMap = new HashMap<String, Object>();
traversMap.put("contentId", contentId);
traversMap.put("direction", direction);
traversMap.put("contentAssocTypeId", contentAssocTypeId);
@@ -169,7 +168,7 @@ public class ContentServices {
*/
public static Map<String, Object> traverseContent(DispatchContext dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Locale locale = (Locale) context.get("locale");
String contentId = (String) context.get("contentId");
@@ -204,7 +203,7 @@ public class ContentServices {
thruDate = UtilDateTime.toTimestamp(thruDateStr);
}
Map<String, Object> whenMap = FastMap.newInstance();
Map<String, Object> whenMap = new HashMap<String, Object>();
whenMap.put("followWhen", context.get("followWhen"));
whenMap.put("pickWhen", context.get("pickWhen"));
whenMap.put("returnBeforePickWhen", context.get("returnBeforePickWhen"));
@@ -215,8 +214,8 @@ public class ContentServices {
startContentAssocTypeId = "PUBLISH";
}
Map<String, Object> nodeMap = FastMap.newInstance();
List<GenericValue> pickList = FastList.newInstance();
Map<String, Object> nodeMap = new HashMap<String, Object>();
List<GenericValue> pickList = new LinkedList<GenericValue>();
ContentWorker.traverse(delegator, content, fromDate, thruDate, whenMap, 0, nodeMap, startContentAssocTypeId, pickList, direction);
results.put("nodeMap", nodeMap);
@@ -258,7 +257,7 @@ public class ContentServices {
context.put("contentPurposeList", contentPurposeList);
Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
String contentId = (String) context.get("contentId");
@@ -359,7 +358,7 @@ public class ContentServices {
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
// This section guesses how contentId should be used (From or To) if
// only a contentIdFrom o contentIdTo is passed in
@@ -390,7 +389,7 @@ public class ContentServices {
/*
String deactivateExisting = (String) context.get("deactivateExisting");
if (deactivateExisting != null && deactivateExisting.equalsIgnoreCase("true")) {
Map andMap = FastMap.newInstance();
Map andMap = new HashMap<String, Object>();
andMap.put("contentIdTo", contentIdTo);
andMap.put("contentAssocTypeId", context.get("contentAssocTypeId"));
@@ -412,7 +411,7 @@ public class ContentServices {
}
*/
GenericValue contentAssoc = delegator.makeValue("ContentAssoc", FastMap.newInstance());
GenericValue contentAssoc = delegator.makeValue("ContentAssoc");
contentAssoc.put("contentId", contentIdFrom);
contentAssoc.put("contentIdTo", contentIdTo);
contentAssoc.put("contentAssocTypeId", context.get("contentAssocTypeId"));
@@ -463,7 +462,7 @@ public class ContentServices {
contentAssoc.put("createdDate", createdDate);
contentAssoc.put("lastModifiedDate", lastModifiedDate);
Map<String, Object> serviceInMap = FastMap.newInstance();
Map<String, Object> serviceInMap = new HashMap<String, Object>();
String permissionStatus = null;
serviceInMap.put("userLogin", context.get("userLogin"));
serviceInMap.put("targetOperationList", targetOperationList);
@@ -525,7 +524,7 @@ public class ContentServices {
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
context.put("entityOperation", "_UPDATE");
List<String> targetOperationList = ContentWorker.prepTargetOperationList(context, "_UPDATE");
@@ -607,7 +606,7 @@ public class ContentServices {
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
context.put("entityOperation", "_UPDATE");
List<String> targetOperationList = ContentWorker.prepTargetOperationList(context, "_UPDATE");
@@ -663,7 +662,7 @@ public class ContentServices {
contentAssoc.put("lastModifiedDate", lastModifiedDate);
String permissionStatus = null;
Map<String, Object> serviceInMap = FastMap.newInstance();
Map<String, Object> serviceInMap = new HashMap<String, Object>();
serviceInMap.put("userLogin", context.get("userLogin"));
serviceInMap.put("targetOperationList", targetOperationList);
serviceInMap.put("contentPurposeList", contentPurposeList);
@@ -720,7 +719,7 @@ public class ContentServices {
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Locale locale = (Locale) context.get("locale");
context.put("entityOperation", "_UPDATE");
List<String> targetOperationList = ContentWorker.prepTargetOperationList(context, "_UPDATE");
@@ -760,7 +759,7 @@ public class ContentServices {
contentAssoc.put("thruDate", UtilDateTime.nowTimestamp());
String permissionStatus = null;
Map<String, Object> serviceInMap = FastMap.newInstance();
Map<String, Object> serviceInMap = new HashMap<String, Object>();
serviceInMap.put("userLogin", context.get("userLogin"));
serviceInMap.put("targetOperationList", targetOperationList);
serviceInMap.put("contentPurposeList", contentPurposeList);
@@ -805,7 +804,7 @@ public class ContentServices {
Locale locale = (Locale) context.get("locale");
Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
String sequenceNum = null;
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
try {
GenericValue activeAssoc = null;
@@ -817,7 +816,7 @@ public class ContentServices {
sequenceNum = (String) activeAssoc.get("sequenceNum");
}
List<EntityCondition> exprList = FastList.newInstance();
List<EntityCondition> exprList = new LinkedList<EntityCondition>();
exprList.add(EntityCondition.makeCondition("mapKey", EntityOperator.EQUALS, mapKey));
if (sequenceNum != null) {
exprList.add(EntityCondition.makeCondition("sequenceNum", EntityOperator.EQUALS, sequenceNum));
@@ -858,7 +857,7 @@ public class ContentServices {
* matching content.
*/
public static Map<String, Object> renderSubContentAsText(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
@@ -895,7 +894,7 @@ public class ContentServices {
Writer outWriter = new StringWriter();
if (templateContext == null) {
templateContext = FastMap.newInstance();
templateContext = new HashMap<String, Object>();
}
try {
@@ -919,7 +918,7 @@ public class ContentServices {
* matching content.
*/
public static Map<String, Object> renderContentAsText(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String,Object> results = FastMap.newInstance();
Map<String,Object> results = new HashMap<String, Object>();
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dctx.getDelegator();
Writer out = (Writer) context.get("outWriter");
@@ -940,7 +939,7 @@ public class ContentServices {
}
if (templateContext == null) {
templateContext = FastMap.newInstance();
templateContext = new HashMap<String, Object>();
}
Writer outWriter = new StringWriter();
@@ -964,7 +963,7 @@ public class ContentServices {
}
public static Map<String, Object> linkContentToPubPt(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
@@ -978,7 +977,7 @@ public class ContentServices {
if (Debug.infoOn()) Debug.logInfo("in publishContent, statusId:" + statusId, module);
if (Debug.infoOn()) Debug.logInfo("in publishContent, userLogin:" + userLogin, module);
Map<String, Object> mapIn = FastMap.newInstance();
Map<String, Object> mapIn = new HashMap<String, Object>();
mapIn.put("contentId", contentId);
mapIn.put("contentIdTo", contentIdTo);
mapIn.put("contentAssocTypeId", contentAssocTypeId);
@@ -1008,7 +1007,7 @@ public class ContentServices {
content.put("statusId", statusId);
content.store();
mapIn = FastMap.newInstance();
mapIn = new HashMap<String, Object>();
mapIn.put("contentId", contentId);
mapIn.put("contentIdTo", contentIdTo);
mapIn.put("contentAssocTypeId", contentAssocTypeId);
@@ -1043,7 +1042,7 @@ public class ContentServices {
}
public static Map<String, Object> publishContent(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
GenericValue content = (GenericValue)context.get("content");
try {
@@ -1057,10 +1056,10 @@ public class ContentServices {
}
public static Map<String, Object> getPrefixedMembers(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> mapIn = UtilGenerics.checkMap(context.get("mapIn"));
String prefix = (String)context.get("prefix");
Map<String, Object> mapOut = FastMap.newInstance();
Map<String, Object> mapOut = new HashMap<String, Object>();
result.put("mapOut", mapOut);
if (mapIn != null) {
Set<Map.Entry<String, Object>> entrySet = mapIn.entrySet();
@@ -1077,8 +1076,8 @@ public class ContentServices {
}
public static Map<String, Object> splitString(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
List<String> outputList = FastList.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
List<String> outputList = new LinkedList<String>();
String delimiter = UtilFormatOut.checkEmpty((String)context.get("delimiter"), "|");
String inputString = (String)context.get("inputString");
if (UtilValidate.isNotEmpty(inputString)) {
@@ -1089,7 +1088,7 @@ public class ContentServices {
}
public static Map<String, Object> joinString(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
String outputString = null;
String delimiter = UtilFormatOut.checkEmpty((String)context.get("delimiter"), "|");
List<String> inputList = UtilGenerics.checkList(context.get("inputList"));
@@ -1101,8 +1100,8 @@ public class ContentServices {
}
public static Map<String, Object> urlEncodeArgs(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> mapFiltered = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> mapFiltered = new HashMap<String, Object>();
Map<String, Object> mapIn = UtilGenerics.checkMap(context.get("mapIn"));
if (mapIn != null) {
Set<Map.Entry<String, Object>> entrySet = mapIn.entrySet();
@@ -20,13 +20,12 @@ package org.ofbiz.content.content;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilDateTime;
@@ -81,7 +80,7 @@ public class ContentServicesComplex {
}
public static Map<String, Object> getAssocAndContentAndDataResourceMethod(Delegator delegator, String contentId, String mapKey, String direction, Timestamp fromDate, Timestamp thruDate, String fromDateStr, String thruDateStr, List<String> assocTypes, List<String> contentTypes) {
List<EntityCondition> exprList = FastList.newInstance();
List<EntityCondition> exprList = new LinkedList<EntityCondition>();
EntityExpr joinExpr = null;
String viewName = null;
if (mapKey != null) {
@@ -115,7 +114,7 @@ public class ContentServicesComplex {
exprList.add(fromExpr);
}
if (thruDate != null) {
List<EntityExpr> thruList = FastList.newInstance();
List<EntityExpr> thruList = new LinkedList<EntityExpr>();
//thruDate = UtilDateTime.getDayStart(thruDate, daysLater);
EntityExpr thruExpr = EntityCondition.makeCondition("caThruDate", EntityOperator.LESS_THAN, thruDate);
@@ -125,7 +124,7 @@ public class ContentServicesComplex {
EntityConditionList<EntityExpr> thruExprList = EntityCondition.makeCondition(thruList, EntityOperator.OR);
exprList.add(thruExprList);
} else if (fromDate != null) {
List<EntityExpr> thruList = FastList.newInstance();
List<EntityExpr> thruList = new LinkedList<EntityExpr>();
EntityExpr thruExpr = EntityCondition.makeCondition("caThruDate", EntityOperator.GREATER_THAN, fromDate);
thruList.add(thruExpr);
@@ -145,7 +144,7 @@ public class ContentServicesComplex {
GenericValue a = relatedAssocs.get(i);
Debug.logVerbose(" contentId:" + a.get("contentId") + " To:" + a.get("caContentIdTo") + " fromDate:" + a.get("caFromDate") + " thruDate:" + a.get("caThruDate") + " AssocTypeId:" + a.get("caContentAssocTypeId"), null);
}
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
results.put("entityList", relatedAssocs);
return results;
}
@@ -165,7 +164,7 @@ public class ContentServicesComplex {
if (UtilValidate.isNotEmpty(assocTypesString)) {
List<String> lst = StringUtil.split(assocTypesString, "|");
if (assocTypes == null) {
assocTypes = FastList.newInstance();
assocTypes = new LinkedList<String>();
}
assocTypes.addAll(lst);
}
@@ -174,7 +173,7 @@ public class ContentServicesComplex {
if (UtilValidate.isNotEmpty(contentTypesString)) {
List<String> lst = StringUtil.split(contentTypesString, "|");
if (contentTypes == null) {
contentTypes = FastList.newInstance();
contentTypes = new LinkedList<String>();
}
contentTypes.addAll(lst);
}
@@ -248,7 +247,7 @@ public class ContentServicesComplex {
GenericValue contentAssocDataResourceView = null;
GenericValue content = null;
GenericValue dataResource = null;
List<GenericValue> contentAssocDataResourceList = FastList.newInstance();
List<GenericValue> contentAssocDataResourceList = new LinkedList<GenericValue>();
Locale locale = Locale.getDefault(); // TODO: this needs to be passed in
try{
for (GenericValue contentAssocView : contentAssocsTypeFiltered) {
@@ -266,12 +265,12 @@ public class ContentServicesComplex {
contentAssocDataResourceView = delegator.makeValue(viewName);
contentAssocDataResourceView.setAllFields(content, true, null, null);
}
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "contentAssocOut", contentAssoc, contentAssocDataResourceView, FastList.newInstance(), locale);
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "contentAssocOut", contentAssoc, contentAssocDataResourceView, new LinkedList<Object>(), locale);
String dataResourceId = content.getString("dataResourceId");
if (UtilValidate.isNotEmpty(dataResourceId))
dataResource = content.getRelatedOne("DataResource", true);
if (dataResource != null) {
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "dataResourceOut", dataResource, contentAssocDataResourceView, FastList.newInstance(), locale);
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "dataResourceOut", dataResource, contentAssocDataResourceView, new LinkedList<Object>(), locale);
}
contentAssocDataResourceList.add(contentAssocDataResourceView);
}
@@ -284,7 +283,7 @@ public class ContentServicesComplex {
List<String> orderByList = StringUtil.split(orderBy, "|");
contentAssocDataResourceList = EntityUtil.orderBy(contentAssocDataResourceList, orderByList);
}
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
results.put("entityList", contentAssocDataResourceList);
if (UtilValidate.isNotEmpty(contentAssocDataResourceList)) {
results.put("view", contentAssocDataResourceList.get(0));
@@ -24,15 +24,13 @@ import java.io.StringWriter;
import java.io.Writer;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.xml.parsers.ParserConfigurationException;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.BshUtil;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
@@ -220,7 +218,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
String contentId = content.getString("contentId");
if (templateContext == null) {
templateContext = FastMap.newInstance();
templateContext = new HashMap<String, Object>();
}
// create the content facade
@@ -451,27 +449,27 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
contentId = (String) content.get("contentId");
contentTypeId = (String) content.get("contentTypeId");
List<GenericValue> topicList = content.getRelated("ToContentAssoc", UtilMisc.toMap("contentAssocTypeId", "TOPIC"), null, false);
List<String> topics = FastList.newInstance();
List<String> topics = new LinkedList<String>();
for (int i = 0; i < topicList.size(); i++) {
GenericValue assoc = topicList.get(i);
topics.add(assoc.getString("contentId"));
}
List<GenericValue> keywordList = content.getRelated("ToContentAssoc", UtilMisc.toMap("contentAssocTypeId", "KEYWORD"), null, false);
List<String> keywords = FastList.newInstance();
List<String> keywords = new LinkedList<String>();
for (int i = 0; i < keywordList.size(); i++) {
GenericValue assoc = keywordList.get(i);
keywords.add(assoc.getString("contentId"));
}
List<GenericValue> purposeValueList = content.getRelated("ContentPurpose", null, null, true);
List<String> purposes = FastList.newInstance();
List<String> purposes = new LinkedList<String>();
for (int i = 0; i < purposeValueList.size(); i++) {
GenericValue purposeValue = purposeValueList.get(i);
purposes.add(purposeValue.getString("contentPurposeTypeId"));
}
List<String> contentTypeAncestry = FastList.newInstance();
List<String> contentTypeAncestry = new LinkedList<String>();
getContentTypeAncestry(delegator, contentTypeId, contentTypeAncestry);
Map<String, Object> context = FastMap.newInstance();
Map<String, Object> context = new HashMap<String, Object>();
context.put("content", content);
context.put("contentAssocTypeId", contentAssocTypeId);
//context.put("related", related);
@@ -483,13 +481,13 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
boolean isReturnBefore = checkReturnWhen(context, (String) whenMap.get("returnBeforePickWhen"));
Map<String, Object> thisNode = null;
if (isPick || !isReturnBefore) {
thisNode = FastMap.newInstance();
thisNode = new HashMap<String, Object>();
thisNode.put("contentId", contentId);
thisNode.put("contentTypeId", contentTypeId);
thisNode.put("contentAssocTypeId", contentAssocTypeId);
List<Map<String, Object>> kids = UtilGenerics.checkList(masterNode.get("kids"));
if (kids == null) {
kids = FastList.newInstance();
kids = new LinkedList<Map<String,Object>>();
masterNode.put("kids", kids);
}
kids.add(thisNode);
@@ -500,9 +498,9 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
boolean isReturnAfter = checkReturnWhen(context, (String) whenMap.get("returnAfterPickWhen"));
if (!isReturnAfter) {
List<String> assocTypes = FastList.newInstance();
List<String> assocTypes = new LinkedList<String>();
List<GenericValue> relatedAssocs = getContentAssocsWithId(delegator, contentId, fromDate, thruDate, direction, assocTypes);
Map<String, Object> assocContext = FastMap.newInstance();
Map<String, Object> assocContext = new HashMap<String, Object>();
assocContext.put("related", relatedAssocs);
for (GenericValue assocValue : relatedAssocs) {
contentAssocTypeId = (String) assocValue.get("contentAssocTypeId");
@@ -623,7 +621,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static List<Object> getPurposes(GenericValue content) {
List<Object> purposes = FastList.newInstance();
List<Object> purposes = new LinkedList<Object>();
try {
List<GenericValue> purposeValueList = content.getRelated("ContentPurpose", null, null, true);
for (int i = 0; i < purposeValueList.size(); i++) {
@@ -637,7 +635,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static List<Object> getSections(GenericValue content) {
List<Object> sections = FastList.newInstance();
List<Object> sections = new LinkedList<Object>();
try {
List<GenericValue> sectionValueList = content.getRelated("FromContentAssoc", null, null, true);
for (int i = 0; i < sectionValueList.size(); i++) {
@@ -654,7 +652,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static List<Object> getTopics(GenericValue content) {
List<Object> topics = FastList.newInstance();
List<Object> topics = new LinkedList<Object>();
try {
List<GenericValue> topicValueList = content.getRelated("FromContentAssoc", null, null, true);
for (int i = 0; i < topicValueList.size(); i++) {
@@ -678,7 +676,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
String parentContentId = (String) parentContent.get("contentId");
//if (Debug.infoOn()) Debug.logInfo("traverse, contentAssocTypeId:" + contentAssocTypeId,null);
Map<String, Object> whenMap = UtilGenerics.checkMap(ctx.get("whenMap"));
List<Map<String, Object>> kids = FastList.newInstance();
List<Map<String, Object>> kids = new LinkedList<Map<String,Object>>();
currentNode.put("kids", kids);
String direction = (String) ctx.get("direction");
if (UtilValidate.isEmpty(direction)) {
@@ -766,7 +764,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
Debug.logInfo("assocList:" + assocList.size() + " contentId:" + currentContent.getString("contentId"), "");
}
List<GenericValue> contentList = FastList.newInstance();
List<GenericValue> contentList = new LinkedList<GenericValue>();
String contentIdName = "contentId";
if (linkDir != null && linkDir.equalsIgnoreCase("TO")) {
contentIdName = contentIdName.concat("To");
@@ -793,8 +791,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static List<GenericValue> getAssociatedContentView(GenericValue currentContent, String linkDir, List<String> assocTypes, List<String> contentTypes, String fromDate, String thruDate) throws GenericEntityException {
List<GenericValue> contentList = FastList.newInstance();
List<EntityExpr> exprListAnd = FastList.newInstance();
List<EntityExpr> exprListAnd = new LinkedList<EntityExpr>();
String origContentId = (String) currentContent.get("contentId");
String contentIdName = "contentId";
@@ -846,9 +843,8 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
@SuppressWarnings("unchecked")
public static List<GenericValue> getContentAssocsWithId(Delegator delegator, String contentId, Timestamp fromDate, Timestamp thruDate, String direction, List<String> assocTypes) throws GenericEntityException {
List exprList = FastList.newInstance();
List<EntityCondition> exprList = new LinkedList<EntityCondition>();
EntityExpr joinExpr = null;
EntityExpr expr = null;
if (direction != null && direction.equalsIgnoreCase("From")) {
joinExpr = EntityCondition.makeCondition("contentIdTo", EntityOperator.EQUALS, contentId);
} else {
@@ -863,7 +859,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
exprList.add(fromExpr);
}
if (thruDate != null) {
List<EntityExpr> thruList = FastList.newInstance();
List<EntityExpr> thruList = new LinkedList<EntityExpr>();
//thruDate = UtilDateTime.getDayStart(thruDate, daysLater);
EntityExpr thruExpr = EntityCondition.makeCondition("thruDate", EntityOperator.LESS_THAN, thruDate);
@@ -873,7 +869,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
EntityConditionList<EntityExpr> thruExprList = EntityCondition.makeCondition(thruList, EntityOperator.OR);
exprList.add(thruExprList);
} else if (fromDate != null) {
List<EntityExpr> thruList = FastList.newInstance();
List<EntityExpr> thruList = new LinkedList<EntityExpr>();
EntityExpr thruExpr = EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN, fromDate);
thruList.add(thruExpr);
@@ -969,8 +965,8 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static List<Map<String, Object>> getContentAncestryNodeTrail(Delegator delegator, String contentId, String contentAssocTypeId, String direction) throws GenericEntityException {
List<GenericValue> contentAncestorList = FastList.newInstance();
List<Map<String, Object>> nodeTrail = FastList.newInstance();
List<GenericValue> contentAncestorList = new LinkedList<GenericValue>();
List<Map<String, Object>> nodeTrail = new LinkedList<Map<String,Object>>();
getContentAncestry(delegator, contentId, contentAssocTypeId, direction, contentAncestorList);
for (GenericValue value : contentAncestorList) {
Map<String, Object> thisNode = ContentWorker.makeNode(value);
@@ -980,7 +976,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static String getContentAncestryNodeTrailCsv(Delegator delegator, String contentId, String contentAssocTypeId, String direction) throws GenericEntityException {
List<GenericValue> contentAncestorList = FastList.newInstance();
List<GenericValue> contentAncestorList = new LinkedList<GenericValue>();
getContentAncestry(delegator, contentId, contentAssocTypeId, direction, contentAncestorList);
String csv = StringUtil.join(contentAncestorList, ",");
return csv;
@@ -1033,13 +1029,13 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static Map<String, Object> callContentPermissionCheckResult(Delegator delegator, LocalDispatcher dispatcher, Map<String, Object> context) {
Map<String, Object> permResults = FastMap.newInstance();
Map<String, Object> permResults = new HashMap<String, Object>();
String skipPermissionCheck = (String) context.get("skipPermissionCheck");
if (UtilValidate.isEmpty(skipPermissionCheck)
|| (!"true".equalsIgnoreCase(skipPermissionCheck) && !"granted".equalsIgnoreCase(skipPermissionCheck))) {
GenericValue userLogin = (GenericValue) context.get("userLogin");
Map<String, Object> serviceInMap = FastMap.newInstance();
Map<String, Object> serviceInMap = new HashMap<String, Object>();
serviceInMap.put("userLogin", userLogin);
serviceInMap.put("targetOperationList", context.get("targetOperationList"));
serviceInMap.put("contentPurposeList", context.get("contentPurposeList"));
@@ -1143,7 +1139,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
if (UtilValidate.isNotEmpty(trail)) {
passedGlobalNodeTrail = UtilGenerics.checkList(UtilMisc.makeListWritable(trail));
} else {
passedGlobalNodeTrail = FastList.newInstance();
passedGlobalNodeTrail = new LinkedList<Map<String,Object>>();
}
//if (Debug.infoOn()) Debug.logInfo("in getCurrentContent, passedGlobalNodeTrail(3):" + passedGlobalNodeTrail , module);
int sz = passedGlobalNodeTrail.size();
@@ -1208,7 +1204,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static Map<String, Object> buildPickContext(Delegator delegator, String contentAssocTypeId, String assocContentId, String direction, GenericValue thisContent) throws GenericEntityException {
Map<String, Object> ctx = FastMap.newInstance();
Map<String, Object> ctx = new HashMap<String, Object>();
ctx.put("contentAssocTypeId", contentAssocTypeId);
ctx.put("contentId", assocContentId);
// This needs to be the opposite
@@ -1222,7 +1218,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
ctx.put("content", thisContent);
List<Object> purposes = getPurposes(thisContent);
ctx.put("purposes", purposes);
List<String> contentTypeAncestry = FastList.newInstance();
List<String> contentTypeAncestry = new LinkedList<String>();
String contentTypeId = thisContent.getString("contentTypeId");
getContentTypeAncestry(delegator, contentTypeId, contentTypeAncestry);
ctx.put("typeAncestry", contentTypeAncestry);
@@ -1235,14 +1231,14 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static void checkConditions(Delegator delegator, Map<String, Object> trailNode, Map<String, Object> contentAssoc, Map<String, Object> whenMap) {
Map<String, Object> context = FastMap.newInstance();
Map<String, Object> context = new HashMap<String, Object>();
GenericValue content = (GenericValue)trailNode.get("value");
// String contentId = (String)trailNode.get("contentId");
if (contentAssoc == null && content != null && (content.getEntityName().indexOf("Assoc") >= 0)) {
contentAssoc = delegator.makeValue("ContentAssoc");
try {
// TODO: locale needs to be gotten correctly
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "contentAssocIn", content, contentAssoc, FastList.newInstance(), Locale.getDefault());
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "contentAssocIn", content, contentAssoc, new LinkedList(), Locale.getDefault());
context.put("contentAssocTypeId", contentAssoc.get("contentAssocTypeId"));
context.put("contentAssocPredicateId", contentAssoc.get("contentAssocPredicateId"));
context.put("mapKey", contentAssoc.get("mapKey"));
@@ -1263,7 +1259,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
List<Object> topics = getTopics(content);
context.put("topics", topics);
String contentTypeId = (String)content.get("contentTypeId");
List<String> contentTypeAncestry = FastList.newInstance();
List<String> contentTypeAncestry = new LinkedList<String>();
try {
getContentTypeAncestry(delegator, contentTypeId, contentTypeAncestry);
} catch (GenericEntityException e) {
@@ -1297,12 +1293,12 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
if (UtilValidate.isNotEmpty(targetOperationString)) {
List<String> opsFromString = StringUtil.split(targetOperationString, "|");
if (UtilValidate.isEmpty(targetOperationList)) {
targetOperationList = FastList.newInstance();
targetOperationList = new LinkedList<String>();
}
targetOperationList.addAll(opsFromString);
}
if (UtilValidate.isEmpty(targetOperationList)) {
targetOperationList = FastList.newInstance();
targetOperationList = new LinkedList<String>();
if (UtilValidate.isEmpty(md)) {
md ="_CREATE";
}
@@ -1329,12 +1325,12 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
if (UtilValidate.isNotEmpty(contentPurposeString)) {
List<String> purposesFromString = StringUtil.split(contentPurposeString, "|");
if (UtilValidate.isEmpty(contentPurposeList)) {
contentPurposeList = FastList.newInstance();
contentPurposeList = new LinkedList<String>();
}
contentPurposeList.addAll(purposesFromString);
}
if (UtilValidate.isEmpty(contentPurposeList)) {
contentPurposeList = FastList.newInstance();
contentPurposeList = new LinkedList<String>();
}
if (Debug.infoOn()) {
Debug.logInfo("in prepContentPurposeList, contentPurposeList(0):" + contentPurposeList, "");
@@ -1357,7 +1353,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static List<GenericValue> getContentAssocViewList(Delegator delegator, String contentIdTo, String contentId, String contentAssocTypeId, String statusId, String privilegeEnumId) throws GenericEntityException {
List<EntityExpr> exprListAnd = FastList.newInstance();
List<EntityExpr> exprListAnd = new LinkedList<EntityExpr>();
if (UtilValidate.isNotEmpty(contentIdTo)) {
EntityExpr expr = EntityCondition.makeCondition("caContentIdTo", EntityOperator.EQUALS, contentIdTo);
@@ -1406,7 +1402,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
return thisNode;
}
thisNode = FastMap.newInstance();
thisNode = new HashMap<String, Object>();
thisNode.put("value", thisContent);
String contentId = (String)thisContent.get("contentId");
thisNode.put("contentId", contentId);
@@ -1442,29 +1438,25 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static List<List<String>> csvToList(String csv, Delegator delegator) {
List<List<String>> outList = FastList.newInstance();
List<List<String>> outList = new LinkedList<List<String>>();
List<String> contentIdList = StringUtil.split(csv, ",");
GenericValue content = null;
String contentName = null;
List<String> values = null;
for (String contentId : contentIdList) {
try {
content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).cache().queryOne();
} catch (GenericEntityException e) {
Debug.logError(e.getMessage(), module);
return FastList.newInstance();
return new LinkedList<List<String>>();
}
contentName = (String)content.get("contentName");
values = FastList.newInstance();
values.add(contentId);
values.add(contentName);
outList.add(values);
outList.add(UtilMisc.toList(contentId, contentName));
}
return outList;
}
public static List<GenericValue> csvToContentList(String csv, Delegator delegator) {
List<GenericValue> trail = FastList.newInstance();
List<GenericValue> trail = new LinkedList<GenericValue>();
if (csv == null) {
return trail;
}
@@ -1475,7 +1467,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).cache().queryOne();
} catch (GenericEntityException e) {
Debug.logError(e.getMessage(), module);
return FastList.newInstance();
return new LinkedList<GenericValue>();
}
trail.add(content);
}
@@ -1483,7 +1475,7 @@ public class ContentWorker implements org.ofbiz.widget.content.ContentWorkerInte
}
public static List<Map<String, Object>> csvToTrail(String csv, Delegator delegator) {
List<Map<String, Object>> trail = FastList.newInstance();
List<Map<String, Object>> trail = new LinkedList<Map<String,Object>>();
if (csv == null) {
return trail;
}
@@ -18,12 +18,11 @@
*******************************************************************************/
package org.ofbiz.content.content;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
@@ -42,7 +41,7 @@ public class PermissionRecorder {
protected boolean isOn = false;
protected GenericValue userLogin;
protected List<Map<String, Object>> permCheckResults = FastList.newInstance();
protected List<Map<String, Object>> permCheckResults = new LinkedList<Map<String,Object>>();
protected boolean entityPermCheckResult = false;
protected String currentContentId = "";
protected Map<String, Object> currentContentMap;
@@ -127,10 +126,10 @@ public class PermissionRecorder {
public void setCurrentContentId(String id) {
if (!currentContentId.equals(id)) {
currentContentMap = FastMap.newInstance();
currentContentMap = new HashMap<String, Object>();
permCheckResults.add(currentContentMap);
currentContentMap.put("contentId", id);
currentContentMap.put("checkResults", FastList.newInstance());
currentContentMap.put("checkResults", new LinkedList());
}
currentContentId = id;
}
@@ -158,7 +157,7 @@ public class PermissionRecorder {
}
public void startMatchGroup(List<String> targetOperations, List<String> purposes, List<String> roles, List<String> targStatusList, String targPrivilegeEnumId, String contentId) {
currentContentMap = FastMap.newInstance();
currentContentMap = new HashMap<String, Object>();
permCheckResults.add(currentContentMap);
String s = null;
if (targetOperations != null) {
@@ -185,7 +184,7 @@ public class PermissionRecorder {
//if (Debug.infoOn()) Debug.logInfo("startMatchGroup, targStatusList(string):" + s, module);
currentContentMap.put("statusId", s);
}
List<Map<String, Object>> checkResultList = FastList.newInstance();
List<Map<String, Object>> checkResultList = new LinkedList<Map<String,Object>>();
currentContentMap.put("privilegeEnumId", privilegeEnumId);
currentContentMap.put("contentId", contentId);
currentContentMap.put("checkResultList", checkResultList);
@@ -18,6 +18,8 @@
*******************************************************************************/
package org.ofbiz.content.content;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -26,9 +28,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
@@ -95,7 +94,7 @@ public class UploadContentAndImage {
return "error";
}
Map<String, Object> passedParams = FastMap.newInstance();
Map<String, Object> passedParams = new HashMap<String, Object>();
FileItem fi = null;
FileItem imageFi = null;
byte[] imageBytes = {};
@@ -124,7 +123,7 @@ public class UploadContentAndImage {
passedParams.put("targetOperationList", targetOperationList);
// Create or update FTL template
Map<String, Object> ftlContext = FastMap.newInstance();
Map<String, Object> ftlContext = new HashMap<String, Object>();
ftlContext.put("userLogin", userLogin);
ftlContext.put("contentId", passedParams.get("ftlContentId"));
ftlContext.put("ownerContentId", passedParams.get("ownerContentId"));
@@ -155,7 +154,7 @@ public class UploadContentAndImage {
}
String ftlContentId = (String)ftlResults.get("contentId");
if (UtilValidate.isNotEmpty(contentIdTo)) {
Map<String, Object> map = FastMap.newInstance();
Map<String, Object> map = new HashMap<String, Object>();
map.put("fromDate", UtilDateTime.nowTimestamp());
map.put("contentId", ftlContentId);
map.put("contentIdTo", contentIdTo);
@@ -198,7 +197,7 @@ public class UploadContentAndImage {
//if (Debug.infoOn()) Debug.logInfo("[UploadContentAndImage]ftlDataResourceId:" + ftlDataResourceId, module);
// Create or update summary text subContent
if (passedParams.containsKey("summaryData")) {
Map<String, Object> sumContext = FastMap.newInstance();
Map<String, Object> sumContext = new HashMap<String, Object>();
sumContext.put("userLogin", userLogin);
sumContext.put("contentId", passedParams.get("sumContentId"));
sumContext.put("ownerContentId", ftlContentId);
@@ -228,7 +227,7 @@ public class UploadContentAndImage {
// Create or update electronic text subContent
if (passedParams.containsKey("textData")) {
Map<String, Object> txtContext = FastMap.newInstance();
Map<String, Object> txtContext = new HashMap<String, Object>();
txtContext.put("userLogin", userLogin);
txtContext.put("contentId", passedParams.get("txtContentId"));
txtContext.put("ownerContentId", ftlContentId);
@@ -257,7 +256,7 @@ public class UploadContentAndImage {
}
// Create or update image subContent
Map<String, Object> imgContext = FastMap.newInstance();
Map<String, Object> imgContext = new HashMap<String, Object>();
if (imageBytes.length > 0) {
imgContext.put("userLogin", userLogin);
imgContext.put("contentId", passedParams.get("imgContentId"));
@@ -362,7 +361,7 @@ public class UploadContentAndImage {
return "error";
}
Map<String, Object> passedParams = FastMap.newInstance();
Map<String, Object> passedParams = new HashMap<String, Object>();
FileItem fi = null;
FileItem imageFi = null;
byte[] imageBytes = {};
@@ -433,7 +432,7 @@ public class UploadContentAndImage {
Delegator delegator = (Delegator)request.getAttribute("delegator");
HttpSession session = request.getSession();
GenericValue userLogin = (GenericValue)session.getAttribute("userLogin");
Map<String, Object> ftlContext = FastMap.newInstance();
Map<String, Object> ftlContext = new HashMap<String, Object>();
String contentPurposeString = (String)passedParams.get("contentPurposeString" + suffix);
if (UtilValidate.isEmpty(contentPurposeString)) {
@@ -463,8 +462,8 @@ public class UploadContentAndImage {
ModelEntity modelEntity = delegator.getModelEntity("ContentAssocDataResourceViewFrom");
List<String> fieldNames = modelEntity.getAllFieldNames();
Map<String, Object> ftlContext2 = FastMap.newInstance();
Map<String, Object> ftlContext3 = FastMap.newInstance();
Map<String, Object> ftlContext2 = new HashMap<String, Object>();
Map<String, Object> ftlContext3 = new HashMap<String, Object>();
for (String keyName : fieldNames) {
Object obj = passedParams.get(keyName + suffix);
ftlContext2.put(keyName, obj);
@@ -472,17 +471,17 @@ public class UploadContentAndImage {
if (Debug.infoOn()) {
Debug.logInfo("[UploadContentStuff]ftlContext2:" + ftlContext2, module);
}
List<Object> errorMessages = FastList.newInstance();
List<Object> errorMessages = new LinkedList<Object>();
Locale loc = Locale.getDefault();
try {
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "contentIn", ftlContext2, ftlContext3, errorMessages, loc);
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "contentOut", ftlContext3, ftlContext, errorMessages, loc);
ftlContext3 = FastMap.newInstance();
ftlContext3 = new HashMap<String, Object>();
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "dataResourceIn", ftlContext2, ftlContext3, errorMessages, loc);
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "dataResourceOut", ftlContext3, ftlContext, errorMessages, loc);
ftlContext3 = FastMap.newInstance();
ftlContext3 = new HashMap<String, Object>();
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "contentAssocIn", ftlContext2, ftlContext3, errorMessages, loc);
SimpleMapProcessor.runSimpleMapProcessor("component://content/script/org/ofbiz/content/ContentManagementMapProcessors.xml", "contentAssocOut", ftlContext3, ftlContext, errorMessages, loc);
} catch (MiniLangException e) {
@@ -512,7 +511,7 @@ public class UploadContentAndImage {
Debug.logInfo("[UploadContentStuff]msg:" + msg, module);
}
if (errorMsgList == null) {
errorMsgList = FastList.newInstance();
errorMsgList = new LinkedList<String>();
request.setAttribute("errorMessageList", errorMsgList);
}
errorMsgList.add(msg);
@@ -523,7 +522,7 @@ public class UploadContentAndImage {
request.setAttribute("_ERROR_MESSAGE_", msg);
List<String> errorMsgList = UtilGenerics.checkList(request.getAttribute("_EVENT_MESSAGE_LIST_"));
if (errorMsgList == null) {
errorMsgList = FastList.newInstance();
errorMsgList = new LinkedList<String>();
request.setAttribute("errorMessageList", errorMsgList);
}
errorMsgList.add(msg);
@@ -543,7 +542,7 @@ public class UploadContentAndImage {
String caContentIdTo = (String)passedParams.get("caContentIdTo");
if (UtilValidate.isNotEmpty(caContentIdTo)) {
Map<String, Object> resequenceContext = FastMap.newInstance();
Map<String, Object> resequenceContext = new HashMap<String, Object>();
resequenceContext.put("contentIdTo", caContentIdTo);
resequenceContext.put("userLogin", userLogin);
try {
@@ -559,7 +558,7 @@ public class UploadContentAndImage {
Debug.logInfo("[UploadContentStuff]msg:" + msg, module);
}
if (errorMsgList == null) {
errorMsgList = FastList.newInstance();
errorMsgList = new LinkedList<String>();
request.setAttribute("errorMessageList", errorMsgList);
}
errorMsgList.add(msg);
@@ -33,6 +33,8 @@ import java.net.URL;
import java.net.URLConnection;
import java.nio.ByteBuffer;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -43,9 +45,6 @@ import javax.servlet.http.HttpSession;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
@@ -119,11 +118,11 @@ public class DataResourceWorker implements org.ofbiz.widget.content.DataResourc
.where("parentCategoryId", parentCategoryId)
.cache().queryList();
categoryNode.put("count", Integer.valueOf(categoryValues.size()));
List<Map<String, Object>> subCategoryIds = FastList.newInstance();
List<Map<String, Object>> subCategoryIds = new LinkedList<Map<String,Object>>();
for (GenericValue category : categoryValues) {
String id = (String) category.get("dataCategoryId");
String categoryName = (String) category.get("categoryName");
Map<String, Object> newNode = FastMap.newInstance();
Map<String, Object> newNode = new HashMap<String, Object>();
newNode.put("id", id);
newNode.put("name", categoryName);
errorMsg = getDataCategoryMap(delegator, depth + 1, newNode, categoryTypeIds, getAll);
@@ -171,7 +170,7 @@ public class DataResourceWorker implements org.ofbiz.widget.content.DataResourc
String spc = "";
for (int i = 0; i < depth; i++)
spc += "&nbsp;&nbsp;";
Map<String, Object> map = FastMap.newInstance();
Map<String, Object> map = new HashMap<String, Object>();
map.put("dataCategoryId", id);
map.put("categoryName", spc + nm);
if (id != null && !id.equals("ROOT") && !id.equals("")) {
@@ -214,7 +213,7 @@ public class DataResourceWorker implements org.ofbiz.widget.content.DataResourc
FileItem fi = null;
FileItem imageFi = null;
String imageFileName = null;
Map<String, Object> passedParams = FastMap.newInstance();
Map<String, Object> passedParams = new HashMap<String, Object>();
HttpSession session = request.getSession();
GenericValue userLogin = (GenericValue)session.getAttribute("userLogin");
passedParams.put("userLogin", userLogin);
@@ -290,14 +289,14 @@ public class DataResourceWorker implements org.ofbiz.widget.content.DataResourc
*/
public static Map<String, Object> callDataResourcePermissionCheckResult(Delegator delegator, LocalDispatcher dispatcher, Map<String, Object> context) {
Map<String, Object> permResults = FastMap.newInstance();
Map<String, Object> permResults = new HashMap<String, Object>();
String skipPermissionCheck = (String) context.get("skipPermissionCheck");
if (Debug.infoOn()) Debug.logInfo("in callDataResourcePermissionCheckResult, skipPermissionCheck:" + skipPermissionCheck,"");
if (UtilValidate.isEmpty(skipPermissionCheck)
|| (!"true".equalsIgnoreCase(skipPermissionCheck) && !"granted".equalsIgnoreCase(skipPermissionCheck))) {
GenericValue userLogin = (GenericValue) context.get("userLogin");
Map<String, Object> serviceInMap = FastMap.newInstance();
Map<String, Object> serviceInMap = new HashMap<String, Object>();
serviceInMap.put("userLogin", userLogin);
serviceInMap.put("targetOperationList", context.get("targetOperationList"));
serviceInMap.put("contentPurposeList", context.get("contentPurposeList"));
@@ -391,7 +390,7 @@ public class DataResourceWorker implements org.ofbiz.widget.content.DataResourc
}
public static String buildRequestPrefix(Delegator delegator, Locale locale, String webSiteId, String https) {
Map<String, Object> prefixValues = FastMap.newInstance();
Map<String, Object> prefixValues = new HashMap<String, Object>();
String prefix;
NotificationServices.setBaseUrl(delegator, webSiteId, prefixValues);
@@ -612,7 +611,7 @@ public class DataResourceWorker implements org.ofbiz.widget.content.DataResourc
throw new GeneralException("Cannot lookup data resource with for a null dataResourceId");
}
if (templateContext == null) {
templateContext = FastMap.newInstance();
templateContext = new HashMap<String, Object>();
}
if (UtilValidate.isEmpty(targetMimeTypeId)) {
targetMimeTypeId = "text/html";
@@ -731,7 +730,7 @@ public class DataResourceWorker implements org.ofbiz.widget.content.DataResourc
// prepare the map for preRenderedContent
String textData = (String) context.get("textData");
if (UtilValidate.isNotEmpty(textData)) {
Map<String, Object> prc = FastMap.newInstance();
Map<String, Object> prc = new HashMap<String, Object>();
String mapKey = (String) context.get("mapKey");
if (mapKey != null) {
prc.put(mapKey, mapKey);
@@ -794,7 +793,7 @@ public class DataResourceWorker implements org.ofbiz.widget.content.DataResourc
Delegator delegator, Appendable out, boolean cache) throws IOException, GeneralException {
Map<String, Object> context = UtilGenerics.checkMap(templateContext.get("context"));
if (context == null) {
context = FastMap.newInstance();
context = new HashMap<String, Object>();
}
String webSiteId = (String) templateContext.get("webSiteId");
if (UtilValidate.isEmpty(webSiteId)) {
@@ -908,7 +907,7 @@ public class DataResourceWorker implements org.ofbiz.widget.content.DataResourc
if (mimeTypeTemplate != null && mimeTypeTemplate.get("templateLocation") != null) {
// prepare the context
Map<String, Object> mimeContext = FastMap.newInstance();
Map<String, Object> mimeContext = new HashMap<String, Object>();
mimeContext.putAll(context);
mimeContext.put("dataResource", dataResource);
mimeContext.put("textData", textData);
@@ -28,11 +28,10 @@ import java.io.StringWriter;
import java.io.Writer;
import java.nio.ByteBuffer;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
@@ -75,7 +74,7 @@ public class DataServices {
*/
public static Map<String, Object> createDataResourceAndText(DispatchContext dctx, Map<String, ? extends Object> rcontext) {
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> thisResult = createDataResourceMethod(dctx, context);
if (thisResult.get(ModelService.RESPONSE_MESSAGE) != null) {
@@ -106,7 +105,7 @@ public class DataServices {
public static Map<String, Object> createDataResourceMethod(DispatchContext dctx, Map<String, ? extends Object> rcontext) {
Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
GenericValue userLogin = (GenericValue) context.get("userLogin");
String userLoginId = (String) userLogin.get("userLoginId");
@@ -167,7 +166,7 @@ public class DataServices {
}
public static Map<String, Object> createElectronicTextMethod(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
String dataResourceId = (String) context.get("dataResourceId");
String textData = (String) context.get("textData");
@@ -300,7 +299,7 @@ public class DataServices {
}
public static Map<String, Object> updateDataResourceMethod(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
GenericValue dataResource = null;
Locale locale = (Locale) context.get("locale");
@@ -349,7 +348,7 @@ public class DataServices {
* @return update the ElectronicText
*/
public static Map<String, Object> updateElectronicTextMethod(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
GenericValue electronicText = null;
Locale locale = (Locale) context.get("locale");
@@ -398,7 +397,7 @@ public class DataServices {
}
public static Map<String, Object> updateFileMethod(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
//GenericValue fileText = null;
Locale locale = (Locale) context.get("locale");
//String dataResourceId = (String) dataResource.get("dataResourceId");
@@ -470,7 +469,7 @@ public class DataServices {
}
public static Map<String, Object> renderDataResourceAsText(DispatchContext dctx, Map<String, ? extends Object> context) throws GeneralException, IOException {
Map<String, Object> results = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
//LocalDispatcher dispatcher = dctx.getDispatcher();
Writer out = (Writer) context.get("outWriter");
@@ -488,7 +487,7 @@ public class DataServices {
Locale locale = (Locale) context.get("locale");
if (templateContext == null) {
templateContext = FastMap.newInstance();
templateContext = new HashMap<String, Object>();
}
// GenericValue view = (GenericValue) context.get("subContentDataResourceView");
@@ -513,7 +512,7 @@ public class DataServices {
}
public static Map<String, Object> updateImageMethod(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
//Locale locale = (Locale) context.get("locale");
String dataResourceId = (String) context.get("dataResourceId");
@@ -548,7 +547,7 @@ public class DataServices {
}
public static Map<String, Object> createImageMethod(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
String dataResourceId = (String) context.get("dataResourceId");
ByteBuffer byteBuffer = (ByteBuffer)context.get("imageData");
@@ -584,7 +583,7 @@ public class DataServices {
}
public static Map<String, Object> createBinaryFileMethod(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
GenericValue dataResource = (GenericValue) context.get("dataResource");
//String dataResourceId = (String) dataResource.get("dataResourceId");
String dataResourceTypeId = (String) dataResource.get("dataResourceTypeId");
@@ -641,7 +640,7 @@ public class DataServices {
}
public static Map<String, Object> updateBinaryFileMethod(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
GenericValue dataResource = (GenericValue) context.get("dataResource");
//String dataResourceId = (String) dataResource.get("dataResourceId");
String dataResourceTypeId = (String) dataResource.get("dataResourceTypeId");
@@ -21,6 +21,8 @@ package org.ofbiz.content.layout;
import java.nio.ByteBuffer;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -29,9 +31,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilGenerics;
@@ -69,7 +68,7 @@ public class LayoutEvents {
Map<String, Object> uploadResults = LayoutWorker.uploadImageAndParameters(request, "imageData");
//Debug.logVerbose("in createLayoutImage(java), uploadResults:" + uploadResults, "");
Map<String, Object> formInput = UtilGenerics.checkMap(uploadResults.get("formInput"));
Map<String, Object> context = FastMap.newInstance();
Map<String, Object> context = new HashMap<String, Object>();
ByteBuffer byteWrap = (ByteBuffer) uploadResults.get("imageData");
if (byteWrap == null) {
String errMsg = UtilProperties.getMessage(LayoutEvents.err_resource, "layoutEvents.image_data_null", locale);
@@ -87,7 +86,7 @@ public class LayoutEvents {
}
}
String mimeTypeId = "image/" + imageFileNameExt;
List<Object> errorMessages = FastList.newInstance();
List<Object> errorMessages = new LinkedList<Object>();
if (locale == null) {
locale = Locale.getDefault();
}
@@ -120,7 +119,7 @@ public class LayoutEvents {
String dataResourceId = (String) result.get("dataResourceId");
String activeContentId = (String) result.get("contentId");
if (UtilValidate.isNotEmpty(activeContentId)) {
Map<String, Object> context2 = FastMap.newInstance();
Map<String, Object> context2 = new HashMap<String, Object>();
context2.put("activeContentId", activeContentId);
//context2.put("dataResourceId", dataResourceId);
context2.put("contentAssocTypeId", result.get("contentAssocTypeId"));
@@ -228,7 +227,7 @@ public class LayoutEvents {
LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
HttpSession session = request.getSession();
Locale locale = UtilHttp.getLocale(request);
Map<String, Object> context = FastMap.newInstance();
Map<String, Object> context = new HashMap<String, Object>();
Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
Debug.logVerbose("in replaceSubContent, paramMap:" + paramMap, module);
String dataResourceId = (String) paramMap.get("dataResourceId");
@@ -277,7 +276,7 @@ public class LayoutEvents {
Map<String, Object> result = dispatcher.runSync("persistContentAndAssoc", context);
//Debug.logVerbose("in replaceSubContent, result:" + result, module);
request.setAttribute("contentId", contentIdTo);
Map<String, Object> context2 = FastMap.newInstance();
Map<String, Object> context2 = new HashMap<String, Object>();
context2.put("activeContentId", contentId);
//context2.put("dataResourceId", dataResourceId);
context2.put("contentAssocTypeId", "SUB_CONTENT");
@@ -369,7 +368,7 @@ public class LayoutEvents {
request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
return "error";
}
Map<String, Object> serviceIn = FastMap.newInstance();
Map<String, Object> serviceIn = new HashMap<String, Object>();
Map<String, Object> results = null;
serviceIn.put("fromDate", UtilDateTime.nowTimestamp());
serviceIn.put("contentId", contentId);
@@ -389,14 +388,14 @@ public class LayoutEvents {
return "error";
}
serviceIn = FastMap.newInstance();
serviceIn = new HashMap<String, Object>();
serviceIn.put("userLogin", session.getAttribute("userLogin"));
// Can't count on records being unique
Map<String, GenericValue> beenThere = FastMap.newInstance();
Map<String, GenericValue> beenThere = new HashMap<String, GenericValue>();
for (int i=0; i<entityList.size(); i++) {
GenericValue view = entityList.get(i);
List<Object> errorMessages = FastList.newInstance();
List<Object> errorMessages = new LinkedList<Object>();
if (locale == null) {
locale = Locale.getDefault();
}
@@ -450,7 +449,7 @@ public class LayoutEvents {
Debug.logVerbose("in createSubContent, contentIdTo:" + contentIdTo, module);
Debug.logVerbose("in createSubContent, mapKey:" + mapKey, module);
}
Map<String, Object> context = FastMap.newInstance();
Map<String, Object> context = new HashMap<String, Object>();
List<Object> errorMessages = null;
Locale loc = (Locale) request.getSession().getServletContext().getAttribute("locale");
if (loc == null) {
@@ -497,7 +496,7 @@ public class LayoutEvents {
request.setAttribute("contentId", contentId);
request.setAttribute("drDataResourceId", dataResourceId);
request.setAttribute("currentEntityName", "SubContentDataResourceId");
Map<String, Object> context2 = FastMap.newInstance();
Map<String, Object> context2 = new HashMap<String, Object>();
context2.put("activeContentId", contentId);
//context2.put("dataResourceId", dataResourceId);
context2.put("contentAssocTypeId", "SUB_CONTENT");
@@ -522,7 +521,7 @@ public class LayoutEvents {
Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
// String contentIdTo = (String) paramMap.get("contentIdTo");
// String mapKey = (String) paramMap.get("mapKey");
Map<String, Object> context = FastMap.newInstance();
Map<String, Object> context = new HashMap<String, Object>();
List<Object> errorMessages = null;
Locale loc = (Locale) request.getSession().getServletContext().getAttribute("locale");
if (loc == null) {
@@ -563,7 +562,7 @@ public class LayoutEvents {
request.setAttribute("drDataResourceId", dataResourceId);
request.setAttribute("currentEntityName", "SubContentDataResourceId");
/*
Map context2 = FastMap.newInstance();
Map context2 = new HashMap<String, Object>();
context2.put("activeContentId", contentId);
//context2.put("dataResourceId", dataResourceId);
context2.put("contentAssocTypeId", "SUB_CONTENT");
@@ -20,14 +20,13 @@ package org.ofbiz.content.layout;
import java.io.File;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javolution.util.FastMap;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
@@ -56,8 +55,8 @@ public class LayoutWorker {
//Debug.logVerbose("in uploadAndStoreImage", "");
Locale locale = UtilHttp.getLocale(request);
Map<String, Object> results = FastMap.newInstance();
Map<String, String> formInput = FastMap.newInstance();
Map<String, Object> results = new HashMap<String, Object>();
Map<String, String> formInput = new HashMap<String, String>();
results.put("formInput", formInput);
ServletFileUpload fu = new ServletFileUpload(new DiskFileItemFactory(10240, new File(new File("runtime"), "tmp")));
List<FileItem> lst = null;
@@ -26,6 +26,7 @@ import java.io.InputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -47,8 +48,6 @@ import javax.print.attribute.PrintServiceAttributeSet;
import javax.print.attribute.standard.PrinterName;
import javax.xml.transform.stream.StreamSource;
import javolution.util.FastMap;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.MimeConstants;
import org.ofbiz.base.util.Debug;
@@ -87,7 +86,7 @@ public class OutputServices {
String printerContentType = (String) serviceContext.remove("printerContentType");
if (UtilValidate.isEmpty(screenContext)) {
screenContext = FastMap.newInstance();
screenContext = new HashMap<String, Object>();
}
screenContext.put("locale", locale);
if (UtilValidate.isEmpty(contentType)) {
@@ -200,7 +199,7 @@ public class OutputServices {
String fileName = (String) serviceContext.remove("fileName");
if (UtilValidate.isEmpty(screenContext)) {
screenContext = FastMap.newInstance();
screenContext = new HashMap<String, Object>();
}
screenContext.put("locale", locale);
if (UtilValidate.isEmpty(contentType)) {
@@ -26,14 +26,13 @@ import java.io.IOException;
import java.nio.ByteBuffer;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
@@ -308,7 +307,7 @@ public class PdfSurveyServices {
/**
*/
public static Map<String, Object> getAcroFieldsFromPdf(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> acroFieldMap = FastMap.newInstance();
Map<String, Object> acroFieldMap = new HashMap<String, Object>();
try {
ByteArrayOutputStream os = new ByteArrayOutputStream();
Delegator delegator = dctx.getDelegator();
@@ -488,7 +487,7 @@ public class PdfSurveyServices {
//LocalDispatcher dispatcher = dctx.getDispatcher();
Map<String, Object> results = ServiceUtil.returnSuccess();
String surveyResponseId = (String)context.get("surveyResponseId");
List<Object> qAndA = FastList.newInstance();
List<Object> qAndA = new LinkedList<Object>();
try {
List<GenericValue> responses = EntityQuery.use(delegator).from("SurveyResponseAnswer").where("surveyResponseId", surveyResponseId).queryList();
@@ -512,7 +511,7 @@ public class PdfSurveyServices {
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Map<String, Object> results = ServiceUtil.returnSuccess();
Map<String, Object> acroFieldMap = FastMap.newInstance();
Map<String, Object> acroFieldMap = new HashMap<String, Object>();
String surveyResponseId = (String)context.get("surveyResponseId");
String acroFormContentId = null;
@@ -25,14 +25,13 @@ import java.io.StringWriter;
import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import javolution.util.FastSet;
import org.ofbiz.base.location.FlexibleLocation;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
@@ -101,7 +100,7 @@ public class SurveyWrapper {
*/
public void setPassThru(Map<String, Object> passThru) {
if (passThru != null) {
this.passThru = FastMap.newInstance();
this.passThru = new HashMap<String, Object>();
this.passThru.putAll(passThru);
}
}
@@ -112,7 +111,7 @@ public class SurveyWrapper {
*/
public void setDefaultValues(Map<String, Object> defaultValues) {
if (defaultValues != null) {
this.defaultValues = FastMap.newInstance();
this.defaultValues = new HashMap<String, Object>();
this.defaultValues.putAll(defaultValues);
}
}
@@ -124,7 +123,7 @@ public class SurveyWrapper {
*/
public void addToTemplateContext(String name, Object value) {
if (templateContext == null) {
templateContext = FastMap.newInstance();
templateContext = new HashMap<String, Object>();
}
templateContext.put(name, value);
}
@@ -179,7 +178,7 @@ public class SurveyWrapper {
currentAnswers = this.getResponseAnswers(null);
}
Map<String, Object> sqaaWithColIdListByMultiRespId = FastMap.newInstance();
Map<String, Object> sqaaWithColIdListByMultiRespId = new HashMap<String, Object>();
for (GenericValue surveyQuestionAndAppl : surveyQuestionAndAppls) {
String surveyMultiRespColId = surveyQuestionAndAppl.getString("surveyMultiRespColId");
if (UtilValidate.isNotEmpty(surveyMultiRespColId)) {
@@ -189,7 +188,7 @@ public class SurveyWrapper {
}
if (templateContext == null) {
templateContext = FastMap.newInstance();
templateContext = new HashMap<String, Object>();
}
templateContext.put("partyId", partyId);
@@ -197,7 +196,7 @@ public class SurveyWrapper {
templateContext.put("surveyResults", results);
templateContext.put("surveyQuestionAndAppls", surveyQuestionAndAppls);
templateContext.put("sqaaWithColIdListByMultiRespId", sqaaWithColIdListByMultiRespId);
templateContext.put("alreadyShownSqaaPkWithColId", FastSet.newInstance());
templateContext.put("alreadyShownSqaaPkWithColId", new HashSet());
templateContext.put("surveyAnswers", currentAnswers);
templateContext.put("surveyResponseId", responseId);
templateContext.put("sequenceSort", UtilMisc.toList("sequenceNum"));
@@ -283,7 +282,7 @@ public class SurveyWrapper {
// returns a list of SurveyQuestions (in order by sequence number) for the current Survey
public List<GenericValue> getSurveyQuestionAndAppls() {
List<GenericValue> questions = FastList.newInstance();
List<GenericValue> questions = new LinkedList<GenericValue>();
try {
questions = EntityQuery.use(delegator).from("SurveyQuestionAndAppl")
@@ -355,7 +354,7 @@ public class SurveyWrapper {
// returns a Map of answers keyed on SurveyQuestion ID from the most current SurveyResponse ID
public Map<String, Object> getResponseAnswers(String responseId) throws SurveyWrapperException {
Map<String, Object> answerMap = FastMap.newInstance();
Map<String, Object> answerMap = new HashMap<String, Object>();
if (responseId != null) {
List<GenericValue> answers = null;
@@ -378,7 +377,7 @@ public class SurveyWrapper {
if (key.toUpperCase().startsWith("ANSWERS_")) {
int splitIndex = key.indexOf('_');
String questionId = key.substring(splitIndex+1);
Map<String, Object> thisAnswer = FastMap.newInstance();
Map<String, Object> thisAnswer = new HashMap<String, Object>();
String answer = (String) passThru.remove(key);
thisAnswer.put("booleanResponse", answer);
thisAnswer.put("currencyResponse", answer);
@@ -432,7 +431,7 @@ public class SurveyWrapper {
}
public Map<String, Object> getResults(List<GenericValue> questions) throws SurveyWrapperException {
Map<String, Object> questionResults = FastMap.newInstance();
Map<String, Object> questionResults = new HashMap<String, Object>();
if (questions != null) {
for (GenericValue question : questions) {
Map<String, Object> results = getResultInfo(question);
@@ -446,7 +445,7 @@ public class SurveyWrapper {
// returns a map of question reqsults
public Map<String, Object> getResultInfo(GenericValue question) throws SurveyWrapperException {
Map<String, Object> resultMap = FastMap.newInstance();
Map<String, Object> resultMap = new HashMap<String, Object>();
// special keys in the result:
// "_q_type" - question type (SurveyQuestionTypeId)
@@ -477,7 +476,7 @@ public class SurveyWrapper {
// create the map of option info ("_total", "_percent")
for (String optId : thisResult.keySet()) {
Map<String, Object> optMap = FastMap.newInstance();
Map<String, Object> optMap = new HashMap<String, Object>();
Long optTotal = (Long) thisResult.get(optId);
if (optTotal == null) {
optTotal = Long.valueOf(0);
@@ -671,7 +670,7 @@ public class SurveyWrapper {
}
private Map<String, Object> getOptionResult(GenericValue question) throws SurveyWrapperException {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
long total = 0;
boolean beganTransaction = false;
@@ -20,14 +20,13 @@ package org.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilGenerics;
@@ -96,7 +95,7 @@ public class CheckPermissionTransform implements TemplateTransformModel {
FreeMarkerWorker.overrideWithArgs(templateCtx, args);
final String mode = (String)templateCtx.get("mode");
final String quickCheckContentId = (String)templateCtx.get("quickCheckContentId");
final Map<String, Object> savedValues = FastMap.newInstance();
final Map<String, Object> savedValues = new HashMap<String, Object>();
//Debug.logInfo("in CheckPermission, contentId(1):" + templateCtx.get("contentId"),"");
//Debug.logInfo("in CheckPermission, subContentId(1):" + templateCtx.get("subContentId"),"");
@@ -151,7 +150,7 @@ public class CheckPermissionTransform implements TemplateTransformModel {
String passedStatusId = (String)templateCtx.get("statusId");
List<String> statusList = StringUtil.split(passedStatusId, "|");
if (statusList == null) {
statusList = FastList.newInstance();
statusList = new LinkedList<String>();
}
if (UtilValidate.isNotEmpty(statusId) && !statusList.contains(statusId)) {
statusList.add(statusId);
@@ -171,7 +170,7 @@ public class CheckPermissionTransform implements TemplateTransformModel {
//Debug.logInfo("in CheckPermission, templateCtx:" + templateCtx,"");
throw new IOException("targetOperationList has zero size.");
}
List<String> roleList = FastList.newInstance();
List<String> roleList = new LinkedList<String>();
String privilegeEnumId = (String)currentContent.get("privilegeEnumId");
Map<String, Object> results = EntityPermissionChecker.checkPermission(currentContent, statusList, userLogin, purposeList, targetOperationList, roleList, delegator, security, entityOperation, privilegeEnumId, quickCheckContentId);
@@ -20,14 +20,13 @@ package org.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilGenerics;
@@ -127,7 +126,7 @@ public class EditRenderSubContentCacheTransform implements TemplateTransformMode
templateCtx.put("dataResourceId", dataResourceId);
templateCtx.put("subContentIdSub", subContentIdSub);
templateCtx.put("subDataResourceTypeId", subDataResourceTypeId);
final Map<String, Object> savedValues = FastMap.newInstance();
final Map<String, Object> savedValues = new HashMap<String, Object>();
FreeMarkerWorker.saveContextValues(templateCtx, saveKeyNames, savedValues);
return new Writer(out) {
@@ -21,15 +21,14 @@ package org.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.StringUtil;
@@ -94,9 +93,9 @@ public class LimitedSubContentCacheTransform implements TemplateTransformModel {
final Delegator delegator = FreeMarkerWorker.getWrappedObject("delegator", env);
final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env);
FreeMarkerWorker.getSiteParameters(request, templateRoot);
final Map<String, Object> savedValuesUp = FastMap.newInstance();
final Map<String, Object> savedValuesUp = new HashMap<String, Object>();
FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp);
final Map<String, Object> savedValues = FastMap.newInstance();
final Map<String, Object> savedValues = new HashMap<String, Object>();
FreeMarkerWorker.overrideWithArgs(templateRoot, args);
String contentAssocTypeId = (String) templateRoot.get("contentAssocTypeId");
@@ -105,7 +104,7 @@ public class LimitedSubContentCacheTransform implements TemplateTransformModel {
templateRoot.put("contentAssocTypeId ", contentAssocTypeId);
}
final Map<String, GenericValue> pickedEntityIds = FastMap.newInstance();
final Map<String, GenericValue> pickedEntityIds = new HashMap<String, GenericValue>();
List<String> assocTypes = StringUtil.split(contentAssocTypeId, "|");
String contentPurposeTypeId = (String) templateRoot.get("contentPurposeTypeId");
@@ -117,7 +116,7 @@ public class LimitedSubContentCacheTransform implements TemplateTransformModel {
templateRoot.put("locale", locale);
}
Map<String, Object> whenMap = FastMap.newInstance();
Map<String, Object> whenMap = new HashMap<String, Object>();
whenMap.put("followWhen", templateRoot.get("followWhen"));
whenMap.put("pickWhen", templateRoot.get("pickWhen"));
whenMap.put("returnBeforePickWhen", templateRoot.get("returnBeforePickWhen"));
@@ -266,7 +265,7 @@ public class LimitedSubContentCacheTransform implements TemplateTransformModel {
isPickObj.booleanValue()) || (isFollowObj != null && isFollowObj.booleanValue()))) {
List<Map<String, ? extends Object>> globalNodeTrail = UtilGenerics.checkList(ctx.get("globalNodeTrail"));
if (globalNodeTrail == null) {
globalNodeTrail = FastList.newInstance();
globalNodeTrail = new LinkedList<Map<String,? extends Object>>();
}
globalNodeTrail.add(trailNode);
ctx.put("globalNodeTrail", globalNodeTrail);
@@ -61,11 +61,11 @@ public class RenderContentAndSubContent implements TemplateTransformModel {
((MapStack)templateRoot).push(envMap);
if (Debug.verboseOn()) Debug.logVerbose("in RenderContentAndSubContent, contentId(0):" + templateRoot.get("contentId"), module);
FreeMarkerWorker.getSiteParameters(request, templateRoot);
// final Map savedValuesUp = FastMap.newInstance();
// final Map savedValuesUp = new HashMap<String, Object>();
// FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp);
FreeMarkerWorker.overrideWithArgs(templateRoot, args);
// final Map<String, Object> savedValues = FastMap.newInstance();
// final Map<String, Object> savedValues = new HashMap<String, Object>();
return new Writer(out) {
@@ -20,6 +20,7 @@ package org.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -28,8 +29,6 @@ import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilFormatOut;
@@ -61,7 +60,7 @@ public class RenderContentAsText implements TemplateTransformModel {
public Writer getWriter(final Writer out, Map args) {
final Environment env = Environment.getCurrentEnvironment();
//final Map templateCtx = FreeMarkerWorker.getWrappedObject("context", env);
//final Map templateCtx = FastMap.newInstance();
//final Map templateCtx = new HashMap<String, Object>();
final LocalDispatcher dispatcher = FreeMarkerWorker.getWrappedObject("dispatcher", env);
final Delegator delegator = FreeMarkerWorker.getWrappedObject("delegator", env);
final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env);
@@ -71,7 +70,7 @@ public class RenderContentAsText implements TemplateTransformModel {
Debug.logVerbose("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module);
}
FreeMarkerWorker.getSiteParameters(request, templateRoot);
final Map<String, Object> savedValuesUp = FastMap.newInstance();
final Map<String, Object> savedValuesUp = new HashMap<String, Object>();
FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp);
FreeMarkerWorker.overrideWithArgs(templateRoot, args);
if (Debug.verboseOn()) {
@@ -130,7 +129,7 @@ public class RenderContentAsText implements TemplateTransformModel {
templateRoot.put("subDataResourceTypeId", subDataResourceTypeId);
*/
final Map<String, Object> savedValues = FastMap.newInstance();
final Map<String, Object> savedValues = new HashMap<String, Object>();
return new Writer(out) {
@@ -20,14 +20,13 @@ package org.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilFormatOut;
@@ -58,7 +57,7 @@ public class RenderSubContentAsText implements TemplateTransformModel {
public Writer getWriter(final Writer out, Map args) {
final Environment env = Environment.getCurrentEnvironment();
// final Map templateCtx = FreeMarkerWorker.getWrappedObject("context", env);
// final Map templateCtx = FastMap.newInstance();
// final Map templateCtx = new HashMap<String, Object>();
final LocalDispatcher dispatcher = FreeMarkerWorker.getWrappedObject("dispatcher", env);
final Delegator delegator = FreeMarkerWorker.getWrappedObject("delegator", env);
final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env);
@@ -68,7 +67,7 @@ public class RenderSubContentAsText implements TemplateTransformModel {
Debug.logInfo("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module);
}
FreeMarkerWorker.getSiteParameters(request, templateRoot);
final Map<String, Object> savedValuesUp = FastMap.newInstance();
final Map<String, Object> savedValuesUp = new HashMap<String, Object>();
FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp);
FreeMarkerWorker.overrideWithArgs(templateRoot, args);
if (Debug.infoOn()) {
@@ -129,7 +128,7 @@ public class RenderSubContentAsText implements TemplateTransformModel {
templateRoot.put("subDataResourceTypeId", subDataResourceTypeId);
*/
final Map<String, Object> savedValues = FastMap.newInstance();
final Map<String, Object> savedValues = new HashMap<String, Object>();
return new Writer(out) {
@@ -20,6 +20,7 @@ package org.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -28,8 +29,6 @@ import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilGenerics;
@@ -61,7 +60,7 @@ public class RenderSubContentCacheTransform implements TemplateTransformModel {
// final StringBuilder buf = new StringBuilder();
final Environment env = Environment.getCurrentEnvironment();
//final Map templateCtx = FreeMarkerWorker.getWrappedObject("context", env);
//final Map templateCtx = FastMap.newInstance();
//final Map templateCtx = new HashMap<String, Object>();
final LocalDispatcher dispatcher = FreeMarkerWorker.getWrappedObject("dispatcher", env);
final Delegator delegator = FreeMarkerWorker.getWrappedObject("delegator", env);
final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env);
@@ -69,7 +68,7 @@ public class RenderSubContentCacheTransform implements TemplateTransformModel {
final Map<String, Object> templateRoot = FreeMarkerWorker.createEnvironmentMap(env);
//if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module);
FreeMarkerWorker.getSiteParameters(request, templateRoot);
final Map<String, Object> savedValuesUp = FastMap.newInstance();
final Map<String, Object> savedValuesUp = new HashMap<String, Object>();
FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp);
FreeMarkerWorker.overrideWithArgs(templateRoot, args);
//if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module);
@@ -120,7 +119,7 @@ public class RenderSubContentCacheTransform implements TemplateTransformModel {
templateRoot.put("subContentId", subContentIdSub);
templateRoot.put("subDataResourceTypeId", subDataResourceTypeId);
//final Map savedValues = FastMap.newInstance();
//final Map savedValues = new HashMap<String, Object>();
//FreeMarkerWorker.saveContextValues(templateCtx, saveKeyNames, savedValues);
return new Writer(out) {
@@ -21,6 +21,7 @@ package org.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -28,8 +29,6 @@ import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
@@ -79,7 +78,7 @@ public class RenderSubContentTransform implements TemplateTransformModel {
final Environment env = Environment.getCurrentEnvironment();
Map<String, Object> ctx = FreeMarkerWorker.getWrappedObject("context", env);
if (ctx == null) {
ctx = FastMap.newInstance();
ctx = new HashMap<String, Object>();
}
final String mapKey = FreeMarkerWorker.getArg(args, "mapKey", ctx);
final String subContentId = FreeMarkerWorker.getArg(args, "subContentId", ctx);
@@ -21,14 +21,13 @@ package org.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilGenerics;
@@ -86,9 +85,9 @@ public class TraverseSubContentCacheTransform implements TemplateTransformModel
//final Map templateRoot = FreeMarkerWorker.getWrappedObject("context", env);
final Map<String, Object> templateRoot = FreeMarkerWorker.createEnvironmentMap(env);
//FreeMarkerWorker.convertContext(templateRoot);
final Map<String, Object> savedValuesUp = FastMap.newInstance();
final Map<String, Object> savedValuesUp = new HashMap<String, Object>();
FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp);
final Map<String, Object> savedValues = FastMap.newInstance();
final Map<String, Object> savedValues = new HashMap<String, Object>();
FreeMarkerWorker.overrideWithArgs(templateRoot, args);
String startContentAssocTypeId = (String)templateRoot.get("contentAssocTypeId");
// if (Debug.infoOn()) Debug.logInfo("in TraverseSubContentCache, startContentAssocTypeId:" + startContentAssocTypeId, module);
@@ -114,9 +113,9 @@ public class TraverseSubContentCacheTransform implements TemplateTransformModel
// final GenericValue view = val;
final Map<String, Object> traverseContext = FastMap.newInstance();
final Map<String, Object> traverseContext = new HashMap<String, Object>();
traverseContext.put("delegator", delegator);
Map<String, Object> whenMap = FastMap.newInstance();
Map<String, Object> whenMap = new HashMap<String, Object>();
whenMap.put("followWhen", templateRoot.get("followWhen"));
whenMap.put("pickWhen", templateRoot.get("pickWhen"));
whenMap.put("returnBeforePickWhen", templateRoot.get("returnBeforePickWhen"));
@@ -170,7 +169,7 @@ public class TraverseSubContentCacheTransform implements TemplateTransformModel
// if (Debug.infoOn()) Debug.logInfo("in TraverseSubContentCache, onStart, trailCsv(1):" + trailCsv , module);
if (globalNodeTrail.size() > 0) {
int sz = globalNodeTrail.size() ;
nodeTrail = FastList.newInstance();
nodeTrail = new LinkedList<Map<String,? extends Object>>();
//nodeTrail = passedGlobalNodeTrail.subList(sz - 1, sz);
node = UtilGenerics.checkMap(globalNodeTrail.get(sz - 1));
//if (Debug.infoOn()) Debug.logInfo("in TraverseSubContentCache, onStart, node(1):" + node , module);
@@ -265,7 +264,7 @@ public class TraverseSubContentCacheTransform implements TemplateTransformModel
Map<String, ? extends Object> ndStart = nodeTrail.get(0);
contentIdStart = (String)ndStart.get("contentId");
} else {
globalNodeTrail = FastList.newInstance();
globalNodeTrail = new LinkedList<Map<String,? extends Object>>();
}
//if (Debug.infoOn()) Debug.logInfo("in TraverseSubContentCache, populateContext, contentIdEnd(1):" + contentIdEnd + " contentIdStart:" + contentIdStart + " equals:" + (contentIdStart.equals(contentIdEnd)), module);
boolean bIdEnd = UtilValidate.isNotEmpty(contentIdEnd);
@@ -21,13 +21,12 @@ package org.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
@@ -133,9 +132,9 @@ public class TraverseSubContentTransform implements TemplateTransformModel {
}
final GenericValue subContentDataResourceView = view;
final Map<String, Object> traverseContext = FastMap.newInstance();
final Map<String, Object> traverseContext = new HashMap<String, Object>();
traverseContext.put("delegator", delegator);
Map<String, Object> whenMap = FastMap.newInstance();
Map<String, Object> whenMap = new HashMap<String, Object>();
whenMap.put("followWhen", templateCtx.get("followWhen"));
whenMap.put("pickWhen", templateCtx.get("pickWhen"));
whenMap.put("returnBeforePickWhen", templateCtx.get("returnBeforePickWhen"));
@@ -180,7 +179,7 @@ public class TraverseSubContentTransform implements TemplateTransformModel {
@Override
public int onStart() throws TemplateModelException, IOException {
//templateContext.put("buf", new StringBuilder());
List<Map<String, Object>> nodeTrail = FastList.newInstance();
List<Map<String, Object>> nodeTrail = new LinkedList<Map<String,Object>>();
traverseContext.put("nodeTrail", nodeTrail);
// GenericValue content = null;
/*
@@ -287,7 +286,7 @@ public class TraverseSubContentTransform implements TemplateTransformModel {
private boolean checkWhen (GenericValue thisContent, String contentAssocTypeId) {
boolean isPick = false;
Map<String, Object> assocContext = FastMap.newInstance();
Map<String, Object> assocContext = new HashMap<String, Object>();
if (UtilValidate.isEmpty(contentAssocTypeId)) {
contentAssocTypeId = "";
}
@@ -309,7 +308,7 @@ public class TraverseSubContentTransform implements TemplateTransformModel {
assocContext.put("content", thisContent);
List<Object> purposes = ContentWorker.getPurposes(thisContent);
assocContext.put("purposes", purposes);
List<String> contentTypeAncestry = FastList.newInstance();
List<String> contentTypeAncestry = new LinkedList<String>();
String contentTypeId = (String)thisContent.get("contentTypeId");
try {
ContentWorker.getContentTypeAncestry(delegator, contentTypeId, contentTypeAncestry);
@@ -20,14 +20,13 @@ package org.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilGenerics;
@@ -94,7 +93,7 @@ public class WrapSubContentCacheTransform implements TemplateTransformModel {
final Delegator delegator = FreeMarkerWorker.getWrappedObject("delegator", env);
final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env);
FreeMarkerWorker.getSiteParameters(request, templateCtx);
final Map<String, Object> savedValuesUp = FastMap.newInstance();
final Map<String, Object> savedValuesUp = new HashMap<String, Object>();
FreeMarkerWorker.saveContextValues(templateCtx, upSaveKeyNames, savedValuesUp);
//if (Debug.infoOn()) Debug.logInfo("in Wrap(0a), savedValuesUp ." + savedValuesUp , module);
FreeMarkerWorker.overrideWithArgs(templateCtx, args);
@@ -135,7 +134,7 @@ public class WrapSubContentCacheTransform implements TemplateTransformModel {
// the parent context. But it will already have one and it is the same context that is
// being passed.
}
final Map<String, Object> savedValues = FastMap.newInstance();
final Map<String, Object> savedValues = new HashMap<String, Object>();
FreeMarkerWorker.saveContextValues(templateCtx, saveKeyNames, savedValues);
//if (Debug.infoOn()) Debug.logInfo("in Wrap(1), savedValues ." + savedValues , module);
// This order is taken so that the mimeType can be overridden in the transform arguments.
@@ -19,14 +19,13 @@
package org.ofbiz.humanres;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
@@ -82,10 +81,10 @@ public class HumanResEvents {
title = memGroupCtx.getString("groupName");
}
Map josonMap = FastMap.newInstance();
Map dataMap = FastMap.newInstance();
Map dataAttrMap = FastMap.newInstance();
Map attrMap = FastMap.newInstance();
Map josonMap = new HashMap();
Map dataMap = new HashMap();
Map dataAttrMap = new HashMap();
Map attrMap = new HashMap();
dataAttrMap.put("onClick", onclickFunction + "('" + memberId + additionParam + "')");
@@ -124,10 +123,10 @@ public class HumanResEvents {
String catNameField = null;
String title = null;
Map josonMap = FastMap.newInstance();
Map dataMap = FastMap.newInstance();
Map dataAttrMap = FastMap.newInstance();
Map attrMap = FastMap.newInstance();
Map josonMap = new HashMap();
Map dataMap = new HashMap();
Map dataAttrMap = new HashMap();
Map attrMap = new HashMap();
catId = childOfCom.get("partyIdTo");
@@ -198,10 +197,10 @@ public class HumanResEvents {
if (UtilValidate.isNotEmpty(isEmpls)) {
for (GenericValue childOfEmpl : isEmpls ) {
Map emplMap = FastMap.newInstance();
Map emplAttrMap = FastMap.newInstance();
Map empldataMap = FastMap.newInstance();
Map emplDataAttrMap = FastMap.newInstance();
Map emplMap = new HashMap();
Map emplAttrMap = new HashMap();
Map empldataMap = new HashMap();
Map emplDataAttrMap = new HashMap();
String emplId = (String) childOfEmpl.get("emplPositionId");
String typeId = (String) childOfEmpl.get("emplPositionTypeId");
@@ -26,9 +26,6 @@ import org.ofbiz.base.util.*;
import org.ofbiz.party.party.PartyHelper;
import org.ofbiz.product.catalog.*;
import org.ofbiz.product.category.*;
import javolution.util.FastMap;
import javolution.util.FastList;
import javolution.util.FastList.*;
import org.ofbiz.entity.*;
import java.util.List;
@@ -36,17 +33,17 @@ import java.util.List;
// The separateRootType function will return the list of category of given catalog.
// PLEASE NOTE : The structure of the list of separateRootType function is according to the JSON_DATA plugin of the jsTree.
completedTree = FastList.newInstance();
completedTreeContext = FastList.newInstance();
existParties = FastList.newInstance();
subtopLists = FastList.newInstance();
completedTree = [];
completedTreeContext = [];
existParties = [];
subtopLists = [];
//internalOrg list
partyRelationships = from("PartyRelationship").where("partyIdFrom", partyId, "partyRelationshipTypeId", "GROUP_ROLLUP").filterByDate().queryList();
if (partyRelationships) {
//root
partyRoot = from("PartyGroup").where("partyId", partyId).queryOne();
partyRootMap = FastMap.newInstance();
partyRootMap = [];
partyRootMap.put("partyId", partyId);
partyRootMap.put("groupName", partyRoot.getString("groupName"));
@@ -62,8 +59,8 @@ if (partyRelationships) {
partyRootMap.put("child", completedTreeContext);
completedTree.add(partyRootMap);
}
// The complete tree list for the category tree
context.completedTree = completedTree;
context.subtopLists = subtopLists;
@@ -22,12 +22,11 @@ package org.ofbiz.manufacturing.bom;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilGenerics;
@@ -73,8 +72,8 @@ public class BOMNode {
this.delegator = product.getDelegator();
this.dispatcher = dispatcher;
this.userLogin = userLogin;
children = FastList.newInstance();
childrenNodes = FastList.newInstance();
children = new LinkedList<GenericValue>();
childrenNodes = new LinkedList<BOMNode>();
parentNode = null;
productForRules = null;
bomTypeId = null;
@@ -111,9 +110,9 @@ public class BOMNode {
.orderBy("sequenceNum")
.filterByDate(inDate).queryList();
}
children = FastList.newInstance();
children = new LinkedList<GenericValue>();
children.addAll(rows);
childrenNodes = FastList.newInstance();
childrenNodes = new LinkedList<BOMNode>();
BOMNode oneChildNode = null;
for (GenericValue oneChild : children) {
// Configurator
@@ -272,7 +271,7 @@ public class BOMNode {
// -----------------------------------------------------------
// We try to apply directly the selected features
if (newNode.equals(oneChildNode)) {
Map<String, String> selectedFeatures = FastMap.newInstance();
Map<String, String> selectedFeatures = new HashMap<String, String>();
if (productFeatures != null) {
GenericValue feature = null;
for (int j = 0; j < productFeatures.size(); j++) {
@@ -282,7 +281,7 @@ public class BOMNode {
}
if (selectedFeatures.size() > 0) {
Map<String, Object> context = FastMap.newInstance();
Map<String, Object> context = new HashMap<String, Object>();
context.put("productId", node.get("productIdTo"));
context.put("selectedFeatures", selectedFeatures);
Map<String, Object> storeResult = null;
@@ -338,9 +337,9 @@ public class BOMNode {
.orderBy("sequenceNum")
.filterByDate(inDate).queryList();
}
children = FastList.newInstance();
children = new LinkedList<GenericValue>();
children.addAll(rows);
childrenNodes = FastList.newInstance();
childrenNodes = new LinkedList<BOMNode>();
BOMNode oneChildNode = null;
for (GenericValue oneChild : children) {
@@ -506,7 +505,7 @@ public class BOMNode {
Timestamp endDate = null;
if (isManufactured(ignoreSupplierProducts)) {
BOMNode oneChildNode = null;
List<String> childProductionRuns = FastList.newInstance();
List<String> childProductionRuns = new LinkedList<String>();
Timestamp maxEndDate = null;
for (int i = 0; i < childrenNodes.size(); i++) {
oneChildNode = childrenNodes.get(i);
@@ -528,7 +527,7 @@ public class BOMNode {
}
Timestamp startDate = UtilDateTime.toTimestamp(UtilDateTime.toDateTimeString(date));
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
if (!useSubstitute) {
serviceContext.put("productId", getProduct().getString("productId"));
serviceContext.put("facilityId", getProduct().getString("facilityId"));
@@ -22,13 +22,12 @@ package org.ofbiz.manufacturing.bom;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilMisc;
@@ -62,7 +61,7 @@ public class BOMServices {
* @return returns the product's low level code (llc) i.e. the maximum depth
*/
public static Map<String, Object> getMaxDepth(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
String productId = (String) context.get("productId");
String fromDateStr = (String) context.get("fromDate");
@@ -79,7 +78,7 @@ public class BOMServices {
if (fromDate == null) {
fromDate = new Date();
}
List<String> bomTypes = FastList.newInstance();
List<String> bomTypes = new LinkedList<String>();
if (bomType == null) {
try {
List<GenericValue> bomTypesValues = EntityQuery.use(delegator).from("ProductAssocType")
@@ -120,7 +119,7 @@ public class BOMServices {
* @return the results of the updates the product's low level code
*/
public static Map<String, Object> updateLowLevelCode(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
String productId = (String) context.get("productIdTo");
@@ -167,7 +166,7 @@ public class BOMServices {
if (alsoComponents.booleanValue()) {
Map<String, Object> treeResult = dispatcher.runSync("getBOMTree", UtilMisc.toMap("productId", productId, "bomType", "MANUF_COMPONENT"));
BOMTree tree = (BOMTree)treeResult.get("tree");
List<BOMNode> products = FastList.newInstance();
List<BOMNode> products = new LinkedList<BOMNode>();
tree.print(products, llc.intValue());
for (int i = 0; i < products.size(); i++) {
BOMNode oneNode = products.get(i);
@@ -207,7 +206,7 @@ public class BOMServices {
* @return the results of the updates the product's low level code
*/
public static Map<String, Object> initLowLevelCode(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -215,7 +214,7 @@ public class BOMServices {
try {
List<GenericValue> products = EntityQuery.use(delegator).from("Product").orderBy("isVirtual DESC").queryList();
Long zero = Long.valueOf(0);
List<GenericValue> allProducts = FastList.newInstance();
List<GenericValue> allProducts = new LinkedList<GenericValue>();
for (GenericValue product : products) {
product.set("billOfMaterialLevel", zero);
allProducts.add(product);
@@ -247,7 +246,7 @@ public class BOMServices {
* @return returns the ProductAssoc generic value for a duplicate productIdKey ancestor if present
*/
public static Map<String, Object> searchDuplicatedAncestor(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin = (GenericValue)context.get("userLogin");
@@ -280,7 +279,7 @@ public class BOMServices {
* @return return the bill of material tree
*/
public static Map<String, Object> getBOMTree(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin = (GenericValue)context.get("userLogin");
@@ -331,7 +330,7 @@ public class BOMServices {
* @return return the list of manufacturing components
*/
public static Map<String, Object> getManufacturingComponents(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin = (GenericValue)context.get("userLogin");
@@ -367,7 +366,7 @@ public class BOMServices {
// Components
//
BOMTree tree = null;
List<BOMNode> components = FastList.newInstance();
List<BOMNode> components = new LinkedList<BOMNode>();
try {
tree = new BOMTree(productId, "MANUF_COMPONENT", fromDate, BOMTree.EXPLOSION_SINGLE_LEVEL, delegator, dispatcher, userLogin);
tree.setRootQuantity(quantity);
@@ -403,9 +402,9 @@ public class BOMServices {
result.put("components", components);
// also return a componentMap (useful in scripts and simple language code)
List<Map<String, Object>> componentsMap = FastList.newInstance();
List<Map<String, Object>> componentsMap = new LinkedList<Map<String,Object>>();
for (BOMNode node : components) {
Map<String, Object> componentMap = FastMap.newInstance();
Map<String, Object> componentMap = new HashMap<String, Object>();
componentMap.put("product", node.getProduct());
componentMap.put("quantity", node.getQuantity());
componentsMap.add(componentMap);
@@ -415,7 +414,7 @@ public class BOMServices {
}
public static Map<String, Object> getNotAssembledComponents(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
String productId = (String) context.get("productId");
@@ -444,8 +443,8 @@ public class BOMServices {
}
BOMTree tree = null;
List<BOMNode> components = FastList.newInstance();
List<BOMNode> notAssembledComponents = FastList.newInstance();
List<BOMNode> components = new LinkedList<BOMNode>();
List<BOMNode> notAssembledComponents = new LinkedList<BOMNode>();
try {
tree = new BOMTree(productId, "MANUF_COMPONENT", fromDate, BOMTree.EXPLOSION_MANUFACTURING, delegator, dispatcher, userLogin);
tree.setRootQuantity(quantity);
@@ -467,7 +466,7 @@ public class BOMServices {
// Service for the Product (Shipment) component
//
public static Map<String, Object> createShipmentPackages(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -489,8 +488,8 @@ public class BOMServices {
} catch (GenericEntityException gee) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingBomErrorLoadingShipmentItems", locale));
}
Map<String, Object> orderReadHelpers = FastMap.newInstance();
Map<String, Object> partyOrderShipments = FastMap.newInstance();
Map<String, Object> orderReadHelpers = new HashMap<String, Object>();
Map<String, Object> partyOrderShipments = new HashMap<String, Object>();
for (GenericValue shipmentItem : shipmentItems) {
// Get the OrderShipments
GenericValue orderShipment = null;
@@ -511,7 +510,7 @@ public class BOMServices {
String partyId = (orderReadHelper.getPlacingParty() != null? orderReadHelper.getPlacingParty().getString("partyId"): null); // FIXME: is it the customer?
if (partyId != null) {
if (!partyOrderShipments.containsKey(partyId)) {
List<Map<String, Object>> orderShipmentReadMapList = FastList.newInstance();
List<Map<String, Object>> orderShipmentReadMapList = new LinkedList<Map<String,Object>>();
partyOrderShipments.put(partyId, orderShipmentReadMapList);
}
List<Map<String, Object>> orderShipmentReadMapList = UtilGenerics.checkList(partyOrderShipments.get(partyId));
@@ -529,7 +528,7 @@ public class BOMServices {
OrderReadHelper orderReadHelper = (OrderReadHelper)orderShipmentReadMap.get("orderReadHelper");
GenericValue orderItem = orderReadHelper.getOrderItem(orderShipment.getString("orderItemSeqId"));
// getProductsInPackages
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.put("productId", orderItem.getString("productId"));
serviceContext.put("quantity", orderShipment.getBigDecimal("quantity"));
Map<String, Object> resultService = null;
@@ -556,9 +555,9 @@ public class BOMServices {
}
// Group together products and components
// of the same box type.
Map<String, GenericValue> boxTypes = FastMap.newInstance();
Map<String, GenericValue> boxTypes = new HashMap<String, GenericValue>();
for (Map.Entry<String, Object> partyOrderShipment : partyOrderShipments.entrySet()) {
Map<String, List<Map<String, Object>>> boxTypeContent = FastMap.newInstance();
Map<String, List<Map<String, Object>>> boxTypeContent = new HashMap<String, List<Map<String,Object>>>();
List<Map<String, Object>> orderShipmentReadMapList = UtilGenerics.checkList(partyOrderShipment.getValue());
for (int i = 0; i < orderShipmentReadMapList.size(); i++) {
Map<String, Object> orderShipmentReadMap = UtilGenerics.checkMap(orderShipmentReadMapList.get(i));
@@ -570,7 +569,7 @@ public class BOMServices {
// this is a multi package shipment item
for (int j = 0; j < productsInPackages.size(); j++) {
BOMNode component = productsInPackages.get(j);
Map<String, Object> boxTypeContentMap = FastMap.newInstance();
Map<String, Object> boxTypeContentMap = new HashMap<String, Object>();
boxTypeContentMap.put("content", orderShipmentReadMap);
boxTypeContentMap.put("componentIndex", Integer.valueOf(j));
GenericValue product = component.getProduct();
@@ -584,7 +583,7 @@ public class BOMServices {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingPackageConfiguratorError", locale));
}
boxTypes.put(boxTypeId, boxType);
List<Map<String, Object>> box = FastList.newInstance();
List<Map<String, Object>> box = new LinkedList<Map<String,Object>>();
boxTypeContent.put(boxTypeId, box);
}
List<Map<String, Object>> boxTypeContentList = UtilGenerics.checkList(boxTypeContent.get(boxTypeId));
@@ -594,7 +593,7 @@ public class BOMServices {
} else {
// no subcomponents, the product has its own package:
// this is a single package shipment item
Map<String, Object> boxTypeContentMap = FastMap.newInstance();
Map<String, Object> boxTypeContentMap = new HashMap<String, Object>();
boxTypeContentMap.put("content", orderShipmentReadMap);
GenericValue orderItem = orderReadHelper.getOrderItem(orderShipment.getString("orderItemSeqId"));
GenericValue product = null;
@@ -614,7 +613,7 @@ public class BOMServices {
}
boxTypes.put(boxTypeId, boxType);
List<Map<String, Object>> box = FastList.newInstance();
List<Map<String, Object>> box = new LinkedList<Map<String,Object>>();
boxTypeContent.put(boxTypeId, box);
}
List<Map<String, Object>> boxTypeContentList = UtilGenerics.checkList(boxTypeContent.get(boxTypeId));
@@ -733,7 +732,7 @@ public class BOMServices {
* @return returns the list of products in packages
*/
public static Map<String, Object> getProductsInPackages(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin = (GenericValue)context.get("userLogin");
@@ -760,7 +759,7 @@ public class BOMServices {
// Components
//
BOMTree tree = null;
List<BOMNode> components = FastList.newInstance();
List<BOMNode> components = new LinkedList<BOMNode>();
try {
tree = new BOMTree(productId, "MANUF_COMPONENT", fromDate, BOMTree.EXPLOSION_MANUFACTURING, delegator, dispatcher, userLogin);
tree.setRootQuantity(quantity);
@@ -21,11 +21,10 @@ package org.ofbiz.manufacturing.bom;
import java.math.BigDecimal;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javolution.util.FastList;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;
@@ -106,7 +105,7 @@ public class BOMTree {
.where("productId", productId,
"productFeatureApplTypeId", "STANDARD_FEATURE")
.queryList();
List<GenericValue> productFeatures = FastList.newInstance();
List<GenericValue> productFeatures = new LinkedList<GenericValue>();
GenericValue oneProductFeatureAppl = null;
for (int i = 0; i < productFeaturesAppl.size(); i++) {
oneProductFeatureAppl = productFeaturesAppl.get(i);
@@ -184,7 +183,7 @@ public class BOMTree {
*
*/
public boolean isConfigured() {
List<BOMNode> notConfiguredParts = FastList.newInstance();
List<BOMNode> notConfiguredParts = new LinkedList<BOMNode>();
root.isConfigured(notConfiguredParts);
return (notConfiguredParts.size() == 0);
}
@@ -301,8 +300,8 @@ public class BOMTree {
* @return List containing all the tree's productId.
*/
public List<String> getAllProductsId() {
List<BOMNode> nodeArr = FastList.newInstance();
List<String> productsId = FastList.newInstance();
List<BOMNode> nodeArr = new LinkedList<BOMNode>();
List<String> productsId = new LinkedList<String>();
print(nodeArr);
for (int i = 0; i < nodeArr.size(); i++) {
productsId.add((nodeArr.get(i)).getProduct().getString("productId"));
@@ -22,11 +22,10 @@ package org.ofbiz.manufacturing.jobshopmgt;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javolution.util.FastList;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
@@ -329,7 +328,7 @@ public class ProductionRun {
if (productionRunRoutingTasks == null) this.getProductionRunRoutingTasks();
if (productionRunRoutingTasks != null) {
try {
productionRunComponents = FastList.newInstance();
productionRunComponents = new LinkedList<GenericValue>();
GenericValue routingTask;
for (Iterator<GenericValue> iter = productionRunRoutingTasks.iterator(); iter.hasNext();) {
routingTask = iter.next();
@@ -21,14 +21,13 @@ package org.ofbiz.manufacturing.jobshopmgt;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilHttp;
import org.ofbiz.base.util.UtilMisc;
@@ -62,7 +61,7 @@ public class ProductionRunEvents {
}
Collection<Map<String, Object>> componentRows = UtilHttp.parseMultiFormData(parameters);
Map<GenericPK, Object> componentsLocationMap = FastMap.newInstance();
Map<GenericPK, Object> componentsLocationMap = new HashMap<GenericPK, Object>();
for (Map<String, Object>componentRow : componentRows) {
Timestamp fromDate = null;
try {
@@ -18,11 +18,10 @@
*******************************************************************************/
package org.ofbiz.manufacturing.jobshopmgt;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
@@ -54,7 +53,7 @@ public class ProductionRunHelper {
* <li> the productionRunProduct
*/
public static Map<String, Object> getProductionRun(Delegator delegator, String productionRunId) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
try {
if (productionRunId != null) {
@@ -21,16 +21,15 @@ package org.ofbiz.manufacturing.jobshopmgt;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilGenerics;
@@ -89,7 +88,7 @@ public class ProductionRunServices {
* @return Map with the result of the service, the output parameters.
*/
public static Map<String, Object> cancelProductionRun(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -107,7 +106,7 @@ public class ProductionRunServices {
if (currentStatusId.equals("PRUN_CREATED") || currentStatusId.equals("PRUN_DOC_PRINTED") || currentStatusId.equals("PRUN_SCHEDULED")) {
try {
// First of all, make sure that there aren't production runs that depend on this one.
List<ProductionRun> mandatoryWorkEfforts = FastList.newInstance();
List<ProductionRun> mandatoryWorkEfforts = new LinkedList<ProductionRun>();
ProductionRunHelper.getLinkedProductionRuns(delegator, dispatcher, productionRunId, mandatoryWorkEfforts);
for (int i = 1; i < mandatoryWorkEfforts.size(); i++) {
GenericValue mandatoryWorkEffort = (mandatoryWorkEfforts.get(i)).getGenericValue();
@@ -115,7 +114,7 @@ public class ProductionRunServices {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunStatusNotChangedMandatoryProductionRunFound", locale));
}
}
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
// change the production run (header) status to PRUN_CANCELLED
serviceContext.put("workEffortId", productionRunId);
serviceContext.put("currentStatusId", "PRUN_CANCELLED");
@@ -182,7 +181,7 @@ public class ProductionRunServices {
* @return Map with the result of the service, the output parameters.
*/
public static Map<String, Object> createProductionRun(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -246,7 +245,7 @@ public class ProductionRunServices {
// The components are retrieved using the getManufacturingComponents service
// (that performs a bom breakdown and if needed runs the configurator).
List<BOMNode> components = null;
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.put("productId", productId); // the product that we want to manufacture
serviceContext.put("quantity", pRQuantity); // the quantity that we want to manufacture
serviceContext.put("userLogin", userLogin);
@@ -556,7 +555,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> changeProductionRunStatus(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -580,7 +579,7 @@ public class ProductionRunServices {
// PRUN_CREATED --> PRUN_SCHEDULED
if ("PRUN_CREATED".equals(currentStatusId) && "PRUN_SCHEDULED".equals(statusId)) {
// change the production run status to PRUN_SCHEDULED
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("workEffortId", productionRunId);
serviceContext.put("currentStatusId", statusId);
@@ -612,7 +611,7 @@ public class ProductionRunServices {
// PRUN_CREATED or PRUN_SCHEDULED --> PRUN_DOC_PRINTED
if ((currentStatusId.equals("PRUN_CREATED") || currentStatusId.equals("PRUN_SCHEDULED")) && (statusId == null || statusId.equals("PRUN_DOC_PRINTED"))) {
// change only the production run (header) status to PRUN_DOC_PRINTED
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("workEffortId", productionRunId);
serviceContext.put("currentStatusId", "PRUN_DOC_PRINTED");
@@ -664,7 +663,7 @@ public class ProductionRunServices {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunStatusNotChanged", locale));
}
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("workEffortId", productionRunId);
serviceContext.put("currentStatusId", "PRUN_RUNNING");
@@ -685,7 +684,7 @@ public class ProductionRunServices {
// this should be called only when the last task is completed
if (currentStatusId.equals("PRUN_RUNNING") && (statusId == null || statusId.equals("PRUN_COMPLETED"))) {
// change only the production run (header) status to PRUN_COMPLETED
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("workEffortId", productionRunId);
serviceContext.put("currentStatusId", "PRUN_COMPLETED");
@@ -705,7 +704,7 @@ public class ProductionRunServices {
// PRUN_COMPLETED --> PRUN_CLOSED
if (currentStatusId.equals("PRUN_COMPLETED") && (statusId == null || statusId.equals("PRUN_CLOSED"))) {
// change the production run status to PRUN_CLOSED
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("workEffortId", productionRunId);
serviceContext.put("currentStatusId", "PRUN_CLOSED");
@@ -739,7 +738,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> changeProductionRunTaskStatus(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -799,7 +798,7 @@ public class ProductionRunServices {
if (productionRun.getGenericValue().getString("currentStatusId").equals("PRUN_CREATED")) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunTaskCannotStartDocsNotPrinted", locale));
}
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("workEffortId", taskId);
serviceContext.put("currentStatusId", "PRUN_RUNNING");
@@ -832,7 +831,7 @@ public class ProductionRunServices {
// PRUN_RUNNING --> PRUN_COMPLETED
// this should be called only when the last task is completed
if (currentStatusId.equals("PRUN_RUNNING") && (statusId == null || statusId.equals("PRUN_COMPLETED"))) {
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
if (issueAllComponents.booleanValue()) {
// Issue all the components, if this task needs components and they still need to be issued
try {
@@ -974,7 +973,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> getWorkEffortCosts(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
String workEffortId = (String)context.get("workEffortId");
Locale locale = (Locale) context.get("locale");
@@ -1008,7 +1007,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> getProductionRunCost(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -1152,7 +1151,7 @@ public class ProductionRunServices {
}
// materials costs: these are the costs derived from the materials used by the production run task
try {
Map<String, BigDecimal> materialsCostByCurrency = FastMap.newInstance();
Map<String, BigDecimal> materialsCostByCurrency = new HashMap<String, BigDecimal>();
for (GenericValue inventoryConsumed : EntityQuery.use(delegator).from("WorkEffortAndInventoryAssign")
.where("workEffortId", productionRunTaskId).queryList()) {
BigDecimal quantity = inventoryConsumed.getBigDecimal("quantity");
@@ -1266,7 +1265,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> addProductionRunComponent(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Timestamp now = UtilDateTime.nowTimestamp();
@@ -1316,7 +1315,7 @@ public class ProductionRunServices {
Debug.logWarning(e.getMessage(), module);
return ServiceUtil.returnError(e.getMessage());
}
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("workEffortId", workEffortId);
serviceContext.put("productId", productId);
@@ -1337,7 +1336,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> updateProductionRunComponent(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -1390,7 +1389,7 @@ public class ProductionRunServices {
Debug.logWarning(e.getMessage(), module);
return ServiceUtil.returnError(e.getMessage());
}
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("workEffortId", theComponent.getString("workEffortId"));
serviceContext.put("workEffortGoodStdTypeId", "PRUNT_PROD_NEEDED");
@@ -1411,7 +1410,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> addProductionRunRoutingTask(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -1487,7 +1486,7 @@ public class ProductionRunServices {
long totalTime = ProductionRun.getEstimatedTaskTime(routingTask, pRQuantity, dispatcher);
estimatedCompletionDate = TechDataServices.addForward(TechDataServices.getTechDataCalendar(routingTask), estimatedStartDate, totalTime);
}
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("priority", priority);
serviceContext.put("workEffortPurposeTypeId", routingTask.get("workEffortPurposeTypeId"));
@@ -1555,7 +1554,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> productionRunProduce(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -1583,7 +1582,7 @@ public class ProductionRunServices {
autoCreateLot = Boolean.FALSE;
}
List<String> inventoryItemIds = FastList.newInstance();
List<String> inventoryItemIds = new LinkedList<String>();
result.put("inventoryItemIds", inventoryItemIds);
// The production run is loaded
ProductionRun productionRun = new ProductionRun(productionRunId, delegator, dispatcher);
@@ -1707,7 +1706,7 @@ public class ProductionRunServices {
serviceContext.put("inventoryItemId", inventoryItemId);
resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext);
// Recompute reservations
serviceContext = FastMap.newInstance();
serviceContext = new HashMap<String, Object>();
serviceContext.put("inventoryItemId", inventoryItemId);
serviceContext.put("userLogin", userLogin);
resultService = dispatcher.runSync("balanceInventoryItems", serviceContext);
@@ -1745,7 +1744,7 @@ public class ProductionRunServices {
serviceContext.put("inventoryItemId", inventoryItemId);
resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext);
// Recompute reservations
serviceContext = FastMap.newInstance();
serviceContext = new HashMap<String, Object>();
serviceContext.put("inventoryItemId", inventoryItemId);
serviceContext.put("userLogin", userLogin);
if (orderItem != null) {
@@ -1775,7 +1774,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> productionRunDeclareAndProduce(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -1832,7 +1831,7 @@ public class ProductionRunServices {
}
}
try {
Map<String, Object> inputMap = FastMap.newInstance();
Map<String, Object> inputMap = new HashMap<String, Object>();
inputMap.putAll(context);
inputMap.remove("componentsLocationMap");
result = dispatcher.runSync("productionRunProduce", inputMap);
@@ -1844,7 +1843,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> productionRunTaskProduce(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -1872,7 +1871,7 @@ public class ProductionRunServices {
ProductionRun productionRun = new ProductionRun(productionRunTaskId, delegator, dispatcher);
facilityId = productionRun.getGenericValue().getString("facilityId");
}
List<String> inventoryItemIds = FastList.newInstance();
List<String> inventoryItemIds = new LinkedList<String>();
if ("SERIALIZED_INV_ITEM".equals(inventoryItemTypeId)) {
try {
int numOfItems = quantity.intValue();
@@ -1908,7 +1907,7 @@ public class ProductionRunServices {
resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext);
inventoryItemIds.add(inventoryItemId);
// Recompute reservations
serviceContext = FastMap.newInstance();
serviceContext = new HashMap<String, Object>();
serviceContext.put("inventoryItemId", inventoryItemId);
serviceContext.put("userLogin", userLogin);
resultService = dispatcher.runSync("balanceInventoryItems", serviceContext);
@@ -1949,7 +1948,7 @@ public class ProductionRunServices {
resultService = dispatcher.runSync("createWorkEffortInventoryProduced", serviceContext);
inventoryItemIds.add(inventoryItemId);
// Recompute reservations
serviceContext = FastMap.newInstance();
serviceContext = new HashMap<String, Object>();
serviceContext.put("inventoryItemId", inventoryItemId);
serviceContext.put("userLogin", userLogin);
resultService = dispatcher.runSync("balanceInventoryItems", serviceContext);
@@ -2027,7 +2026,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> updateProductionRunTask(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -2177,7 +2176,7 @@ public class ProductionRunServices {
GenericValue timeEntry = delegator.makeValue("TimeEntry", timeEntryFields);
timeEntry.create();
*/
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("workEffortId", workEffortId);
if (addTaskTime != null) {
@@ -2233,7 +2232,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> createProductionRunFromRequirement(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -2258,7 +2257,7 @@ public class ProductionRunServices {
if (quantity == null) {
quantity = requirement.getBigDecimal("quantity");
}
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("productId", requirement.getString("productId"));
serviceContext.put("quantity", quantity);
@@ -2293,7 +2292,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> createProductionRunFromConfiguration(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -2327,7 +2326,7 @@ public class ProductionRunServices {
return ServiceUtil.returnError(e.getMessage());
}
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.clear();
serviceContext.put("productId", instanceProductId);
serviceContext.put("pRQuantity", quantity);
@@ -2344,7 +2343,7 @@ public class ProductionRunServices {
String productionRunId = (String)resultService.get("productionRunId");
result.put("productionRunId", productionRunId);
Map<String, BigDecimal> components = FastMap.newInstance();
Map<String, BigDecimal> components = new HashMap<String, BigDecimal>();
for (ConfigOption co : config.getSelectedOptions()) {
//components.addAll(co.getComponents());
for (GenericValue selComponent : co.getComponents()) {
@@ -2431,7 +2430,7 @@ public class ProductionRunServices {
componentQuantity = BigDecimal.ONE;
}
resultService = null;
serviceContext = FastMap.newInstance();
serviceContext = new HashMap<String, Object>();
serviceContext.put("productionRunId", productionRunId);
serviceContext.put("productId", productId);
serviceContext.put("estimatedQuantity", componentQuantity);
@@ -2455,7 +2454,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> createProductionRunForMktgPkg(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -2510,7 +2509,7 @@ public class ProductionRunServices {
// how many should we produce? If there already is some inventory, then just produce enough to bring ATP back up to zero.
BigDecimal qtyRequired = BigDecimal.ZERO.subtract(existingAtp);
// ok so that's how many we WANT to produce, but let's check how many we can actually produce based on the available components
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.put("productId", orderItem.getString("productId"));
serviceContext.put("facilityId", facilityId);
serviceContext.put("userLogin", userLogin);
@@ -2567,7 +2566,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> createProductionRunsForOrder(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin = (GenericValue)context.get("userLogin");
@@ -2620,7 +2619,7 @@ public class ProductionRunServices {
return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrder, "OrderProblemsReadingOrderItemInformation", UtilMisc.toMap("errorString", gee.getMessage()), locale));
}
}
List<String> productionRuns = FastList.newInstance();
List<String> productionRuns = new LinkedList<String>();
for (int i = 0; i < orderItems.size(); i++) {
GenericValue orderItemOrShipGroupAssoc = orderItems.get(i);
String productId = null;
@@ -2673,7 +2672,7 @@ public class ProductionRunServices {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturinWorkOrderItemFulfillmentError", UtilMisc.toMap("errorString", gee.getMessage()), locale));
}
try {
List<BOMNode> components = FastList.newInstance();
List<BOMNode> components = new LinkedList<BOMNode>();
BOMTree tree = new BOMTree(productId, "MANUF_COMPONENT", fromDate, BOMTree.EXPLOSION_MANUFACTURING, delegator, dispatcher, userLogin);
tree.setRootQuantity(quantity);
tree.setRootAmount(amount);
@@ -2688,7 +2687,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> createProductionRunsForProductBom(DispatchContext dctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
LocalDispatcher dispatcher = dctx.getDispatcher();
GenericValue userLogin =(GenericValue)context.get("userLogin");
@@ -2705,7 +2704,7 @@ public class ProductionRunServices {
quantity = BigDecimal.ONE;
}
try {
List<BOMNode> components = FastList.newInstance();
List<BOMNode> components = new LinkedList<BOMNode>();
BOMTree tree = new BOMTree(productId, "MANUF_COMPONENT", startDate, BOMTree.EXPLOSION_MANUFACTURING, delegator, dispatcher, userLogin);
tree.setRootQuantity(quantity);
tree.setRootAmount(BigDecimal.ZERO);
@@ -2717,7 +2716,7 @@ public class ProductionRunServices {
if (workEffortId == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunIsNotRequiredForProductId", UtilMisc.toMap("productId", productId, "startDate", startDate), locale));
}
List<String> productionRuns = FastList.newInstance();
List<String> productionRuns = new LinkedList<String>();
result.put("productionRuns" , productionRuns);
result.put("productionRunId" , workEffortId);
return result;
@@ -2741,7 +2740,7 @@ public class ProductionRunServices {
String taskId = (String) context.get("taskId");
try {
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
Map<String, Object> resultService = null;
GenericValue task = EntityQuery.use(delegator).from("WorkEffort").where("workEffortId", taskId).queryOne();
String currentStatusId = task.getString("currentStatusId");
@@ -2794,7 +2793,7 @@ public class ProductionRunServices {
oneTask = tasks.get(i);
taskId = oneTask.getString("workEffortId");
try {
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.put("productionRunId", productionRunId);
serviceContext.put("taskId", taskId);
serviceContext.put("userLogin", userLogin);
@@ -2863,7 +2862,7 @@ public class ProductionRunServices {
String startAllTasks = (String) context.get("startAllTasks");
try {
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> serviceContext = new HashMap<String, Object>();
// Change the task status to running
if (statusId.equals("PRUN_DOC_PRINTED") ||
@@ -2931,13 +2930,13 @@ public class ProductionRunServices {
}
BigDecimal totQty = BigDecimal.ZERO;
try {
List<EntityCondition> findOutgoingProductionRunsConds = FastList.newInstance();
List<EntityCondition> findOutgoingProductionRunsConds = new LinkedList<EntityCondition>();
findOutgoingProductionRunsConds.add(EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId));
findOutgoingProductionRunsConds.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "WEGS_CREATED"));
findOutgoingProductionRunsConds.add(EntityCondition.makeCondition("estimatedStartDate", EntityOperator.LESS_THAN_EQUAL_TO, startDate));
List<EntityCondition> findOutgoingProductionRunsStatusConds = FastList.newInstance();
List<EntityCondition> findOutgoingProductionRunsStatusConds = new LinkedList<EntityCondition>();
findOutgoingProductionRunsStatusConds.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.EQUALS, "PRUN_CREATED"));
findOutgoingProductionRunsStatusConds.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.EQUALS, "PRUN_SCHEDULED"));
findOutgoingProductionRunsStatusConds.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.EQUALS, "PRUN_DOC_PRINTED"));
@@ -3006,7 +3005,7 @@ public class ProductionRunServices {
}
public static Map<String, Object> decomposeInventoryItem(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Timestamp now = UtilDateTime.nowTimestamp();
@@ -3015,7 +3014,7 @@ public class ProductionRunServices {
// Mandatory input fields
String inventoryItemId = (String)context.get("inventoryItemId");
BigDecimal quantity = (BigDecimal)context.get("quantity");
List<String> inventoryItemIds = FastList.newInstance();
List<String> inventoryItemIds = new LinkedList<String>();
try {
GenericValue inventoryItem = EntityQuery.use(delegator).from("InventoryItem")
.where("inventoryItemId", inventoryItemId).queryOne();
@@ -3115,7 +3114,7 @@ public class ProductionRunServices {
Delegator delegator = ctx.getDelegator();
Timestamp now = UtilDateTime.nowTimestamp();
Locale locale = (Locale) context.get("locale");
Map<String, TreeMap<Timestamp, Object>> products = FastMap.newInstance();
Map<String, TreeMap<Timestamp, Object>> products = new HashMap<String, TreeMap<Timestamp,Object>>();
try {
List<GenericValue> resultList = EntityQuery.use(delegator).from("WorkEffortAndGoods")
@@ -3151,7 +3150,7 @@ public class ProductionRunServices {
TreeMap<Timestamp, Object> productMap = products.get(productId);
if (!productMap.containsKey(estimatedShipDate)) {
productMap.put(estimatedShipDate,
UtilMisc.<String, Object>toMap("remainingQty", BigDecimal.ZERO, "reservations", FastList.newInstance()));
UtilMisc.<String, Object>toMap("remainingQty", BigDecimal.ZERO, "reservations", new LinkedList()));
}
Map<String, Object> dateMap = UtilGenerics.checkMap(productMap.get(estimatedShipDate));
BigDecimal remainingQty = (BigDecimal)dateMap.get("remainingQty");
@@ -3200,7 +3199,7 @@ public class ProductionRunServices {
}
TreeMap<Timestamp, Object> productMap = products.get(productId);
if (!productMap.containsKey(estimatedShipDate)) {
productMap.put(estimatedShipDate, UtilMisc.toMap("remainingQty", BigDecimal.ZERO, "reservations", FastList.newInstance()));
productMap.put(estimatedShipDate, UtilMisc.toMap("remainingQty", BigDecimal.ZERO, "reservations", new LinkedList()));
}
Map<String, Object> dateMap = UtilGenerics.checkMap(productMap.get(estimatedShipDate));
BigDecimal remainingQty = (BigDecimal)dateMap.get("remainingQty");
@@ -3210,7 +3209,7 @@ public class ProductionRunServices {
}
// backorders
List<EntityCondition> backordersCondList = FastList.newInstance();
List<EntityCondition> backordersCondList = new LinkedList<EntityCondition>();
backordersCondList.add(EntityCondition.makeCondition("quantityNotAvailable", EntityOperator.NOT_EQUAL, null));
backordersCondList.add(EntityCondition.makeCondition("quantityNotAvailable", EntityOperator.GREATER_THAN, BigDecimal.ZERO));
//backordersCondList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "ITEM_CREATED"), EntityOperator.OR, EntityCondition.makeCondition("statusId", EntityOperator.LESS_THAN, "ITEM_APPROVED")));
@@ -21,14 +21,13 @@ package org.ofbiz.manufacturing.mrp;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilGenerics;
@@ -92,7 +91,7 @@ public class MrpServices {
// Proposed requirements are deleted
listResult = null;
List<GenericValue> listResultRoles = FastList.newInstance();
List<GenericValue> listResultRoles = new LinkedList<GenericValue>();
try {
listResult = EntityQuery.use(delegator).from("Requirement")
.where("requirementTypeId", "PRODUCT_REQUIREMENT",
@@ -494,7 +493,7 @@ public class MrpServices {
}
}
}
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
Debug.logInfo("return from initMrpEvent", module);
return result;
@@ -833,8 +832,8 @@ public class MrpServices {
// if there are 3 levels with no inventoryEvenPanned we stop
} while (bomLevelWithNoEvent < 3);
result = FastMap.newInstance();
List<Object> msgResult = FastList.newInstance();
result = new HashMap<String, Object>();
List<Object> msgResult = new LinkedList<Object>();
result.put("msgResult", msgResult);
result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
Debug.logInfo("return from executeMrp", module);
@@ -21,13 +21,12 @@ package org.ofbiz.manufacturing.mrp;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilMisc;
@@ -115,7 +114,7 @@ public class ProposedOrder {
if (routing == null) {
// try to find a routing linked to the virtual product
BOMTree tree = null;
List<BOMNode> components = FastList.newInstance();
List<BOMNode> components = new LinkedList<BOMNode>();
try {
tree = new BOMTree(product.getString("productId"), "MANUF_COMPONENT", requiredByDate, BOMTree.EXPLOSION_SINGLE_LEVEL, delegator, dispatcher, userLogin);
tree.setRootQuantity(quantity);
@@ -136,7 +135,7 @@ public class ProposedOrder {
}
}
if (routing != null) {
result = FastMap.newInstance();
result = new HashMap<String, Object>();
//Looks for all the routingTask (ordered by inversed (begin from the end) sequence number)
if (listRoutingTaskAssoc == null) {
try {
@@ -234,7 +233,7 @@ public class ProposedOrder {
Map<String, Object> parameters = UtilMisc.<String, Object>toMap("userLogin", userLogin);
if (isBuilt) {
try {
List<BOMNode> bom = FastList.newInstance();
List<BOMNode> bom = new LinkedList<BOMNode>();
BOMTree tree = new BOMTree(productId, "MANUF_COMPONENT", null, BOMTree.EXPLOSION_MANUFACTURING, delegator, dispatcher, userLogin);
tree.setRootQuantity(quantity);
tree.print(bom);
@@ -19,11 +19,10 @@
package org.ofbiz.manufacturing.routing;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastMap;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.entity.Delegator;
@@ -51,7 +50,7 @@ public class RoutingServices {
* @return Map with the result of the service, the output parameters.
*/
public static Map<String, Object> getEstimatedTaskTime(DispatchContext ctx, Map<String, ? extends Object> context) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
@@ -20,13 +20,12 @@ package org.ofbiz.manufacturing.techdata;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
@@ -64,13 +63,13 @@ public class TechDataServices {
*/
public static Map<String, Object> lookupRoutingTask(DispatchContext ctx, Map<String, ? extends Object> context) {
Delegator delegator = ctx.getDelegator();
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Locale locale = (Locale) context.get("locale");
String workEffortName = (String) context.get("workEffortName");
String fixedAssetId = (String) context.get("fixedAssetId");
List<GenericValue> listRoutingTask = null;
List<EntityExpr> constraints = FastList.newInstance();
List<EntityExpr> constraints = new LinkedList<EntityExpr>();
if (UtilValidate.isNotEmpty(workEffortName)) {
constraints.add(EntityCondition.makeCondition("workEffortName", EntityOperator.GREATER_THAN_EQUAL_TO, workEffortName));
@@ -91,7 +90,7 @@ public class TechDataServices {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingTechDataWorkEffortNotExist", UtilMisc.toMap("errorString", e.toString()), locale));
}
if (listRoutingTask == null) {
listRoutingTask = FastList.newInstance();
listRoutingTask = new LinkedList<GenericValue>();
}
if (listRoutingTask.size() == 0) {
//FIXME is it correct ?
@@ -111,15 +110,15 @@ public class TechDataServices {
*/
public static Map<String, Object> checkRoutingTaskAssoc(DispatchContext ctx, Map<String, ? extends Object> context) {
Delegator delegator = ctx.getDelegator();
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
String sequenceNumNotOk = "N";
Locale locale = (Locale) context.get("locale");
String workEffortIdFrom = (String) context.get("workEffortIdFrom");
String workEffortIdTo = (String) context.get("workEffortIdTo");
String workEffortAssocTypeId = (String) context.get("workEffortAssocTypeId");
Long sequenceNum = (Long) context.get("sequenceNum");
Timestamp fromDate = (Timestamp) context.get("fromDate");
Timestamp thruDate = (Timestamp) context.get("thruDate");
Timestamp fromDate = (Timestamp) context.get("fromDate");
Timestamp thruDate = (Timestamp) context.get("thruDate");
String create = (String) context.get("create");
boolean createProcess = (create !=null && create.equals("Y")) ? true : false;
@@ -217,7 +216,7 @@ public class TechDataServices {
* @return a map with the capacity (Double) available and moveDay (int): the number of day it's necessary to move to have capacity available
*/
public static Map<String, Object> dayStartCapacityAvailable(GenericValue techDataCalendarWeek, int dayStart) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
int moveDay = 0;
Double capacity = null;
Time startTime = null;
@@ -301,7 +300,7 @@ public class TechDataServices {
* @return a map with Timestamp dateTo, Double nextCapacity
*/
public static Map<String, Object> startNextDay(GenericValue techDataCalendar, Timestamp dateFrom) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Timestamp dateTo = null;
GenericValue techDataCalendarWeek = null;
// TODO read TechDataCalendarExcWeek to manage execption week (maybe it's needed to refactor the entity definition
@@ -351,7 +350,7 @@ public class TechDataServices {
amount = 0;
} else amount -= nextCapacity;
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
while (amount > 0) {
result = startNextDay(techDataCalendar, dateTo);
dateTo = (Timestamp) result.get("dateTo");
@@ -372,7 +371,7 @@ public class TechDataServices {
* @return a map with the capacity (Double) available, the startTime and moveDay (int): the number of day it's necessary to move to have capacity available
*/
public static Map<String, Object> dayEndCapacityAvailable(GenericValue techDataCalendarWeek, int dayEnd) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
int moveDay = 0;
Double capacity = null;
Time startTime = null;
@@ -455,7 +454,7 @@ public class TechDataServices {
* @return a map with Timestamp dateTo, Double previousCapacity
*/
public static Map<String, Object> endPreviousDay(GenericValue techDataCalendar, Timestamp dateFrom) {
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
Timestamp dateTo = null;
GenericValue techDataCalendarWeek = null;
// TODO read TechDataCalendarExcWeek to manage exception week (maybe it's needed to refactor the entity definition
@@ -507,7 +506,7 @@ public class TechDataServices {
amount = 0;
} else amount -= previousCapacity;
Map<String, Object> result = FastMap.newInstance();
Map<String, Object> result = new HashMap<String, Object>();
while (amount > 0) {
result = endPreviousDay(techDataCalendar, dateTo);
dateTo = (Timestamp) result.get("dateTo");
@@ -25,8 +25,6 @@ import org.ofbiz.entity.GenericValue;
import org.ofbiz.widget.renderer.html.HtmlFormWrapper;
import org.ofbiz.manufacturing.jobshopmgt.ProductionRun;
import javolution.util.FastList;
productionRunId = parameters.productionRunId ?: parameters.workEffortId;
if (productionRunId) {
ProductionRun productionRun = new ProductionRun(productionRunId, delegator, dispatcher);
@@ -160,9 +158,9 @@ if (productionRunId) {
// Product components list
productionRunComponents = productionRun.getProductionRunComponents();
productionRunComponentsData = FastList.newInstance();
productionRunComponentsDataReadyForIssuance = FastList.newInstance();
productionRunComponentsAlreadyIssued = FastList.newInstance();
productionRunComponentsData = [];
productionRunComponentsDataReadyForIssuance = [];
productionRunComponentsAlreadyIssued = [];
if (productionRunComponents) {
productionRunComponents.each { component ->
product = component.getRelatedOne("Product", false);
@@ -19,13 +19,11 @@
import org.ofbiz.manufacturing.jobshopmgt.ProductionRun;
import javolution.util.FastList;
productionRunId = parameters.productionRunId ?: parameters.workEffortId;
if (productionRunId) {
ProductionRun productionRun = new ProductionRun(productionRunId, delegator, dispatcher);
if (productionRun.exist()) {
productionRunFixedAssetsData = FastList.newInstance();
productionRunFixedAssetsData = [];
productionRunRoutingTasks = productionRun.getProductionRunRoutingTasks();
productionRunRoutingTasks.each { prodRunTask ->
taskFixedAssets = prodRunTask.getRelated("WorkEffortFixedAssetAssign", null, null, false);
@@ -18,12 +18,14 @@
*******************************************************************************/
package org.ofbiz.marketing.report;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.util.EntityUtil;
import java.util.*;
import javolution.util.FastList;
import javolution.util.FastMap;
/**
* Marketing Report Helper
@@ -42,11 +44,11 @@ public class ReportHelper {
* conversionRate - # orders/# visits
*/
public static List<Map<String, Object>> calcConversionRates(List<GenericValue> visits, List<GenericValue> orders, String keyFieldName) {
List<Map<String, Object>> conversionRates = FastList.newInstance();
List<Map<String, Object>> conversionRates = new LinkedList<Map<String, Object>>();
// loop through all the visits
for (GenericValue visit: visits) {
Map<String, Object> reportValue = FastMap.newInstance();
Map<String, Object> reportValue = new HashMap<String, Object>();
reportValue.put(keyFieldName, visit.getString(keyFieldName));
reportValue.put("visits", visit.getLong("visitId")); // actually # of visits
@@ -19,6 +19,7 @@
package org.ofbiz.marketing.tracking;
import java.sql.Timestamp;
import java.util.LinkedList;
import java.util.List;
import javax.servlet.http.Cookie;
@@ -26,8 +27,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javolution.util.FastList;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
@@ -286,7 +285,7 @@ public class TrackingCodeEvents {
String prodCatalogId = trackingCode.getString("prodCatalogId");
if (UtilValidate.isNotEmpty(prodCatalogId)) {
session.setAttribute("CURRENT_CATALOG_ID", prodCatalogId);
CategoryWorker.setTrail(request, FastList.<String>newInstance());
CategoryWorker.setTrail(request, new LinkedList());
}
// if forward/redirect is needed, do a response.sendRedirect and return null to tell the control servlet to not do any other requests/views
@@ -435,7 +434,7 @@ public class TrackingCodeEvents {
public static List<GenericValue> makeTrackingCodeOrders(HttpServletRequest request) {
Delegator delegator = (Delegator) request.getAttribute("delegator");
java.sql.Timestamp nowStamp = UtilDateTime.nowTimestamp();
List<GenericValue> trackingCodeOrders = FastList.newInstance();
List<GenericValue> trackingCodeOrders = new LinkedList<GenericValue>();
Cookie[] cookies = request.getCookies();
Timestamp affiliateReferredTimeStamp = null;
@@ -26,11 +26,11 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import javolution.util.FastMap;
import net.wimpi.pim.Pim;
import net.wimpi.pim.contact.basicimpl.AddressImpl;
import net.wimpi.pim.contact.basicimpl.EmailAddressImpl;
@@ -85,7 +85,7 @@ public class VCard {
InputStream in = new ByteArrayInputStream(inputByteArray);
String partyType = (String) context.get("partyType");
Boolean isGroup = "PartyGroup".equals(partyType); // By default we import a Person.
Map<String, Object> serviceCtx = FastMap.newInstance();
Map<String, Object> serviceCtx = new HashMap<String, Object>();
try {
ContactIOFactory ciof = Pim.getContactIOFactory();
@@ -19,6 +19,7 @@
package org.ofbiz.order;
import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -27,8 +28,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javolution.util.FastList;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.ObjectType;
@@ -68,7 +67,7 @@ public class OrderManagerEvents {
if (session.getAttribute("OFFLINE_PAYMENTS") != null) {
String orderId = (String) request.getAttribute("orderId");
List<GenericValue> toBeStored = FastList.newInstance();
List<GenericValue> toBeStored = new LinkedList<GenericValue>();
List<GenericValue> paymentPrefs = null;
GenericValue placingCustomer = null;
try {
@@ -220,7 +219,7 @@ public class OrderManagerEvents {
}
}
List<GenericValue> toBeStored = FastList.newInstance();
List<GenericValue> toBeStored = new LinkedList<GenericValue>();
for (GenericValue paymentMethodType : paymentMethodTypes) {
String paymentMethodTypeId = paymentMethodType.getString("paymentMethodTypeId");
String amountStr = request.getParameter(paymentMethodTypeId + "_amount");
@@ -21,13 +21,12 @@ package org.ofbiz.order.order;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilHttp;
@@ -140,7 +139,7 @@ public class OrderContentWrapper {
.cache().filterByDate().queryFirst();
if (orderContent != null) {
// when rendering the order content, always include the OrderHeader/OrderItem and OrderContent records that this comes from
Map<String, Object> inContext = FastMap.newInstance();
Map<String, Object> inContext = new HashMap<String, Object>();
inContext.put("order", order);
inContext.put("orderContent", orderContent);
ContentWorker.renderContentAsText(dispatcher, delegator, orderContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, null, null, false);
@@ -20,6 +20,7 @@ package org.ofbiz.order.order;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -37,14 +38,11 @@ import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ServiceUtil;
import org.ofbiz.webapp.website.WebSiteWorker;
import javolution.util.FastMap;
/**
* Order Events
*/
@@ -109,7 +107,7 @@ public class OrderEvents {
GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
Locale locale = UtilHttp.getLocale(request);
Map<String, Object> resultMap = FastMap.newInstance();
Map<String, Object> resultMap = new HashMap<String, Object>();
String orderId = request.getParameter("orderId");
String[] orderItemSeqIds = request.getParameterValues("selectedItem");
@@ -122,7 +120,7 @@ public class OrderEvents {
GenericValue orderItemShipGroup = orderItemShipGroupAssoc.getRelatedOne("OrderItemShipGroup", false);
String shipGroupSeqId = orderItemShipGroup.getString("shipGroupSeqId");
Map<String, Object> contextMap = FastMap.newInstance();
Map<String, Object> contextMap = new HashMap<String, Object>();
contextMap.put("orderId", orderId);
contextMap.put("orderItemSeqId", orderItemSeqId);
contextMap.put("shipGroupSeqId", shipGroupSeqId);
@@ -20,16 +20,15 @@ package org.ofbiz.order.order;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javolution.util.FastList;
import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilValidate;
@@ -76,7 +75,7 @@ public class OrderListState implements Serializable {
protected static final Map<String, String> parameterToOrderTypeId;
protected static final Map<String, String> parameterToFilterId;
static {
Map<String, String> map = FastMap.newInstance();
Map<String, String> map = new HashMap<String, String>();
map.put("viewcompleted", "ORDER_COMPLETED");
map.put("viewcancelled", "ORDER_CANCELLED");
map.put("viewrejected", "ORDER_REJECTED");
@@ -87,12 +86,12 @@ public class OrderListState implements Serializable {
map.put("viewhold", "ORDER_HOLD");
parameterToOrderStatusId = map;
map = FastMap.newInstance();
map = new HashMap<String, String>();
map.put("view_SALES_ORDER", "SALES_ORDER");
map.put("view_PURCHASE_ORDER", "PURCHASE_ORDER");
parameterToOrderTypeId = map;
map = FastMap.newInstance();
map = new HashMap<String, String>();
map.put("filterInventoryProblems", "filterInventoryProblems");
map.put("filterAuthProblems", "filterAuthProblems");
map.put("filterPartiallyReceivedPOs", "filterPartiallyReceivedPOs");
@@ -110,9 +109,9 @@ public class OrderListState implements Serializable {
protected OrderListState() {
viewSize = 10;
viewIndex = 0;
orderStatusState = FastMap.newInstance();
orderTypeState = FastMap.newInstance();
orderFilterState = FastMap.newInstance();
orderStatusState = new HashMap<String, String>();
orderTypeState = new HashMap<String, String>();
orderFilterState = new HashMap<String, String>();
// defaults (TODO: configuration)
orderStatusState.put("viewcreated", "Y");
@@ -226,25 +225,25 @@ public class OrderListState implements Serializable {
* Get the OrderHeaders corresponding to the state.
*/
public List<GenericValue> getOrders(String facilityId, Timestamp filterDate, Delegator delegator) throws GenericEntityException {
List<EntityCondition> allConditions = FastList.newInstance();
List<EntityCondition> allConditions = new LinkedList<EntityCondition>();
if (facilityId != null) {
allConditions.add(EntityCondition.makeCondition("originFacilityId", EntityOperator.EQUALS, facilityId));
}
if (filterDate != null) {
List<EntityCondition> andExprs = FastList.newInstance();
List<EntityCondition> andExprs = new LinkedList<EntityCondition>();
andExprs.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, UtilDateTime.getDayStart(filterDate)));
andExprs.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, UtilDateTime.getDayEnd(filterDate)));
allConditions.add(EntityCondition.makeCondition(andExprs, EntityOperator.AND));
}
List<EntityCondition> statusConditions = FastList.newInstance();
List<EntityCondition> statusConditions = new LinkedList<EntityCondition>();
for (String status : orderStatusState.keySet()) {
if (!hasStatus(status)) continue;
statusConditions.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, parameterToOrderStatusId.get(status)));
}
List<EntityCondition> typeConditions = FastList.newInstance();
List<EntityCondition> typeConditions = new LinkedList<EntityCondition>();
for (String type : orderTypeState.keySet()) {
if (!hasType(type)) continue;
typeConditions.add(EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, parameterToOrderTypeId.get(type)));

Some files were not shown because too many files have changed in this diff Show More