diff --git a/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java b/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java index 6d1bf832fa..ff5416cce0 100644 --- a/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java @@ -207,7 +207,7 @@ public class FinAccountProductServices { Debug.logFatal(ServiceUtil.getErrorMessage(createResp), module); return createResp; } - + finAccountId = (String) createResp.get("finAccountId"); // create the owner role diff --git a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java index 495f9581ba..180847b885 100644 --- a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java @@ -819,7 +819,7 @@ public class InvoiceServices { List salesInvoiceRolePartyIds = EntityUtil.getFieldListFromEntityList(delegator.findList("InvoiceRole", EntityCondition.makeCondition(invoiceRoleConds, EntityOperator.AND), null, null, null, false), "partyId", true); if (UtilValidate.isNotEmpty(salesInvoiceRolePartyIds)) { salesRepPartyIds = UtilGenerics.checkList(CollectionUtils.intersection(salesRepPartyIds, salesInvoiceRolePartyIds)); - } + } } invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", salesInvoiceId), false); String invoiceTypeId = invoice.getString("invoiceTypeId"); @@ -1054,7 +1054,7 @@ public class InvoiceServices { String shipmentId = (String) context.get("shipmentId"); Locale locale = (Locale) context.get("locale"); GenericValue userLogin = (GenericValue) context.get("userLogin"); - + // 1. Find all the orders for this shipment // 2. For every order check the invoice // 2.a If the invoice is in In-Process status, then move its status to ready and capture the payment. @@ -1084,7 +1084,7 @@ public class InvoiceServices { return ServiceUtil.returnSuccess(); } // 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. + // 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 ordersWithInProcessInvoice = FastMap.newInstance(); @@ -1260,7 +1260,7 @@ public class InvoiceServices { billFields.add(EntityCondition.makeCondition("orderId", orderId)); billFields.add(EntityCondition.makeCondition("orderItemSeqId", orderItemSeqId)); billFields.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "INVOICE_CANCELLED")); - + if (dropShipmentFound) { // Drop shipments have neither issuances nor receipts, so this check is meaningless diff --git a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java index 9415d3f6ec..b1a44fe0b3 100644 --- a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java +++ b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java @@ -164,7 +164,7 @@ public class InvoiceWorker { } /** - * + * * Return the total amount of the invoice (including tax) using the the invoice GenericValue as input. * with the ability to specify if the actual currency is required. * @param invoice @@ -185,12 +185,12 @@ public class InvoiceWorker { if ("SALES_INVOICE".equals(invoice.getString("invoiceTypeId"))) { invoiceItems = EntityUtil.filterByAnd( invoiceItems, UtilMisc.toList( - EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.NOT_EQUAL, "INV_SALES_TAX"), + EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.NOT_EQUAL, "INV_SALES_TAX"), EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.NOT_EQUAL, "ITM_SALES_TAX"))); } else if (("PURCHASE_INVOICE".equals(invoice.getString("invoiceTypeId")))) { invoiceItems = EntityUtil.filterByAnd( invoiceItems, UtilMisc.toList( - EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.NOT_EQUAL, "PINV_SALES_TAX"), + EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.NOT_EQUAL, "PINV_SALES_TAX"), EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.NOT_EQUAL, "PITM_SALES_TAX"))); } } catch (GenericEntityException e) { @@ -654,12 +654,12 @@ public class InvoiceWorker { if ("SALES_INVOICE".equals(invoice.getString("invoiceTypeId"))) { invoiceItems = EntityUtil.filterByOr( invoiceItems, UtilMisc.toList( - EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.EQUALS, "INV_SALES_TAX"), + EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.EQUALS, "INV_SALES_TAX"), EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.EQUALS, "ITM_SALES_TAX"))); } else if (("PURCHASE_INVOICE".equals(invoice.getString("invoiceTypeId")))) { invoiceItems = EntityUtil.filterByOr( invoiceItems, UtilMisc.toList( - EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.EQUALS, "PINV_SALES_TAX"), + EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.EQUALS, "PINV_SALES_TAX"), EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.EQUALS, "PITM_SALES_TAX"))); } else { invoiceItems = null; diff --git a/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java b/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java index 8b7659b1e6..d9f72c02be 100644 --- a/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java @@ -122,16 +122,16 @@ public class PaymentGatewayServices { return ServiceUtil.returnError("Problems getting required information: orderPaymentPreference [" + orderPaymentPreferenceId + "]"); } OrderReadHelper orh = new OrderReadHelper(orderHeader); - + // get the total remaining BigDecimal totalRemaining = orh.getOrderGrandTotal(); - + // get the process attempts so far Long procAttempt = orderPaymentPreference.getLong("processAttempt"); if (procAttempt == null) { procAttempt = Long.valueOf(0); } - + // update the process attempt count orderPaymentPreference.set("processAttempt", Long.valueOf(procAttempt.longValue() + 1)); try { @@ -496,7 +496,7 @@ public class PaymentGatewayServices { // Check if the order is a replacement order boolean replacementOrderFlag = isReplacementOrder(orderHeader); - + // don't authorized more then what is required if (!replacementOrderFlag && processAmount.compareTo(totalRemaining) > 0) { processAmount = totalRemaining; @@ -759,7 +759,7 @@ public class PaymentGatewayServices { return result; } - + public static Map processCreditResult(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); @@ -837,7 +837,7 @@ public class PaymentGatewayServices { } return ServiceUtil.returnSuccess(); } - + /** * * Releases authorization for a single OrderPaymentPreference through service calls to the defined processing service for the ProductStore/PaymentMethodType @@ -950,7 +950,7 @@ public class PaymentGatewayServices { } return result; } - + public static Map processReleaseResult(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); @@ -993,7 +993,7 @@ public class PaymentGatewayServices { savePgr(dctx, respMsg); } } - + if (releaseResponse != null && releaseResponse.booleanValue()) { paymentPref.set("statusId", "PAYMENT_CANCELLED"); try { @@ -1029,7 +1029,7 @@ public class PaymentGatewayServices { } return ServiceUtil.returnSuccess(); } - + /** * Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodType * @return COMPLETE|FAILED|ERROR for complete processing of ALL payment methods. @@ -1398,7 +1398,7 @@ public class PaymentGatewayServices { // create the new payment preference delegator.create(newPref); - // PayPal requires us to reuse the existing authorization, so we'll + // PayPal requires us to reuse the existing authorization, so we'll // fake it and copy the existing auth with the remaining amount if ("EXT_PAYPAL".equals(paymentPref.get("paymentMethodTypeId"))) { String newAuthId = delegator.getNextSeqId("PaymentGatewayResponse"); @@ -1601,7 +1601,7 @@ public class PaymentGatewayServices { } paymentConfig = paymentSettings.getString("paymentPropertiesPath"); paymentGatewayConfigId = paymentSettings.getString("paymentGatewayConfigId"); - + if (serviceName == null) { Debug.logError("Service name is null for payment setting; cannot process", module); return null; @@ -2294,7 +2294,7 @@ public class PaymentGatewayServices { } return ServiceUtil.returnSuccess(); } - + public static Map refundOrderPaymentPreference(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); @@ -2322,7 +2322,7 @@ public class PaymentGatewayServices { } return refundResponse; } - + public static Map refundPayment(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -2344,10 +2344,10 @@ public class PaymentGatewayServices { if (orderHeader != null) { paymentSettings = getPaymentSettings(orderHeader, paymentPref, REFUND_SERVICE_TYPE, false); } - + String serviceName = null; String paymentGatewayConfigId = null; - + if (paymentSettings != null) { String customMethodId = paymentSettings.getString("paymentCustomMethodId"); if (UtilValidate.isNotEmpty(customMethodId)) { @@ -2358,7 +2358,7 @@ public class PaymentGatewayServices { } String paymentConfig = paymentSettings.getString("paymentPropertiesPath"); paymentGatewayConfigId = paymentSettings.getString("paymentGatewayConfigId"); - + if (serviceName != null) { Map serviceContext = FastMap.newInstance(); serviceContext.put("orderPaymentPreference", paymentPref); @@ -2688,7 +2688,7 @@ public class PaymentGatewayServices { } return ServiceUtil.returnSuccess(); } - + public static GenericValue getCaptureTransaction(GenericValue orderPaymentPreference) { GenericValue capTrans = null; try { @@ -2702,7 +2702,7 @@ public class PaymentGatewayServices { } return capTrans; } - + /** * Gets the chronologically latest PaymentGatewayResponse from an OrderPaymentPreference which is either a PRDS_PAY_AUTH * or PRDS_PAY_REAUTH. Used for capturing. @@ -2712,7 +2712,7 @@ public class PaymentGatewayServices { public static GenericValue getAuthTransaction(GenericValue orderPaymentPreference) { return EntityUtil.getFirst(getAuthTransactions(orderPaymentPreference)); } - + /** * Gets a chronologically ordered list of PaymentGatewayResponses from an OrderPaymentPreference which is either a PRDS_PAY_AUTH * or PRDS_PAY_REAUTH. @@ -2749,7 +2749,7 @@ public class PaymentGatewayServices { if (authTime == null) { return false; } - + String reauthDays = null; GenericValue paymentMethod = null; @@ -2810,7 +2810,7 @@ public class PaymentGatewayServices { } // safe payment gateway response store - + /** * Saves either a PaymentGatewayResponse or PaymentGatewayRespMsg value and ensures that the value * is persisted even in the event of a rollback. @@ -2848,7 +2848,7 @@ public class PaymentGatewayServices { return ServiceUtil.returnSuccess(); } - + // manual auth service public static Map processManualCcAuth(DispatchContext dctx, Map context) { GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -2973,7 +2973,7 @@ public class PaymentGatewayServices { return ServiceUtil.returnError("Authorization failed"); } } - + // manual processing service public static Map processManualCcTx(DispatchContext dctx, Map context) { GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -3058,7 +3058,7 @@ public class PaymentGatewayServices { if (paymentService == null || (paymentGatewayConfigId == null && paymentConfig == null)) { return ServiceUtil.returnError("Invalid product store payment settings"); } - + if (paymentMethodTypeId.equals("CREDIT_CARD")) { GenericValue creditCard = delegator.makeValue("CreditCard"); creditCard.setAllFields(context, true, null, null); @@ -3087,7 +3087,7 @@ public class PaymentGatewayServices { requestContext.put("referenceCode", referenceCode); String currency = UtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD"); requestContext.put("currency", currency); - requestContext.put("creditAmount", context.get("amount")); + requestContext.put("creditAmount", context.get("amount")); } else { return ServiceUtil.returnError("Payment method type : " + paymentMethodTypeId + " is not yet implemented for manual transactions"); } @@ -3131,7 +3131,7 @@ public class PaymentGatewayServices { returnResults.put("referenceNum", refNum); return returnResults; } - + // Verify Credit Card (Manually) Service public static MapverifyCreditCard(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); @@ -3529,7 +3529,7 @@ public class PaymentGatewayServices { result.put("refundMessage", "This is a test refund failure; no money was transferred"); return result; } - + public static String getPaymentCustomMethod(Delegator delegator, String customMethodId) { String serviceName = null; GenericValue customMethod = null; @@ -3543,10 +3543,10 @@ public class PaymentGatewayServices { } return serviceName; } - + public static boolean isReplacementOrder(GenericValue orderHeader) { boolean replacementOrderFlag = false; - + List returnItemResponses = FastList.newInstance(); try { returnItemResponses = orderHeader.getRelated("ReplacementReturnItemResponse"); @@ -3557,7 +3557,7 @@ public class PaymentGatewayServices { if (UtilValidate.isNotEmpty(returnItemResponses)) { replacementOrderFlag = true; } - + return replacementOrderFlag; } } diff --git a/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java b/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java index ab7746480a..d34533e8be 100644 --- a/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java @@ -143,18 +143,18 @@ public class PaymentMethodServices { context.put("cardNumber", StringUtil.removeSpaces((String) context.get("cardNumber"))); if (!UtilValidate.isCardMatch((String) context.get("cardType"), (String) context.get("cardNumber"))) { messages.add( - UtilProperties.getMessage(resource, "AccountingCreditCardNumberInvalid", + UtilProperties.getMessage(resource, "AccountingCreditCardNumberInvalid", UtilMisc.toMap("cardNumber", (String) context.get("cardNumber"), "cardType", (String) context.get("cardType"), "validCardType", UtilValidate.getCardType((String) context.get("cardNumber"))), locale)); } - + if (!UtilValidate.isDateAfterToday((String) context.get("expireDate"))) { messages.add( - UtilProperties.getMessage(resource, "AccountingCreditCardExpireDateBeforeToday", + UtilProperties.getMessage(resource, "AccountingCreditCardExpireDateBeforeToday", UtilMisc.toMap("expireDate", (String) context.get("expireDate")), locale)); } - + if (messages.size() > 0) { return ServiceUtil.returnError(messages); } @@ -304,20 +304,20 @@ public class PaymentMethodServices { } context.put("cardNumber", updatedCardNumber); - if (!UtilValidate.isCardMatch((String) context.get("cardType"), (String) context.get("cardNumber"))) { + if (!UtilValidate.isCardMatch((String) context.get("cardType"), (String) context.get("cardNumber"))) { messages.add( - UtilProperties.getMessage(resource, "AccountingCreditCardNumberInvalid", + UtilProperties.getMessage(resource, "AccountingCreditCardNumberInvalid", UtilMisc.toMap("cardNumber", (String) context.get("cardNumber"), "cardType", (String) context.get("cardType"), "validCardType", UtilValidate.getCardType((String) context.get("cardNumber"))), locale)); } - - if (!UtilValidate.isDateAfterToday((String) context.get("expireDate"))) { + + if (!UtilValidate.isDateAfterToday((String) context.get("expireDate"))) { messages.add( - UtilProperties.getMessage(resource, "AccountingCreditCardExpireDateBeforeToday", + UtilProperties.getMessage(resource, "AccountingCreditCardExpireDateBeforeToday", UtilMisc.toMap("expireDate", (String) context.get("expireDate")), locale)); } - + if (messages.size() > 0) { return ServiceUtil.returnError(messages); } @@ -330,7 +330,7 @@ public class PaymentMethodServices { String newPmId = null; try { newPmId = delegator.getNextSeqId("PaymentMethod"); - } catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingCreditCardUpdateIdGenerationFailure", locale)); } diff --git a/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java b/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java index 63381f1ba0..337e19a4b9 100644 --- a/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java @@ -162,7 +162,7 @@ public class TaxAuthorityServices { if (productStoreId != null) { productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId)); } - + } catch (GenericEntityException e) { String errMsg = "Data error getting tax settings: " + e.toString(); Debug.logError(e, errMsg, module); @@ -176,14 +176,14 @@ public class TaxAuthorityServices { else { try { - getTaxAuthorities(delegator, shippingAddress, taxAuthoritySet); + getTaxAuthorities(delegator, shippingAddress, taxAuthoritySet); } catch (GenericEntityException e) { String errMsg = "Data error getting tax settings: " + e.toString(); Debug.logError(e, errMsg, module); return ServiceUtil.returnError(errMsg); } } - + // Setup the return lists. List orderAdjustments = FastList.newInstance(); List itemAdjustments = FastList.newInstance(); @@ -286,7 +286,7 @@ public class TaxAuthorityServices { taxAuthCondOrList.add(taxAuthCond); } EntityCondition taxAuthoritiesCond = EntityCondition.makeCondition(taxAuthCondOrList, EntityOperator.OR); - + try { EntityCondition productCategoryCond = null; if (product != null) { @@ -318,14 +318,14 @@ public class TaxAuthorityServices { mainExprs.add(EntityCondition.makeCondition(EntityCondition.makeCondition("minItemPrice", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("minItemPrice", EntityOperator.LESS_THAN_EQUAL_TO, itemPrice))); mainExprs.add(EntityCondition.makeCondition(EntityCondition.makeCondition("minPurchase", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("minPurchase", EntityOperator.LESS_THAN_EQUAL_TO, itemAmount))); EntityCondition mainCondition = EntityCondition.makeCondition(mainExprs, EntityOperator.AND); - + // create the orderby clause List orderList = UtilMisc.toList("minItemPrice", "minPurchase", "fromDate"); // finally ready... do the rate query List lookupList = delegator.findList("TaxAuthorityRateProduct", mainCondition, null, orderList, null, false); List filteredList = EntityUtil.filterByDate(lookupList, true); - + if (filteredList.size() == 0) { Debug.logWarning("In TaxAuthority Product Rate no records were found for condition:" + mainCondition.toString(), module); return adjustments; diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java index 5d49f4c37c..453c2ae8a2 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java @@ -45,26 +45,26 @@ import org.ofbiz.service.ModelService; import org.ofbiz.service.ServiceUtil; public class AIMPaymentServices { - + public static final String module = AIMPaymentServices.class.getName(); - + // The list of refund failure response codes that would cause the ccRefund service // to attempt to void the refund's associated authorization transaction. This list // contains the responses where the voiding does not need to be done within a certain // time limit private static final List VOIDABLE_RESPONSES_NO_TIME_LIMIT = UtilMisc.toList("50"); - + // A list of refund failure response codes that would cause the ccRefund service // to first check whether the refund's associated authorization transaction has occurred // within a certain time limit, and if so, cause it to void the transaction private static final List VOIDABLE_RESPONSES_TIME_LIMIT = UtilMisc.toList("54"); - + // The number of days in the time limit when one can safely consider an unsettled // transaction to be still valid private static final int TIME_LIMIT_VERIFICATION_DAYS = 120; - + private static Properties AIMProperties = null; - + // A routine to check whether a given refund failure response code will cause the // ccRefund service to attempt to void the refund's associated authorization transaction private static boolean isVoidableResponse(String responseCode) { @@ -72,7 +72,7 @@ public class AIMPaymentServices { VOIDABLE_RESPONSES_NO_TIME_LIMIT.contains(responseCode) || VOIDABLE_RESPONSES_TIME_LIMIT.contains(responseCode); } - + public static Map ccAuth(DispatchContext ctx, Map context) { Delegator delegator = ctx.getDelegator(); Map results = ServiceUtil.returnSuccess(); @@ -96,7 +96,7 @@ public class AIMPaymentServices { processAuthTransResult(reply, results); return results; } - + public static Map ccCapture(DispatchContext ctx, Map context) { Delegator delegator = ctx.getDelegator(); GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); @@ -141,7 +141,7 @@ public class AIMPaymentServices { } return results; } - + public static Map ccRefund(DispatchContext ctx, Map context) { Delegator delegator = ctx.getDelegator(); GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); @@ -222,7 +222,7 @@ public class AIMPaymentServices { } return results; } - + public static Map ccRelease(DispatchContext ctx, Map context) { Delegator delegator = ctx.getDelegator(); GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); @@ -238,7 +238,7 @@ public class AIMPaymentServices { results.putAll(processReleaseTransResult(reply)); return results; } - + private static Map voidTransaction(GenericValue authTransaction, Map context, Delegator delegator) { context.put("authTransaction", authTransaction); Map results = ServiceUtil.returnSuccess(); @@ -257,14 +257,14 @@ public class AIMPaymentServices { } return processCard(request, props); } - + public static Map ccCredit(DispatchContext ctx, Map context) { Map results = FastMap.newInstance(); results.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR); results.put(ModelService.ERROR_MESSAGE, "Authorize.net ccCredit unsupported with version 3.1"); return results; } - + public static Map ccAuthCapture(DispatchContext ctx, Map context) { Delegator delegator = ctx.getDelegator(); Map results = ServiceUtil.returnSuccess(); @@ -292,7 +292,7 @@ public class AIMPaymentServices { } return results; } - + private static Map processCard(Map request, Properties props) { Map result = FastMap.newInstance(); String url = props.getProperty("url"); @@ -328,11 +328,11 @@ public class AIMPaymentServices { result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); return result; } - + private static boolean isTestMode() { return "true".equalsIgnoreCase((String)AIMProperties.get("testReq")); } - + private static Properties buildAIMProperties(Map context, Delegator delegator) { String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); String configStr = (String) context.get("paymentConfig"); @@ -395,7 +395,7 @@ public class AIMPaymentServices { } return props; } - + private static void buildMerchantInfo(Map params, Properties props, Map AIMRequest) { AIMRequest.put("x_Login", props.getProperty("login")); String trankey = props.getProperty("trankey"); @@ -405,12 +405,12 @@ public class AIMPaymentServices { AIMRequest.put("x_Password",props.getProperty("password")); AIMRequest.put("x_Version", props.getProperty("ver")); } - + private static void buildGatewayResponeConfig(Map params, Properties props, Map AIMRequest) { AIMRequest.put("x_Delim_Data", props.getProperty("delimited")); AIMRequest.put("x_Delim_Char", props.getProperty("delimiter")); } - + private static void buildCustomerBillingInfo(Map params, Properties props, Map AIMRequest) { try { // this would be used in the case of a capture, where one of the parameters is an OrderPaymentPreference @@ -456,7 +456,7 @@ public class AIMPaymentServices { return; } } - + private static void buildEmailSettings(Map params, Properties props, Map AIMRequest) { GenericValue ea = (GenericValue)params.get("billToEmail"); AIMRequest.put("x_Email_Customer", props.getProperty("emailCustomer")); @@ -465,14 +465,14 @@ public class AIMPaymentServices { AIMRequest.put("x_Email", UtilFormatOut.checkNull(ea.getString("infoString"))); } } - + private static void buildInvoiceInfo(Map params, Properties props, Map AIMRequest) { String description = UtilFormatOut.checkNull(props.getProperty("transDescription")); String orderId = UtilFormatOut.checkNull((String)params.get("orderId")); AIMRequest.put("x_Invoice_Num", "Order " + orderId); AIMRequest.put("x_Description", description); } - + private static void buildAuthTransaction(Map params, Properties props, Map AIMRequest) { GenericValue cc = (GenericValue) params.get("creditCard"); String currency = (String) params.get("currency"); @@ -490,7 +490,7 @@ public class AIMPaymentServices { AIMRequest.put("x_card_code", cardSecurityCode); } } - + private static void buildCaptureTransaction(Map params, Properties props, Map AIMRequest) { GenericValue at = (GenericValue) params.get("authTransaction"); GenericValue cc = (GenericValue) params.get("creditCard"); @@ -507,7 +507,7 @@ public class AIMPaymentServices { AIMRequest.put("x_Trans_ID", at.get("referenceNum")); AIMRequest.put("x_Auth_Code", at.get("gatewayCode")); } - + private static void buildRefundTransaction(Map params, Properties props, Map AIMRequest) { GenericValue at = (GenericValue) params.get("authTransaction"); GenericValue cc = (GenericValue) params.get("creditCard"); @@ -525,7 +525,7 @@ public class AIMPaymentServices { AIMRequest.put("x_Auth_Code", at.get("gatewayCode")); Debug.logInfo("buildCaptureTransaction. " + at.toString(), module); } - + private static void buildVoidTransaction(Map params, Properties props, Map AIMRequest) { GenericValue at = (GenericValue) params.get("authTransaction"); String currency = (String) params.get("currency"); @@ -536,13 +536,13 @@ public class AIMPaymentServices { AIMRequest.put("x_Auth_Code", at.get("gatewayCode")); Debug.logInfo("buildVoidTransaction. " + at.toString(), module); } - + private static Map validateRequest(Map params, Properties props, Map AIMRequest) { Map result = FastMap.newInstance(); result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); return result; } - + private static void processAuthTransResult(Map reply, Map results) { AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse"); Boolean authResult = (Boolean) reply.get("authResult"); @@ -562,7 +562,7 @@ public class AIMPaymentServices { } Debug.logInfo("processAuthTransResult: " + results.toString(),module); } - + private static void processCaptureTransResult(Map reply, Map results) { AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse"); Boolean captureResult = (Boolean) reply.get("authResult"); @@ -578,7 +578,7 @@ public class AIMPaymentServices { } Debug.logInfo("processCaptureTransResult: " + results.toString(),module); } - + private static Map processRefundTransResult(Map reply) { Map results = FastMap.newInstance(); AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse"); @@ -596,7 +596,7 @@ public class AIMPaymentServices { Debug.logInfo("processRefundTransResult: " + results.toString(),module); return results; } - + private static Map processReleaseTransResult(Map reply) { Map results = FastMap.newInstance(); AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse"); @@ -614,7 +614,7 @@ public class AIMPaymentServices { Debug.logInfo("processReleaseTransResult: " + results.toString(),module); return results; } - + private static void processAuthCaptureTransResult(Map reply, Map results) { AuthorizeResponse ar = (AuthorizeResponse) reply.get("authorizeResponse"); Boolean authResult = (Boolean) reply.get("authResult"); @@ -638,7 +638,7 @@ public class AIMPaymentServices { } Debug.logInfo("processAuthTransResult: " + results.toString(),module); } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName) { String returnValue = ""; diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java index 87cbb2452a..05d0bb6cf1 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java @@ -353,7 +353,7 @@ public class CCPaymentServices { Debug.set(Debug.VERBOSE, true); //Document reportResponseDoc = null; try { - //reportResponseDoc = + //reportResponseDoc = sendRequest(requestDocument, (String) context.get("paymentConfig")); } catch (ClearCommerceException cce) { return ServiceUtil.returnError(cce.getMessage()); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java index 49f9eb12f8..a212ab91aa 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java @@ -53,12 +53,12 @@ public class IcsPaymentServices { public static final String module = IcsPaymentServices.class.getName(); private static int decimals = UtilNumber.getBigDecimalScale("invoice.decimals"); private static int rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding"); - + // load the JSSE properties static { SSLUtil.loadJsseProperties(); } - + public static Map ccAuth(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); // generate the request/properties @@ -66,10 +66,10 @@ public class IcsPaymentServices { if (props == null) { return ServiceUtil.returnError("ERROR: Getting Cybersource property configuration"); } - + Map request = buildAuthRequest(context, delegator); request.put("merchantID", props.get("merchantID")); - + // transmit the request Map reply; try { @@ -87,11 +87,11 @@ public class IcsPaymentServices { processAuthResult(reply, result); return result; } - + public static Map ccReAuth(DispatchContext dctx, Map context) { return ServiceUtil.returnSuccess(); } - + public static Map ccCapture(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); @@ -108,10 +108,10 @@ public class IcsPaymentServices { if (props == null) { return ServiceUtil.returnError("ERROR: Getting Cybersource property configuration"); } - + Map request = buildCaptureRequest(context, authTransaction, delegator); request.put("merchantID", props.get("merchantID")); - + // transmit the request Map reply; try { @@ -128,7 +128,7 @@ public class IcsPaymentServices { processCaptureResult(reply, result); return result; } - + public static Map ccRelease(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); @@ -136,16 +136,16 @@ public class IcsPaymentServices { if (authTransaction == null) { return ServiceUtil.returnError("No authorization transaction found for the OrderPaymentPreference; cannot release"); } - + // generate the request/properties Properties props = buildCsProperties(context, delegator); if (props == null) { return ServiceUtil.returnError("ERROR: Getting Cybersource property configuration"); } - + Map request = buildReleaseRequest(context, authTransaction); request.put("merchantID", props.get("merchantID")); - + // transmit the request Map reply; try { @@ -162,7 +162,7 @@ public class IcsPaymentServices { processReleaseResult(reply, result); return result; } - + public static Map ccRefund(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); @@ -170,16 +170,16 @@ public class IcsPaymentServices { if (authTransaction == null) { return ServiceUtil.returnError("No authorization transaction found for the OrderPaymentPreference; cannot refund"); } - + // generate the request/properties Properties props = buildCsProperties(context, delegator); if (props == null) { return ServiceUtil.returnError("ERROR: Getting Cybersource property configuration"); } - + Map request = buildRefundRequest(context, authTransaction, delegator); request.put("merchantID", props.get("merchantID")); - + // transmit the request Map reply; try { @@ -191,13 +191,13 @@ public class IcsPaymentServices { Debug.logError(e, "ERROR: CyberSource Client exception : " + e.getMessage(), module); return ServiceUtil.returnError("Unable to communicate with CyberSource"); } - + // process the reply Map result = ServiceUtil.returnSuccess(); processRefundResult(reply, result); return result; } - + public static Map ccCredit(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); // generate the request/properties @@ -205,10 +205,10 @@ public class IcsPaymentServices { if (props == null) { return ServiceUtil.returnError("ERROR: Getting Cybersource property configuration"); } - + Map request = buildCreditRequest(context); request.put("merchantID", props.get("merchantID")); - + // transmit the request Map reply; try { @@ -220,13 +220,13 @@ public class IcsPaymentServices { Debug.logError(e, "ERROR: CyberSource Client exception : " + e.getMessage(), module); return ServiceUtil.returnError("Unable to communicate with CyberSource"); } - + // process the reply Map result = ServiceUtil.returnSuccess(); processCreditResult(reply, result); return result; } - + private static Properties buildCsProperties(Map context, Delegator delegator) { String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); String configString = (String) context.get("paymentConfig"); @@ -267,7 +267,7 @@ public class IcsPaymentServices { Debug.log("Created CyberSource Properties : " + props, module); return props; } - + private static Map buildAuthRequest(Map context, Delegator delegator) { String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); String configString = (String) context.get("paymentConfig"); @@ -288,7 +288,7 @@ public class IcsPaymentServices { appendAvsRules(request, context, delegator); // add in the AVS flags and decline codes return request; } - + private static Map buildCaptureRequest(Map context, GenericValue authTransaction, Delegator delegator) { GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); @@ -305,7 +305,7 @@ public class IcsPaymentServices { request.put("item_0_unitPrice", getAmountString(context, "captureAmount")); request.put("merchantReferenceCode", orderPaymentPreference.getString("orderId")); request.put("purchaseTotals_currency", currency); - + // TODO: add support for verbal authorizations //request.put("ccCaptureService_authType", null); -- should be 'verbal' //request.put("ccCaptureService_verbalAuthCode", null); -- code from verbal auth @@ -317,7 +317,7 @@ public class IcsPaymentServices { } return request; } - + private static Map buildReleaseRequest(Map context, GenericValue authTransaction) { Map request = FastMap.newInstance(); GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); @@ -329,7 +329,7 @@ public class IcsPaymentServices { request.put("purchaseTotals_currency", currency); return request; } - + private static Map buildRefundRequest(Map context, GenericValue authTransaction, Delegator delegator) { GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); @@ -354,7 +354,7 @@ public class IcsPaymentServices { } return request; } - + private static Map buildCreditRequest(Map context) { String refCode = (String) context.get("referenceCode"); Map request = FastMap.newInstance(); @@ -364,7 +364,7 @@ public class IcsPaymentServices { appendItemLineInfo(request, context, "creditAmount"); // add in the item info return request; } - + private static void appendAvsRules(Map request, Map context, Delegator delegator) { String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); String configString = (String) context.get("paymentConfig"); @@ -394,7 +394,7 @@ public class IcsPaymentServices { String avsIgnore = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "ignoreAvs", configString, "payment.cybersource.ignoreAvs", "false"); request.put("businessRules_ignoreAVS", avsIgnore); } - + private static void appendFullBillingInfo(Map request, Map context) { // contact info GenericValue email = (GenericValue) context.get("billToEmail"); @@ -404,7 +404,7 @@ public class IcsPaymentServices { Debug.logWarning("Email not defined; Cybersource will fail.", module); } // phone number seems to not be used; possibly only for reporting. - + // CC payment info GenericValue creditCard = (GenericValue) context.get("creditCard"); if (creditCard != null) { @@ -426,7 +426,7 @@ public class IcsPaymentServices { } // payment contact info GenericValue billingAddress = (GenericValue) context.get("billingAddress"); - + if (billingAddress != null) { request.put("billTo_street1", billingAddress.getString("address1")); if (billingAddress.get("address2") != null) { @@ -463,7 +463,7 @@ public class IcsPaymentServices { } } } - + private static void appendItemLineInfo(Map request, Map context, String amountField) { // send over a line item total offer w/ the total for billing; don't trust CyberSource for calc String currency = (String) context.get("currency"); @@ -503,12 +503,12 @@ public class IcsPaymentServices { } } } - + private static String getAmountString(Map context, String amountField) { BigDecimal processAmount = (BigDecimal) context.get(amountField); return processAmount.setScale(decimals, rounding).toPlainString(); } - + private static void processAuthResult(Map reply, Map result) { String decision = getDecision(reply); if ("ACCEPT".equalsIgnoreCase(decision)) { @@ -519,7 +519,7 @@ public class IcsPaymentServices { result.put("authResult", Boolean.FALSE); // TODO: based on reasonCode populate the following flags as applicable: resultDeclined, resultNsf, resultBadExpire, resultBadCardNumber } - + if (reply.get("ccAuthReply_amount") != null) { result.put("processAmount", new BigDecimal((String) reply.get("ccAuthReply_amount"))); } else { @@ -545,7 +545,7 @@ public class IcsPaymentServices { if (Debug.infoOn()) Debug.logInfo("CC [Cybersource] authorization result : " + result, module); } - + private static void processCaptureResult(Map reply, Map result) { String decision = getDecision(reply); if ("ACCEPT".equalsIgnoreCase(decision)) { @@ -565,7 +565,7 @@ public class IcsPaymentServices { if (Debug.infoOn()) Debug.logInfo("CC [Cybersource] capture result : " + result, module); } - + private static void processReleaseResult(Map reply, Map result) { String decision = getDecision(reply); if ("ACCEPT".equalsIgnoreCase(decision)) { @@ -585,7 +585,7 @@ public class IcsPaymentServices { if (Debug.infoOn()) Debug.logInfo("CC [Cybersource] release result : " + result, module); } - + private static void processRefundResult(Map reply, Map result) { String decision = getDecision(reply); if ("ACCEPT".equalsIgnoreCase(decision)) { @@ -605,7 +605,7 @@ public class IcsPaymentServices { if (Debug.infoOn()) Debug.logInfo("CC [Cybersource] refund result : " + result, module); } - + private static void processCreditResult(Map reply, Map result) { String decision = (String) reply.get("decision"); if ("ACCEPT".equalsIgnoreCase(decision)) { @@ -613,13 +613,13 @@ public class IcsPaymentServices { } else { result.put("creditResult", Boolean.FALSE); } - + if (reply.get("ccCreditReply_amount") != null) { result.put("creditAmount", new BigDecimal((String) reply.get("ccCreditReply_amount"))); } else { result.put("creditAmount", BigDecimal.ZERO); } - + result.put("creditRefNum", reply.get("requestID")); result.put("creditCode", reply.get("ccCreditReply_reconciliationID")); result.put("creditFlag", reply.get("ccCreditReply_reasonCode")); @@ -627,7 +627,7 @@ public class IcsPaymentServices { if (Debug.infoOn()) Debug.logInfo("CC [Cybersource] credit result : " + result, module); } - + private static String getDecision(Map reply) { String decision = (String) reply.get("decision"); String reasonCode = (String) reply.get("reasonCode"); @@ -637,7 +637,7 @@ public class IcsPaymentServices { } return decision; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName) { String returnValue = ""; @@ -661,7 +661,7 @@ public class IcsPaymentServices { } return returnValue; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName, String defaultValue) { String returnValue = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, paymentGatewayConfigParameterName, resource, parameterName); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java index 1e8fc06c6d..c6030c8d3a 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java @@ -56,12 +56,12 @@ public class OrbitalPaymentServices { public static String APPROVED = "Approved"; public static String DECLINED = "Declined"; public static String ERROR = "Error"; - + public static final String BIN_VALUE = "000002"; public static TransactionProcessorIF tp = null; public static ResponseIF response = null; public static RequestIF request = null; - + public static Map ccAuth(DispatchContext ctx, Map context) { Delegator delegator = ctx.getDelegator(); Map results = ServiceUtil.returnSuccess(); @@ -71,7 +71,7 @@ public class OrbitalPaymentServices { try { request = new Request(RequestIF.NEW_ORDER_TRANSACTION); } catch (InitializationException e) { - Debug.logError("Error in request initialization", module); + Debug.logError("Error in request initialization", module); e.printStackTrace(); } buildAuthOrAuthCaptureTransaction(context, delegator, props, request, results); @@ -88,7 +88,7 @@ public class OrbitalPaymentServices { processAuthTransResult(processCardResponseContext, results); return results; } - + public static Map ccAuthCapture(DispatchContext ctx, Map context) { Delegator delegator = ctx.getDelegator(); Map results = ServiceUtil.returnSuccess(); @@ -98,7 +98,7 @@ public class OrbitalPaymentServices { try { request = new Request(RequestIF.NEW_ORDER_TRANSACTION); } catch (InitializationException e) { - Debug.logError("Error in request initialization", module); + Debug.logError("Error in request initialization", module); e.printStackTrace(); } buildAuthOrAuthCaptureTransaction(context, delegator, props, request, results); @@ -120,7 +120,7 @@ public class OrbitalPaymentServices { Delegator delegator = ctx.getDelegator(); Map results = ServiceUtil.returnSuccess(); Map props = buildOrbitalProperties(context, delegator); - + GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue creditCard = null; try { @@ -136,13 +136,13 @@ public class OrbitalPaymentServices { context.put("creditCard", creditCard); context.put("authTransaction", authTransaction); context.put("orderId", orderPaymentPreference.getString("orderId")); - + props.put("transType", "PRIOR_AUTH_CAPTURE"); //Tell the request object which template to use (see RequestIF.java) try { request = new Request(RequestIF.MARK_FOR_CAPTURE_TRANSACTION); } catch (InitializationException e) { - Debug.logError("Error in request initialization", module); + Debug.logError("Error in request initialization", module); e.printStackTrace(); } buildCaptureTransaction(context, delegator, props, request, results); @@ -179,12 +179,12 @@ public class OrbitalPaymentServices { context.put("creditCard", creditCard); context.put("authTransaction", authTransaction); context.put("orderId", orderPaymentPreference.getString("orderId")); - + //Tell the request object which template to use (see RequestIF.java) try { request = new Request(RequestIF.NEW_ORDER_TRANSACTION); } catch (InitializationException e) { - Debug.logError("Error in request initialization", module); + Debug.logError("Error in request initialization", module); e.printStackTrace(); } buildRefundTransaction(context, props, request, results); @@ -201,12 +201,12 @@ public class OrbitalPaymentServices { processRefundTransResult(processCardResponseContext, results); return results; } - + public static Map ccRelease(DispatchContext ctx, Map context) { Delegator delegator = ctx.getDelegator(); Map results = ServiceUtil.returnSuccess(); Map props = buildOrbitalProperties(context, delegator); - + GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue creditCard = null; try { @@ -221,12 +221,12 @@ public class OrbitalPaymentServices { } context.put("authTransaction", authTransaction); context.put("orderId", orderPaymentPreference.getString("orderId")); - + //Tell the request object which template to use (see RequestIF.java) try { request = new Request(RequestIF.REVERSE_TRANSACTION); } catch (InitializationException e) { - Debug.logError("Error in request initialization", module); + Debug.logError("Error in request initialization", module); e.printStackTrace(); } buildReleaseTransaction(context, delegator, props, request, results); @@ -243,8 +243,8 @@ public class OrbitalPaymentServices { processReleaseTransResult(processCardResponseContext, results); return results; } - - + + private static Map buildOrbitalProperties(Map context, Delegator delegator) { //TODO: Will move this to property file and then will read it from there. String configFile = "/applications/accounting/config/linehandler.properties"; @@ -275,7 +275,7 @@ public class OrbitalPaymentServices { } return buildConfiguratorContext; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName) { String returnValue = ""; @@ -291,7 +291,7 @@ public class OrbitalPaymentServices { } catch (GenericEntityException e) { Debug.logError(e, module); } - } + } return returnValue; } @@ -309,8 +309,8 @@ public class OrbitalPaymentServices { if ("AUTH_ONLY".equals(transType)) { messageType = "A"; } else if ("AUTH_CAPTURE".equals(transType)) { - messageType = "AC"; - } + messageType = "AC"; + } try { request.setFieldValue("IndustryType", "EC"); request.setFieldValue("MessageType", UtilFormatOut.checkNull(messageType)); @@ -318,7 +318,7 @@ public class OrbitalPaymentServices { request.setFieldValue("BIN", BIN_VALUE); request.setFieldValue("OrderID", UtilFormatOut.checkNull(orderId)); request.setFieldValue("AccountNum", UtilFormatOut.checkNull(number)); - + request.setFieldValue("Amount", UtilFormatOut.checkNull(amountValue)); request.setFieldValue("Exp", UtilFormatOut.checkNull(expDate)); // AVS Information @@ -332,7 +332,7 @@ public class OrbitalPaymentServices { creditCard = opp.getRelatedOne("CreditCard"); } } - + request.setFieldValue("AVSname", "Demo Customer"); if (UtilValidate.isNotEmpty(creditCard.getString("contactMechId"))) { GenericValue address = creditCard.getRelatedOne("PostalAddress"); @@ -375,7 +375,7 @@ public class OrbitalPaymentServices { e.printStackTrace(); } } - + private static void buildCaptureTransaction(Map params, Delegator delegator, Map props, RequestIF request, Map results) { GenericValue authTransaction = (GenericValue) params.get("authTransaction"); GenericValue creditCard = (GenericValue) params.get("creditCard"); @@ -390,7 +390,7 @@ public class OrbitalPaymentServices { request.setFieldValue("TxRefNum", UtilFormatOut.checkNull(authTransaction.get("referenceNum").toString())); request.setFieldValue("OrderID", UtilFormatOut.checkNull(orderId)); request.setFieldValue("Amount", UtilFormatOut.checkNull(amountValue)); - + request.setFieldValue("PCDestName", UtilFormatOut.checkNull(creditCard.getString("firstNameOnCard") + creditCard.getString("lastNameOnCard"))); if (UtilValidate.isNotEmpty(creditCard.getString("contactMechId"))) { GenericValue address = creditCard.getRelatedOne("PostalAddress"); @@ -402,7 +402,7 @@ public class OrbitalPaymentServices { request.setFieldValue("PCDestState", UtilFormatOut.checkNull(address.getString("stateProvinceGeoId"))); request.setFieldValue("PCDestZip", UtilFormatOut.checkNull(address.getString("postalCode"))); } - } + } //Display the request Debug.log("\nCapture Request:\n ======== " + request.getXML()); results.put("captureAmount", amount); @@ -435,7 +435,7 @@ public class OrbitalPaymentServices { request.setFieldValue("Amount", UtilFormatOut.checkNull(amountValue)); request.setFieldValue("Exp", UtilFormatOut.checkNull(expDate)); request.setFieldValue("Comments", "This is a credit card refund"); - + Debug.log("\nRefund Request:\n ======== " + request.getXML()); results.put("refundAmount", amount); } catch (InitializationException ie) { @@ -446,7 +446,7 @@ public class OrbitalPaymentServices { e.printStackTrace(); } } - + private static void buildReleaseTransaction(Map params, Delegator delegator, Map props, RequestIF request, Map results) { BigDecimal amount = (BigDecimal) params.get("releaseAmount"); GenericValue authTransaction = (GenericValue) params.get("authTransaction"); @@ -458,7 +458,7 @@ public class OrbitalPaymentServices { request.setFieldValue("BIN", BIN_VALUE); request.setFieldValue("TxRefNum", UtilFormatOut.checkNull(authTransaction.get("referenceNum").toString())); request.setFieldValue("OrderID", UtilFormatOut.checkNull(orderId)); - + //Display the request Debug.log("\nRelease Request:\n ======== " + request.getXML()); results.put("releaseAmount", amount); @@ -470,8 +470,8 @@ public class OrbitalPaymentServices { e.printStackTrace(); } } - - + + private static void initializeTransactionProcessor() { //Create a Transaction Processor //The Transaction Processor acquires and releases resources and executes transactions. @@ -483,7 +483,7 @@ public class OrbitalPaymentServices { iex.printStackTrace(); } } - + private static Map processCard(RequestIF request) { Map processCardResult = FastMap.newInstance(); try { @@ -492,7 +492,7 @@ public class OrbitalPaymentServices { processCardResult.put("authResult", Boolean.TRUE); } else { processCardResult.put("authResult", Boolean.FALSE); - } + } processCardResult.put("processCardResponse", response); } catch (TransactionException tex) { Debug.logError("TransactionProcessor failed to initialize" + tex.getMessage(), module); @@ -501,7 +501,7 @@ public class OrbitalPaymentServices { processCardResult.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); return processCardResult; } - + private static void processAuthTransResult(Map processCardResponseContext, Map results) { ResponseIF response = (ResponseIF) processCardResponseContext.get("processCardResponse"); Boolean authResult = (Boolean) processCardResponseContext.get("authResult"); @@ -521,7 +521,7 @@ public class OrbitalPaymentServices { } Debug.logInfo("processAuthTransResult: " + results.toString(),module); } - + private static void processAuthCaptureTransResult(Map processCardResponseContext, Map results) { ResponseIF response = (ResponseIF) processCardResponseContext.get("processCardResponse"); Boolean authResult = (Boolean) processCardResponseContext.get("authResult"); @@ -545,7 +545,7 @@ public class OrbitalPaymentServices { } Debug.logInfo("processAuthCaptureTransResult: " + results.toString(),module); } - + private static void processCaptureTransResult(Map processCardResponseContext, Map results) { ResponseIF response = (ResponseIF) processCardResponseContext.get("processCardResponse"); Boolean captureResult = (Boolean) processCardResponseContext.get("authResult"); @@ -577,7 +577,7 @@ public class OrbitalPaymentServices { } Debug.logInfo("processRefundTransResult: " + results.toString(),module); } - + private static void processReleaseTransResult(Map processCardResponseContext, Map results) { ResponseIF response = (ResponseIF) processCardResponseContext.get("processCardResponse"); Boolean releaseResult = (Boolean) processCardResponseContext.get("authResult"); @@ -593,7 +593,7 @@ public class OrbitalPaymentServices { } Debug.logInfo("processReleaseTransResult: " + results.toString(),module); } - + private static void printTransResult(ResponseIF response) { Map generatedResponse = FastMap.newInstance(); generatedResponse.put("isGood", response.isGood()); @@ -608,15 +608,15 @@ public class OrbitalPaymentServices { generatedResponse.put("Message", response.getMessage()); generatedResponse.put("AVSCode", response.getAVSResponseCode()); generatedResponse.put("CVV2ResponseCode", response.getCVV2RespCode()); - + Debug.logInfo("printTransResult === " + generatedResponse.toString(),module); } - + private static String formatExpDateForOrbital(String expDate) { String formatedDate = expDate.substring(0, 2) + expDate.substring(5); return formatedDate; } - + private static String getShippingRefForOrder(String orderId, Delegator delegator) { String shippingRef = ""; try { @@ -625,7 +625,7 @@ public class OrbitalPaymentServices { GenericValue trackingCode = null; if (UtilValidate.isNotEmpty(trackingCodeOrder)) { trackingCode = trackingCodeOrder.getRelatedOne("TrackingCode"); - } + } if (UtilValidate.isNotEmpty(trackingCode) && UtilValidate.isNotEmpty(trackingCode.getString("description"))) { // get tracking code description and provide it into shipping reference. shippingRef = trackingCode.getString("trackingCodeId") + "====" + trackingCode.getString("description"); @@ -638,7 +638,7 @@ public class OrbitalPaymentServices { } return shippingRef; } - + private static Map validateRequest(Map params, Map props, RequestIF request) { Map result = FastMap.newInstance(); result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java index 9c2afa407c..bf02ba39ca 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java @@ -115,25 +115,25 @@ public class PayPalEvents { String itemName = UtilProperties.getMessage(resource, "AccountingOrderNr", locale) + orderId + " " + (company != null ? UtilProperties.getMessage(commonResource, "CommonFrom", locale) + " "+ company : ""); String itemNumber = "0"; - + // get the redirect url String redirectUrl = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "redirectUrl", configString, "payment.paypal.redirect"); - + // get the notify url String notifyUrl = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "notifyUrl", configString, "payment.paypal.notify"); - + // get the return urls String returnUrl = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "returnUrl", configString, "payment.paypal.return"); - + // get the cancel return urls String cancelReturnUrl = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "cancelReturnUrl", configString, "payment.paypal.cancelReturn"); - + // get the image url String imageUrl = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "imageUrl", configString, "payment.paypal.image"); - + // get the paypal account String payPalAccount = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "businessEmail", configString, "payment.paypal.business"); - + if (UtilValidate.isEmpty(redirectUrl) || UtilValidate.isEmpty(notifyUrl) || UtilValidate.isEmpty(returnUrl) @@ -242,7 +242,7 @@ public class PayPalEvents { } catch (IOException e) { Debug.logError(e, "Problems sending verification message", module); } - + Debug.logInfo("Got verification from PayPal, processing..", module); boolean verified = false; Set keySet = parametersMap.keySet(); @@ -259,7 +259,7 @@ public class PayPalEvents { if (!verified) { Debug.logError("###### PayPal did not verify this request, need investigation!", module); } - + // get the system user GenericValue userLogin = null; try { @@ -508,7 +508,7 @@ public class PayPalEvents { return true; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName) { String returnValue = ""; diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java index 4801795952..d522d8c471 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java @@ -86,7 +86,7 @@ public class PayPalServices { // Used to maintain a weak reference to the ShoppingCart for customers who have gone to PayPal to checkout // so that we can quickly grab the cart, perform shipment estimates and send the info back to PayPal. // The weak key is a simple wrapper for the checkout token String and is stored as a cart attribute. The value - // is a weak reference to the ShoppingCart itself. Entries will be removed as carts are removed from the + // is a weak reference to the ShoppingCart itself. Entries will be removed as carts are removed from the // session (i.e. on cart clear or successful checkout) or when the session is destroyed private static Map> tokenCartMap = new WeakHashMap>(); @@ -878,7 +878,7 @@ public class PayPalServices { // so until further testing proves we should do otherwise I'm just going to return requested void amount result.put("releaseAmount", context.get("releaseAmount")); result.put("releaseRefNum", decoder.get("AUTHORIZATIONID")); - } + } return result; } @@ -925,7 +925,7 @@ public class PayPalServices { result.put("refundResult", true); result.put("refundAmount", new BigDecimal(decoder.get("GROSSREFUNDAMT"))); result.put("refundRefNum", decoder.get("REFUNDTRANSACTIONID")); - } + } return result; } diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java index 8979711d55..9778abf0a7 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java @@ -43,19 +43,19 @@ import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; public class SagePayPaymentServices { - + public static final String module = SagePayPaymentServices.class.getName(); private static Map buildCustomerBillingInfo(Map context) { - + Debug.logInfo("SagePay - Entered buildCustomerBillingInfo", module); Debug.logInfo("SagePay buildCustomerBillingInfo context : " + context, module); - + Map billingInfo = FastMap.newInstance(); - + String orderId = null; BigDecimal processAmount = null; - String currency = null; + String currency = null; String cardNumber = null; String cardType = null; String nameOnCard = null; @@ -65,7 +65,7 @@ public class SagePayPaymentServices { String address = null; try { - + GenericValue opp = (GenericValue) context.get("orderPaymentPreference"); if (opp != null) { if ("CREDIT_CARD".equals(opp.getString("paymentMethodTypeId"))) { @@ -136,14 +136,14 @@ public class SagePayPaymentServices { billingInfo.put("cardNumber", cardNumber); billingInfo.put("cardHolder", nameOnCard); billingInfo.put("expiryDate", expireDate); - billingInfo.put("cardType", cardType); + billingInfo.put("cardType", cardType); billingInfo.put("cv2", securityCode); billingInfo.put("billingPostCode", postalCode); billingInfo.put("billingAddress", address); - + Debug.logInfo("SagePay billingInfo : " + billingInfo, module); Debug.logInfo("SagePay - Exiting buildCustomerBillingInfo", module); - + return billingInfo; } @@ -163,11 +163,11 @@ public class SagePayPaymentServices { Debug.logInfo("SagePay - Exiting ccAuth", module); return response; } - + private static Map processCardAuthorisationPayment(DispatchContext ctx, Map context) { - - Map result = ServiceUtil.returnSuccess(); + + Map result = ServiceUtil.returnSuccess(); LocalDispatcher dispatcher = ctx.getDispatcher(); Map billingInfo = buildCustomerBillingInfo(context); @@ -175,7 +175,7 @@ public class SagePayPaymentServices { try { - Map paymentResult = dispatcher.runSync("SagePayPaymentAuthentication", + Map paymentResult = dispatcher.runSync("SagePayPaymentAuthentication", UtilMisc.toMap( "paymentGatewayConfigId", paymentGatewayConfigId, "vendorTxCode", billingInfo.get("orderId"), @@ -241,14 +241,14 @@ public class SagePayPaymentServices { GenericValue authTransaction = PaymentGatewayServices.getAuthTransaction(orderPaymentPreference); context.put("authTransaction", authTransaction); Map response = processCardCapturePayment(ctx, context); - + Debug.logInfo("SagePay ccCapture response : " + response, module); Debug.logInfo("SagePay - Exiting ccCapture", module); - + return response; } - - + + private static Map processCardCapturePayment(DispatchContext ctx, Map context) { Map result = ServiceUtil.returnSuccess(); @@ -264,7 +264,7 @@ public class SagePayPaymentServices { try { - Map paymentResult = dispatcher.runSync("SagePayPaymentAuthorisation", + Map paymentResult = dispatcher.runSync("SagePayPaymentAuthorisation", UtilMisc.toMap( "paymentGatewayConfigId", paymentGatewayConfigId, "vendorTxCode", vendorTxCode, @@ -282,7 +282,7 @@ public class SagePayPaymentServices { result = SagePayUtil.buildCardCapturePaymentResponse(Boolean.TRUE, txAuthCode, securityKey, amount, vpsTxId, vendorTxCode, statusDetail); } else { Debug.logInfo("SagePay - Invalid status " + status + " received for order : " + vendorTxCode, module); - result = SagePayUtil.buildCardCapturePaymentResponse(Boolean.FALSE, txAuthCode, securityKey, amount, vpsTxId, vendorTxCode, statusDetail); + result = SagePayUtil.buildCardCapturePaymentResponse(Boolean.FALSE, txAuthCode, securityKey, amount, vpsTxId, vendorTxCode, statusDetail); } } catch(GenericServiceException e) { Debug.logError(e, "Error in calling SagePayPaymentAuthorisation", module); @@ -290,7 +290,7 @@ public class SagePayPaymentServices { } return result; } - + public static Map ccRefund(DispatchContext ctx, Map context) { Debug.logInfo("SagePay - Entered ccRefund", module); @@ -333,7 +333,7 @@ public class SagePayPaymentServices { yesterday.add(Calendar.DAY_OF_YEAR, -1); Map response = null; - + if (authCal.before(yesterday)) { Debug.logInfo("SagePay - Calling Refund for Refund", module); response = processCardRefundPayment(ctx, context); @@ -350,14 +350,14 @@ public class SagePayPaymentServices { response = processCardRefundPayment(ctx, context); } } - + Debug.logInfo("SagePay ccRefund response : " + response, module); return response; } private static Map processCardRefundPayment(DispatchContext ctx, Map context) { - Map result = ServiceUtil.returnSuccess(); + Map result = ServiceUtil.returnSuccess(); LocalDispatcher dispatcher = ctx.getDispatcher(); String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); @@ -377,7 +377,7 @@ public class SagePayPaymentServices { "currency", "GBP", "description", orderId, "relatedVPSTxId", captureTransaction.get("referenceNum"), - "relatedVendorTxCode", captureTransaction.get("altReference"), + "relatedVendorTxCode", captureTransaction.get("altReference"), "relatedSecurityKey", captureTransaction.get("gatewayFlag"), "relatedTxAuthNo", captureTransaction.get("gatewayCode") ) @@ -407,7 +407,7 @@ public class SagePayPaymentServices { private static Map processCardVoidPayment(DispatchContext ctx, Map context) { - Map result = ServiceUtil.returnSuccess(); + Map result = ServiceUtil.returnSuccess(); LocalDispatcher dispatcher = ctx.getDispatcher(); String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); @@ -416,8 +416,8 @@ public class SagePayPaymentServices { String orderId = (String) captureTransaction.get("altReference"); try { - - Map paymentResult = dispatcher.runSync("SagePayPaymentVoid", + + Map paymentResult = dispatcher.runSync("SagePayPaymentVoid", UtilMisc.toMap( "paymentGatewayConfigId", paymentGatewayConfigId, "vendorTxCode", captureTransaction.get("altReference"), @@ -426,7 +426,7 @@ public class SagePayPaymentServices { "txAuthNo", captureTransaction.get("gatewayCode") ) ); - + Debug.logInfo("SagePay - SagePayPaymentVoid result : " + paymentResult, module); String status = (String) paymentResult.get("status"); @@ -457,7 +457,7 @@ public class SagePayPaymentServices { Debug.logInfo("SagePay - Entered ccRelease", module); Debug.logInfo("SagePay ccRelease context : " + context, module); - + GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue authTransaction = PaymentGatewayServices.getAuthTransaction(orderPaymentPreference); @@ -473,20 +473,20 @@ public class SagePayPaymentServices { private static Map processCardReleasePayment(DispatchContext ctx, Map context) { - Map result = ServiceUtil.returnSuccess(); + Map result = ServiceUtil.returnSuccess(); LocalDispatcher dispatcher = ctx.getDispatcher(); String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); BigDecimal amount = (BigDecimal) context.get("releaseAmount"); - + GenericValue authTransaction = (GenericValue) context.get("authTransaction"); String orderId = (String) authTransaction.get("altReference"); String refNum = (String) authTransaction.get("referenceNum"); - + try { - - Map paymentResult = dispatcher.runSync("SagePayPaymentRelease", + + Map paymentResult = dispatcher.runSync("SagePayPaymentRelease", UtilMisc.toMap( "paymentGatewayConfigId", paymentGatewayConfigId, "vendorTxCode", orderId, @@ -498,7 +498,7 @@ public class SagePayPaymentServices { ); Debug.logInfo("SagePay - SagePayPaymentRelease result : " + paymentResult, module); - + String status = (String) paymentResult.get("status"); String statusDetail = (String) paymentResult.get("statusDetail"); @@ -517,5 +517,5 @@ public class SagePayPaymentServices { return result; } - + } diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java index eeb5dfc164..6de125fd74 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java @@ -74,7 +74,7 @@ public class SagePayServices { Debug.logInfo("SagePay - Entered paymentAuthentication", module); Debug.logInfo("SagePay paymentAuthentication context : " + context, module); - + Delegator delegator = ctx.getDelegator(); Map resultMap = new HashMap(); @@ -101,7 +101,7 @@ public class SagePayServices String billingPhone = (String) context.get("billingPhone"); Boolean isBillingSameAsDelivery = (Boolean) context.get("isBillingSameAsDelivery"); - + String deliverySurname = (String) context.get("deliverySurname"); String deliveryFirstnames = (String) context.get("deliveryFirstnames"); String deliveryAddress = (String) context.get("deliveryAddress"); @@ -116,7 +116,7 @@ public class SagePayServices String issueNumber = (String) context.get("issueNumber"); String basket = (String) context.get("basket"); String clientIPAddress = (String) context.get("clientIPAddress"); - + HttpClient httpClient = SagePayUtil.getHttpClient(); HttpHost host = SagePayUtil.getHost(props); @@ -152,7 +152,7 @@ public class SagePayServices if (billingState != null) { parameters.put("BillingState", billingState); } if (billingPhone != null) { parameters.put("BillingPhone", billingPhone); } //end - billing details - + //start - delivery details if (isBillingSameAsDelivery != null && isBillingSameAsDelivery) { if (billingSurname != null) { parameters.put("DeliverySurname", billingSurname); } @@ -188,7 +188,7 @@ public class SagePayServices //end - authentication parameters try { - + String successMessage = null; HttpPost httpPost = SagePayUtil.getHttpPost(props.get("authenticationUrl"), parameters); HttpResponse response = httpClient.execute(host, httpPost); @@ -196,7 +196,7 @@ public class SagePayServices String status = responseData.get("Status"); String statusDetail = responseData.get("StatusDetail"); - + resultMap.put("status", status); resultMap.put("statusDetail", statusDetail); @@ -277,7 +277,7 @@ public class SagePayServices Debug.logError(ioe, errorMsg, module); resultMap = ServiceUtil.returnError(errorMsg); } finally { - httpClient.getConnectionManager().shutdown(); + httpClient.getConnectionManager().shutdown(); } return resultMap; } @@ -286,7 +286,7 @@ public class SagePayServices { Debug.logInfo("SagePay - Entered paymentAuthorisation", module); Debug.logInfo("SagePay paymentAuthorisation context : " + context, module); - + Delegator delegator = ctx.getDelegator(); Map resultMap = new HashMap(); @@ -300,7 +300,7 @@ public class SagePayServices HttpClient httpClient = SagePayUtil.getHttpClient(); HttpHost host = SagePayUtil.getHost(props); - + //start - authorization parameters Map parameters = new HashMap(); @@ -319,31 +319,31 @@ public class SagePayServices Debug.logInfo("authorization parameters -> " + parameters, module); //end - authorization parameters - + try { String successMessage = null; HttpPost httpPost = SagePayUtil.getHttpPost(props.get("authoriseUrl"), parameters); HttpResponse response = httpClient.execute(host, httpPost); - + Map responseData = SagePayUtil.getResponseData(response); String status = responseData.get("Status"); String statusDetail = responseData.get("StatusDetail"); - + resultMap.put("status", status); resultMap.put("statusDetail", statusDetail); - + //start - payment refunded if ("OK".equals(status)) { successMessage = "Payment Released"; } //end - payment refunded - + //start - refund request not formed properly or parameters missing if ("MALFORMED".equals(status)) { successMessage = "Released request not formed properly or parameters missing"; } //end - refund request not formed properly or parameters missing - + //start - invalid information passed in parameters if ("INVALID".equals(status)) { successMessage = "Invalid information passed in parameters"; @@ -355,7 +355,7 @@ public class SagePayServices successMessage = "Problem at SagePay"; } //end - problem at Sagepay - + resultMap.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); resultMap.put(ModelService.SUCCESS_MESSAGE, successMessage); @@ -375,7 +375,7 @@ public class SagePayServices Debug.logError(ioe, errorMsg, module); resultMap = ServiceUtil.returnError(errorMsg); } finally { - httpClient.getConnectionManager().shutdown(); + httpClient.getConnectionManager().shutdown(); } return resultMap; } @@ -419,7 +419,7 @@ public class SagePayServices String successMessage = null; HttpPost httpPost = SagePayUtil.getHttpPost(props.get("releaseUrl"), parameters); HttpResponse response = httpClient.execute(host, httpPost); - + Map responseData = SagePayUtil.getResponseData(response); String status = responseData.get("Status"); @@ -454,7 +454,7 @@ public class SagePayServices resultMap.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); resultMap.put(ModelService.SUCCESS_MESSAGE, successMessage); - + } catch(UnsupportedEncodingException uee) { //exception in encoding parameters in httpPost String errorMsg = "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")"; @@ -471,7 +471,7 @@ public class SagePayServices Debug.logError(ioe, errorMsg, module); resultMap = ServiceUtil.returnError(errorMsg); } finally { - httpClient.getConnectionManager().shutdown(); + httpClient.getConnectionManager().shutdown(); } return resultMap; } @@ -480,7 +480,7 @@ public class SagePayServices { Debug.logInfo("SagePay - Entered paymentVoid", module); Debug.logInfo("SagePay paymentVoid context : " + context, module); - + Delegator delegator = ctx.getDelegator(); Map resultMap = new HashMap(); @@ -493,7 +493,7 @@ public class SagePayServices HttpClient httpClient = SagePayUtil.getHttpClient(); HttpHost host = SagePayUtil.getHost(props); - + //start - void parameters Map parameters = new HashMap(); @@ -515,7 +515,7 @@ public class SagePayServices HttpPost httpPost = SagePayUtil.getHttpPost(props.get("voidUrl"), parameters); HttpResponse response = httpClient.execute(host, httpPost); Map responseData = SagePayUtil.getResponseData(response); - + String status = responseData.get("Status"); String statusDetail = responseData.get("StatusDetail"); @@ -539,7 +539,7 @@ public class SagePayServices successMessage = "Invalid information passed in parameters"; } //end - invalid information passed in parameters - + //start - problem at Sagepay if ("ERROR".equals(status)) { successMessage = "Problem at SagePay"; @@ -548,7 +548,7 @@ public class SagePayServices resultMap.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); resultMap.put(ModelService.SUCCESS_MESSAGE, successMessage); - + } catch(UnsupportedEncodingException uee) { //exception in encoding parameters in httpPost String errorMsg = "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")"; @@ -565,7 +565,7 @@ public class SagePayServices Debug.logError(ioe, errorMsg, module); resultMap = ServiceUtil.returnError(errorMsg); } finally { - httpClient.getConnectionManager().shutdown(); + httpClient.getConnectionManager().shutdown(); } return resultMap; } @@ -579,12 +579,12 @@ public class SagePayServices Map resultMap = new HashMap(); Map props = buildSagePayProperties(context, delegator); - + String vendorTxCode = (String)context.get("vendorTxCode"); String amount = (String)context.get("amount"); String currency = (String)context.get("currency"); String description = (String)context.get("description"); - + String relatedVPSTxId = (String) context.get("relatedVPSTxId"); String relatedVendorTxCode = (String) context.get("relatedVendorTxCode"); String relatedSecurityKey = (String) context.get("relatedSecurityKey"); @@ -618,12 +618,12 @@ public class SagePayServices HttpPost httpPost = SagePayUtil.getHttpPost(props.get("refundUrl"), parameters); HttpResponse response = httpClient.execute(host, httpPost); Map responseData = SagePayUtil.getResponseData(response); - + Debug.logInfo("response data -> " + responseData, module); - + String status = responseData.get("Status"); String statusDetail = responseData.get("StatusDetail"); - + resultMap.put("status", status); resultMap.put("statusDetail", statusDetail); @@ -634,7 +634,7 @@ public class SagePayServices successMessage = "Payment Refunded"; } //end - payment refunded - + //start - refund not authorized by the acquiring bank if ("NOTAUTHED".equals(status)) { successMessage = "Refund not authorized by the acquiring bank"; @@ -652,13 +652,13 @@ public class SagePayServices successMessage = "Invalid information passed in parameters"; } //end - invalid information passed in parameters - + //start - problem at Sagepay if ("ERROR".equals(status)) { successMessage = "Problem at SagePay"; } //end - problem at Sagepay - + resultMap.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); resultMap.put(ModelService.SUCCESS_MESSAGE, successMessage); @@ -678,7 +678,7 @@ public class SagePayServices Debug.logError(ioe, errorMsg, module); resultMap = ServiceUtil.returnError(errorMsg); } finally { - httpClient.getConnectionManager().shutdown(); + httpClient.getConnectionManager().shutdown(); } return resultMap; diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayUtil.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayUtil.java index bdf002f46d..ad18c85474 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayUtil.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayUtil.java @@ -53,7 +53,7 @@ public class SagePayUtil public static Map buildCardAuthorisationPaymentResponse (Boolean authResult, String authCode, String authFlag, BigDecimal processAmount, String authRefNum, String authAltRefNum, String authMessage) { - + Map result = FastMap.newInstance(); if(authResult != null) { result.put("authResult", authResult); } if(authCode != null) { result.put("authCode", authCode); } @@ -64,7 +64,7 @@ public class SagePayUtil if(authMessage != null) { result.put("authMessage", authMessage); } return result; } - + public static Map buildCardCapturePaymentResponse (Boolean captureResult, String captureCode, String captureFlag, BigDecimal captureAmount, String captureRefNum, String captureAltRefNum, String captureMessage) { @@ -81,7 +81,7 @@ public class SagePayUtil public static Map buildCardReleasePaymentResponse (Boolean releaseResult, String releaseCode, BigDecimal releaseAmount, String releaseRefNum, String releaseAltRefNum, String releaseMessage) { - + Map result = FastMap.newInstance(); if(releaseResult != null) { result.put("releaseResult", releaseResult); } if(releaseCode != null) { result.put("releaseCode", releaseCode); } @@ -103,7 +103,7 @@ public class SagePayUtil if(refundMessage != null) { result.put("refundMessage", refundMessage); } return result; } - + public static Map buildCardRefundPaymentResponse (Boolean refundResult, String refundCode, BigDecimal refundAmount, String refundRefNum, String refundAltRefNum, String refundMessage) { @@ -129,7 +129,7 @@ public class SagePayUtil String port = hostUrl.substring(hostUrl.lastIndexOf(":")+1); return getHost(host, Integer.parseInt(port), scheme); } - + public static HttpHost getHost(String hostName, int port, String scheme) { HttpHost host = new HttpHost(hostName, port, scheme); return host; @@ -157,7 +157,7 @@ public class SagePayUtil } public static HttpPost getHttpPost(String uri, Map parameters) throws UnsupportedEncodingException { - + HttpPost httpPost = new HttpPost(uri); httpPost.addHeader("User-Agent", "HTTP Client"); httpPost.addHeader("Content-type", "application/x-www-form-urlencoded"); @@ -165,14 +165,14 @@ public class SagePayUtil HttpParams params = new BasicHttpParams(); httpPost.setParams(params); - + List postParameters = new ArrayList(); Set keys = parameters.keySet(); for (String key : keys) { String value = parameters.get(key); postParameters.add(new BasicNameValuePair(key, value)); } - + Debug.log("SagePay PostParameters - " + postParameters); HttpEntity postEntity = new UrlEncodedFormEntity(postParameters); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java index e41ad4f026..c8481a1ad0 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java @@ -57,7 +57,7 @@ import paypal.payflow.SDKProperties; public class PayflowPro { public static final String module = PayflowPro.class.getName(); - + /** * Authorize credit card payment service. Service wrapper around PayFlow Pro API. * @param dctx Service Engine DispatchContext. @@ -88,7 +88,7 @@ public class PayflowPro { isPayPal = true; } - Map data = FastMap.newInstance(); + Map data = FastMap.newInstance(); boolean isReAuth = false; if (isPayPal) { @@ -155,7 +155,7 @@ public class PayflowPro { data.put("AMT", processAmount.toString()); PayflowAPI pfp = init(delegator, paymentGatewayConfigId, configString, context); - + // get the base params StringBuilder params = makeBaseParams(delegator, paymentGatewayConfigId, configString); @@ -178,7 +178,7 @@ public class PayflowPro { // Attach the avs info returned in doExpressCheckout and stored in PayPalPaymentMethod resp += "&AVSADDR=" + payPalPaymentMethod.getString("avsAddr") + "&AVSZIP=" + payPalPaymentMethod.getString("avsZip"); } - + // check the response Map result = ServiceUtil.returnSuccess(); parseAuthResponse(delegator, paymentGatewayConfigId, resp, result, configString, isReAuth, isPayPal); @@ -411,8 +411,8 @@ public class PayflowPro { result.put("refundAmount", amount); return result; } - - + + public static Map setExpressCheckout(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); ShoppingCart cart = (ShoppingCart) context.get("cart"); @@ -420,7 +420,7 @@ public class PayflowPro { GenericValue payPalPaymentSetting = ProductStoreWorker.getProductStorePaymentSetting(delegator, cart.getProductStoreId(), "EXT_PAYPAL", null, true); String paymentGatewayConfigId = payPalPaymentSetting.getString("paymentGatewayConfigId"); String configString = "payment.properties"; - + if (cart == null || cart.items().size() <= 0) { return ServiceUtil.returnError(UtilProperties.getMessage("AccountingErrorUiLabels", "AccountingPayPalShoppingCartIsEmpty", locale)); } @@ -436,7 +436,7 @@ public class PayflowPro { } data.put("RETURNURL", getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "returnUrl", configString, "payment.verisign.returnUrl")); data.put("CANCELURL", getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "cancelReturnUrl", configString, "payment.verisign.cancelReturnUrl")); - + try { addCartDetails(data, cart); } catch (GenericEntityException e) { @@ -523,7 +523,7 @@ public class PayflowPro { parameterMap.put("SHIPTOCOUNTRY", StringUtils.left(countryGeo.getString("geoCode"), 2)); } } - + public static Map getExpressCheckout(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); @@ -564,7 +564,7 @@ public class PayflowPro { Debug.logError("A problem occurred while requesting the checkout details from paypal: Result = " + responseMap.get("RESULT") + ", Message = " + responseMap.get("RESPMSG"), module); return ServiceUtil.returnError(UtilProperties.getMessage("AccountingErrorUiLabels", "AccountingPayPalCommunicationError", locale)); } - + Map inMap = FastMap.newInstance(); inMap.put("userLogin", cart.getUserLogin()); inMap.put("partyId", cart.getOrderPartyId()); @@ -584,10 +584,10 @@ public class PayflowPro { return ServiceUtil.returnError(e.getMessage()); } String paymentMethodId = (String) outMap.get("paymentMethodId"); - + cart.clearPayments(); cart.addPaymentAmount(paymentMethodId, cart.getGrandTotal(), true); - + return ServiceUtil.returnSuccess(); } @@ -719,7 +719,7 @@ public class PayflowPro { Debug.logError(e, "Unable to parse response code; not a number!", module); } - + result.put("authRefNum", parameters.get("PNREF")); if (codeInt == 0 && avsCheckOkay && cvv2CheckOkay) { @@ -754,7 +754,7 @@ public class PayflowPro { private static void parseCaptureResponse(String resp, Map result) { Map parameters = parseResponse(resp); - + String respCode = (String) parameters.get("RESULT"); int codeInt = -999; // custom response code -- not from payflow docs try { @@ -782,7 +782,7 @@ public class PayflowPro { private static void parseVoidResponse(String resp, Map result) { Map parameters = parseResponse(resp); - + String respCode = (String) parameters.get("RESULT"); int codeInt = -999; // custom response code -- not from payflow docs try { @@ -810,7 +810,7 @@ public class PayflowPro { private static void parseRefundResponse(String resp, Map result) { Map parameters = parseResponse(resp); - + String respCode = (String) parameters.get("RESULT"); int codeInt = -999; // custom response code -- not from payflow docs try { @@ -896,7 +896,7 @@ public class PayflowPro { Integer loggingLevel = Integer.decode(getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "loggingLevel", resource, "payment.verisign.loggingLevel", "6")); Integer maxLogFileSize = Integer.decode(getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "maxLogFileSize", resource, "payment.verisign.maxLogFileSize", "1000000")); boolean stackTraceOn = "Y".equalsIgnoreCase(getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "stackTraceOn", resource, "payment.verisign.stackTraceOn", "N")); - + PayflowAPI pfp = new PayflowAPI(hostAddress, hostPort.intValue(), timeout.intValue(), proxyAddress, proxyPort.intValue(), proxyLogon, proxyPassword); SDKProperties.setLogFileName(logFileName); @@ -905,7 +905,7 @@ public class PayflowPro { SDKProperties.setStackTraceOn(stackTraceOn); return pfp; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName) { String returnValue = ""; @@ -929,7 +929,7 @@ public class PayflowPro { } return returnValue; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName, String defaultValue) { String returnValue = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, paymentGatewayConfigParameterName, resource, parameterName); @@ -938,11 +938,11 @@ public class PayflowPro { } return returnValue; } - + private static boolean comparePaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName, String compareValue) { boolean returnValue = false; - + String value = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, paymentGatewayConfigParameterName, resource, parameterName, compareValue); if (UtilValidate.isNotEmpty(value)) { returnValue = value.trim().equalsIgnoreCase(compareValue); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java index b42b29e3d9..3b002640e6 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java @@ -55,12 +55,12 @@ import org.ofbiz.service.ModelService; * WorldPay Select Junior Integration Events/Services */ public class WorldPayEvents { - + public static final String resource = "AccountingUiLabels"; public static final String resourceErr = "AccountingErrorUiLabels"; public static final String commonResource = "CommonUiLabels"; public static final String module = WorldPayEvents.class.getName(); - + public static String worldPayRequest(HttpServletRequest request, HttpServletResponse response) { Locale locale = UtilHttp.getLocale(request); Delegator delegator = (Delegator) request.getAttribute("delegator"); @@ -307,7 +307,7 @@ public class WorldPayEvents { } return "success"; } - + /** WorldPay notification */ public static String worldPayNotify(HttpServletRequest request, HttpServletResponse response) { Locale locale = UtilHttp.getLocale(request); @@ -408,7 +408,7 @@ public class WorldPayEvents { } return "success"; } - + private static boolean setPaymentPreferences(Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin, String orderId, HttpServletRequest request) { Debug.logVerbose("Setting payment preferences..", module); List paymentPrefs = null; @@ -431,7 +431,7 @@ public class WorldPayEvents { } return true; } - + private static boolean setPaymentPreference(LocalDispatcher dispatcher, GenericValue userLogin, GenericValue paymentPreference, HttpServletRequest request) { Locale locale = UtilHttp.getLocale(request); String paymentStatus = request.getParameter("transStatus"); @@ -474,7 +474,7 @@ public class WorldPayEvents { response.set("transactionDate", authDate); response.set("gatewayAvsResult", avs); response.set("gatewayCvResult", avs.substring(0, 1)); - + toStore.add(response); try { delegator.storeAll(toStore); @@ -500,7 +500,7 @@ public class WorldPayEvents { } return true; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName) { String returnValue = ""; @@ -524,7 +524,7 @@ public class WorldPayEvents { } return returnValue; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName, String defaultValue) { String returnValue = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, paymentGatewayConfigParameterName, resource, parameterName); diff --git a/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java b/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java index d2cdcd97c8..e699185175 100644 --- a/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java +++ b/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java @@ -261,7 +261,7 @@ public class UtilAccounting { public static boolean isExpenseAccount(GenericValue account) throws GenericEntityException { return isAccountClass(account, "EXPENSE"); } - + /** * Recurses up invoice type tree via parentTypeId to see if input invoice type ID is in tree. */ @@ -280,7 +280,7 @@ public class UtilAccounting { // otherwise, we have to go to the grandparent (recurse) return isInvoiceTypeRecurse(invoiceType.getRelatedOne("ParentInvoiceType"), inputTypeId); } - + /** * Checks if a invoice is of a specified InvoiceType.invoiceTypeId. Return false if invoice is null. It's better to use * more specific calls like isPurchaseInvoice(). diff --git a/applications/content/src/org/ofbiz/content/cms/CmsEvents.java b/applications/content/src/org/ofbiz/content/cms/CmsEvents.java index e81b5254f1..f93824b59d 100644 --- a/applications/content/src/org/ofbiz/content/cms/CmsEvents.java +++ b/applications/content/src/org/ofbiz/content/cms/CmsEvents.java @@ -186,14 +186,14 @@ public class CmsEvents { // verify the request content is associated with the current website int statusCode=-1; boolean hasErrorPage=false; - + try { statusCode = verifyContentToWebSite(delegator, webSiteId, contentId); } catch (GeneralException e) { Debug.logError(e, module); throw new GeneralRuntimeException(e.getMessage(), e); } - + // We try to find a specific Error page for this website concerning the status code if (statusCode!=HttpServletResponseWrapper.SC_OK) { List errorContainers = null; @@ -209,10 +209,10 @@ public class CmsEvents { if (UtilValidate.isNotEmpty(errorContainers)) { if (Debug.verboseOn()) Debug.logVerbose("Found error containers: " + errorContainers, module); GenericValue errorContainer = EntityUtil.getFirst(errorContainers); - + List errorPages = null; try { - errorPages = delegator.findByAnd("ContentAssocViewTo", UtilMisc.toMap("contentIdStart", errorContainer.getString("contentId"), "caContentAssocTypeId", "TREE_CHILD", "contentTypeId", "DOCUMENT", "caMapKey",""+statusCode)); + errorPages = delegator.findByAnd("ContentAssocViewTo", UtilMisc.toMap("contentIdStart", errorContainer.getString("contentId"), "caContentAssocTypeId", "TREE_CHILD", "contentTypeId", "DOCUMENT", "caMapKey",""+statusCode)); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -240,11 +240,11 @@ public class CmsEvents { } } catch (GenericEntityException e) { Debug.logError(e, module); - } + } } } - + if (statusCode==HttpServletResponseWrapper.SC_OK || hasErrorPage) { // create the template map MapStack templateMap = MapStack.create(); @@ -258,7 +258,7 @@ public class CmsEvents { templateMap.put("_REQUEST_HANDLER_", rh); response.setStatus(statusCode); - + // NOTE DEJ20080817: this is done in the ContentMapFacade class now to avoid problems with the jsessionid being in the middle of the URL and such //String contextLinkPrefix = rh.makeLink(request, response, "", true, false, true); //templateMap.put("_CONTEXT_LINK_PREFIX_", contextLinkPrefix); diff --git a/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java b/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java index a43fbc2487..06bbf228ab 100644 --- a/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java +++ b/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java @@ -180,7 +180,7 @@ public class ContentMapFacade implements Map { Debug.logWarning("This method [entrySet()] is not implemented in ContentMapFacade", module); return null; } - + public void setSortOrder(Object obj) { if (!(obj instanceof String)) { Debug.logWarning("sortOrder parameters must be a string", module); @@ -205,8 +205,8 @@ public class ContentMapFacade implements Map { } this.statusFilter=(String) obj; this.subContent.setStatusFilter(obj); - } - + } + // implemented get method public Object get(Object obj) { if (!(obj instanceof String)) { @@ -264,9 +264,9 @@ public class ContentMapFacade implements Map { } if (cache) { - subs = delegator.findByAndCache("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); + subs = delegator.findByAndCache("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); } else { - subs = delegator.findByAnd("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); + subs = delegator.findByAnd("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); } } catch (GenericEntityException e) { Debug.logError(e, module); @@ -412,8 +412,8 @@ public class ContentMapFacade implements Map { } class SubContent extends AbstractInfo { - private String sortOrder="-fromDate"; - private String statusFilter=""; + private String sortOrder="-fromDate"; + private String statusFilter=""; @Override public Object get(Object key) { if (!(key instanceof String)) { @@ -465,7 +465,7 @@ public class ContentMapFacade implements Map { return; } this.statusFilter=(String) obj; - } + } } class MetaData extends AbstractInfo { diff --git a/applications/content/src/org/ofbiz/content/content/ContentWorker.java b/applications/content/src/org/ofbiz/content/content/ContentWorker.java index 08b47f80fe..61b698791c 100644 --- a/applications/content/src/org/ofbiz/content/content/ContentWorker.java +++ b/applications/content/src/org/ofbiz/content/content/ContentWorker.java @@ -182,7 +182,7 @@ public class ContentWorker implements org.ofbiz.widget.ContentWorkerInterface { public static void renderContentAsText(LocalDispatcher dispatcher, Delegator delegator, GenericValue content, Appendable out, MaptemplateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException { // if the content has a service attached run the service - + String serviceName = content.getString("serviceName"); if (dispatcher != null && UtilValidate.isNotEmpty(serviceName)) { DispatchContext dctx = dispatcher.getDispatchContext(); diff --git a/applications/content/src/org/ofbiz/content/survey/SurveyEvents.java b/applications/content/src/org/ofbiz/content/survey/SurveyEvents.java index 6405558b3c..4115d3dc77 100644 --- a/applications/content/src/org/ofbiz/content/survey/SurveyEvents.java +++ b/applications/content/src/org/ofbiz/content/survey/SurveyEvents.java @@ -36,7 +36,7 @@ import org.ofbiz.webapp.event.EventHandlerException; public class SurveyEvents { public static final String module = SurveyEvents.class.getName(); - + public static String createSurveyResponseAndRestoreParameters(HttpServletRequest request, HttpServletResponse response) { // Call createSurveyResponse as an event, easier to setup and ensures parameter security ConfigXMLReader.Event createSurveyResponseEvent = new ConfigXMLReader.Event("service", null, "createSurveyResponse", true); diff --git a/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java b/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java index 2da110d630..07f6fc6672 100644 --- a/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java +++ b/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java @@ -896,7 +896,7 @@ public class ProductionRunServices { } else { Map costMethodResult = dispatcher.runSync(customMethod.getString("customMethodName"), UtilMisc.toMap("productCostComponentCalc", productCostComponentCalc, "costComponentCalc", costComponentCalc, - "costComponentTypePrefix", "ACTUAL", + "costComponentTypePrefix", "ACTUAL", "baseCost", totalCost, "currencyUomId", (String)partyAccountingPreference.get("baseCurrencyUomId"), "userLogin", userLogin)); @@ -2280,7 +2280,7 @@ public class ProductionRunServices { BigDecimal totalQuantity = (BigDecimal)components.get(componentProductId); componentQuantity = totalQuantity.add(componentQuantity); } - + // check if a bom exists List bomList = null; try { @@ -2309,7 +2309,7 @@ public class ProductionRunServices { } catch (GenericEntityException e) { return ServiceUtil.returnError("try to create workeffort assoc"); } - + } else { components.put(componentProductId, componentQuantity); } @@ -2441,7 +2441,7 @@ public class ProductionRunServices { String productionRunId = (String)resultService.get("productionRunId"); result.put("productionRunId", productionRunId); - + try { delegator.create("WorkOrderItemFulfillment", UtilMisc.toMap("workEffortId", productionRunId, "orderId", orderId, "orderItemSeqId", orderItemSeqId)); } catch (GenericEntityException e) { diff --git a/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java b/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java index 5ce2fbde04..2dba1d142a 100644 --- a/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java +++ b/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java @@ -112,7 +112,7 @@ public class VCard { serviceCtx.put("address1", workAddress.getStreet()); serviceCtx.put("city", workAddress.getCity()); serviceCtx.put("postalCode", workAddress.getPostalCode()); - + List countryGeoList = null; List stateGeoList = null; EntityCondition cond = EntityCondition.makeCondition(UtilMisc.toList( @@ -175,16 +175,16 @@ public class VCard { } } } - OrganizationalIdentity oid = contact.getOrganizationalIdentity(); + OrganizationalIdentity oid = contact.getOrganizationalIdentity(); // Useful when creating a contact with more than OOTB - if (!isGroup) { + if (!isGroup) { serviceCtx.put("personalTitle", oid.getTitle()); } // Needed when creating an account (a PartyGroup) if (isGroup) { //serviceCtx.put("partyRole", oid.getRole()); // not used yet,maybe useful later - if (oid.hasOrganization()) { + if (oid.hasOrganization()) { Organization org = oid.getOrganization(); serviceCtx.put("groupName", org.getName()); } @@ -232,7 +232,7 @@ public class VCard { address.setStreet(postalAddress.getString("address1")); address.setCity(postalAddress.getString("city")); - address.setPostalCode(postalAddress.getString("postalCode")); + address.setPostalCode(postalAddress.getString("postalCode")); GenericValue state = postalAddress.getRelatedOne("StateProvinceGeo"); if (UtilValidate.isNotEmpty(state)) { address.setRegion(state.getString("geoName")); diff --git a/applications/order/src/org/ofbiz/order/order/OrderEvents.java b/applications/order/src/org/ofbiz/order/order/OrderEvents.java index 3fa5059f97..0972ea9b58 100644 --- a/applications/order/src/org/ofbiz/order/order/OrderEvents.java +++ b/applications/order/src/org/ofbiz/order/order/OrderEvents.java @@ -96,17 +96,17 @@ public class OrderEvents { return "success"; } - + public static String cancelSelectedOrderItems(HttpServletRequest request, HttpServletResponse response) { LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); Delegator delegator = (Delegator) request.getAttribute("delegator"); HttpSession session = request.getSession(); GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); - + Map resultMap = FastMap.newInstance(); String orderId = request.getParameter("orderId"); String[] orderItemSeqIds = request.getParameterValues("selectedItem"); - + if (orderItemSeqIds != null) { for (String orderItemSeqId : orderItemSeqIds) { try { @@ -115,7 +115,7 @@ public class OrderEvents { for (GenericValue orderItemShipGroupAssoc : orderItemShipGroupAssocs) { GenericValue orderItemShipGroup = orderItemShipGroupAssoc.getRelatedOne("OrderItemShipGroup"); String shipGroupSeqId = orderItemShipGroup.getString("shipGroupSeqId"); - + Map contextMap = FastMap.newInstance(); contextMap.put("orderId", orderId); contextMap.put("orderItemSeqId", orderItemSeqId); @@ -123,14 +123,14 @@ public class OrderEvents { contextMap.put("userLogin", userLogin); try { resultMap = dispatcher.runSync("cancelOrderItem", contextMap); - + if (ServiceUtil.isError(resultMap)) { String errorMessage = (String) resultMap.get("errorMessage"); Debug.logError(errorMessage, module); request.setAttribute("_ERROR_MESSAGE_", errorMessage); return "error"; } - + } catch (GenericServiceException e) { Debug.logError(e, module); request.setAttribute("_ERROR_MESSAGE_", resultMap.get("errorMessage")); @@ -142,7 +142,7 @@ public class OrderEvents { return "error"; } } - return "success"; + return "success"; } else { request.setAttribute("_ERROR_MESSAGE_", "No order item selected. Please select an order item to cancel"); return "error"; diff --git a/applications/order/src/org/ofbiz/order/order/OrderListState.java b/applications/order/src/org/ofbiz/order/order/OrderListState.java index 0d71f23f17..554b674fb8 100644 --- a/applications/order/src/org/ofbiz/order/order/OrderListState.java +++ b/applications/order/src/org/ofbiz/order/order/OrderListState.java @@ -216,7 +216,7 @@ public class OrderListState { if (facilityId != null) { allConditions.add(EntityCondition.makeCondition("originFacilityId", EntityOperator.EQUALS, facilityId)); } - + if (filterDate != null) { List andExprs = new ArrayList(); andExprs.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, UtilDateTime.getDayStart(filterDate))); diff --git a/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java b/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java index 9c929ed2fd..6fea7d8300 100644 --- a/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java +++ b/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java @@ -306,7 +306,7 @@ public class OrderReturnServices { public static Map sendReturnCancelNotification(DispatchContext dctx, Map context) { return sendReturnNotificationScreen(dctx, context, "PRDS_RTN_CANCEL"); } - + // cancel replacement order if return not received within 30 days and send notification public static Map autoCancelReplacementOrders(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); @@ -315,7 +315,7 @@ public class OrderReturnServices { List returnHeaders = null; try { returnHeaders = delegator.findList("ReturnHeader", EntityCondition.makeCondition( - EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "RETURN_ACCEPTED"), EntityOperator.AND, + EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "RETURN_ACCEPTED"), EntityOperator.AND, EntityCondition.makeCondition("returnHeaderTypeId", EntityOperator.EQUALS, "CUSTOMER_RETURN")), null, UtilMisc.toList("entryDate"), null, false); } catch (GenericEntityException e) { Debug.logError(e, "Problem getting Return headers", module); @@ -339,7 +339,7 @@ public class OrderReturnServices { if (cancelDate.equals(nowDate) || nowDate.after(cancelDate)) { try { List returnItems = delegator.findList("ReturnItem", EntityCondition.makeCondition( - EntityCondition.makeCondition("returnId", EntityOperator.EQUALS, returnId), EntityOperator.AND, + EntityCondition.makeCondition("returnId", EntityOperator.EQUALS, returnId), EntityOperator.AND, EntityCondition.makeCondition("returnTypeId", EntityOperator.EQUALS, "RTN_WAIT_REPLACE_RES")), null, UtilMisc.toList("createdStamp"), null, false); for (GenericValue returnItem : returnItems) { GenericValue returnItemResponse = returnItem.getRelatedOne("ReturnItemResponse"); @@ -969,7 +969,7 @@ public class OrderReturnServices { return ServiceUtil.returnSuccess(); } - + /** * Helper method to get billing account balance, cannot use BillingAccountWorker.getBillingAccountBalance() * due to circular build dependency. @@ -1094,7 +1094,7 @@ public class OrderReturnServices { GenericValue userLogin = (GenericValue) context.get("userLogin"); String orderId = (String) context.get("orderId"); Map serviceResult = FastMap.newInstance(); - + GenericValue orderHeader = null; List orderPayPrefs = FastList.newInstance(); try { @@ -1104,7 +1104,7 @@ public class OrderReturnServices { Debug.logError("Problem looking up order information for orderId #" + orderId, module); ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "OrderCannotGetOrderHeader", locale)); } - + // Check for replacement order if (UtilValidate.isEmpty(orderPayPrefs)) { List returnItemResponses = FastList.newInstance(); @@ -1114,7 +1114,7 @@ public class OrderReturnServices { Debug.logError("Problem getting ReturnItemResponses", module); ServiceUtil.returnError(e.getMessage()); } - + for (GenericValue returnItemResponse : returnItemResponses) { GenericValue returnItem = null; GenericValue returnHeader = null; @@ -1125,7 +1125,7 @@ public class OrderReturnServices { Debug.logError("Problem getting ReturnItem", module); ServiceUtil.returnError(e.getMessage()); } - + if ("RETURN_RECEIVED".equals(returnHeader.getString("statusId"))) { String returnId = returnItem.getString("returnId"); String returnTypeId = returnItem.getString("returnTypeId"); @@ -1204,7 +1204,7 @@ public class OrderReturnServices { List exprs = UtilMisc.toList(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PAYMENT_SETTLED"), EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PAYMENT_RECEIVED")); orderPayPrefs = EntityUtil.filterByOr(orderPayPrefs, exprs); - + // Check for replacement order if (UtilValidate.isEmpty(orderPayPrefs)) { List orderItemAssocs = delegator.findByAnd("OrderItemAssoc", UtilMisc.toMap("toOrderId", orderId, "orderItemAssocTypeId", "REPLACEMENT")); @@ -1255,10 +1255,10 @@ public class OrderReturnServices { // We break the OPPs down this way because we need to process the refunds to payment methods in a particular order Map receivedPaymentTotalsByPaymentMethod = orderReadHelper.getReceivedPaymentTotalsByPaymentMethod() ; Map refundedTotalsByPaymentMethod = orderReadHelper.getReturnedTotalsByPaymentMethod() ; - - // getOrderPaymentPreferenceTotalByType has been called because getReceivedPaymentTotalsByPaymentMethod does not + + // getOrderPaymentPreferenceTotalByType has been called because getReceivedPaymentTotalsByPaymentMethod does not // return payments captured from Billing Account.This is because when payment is captured from Billing Account - // then no entry is maintained in Payment entity. + // then no entry is maintained in Payment entity. BigDecimal receivedPaymentTotalsByBillingAccount = orderReadHelper.getOrderPaymentPreferenceTotalByType("EXT_BILLACT"); /* @@ -1278,7 +1278,7 @@ public class OrderReturnServices { if (receivedPaymentTotalsByPaymentMethod.containsKey(orderPayPrefKey)) { orderPayPrefReceivedTotal = orderPayPrefReceivedTotal.add((BigDecimal)receivedPaymentTotalsByPaymentMethod.get(orderPayPrefKey)).setScale(decimals, rounding); } - + if (receivedPaymentTotalsByBillingAccount != null) { orderPayPrefReceivedTotal = orderPayPrefReceivedTotal.add(receivedPaymentTotalsByBillingAccount); } @@ -1306,7 +1306,7 @@ public class OrderReturnServices { // This can be extended to support additional electronic types List electronicTypes = UtilMisc.toList("CREDIT_CARD", "EFT_ACCOUNT", "FIN_ACCOUNT", "GIFT_CARD"); - + // Figure out if EXT_PAYPAL should be considered as an electronic type if (productStore != null) { ExpressCheckoutEvents.CheckoutType payPalType = ExpressCheckoutEvents.determineCheckoutType(delegator, productStore.getString("productStoreId")); @@ -1433,7 +1433,7 @@ public class OrderReturnServices { Iterator itemsIter = items.iterator(); while (itemsIter.hasNext()) { GenericValue item = (GenericValue) itemsIter.next(); - + Map returnItemMap = UtilMisc.toMap("returnItemResponseId", responseId, "returnId", item.get("returnId"), "returnItemSeqId", item.get("returnItemSeqId"), "statusId", returnItemStatusId, "userLogin", userLogin); //Debug.log("Updating item status", module); try { @@ -2074,7 +2074,7 @@ public class OrderReturnServices { } if (ServiceUtil.isError(serviceResult)) { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult)); - } + } } else { OrderChangeHelper.approveOrder(dispatcher, userLogin, createdOrderId); } diff --git a/applications/order/src/org/ofbiz/order/order/OrderServices.java b/applications/order/src/org/ofbiz/order/order/OrderServices.java index 8e925eb5a9..b8bca6bcf6 100644 --- a/applications/order/src/org/ofbiz/order/order/OrderServices.java +++ b/applications/order/src/org/ofbiz/order/order/OrderServices.java @@ -933,7 +933,7 @@ public class OrderServices { toBeStored.add(productPromoUse); } } - + // store the orderProductPromoCodes Set orderProductPromoCodes = (Set) context.get("orderProductPromoCodes"); if (UtilValidate.isNotEmpty(orderProductPromoCodes)) { @@ -3191,7 +3191,7 @@ public class OrderServices { GenericValue userLogin = (GenericValue) context.get("userLogin"); String orderId = (String) context.get("orderId"); Locale locale = (Locale) context.get("locale"); - + OrderReadHelper orh = null; try { orh = new OrderReadHelper(delegator, orderId); @@ -3323,12 +3323,12 @@ public class OrderServices { } else { throw new CartItemModifyException("No supplier information found for product [" + productId + "] and quantity quantity [" + quantity + "], cannot add to cart."); } - + if (basePrice != null) { item.setBasePrice(basePrice); item.setIsModifiedPrice(true); } - + cart.setItemShipGroupQty(item, item.getQuantity(), shipGroupIdx); } else { ShoppingCartItem item = ShoppingCartItem.makeItem(null, productId, null, quantity, null, null, null, null, null, null, null, null, prodCatalogId, null, null, null, dispatcher, cart, null, null, null, Boolean.FALSE, Boolean.FALSE); @@ -3565,7 +3565,7 @@ public class OrderServices { // run promotions to handle all changes in the cart ProductPromoWorker.doPromotions(cart, dispatcher); - + // log an order note try { dispatcher.runSync("createOrderNote", UtilMisc.toMap("orderId", orderId, "note", "Updated order.", "internalNote", "Y", "userLogin", userLogin)); @@ -3837,7 +3837,7 @@ public class OrderServices { toStore.addAll(cart.makeOrderItems()); toStore.addAll(cart.makeAllAdjustments()); - + String shipGroupSeqId = null; long groupIndex = cart.getShipInfoSize(); List orderAdjustments = new ArrayList(); @@ -3863,7 +3863,7 @@ public class OrderServices { } for (GenericValue toAdd: (List)toAddList) { if ("OrderAdjustment".equals(toAdd.getEntityName())) { - if (toAdd.get("comments") != null && ((String)toAdd.get("comments")).startsWith("Added manually by") && (("PROMOTION_ADJUSTMENT".equals(toAdd.get("orderAdjustmentTypeId"))) || + if (toAdd.get("comments") != null && ((String)toAdd.get("comments")).startsWith("Added manually by") && (("PROMOTION_ADJUSTMENT".equals(toAdd.get("orderAdjustmentTypeId"))) || ("SHIPPING_CHARGES".equals(toAdd.get("orderAdjustmentTypeId"))) || ("SALES_TAX".equals(toAdd.get("orderAdjustmentTypeId"))))) { toStore.add(toAdd); } @@ -5304,7 +5304,7 @@ public class OrderServices { LocalDispatcher dispatcher = dctx.getDispatcher(); // All orders with an entryDate > orderEntryFromDateTime will be processed Timestamp orderEntryFromDateTime = (Timestamp) context.get("orderEntryFromDateTime"); - // If true all orders ever created will be processed and any pre-existing ALSO_BOUGHT ProductAssocs will be expired + // If true all orders ever created will be processed and any pre-existing ALSO_BOUGHT ProductAssocs will be expired boolean processAllOrders = context.get("processAllOrders") == null ? false : (Boolean) context.get("processAllOrders"); if (orderEntryFromDateTime == null && !processAllOrders) { // No from date supplied, check to see when this service last ran and use the startDateTime @@ -5368,14 +5368,14 @@ public class OrderServices { } return ServiceUtil.returnSuccess(); } - + public static Map createAlsoBoughtProductAssocsForOrder(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); String orderId = (String) context.get("orderId"); OrderReadHelper orh = new OrderReadHelper(delegator, orderId); List orderItems = orh.getOrderItems(); - // In order to improve efficiency a little bit, we will always create the ProductAssoc records + // In order to improve efficiency a little bit, we will always create the ProductAssoc records // with productId < productIdTo when the two are compared. This way when checking for an existing // record we don't have to check both possible combinations of productIds TreeSet productIdSet = new TreeSet(); @@ -5436,7 +5436,7 @@ public class OrderServices { } } } - + return ServiceUtil.returnSuccess(); } } diff --git a/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java b/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java index 33d6245c1c..2762325517 100644 --- a/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java +++ b/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java @@ -269,8 +269,8 @@ public class RequirementServices { GenericValue item = (GenericValue) iter.next(); GenericValue product = item.getRelatedOne("Product"); if (product == null) continue; - - if (!("PRODRQM_ATP".equals(product.get("requirementMethodEnumId")) || + + if (!("PRODRQM_ATP".equals(product.get("requirementMethodEnumId")) || ("PRODRQM_ATP".equals(productStore.get("requirementMethodEnumId")) && product.get("requirementMethodEnumId") == null))) continue; BigDecimal quantity = item.getBigDecimal("quantity"); diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java b/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java index 4eb5d8e379..3b4e33eda0 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java @@ -1145,7 +1145,7 @@ public class CheckOutEvents { Debug.logError(e.getMessage(), module); } } - + String result = createOrder(request, response); if ("error".equals(result)) { return "error"; diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java index 1555a570f5..37cb1da608 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java @@ -829,7 +829,7 @@ public class ShoppingCart implements Serializable { return null; } return (ShoppingCartItem) cartLines.get(index); - + } public ShoppingCartItem findCartItem(String orderItemSeqId) { @@ -1977,8 +1977,8 @@ public class ShoppingCart implements Serializable { CartShipInfo csi = this.getShipInfo(i); csi.shipItemInfo.remove(item); } - - // DEJ20100107: commenting this out because we do NOT want to clear out ship group info since there is information there that will be lost; good enough to clear the item/group association which can be restored later (though questionable, the whole processes using this should be rewritten to not destroy information! + + // DEJ20100107: commenting this out because we do NOT want to clear out ship group info since there is information there that will be lost; good enough to clear the item/group association which can be restored later (though questionable, the whole processes using this should be rewritten to not destroy information! // this.cleanUpShipGroups(); } @@ -2037,15 +2037,15 @@ public class ShoppingCart implements Serializable { if (quantity.compareTo(item.getQuantity()) > 0) { quantity = item.getQuantity(); } - + // re-set the ship group's before and after dates based on the item's csi.resetShipBeforeDateIfAfter(item.getShipBeforeDate()); csi.resetShipAfterDateIfBefore(item.getShipAfterDate()); - + CartShipInfo.CartShipItemInfo csii = csi.setItemInfo(item, quantity); this.checkShipItemInfo(csi, csii); - } + } } } @@ -3166,7 +3166,7 @@ public class ShoppingCart implements Serializable { */ public String addProductPromoCode(String productPromoCodeId, LocalDispatcher dispatcher) { if (this.productPromoCodes.contains(productPromoCodeId)) { - return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_already_been_entered", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale); + return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_already_been_entered", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale); } // if the promo code requires it make sure the code is valid String checkResult = ProductPromoWorker.checkCanUsePromoCode(productPromoCodeId, this.getPartyId(), this.getDelegator(), locale); @@ -3807,7 +3807,7 @@ public class ShoppingCart implements Serializable { } return groups; } - + public int getShipInfoSize() { return this.shipInfo.size(); } @@ -4307,19 +4307,19 @@ public class ShoppingCart implements Serializable { public Timestamp shipAfterDate = null; private String shipGroupSeqId = null; public String vendorPartyId = null; - + public CartShipInfo() { // Debug.logInfo(new Exception(), "Created a new CartShipInfo", module); } public String getOrderTypeId() { return orderTypeId; } - + public String getContactMechId() { return internalContactMechId; } public void setContactMechId(String contactMechId) { this.internalContactMechId = contactMechId; // Debug.logInfo(new Exception(), "Set CartShipInfo.contactMechId=" + this.internalContactMechId, module); } - + public String getCarrierPartyId() { return carrierPartyId; } public String getSupplierPartyId() { return supplierPartyId; } public String getShipmentMethodTypeId() { return shipmentMethodTypeId; } @@ -4330,24 +4330,24 @@ public class ShoppingCart implements Serializable { this.shipGroupSeqId = shipGroupSeqId; // Debug.logInfo(new Exception(), "============= On CartShipInfo shipGroupSeqId to " + this.shipGroupSeqId, module); } - + public String getFacilityId() { return facilityId; } public void setFacilityId(String facilityId) { this.facilityId = facilityId; // Debug.logInfo(new Exception(), "============= On CartShipInfo setFacilityId to " + this.facilityId, module); } - + public String getVendorPartyId() { return vendorPartyId;} public void setVendorPartyId(String vendorPartyId) { this.vendorPartyId = vendorPartyId; } - + public void setMaySplit(Boolean maySplit) { if (UtilValidate.isNotEmpty(maySplit)) { this.maySplit = maySplit.booleanValue() ? "Y" : "N"; } } - + public List makeItemShipGroupAndAssoc(Delegator delegator, ShoppingCart cart, long groupIndex) { shipGroupSeqId = UtilFormatOut.formatPaddedNumber(groupIndex, 5); @@ -4375,7 +4375,7 @@ public class ShoppingCart implements Serializable { shipGroup.set("shipGroupSeqId", shipGroupSeqId); shipGroup.set("vendorPartyId", vendorPartyId); shipGroup.set("facilityId", facilityId); - + // Debug.logInfo("=================Creating ship group value: " + shipGroup, module); // use the cart's default ship before and after dates here diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java index 19aba94d44..77b304116e 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java @@ -1195,14 +1195,14 @@ public class ShoppingCartEvents { request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error, "OrderOrderTermTypeIsRequired", locale)); return "error"; } - + try { termType = delegator.findOne("TermType", UtilMisc.toMap("termTypeId", termTypeId), false); } catch (GenericEntityException gee) { request.setAttribute("_ERROR_MESSAGE_", gee.getMessage()); return "error"; } - + if (("FIN_PAYMENT_TERM".equals(termTypeId) && UtilValidate.isEmpty(termDaysStr)) || (UtilValidate.isNotEmpty(termType) && "FIN_PAYMENT_TERM".equals(termType.get("parentTypeId")) && UtilValidate.isEmpty(termDaysStr))) { request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error, "OrderOrderTermDaysIsRequired", locale)); return "error"; @@ -1356,15 +1356,15 @@ public class ShoppingCartEvents { shipGroupSeqId = UtilFormatOut.formatPaddedNumber(1, 5); List duplicateAdjustmentList = new ArrayList(); for (GenericValue adjustment: (List)orderAdjustmentList) { - if ("PROMOTION_ADJUSTMENT".equals(adjustment.get("orderAdjustmentTypeId"))) { + if ("PROMOTION_ADJUSTMENT".equals(adjustment.get("orderAdjustmentTypeId"))) { cart.addAdjustment(adjustment); } if ("SALES_TAX".equals(adjustment.get("orderAdjustmentTypeId"))) { - if (adjustment.get("description") != null + if (adjustment.get("description") != null && ((String)adjustment.get("description")).startsWith("Tax adjustment due")) { cart.addAdjustment(adjustment); } - if ( adjustment.get("comments") != null + if ( adjustment.get("comments") != null && ((String)adjustment.get("comments")).startsWith("Added manually by")) { cart.addAdjustment(adjustment); } @@ -1392,9 +1392,9 @@ public class ShoppingCartEvents { session.setAttribute("productStoreId", cart.getProductStoreId()); session.setAttribute("orderMode", cart.getOrderType()); session.setAttribute("orderPartyId", cart.getOrderPartyId()); - + // Since we only need the cart items, so set the order id as null - cart.setOrderId(null); + cart.setOrderId(null); return "success"; } diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java index d46509ff3f..a6a6f89226 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java @@ -723,7 +723,7 @@ public class ShoppingCartItem implements java.io.Serializable { this.itemType = "PRODUCT_ORDER_ITEM"; } } else { - // NOTE DEJ20100111: it seems safe to assume here that because a product is passed in that even if the product has no type this type of item still applies; thanks to whoever wrote the previous code, that's a couple of hours tracking this down that I wouldn't have minded doing something else with... :) + // NOTE DEJ20100111: it seems safe to assume here that because a product is passed in that even if the product has no type this type of item still applies; thanks to whoever wrote the previous code, that's a couple of hours tracking this down that I wouldn't have minded doing something else with... :) this.itemType = "PRODUCT_ORDER_ITEM"; } } else { diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java index 8bee74320c..bdc7adb904 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java @@ -302,23 +302,23 @@ public class ShoppingCartServices { List orderItemShipGroupList = orh.getOrderItemShipGroups(); for (GenericValue orderItemShipGroup: orderItemShipGroupList) { // Debug.logInfo("===================== Load order: orderItemShipGroup=" + orderItemShipGroup, module); - + // should be sorted by shipGroupSeqId int newShipInfoIndex = cart.addShipInfo(); - + // shouldn't be gaps in it but allow for that just in case String cartShipGroupIndexStr = orderItemShipGroup.getString("shipGroupSeqId"); int cartShipGroupIndex = NumberUtils.toInt(cartShipGroupIndexStr); - + if (newShipInfoIndex != (cartShipGroupIndex - 1)) { int groupDiff = cartShipGroupIndex - cart.getShipGroupSize(); for (int i = 0; i < groupDiff; i++) { newShipInfoIndex = cart.addShipInfo(); } } - + CartShipInfo cartShipInfo = cart.getShipInfo(newShipInfoIndex); - + cartShipInfo.shipAfterDate = orderItemShipGroup.getTimestamp("shipAfterDate"); cartShipInfo.shipBeforeDate = orderItemShipGroup.getTimestamp("shipByDate"); cartShipInfo.shipmentMethodTypeId = orderItemShipGroup.getString("shipmentMethodTypeId"); @@ -343,7 +343,7 @@ public class ShoppingCartServices { // get product Id String productId = item.getString("productId"); GenericValue product = null; - // creates survey responses for Gift cards same as last Order created + // creates survey responses for Gift cards same as last Order created Map surveyResponseResult = null; try { product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false); @@ -360,7 +360,7 @@ public class ShoppingCartServices { surveyResponseMap.put("surveyId", surveyId); surveyResponseResult = dispatcher.runSync("createSurveyResponse", surveyResponseMap); } - } + } } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -473,7 +473,7 @@ public class ShoppingCartServices { // flag the item w/ the orderItemSeqId so we can reference it ShoppingCartItem cartItem = cart.findCartItem(itemIndex); cartItem.setOrderItemSeqId(item.getString("orderItemSeqId")); - + // attach surveyResponseId for each item if (UtilValidate.isNotEmpty(surveyResponseResult)){ cartItem.setAttribute("surveyResponseId",surveyResponseResult.get("surveyResponseId")); @@ -534,7 +534,7 @@ public class ShoppingCartServices { } } } - + // setup the OrderItemShipGroupAssoc records if (UtilValidate.isNotEmpty(orderItems)) { int itemIndex = 0; @@ -548,7 +548,7 @@ public class ShoppingCartServices { if (shipGroupQty == null) { shipGroupQty = BigDecimal.ZERO; } - + String cartShipGroupIndexStr = sgAssoc.getString("shipGroupSeqId"); int cartShipGroupIndex = NumberUtils.toInt(cartShipGroupIndexStr); @@ -556,7 +556,7 @@ public class ShoppingCartServices { if (cartShipGroupIndex > 0) { cart.positionItemToGroup(itemIndex, shipGroupQty, 0, cartShipGroupIndex, false); } - + cart.setItemShipGroupQty(itemIndex, shipGroupQty, cartShipGroupIndex); } itemIndex ++; diff --git a/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java b/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java index ae0d1b272a..ff86167eec 100644 --- a/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java +++ b/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java @@ -842,11 +842,11 @@ public class ProductPromoWorker { if (UtilValidate.isNotEmpty(condValue)) { BigDecimal amountNeeded = new BigDecimal(condValue); BigDecimal amountAvailable = BigDecimal.ZERO; - + // Debug.logInfo("Doing Amount Not Counted Cond with Value: " + amountNeeded, module); - + Set productIds = ProductPromoWorker.getPromoRuleCondProductIds(productPromoCond, delegator, nowTimestamp); - + List lineOrderedByBasePriceList = cart.getLineListOrderedByBasePrice(false); Iterator lineOrderedByBasePriceIter = lineOrderedByBasePriceList.iterator(); while (lineOrderedByBasePriceIter.hasNext()) { @@ -857,14 +857,14 @@ public class ProductPromoWorker { if (!cartItem.getIsPromo() && (productIds.contains(cartItem.getProductId()) || (parentProductId != null && productIds.contains(parentProductId))) && (product == null || !"N".equals(product.getString("includeInPromotions")))) { - + // just count the entire sub-total of the item amountAvailable = amountAvailable.add(cartItem.getItemSubTotal()); } } - + // Debug.logInfo("Doing Amount Not Counted Cond with Value after finding applicable cart lines: " + amountNeeded, module); - + compareBase = Integer.valueOf(amountAvailable.compareTo(amountNeeded)); } } else if ("PPIP_PRODUCT_QUANT".equals(inputParamEnumId)) { @@ -1136,7 +1136,7 @@ public class ProductPromoWorker { } catch (RecurrenceInfoException e) { Debug.logError(e, module); } - + // check the current recurrence if (recurrence != null) { if (recurrence.isValidCurrent()) { diff --git a/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java b/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java index c6d2794623..ed54e67ddc 100644 --- a/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java +++ b/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java @@ -48,11 +48,11 @@ public class ExpressCheckoutEvents { public static final String resourceErr = "AccountingErrorUiLabels"; public static final String module = ExpressCheckoutEvents.class.getName(); public static enum CheckoutType {PAYFLOW, STANDARD, NONE}; - + public static String setExpressCheckout(HttpServletRequest request, HttpServletResponse response) { Locale locale = UtilHttp.getLocale(request); LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); - + ShoppingCart cart = ShoppingCartEvents.getCartObject(request); CheckoutType checkoutType = determineCheckoutType(request); if (!checkoutType.equals(CheckoutType.NONE)) { @@ -98,7 +98,7 @@ public class ExpressCheckoutEvents { } return "success"; } - + public static String expressCheckoutUpdate(HttpServletRequest request, HttpServletResponse response) { LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); CheckoutType checkoutType = determineCheckoutType(request); @@ -118,7 +118,7 @@ public class ExpressCheckoutEvents { public static String getExpressCheckoutDetails(HttpServletRequest request, HttpServletResponse response) { Locale locale = UtilHttp.getLocale(request); LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); - + ShoppingCart cart = ShoppingCartEvents.getCartObject(request); CheckoutType checkoutType = determineCheckoutType(request); if (!checkoutType.equals(CheckoutType.NONE)) { @@ -142,10 +142,10 @@ public class ExpressCheckoutEvents { return "error"; } } - + return "success"; } - + public static Map doExpressCheckout(String productStoreId, String orderId, GenericValue paymentPref, GenericValue userLogin, Delegator delegator, LocalDispatcher dispatcher) { CheckoutType checkoutType = determineCheckoutType(delegator, productStoreId); if (!checkoutType.equals(CheckoutType.NONE)) { @@ -166,7 +166,7 @@ public class ExpressCheckoutEvents { } return result; } - + return ServiceUtil.returnSuccess(); } @@ -205,5 +205,5 @@ public class ExpressCheckoutEvents { } return CheckoutType.NONE; } - + } \ No newline at end of file diff --git a/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java b/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java index 2de37f302c..3a28ca399e 100644 --- a/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java +++ b/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java @@ -121,9 +121,9 @@ public class CommunicationEventServices { sendMailParams.put("subject", communicationEvent.getString("subject")); sendMailParams.put("contentType", communicationEvent.getString("contentMimeTypeId")); sendMailParams.put("userLogin", userLogin); - + Debug.logInfo("Sending communicationEvent: " + communicationEventId, module); - + // check for attachments boolean isMultiPart = false; List comEventContents = communicationEvent.getRelated("CommEventContentAssoc"); @@ -159,7 +159,7 @@ public class CommunicationEventServices { String errMsg = UtilProperties.getMessage(resource,"commeventservices.communication_event_to_contact_mech_must_be_email", locale); return ServiceUtil.returnError(errMsg + " " + communicationEventId); } - + // add other parties from roles String sendCc = null; String sendBcc = null; @@ -303,16 +303,16 @@ public class CommunicationEventServices { EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "CLPT_ACCEPTED"), EntityCondition.makeCondition("preferredContactMechId", EntityOperator.NOT_EQUAL, null), EntityUtil.getFilterByDateExpr(), EntityUtil.getFilterByDateExpr("contactFromDate", "contactThruDate")); - + EntityConditionList conditions = EntityCondition.makeCondition(conditionList, EntityOperator.AND); Set fieldsToSelect = UtilMisc.toSet("infoString"); eli = delegator.find("ContactListPartyAndContactMech", conditions, null, fieldsToSelect, null, new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true)); - - // Send an email to each contact list member + + // Send an email to each contact list member List orderBy = UtilMisc.toList("-fromDate"); - + // loop through the list iterator for (GenericValue contactListPartyAndContactMech; (contactListPartyAndContactMech = eli.next()) != null;) { Debug.logInfo("Contact info: " + contactListPartyAndContactMech, module); @@ -363,7 +363,7 @@ public class CommunicationEventServices { // No attempt has been made previously to send to this address, so create a record to reflect // the beginning of the current attempt Map newContactListCommStatusRecordMap = UtilMisc.makeMapWritable(contactListCommStatusRecordMap); - newContactListCommStatusRecordMap.put("statusId", "COM_IN_PROGRESS"); + newContactListCommStatusRecordMap.put("statusId", "COM_IN_PROGRESS"); newContactListCommStatusRecordMap.put("partyId", partyId); contactListCommStatusRecord = delegator.create("ContactListCommStatus", newContactListCommStatusRecordMap); } else if (contactListCommStatusRecord.get("statusId") != null && contactListCommStatusRecord.getString("statusId").equals("COM_COMPLETE")) { @@ -377,9 +377,9 @@ public class CommunicationEventServices { Map tmpResult = dispatcher.runSync("sendMail", sendMailParams, 360, true); if (tmpResult == null || ServiceUtil.isError(tmpResult)) { if (ServiceUtil.getErrorMessage(tmpResult).startsWith("[ADDRERR]")) { - // address error; mark the communication event as BOUNCED + // address error; mark the communication event as BOUNCED contactListCommStatusRecord.set("statusId", "COM_BOUNCED"); - try { + try { contactListCommStatusRecord.store(); } catch (GenericEntityException e) { Debug.logError(e, module); @@ -406,11 +406,11 @@ public class CommunicationEventServices { } else { // attach the parent communication event to the new event created when sending the mail String thisCommEventId = (String) tmpResult.get("communicationEventId"); - GenericValue thisCommEvent = delegator.findOne("CommunicationEvent", false, "communicationEventId", thisCommEventId); + GenericValue thisCommEvent = delegator.findOne("CommunicationEvent", false, "communicationEventId", thisCommEventId); if (thisCommEvent != null) { thisCommEvent.set("contactListId", contactListId); thisCommEvent.set("parentCommEventId", communicationEventId); - thisCommEvent.store(); + thisCommEvent.store(); } String messageId = (String) tmpResult.get("messageId"); //contactListCommStatusRecord.set("communicationEventId", thisCommEventId); @@ -453,7 +453,7 @@ public class CommunicationEventServices { try { eli.close(); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, module); } } } @@ -480,25 +480,25 @@ public class CommunicationEventServices { } /* - * Store an outgoing email as a communication event; + * Store an outgoing email as a communication event; * runs as a pre-invoke ECA on sendMail and sendMultipartMail services * - service should run as the 'system' user */ public static Map createCommEventFromEmail(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - + GenericValue userLogin = (GenericValue) context.get("userLogin"); String subject = (String) context.get("subject"); String sendFrom = (String) context.get("sendFrom"); String sendTo = (String) context.get("sendTo"); - String partyId = (String) context.get("partyId"); - String contentType = (String) context.get("contentType"); + String partyId = (String) context.get("partyId"); + String contentType = (String) context.get("contentType"); String statusId = (String) context.get("statusId"); if (statusId == null) { statusId = "COM_PENDING"; } - + // get the from contact mech info String contactMechIdFrom = null; String partyIdFrom = null; @@ -515,7 +515,7 @@ public class CommunicationEventServices { contactMechIdFrom = fromCm.getString("contactMechId"); partyIdFrom = fromCm.getString("partyId"); } - + // get the to contact mech info String contactMechIdTo = null; GenericValue toCm; @@ -530,25 +530,25 @@ public class CommunicationEventServices { if (toCm != null) { contactMechIdTo = toCm.getString("contactMechId"); } - + Timestamp now = UtilDateTime.nowTimestamp(); - + Map commEventMap = FastMap.newInstance(); commEventMap.put("communicationEventTypeId", "EMAIL_COMMUNICATION"); commEventMap.put("contactMechTypeId", "EMAIL_ADDRESS"); commEventMap.put("contactMechIdFrom", contactMechIdFrom); commEventMap.put("contactMechIdTo", contactMechIdTo); commEventMap.put("statusId", statusId); - + commEventMap.put("partyIdFrom", partyIdFrom); commEventMap.put("partyIdTo", partyId); commEventMap.put("datetimeStarted", now); commEventMap.put("entryDate", now); - - commEventMap.put("subject", subject); + + commEventMap.put("subject", subject); commEventMap.put("userLogin", userLogin); commEventMap.put("contentMimeTypeId", contentType); - + Map createResult; try { createResult = dispatcher.runSync("createCommunicationEvent", commEventMap); @@ -560,12 +560,12 @@ public class CommunicationEventServices { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(createResult)); } String communicationEventId = (String) createResult.get("communicationEventId"); - + Map result = ServiceUtil.returnSuccess(); result.put("communicationEventId", communicationEventId); return result; } - + /* * Update the communication event with information from the email; * runs as a post-commit ECA on sendMail and sendMultiPartMail services @@ -573,11 +573,11 @@ public class CommunicationEventServices { */ public static Map updateCommEventAfterEmail(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); - + GenericValue userLogin = (GenericValue) context.get("userLogin"); String communicationEventId = (String) context.get("communicationEventId"); MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper"); - + Map commEventMap = FastMap.newInstance(); commEventMap.put("communicationEventId", communicationEventId); commEventMap.put("subject", wrapper.getSubject()); @@ -587,27 +587,27 @@ public class CommunicationEventServices { commEventMap.put("messageId", wrapper.getMessageId()); commEventMap.put("userLogin", userLogin); commEventMap.put("content", wrapper.getMessageBody()); - + // populate the address (to/from/cc/bcc) data populateAddressesFromMessage(wrapper, commEventMap); - - // save the communication event + + // save the communication event try { dispatcher.runSync("updateCommunicationEvent", commEventMap); } catch (GenericServiceException e) { return ServiceUtil.returnError(e.getMessage()); } - + // attachments try { createAttachmentContent(dispatcher, wrapper, communicationEventId, userLogin); } catch (GenericServiceException e) { return ServiceUtil.returnError(e.getMessage()); - } - + } + return ServiceUtil.returnSuccess(); } - + /** * This service is the main one for processing incoming emails. * @@ -643,7 +643,7 @@ public class CommunicationEventServices { Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper"); - + Timestamp nowTimestamp = UtilDateTime.nowTimestamp(); GenericValue userLogin = (GenericValue) context.get("userLogin"); String partyIdTo = null; @@ -717,7 +717,7 @@ public class CommunicationEventServices { } String deliveredTo = wrapper.getFirstHeader("Delivered-To"); - if (deliveredTo != null) { + if (deliveredTo != null) { // check if started with the domain name if yes remove including the dash. String dn = deliveredTo.substring(deliveredTo.indexOf("@")+1, deliveredTo.length()); if (deliveredTo.startsWith(dn)) { @@ -766,7 +766,7 @@ public class CommunicationEventServices { if (messageBodyContentType.indexOf(";") > -1) { messageBodyContentType = messageBodyContentType.substring(0, messageBodyContentType.indexOf(";")); } - + // select the plain text bodypart String messageBody = null; if (wrapper.getMainPartCount() > 1) { @@ -778,13 +778,13 @@ public class CommunicationEventServices { } } } - + if (messageBody == null) { messageBody = wrapper.getMessageBody(); } - + commEventMap.put("content", messageBody); - commEventMap.put("contentMimeTypeId", messageBodyContentType.toLowerCase()); + commEventMap.put("contentMimeTypeId", messageBodyContentType.toLowerCase()); // check for for a reply to communication event (using in-reply-to the parent messageID) String[] inReplyTo = wrapper.getHeader("In-Reply-To"); @@ -807,7 +807,7 @@ public class CommunicationEventServices { // populate the address (to/from/cc/bcc) data populateAddressesFromMessage(wrapper, commEventMap); - + // store from/to parties, but when not found make a note of the email to/from address in the workEffort Note Section. String commNote = ""; if (partyIdFrom != null) { @@ -859,17 +859,17 @@ public class CommunicationEventServices { // handle the attachments createAttachmentContent(dispatcher, wrapper, communicationEventId, userLogin); - + // For all addresses create a CommunicationEventRoles createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, toParties, "ADDRESSEE"); createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, ccParties, "CC"); createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, bccParties, "BCC"); - + // get the related work effort info List> toWorkEffortInfos = buildListOfWorkEffortInfoFromEmailAddresses(addressesTo, userLogin, dispatcher); List> ccWorkEffortInfos = buildListOfWorkEffortInfoFromEmailAddresses(addressesCC, userLogin, dispatcher); List> bccWorkEffortInfos = buildListOfWorkEffortInfoFromEmailAddresses(addressesBCC, userLogin, dispatcher); - + // For all WorkEffort addresses create a CommunicationEventWorkEffs createCommunicationEventWorkEffs(userLogin, dispatcher, toWorkEffortInfos, communicationEventId); createCommunicationEventWorkEffs(userLogin, dispatcher, ccWorkEffortInfos, communicationEventId); @@ -884,7 +884,7 @@ public class CommunicationEventServices { return ServiceUtil.returnError(e.getMessage()); } catch (GenericServiceException e) { Debug.logError(e, module); - return ServiceUtil.returnError(e.getMessage()); + return ServiceUtil.returnError(e.getMessage()); } catch (Exception e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -897,7 +897,7 @@ public class CommunicationEventServices { Address[] addressesTo = wrapper.getTo(); Address[] addressesCC = wrapper.getCc(); Address[] addressesBCC = wrapper.getBcc(); - + Set emailAddressesFrom = new TreeSet(); Set emailAddressesTo = new TreeSet(); Set emailAddressesCC = new TreeSet(); @@ -928,12 +928,12 @@ public class CommunicationEventServices { if (UtilValidate.isNotEmpty(ccString)) commEventMap.put("ccString", ccString); if (UtilValidate.isNotEmpty(bccString)) commEventMap.put("bccString", bccString); } - + private static void createAttachmentContent(LocalDispatcher dispatcher, MimeMessageWrapper wrapper, String communicationEventId, GenericValue userLogin) throws GenericServiceException { // handle the attachments - String subject = wrapper.getSubject(); + String subject = wrapper.getSubject(); List attachmentIndexes = wrapper.getAttachmentIndexes(); - + if (attachmentIndexes.size() > 0) { Debug.logInfo("=== message has attachments [" + attachmentIndexes.size() + "] =====", module); for (String attachmentIdx : attachmentIndexes) { @@ -945,40 +945,40 @@ public class CommunicationEventServices { if (subject != null && subject.length() > 80) { subject = subject.substring(0,80); // make sure not too big for database field. (20 characters for filename) } - + String attFileName = wrapper.getPartFilename(attachmentIdx); String attContentType = wrapper.getPartContentType(attachmentIdx); if (attContentType != null && attContentType.indexOf(";") > -1) { attContentType = attContentType.toLowerCase().substring(0, attContentType.indexOf(";")); - } - + } + if (!UtilValidate.isEmpty(attFileName)) { attachmentMap.put("contentName", attFileName); attachmentMap.put("description", subject + "-" + attachmentIdx); } else { attachmentMap.put("contentName", subject + "-" + attachmentIdx); } - + attachmentMap.put("drMimeTypeId", attContentType); if (attContentType.startsWith("text")) { String text = wrapper.getPartText(attachmentIdx); attachmentMap.put("drDataResourceTypeId", "ELECTRONIC_TEXT"); attachmentMap.put("textData", text); } else { - ByteBuffer data = wrapper.getPartByteBuffer(attachmentIdx); + ByteBuffer data = wrapper.getPartByteBuffer(attachmentIdx); if (Debug.infoOn()) Debug.logInfo("Binary attachment size: " + data.limit(), module); attachmentMap.put("drDataResourceName", attFileName); attachmentMap.put("imageData", data); attachmentMap.put("drDataResourceTypeId", "IMAGE_OBJECT"); // TODO: why always use IMAGE attachmentMap.put("_imageData_contentType", attContentType); } - + // save the content - dispatcher.runSync("createCommContentDataResource", attachmentMap); + dispatcher.runSync("createCommContentDataResource", attachmentMap); } } } - + private static void createCommEventRoles(GenericValue userLogin, Delegator delegator, LocalDispatcher dispatcher, String communicationEventId, List> parties, String roleTypeId) { // It's not clear what the "role" of this communication event should be, so we'll just put _NA_ // check and see if this role was already created and ignore if true @@ -1003,7 +1003,7 @@ public class CommunicationEventServices { Debug.logError(e, module); } } - + private static void createCommunicationEventWorkEffs(GenericValue userLogin, LocalDispatcher dispatcher, List> workEffortInfos, String communicationEventId) { // create relationship between communication event and work efforts try { @@ -1053,7 +1053,7 @@ public class CommunicationEventServices { * Calls findPartyFromEmailAddress service and returns a List of the results for the array of addresses */ private static List> buildListOfPartyInfoFromEmailAddresses(Address [] addresses, GenericValue userLogin, LocalDispatcher dispatcher) throws GenericServiceException { - InternetAddress emailAddress = null; + InternetAddress emailAddress = null; Map result = null; List> tempResults = FastList.newInstance(); @@ -1074,7 +1074,7 @@ public class CommunicationEventServices { } return tempResults; } - + /* * Gets WorkEffort info from e-mail address and returns a List of the results for the array of addresses */ @@ -1096,9 +1096,9 @@ public class CommunicationEventServices { result = dispatcher.runSync("performFind", UtilMisc.toMap("entityName", "WorkEffortContactMechView" ,"inputFields", inputFields, "userLogin", userLogin)); EntityListIterator listIt = (EntityListIterator) result.get("listIt"); - + try { - List list = listIt.getCompleteList(); + List list = listIt.getCompleteList(); List filteredList = EntityUtil.filterByDate(list); tempResults.addAll(filteredList); } catch (GenericEntityException e) { @@ -1113,20 +1113,20 @@ public class CommunicationEventServices { /* * Service to process incoming email and look for a bounce message. If the email is indeed a bounce message - * the CommunicationEvent will be updated with the proper COM_BOUNCED status. + * the CommunicationEvent will be updated with the proper COM_BOUNCED status. */ public static Map processBouncedMessage(DispatchContext dctx, Map context) { Debug.logInfo("Running process bounced message check...", module); - MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper"); - + MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper"); + LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - + int parts = wrapper.getMainPartCount(); - if (parts >= 3) { // it must have all three parts in order to process correctly + if (parts >= 3) { // it must have all three parts in order to process correctly // get the second part (delivery report) - String contentType = wrapper.getPartContentType("1"); // index 1 should be the second part + String contentType = wrapper.getPartContentType("1"); // index 1 should be the second part if (contentType != null && "message/delivery-status".equalsIgnoreCase(contentType)) { Debug.logInfo("Delivery status report part found; processing...", module); @@ -1138,7 +1138,7 @@ public class CommunicationEventServices { if (Debug.verboseOn()) Debug.logVerbose("Part 2 Text :\n\n" + part2Text, module); - // find the "Action" element and obtain its value (looking for "failed") + // find the "Action" element and obtain its value (looking for "failed") Pattern p2 = Pattern.compile("^Action: (.*)$", Pattern.MULTILINE | Pattern.CASE_INSENSITIVE); Matcher m2 = p2.matcher(part2Text); String action = null; @@ -1148,14 +1148,14 @@ public class CommunicationEventServices { if (action != null && "failed".equalsIgnoreCase(action)) { // message bounced -- get the original message - String part3Text = wrapper.getPartRawText("2"); // index 2 should be the third part + String part3Text = wrapper.getPartRawText("2"); // index 2 should be the third part if (part3Text == null) { part3Text = ""; } if (Debug.verboseOn()) Debug.logVerbose("Part 3 Text :\n\n" + part3Text, module); - // find the "Message-Id" element and obtain its value (looking for "failed") + // find the "Message-Id" element and obtain its value (looking for "failed") Pattern p3 = Pattern.compile("^Message-Id: (.*)$", Pattern.MULTILINE | Pattern.CASE_INSENSITIVE); Matcher m3 = p3.matcher(part3Text); String messageId = null; @@ -1194,10 +1194,10 @@ public class CommunicationEventServices { } } else { if (Debug.infoOn()) { - Debug.logInfo("Unable to find CommunicationEvent with the matching messageId : " + messageId, module); + Debug.logInfo("Unable to find CommunicationEvent with the matching messageId : " + messageId, module); } - // no communication events found for that message ID; possible this is a NEWSLETTER + // no communication events found for that message ID; possible this is a NEWSLETTER try { values = delegator.findByAnd("ContactListCommStatus", UtilMisc.toMap("messageId", messageId)); @@ -1229,7 +1229,7 @@ public class CommunicationEventServices { } else { if (Debug.infoOn()) { Debug.logInfo("Unable to find ContactListCommStatus with the matching messageId : " + messageId, module); - + } } } @@ -1239,10 +1239,10 @@ public class CommunicationEventServices { } } } - + return ServiceUtil.returnSuccess(); } - + public static Map logIncomingMessage(DispatchContext dctx, Map context) { MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper"); Debug.logInfo("Message recevied : " + wrapper.getSubject(), module); @@ -1250,9 +1250,9 @@ public class CommunicationEventServices { Debug.logInfo("-- Number of parts : " + wrapper.getMainPartCount(), module); Debug.logInfo("-- Number of attachments : " + wrapper.getAttachmentIndexes().size(), module); Debug.logInfo("-- Message ID : " + wrapper.getMessageId(), module); - + Debug.logInfo("### MESSAGE ###\n\n" + wrapper.getMessageBody(), module); - + List attachmentIndexes = wrapper.getAttachmentIndexes(); if (attachmentIndexes.size() > 0) { Debug.logInfo("### ATTACHMENTS ###", module); @@ -1261,19 +1261,19 @@ public class CommunicationEventServices { Debug.logInfo("### -- Content Type : " + wrapper.getPartContentType(idx), module); } } - + return ServiceUtil.returnSuccess(); - + } - + /* * Event which marks a communication event as read, and returns a 1px image to the browser/mail client * Is updated because the read status is now stored in the communicationEventRole * This services is updated but could not be tested. assumed is "read" for partyIdTo on the commevent */ - public static String markCommunicationAsRead(HttpServletRequest request, HttpServletResponse response) { - String communicationEventId = null; - + public static String markCommunicationAsRead(HttpServletRequest request, HttpServletResponse response) { + String communicationEventId = null; + // pull the communication event from path info, so we can hide the process from the user String pathInfo = request.getPathInfo(); String[] pathParsed = pathInfo.split("/", 3); @@ -1284,39 +1284,39 @@ public class CommunicationEventServices { } if (pathInfo != null && pathInfo.indexOf("/") > -1) { pathParsed = pathInfo.split("/"); - communicationEventId = pathParsed[0]; + communicationEventId = pathParsed[0]; } - + // update the communication event if (communicationEventId != null) { Debug.logInfo("Marking communicationEventId [" + communicationEventId + "] from path info : " + request.getPathInfo() + " as read.", module); Delegator delegator = (Delegator) request.getAttribute("delegator"); GenericValue communicationEvent = null; - try { - communicationEvent = delegator.findOne("CommunicationEvent", UtilMisc.toMap("communicationEventId", communicationEventId), true); + try { + communicationEvent = delegator.findOne("CommunicationEvent", UtilMisc.toMap("communicationEventId", communicationEventId), true); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, module); } LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); - try { - dispatcher.runAsync("setCommEventRoleToRead", UtilMisc.toMap("communicationEventId", communicationEventId, "partyId", communicationEvent.getString("partyIdTo"))); + try { + dispatcher.runAsync("setCommEventRoleToRead", UtilMisc.toMap("communicationEventId", communicationEventId, "partyId", communicationEvent.getString("partyIdTo"))); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, module); } } - + // return the 1px image (spacer.gif) URL imageUrl; try { imageUrl = FlexibleLocation.resolveLocation("component://images/webapp/images/spacer.gif"); InputStream imageStream = imageUrl.openStream(); - UtilHttp.streamContentToBrowser(response, imageStream, 43, "image/gif", null); + UtilHttp.streamContentToBrowser(response, imageStream, 43, "image/gif", null); } catch (MalformedURLException e) { Debug.logError(e, module); } catch (IOException e) { Debug.logError(e, module); } - + // return null to not return any view return null; } diff --git a/applications/party/src/org/ofbiz/party/party/PartyRelationshipHelper.java b/applications/party/src/org/ofbiz/party/party/PartyRelationshipHelper.java index 5b1ed96bc7..d7752a7f04 100644 --- a/applications/party/src/org/ofbiz/party/party/PartyRelationshipHelper.java +++ b/applications/party/src/org/ofbiz/party/party/PartyRelationshipHelper.java @@ -41,13 +41,13 @@ import org.ofbiz.entity.condition.EntityOperator; public class PartyRelationshipHelper { public static final String module = PartyRelationshipHelper.class.getName(); - + /** Return A List of the active Party Relationships (ie with valid from and thru dates) *@param delegator needed Delegator *@param partyRelationshipValues Map containing the input parameters (primaries keys + partyRelationshipTypeId) *@return List of the active Party Relationships */ - public static List getActivePartyRelationships(Delegator delegator, Map partyRelationshipValues) { + public static List getActivePartyRelationships(Delegator delegator, Map partyRelationshipValues) { String partyIdFrom = (String) partyRelationshipValues.get("partyIdFrom") ; String partyIdTo = (String) partyRelationshipValues.get("partyIdTo") ; String roleTypeIdFrom = (String) partyRelationshipValues.get("roleTypeIdFrom") ; @@ -64,11 +64,11 @@ public class PartyRelationshipHelper { condList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, fromDate)); EntityCondition thruCond = EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition("thruDate", null), - EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN, fromDate)), + EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN, fromDate)), EntityOperator.OR); condList.add(thruCond); EntityCondition condition = EntityCondition.makeCondition(condList); - + List partyRelationships = null; try { partyRelationships = delegator.findList("PartyRelationship", condition, null, null, null, false); @@ -81,5 +81,5 @@ public class PartyRelationshipHelper { } else { return null; } - } + } } diff --git a/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java b/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java index c9e9e75d96..90bcf4e1dd 100644 --- a/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java +++ b/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java @@ -93,7 +93,7 @@ public class PartyRelationshipServices { return result; } - /** Creates and updates a PartyRelationship creating related PartyRoles if needed. + /** Creates and updates a PartyRelationship creating related PartyRoles if needed. * A side of the relationship is checked to maintain history *@param ctx The DispatchContext that this service is operating in *@param context Map containing the input parameters @@ -102,10 +102,10 @@ public class PartyRelationshipServices { public static Map createUpdatePartyRelationshipAndRoles(DispatchContext ctx, Map context) { Map result = FastMap.newInstance(); Delegator delegator = ctx.getDelegator(); - LocalDispatcher dispatcher = ctx.getDispatcher(); - + LocalDispatcher dispatcher = ctx.getDispatcher(); + try { - List partyRelationShipList = PartyRelationshipHelper.getActivePartyRelationships(delegator, context); + List partyRelationShipList = PartyRelationshipHelper.getActivePartyRelationships(delegator, context); if (UtilValidate.isEmpty(partyRelationShipList)) { // If already exists and active nothing to do: keep the current one String partyId = (String) context.get("partyId") ; String partyIdFrom = (String) context.get("partyIdFrom") ; @@ -116,28 +116,28 @@ public class PartyRelationshipServices { // Before creating the partyRelationShip, create the partyRoles if they don't exist GenericValue partyToRole = null; - partyToRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", partyIdTo, "roleTypeId", roleTypeIdTo), false); + partyToRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", partyIdTo, "roleTypeId", roleTypeIdTo), false); if (partyToRole == null) { partyToRole = delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", partyIdTo, "roleTypeId", roleTypeIdTo)); partyToRole.create(); } - + GenericValue partyFromRole= null; partyFromRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", partyIdFrom, "roleTypeId", roleTypeIdFrom), false); if (partyFromRole == null) { partyFromRole = delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", partyIdFrom, "roleTypeId", roleTypeIdFrom)); partyFromRole.create(); - } + } // Check if there is already a partyRelationship of that type with another party from the side indicated String sideChecked = partyIdFrom.equals(partyId)? "partyIdFrom" : "partyIdTo"; partyRelationShipList = delegator.findByAnd("PartyRelationship", UtilMisc.toMap(sideChecked, partyId, - "roleTypeIdFrom", roleTypeIdFrom, + "roleTypeIdFrom", roleTypeIdFrom, "roleTypeIdTo", roleTypeIdTo, - "partyRelationshipTypeId", partyRelationshipTypeId)); + "partyRelationshipTypeId", partyRelationshipTypeId)); // We consider the last one (in time) as sole active (we try to maintain a unique relationship and keep changes history) - partyRelationShipList = EntityUtil.filterByDate(partyRelationShipList); - GenericValue oldPartyRelationShip = EntityUtil.getFirst(partyRelationShipList); + partyRelationShipList = EntityUtil.filterByDate(partyRelationShipList); + GenericValue oldPartyRelationShip = EntityUtil.getFirst(partyRelationShipList); if (UtilValidate.isNotEmpty(oldPartyRelationShip)) { oldPartyRelationShip.setFields(UtilMisc.toMap("thruDate", UtilDateTime.nowTimestamp())); // Current becomes inactive oldPartyRelationShip.store(); @@ -154,6 +154,6 @@ public class PartyRelationshipServices { return ServiceUtil.returnError("Could not create party relationship (write failure): " + e.getMessage()); } result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); - return result; + return result; } } diff --git a/applications/party/src/org/ofbiz/party/party/PartyServices.java b/applications/party/src/org/ofbiz/party/party/PartyServices.java index 44884c6fcc..5207dc522e 100644 --- a/applications/party/src/org/ofbiz/party/party/PartyServices.java +++ b/applications/party/src/org/ofbiz/party/party/PartyServices.java @@ -181,7 +181,7 @@ public class PartyServices { person = delegator.makeValue("Person", UtilMisc.toMap("partyId", partyId)); person.setNonPKFields(context); toBeStored.add(person); - + try { delegator.storeAll(toBeStored); } catch (GenericEntityException e) { @@ -287,7 +287,7 @@ public class PartyServices { if (person == null || party == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "person.update.not_found", locale)); } - + // update status by separate service String oldStatusId = party.getString("statusId"); if (party.get("statusId") == null) { // old records @@ -298,7 +298,7 @@ public class PartyServices { party.setNonPKFields(context); party.set("statusId", oldStatusId); - + try { person.store(); party.store(); @@ -306,7 +306,7 @@ public class PartyServices { Debug.logWarning(e.getMessage(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "person.update.write_failure", new Object[] { e.getMessage() }, locale)); } - + if (UtilValidate.isNotEmpty(context.get("statusId")) && !context.get("statusId").equals(oldStatusId)) { try { dispatcher.runSync("setPartyStatus", UtilMisc.toMap("partyId", partyId, "statusId", context.get("statusId"), "userLogin", context.get("userLogin"))); @@ -415,7 +415,7 @@ public class PartyServices { partyGroup = delegator.makeValue("PartyGroup", UtilMisc.toMap("partyId", partyId)); partyGroup.setNonPKFields(context); partyGroup.create(); - + } catch (GenericEntityException e) { Debug.logWarning(e, module); Map messageMap = UtilMisc.toMap("errMessage", e.getMessage()); @@ -464,7 +464,7 @@ public class PartyServices { return ServiceUtil.returnError(errMsg); } - + // update status by separate service String oldStatusId = party.getString("statusId"); partyGroup.setNonPKFields(context); @@ -1735,8 +1735,8 @@ public class PartyServices { } return partyId; } - - + + /** * Finds partyId(s) corresponding to a party reference, partyId or a GoodIdentification idValue * @param dctx diff --git a/applications/party/src/org/ofbiz/party/party/PartyTypeHelper.java b/applications/party/src/org/ofbiz/party/party/PartyTypeHelper.java index 1f96bd05b2..1d1a9fafae 100644 --- a/applications/party/src/org/ofbiz/party/party/PartyTypeHelper.java +++ b/applications/party/src/org/ofbiz/party/party/PartyTypeHelper.java @@ -33,17 +33,17 @@ import org.ofbiz.entity.util.EntityTypeUtil; public class PartyTypeHelper { public static final String module = PartyTypeHelper.class.getName(); - + /** Check if a related party is of the right party type (PERSON or PARTY_GROUP) *@param delegator needed Delegator - *@param partyId a a valid Party Id string + *@param partyId a a valid Party Id string *@param checkedPartyType a string in {PERSON, PARTY_GROUP} *@return Boolean, false in case of error - */ - public static Boolean checkPartyType(Delegator delegator, String partyId, String checkedPartyType) { + */ + public static Boolean checkPartyType(Delegator delegator, String partyId, String checkedPartyType) { GenericValue party = null; GenericValue partyType = null; - GenericValue checkedTypeOfParty = null; + GenericValue checkedTypeOfParty = null; try { party = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false); if (UtilValidate.isNotEmpty(party)) { @@ -53,8 +53,8 @@ public class PartyTypeHelper { return false; } } catch (GenericEntityException e) { - Debug.logWarning(e, module); - } + Debug.logWarning(e, module); + } return EntityTypeUtil.isType(partyType, checkedTypeOfParty); - } + } } diff --git a/applications/party/src/org/ofbiz/party/party/PartyWorker.java b/applications/party/src/org/ofbiz/party/party/PartyWorker.java index 20b68a0069..737063564d 100644 --- a/applications/party/src/org/ofbiz/party/party/PartyWorker.java +++ b/applications/party/src/org/ofbiz/party/party/PartyWorker.java @@ -397,7 +397,7 @@ public class PartyWorker { } return partyIds; } - + /** * Generic service to find party by id. * By default return the party find by partyId diff --git a/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java b/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java index 01d5f7fe95..a9659b58b0 100644 --- a/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java +++ b/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java @@ -647,10 +647,10 @@ public class ProductConfigWrapper implements Serializable { public String getDescription() { return (configOption.getString("description") != null? configOption.getString("description"): "no description"); } - + public String getDescription(Locale locale) { return (configOption.getString("description") != null? (String) configOption.get("description", locale): "no description"); - } + } public String getId() { return configOption.getString("configOptionId"); diff --git a/applications/product/src/org/ofbiz/product/product/ProductEvents.java b/applications/product/src/org/ofbiz/product/product/ProductEvents.java index a5067165b4..5639544009 100644 --- a/applications/product/src/org/ofbiz/product/product/ProductEvents.java +++ b/applications/product/src/org/ofbiz/product/product/ProductEvents.java @@ -1072,7 +1072,7 @@ public class ProductEvents { public static String addProductToComparisonList(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); Delegator delegator = (Delegator) request.getAttribute("delegator"); - + String productId = request.getParameter("productId"); GenericValue product = null; if (UtilValidate.isNotEmpty(productId)) { @@ -1082,15 +1082,15 @@ public class ProductEvents { Debug.logError(e, module); } } - + if (product == null) { String errMsg = UtilProperties.getMessage(resource, "productevents.product_with_id_not_found", UtilMisc.toMap("productId", productId), UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } - + List compareList = getProductCompareList(request); - boolean alreadyInList = false; + boolean alreadyInList = false; for (GenericValue compProduct : compareList) { if (product.getString("productId").equals(compProduct.getString("productId"))) { alreadyInList = true; @@ -1110,7 +1110,7 @@ public class ProductEvents { public static String removeProductFromComparisonList(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); Delegator delegator = (Delegator) request.getAttribute("delegator"); - + String productId = request.getParameter("productId"); GenericValue product = null; if (UtilValidate.isNotEmpty(productId)) { @@ -1121,13 +1121,13 @@ public class ProductEvents { Debug.logError(e, module); } } - + if (product == null) { String errMsg = UtilProperties.getMessage(resource, "productevents.product_with_id_not_found", UtilMisc.toMap("productId", productId), UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } - + List compareList = getProductCompareList(request); Iterator it = compareList.iterator(); while (it.hasNext()) { @@ -1151,7 +1151,7 @@ public class ProductEvents { request.setAttribute("_EVENT_MESSAGE_", eventMsg); return "success"; } - + /** * Return nulls for empty strings, as the entity engine can deal with nulls. This will provide blanks * in fields where BigDecimal display. Blank meaning null, vs. 0 which means 0 diff --git a/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java b/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java index 646e488f0c..59ecbbb6b6 100644 --- a/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java +++ b/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java @@ -894,7 +894,7 @@ public class ProductSearchSession { Map requestParams = UtilHttp.getParameterMap(request); String noConditionFind = (String) requestParams.get("noConditionFind"); if (UtilValidate.isEmpty(noConditionFind)) { - noConditionFind = UtilProperties.getPropertyValue("widget", "widget.defaultNoConditionFind"); + noConditionFind = UtilProperties.getPropertyValue("widget", "widget.defaultNoConditionFind"); } // if noConditionFind to Y then find without conditions otherwise search according to constraints. if ("Y".equals(noConditionFind) || UtilValidate.isNotEmpty(productSearchConstraintList)) { @@ -1168,7 +1168,7 @@ public class ProductSearchSession { return searchParamString.toString(); } - + /** * This method returns a list of productId counts grouped by productFeatureId's of input productFeatureTypeId, * the constraint being applied on current ProductSearchConstraint list in session. @@ -1179,7 +1179,7 @@ public class ProductSearchSession { */ public static List> listCountByFeatureForType(String productFeatureTypeId, HttpSession session, Delegator delegator) { String visitId = VisitHandler.getVisitId(session); - + ProductSearchContext productSearchContext = new ProductSearchContext(delegator, visitId); List productSearchConstraintList = ProductSearchOptions.getConstraintList(session); if (UtilValidate.isNotEmpty(productSearchConstraintList)) { @@ -1187,11 +1187,11 @@ public class ProductSearchSession { } productSearchContext.finishKeywordConstraints(); productSearchContext.finishCategoryAndFeatureConstraints(); - + DynamicViewEntity dynamicViewEntity = productSearchContext.dynamicViewEntity; List entityConditionList = productSearchContext.entityConditionList; List fieldsToSelect = FastList.newInstance(); - + dynamicViewEntity.addMemberEntity("PFAC", "ProductFeatureAppl"); dynamicViewEntity.addAlias("PFAC", "pfacProductFeatureId", "productFeatureId", null, null, Boolean.TRUE, null); dynamicViewEntity.addAlias("PFAC", "pfacFromDate", "fromDate", null, null, null, null); @@ -1202,7 +1202,7 @@ public class ProductSearchSession { fieldsToSelect.add("featureCount"); entityConditionList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("pfacThruDate", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("pfacThruDate", EntityOperator.GREATER_THAN, UtilDateTime.nowTimestamp()))); entityConditionList.add(EntityCondition.makeCondition("pfacFromDate", EntityOperator.LESS_THAN, UtilDateTime.nowTimestamp())); - + dynamicViewEntity.addMemberEntity("PFC", "ProductFeature"); dynamicViewEntity.addAlias("PFC", "pfcProductFeatureTypeId", "productFeatureTypeId", null, null, Boolean.TRUE, null); dynamicViewEntity.addAlias("PFC", "pfcDescription", "description", null, null, Boolean.TRUE, null); @@ -1210,12 +1210,12 @@ public class ProductSearchSession { fieldsToSelect.add("pfcDescription"); fieldsToSelect.add("pfcProductFeatureTypeId"); entityConditionList.add(EntityCondition.makeCondition("pfcProductFeatureTypeId", EntityOperator.EQUALS, productFeatureTypeId)); - + EntityCondition whereCondition = EntityCondition.makeCondition(entityConditionList, EntityOperator.AND); - + EntityFindOptions efo = new EntityFindOptions(); efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE); - + EntityListIterator eli = null; try { eli = delegator.findListIteratorByCondition(dynamicViewEntity, whereCondition, null, fieldsToSelect, productSearchContext.orderByList, efo); @@ -1223,13 +1223,13 @@ public class ProductSearchSession { Debug.logError(e, "Error in product search", module); return null; } - + List> featureCountList = FastList.newInstance(); GenericValue searchResult = null; while ((searchResult = (GenericValue) eli.next()) != null) { featureCountList.add(UtilMisc.toMap("productFeatureId", (String) searchResult.get("pfacProductFeatureId"), "productFeatureTypeId", (String) searchResult.get("pfcProductFeatureTypeId"), "description", (String) searchResult.get("pfcDescription"), "featureCount", Long.toString((Long) searchResult.get("featureCount")))); } - + if (eli != null) { try { eli.close(); @@ -1239,7 +1239,7 @@ public class ProductSearchSession { } return featureCountList; } - + public static int getCategoryCostraintIndex(HttpSession session) { int index = 0; List productSearchConstraintList = ProductSearchOptions.getConstraintList(session); @@ -1250,9 +1250,9 @@ public class ProductSearchSession { } return index; } - + /** - * This method returns count of products within a given price range, the constraint being + * This method returns count of products within a given price range, the constraint being * applied on current ProductSearchConstraint list in session. * @param priceLow The low price. * @param priceHigh The high price. @@ -1262,7 +1262,7 @@ public class ProductSearchSession { */ public static long getCountForListPriceRange(BigDecimal priceLow, BigDecimal priceHigh, HttpSession session, Delegator delegator) { String visitId = VisitHandler.getVisitId(session); - + ProductSearchContext productSearchContext = new ProductSearchContext(delegator, visitId); List productSearchConstraintList = ProductSearchOptions.getConstraintList(session); if (UtilValidate.isNotEmpty(productSearchConstraintList)) { @@ -1270,11 +1270,11 @@ public class ProductSearchSession { } productSearchContext.finishKeywordConstraints(); productSearchContext.finishCategoryAndFeatureConstraints(); - + DynamicViewEntity dynamicViewEntity = productSearchContext.dynamicViewEntity; List entityConditionList = productSearchContext.entityConditionList; List fieldsToSelect = FastList.newInstance(); - + dynamicViewEntity.addMemberEntity("PPC", "ProductPrice"); dynamicViewEntity.addAlias("PPC", "ppcProductPriceTypeId", "productPriceTypeId", null, null, null, null); dynamicViewEntity.addAlias("PPC", "ppcFromDate", "fromDate", null, null, null, null); @@ -1288,12 +1288,12 @@ public class ProductSearchSession { entityConditionList.add(EntityCondition.makeCondition("ppcPrice", EntityOperator.GREATER_THAN_EQUAL_TO, priceLow)); entityConditionList.add(EntityCondition.makeCondition("ppcPrice", EntityOperator.LESS_THAN_EQUAL_TO, priceHigh)); entityConditionList.add(EntityCondition.makeCondition("ppcProductPriceTypeId", EntityOperator.EQUALS, "LIST_PRICE")); - + EntityCondition whereCondition = EntityCondition.makeCondition(entityConditionList, EntityOperator.AND); - + EntityFindOptions efo = new EntityFindOptions(); efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE); - + EntityListIterator eli = null; try { eli = delegator.findListIteratorByCondition(dynamicViewEntity, whereCondition, null, fieldsToSelect, productSearchContext.orderByList, efo); @@ -1301,13 +1301,13 @@ public class ProductSearchSession { Debug.logError(e, "Error in product search", module); return 0; } - + GenericValue searchResult = null; Long priceRangeCount = Long.valueOf(0); while ((searchResult = (GenericValue) eli.next()) != null) { priceRangeCount = searchResult.getLong("priceRangeCount"); } - + if (eli != null) { try { eli.close(); @@ -1317,9 +1317,9 @@ public class ProductSearchSession { } return priceRangeCount; } - + /** - * This method returns count of products in a given category (including all sub categories), the constraint being + * This method returns count of products in a given category (including all sub categories), the constraint being * applied on current ProductSearchConstraint list in session. * @param productCategoryId productCategoryId for which the count should be returned. * @param session Current session. @@ -1328,7 +1328,7 @@ public class ProductSearchSession { */ public static long getCountForProductCategory(String productCategoryId, HttpSession session, Delegator delegator) { String visitId = VisitHandler.getVisitId(session); - + ProductSearchContext productSearchContext = new ProductSearchContext(delegator, visitId); List productSearchConstraintList = ProductSearchOptions.getConstraintList(session); if (UtilValidate.isNotEmpty(productSearchConstraintList)) { @@ -1336,11 +1336,11 @@ public class ProductSearchSession { } productSearchContext.finishKeywordConstraints(); productSearchContext.finishCategoryAndFeatureConstraints(); - + DynamicViewEntity dynamicViewEntity = productSearchContext.dynamicViewEntity; List entityConditionList = productSearchContext.entityConditionList; List fieldsToSelect = FastList.newInstance(); - + dynamicViewEntity.addMemberEntity("PCMC", "ProductCategoryMember"); dynamicViewEntity.addAlias("PCMC", "pcmcProductCategoryId", "productCategoryId", null, null, null, null); dynamicViewEntity.addAlias("PCMC", "pcmcFromDate", "fromDate", null, null, null, null); @@ -1350,16 +1350,16 @@ public class ProductSearchSession { fieldsToSelect.add("categoryCount"); entityConditionList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("pcmcThruDate", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("pcmcThruDate", EntityOperator.GREATER_THAN, productSearchContext.nowTimestamp))); entityConditionList.add(EntityCondition.makeCondition("pcmcFromDate", EntityOperator.LESS_THAN, productSearchContext.nowTimestamp)); - + Set productCategoryIdSet = FastSet.newInstance(); ProductSearch.getAllSubCategoryIds(productCategoryId, productCategoryIdSet, delegator, productSearchContext.nowTimestamp); entityConditionList.add(EntityCondition.makeCondition("pcmcProductCategoryId", EntityOperator.IN, productCategoryIdSet)); - + EntityCondition whereCondition = EntityCondition.makeCondition(entityConditionList, EntityOperator.AND); - + EntityFindOptions efo = new EntityFindOptions(); efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE); - + EntityListIterator eli = null; try { eli = delegator.findListIteratorByCondition(dynamicViewEntity, whereCondition, null, fieldsToSelect, productSearchContext.orderByList, efo); @@ -1367,13 +1367,13 @@ public class ProductSearchSession { Debug.logError(e, "Error in product search", module); return 0; } - + GenericValue searchResult = null; Long categoryCount = Long.valueOf(0); while ((searchResult = (GenericValue) eli.next()) != null) { categoryCount = searchResult.getLong("categoryCount"); } - + if (eli != null) { try { eli.close(); diff --git a/applications/product/src/org/ofbiz/product/product/ProductServices.java b/applications/product/src/org/ofbiz/product/product/ProductServices.java index 69701ca57e..6e649ccdf7 100644 --- a/applications/product/src/org/ofbiz/product/product/ProductServices.java +++ b/applications/product/src/org/ofbiz/product/product/ProductServices.java @@ -477,7 +477,7 @@ public class ProductServices { try { List productAssocs = null; - + List orderBy = FastList.newInstance(); if (sortDescending) { orderBy.add("sequenceNum DESC"); @@ -488,7 +488,7 @@ public class ProductServices { if (bidirectional) { EntityCondition cond = EntityCondition.makeCondition( UtilMisc.toList( - EntityCondition.makeCondition("productId", productId), + EntityCondition.makeCondition("productId", productId), EntityCondition.makeCondition("productIdTo", productId) ), EntityJoinOperator.OR); cond = EntityCondition.makeCondition(cond, EntityCondition.makeCondition("productAssocTypeId", type)); diff --git a/applications/product/src/org/ofbiz/product/product/ProductWorker.java b/applications/product/src/org/ofbiz/product/product/ProductWorker.java index c88b9342b9..207a82d5c6 100644 --- a/applications/product/src/org/ofbiz/product/product/ProductWorker.java +++ b/applications/product/src/org/ofbiz/product/product/ProductWorker.java @@ -556,7 +556,7 @@ public class ProductWorker { } return featureTypeFeatures; } - + /** * For a given variant product, returns the list of features that would qualify it for * selection from the virtual product @@ -579,7 +579,7 @@ public class ProductWorker { List standardFeatures = ProductWorker.getProductFeaturesByApplTypeId(variantProduct, "STANDARD_FEATURE"); List result = FastList.newInstance(); for (GenericValue standardFeature : standardFeatures) { - // For each standard variant feature check it is also a virtual selectable feature and + // For each standard variant feature check it is also a virtual selectable feature and // if a feature of the same type hasn't already been added to the list if (selectableTypes.contains(standardFeature.getString("productFeatureTypeId")) && selectableFeatures.contains(standardFeature)) { result.add(standardFeature); @@ -879,12 +879,12 @@ public class ProductWorker { return null; } - /* - * Returns the product's unit weight converted to the desired Uom. If the weight is null, - * then a check is made for an associated virtual product to retrieve the weight from. If the + /* + * Returns the product's unit weight converted to the desired Uom. If the weight is null, + * then a check is made for an associated virtual product to retrieve the weight from. If the * weight is still null then null is returned. If a weight is found and a desiredUomId has - * been supplied and the product specifies a weightUomId then an attempt will be made to - * convert the value otherwise the weight is returned as is. + * been supplied and the product specifies a weightUomId then an attempt will be made to + * convert the value otherwise the weight is returned as is. */ public static BigDecimal getProductWeight(GenericValue product, String desiredUomId, Delegator delegator, LocalDispatcher dispatcher) { BigDecimal weight = product.getBigDecimal("weight"); diff --git a/applications/product/src/org/ofbiz/product/promo/PromoServices.java b/applications/product/src/org/ofbiz/product/promo/PromoServices.java index c13de11583..42c6791d7c 100644 --- a/applications/product/src/org/ofbiz/product/promo/PromoServices.java +++ b/applications/product/src/org/ofbiz/product/promo/PromoServices.java @@ -119,8 +119,8 @@ public class PromoServices { return ServiceUtil.returnError("Uploaded file not valid or corrupted"); } - String encoding = System.getProperty("file.encoding"); - String file = Charset.forName(encoding).decode(fileBytes).toString(); + String encoding = System.getProperty("file.encoding"); + String file = Charset.forName(encoding).decode(fileBytes).toString(); // get the createProductPromoCode Model ModelService promoModel; try { diff --git a/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java b/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java index 843d097b3c..7300a91b18 100644 --- a/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java +++ b/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java @@ -50,9 +50,9 @@ public class ShipmentWorker { /* * Returns the value of a given ShipmentPackageContent record. Calculated by working out the total value (from the OrderItems) of all ItemIssuances - * for the ShipmentItem then dividing that by the total quantity issued for the same to get an average item value then multiplying that by the package + * for the ShipmentItem then dividing that by the total quantity issued for the same to get an average item value then multiplying that by the package * content quantity. - * Note: No rounding of the calculation is performed so you will need to round it to the accuracy that you require + * Note: No rounding of the calculation is performed so you will need to round it to the accuracy that you require */ public static BigDecimal getShipmentPackageContentValue(GenericValue shipmentPackageContent) { BigDecimal quantity = shipmentPackageContent.getBigDecimal("quantity"); diff --git a/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java b/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java index 0734b11181..427b402960 100644 --- a/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java +++ b/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java @@ -274,7 +274,7 @@ public class UpsServices { Debug.logInfo("Voice notification service will not be requested for COD shipmentId " + shipmentId + ", shipmentRouteSegmentId " + shipmentRouteSegmentId + " - destination address is not residential", module); } } - + // Determine the currency by trying the shipmentRouteSegment, then the Shipment, then the framework's default currency, and finally default to USD String currencyCode = null; if (UtilValidate.isNotEmpty(shipmentRouteSegment.getString("currencyUomId"))) { @@ -387,7 +387,7 @@ public class UpsServices { UtilXml.addChildElementValue(soldToAddressElement, "StateProvinceCode", destPostalAddress.getString("stateProvinceGeoId"), shipmentConfirmRequestDoc); UtilXml.addChildElementValue(soldToAddressElement, "PostalCode", destPostalAddress.getString("postalCode"), shipmentConfirmRequestDoc); UtilXml.addChildElementValue(soldToAddressElement, "CountryCode", destCountryGeo.getString("geoCode"), shipmentConfirmRequestDoc); - + // Child of Shipment: PaymentInformation Element paymentInformationElement = UtilXml.addChildElement(shipmentElement, "PaymentInformation", shipmentConfirmRequestDoc); @@ -528,7 +528,7 @@ public class UpsServices { Element referenceNumberElement = UtilXml.addChildElement(packageElement, "ReferenceNumber", shipmentConfirmRequestDoc); UtilXml.addChildElementValue(referenceNumberElement, "Code", "MK", shipmentConfirmRequestDoc); UtilXml.addChildElementValue(referenceNumberElement, "Value", shipmentPackage.getString("shipmentPackageSeqId"), shipmentConfirmRequestDoc); - } + } if (carrierShipmentBoxType != null && carrierShipmentBoxType.get("oversizeCode") != null) { UtilXml.addChildElementValue(packageElement, "OversizePackage", carrierShipmentBoxType.getString("oversizeCode"), shipmentConfirmRequestDoc); } @@ -1105,14 +1105,14 @@ public class UpsServices { } } } - + //save International Invoice image if it exists (upscie is not returning this at this moment) //Commenting because it might be useful in the future as there are other types of forms that may be returned /* Element formElement = UtilXml.firstChildElement(packageResultsElement, "Form"); if (formElement != null) { String code = UtilXml.childElementValue(formElement, "Code"); String description = UtilXml.childElementValue(formElement, "Description"); - + Element imageElement = UtilXml.firstChildElement(formElement, "Image"); Element imageFormatElement = UtilXml.firstChildElement(imageElement, "ImageFormat"); String formatCode = UtilXml.childElementValue(imageFormatElement, "Code"); @@ -1130,7 +1130,7 @@ public class UpsServices { Debug.log(e, "Could not save UPS International Invoice: [[[" + imgStringDecoded + "]]] to file: " + outFile, module); } } - String formGroupId = UtilXml.childElementValue(formElement, "FormGroupId"); + String formGroupId = UtilXml.childElementValue(formElement, "FormGroupId"); */ shipmentPackageRouteSeg.store(); } @@ -1142,7 +1142,7 @@ public class UpsServices { errorList.add("Error: No PackageResults were returned for the Package [" + shipmentPackageRouteSeg.getString("shipmentPackageSeqId") + "]"); } } - + // save the High Value Report image if it exists Element controlLogReceiptElement = UtilXml.firstChildElement(shipmentResultsElement, "ControlLogReceipt"); if (controlLogReceiptElement != null) { @@ -2330,7 +2330,7 @@ public class UpsServices { return ServiceUtil.returnError(errorList); } } - + public static Map upsEmailReturnLabel(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); @@ -2348,7 +2348,7 @@ public class UpsServices { shipmentUpsSaveCertificationFile.mkdirs(); } } - + //Shipment Confirm request String shipmentConfirmResponseString = null; @@ -2421,7 +2421,7 @@ public class UpsServices { if (carrierShipmentMethod == null) { return ServiceUtil.returnError("CarrierShipmentMethod not found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId + "; partyId is " + shipmentRouteSegment.get("carrierPartyId") + " and shipmentMethodTypeId is " + shipmentRouteSegment.get("shipmentMethodTypeId")); } - + Map destEmail = dispatcher.runSync("getPartyEmail", UtilMisc.toMap("partyId", shipment.get("partyIdTo"), "userLogin", userLogin)); String recipientEmail = null; if (UtilValidate.isNotEmpty(destEmail.get("emailAddress"))) { @@ -2546,7 +2546,7 @@ public class UpsServices { Element packageWeightUnitOfMeasurementElement = UtilXml.addChildElement(packageElement, "UnitOfMeasurement", shipmentConfirmRequestDoc); UtilXml.addChildElementValue(packageWeightUnitOfMeasurementElement, "Code", "LBS", shipmentConfirmRequestDoc); UtilXml.addChildElementValue(packageWeightElement, "Weight", UtilProperties.getPropertyValue("shipment", "shipment.default.weight.value"), shipmentConfirmRequestDoc); - + String shipmentConfirmRequestString = null; try { shipmentConfirmRequestString = UtilXml.writeXmlDocument(shipmentConfirmRequestDoc); @@ -2616,7 +2616,7 @@ public class UpsServices { if (UtilValidate.isEmpty(shipmentPackageRouteSegs)) { return ServiceUtil.returnError("No ShipmentPackageRouteSegs found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId); } - + String shipmentDigest = UtilXml.childElementValue(shipmentConfirmResponseElement, "ShipmentDigest"); if (UtilValidate.isEmpty(shipmentDigest)) { return ServiceUtil.returnError("ERROR: The trackingDigest was not set for this Route Segment, meaning that a UPS shipment confirm has not been done."); @@ -2632,7 +2632,7 @@ public class UpsServices { Element acceptTransactionReferenceElement = UtilXml.addChildElement(acceptRequestElement, "TransactionReference", shipmentAcceptRequestDoc); UtilXml.addChildElementValue(acceptTransactionReferenceElement, "CustomerContext", "ShipAccept / 01", shipmentAcceptRequestDoc); UtilXml.addChildElementValue(acceptTransactionReferenceElement, "XpciVersion", "1.0001", shipmentAcceptRequestDoc); - + UtilXml.addChildElementValue(acceptRequestElement, "RequestAction", "ShipAccept", shipmentAcceptRequestDoc); UtilXml.addChildElementValue(acceptRequestElement, "RequestOption", "01", shipmentAcceptRequestDoc); @@ -2688,13 +2688,13 @@ public class UpsServices { } catch (GenericServiceException e) { Debug.logError(e, module); return ServiceUtil.returnError("Error reading or writing Shipment data for UPS Shipment Confirm: " + e.toString()); - } + } return ServiceUtil.returnSuccess(UtilProperties.getMessage("OrderUiLabels", "OrderReturnLabelEmailSuccessful", locale)); } - + public static Map upsShipmentAlternateRatesInquiry(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); - + // prepare the data String upsRateInquireMode = (String) context.get("upsRateInquireMode"); String shipmentId = (String) context.get("shipmentId"); @@ -2703,21 +2703,21 @@ public class UpsServices { String productStoreId = (String) context.get("productStoreId"); List> shippingRates = FastList.newInstance(); GenericValue shipmentRouteSegment = null; - + try { if (shipmentRouteSegmentId != null) { - + shipmentRouteSegment = delegator.findOne("ShipmentRouteSegment", false, UtilMisc.toMap("shipmentId", shipmentId, "shipmentRouteSegmentId", shipmentRouteSegmentId)); } else { List shipmentRouteSegments = delegator.findList("ShipmentRouteSegment", EntityCondition.makeCondition("shipmentId", EntityOperator.EQUALS, shipmentId), null, null, null, false); shipmentRouteSegment = EntityUtil.getFirst(shipmentRouteSegments); } - + if (shipmentRouteSegment == null) { return ServiceUtil.returnError("ShipmentRouteSegment not found with shipmentId " + shipmentId); } shipmentRouteSegmentId = shipmentRouteSegment.getString("shipmentRouteSegmentId"); - + if (!"UPS".equals(shipmentRouteSegment.getString("carrierPartyId"))) { return ServiceUtil.returnError("ERROR: The Carrier for ShipmentRouteSegment " + shipmentRouteSegmentId + " of Shipment " + shipmentId + ", is not UPS."); } @@ -2773,15 +2773,15 @@ public class UpsServices { if (destCountryGeo == null) { return ServiceUtil.returnError("DestCountryGeo not found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId); } - + // grab the pickup type; if none is defined we will assume daily pickup String pickupType = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipper.pickup.type", "01"); // grab the customer classification; if none is defined we will assume daily pickup String customerClassification = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.customerclassification", "01"); - + // should be shop to get estimates for all the possible shipping method of UPS upsRateInquireMode = "Shop"; - + // prepare the XML Document Document rateRequestDoc = UtilXml.makeEmptyXmlDocument("RatingServiceSelectionRequest"); Element rateRequestElement = rateRequestDoc.getDocumentElement(); @@ -2800,15 +2800,15 @@ public class UpsServices { // set the pickup type Element pickupElement = UtilXml.addChildElement(rateRequestElement, "PickupType", rateRequestDoc); UtilXml.addChildElementValue(pickupElement, "Code", pickupType, rateRequestDoc); - + Element customerClassificationElement = UtilXml.addChildElement(rateRequestElement, "CustomerClassification", rateRequestDoc); UtilXml.addChildElementValue(customerClassificationElement, "Code", customerClassification, rateRequestDoc); - + // shipment info Element shipmentElement = UtilXml.addChildElement(rateRequestElement, "Shipment", rateRequestDoc); Element rateInformationElement = UtilXml.addChildElement(shipmentElement, "RateInformation", rateRequestDoc); Element negotiatedRatesIndicatorElement = UtilXml.addChildElement(rateInformationElement, "NegotiatedRatesIndicator", rateRequestDoc); - + Element shipperElement = UtilXml.addChildElement(shipmentElement, "Shipper", rateRequestDoc); UtilXml.addChildElementValue(shipperElement, "Name", UtilValidate.isNotEmpty(originPostalAddress.getString("toName")) ? originPostalAddress.getString("toName") : "", rateRequestDoc); UtilXml.addChildElementValue(shipperElement, "AttentionName", UtilValidate.isNotEmpty(originPostalAddress.getString("attnName")) ? originPostalAddress.getString("attnName") : "", rateRequestDoc); @@ -2820,7 +2820,7 @@ public class UpsServices { if (UtilValidate.isNotEmpty(originPostalAddress.getString("address2"))) { UtilXml.addChildElementValue(shipperAddressElement, "AddressLine2", originPostalAddress.getString("address2"), rateRequestDoc); } - + UtilXml.addChildElementValue(shipperAddressElement, "City", originPostalAddress.getString("city"), rateRequestDoc); UtilXml.addChildElementValue(shipperAddressElement, "StateProvinceCode", originPostalAddress.getString("stateProvinceGeoId"), rateRequestDoc); UtilXml.addChildElementValue(shipperAddressElement, "PostalCode", originPostalAddress.getString("postalCode"), rateRequestDoc); @@ -2838,7 +2838,7 @@ public class UpsServices { if (UtilValidate.isNotEmpty(destPostalAddress.getString("address2"))) { UtilXml.addChildElementValue(shipToAddressElement, "AddressLine2", destPostalAddress.getString("address2"), rateRequestDoc); } - + UtilXml.addChildElementValue(shipToAddressElement, "City", destPostalAddress.getString("city"), rateRequestDoc); UtilXml.addChildElementValue(shipToAddressElement, "StateProvinceCode", destPostalAddress.getString("stateProvinceGeoId"), rateRequestDoc); UtilXml.addChildElementValue(shipToAddressElement, "PostalCode", destPostalAddress.getString("postalCode"), rateRequestDoc); @@ -2861,13 +2861,13 @@ public class UpsServices { UtilXml.addChildElementValue(shipFromAddressElement, "StateProvinceCode", originPostalAddress.getString("stateProvinceGeoId"), rateRequestDoc); UtilXml.addChildElementValue(shipFromAddressElement, "PostalCode", originPostalAddress.getString("postalCode"), rateRequestDoc); UtilXml.addChildElementValue(shipFromAddressElement, "CountryCode", originCountryGeo.getString("geoCode"), rateRequestDoc); - + List shipmentPackageRouteSegs = shipmentRouteSegment.getRelated("ShipmentPackageRouteSeg", null, UtilMisc.toList("+shipmentPackageSeqId")); if (UtilValidate.isEmpty(shipmentPackageRouteSegs)) { return ServiceUtil.returnError("No ShipmentPackageRouteSegs (ie No Packages) found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId); } for (GenericValue shipmentPackageRouteSeg :shipmentPackageRouteSegs) { - + GenericValue shipmentPackage = shipmentPackageRouteSeg.getRelatedOne("ShipmentPackage"); GenericValue shipmentBoxType = shipmentPackage.getRelatedOne("ShipmentBoxType"); List carrierShipmentBoxTypes = shipmentPackage.getRelated("CarrierShipmentBoxType", UtilMisc.toMap("partyId", "UPS"), null); @@ -2900,8 +2900,8 @@ public class UpsServices { UtilXml.addChildElementValue(dimensionsElement, "Width", UtilValidate.isNotEmpty(boxWidth) ? ""+boxWidth.intValue() : "", rateRequestDoc); UtilXml.addChildElementValue(dimensionsElement, "Height", UtilValidate.isNotEmpty(boxHeight) ? ""+boxHeight.intValue() : "", rateRequestDoc); } - else if - (UtilValidate.isNotEmpty(shipmentPackage.get("boxLength")) && UtilValidate.isNotEmpty(shipmentPackage.get("boxWidth")) && + else if + (UtilValidate.isNotEmpty(shipmentPackage.get("boxLength")) && UtilValidate.isNotEmpty(shipmentPackage.get("boxWidth")) && UtilValidate.isNotEmpty(shipmentPackage.get("boxHeight"))) { Element dimensionsElement = UtilXml.addChildElement(packageElement, "Dimensions", rateRequestDoc); Element unitOfMeasurementElement = UtilXml.addChildElement(dimensionsElement, "UnitOfMeasurement", rateRequestDoc); @@ -2913,7 +2913,7 @@ public class UpsServices { UtilXml.addChildElementValue(dimensionsElement, "Width", width.setScale(decimals, rounding).toString(), rateRequestDoc); UtilXml.addChildElementValue(dimensionsElement, "Height", height.setScale(decimals, rounding).toString(), rateRequestDoc); } - + Element packageWeightElement = UtilXml.addChildElement(packageElement, "PackageWeight", rateRequestDoc); Element packageWeightUnitOfMeasurementElement = UtilXml.addChildElement(packageElement, "UnitOfMeasurement", rateRequestDoc); String weightUomUps = unitsOfbizToUps.get(shipmentPackage.get("weightUomId")); @@ -2923,14 +2923,14 @@ public class UpsServices { // might as well default to LBS UtilXml.addChildElementValue(packageWeightUnitOfMeasurementElement, "Code", "LBS", rateRequestDoc); } - + if (shipmentPackage.getString("weight") == null) { return ServiceUtil.returnError("Weight value not found for ShipmentRouteSegment with shipmentId " + shipmentId + ", shipmentRouteSegmentId " + shipmentRouteSegmentId + ", and shipmentPackageSeqId " + shipmentPackage.getString("shipmentPackageSeqId")); } BigDecimal boxWeight = shipmentPackage.getBigDecimal("weight"); UtilXml.addChildElementValue(packageWeightElement, "Weight", UtilValidate.isNotEmpty(boxWeight) ? ""+boxWeight.intValue() : "", rateRequestDoc); } - + // service options UtilXml.addChildElement(shipmentElement, "ShipmentServiceOptions", rateRequestDoc); String rateRequestString = null; @@ -2941,7 +2941,7 @@ public class UpsServices { Debug.logError(e, ioeErrMsg, module); return ServiceUtil.returnFailure(ioeErrMsg); } - + // create AccessRequest XML doc Document accessRequestDocument = createAccessRequestDocument("shipment.properties"); String accessRequestString = null; @@ -2961,7 +2961,7 @@ public class UpsServices { // send the request try { rateResponseString = sendUpsRequest("Rate", xmlString.toString()); - + } catch (UpsConnectException e) { String uceErrMsg = "Error sending UPS request for UPS Service Rate: " + e.toString(); Debug.logError(e, uceErrMsg, module); @@ -3023,7 +3023,7 @@ public class UpsServices { } } } - + public static Map handleUpsAlternateRatesInquireResponse(Document rateResponseDocument) { Element rateResponseElement = rateResponseDocument.getDocumentElement(); diff --git a/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java b/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java index 7203ad534b..a6eef1f9c8 100644 --- a/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java +++ b/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java @@ -266,7 +266,7 @@ public class UspsServices { * 14 - First Class Mail International Flats * 15 - First Class Mail International Parcels * 16 - Priority Mail Small Flat Rate Box - * 21 - PostCards + * 21 - PostCards */ public static Map uspsInternationalRateInquire(DispatchContext dctx, Map context) { @@ -355,7 +355,7 @@ public class UspsServices { UtilXml.addChildElementValue(packageElement, "Machinable", "False", requestDocument); UtilXml.addChildElementValue(packageElement, "MailType", "Package", requestDocument); - + // TODO: Add package value so that an insurance fee can be returned UtilXml.addChildElementValue(packageElement, "Country", destinationCountry, requestDocument); @@ -1501,7 +1501,7 @@ public class UspsServices { certify = true; } Element rootElement = requestDocument.getDocumentElement(); - + // Retrieve from/to address and package details GenericValue originAddress = null; GenericValue originTelecomNumber = null; @@ -1562,7 +1562,7 @@ public class UspsServices { String toPhoneNumber = destinationTelecomNumber.getString("countryCode") + destinationTelecomNumber.getString("areaCode") + destinationTelecomNumber.getString("contactNumber"); UtilXml.addChildElementValue(rootElement, "ToPhone", toPhoneNumber, requestDocument); UtilXml.addChildElementValue(rootElement, "NonDeliveryOption", "RETURN", requestDocument); - + for (GenericValue shipmentPackageRouteSeg : shipmentPackageRouteSegs) { Document packageDocument = (Document) requestDocument.cloneNode(true); Element packageRootElement = requestDocument.getDocumentElement(); @@ -1570,7 +1570,7 @@ public class UspsServices { String fromCustomsReference = shipmentRouteSegment.getString("shipmentId") + ":" + shipmentRouteSegment.getString("shipmentRouteSegmentId"); fromCustomsReference = StringUtils.join( UtilMisc.toList( - shipmentRouteSegment.get("shipmentId"), + shipmentRouteSegment.get("shipmentId"), shipmentPackageRouteSeg.get("shipmentPackageSeqId"), shipmentRouteSegment.get("shipmentRouteSegementId") ), ':'); @@ -1611,7 +1611,7 @@ public class UspsServices { */ // According to the docs sending an empty postage tag will cause the postage to be calculated UtilXml.addChildElementValue(rootElement, "Postage", "", packageDocument); - + BigDecimal packageWeight = shipmentPackage.getBigDecimal("weight"); String weightUomId = shipmentPackage.getString("weightUomId"); BigDecimal packageWeightPounds = UomWorker.convertUom(packageWeight, weightUomId, "WT_lb", dispatcher); @@ -1625,7 +1625,7 @@ public class UspsServices { // TODO: Try the different layouts UtilXml.addChildElementValue(rootElement, "ImageType", "ALLINONEFILE", packageDocument); UtilXml.addChildElementValue(rootElement, "CustomerRefNo", fromCustomsReference, packageDocument); - + // Add the shipping contents Element shippingContents = UtilXml.addChildElement(rootElement, "ShippingContents", packageDocument); for (GenericValue shipmentPackageContent : shipmentPackageContents) { @@ -1651,7 +1651,7 @@ public class UspsServices { UtilXml.addChildElementValue(itemDetail, "HSTariffNumber", "", packageDocument); UtilXml.addChildElementValue(itemDetail, "CountryOfOrigin", originGeo.getString("geoName"), packageDocument); } - + // Send the request Document responseDocument = null; String api = certify ? "PriorityMailIntlCertify" : "PriorityMailIntl"; @@ -1683,7 +1683,7 @@ public class UspsServices { } catch (GenericEntityException e) { Debug.logError(e, module); } - + } return ServiceUtil.returnSuccess(); } @@ -1775,7 +1775,7 @@ public class UspsServices { } /* - * Converts decimal pounds to pounds and ounces as an Integer array, ounces are rounded up to the nearest whole number + * Converts decimal pounds to pounds and ounces as an Integer array, ounces are rounded up to the nearest whole number */ public static Integer[] convertPoundsToPoundsOunces(BigDecimal decimalPounds) { if (decimalPounds == null) return null; diff --git a/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java b/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java index 73fe2f51e7..71f881e05c 100644 --- a/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java +++ b/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java @@ -273,9 +273,9 @@ public class VerifyPickSession implements Serializable { public VerifyPickSessionRow getPickRow(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, String inventoryItemId) { for (VerifyPickSessionRow line : this.getPickRows(orderId)) { - if (orderItemSeqId.equals(line.getOrderItemSeqId()) && shipGroupSeqId.equals(line.getShipGroupSeqId()) + if (orderItemSeqId.equals(line.getOrderItemSeqId()) && shipGroupSeqId.equals(line.getShipGroupSeqId()) && productId.equals(line.getProductId()) && inventoryItemId.equals(line.getInventoryItemId())) { - return line; + return line; } } return null; @@ -398,7 +398,7 @@ public class VerifyPickSession implements Serializable { if (UtilValidate.isNotEmpty(orderRoleShipTo)) { newShipment.put("partyIdTo", orderRoleShipTo.getString("partyId")); } - String partyIdFrom = null; + String partyIdFrom = null; GenericValue orderItemShipGroup = EntityUtil.getFirst(delegator.findByAnd("OrderItemShipGroup", UtilMisc.toMap("orderId", orderId, "shipGroupSeqId", line.getShipGroupSeqId()))); if (UtilValidate.isNotEmpty(orderItemShipGroup.getString("vendorPartyId"))) { partyIdFrom = orderItemShipGroup.getString("vendorPartyId"); diff --git a/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java b/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java index 96fe95aa66..e8d4833807 100644 --- a/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java +++ b/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java @@ -192,7 +192,7 @@ public class WeightPackageSession implements Serializable { public String getDimensionUomId() { return dimensionUomId; } - + public void setCarrierPartyId(String carrierPartyId) { this.carrierPartyId = carrierPartyId; } @@ -303,7 +303,7 @@ public class WeightPackageSession implements Serializable { this.createPackages(orderId); // calculate the actual shipping charges according to package(s) weight and dimensions BigDecimal actualShippingCost = ZERO; - // Check if UPS integration is done + // Check if UPS integration is done if ("UPS".equals(this.carrierPartyId) && "Y".equals(calculateOnlineShippingRateFromUps)) { // call upsShipmentConfirm service, it will calculate the online shipping rate from UPS and save in ShipmentRouteSegment entity in actualCost field actualShippingCost = this.upsShipmentConfirm(); @@ -331,7 +331,7 @@ public class WeightPackageSession implements Serializable { } public boolean completeShipment(String orderId, String calculateOnlineShippingRateFromUps) throws GeneralException { - // Check if UPS integration is done + // Check if UPS integration is done if ("UPS".equals(this.carrierPartyId) && "Y".equals(calculateOnlineShippingRateFromUps)) { // call upsShipmentAccept service, it will made record(s) in ShipmentPackageRouteSeg entity this.upsShipmentAccept(); @@ -528,7 +528,7 @@ public class WeightPackageSession implements Serializable { protected void savePackagesInfo(String orderId, String calculateOnlineShippingRateFromUps) throws GeneralException { //create the package(s) this.createPackages(orderId); - // Check if UPS integration is done + // Check if UPS integration is done if ("UPS".equals(this.carrierPartyId) && "Y".equals(calculateOnlineShippingRateFromUps)) { // call upsShipmentConfirm service, it will calculate the online shipping rate from UPS and save in ShipmentRouteSegment entity in actualCost field this.upsShipmentConfirm(); diff --git a/applications/securityext/src/org/ofbiz/securityext/da/ServiceDaHandler.java b/applications/securityext/src/org/ofbiz/securityext/da/ServiceDaHandler.java index a61ab1da4c..d3de322be1 100644 --- a/applications/securityext/src/org/ofbiz/securityext/da/ServiceDaHandler.java +++ b/applications/securityext/src/org/ofbiz/securityext/da/ServiceDaHandler.java @@ -35,8 +35,8 @@ public class ServiceDaHandler implements DynamicAccessHandler { private static final String module = ServiceDaHandler.class.getName(); protected LocalDispatcher dispatcher; protected Delegator delegator; - - public String getPattern() { + + public String getPattern() { return "^service:(.*)$"; } @@ -46,7 +46,7 @@ public class ServiceDaHandler implements DynamicAccessHandler { serviceContext.put("permission", permission); serviceContext.put("accessString", accessString); serviceContext.put("permissionContext", context); - + String serviceName = accessString.substring(8); Map result; try { @@ -55,7 +55,7 @@ public class ServiceDaHandler implements DynamicAccessHandler { Debug.logError(e, module); return false; } - + if (result != null && !ServiceUtil.isError(result)) { Boolean reply = (Boolean) result.get("permissionGranted"); if (reply == null) { diff --git a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java index a8bbb8811c..590370397f 100644 --- a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java +++ b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java @@ -100,7 +100,7 @@ import org.ofbiz.service.calendar.TemporalExpressionWorker; import org.ofbiz.workeffort.workeffort.ICalWorker.ResponseProperties; /** iCalendar converter class. This class uses the - * iCal4J library. + * iCal4J library. */ public class ICalConverter { @@ -111,7 +111,7 @@ public class ICalConverter { protected static final String uidPrefix = "ORG-APACHE-OFBIZ-WE-"; protected static final String workEffortIdXPropName = "X-ORG-APACHE-OFBIZ-WORKEFFORT-ID"; protected static final String reminderXPropName = "X-ORG-APACHE-OFBIZ-REMINDER-ID"; - protected static final Map fromStatusMap = UtilMisc.toMap("TENTATIVE", "CAL_TENTATIVE", + protected static final Map fromStatusMap = UtilMisc.toMap("TENTATIVE", "CAL_TENTATIVE", "CONFIRMED", "CAL_CONFIRMED", "CANCELLED", "CAL_CANCELLED", "NEEDS-ACTION", "CAL_NEEDS_ACTION", "COMPLETED", "CAL_COMPLETED", "IN-PROCESS", "CAL_ACCEPTED"); protected static final Map toStatusMap = UtilMisc.toMap("CAL_TENTATIVE", Status.VEVENT_TENTATIVE, @@ -122,7 +122,7 @@ public class ICalConverter { "PRTYASGN_OFFERED", PartStat.TENTATIVE, "PRTYASGN_ASSIGNED", PartStat.ACCEPTED); protected static final Map fromPartStatusMap = UtilMisc.toMap( "TENTATIVE", "PRTYASGN_OFFERED", "ACCEPTED", "PRTYASGN_ASSIGNED"); - protected static final Map fromRoleMap = UtilMisc.toMap("ATTENDEE", "CAL_ATTENDEE", + protected static final Map fromRoleMap = UtilMisc.toMap("ATTENDEE", "CAL_ATTENDEE", "CONTACT", "CONTACT", "ORGANIZER", "CAL_ORGANIZER"); protected static VAlarm createAlarm(GenericValue workEffortEventReminder) { @@ -278,7 +278,7 @@ public class ICalConverter { } return fromStatusMap.get(iCalObj.getValue()); } - + protected static String fromSummary(PropertyList propertyList) { Summary iCalObj = (Summary) propertyList.getProperty(Summary.SUMMARY); if (iCalObj == null) { @@ -378,7 +378,7 @@ public class ICalConverter { } } - /** Returns a calendar derived from a Work Effort calendar publish point. + /** Returns a calendar derived from a Work Effort calendar publish point. * @param workEffortId ID of a work effort with workEffortTypeId equal to * PUBLISH_PROPS. * @param context The conversion context diff --git a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalHandlerFactory.java b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalHandlerFactory.java index ff4edc8837..99f536ccfa 100644 --- a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalHandlerFactory.java +++ b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalHandlerFactory.java @@ -38,9 +38,9 @@ import org.ofbiz.webapp.webdav.RequestHandlerFactory; */ @SuppressWarnings("serial") public class ICalHandlerFactory implements RequestHandlerFactory { - + public static final String module = ICalHandlerFactory.class.getName(); - + protected final Map handlerMap; protected final RequestHandler invalidMethodHandler = new InvalidMethodHandler(); protected final RequestHandler doNothingHandler = new DoNothingHandler(); diff --git a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java index 2ed16a002f..2bbce043e6 100644 --- a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java +++ b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java @@ -89,7 +89,7 @@ public class ICalWorker { * response when a user is logged in, but they don't have the basic CRUD * permissions to perform an action. Returning a Forbidden status will * prevent the client from trying the operation again. - * + * * @param statusMessage Optional status message - usually null * for security reasons * @return @@ -102,7 +102,7 @@ public class ICalWorker { * response when a user is not logged in, and basic CRUD permissions are * needed to perform an action. Returning an Unauthorized status will * force the client to authenticate the user, then try the operation again. - * + * * @param statusMessage Optional status message - usually null * for security reasons * @return @@ -121,7 +121,7 @@ public class ICalWorker { /** Create an HTTP Partial Content response. The calendar converter will use this * response when a calendar is only partially updated. - * + * * @param statusMessage A message describing which calendar components were * not updated * @return diff --git a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java index db37a1ee58..7fb36b63d4 100644 --- a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java +++ b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java @@ -361,7 +361,7 @@ public class WorkEffortServices { EntityCondition.makeCondition("scopeEnumId", EntityOperator.EQUALS, "WES_PUBLIC"), EntityCondition.makeCondition("parentTypeId", EntityOperator.EQUALS, "EVENT") ); - + if (cancelledCheckAndList != null) { publicEvents.addAll(cancelledCheckAndList); } @@ -436,9 +436,9 @@ public class WorkEffortServices { * * */ - + public static Map getWorkEffortEventsByPeriod(DispatchContext ctx, Map context) { - + /* To create testdata for this function for fixedasset/facility @@ -447,10 +447,10 @@ public class WorkEffortServices { 2) enter as productId "PROD_MANUF", quantity 1, start date tomorrow and press the submit button ` 3) in the next screen, click on the "Confirm" link (top part of the sccreen) - Now you have a confirmed production run (starting tomorrow) happening in facility "WebStoreWarehouse", + Now you have a confirmed production run (starting tomorrow) happening in facility "WebStoreWarehouse", with a task happening in fixed asset "WORKCENTER_COST" - In the calendars screen, selecting the proper facility you should see the work effort associated to the production run; + In the calendars screen, selecting the proper facility you should see the work effort associated to the production run; if you select the proper fixed asset you should see the task. */ @@ -517,7 +517,7 @@ public class WorkEffortServices { List cancelledCheckAndList = UtilMisc.toList( EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "EVENT_CANCELLED"), EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "CAL_CANCELLED")); - + List entityExprList = UtilGenerics.checkList(context.get("entityExprList")); if (entityExprList == null) { @@ -526,13 +526,13 @@ public class WorkEffortServices { // should have at least a start date EntityCondition startDateRequired = EntityCondition.makeCondition(UtilMisc.toList( - EntityCondition.makeCondition("estimatedStartDate", EntityOperator.NOT_EQUAL, null), - EntityCondition.makeCondition("actualStartDate", EntityOperator.NOT_EQUAL, null) + EntityCondition.makeCondition("estimatedStartDate", EntityOperator.NOT_EQUAL, null), + EntityCondition.makeCondition("actualStartDate", EntityOperator.NOT_EQUAL, null) ), EntityJoinOperator.OR); - + List periodCheckAndlList = UtilMisc.toList( startDateRequired, - // the startdate should be less than the period end + // the startdate should be less than the period end EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition("actualStartDate", EntityOperator.EQUALS, null), @@ -544,7 +544,7 @@ public class WorkEffortServices { EntityCondition.makeCondition("actualStartDate", EntityOperator.LESS_THAN_EQUAL_TO, endStamp) ), EntityJoinOperator.AND) ), EntityJoinOperator.OR), - // if the completion date is not null then it should be larger than the period start + // if the completion date is not null then it should be larger than the period start EntityCondition.makeCondition(UtilMisc.toList( // can also be empty EntityCondition.makeCondition(UtilMisc.toList( @@ -563,7 +563,7 @@ public class WorkEffortServices { EntityCondition.makeCondition("actualCompletionDate", EntityOperator.GREATER_THAN_EQUAL_TO, startStamp) ), EntityJoinOperator.AND) ), EntityJoinOperator.OR)); - + entityExprList.addAll(periodCheckAndlList); // (non cancelled) recurring events @@ -576,7 +576,7 @@ public class WorkEffortServices { EntityCondition.makeCondition(entityExprList, EntityJoinOperator.AND), EntityCondition.makeCondition(recurringEvents, EntityJoinOperator.AND) ), EntityJoinOperator.OR); - + List orderByList = UtilMisc.toList("estimatedStartDate"); if (partyIdsToUse.size() > 0 || UtilValidate.isNotEmpty(facilityId) || UtilValidate.isNotEmpty(fixedAssetId)) { try { @@ -585,7 +585,7 @@ public class WorkEffortServices { // Debug.log("=====conditions for party: " + eclTotal); tempWorkEfforts = EntityUtil.filterByDate(delegator.findList("WorkEffortAndPartyAssignAndType", eclTotal, null, orderByList, null, false)); } else if (UtilValidate.isNotEmpty(fixedAssetId)) { - EntityConditionList ecl = + EntityConditionList ecl = EntityCondition.makeCondition(UtilMisc.toList( eclTotal, EntityCondition.makeCondition("fixedAssetId", EntityOperator.EQUALS, fixedAssetId) @@ -595,7 +595,7 @@ public class WorkEffortServices { tempWorkEfforts = delegator.findList("WorkEffort", ecl, null, orderByList, null, false); tempWorkEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAndFixedAssetAssign", ecl, null, orderByList, null, false))); } else { - EntityConditionList ecl = + EntityConditionList ecl = EntityCondition.makeCondition(UtilMisc.toList( eclTotal, EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, facilityId) diff --git a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java index d0326fa9e1..c1efac08a1 100644 --- a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java +++ b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java @@ -167,17 +167,17 @@ public class WorkEffortWorker { } public static List getLowestLevelWorkEfforts(Delegator delegator, String workEffortId, String workEffortAssocTypeId) { - return getLowestLevelWorkEfforts(delegator, workEffortId, workEffortAssocTypeId, "workEffortIdFrom", "workEffortIdTo"); + return getLowestLevelWorkEfforts(delegator, workEffortId, workEffortAssocTypeId, "workEffortIdFrom", "workEffortIdTo"); } - + public static List getLowestLevelWorkEfforts(Delegator delegator, String workEffortId, String workEffortAssocTypeId, String left, String right) { - if (left == null) { - left = "workEffortIdFrom"; - } - if (right == null) { - right = "workEffortIdTo"; - } - + if (left == null) { + left = "workEffortIdFrom"; + } + if (right == null) { + right = "workEffortIdTo"; + } + List workEfforts = FastList.newInstance(); try { EntityConditionList exprsLevelFirst = EntityCondition.makeCondition(UtilMisc.toList( diff --git a/framework/appserver/src/org/ofbiz/appservers/GenerateContainer.java b/framework/appserver/src/org/ofbiz/appservers/GenerateContainer.java index 0e41a9d13d..58a12a963b 100644 --- a/framework/appserver/src/org/ofbiz/appservers/GenerateContainer.java +++ b/framework/appserver/src/org/ofbiz/appservers/GenerateContainer.java @@ -486,11 +486,11 @@ public class GenerateContainer implements Container { try { if (writer != null) { writer.flush(); - writer.close(); + writer.close(); } } catch (IOException e) { throw new ContainerException(e); - } + } } } diff --git a/framework/base/src/org/ofbiz/base/conversion/ConverterLoader.java b/framework/base/src/org/ofbiz/base/conversion/ConverterLoader.java index d0a5b5f5bc..72629f15a7 100644 --- a/framework/base/src/org/ofbiz/base/conversion/ConverterLoader.java +++ b/framework/base/src/org/ofbiz/base/conversion/ConverterLoader.java @@ -20,7 +20,7 @@ package org.ofbiz.base.conversion; /** Converter loader interface. Applications implement this * interface to load their Java object converters. - * + * */ public interface ConverterLoader { /** Create and register converters with the Java object type diff --git a/framework/base/src/org/ofbiz/base/conversion/Converters.java b/framework/base/src/org/ofbiz/base/conversion/Converters.java index 4363451be2..22e0aefaf8 100644 --- a/framework/base/src/org/ofbiz/base/conversion/Converters.java +++ b/framework/base/src/org/ofbiz/base/conversion/Converters.java @@ -42,7 +42,7 @@ public class Converters { /** Null converter used when the source and target java object * types are the same. The convert method returns the * source object. - * + * */ public static final Converter nullConverter = new NullConverter(); @@ -150,7 +150,7 @@ public class Converters { /** Null converter used when the source and target java object * types are the same. The convert method returns the * source object. - * + * */ protected static class NullConverter implements Converter { public NullConverter() { diff --git a/framework/base/src/org/ofbiz/base/util/ObjectType.java b/framework/base/src/org/ofbiz/base/util/ObjectType.java index 64fe4539fe..1128a52d53 100644 --- a/framework/base/src/org/ofbiz/base/util/ObjectType.java +++ b/framework/base/src/org/ofbiz/base/util/ObjectType.java @@ -756,19 +756,19 @@ public class ObjectType { @SuppressWarnings("unchecked") public static boolean isEmpty(Object value) { if (value == null) return true; - + if (value instanceof String) return UtilValidate.isEmpty((String) value); if (value instanceof Collection) return UtilValidate.isEmpty((Collection) value); if (value instanceof Map) return UtilValidate.isEmpty((Map) value); if (value instanceof CharSequence) return UtilValidate.isEmpty((CharSequence) value); - + // These types would flood the log // Number covers: BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, Short - if (value instanceof Boolean) return false; - if (value instanceof Number) return false; - if (value instanceof Character) return false; - if (value instanceof java.sql.Timestamp) return false; - + if (value instanceof Boolean) return false; + if (value instanceof Number) return false; + if (value instanceof Character) return false; + if (value instanceof java.sql.Timestamp) return false; + if (Debug.verboseOn()) { Debug.logVerbose("In ObjectType.isEmpty(Object value) returning false for " + value.getClass() + " Object.", module); } diff --git a/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java b/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java index 5c8e6233ea..59318e2f7d 100644 --- a/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java +++ b/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java @@ -39,7 +39,7 @@ public class UtilFormatOut { } } - // ------------------- price format handlers ------------------- + // ------------------- price format handlers ------------------- static DecimalFormat priceDecimalFormat = new DecimalFormat(UtilProperties.getPropertyValue("general.properties", "currency.decimal.format", "#,##0.00")); /** Formats a Double representing a price into a string diff --git a/framework/base/src/org/ofbiz/base/util/template/XslTransform.java b/framework/base/src/org/ofbiz/base/util/template/XslTransform.java index d088ddc8a1..14f532829e 100644 --- a/framework/base/src/org/ofbiz/base/util/template/XslTransform.java +++ b/framework/base/src/org/ofbiz/base/util/template/XslTransform.java @@ -65,34 +65,34 @@ public final class XslTransform { */ public static String renderTemplate(String template, String data) throws TransformerException { - String result = null; - TransformerFactory tfactory = TransformerFactory.newInstance(); - if (tfactory.getFeature(SAXSource.FEATURE)) { - // setup for xml data file preprocessing to be able to xinclude - SAXParserFactory pfactory= SAXParserFactory.newInstance(); - pfactory.setNamespaceAware(true); - pfactory.setValidating(false); - pfactory.setXIncludeAware(true); - XMLReader reader = null; - try { - reader = pfactory.newSAXParser().getXMLReader(); + String result = null; + TransformerFactory tfactory = TransformerFactory.newInstance(); + if (tfactory.getFeature(SAXSource.FEATURE)) { + // setup for xml data file preprocessing to be able to xinclude + SAXParserFactory pfactory= SAXParserFactory.newInstance(); + pfactory.setNamespaceAware(true); + pfactory.setValidating(false); + pfactory.setXIncludeAware(true); + XMLReader reader = null; + try { + reader = pfactory.newSAXParser().getXMLReader(); } catch (Exception e) { throw new TransformerException("Error creating SAX parser/reader", e); } // do the actual preprocessing - SAXSource source = new SAXSource(reader, new InputSource(data)); - // compile the xsl template - Transformer transformer = tfactory.newTransformer(new StreamSource(template)); - // and apply the xsl template to the source document and save in a result string - StringWriter sw = new StringWriter(); - StreamResult sr = new StreamResult(sw); - transformer.transform(source, sr); - result = sw.toString(); - } else { - Debug.logError("tfactory does not support SAX features!", module); - } - return result; - } + SAXSource source = new SAXSource(reader, new InputSource(data)); + // compile the xsl template + Transformer transformer = tfactory.newTransformer(new StreamSource(template)); + // and apply the xsl template to the source document and save in a result string + StringWriter sw = new StringWriter(); + StreamResult sr = new StreamResult(sw); + transformer.transform(source, sr); + result = sw.toString(); + } else { + Debug.logError("tfactory does not support SAX features!", module); + } + return result; + } /* * it does not look like the rest of this file is working or used..........better set it to depreciated diff --git a/framework/birt/src/org/ofbiz/birt/BirtWorker.java b/framework/birt/src/org/ofbiz/birt/BirtWorker.java index 756796ec29..ada8b99095 100644 --- a/framework/birt/src/org/ofbiz/birt/BirtWorker.java +++ b/framework/birt/src/org/ofbiz/birt/BirtWorker.java @@ -42,17 +42,17 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.jdbc.ConnectionFactory; public class BirtWorker { - + public final static String module = BirtWorker.class.getName(); - + public final static String BIRT_PARAMETERS = "birtParameters"; public final static String REPORT_ENGINE = "reportEngine"; public final static String BIRT_LOCALE = "birtLocale"; public final static String BIRT_IMAGE_DIRECTORY = "birtImageDirectory"; public final static String BIRT_CONTENT_TYPE = "birtContentType"; - + private static HTMLServerImageHandler imageHandler = new HTMLServerImageHandler(); - + /** * export report * @param design @@ -65,7 +65,7 @@ public class BirtWorker { */ public static void exportReport(IReportRunnable design, Map context, String contentType, OutputStream output) throws EngineException, GeneralException, SQLException { - + Locale birtLocale = (Locale)context.get(BIRT_LOCALE); String birtImageDirectory = (String)context.get(BIRT_IMAGE_DIRECTORY); @@ -77,7 +77,7 @@ public class BirtWorker { } Debug.logInfo("Get report engine", module); IReportEngine engine = BirtContainer.getReportEngine(); - + /* --- DISABLE JDBC FEATURE // set the jdbc connection @@ -85,23 +85,23 @@ public class BirtWorker { Delegator delegator = BirtContainer.getDelegator(); Debug.logInfo("Get the JDBC connection from group helper's name:" + delegatorGroupHelperName, module); String helperName = delegator.getGroupHelperName(delegatorGroupHelperName); // gets the helper (localderby, localmysql, localpostgres, etc.) for your entity group org.ofbiz - Connection connection = ConnectionFactory.getConnection(helperName); + Connection connection = ConnectionFactory.getConnection(helperName); engine.getConfig().getAppContext().put("OdaJDBCDriverPassInConnection", connection); */ - + IRunAndRenderTask task = engine.createRunAndRenderTask(design); if (birtLocale != null) { Debug.logInfo("Set birt locale:" + birtLocale, module); task.setLocale(birtLocale); } - + // set parameters if exists Map parameters = UtilGenerics.cast(context.get(BirtWorker.BIRT_PARAMETERS)); if (parameters != null) { Debug.logInfo("Set birt parameters:" + parameters, module); task.setParameterValues(parameters); } - + // set output options RenderOption options = new RenderOption(); if ("text/html".equalsIgnoreCase(contentType)) { @@ -117,7 +117,7 @@ public class BirtWorker { } else { throw new GeneralException("Unknown content type : " + contentType); } - + if (options.getOutputFormat().equalsIgnoreCase(RenderOption.OUTPUT_FORMAT_HTML)) { // set html render options HTMLRenderOption htmlOptions = new HTMLRenderOption(options); @@ -131,10 +131,10 @@ public class BirtWorker { } else if (options.getOutputFormat().equalsIgnoreCase("xls")) { // set excel render options EXCELRenderOption excelOptions = new EXCELRenderOption(options); - } + } options.setOutputStream(output); task.setRenderOption(options); - + // run report Debug.logInfo("Birt's locale is: " + task.getLocale(), module); Debug.logInfo("Run report's task", module); diff --git a/framework/birt/src/org/ofbiz/birt/container/BirtContainer.java b/framework/birt/src/org/ofbiz/birt/container/BirtContainer.java index e33273b0a6..9eaa7f8568 100644 --- a/framework/birt/src/org/ofbiz/birt/container/BirtContainer.java +++ b/framework/birt/src/org/ofbiz/birt/container/BirtContainer.java @@ -48,14 +48,14 @@ import org.ofbiz.service.GenericDispatcher; import org.ofbiz.service.LocalDispatcher; public class BirtContainer implements Container { - + public static final String module = BirtContainer.class.getName(); - + public final static String CONFIG_FILE = "birt.properties"; - + protected EngineConfig config; protected String configFile; - + private static IReportEngine engine; private static String delegatorGroupHelperName; private static String delegatorName; @@ -74,9 +74,9 @@ public class BirtContainer implements Container { */ public boolean start() throws ContainerException { // TODO Auto-generated method stub - + Debug.logInfo("Start birt container", module); - + // make sure the subclass sets the config name if (this.getContainerConfigName() == null) { throw new ContainerException("Unknown container config name"); @@ -88,18 +88,18 @@ public class BirtContainer implements Container { } config = new EngineConfig(); - + // set osgi config Map osgiConfig = FastMap.newInstance(); osgiConfig.put("osgi.configuration.area", new File(System.getProperty("ofbiz.home"), "runtime" + File.separator + "tempfiles").getPath()); config.setOSGiConfig(osgiConfig); - + HashMap context = UtilGenerics.cast(config.getAppContext()); - + // set delegator, dispatcher and security objects to report - + delegatorGroupHelperName = ContainerConfig.getPropertyValue(cc, "delegator-group-helper-name", "org.ofbiz"); - + // get the delegator delegatorName = ContainerConfig.getPropertyValue(cc, "delegator-name", "default"); try { @@ -107,25 +107,25 @@ public class BirtContainer implements Container { } catch (ClassNotFoundException e) { Debug.logError(e, module); } - + // get the dispatcher dispatcher = GenericDispatcher.getLocalDispatcher(dispatcherName, delegator); - + context.put("delegator", delegator); context.put("dispatcher", dispatcher); - + // set classloader for engine context.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, BirtContainer.class.getClassLoader()); context.put(EngineConstants.WEBAPP_CLASSPATH_KEY, BirtContainer.class.getClassLoader()); - + // set log config to show all level in console config.setLogConfig(null, Level.ALL); - + // set engine home String reportEnginePath = FileUtil.getFile("component://birt/lib/platform").getPath(); config.setEngineHome(reportEnginePath); config.setBIRTHome(reportEnginePath); - + // set OSGi arguments specific in properties String argumentsString = UtilProperties.getPropertyValue(BirtContainer.CONFIG_FILE, "birt.osgi.arguments"); config.setOSGiArguments(argumentsString.split(",")); @@ -133,7 +133,7 @@ public class BirtContainer implements Container { // set platform file context config.setPlatformContext(new PlatformFileContext(config)); config.setAppContext(context); - + // startup platform try { Debug.logInfo("Startup birt platform", module); @@ -163,28 +163,28 @@ public class BirtContainer implements Container { Debug.logInfo("BIRT supported formats: " + formatList, module); return false; } - + public void stop() throws ContainerException { // TODO Auto-generated method stub - + } - + public String getContainerConfigName() { return "birt-container"; } - + public static IReportEngine getReportEngine() throws GenericEntityException, SQLException { return engine; } - + public static String getDelegatorGroupHelperName() { return delegatorGroupHelperName; } - + public static String getDelegatorName() { return delegatorName; } - + public static String getDispatcherName() { return dispatcherName; } @@ -192,7 +192,7 @@ public class BirtContainer implements Container { public static Delegator getDelegator() { return delegator; } - + public static LocalDispatcher getDispatcher() { return dispatcher; } diff --git a/framework/birt/src/org/ofbiz/birt/email/BirtEmailServices.java b/framework/birt/src/org/ofbiz/birt/email/BirtEmailServices.java index 2dac5eb9f0..c587e59da9 100644 --- a/framework/birt/src/org/ofbiz/birt/email/BirtEmailServices.java +++ b/framework/birt/src/org/ofbiz/birt/email/BirtEmailServices.java @@ -55,14 +55,14 @@ import org.ofbiz.widget.screen.ScreenRenderer; import org.xml.sax.SAXException; public class BirtEmailServices { - + public static final String module = BirtEmailServices.class.getName(); - + protected static final HtmlScreenRenderer htmlScreenRenderer = new HtmlScreenRenderer(); - + /** * send birt mail - * + * * @param ctx * @param context * @return @@ -127,9 +127,9 @@ public class BirtEmailServices { return ServiceUtil.returnError(errMsg); } } - + boolean isMultiPart = false; - + // check if attachment screen location passed in if (UtilValidate.isNotEmpty(birtReportLocation)) { isMultiPart = true; @@ -137,7 +137,7 @@ public class BirtEmailServices { try { // create the output stream for the generation ByteArrayOutputStream baos = new ByteArrayOutputStream(); - + Map birtContext = FastMap.newInstance(); if (birtLocale == null) { birtLocale = locale; @@ -218,7 +218,7 @@ public class BirtEmailServices { serviceContext.put("contentType", "text/html"); } } - + // also expand the subject at this point, just in case it has the FlexibleStringExpander syntax in it... String subject = (String) serviceContext.remove("subject"); subject = FlexibleStringExpander.expandString(subject, screenContext, locale); @@ -238,7 +238,7 @@ public class BirtEmailServices { String errMsg = "Error send email :" + e.toString(); Debug.logError(e, errMsg, module); return ServiceUtil.returnError(errMsg); - } + } result.put("body", bodyWriter.toString()); return result; } diff --git a/framework/birt/src/org/ofbiz/birt/report/context/BirtViewerAttributeBean.java b/framework/birt/src/org/ofbiz/birt/report/context/BirtViewerAttributeBean.java index f4e95bd0ad..39c5df1a09 100644 --- a/framework/birt/src/org/ofbiz/birt/report/context/BirtViewerAttributeBean.java +++ b/framework/birt/src/org/ofbiz/birt/report/context/BirtViewerAttributeBean.java @@ -34,13 +34,13 @@ import org.eclipse.birt.report.utility.ParameterAccessor; import org.ofbiz.base.location.FlexibleLocation; public class BirtViewerAttributeBean extends ViewerAttributeBean { - + public final static String module = BirtViewerAttributeBean.class.getName(); public BirtViewerAttributeBean(HttpServletRequest request) { super(request); } - + protected void __init( HttpServletRequest request ) throws Exception { String reportParam = DataUtil.trimString( ParameterAccessor.getParameter( request, ParameterAccessor.PARAM_REPORT )); @@ -63,7 +63,7 @@ public class BirtViewerAttributeBean extends ViewerAttributeBean { if ( this.reportDesignHandle == null ) throw new ViewerException( ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN ); - + // Initialize report parameters. __initParameters( request ); } diff --git a/framework/birt/src/org/ofbiz/birt/report/context/OFBizBirtContext.java b/framework/birt/src/org/ofbiz/birt/report/context/OFBizBirtContext.java index ef5a3f43a8..9d5f05fb65 100644 --- a/framework/birt/src/org/ofbiz/birt/report/context/OFBizBirtContext.java +++ b/framework/birt/src/org/ofbiz/birt/report/context/OFBizBirtContext.java @@ -26,7 +26,7 @@ import org.eclipse.birt.report.context.BirtContext; import org.eclipse.birt.report.context.ViewerAttributeBean; public class OFBizBirtContext extends BirtContext { - + public final static String module = OFBizBirtContext.class.getName(); public OFBizBirtContext(HttpServletRequest request, diff --git a/framework/birt/src/org/ofbiz/birt/report/service/OFBizBirtViewerReportService.java b/framework/birt/src/org/ofbiz/birt/report/service/OFBizBirtViewerReportService.java index 07388aaa28..5b121a22af 100644 --- a/framework/birt/src/org/ofbiz/birt/report/service/OFBizBirtViewerReportService.java +++ b/framework/birt/src/org/ofbiz/birt/report/service/OFBizBirtViewerReportService.java @@ -56,19 +56,19 @@ import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.jdbc.ConnectionFactory; public class OFBizBirtViewerReportService extends BirtViewerReportService { - + public final static String module = OFBizBirtViewerReportService.class.getName(); public OFBizBirtViewerReportService(ServletContext servletContext) { super(servletContext); // TODO Auto-generated constructor stub } - + public String runReport(IViewerReportDesignHandle design, String outputDocName, InputOptions runOptions, Map parameters, Map displayTexts, List errorList) throws ReportServiceException { // TODO Auto-generated method stub - + if ( design == null || design.getDesignObject( ) == null ) throw new ReportServiceException( BirtResources.getMessage( ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN ) ); @@ -99,7 +99,7 @@ public class OFBizBirtViewerReportService extends BirtViewerReportService { if ( ParameterAccessor.isReportParameterExist( request, ParameterAccessor.PARAM_MAXROWS ) ) maxRows = Integer.valueOf( ParameterAccessor.getMaxRows( request ) ); - + try { // put all app context from Birt Container to Report Engine Service ReportEngineService.getInstance().getEngineConfig().getAppContext().putAll( @@ -139,12 +139,12 @@ public class OFBizBirtViewerReportService extends BirtViewerReportService { } return outputDocName; } - + /** * Run report. - * + * * @param request - * + * * @param runnable * @param archive * @param documentName @@ -170,7 +170,7 @@ public class OFBizBirtViewerReportService extends BirtViewerReportService { throwDummyException(e); } runTask.setLocale( locale ); - + com.ibm.icu.util.TimeZone tz = BirtUtility.toICUTimeZone( timeZone ); if ( tz != null ) { @@ -237,7 +237,7 @@ public class OFBizBirtViewerReportService extends BirtViewerReportService { } return null; } - + /** * @see org.eclipse.birt.report.service.api.IViewerReportService#runAndRenderReport(org.eclipse.birt.report.service.api.IViewerReportDesignHandle, * java.lang.String, org.eclipse.birt.report.service.api.InputOptions, @@ -293,7 +293,7 @@ public class OFBizBirtViewerReportService extends BirtViewerReportService { throwReportServiceException( e ); } } - + /** * get connection */ @@ -312,7 +312,7 @@ public class OFBizBirtViewerReportService extends BirtViewerReportService { } return connection; } - + /** * @param e * @throws DummyRemoteException @@ -330,7 +330,7 @@ public class OFBizBirtViewerReportService extends BirtViewerReportService { .getLocalizedMessage( ), e ) ); } } - + /** * Temporary method for extracting the exception from the * DummyRemoteException and throwing it. diff --git a/framework/birt/src/org/ofbiz/birt/report/servlet/BirtEngineServlet.java b/framework/birt/src/org/ofbiz/birt/report/servlet/BirtEngineServlet.java index 5d310f3e54..7238c6cf99 100644 --- a/framework/birt/src/org/ofbiz/birt/report/servlet/BirtEngineServlet.java +++ b/framework/birt/src/org/ofbiz/birt/report/servlet/BirtEngineServlet.java @@ -38,7 +38,7 @@ import org.ofbiz.birt.report.context.OFBizBirtContext; import org.ofbiz.birt.report.service.OFBizBirtViewerReportService; public class BirtEngineServlet extends org.eclipse.birt.report.servlet.BirtEngineServlet { - + public final static String module = BirtEngineServlet.class.getName(); protected void __init( ServletConfig config ) diff --git a/framework/birt/src/org/ofbiz/birt/report/servlet/BirtViewerServlet.java b/framework/birt/src/org/ofbiz/birt/report/servlet/BirtViewerServlet.java index b1bd27e09a..15e9d54121 100644 --- a/framework/birt/src/org/ofbiz/birt/report/servlet/BirtViewerServlet.java +++ b/framework/birt/src/org/ofbiz/birt/report/servlet/BirtViewerServlet.java @@ -39,13 +39,13 @@ import org.ofbiz.birt.report.context.OFBizBirtContext; import org.ofbiz.birt.report.service.OFBizBirtViewerReportService; public class BirtViewerServlet extends ViewerServlet { - + public final static String module = BirtViewerServlet.class.getName(); - + protected void __init(ServletConfig config) { BirtReportServiceFactory.init( new OFBizBirtViewerReportService( config .getServletContext( ) ) ); - + // handle 'frameset' pattern viewer = new FramesetFragment( ); viewer.buildComposite( ); diff --git a/framework/birt/src/org/ofbiz/birt/webapp/view/BirtViewHandler.java b/framework/birt/src/org/ofbiz/birt/webapp/view/BirtViewHandler.java index 3e72d4864c..4cf7c29715 100644 --- a/framework/birt/src/org/ofbiz/birt/webapp/view/BirtViewHandler.java +++ b/framework/birt/src/org/ofbiz/birt/webapp/view/BirtViewHandler.java @@ -48,13 +48,13 @@ import org.ofbiz.birt.widget.BirtFactory; import org.xml.sax.SAXException; public class BirtViewHandler implements ViewHandler { - + public static final String module = BirtViewHandler.class.getName(); protected ServletContext servletContext = null; private String name = "birt"; - + public void init(ServletContext context) throws ViewHandlerException { // TODO Auto-generated method stub this.servletContext = context; @@ -84,7 +84,7 @@ public class BirtViewHandler implements ViewHandler { } else { design = engine.openReportDesign(servletContext.getRealPath(page)); } - + Map context = FastMap.newInstance(); // set parameters from request Map parameters = UtilGenerics.cast(request.getAttribute(BirtWorker.BIRT_PARAMETERS)); diff --git a/framework/birt/src/org/ofbiz/birt/widget/BirtFactory.java b/framework/birt/src/org/ofbiz/birt/widget/BirtFactory.java index 7c1393e0da..ac3b71f0a1 100644 --- a/framework/birt/src/org/ofbiz/birt/widget/BirtFactory.java +++ b/framework/birt/src/org/ofbiz/birt/widget/BirtFactory.java @@ -30,9 +30,9 @@ import org.ofbiz.widget.screen.ScreenFactory; import org.xml.sax.SAXException; public class BirtFactory { - + public static final String module = BirtFactory.class.getName(); - + /** * get report inport stream from location * @param resourceName @@ -43,7 +43,7 @@ public class BirtFactory { */ public static InputStream getReportInputStreamFromLocation(String resourceName) throws IOException, SAXException, ParserConfigurationException{ - + InputStream reportInputStream = null; synchronized (BirtFactory.class) { long startTime = System.currentTimeMillis(); @@ -60,7 +60,7 @@ public class BirtFactory { double totalSeconds = (System.currentTimeMillis() - startTime)/1000.0; Debug.logInfo("Got report in " + totalSeconds + "s from: " + reportFileUrl.toExternalForm(), module); } - + if (reportInputStream == null) { throw new IllegalArgumentException("Could not find report file with location [" + resourceName + "]"); } diff --git a/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java b/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java index 6306e86009..6cd304316b 100644 --- a/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java +++ b/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java @@ -536,7 +536,7 @@ public class CatalinaContainer implements Container { } else { sessionMgr = new StandardManager(); } - + // create the web application context StandardContext context = (StandardContext) embedded.createContext(mount, location); context.setJ2EEApplication(J2EE_APP); diff --git a/framework/common/src/org/ofbiz/common/CommonServices.java b/framework/common/src/org/ofbiz/common/CommonServices.java index c870395219..57cee564e8 100644 --- a/framework/common/src/org/ofbiz/common/CommonServices.java +++ b/framework/common/src/org/ofbiz/common/CommonServices.java @@ -97,7 +97,7 @@ public class CommonServices { System.out.println("----- SVC: " + dctx.getName() + " -----"); return response; } - + /** * Generic Test SOAP Service *@param dctx The DispatchContext that this service is operating in diff --git a/framework/common/src/org/ofbiz/common/CommonWorkers.java b/framework/common/src/org/ofbiz/common/CommonWorkers.java index 8de8bebf8c..d1f36edfe3 100644 --- a/framework/common/src/org/ofbiz/common/CommonWorkers.java +++ b/framework/common/src/org/ofbiz/common/CommonWorkers.java @@ -52,14 +52,14 @@ public class CommonWorkers { Debug.logError(e, "Cannot lookup Geo", module); } } - + List exprs = UtilMisc.toList(EntityCondition.makeCondition("geoTypeId", EntityOperator.EQUALS, "COUNTRY")); - List countriesAvailable = StringUtil.split(UtilProperties.getPropertyValue("general.properties", "countries.geo.id.available"), ","); + List countriesAvailable = StringUtil.split(UtilProperties.getPropertyValue("general.properties", "countries.geo.id.available"), ","); if (UtilValidate.isNotEmpty(countriesAvailable)) { // only available countries (we don't verify the list of geoId in countries.geo.id.available) exprs.add(EntityCondition.makeCondition("geoId", EntityOperator.IN, countriesAvailable)); } - + List countriesList = FastList.newInstance(); try { countriesList = delegator.findList("Geo", EntityCondition.makeCondition(exprs), null, UtilMisc.toList("geoName"), null, true); @@ -76,7 +76,7 @@ public class CommonWorkers { } } } - if (removeDefaultGeo) { + if (removeDefaultGeo) { geoList.remove(0); // Remove default country to avoid double rows in drop-down, from 1st place to keep alphabetical order } geoList.addAll(countriesList); @@ -103,7 +103,7 @@ public class CommonWorkers { public static List getAssociatedStateList(Delegator delegator, String country) { return getAssociatedStateList(delegator, country, null); } - + /** * Returns a list of regional geo associations. */ @@ -119,7 +119,7 @@ public class CommonWorkers { EntityCondition.makeCondition("geoTypeId", "STATE"), EntityCondition.makeCondition("geoTypeId", "PROVINCE"), EntityCondition.makeCondition("geoTypeId", "COUNTY"))); - + if (UtilValidate.isEmpty(listOrderBy)) { listOrderBy = "geoId"; } @@ -134,11 +134,11 @@ public class CommonWorkers { return geoList; } - + /** * A generic method to be used on Type enities, e.g. ProductType. Recurse to the root level in the type hierarchy * and checks if the specified type childType has parentType as its parent somewhere in the hierarchy. - * + * * @param delegator The Delegator object. * @param entityName Name of the Type entity on which check is performed. * @param primaryKey Primary Key field of the Type entity. @@ -165,7 +165,7 @@ public class CommonWorkers { } } } - + return false; } } diff --git a/framework/common/src/org/ofbiz/common/FindServices.java b/framework/common/src/org/ofbiz/common/FindServices.java index 856f355a96..20bcf39a14 100644 --- a/framework/common/src/org/ofbiz/common/FindServices.java +++ b/framework/common/src/org/ofbiz/common/FindServices.java @@ -303,7 +303,7 @@ public class FindServices { } cond = EntityCondition.makeCondition(fieldName, fieldOp, fieldObject); } - + if (EntityOperator.NOT_EQUAL.equals(fieldOp) && fieldObject != null) { tmpOrList = FastList.newInstance(); tmpOrList.add(cond); @@ -384,10 +384,10 @@ public class FindServices { public static Map performFindList(DispatchContext dctx, Map context) { Integer viewSize = (Integer) context.get("viewSize"); if (viewSize == null) viewSize = Integer.valueOf(20); // default - context.put("viewSize", viewSize); + context.put("viewSize", viewSize); Integer viewIndex = (Integer) context.get("viewIndex"); if (viewIndex == null) viewIndex = Integer.valueOf(0); // default - context.put("viewIndex", viewIndex); + context.put("viewIndex", viewIndex); Map result = performFind(dctx,context); @@ -449,9 +449,9 @@ public class FindServices { Map prepareResult = null; try { - prepareResult = dispatcher.runSync("prepareFind", UtilMisc.toMap("entityName", entityName, "orderBy", orderBy, + prepareResult = dispatcher.runSync("prepareFind", UtilMisc.toMap("entityName", entityName, "orderBy", orderBy, "inputFields", inputFields, "filterByDate", filterByDate, - "filterByDateValue", filterByDateValue, "userLogin", userLogin, + "filterByDateValue", filterByDateValue, "userLogin", userLogin, "locale", context.get("locale"), "timeZone", context.get("timeZone"))); } catch (GenericServiceException gse) { return ServiceUtil.returnError("Error preparing conditions: " + gse.getMessage()); @@ -461,9 +461,9 @@ public class FindServices { Map executeResult = null; try { - executeResult = dispatcher.runSync("executeFind", UtilMisc.toMap("entityName", entityName, "orderByList", orderByList, - "fieldList", fieldList, "entityConditionList", exprList, - "noConditionFind", noConditionFind, "distinct", distinct, + executeResult = dispatcher.runSync("executeFind", UtilMisc.toMap("entityName", entityName, "orderByList", orderByList, + "fieldList", fieldList, "entityConditionList", exprList, + "noConditionFind", noConditionFind, "distinct", distinct, "locale", context.get("locale"), "timeZone", context.get("timeZone"), "maxRows", maxRows)); } catch (GenericServiceException gse) { diff --git a/framework/common/src/org/ofbiz/common/authentication/AuthHelper.java b/framework/common/src/org/ofbiz/common/authentication/AuthHelper.java index 37573f8777..026c3cb1f0 100644 --- a/framework/common/src/org/ofbiz/common/authentication/AuthHelper.java +++ b/framework/common/src/org/ofbiz/common/authentication/AuthHelper.java @@ -74,14 +74,14 @@ public class AuthHelper { public static void updatePassword(String username, String password, String newPassword) throws AuthenticatorException { if (!authenticatorsLoaded) throw new AuthenticatorException("Authenticators never loaded; be sure to call AuthHelper.loadAuthenticators()"); for (Authenticator auth : authenticators) { - auth.updatePassword(username, password, newPassword); + auth.updatePassword(username, password, newPassword); } } public static boolean authenticatorsLoaded() { return authenticatorsLoaded; } - + public static void loadAuthenticators(LocalDispatcher dispatcher) { if (!authenticatorsLoaded) { loadAuthenticators_internal(dispatcher); @@ -95,7 +95,7 @@ public class AuthHelper { try { Authenticator auth = it.next(); if (auth.isEnabled()) { - auth.initialize(dispatcher); + auth.initialize(dispatcher); authenticators.add(auth); } } catch (ClassCastException e) { diff --git a/framework/common/src/org/ofbiz/common/authentication/AuthenticationComparator.java b/framework/common/src/org/ofbiz/common/authentication/AuthenticationComparator.java index ba327f3f73..f0ddbacbf8 100644 --- a/framework/common/src/org/ofbiz/common/authentication/AuthenticationComparator.java +++ b/framework/common/src/org/ofbiz/common/authentication/AuthenticationComparator.java @@ -61,7 +61,7 @@ public class AuthenticationComparator implements Comparator { * second. * @throws ClassCastException if the arguments' types prevent them from * being compared by this Comparator. - */ + */ public int compare(Authenticator a1, Authenticator a2) { if (a1.getWeight() < a2.getWeight()) { return -1; diff --git a/framework/common/src/org/ofbiz/common/authentication/api/Authenticator.java b/framework/common/src/org/ofbiz/common/authentication/api/Authenticator.java index 8b5d986977..851798ed11 100644 --- a/framework/common/src/org/ofbiz/common/authentication/api/Authenticator.java +++ b/framework/common/src/org/ofbiz/common/authentication/api/Authenticator.java @@ -78,13 +78,13 @@ public interface Authenticator { public float getWeight(); /** - * Is the user synchronized back to OFBiz + * Is the user synchronized back to OFBiz * @return true if the user record is copied to the OFB database */ public boolean isUserSynchronized(); /** - * Is this expected to be the only authenticator, if so errors will be thrown when users cannot be found + * Is this expected to be the only authenticator, if so errors will be thrown when users cannot be found * @return true if this is expected to be the only Authenticator */ public boolean isSingleAuthenticator(); diff --git a/framework/common/src/org/ofbiz/common/authentication/api/AuthenticatorException.java b/framework/common/src/org/ofbiz/common/authentication/api/AuthenticatorException.java index c8f0c84f3e..246a8c4619 100644 --- a/framework/common/src/org/ofbiz/common/authentication/api/AuthenticatorException.java +++ b/framework/common/src/org/ofbiz/common/authentication/api/AuthenticatorException.java @@ -27,7 +27,7 @@ import org.ofbiz.base.util.GeneralException; * AuthenticatorException */ public class AuthenticatorException extends GeneralException { - + private static final long serialVersionUID = 2836939874682240962L; /** diff --git a/framework/common/src/org/ofbiz/common/email/EmailServices.java b/framework/common/src/org/ofbiz/common/email/EmailServices.java index 94d0dc33ac..6620a3b99e 100644 --- a/framework/common/src/org/ofbiz/common/email/EmailServices.java +++ b/framework/common/src/org/ofbiz/common/email/EmailServices.java @@ -104,7 +104,7 @@ public class EmailServices { Map results = ServiceUtil.returnSuccess(); String subject = (String) context.get("subject"); subject = FlexibleStringExpander.expandString(subject, context); - + String partyId = (String) context.get("partyId"); String body = (String) context.get("body"); List> bodyParts = UtilGenerics.checkList(context.get("bodyParts")); @@ -301,7 +301,7 @@ public class EmailServices { results.put("messageWrapper", new MimeMessageWrapper(session, mail)); return results; } - + Transport trans = null; try { trans = session.getTransport("smtp"); @@ -356,14 +356,14 @@ public class EmailServices { *@param rcontext Map containing the input parameters *@return Map with the result of the service, the output parameters */ - public static Map sendMailFromUrl(DispatchContext ctx, Map rcontext) { + public static Map sendMailFromUrl(DispatchContext ctx, Map rcontext) { // pretty simple, get the content and then call the sendMail method below Map sendMailContext = UtilMisc.makeMapWritable(rcontext); String bodyUrl = (String) sendMailContext.remove("bodyUrl"); Map bodyUrlParameters = UtilGenerics.checkMap(sendMailContext.remove("bodyUrlParameters")); LocalDispatcher dispatcher = ctx.getDispatcher(); - + URL url = null; try { @@ -382,7 +382,7 @@ public class EmailServices { Debug.logWarning(e, module); return ServiceUtil.returnError("Error getting content: " + e.toString()); } - + sendMailContext.put("body", body); Map sendMailResult; try { @@ -391,7 +391,7 @@ public class EmailServices { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); } - + // just return the same result; it contains all necessary information return sendMailResult; } @@ -576,7 +576,7 @@ public class EmailServices { if (ServiceUtil.isError(sendMailResult)) { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(sendMailResult)); } - + result.put("messageWrapper", sendMailResult.get("messageWrapper")); result.put("body", bodyWriter.toString()); result.put("subject", subject); diff --git a/framework/common/src/org/ofbiz/common/image/ImageTransform.java b/framework/common/src/org/ofbiz/common/image/ImageTransform.java index 301a4b2f16..3bf584f607 100644 --- a/framework/common/src/org/ofbiz/common/image/ImageTransform.java +++ b/framework/common/src/org/ofbiz/common/image/ImageTransform.java @@ -172,7 +172,7 @@ public class ImageTransform { // scale original image with new size Image newImg = bufImg.getScaledInstance((int) (imgWidth * scaleFactor), (int) (imgHeight * scaleFactor), Image.SCALE_SMOOTH); - + bufNewImg = ImageTransform.toBufferedImage(newImg, bufImgType); result.put("responseMessage", "success"); @@ -251,7 +251,7 @@ public class ImageTransform { return result; } - + /** * toBufferedImage *

@@ -263,7 +263,7 @@ public class ImageTransform { public static BufferedImage toBufferedImage(Image image) { return ImageTransform.toBufferedImage(image, BufferedImage.TYPE_INT_ARGB_PRE); } - + public static BufferedImage toBufferedImage(Image image, int bufImgType) { /** Check if the image isn't already a BufferedImage instance */ if( image instanceof BufferedImage ) { @@ -271,18 +271,18 @@ public class ImageTransform { } else { /** Full image loading */ image = new ImageIcon(image).getImage(); - + /** new BufferedImage creation */ BufferedImage bufferedImage = new BufferedImage( image.getWidth(null), image.getHeight(null), bufImgType); - + Graphics2D g = bufferedImage.createGraphics(); g.drawImage(image,0,0,null); g.dispose(); - + return( bufferedImage ); - } + } } } diff --git a/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java b/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java index 151daf4ea4..4559884108 100644 --- a/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java +++ b/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java @@ -150,7 +150,7 @@ public class PreferenceServices { } } } - + Map result = ServiceUtil.returnSuccess(); result.put("userPrefMap", userPrefMap); return result; diff --git a/framework/common/src/org/ofbiz/common/uom/UomWorker.java b/framework/common/src/org/ofbiz/common/uom/UomWorker.java index a063fbf3be..05f457fbf0 100644 --- a/framework/common/src/org/ofbiz/common/uom/UomWorker.java +++ b/framework/common/src/org/ofbiz/common/uom/UomWorker.java @@ -98,7 +98,7 @@ public class UomWorker { public static BigDecimal convertUom(BigDecimal originalValue, String uomId, String uomIdTo, LocalDispatcher dispatcher) { if (originalValue == null || uomId == null || uomIdTo == null) return null; if (uomId.equals(uomIdTo)) return originalValue; - + Map svcInMap = FastMap.newInstance(); svcInMap.put("originalValue", originalValue); svcInMap.put("uomId", uomId); diff --git a/framework/datafile/src/org/ofbiz/datafile/Record.java b/framework/datafile/src/org/ofbiz/datafile/Record.java index db31337073..916a25c382 100644 --- a/framework/datafile/src/org/ofbiz/datafile/Record.java +++ b/framework/datafile/src/org/ofbiz/datafile/Record.java @@ -269,9 +269,9 @@ public class Record implements Serializable { else if (fieldType.equals("java.lang.String") || fieldType.equals("String")) if (field.format.equals("EncryptedString")) { String hashType = LoginServices.getHashType(); - set(name, HashCrypt.getDigestHash(value, hashType)); + set(name, HashCrypt.getDigestHash(value, hashType)); } else { - set(name, value); + set(name, value); } else if (fieldType.equals("NullTerminatedString")) { int terminate = value.indexOf(0x0); diff --git a/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java b/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java index 1372cbbdb4..afeceaa227 100644 --- a/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java +++ b/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java @@ -284,26 +284,26 @@ public class EntityExpr extends EntityCondition { throw new IllegalArgumentException("Type " + curField.getType() + " not found for entity [" + modelEntity.getEntityName() + "]; probably because there is no datasource (helper) setup for the entity group that this entity is in: [" + delegator.getEntityGroupName(modelEntity.getEntityName()) + "]"); } if (value instanceof EntityConditionSubSelect){ - ModelFieldType valueType = null; - try { - ModelEntity valueModelEntity= ((EntityConditionSubSelect) value).getModelEntity(); - valueType = delegator.getEntityFieldType(valueModelEntity, valueModelEntity.getField(((EntityConditionSubSelect) value).getKeyFieldName()).getType()); - } catch (GenericEntityException e) { - Debug.logWarning(e, module); - } + ModelFieldType valueType = null; + try { + ModelEntity valueModelEntity= ((EntityConditionSubSelect) value).getModelEntity(); + valueType = delegator.getEntityFieldType(valueModelEntity, valueModelEntity.getField(((EntityConditionSubSelect) value).getKeyFieldName()).getType()); + } catch (GenericEntityException e) { + Debug.logWarning(e, module); + } // make sure the type of keyFieldName of EntityConditionSubSelect matches the field Java type - if (!ObjectType.instanceOf(valueType.getJavaType(), type.getJavaType())) { - String errMsg = "Warning using ["+ value.getClass().getName() + "] and entity field [" + modelEntity.getEntityName() + "." + curField.getName() + "]. The Java type of keyFieldName : [" + valueType.getJavaType()+ "] is not compatible with the Java type of the field [" + type.getJavaType() + "]"; - // eventually we should do this, but for now we'll do a "soft" failure: throw new IllegalArgumentException(errMsg); - Debug.logWarning(new Exception("Location of database type warning"), "=-=-=-=-=-=-=-=-= Database type warning in EntityExpr =-=-=-=-=-=-=-=-= " + errMsg, module); + if (!ObjectType.instanceOf(valueType.getJavaType(), type.getJavaType())) { + String errMsg = "Warning using ["+ value.getClass().getName() + "] and entity field [" + modelEntity.getEntityName() + "." + curField.getName() + "]. The Java type of keyFieldName : [" + valueType.getJavaType()+ "] is not compatible with the Java type of the field [" + type.getJavaType() + "]"; + // eventually we should do this, but for now we'll do a "soft" failure: throw new IllegalArgumentException(errMsg); + Debug.logWarning(new Exception("Location of database type warning"), "=-=-=-=-=-=-=-=-= Database type warning in EntityExpr =-=-=-=-=-=-=-=-= " + errMsg, module); } } else { // make sure the type matches the field Java type - if (!ObjectType.instanceOf(value, type.getJavaType())) { - String errMsg = "In entity field [" + modelEntity.getEntityName() + "." + curField.getName() + "] set the value passed in [" + value.getClass().getName() + "] is not compatible with the Java type of the field [" + type.getJavaType() + "]"; - // eventually we should do this, but for now we'll do a "soft" failure: throw new IllegalArgumentException(errMsg); - Debug.logWarning(new Exception("Location of database type warning"), "=-=-=-=-=-=-=-=-= Database type warning in EntityExpr =-=-=-=-=-=-=-=-= " + errMsg, module); - } + if (!ObjectType.instanceOf(value, type.getJavaType())) { + String errMsg = "In entity field [" + modelEntity.getEntityName() + "." + curField.getName() + "] set the value passed in [" + value.getClass().getName() + "] is not compatible with the Java type of the field [" + type.getJavaType() + "]"; + // eventually we should do this, but for now we'll do a "soft" failure: throw new IllegalArgumentException(errMsg); + Debug.logWarning(new Exception("Location of database type warning"), "=-=-=-=-=-=-=-=-= Database type warning in EntityExpr =-=-=-=-=-=-=-=-= " + errMsg, module); + } } } diff --git a/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java b/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java index c376f08e5d..7f5a52aa31 100644 --- a/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java +++ b/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java @@ -971,7 +971,7 @@ public class GenericDAO { public long selectCountByCondition(ModelEntity modelEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, EntityFindOptions findOptions) throws GenericEntityException { return selectCountByCondition(modelEntity, whereEntityCondition, havingEntityCondition, null, findOptions); } - + public long selectCountByCondition(ModelEntity modelEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, List selectFields, EntityFindOptions findOptions) throws GenericEntityException { if (modelEntity == null) { return 0; diff --git a/framework/entity/src/org/ofbiz/entity/serialize/XmlSerializer.java b/framework/entity/src/org/ofbiz/entity/serialize/XmlSerializer.java index 279a58d019..b241ab3a56 100644 --- a/framework/entity/src/org/ofbiz/entity/serialize/XmlSerializer.java +++ b/framework/entity/src/org/ofbiz/entity/serialize/XmlSerializer.java @@ -363,7 +363,7 @@ public class XmlSerializer { Element mapKeyElement = UtilXml.firstChildElement(curElement, "map-Key"); Element keyElement = null; Node tempNode = mapKeyElement.getFirstChild(); - + while (tempNode != null) { if (tempNode.getNodeType() == Node.ELEMENT_NODE) { keyElement = (Element) tempNode; diff --git a/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java b/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java index 32a2321157..af8ac8d47d 100644 --- a/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java +++ b/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java @@ -148,15 +148,15 @@ public class EntityDataLoadContainer implements Container { } } else if ("drop-pks".equalsIgnoreCase(argumentName)) { if (UtilValidate.isEmpty(argumentVal) || "true".equalsIgnoreCase(argumentVal)) { - dropPks = true; + dropPks = true; } } else if ("create-pks".equalsIgnoreCase(argumentName)) { if (UtilValidate.isEmpty(argumentVal) || "true".equalsIgnoreCase(argumentVal)) { createPks = true; - } + } } else if ("drop-constraints".equalsIgnoreCase(argumentName)) { if (UtilValidate.isEmpty(argumentVal) || "true".equalsIgnoreCase(argumentVal)) { - dropConstraints = true; + dropConstraints = true; } } else if ("create-constraints".equalsIgnoreCase(argumentName)) { if (UtilValidate.isEmpty(argumentVal) || "true".equalsIgnoreCase(argumentVal)) { @@ -243,13 +243,13 @@ public class EntityDataLoadContainer implements Container { modelEntities = delegator.getModelEntityMapByGroup(groupNameToUse); } catch (GenericEntityException e) { throw new ContainerException(e.getMessage(), e); - } - TreeSet modelEntityNames = new TreeSet(modelEntities.keySet()); - + } + TreeSet modelEntityNames = new TreeSet(modelEntities.keySet()); + // check for drop index/fks - if (dropConstraints) { + if (dropConstraints) { List messages = FastList.newInstance(); - + Debug.logImportant("Dropping foreign key indcies...", module); for (String entityName : modelEntityNames) { ModelEntity modelEntity = modelEntities.get(entityName); @@ -257,7 +257,7 @@ public class EntityDataLoadContainer implements Container { dbUtil.deleteForeignKeyIndices(modelEntity, messages); } } - + Debug.logImportant("Dropping declared indices...", module); for (String entityName : modelEntityNames) { ModelEntity modelEntity = modelEntities.get(entityName); @@ -265,7 +265,7 @@ public class EntityDataLoadContainer implements Container { dbUtil.deleteDeclaredIndices(modelEntity, messages); } } - + Debug.logImportant("Dropping foreign keys...", module); for (String entityName : modelEntityNames) { ModelEntity modelEntity = modelEntities.get(entityName); @@ -273,7 +273,7 @@ public class EntityDataLoadContainer implements Container { dbUtil.deleteForeignKeys(modelEntity, modelEntities, messages); } } - + if (messages.size() > 0) { if (Debug.infoOn()) { for (String message : messages) { @@ -282,18 +282,18 @@ public class EntityDataLoadContainer implements Container { } } } - + // drop pks if (dropPks) { List messages = FastList.newInstance(); Debug.logImportant("Dropping primary keys...", module); for (String entityName : modelEntityNames) { - ModelEntity modelEntity = modelEntities.get(entityName); + ModelEntity modelEntity = modelEntities.get(entityName); if (modelEntity != null) { dbUtil.deletePrimaryKey(modelEntity, messages); } } - + if (messages.size() > 0) { if (Debug.infoOn()) { for (String message : messages) { @@ -302,7 +302,7 @@ public class EntityDataLoadContainer implements Container { } } } - + // repair columns if (repairColumns) { List fieldsToRepair = FastList.newInstance(); @@ -320,7 +320,7 @@ public class EntityDataLoadContainer implements Container { } } } - + // get the reader name URLs first List urlList = null; if (readerNames != null) { @@ -409,7 +409,7 @@ public class EntityDataLoadContainer implements Container { // create primary keys if (createPks) { List messages = FastList.newInstance(); - + Debug.logImportant("Creating primary keys...", module); for (String entityName : modelEntityNames) { ModelEntity modelEntity = modelEntities.get(entityName); @@ -425,11 +425,11 @@ public class EntityDataLoadContainer implements Container { } } } - + // create constraints - if (createConstraints) { + if (createConstraints) { List messages = FastList.newInstance(); - + Debug.logImportant("Creating foreign keys...", module); for (String entityName : modelEntityNames) { ModelEntity modelEntity = modelEntities.get(entityName); @@ -437,7 +437,7 @@ public class EntityDataLoadContainer implements Container { dbUtil.createForeignKeys(modelEntity, modelEntities, messages); } } - + Debug.logImportant("Creating foreign key indcies...", module); for (String entityName : modelEntityNames) { ModelEntity modelEntity = modelEntities.get(entityName); @@ -445,7 +445,7 @@ public class EntityDataLoadContainer implements Container { dbUtil.createForeignKeyIndices(modelEntity, messages); } } - + Debug.logImportant("Creating declared indices...", module); for (String entityName : modelEntityNames) { ModelEntity modelEntity = modelEntities.get(entityName); @@ -453,7 +453,7 @@ public class EntityDataLoadContainer implements Container { dbUtil.createDeclaredIndices(modelEntity, messages); } } - + if (messages.size() > 0) { if (Debug.infoOn()) { for (String message : messages) { @@ -462,7 +462,7 @@ public class EntityDataLoadContainer implements Container { } } } - + return true; } diff --git a/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java b/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java index b47c4d9c77..23cfc86f8c 100644 --- a/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java +++ b/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java @@ -157,9 +157,9 @@ public abstract class XuiContainer implements Container { UtilProperties.setPropertyValue(startupProperties, "Language", "XuiLabels" + suffix); } if (suffix.equals("_zh")) { // TODO maybe needed for other languages using non Latin alphabet http://en.wikipedia.org/wiki/Alphabet#Types - UtilProperties.setPropertyValue(startupProperties, "StyleFile", "posstyles" + suffix + ".xml"); // For the moment only a Chinese StyleFile is provided + UtilProperties.setPropertyValue(startupProperties, "StyleFile", "posstyles" + suffix + ".xml"); // For the moment only a Chinese StyleFile is provided } else { - UtilProperties.setPropertyValue(startupProperties, "StyleFile", "posstyles.xml"); // Languages using Latin alphabet + UtilProperties.setPropertyValue(startupProperties, "StyleFile", "posstyles.xml"); // Languages using Latin alphabet } frame.setVisible(true); frame.getContentPane().add(this); diff --git a/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java b/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java index 3f4b9ed3ef..e5e56581c0 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java @@ -280,7 +280,7 @@ public class MethodContext implements Iterable> { public Authorization getAuthz() { return this.authz; } - + public Security getSecurity() { return this.security; } diff --git a/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java b/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java index 55e8f6ad78..331204b355 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java @@ -57,7 +57,7 @@ public class CallService extends MethodOperation { public static final String module = CallService.class.getName(); public static final String resource = "MiniLangErrorUiLabels"; - + protected String serviceName; protected ContextAccessor> inMapAcsr; protected String includeUserLoginStr; @@ -316,14 +316,14 @@ public class CallService extends MethodOperation { String successSuffixStr = successSuffix.getMessage(methodContext.getLoader(), methodContext); String messagePrefixStr = messagePrefix.getMessage(methodContext.getLoader(), methodContext); String messageSuffixStr = messageSuffix.getMessage(methodContext.getLoader(), methodContext); - + String errorMessage = ServiceUtil.makeErrorMessage(result, messagePrefixStr, messageSuffixStr, errorPrefixStr, errorSuffixStr); if (UtilValidate.isNotEmpty(errorMessage)) { errorMessage += UtilProperties.getMessage(resource, "simpleMethod.error_show_service_name", UtilMisc.toMap("serviceName", serviceName, "methodName", simpleMethod.getMethodName()), locale); if (methodContext.getMethodType() == MethodContext.EVENT) { methodContext.putEnv(simpleMethod.getEventErrorMessageName(), errorMessage); } else if (methodContext.getMethodType() == MethodContext.SERVICE) { - ServiceUtil.addErrors(UtilMisc.getListFromMap(methodContext.getEnvMap(), this.simpleMethod.getServiceErrorMessageListName()), + ServiceUtil.addErrors(UtilMisc.getListFromMap(methodContext.getEnvMap(), this.simpleMethod.getServiceErrorMessageListName()), UtilMisc.getMapFromMap(methodContext.getEnvMap(), this.simpleMethod.getServiceErrorMessageMapName()), result); // the old way, makes a mess of messages passed up the stack: methodContext.putEnv(simpleMethod.getServiceErrorMessageName(), errorMessage); Debug.logError(new Exception(errorMessage), module); diff --git a/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java b/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java index 8c4de62b67..c6fc46ce48 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java @@ -74,7 +74,7 @@ public class HasPermissionCondition implements Conditional { } } else { // run hasPermission - if (authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap())) { + if (authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap())) { runSubOps = true; } } diff --git a/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java b/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java index fda4ddb010..2550c79fef 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java @@ -106,7 +106,7 @@ public class EntityCount extends MethodOperation { } ModelEntity modelEntity = delegator.getModelEntity(entityName); - + // create whereEntityCondition from whereCondition EntityCondition whereEntityCondition = null; if (this.whereCondition != null) { diff --git a/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java b/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java index c8498a355e..a0c91c0d7b 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java @@ -104,7 +104,7 @@ public class CheckPermission extends MethodOperation { // if no user is logged in, treat as if the user does not have permission: do not run subops GenericValue userLogin = methodContext.getUserLogin(); if (userLogin != null) { - Authorization authz = methodContext.getAuthz(); + Authorization authz = methodContext.getAuthz(); Security security = methodContext.getSecurity(); if (this.permissionInfo.hasPermission(methodContext, userLogin, authz, security)) { hasPermission = true; @@ -183,7 +183,7 @@ public class CheckPermission extends MethodOperation { return security.hasEntityPermission(permission, action, userLogin); } else { // run hasPermission - return authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap()); + return authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap()); } } } diff --git a/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfHasPermission.java b/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfHasPermission.java index 42ab73410f..4f7ead61ef 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfHasPermission.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfHasPermission.java @@ -92,7 +92,7 @@ public class IfHasPermission extends MethodOperation { } } else { // run hasPermission - if (authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap())) { + if (authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap())) { runSubOps = true; } } diff --git a/framework/security/src/org/ofbiz/security/OFBizSecurity.java b/framework/security/src/org/ofbiz/security/OFBizSecurity.java index b714362e5f..9f04163a7f 100644 --- a/framework/security/src/org/ofbiz/security/OFBizSecurity.java +++ b/framework/security/src/org/ofbiz/security/OFBizSecurity.java @@ -131,7 +131,7 @@ public class OFBizSecurity implements Security { * @see org.ofbiz.security.Security#hasEntityPermission(java.lang.String, java.lang.String, javax.servlet.http.HttpSession) */ public boolean hasEntityPermission(String entity, String action, HttpSession session) { - if (session == null) { + if (session == null) { return false; } GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); diff --git a/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java b/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java index 42fa850de6..255e56f2be 100644 --- a/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java +++ b/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java @@ -31,67 +31,67 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.string.FlexibleStringExpander; public abstract class AbstractAuthorization implements Authorization { - + private static final String module = AbstractAuthorization.class.getName(); - + /** * Used to manage Auto-Grant permissions for the current "request" */ private static ThreadLocal> autoGrant = new ThreadLocal>(); private static ThreadLocal origPermission = new ThreadLocal(); private static ThreadLocal uid = new ThreadLocal(); - + private static final String[] basePermissions = { "access", "create", "read", "update", "delete" }; - + /** * Checks to see if the user has a static permission - * + * * @param userId the user's userId * @param permission the expanded permission string * @param context name/value pairs used for permission lookup * @return true if the user has permission */ public abstract boolean hasStaticPermission(String userId, String permission, Map context); - + /** * Locates the Dynamic Access implementation for the permissions and invokes it - * + * * @param userId the user's userId * @param permission the expanded permission string * @param context name/value pairs used for permission lookup * @return true if the user has permission */ public abstract boolean hasDynamicPermission(String userId, String permission, Map context); - + /** * Obtains a list of permissions auto-granted by the given permission - * + * * @param userId the user's userId * @param permission the expanded permission string * @param context name/value pairs used for permission lookup * @return a List of permission strings to auto-grant the user */ public abstract List getAutoGrantPermissions(String userId, String permission, Map context); - + /** * Takes a regular expression (permissionRegexp) and evaluates it against base permissions and returns permission * values for each match. * Example 1: ".*:example" will return values for access:example, create:example, read:example, update:example and delete:example - * Example 2: "(access|read):example:${exampleId} will return values for access:example:${exampleId} and read:example:${exampleId} - * + * Example 2: "(access|read):example:${exampleId} will return values for access:example:${exampleId} and read:example:${exampleId} + * * NOTE: the regular expression can only be part of the base permission (before the first colon) - * + * * @param userId the user's userId - * @param permissionRegexp permission string containing regexp in the base position + * @param permissionRegexp permission string containing regexp in the base position * @param expanded true if the permission string is already expanded, false if it will contain ${} context values * @return a map of allowed or disallowed permissions */ public Map findMatchingPermission(String userId, String permissionRegexp, Map context) { Map resultMap = FastMap.newInstance(); - + String regexp = permissionRegexp.substring(0, permissionRegexp.indexOf(":")); String permStr = permissionRegexp.substring(permissionRegexp.indexOf(":")); - + Pattern p = Pattern.compile("^" + regexp + ":.*$"); for (String base : basePermissions) { Matcher m = p.matcher(base + permStr); @@ -102,19 +102,19 @@ public abstract class AbstractAuthorization implements Authorization { } return resultMap; } - + /** * Test to see if the specified user has permission - * + * * @param userId the user's userId * @param permission the raw permission string - * @param context name/value pairs used for permission lookup + * @param context name/value pairs used for permission lookup * @return true if the user has permission */ public boolean hasPermission(String userId, String permission, Map context) { // expand the permission string String expandedPermission = FlexibleStringExpander.expandString(permission, context); - + // verify the ThreadLocal data; make sure it isn't stale (from a thread pool) String threadUid = uid.get(); if (threadUid != null && !userId.equals(threadUid)) { @@ -123,7 +123,7 @@ public abstract class AbstractAuthorization implements Authorization { uid.remove(); threadUid = null; } - + // set the tracking values on thread local boolean initialCall = false; if (UtilValidate.isEmpty(threadUid)) { @@ -131,12 +131,12 @@ public abstract class AbstractAuthorization implements Authorization { uid.set(userId); initialCall = true; } - + // split the permission string; so we can walk up the levels String[] permSplit = expandedPermission.split(":"); StringBuilder joined = new StringBuilder(); int index = 1; - + if (permSplit != null && permSplit.length > 1) { if (Debug.verboseOn()) Debug.logVerbose("Security 2.0 schema found -- walking tree : " + expandedPermission, module); // start walking @@ -146,7 +146,7 @@ public abstract class AbstractAuthorization implements Authorization { joined.append(":"); } joined.append(perm); - + // first check auto-granted permissions List grantedPerms = autoGrant.get(); if (UtilValidate.isNotEmpty(grantedPerms)) { @@ -160,7 +160,7 @@ public abstract class AbstractAuthorization implements Authorization { } } } - + // next check static permission if (hasStaticPermission(userId, joined.toString(), context)) { // permission granted @@ -170,7 +170,7 @@ public abstract class AbstractAuthorization implements Authorization { } index++; } - + // finally check dynamic permission (outside the loop) String threadPerm = origPermission.get(); if (initialCall || !permission.equals(threadPerm)) { @@ -189,27 +189,27 @@ public abstract class AbstractAuthorization implements Authorization { } return false; } - - protected void handleAutoGrantPermissions(String userId, String expandedPermission, Map context) { + + protected void handleAutoGrantPermissions(String userId, String expandedPermission, Map context) { List granted = getAutoGrantPermissions(userId, expandedPermission, context); if (UtilValidate.isNotEmpty(granted)) { List alreadyGranted = autoGrant.get(); if (alreadyGranted == null) { alreadyGranted = FastList.newInstance(); } - + // expand the auto-grant permissions for (String toGrant : granted) { - if (UtilValidate.isNotEmpty(toGrant)) { + if (UtilValidate.isNotEmpty(toGrant)) { String grantExpanded = FlexibleStringExpander.expandString(toGrant, context); if (Debug.verboseOn()) Debug.logVerbose("Adding auto-grant permission -- " + grantExpanded, module); - alreadyGranted.add(grantExpanded); + alreadyGranted.add(grantExpanded); } } - autoGrant.set(granted); + autoGrant.set(granted); } } - + /** * Used to clear the values set in ThreadLocal * -- needed when thread pools are used which do not handle clearing between requests @@ -217,6 +217,6 @@ public abstract class AbstractAuthorization implements Authorization { public static void clearThreadLocal() { origPermission.remove(); autoGrant.remove(); - uid.remove(); + uid.remove(); } } diff --git a/framework/security/src/org/ofbiz/security/authz/Authorization.java b/framework/security/src/org/ofbiz/security/authz/Authorization.java index dab6a99c63..08ce40bc85 100644 --- a/framework/security/src/org/ofbiz/security/authz/Authorization.java +++ b/framework/security/src/org/ofbiz/security/authz/Authorization.java @@ -28,42 +28,42 @@ public interface Authorization { /** * Test to see if the specified user has permission - * + * * @param userId the user's userId * @param permission the raw permission string - * @param context name/value pairs used for permission lookup + * @param context name/value pairs used for permission lookup * @return true if the user has permission */ public boolean hasPermission(String userId, String permission, Map context); - + /** * Test to see if the specified user has permission - * + * * @param session HttpSession used to obtain the userId * @param permission the raw permission string - * @param context name/value pairs used for permission lookup + * @param context name/value pairs used for permission lookup * @return true if the user has permission */ public boolean hasPermission(HttpSession session, String permission, Map context); - + /** * Takes a regular expression (permissionRegexp) and evaluates it against base permissions and returns permission * values for each match. * Example 1: ".*:example" will return values for access:example, create:example, read:example, update:example and delete:example - * Example 2: "(access|read):example:${exampleId} will return values for access:example:${exampleId} and read:example:${exampleId} - * + * Example 2: "(access|read):example:${exampleId} will return values for access:example:${exampleId} and read:example:${exampleId} + * * NOTE: the regular expression can only be part of the base permission (before the first colon) - * + * * @param userId the user's userId * @param permissionRegexp permission string containing regexp in the base position - * @param context name/value pairs used for permission lookup + * @param context name/value pairs used for permission lookup * @return Map containing each permission as the key and a boolean if the permission is granted */ public Map findMatchingPermission(String userId, String permissionRegexp, Map context); - + /** * Method for injecting the delegator object - * + * * @param delegator the Delegator object to use for the Authorization implementation */ public void setDelegator(Delegator delegator); diff --git a/framework/security/src/org/ofbiz/security/authz/da/DynamicAccess.java b/framework/security/src/org/ofbiz/security/authz/da/DynamicAccess.java index 1b751c037c..aab70ef120 100644 --- a/framework/security/src/org/ofbiz/security/authz/da/DynamicAccess.java +++ b/framework/security/src/org/ofbiz/security/authz/da/DynamicAccess.java @@ -26,7 +26,7 @@ public interface DynamicAccess { /** * Processes the dynamic permission check - * + * * @param userId the user's userId * @param permission the raw permission string * @param context name/value pairs needed for permission lookup @@ -39,10 +39,10 @@ public interface DynamicAccess { * @return permission name */ public String getPermissionName(); - + /** * Method for injecting the delegator object - * + * * @param delegator the Delegator object to use for the Authorization implementation */ public void setDelegator(Delegator delegator); diff --git a/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessFactory.java b/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessFactory.java index 39353511b0..175d01e72a 100644 --- a/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessFactory.java +++ b/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessFactory.java @@ -30,18 +30,18 @@ import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; public class DynamicAccessFactory { - + /** * Cache to store the DynamicAccess implementations */ private static UtilCache dynamicAccessHandlerCache = UtilCache.createUtilCache("security.DynamicAccessHandlerCache"); private static final String module = DynamicAccessFactory.class.getName(); - + public static DynamicAccessHandler getDynamicAccessHandler(Delegator delegator, String accessString) { if (dynamicAccessHandlerCache.size() == 0) { // should always be at least 1 loadAccessHandlers(delegator); } - + Set patterns = dynamicAccessHandlerCache.getCacheLineKeys(); for (String pattern : patterns) { if (!pattern.equals("*")) { // ignore the default pattern for now @@ -50,14 +50,14 @@ public class DynamicAccessFactory { Matcher m = p.matcher(accessString); if (m.find()) { Debug.logInfo("Pattern [" + pattern + "] matched -- " + accessString, module); - return dynamicAccessHandlerCache.get(pattern); + return dynamicAccessHandlerCache.get(pattern); } } } - + return dynamicAccessHandlerCache.get("*"); } - + private static void loadAccessHandlers(Delegator delegator) { Iterator it = ServiceRegistry.lookupProviders(DynamicAccessHandler.class, DynamicAccessFactory.class.getClassLoader()); while (it.hasNext()) { @@ -66,7 +66,7 @@ public class DynamicAccessFactory { dynamicAccessHandlerCache.put(handler.getPattern(), handler); } } - + @SuppressWarnings("unchecked") public static DynamicAccess loadDynamicAccessObject(Delegator delegator, String accessString) { DynamicAccess da = null; @@ -80,20 +80,20 @@ public class DynamicAccessFactory { Debug.logError(e, module); return null; } - + if (clazz != null) { try { da = clazz.newInstance(); da.setDelegator(delegator); } catch (InstantiationException e) { Debug.logError(e, module); - return null; + return null; } catch (IllegalAccessException e) { Debug.logError(e, module); - return null; + return null; } } - + return da; } } diff --git a/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessHandler.java b/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessHandler.java index 1231f7be10..d08516b9c7 100644 --- a/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessHandler.java +++ b/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessHandler.java @@ -23,10 +23,10 @@ import java.util.Map; import org.ofbiz.entity.Delegator; public interface DynamicAccessHandler { - + /** * Method invoked to call the DynamicAccess implementation - * + * * @param accessString Access string for the permission * @param userId the user's userId * @param permission the raw permission string @@ -34,19 +34,19 @@ public interface DynamicAccessHandler { * @return the value returned from the DynamicAccess implementation */ public boolean handleDynamicAccess(String accessString, String userId, String permission, Map context); - + /** - * Returns the handlers matching pattern. - * Example: ^service:(.*)$ + * Returns the handlers matching pattern. + * Example: ^service:(.*)$ * Example: (^.*\.groovy$) - * + * * @return String containing the pattern this handler will control */ public String getPattern(); - + /** * Method for injecting the delegator object - * + * * @param delegator the Delegator object to use for the Authorization implementation */ public void setDelegator(Delegator delegator); diff --git a/framework/security/src/org/ofbiz/security/authz/da/GroovyDaHandler.java b/framework/security/src/org/ofbiz/security/authz/da/GroovyDaHandler.java index 9e2e5e94e0..6cacb15615 100644 --- a/framework/security/src/org/ofbiz/security/authz/da/GroovyDaHandler.java +++ b/framework/security/src/org/ofbiz/security/authz/da/GroovyDaHandler.java @@ -31,7 +31,7 @@ public class GroovyDaHandler implements DynamicAccessHandler { private static final String module = GroovyDaHandler.class.getName(); protected Delegator delegator; - + public String getPattern() { return "(^.*\\.groovy$)"; } @@ -43,18 +43,18 @@ public class GroovyDaHandler implements DynamicAccessHandler { bindings.put("permission", permission); bindings.put("userId", userId); bindings.put("permissionContext", context); - + Debug.log("Attempting to call groovy script : " + accessString, module); Object result = null; - + if (accessString.startsWith("component://")) { - // loaded using the OFBiz location API + // loaded using the OFBiz location API try { result = GroovyUtil.runScriptAtLocation(accessString, bindings); } catch (GeneralException e) { Debug.logWarning(e, module); } - + } else { // try the standard class path String classpathString = accessString.substring(0, accessString.lastIndexOf(".")); @@ -64,18 +64,18 @@ public class GroovyDaHandler implements DynamicAccessHandler { Debug.logWarning(e, module); } } - + // parse the result if (result != null && (result instanceof Boolean)) { return (Boolean) result; } else { Debug.logWarning("Groovy DynamicAccess implementation did not return a boolean [" + accessString + "]", module); } - + return false; } public void setDelegator(Delegator delegator) { - this.delegator = delegator; - } + this.delegator = delegator; + } } diff --git a/framework/security/src/org/ofbiz/security/authz/da/ObjectDaHandler.java b/framework/security/src/org/ofbiz/security/authz/da/ObjectDaHandler.java index 0ed212cfb6..f8f4b84d00 100644 --- a/framework/security/src/org/ofbiz/security/authz/da/ObjectDaHandler.java +++ b/framework/security/src/org/ofbiz/security/authz/da/ObjectDaHandler.java @@ -26,13 +26,13 @@ import org.ofbiz.entity.Delegator; public class ObjectDaHandler implements DynamicAccessHandler { private static UtilCache dynamicAccessCache = UtilCache.createUtilCache("security.DynamicAccessCache"); - + protected Delegator delegator; - + public void setDelegator(Delegator delegator) { - this.delegator = delegator; + this.delegator = delegator; } - + public String getPattern() { // returns "*" as a fall back pattern (catch all) // if no other handler comes back this handler will catch @@ -46,17 +46,17 @@ public class ObjectDaHandler implements DynamicAccessHandler { } return false; } - + private DynamicAccess getDynamicAccessObject(String name) { DynamicAccess da = dynamicAccessCache.get(name); - + if (da == null) { da = DynamicAccessFactory.loadDynamicAccessObject(delegator, name); if (da != null) { dynamicAccessCache.put(name, da); } } - + return da; - } + } } diff --git a/framework/service/src/org/ofbiz/service/DispatchContext.java b/framework/service/src/org/ofbiz/service/DispatchContext.java index ddd82feed1..cefc57ce47 100644 --- a/framework/service/src/org/ofbiz/service/DispatchContext.java +++ b/framework/service/src/org/ofbiz/service/DispatchContext.java @@ -252,7 +252,7 @@ public class DispatchContext implements Serializable { public Authorization getAuthorization() { return dispatcher.getAuthorization(); } - + /** * Gets the Security object associated with this dispatcher * @return Security object associated with this dispatcher diff --git a/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java b/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java index b00f77fc78..a935ebd27b 100644 --- a/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java +++ b/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java @@ -221,11 +221,11 @@ public abstract class GenericAbstractDispatcher implements LocalDispatcher { /** * @see org.ofbiz.service.LocalDispatcher#getAuthorization() - */ + */ public Authorization getAuthorization() { return dispatcher.getAuthorization(); } - + /** * @see org.ofbiz.service.LocalDispatcher#getSecurity() */ diff --git a/framework/service/src/org/ofbiz/service/LocalDispatcher.java b/framework/service/src/org/ofbiz/service/LocalDispatcher.java index 86ed1ad8a2..b0bda1f217 100644 --- a/framework/service/src/org/ofbiz/service/LocalDispatcher.java +++ b/framework/service/src/org/ofbiz/service/LocalDispatcher.java @@ -324,7 +324,7 @@ public interface LocalDispatcher { * @return Authorization object associated with this dispatcher */ public Authorization getAuthorization(); - + /** * Gets the Security object associated with this dispatcher * @return Security object associated with this dispatcher diff --git a/framework/service/src/org/ofbiz/service/ModelParam.java b/framework/service/src/org/ofbiz/service/ModelParam.java index bd864f9f19..e6ac99855e 100644 --- a/framework/service/src/org/ofbiz/service/ModelParam.java +++ b/framework/service/src/org/ofbiz/service/ModelParam.java @@ -136,15 +136,15 @@ public class ModelParam implements Serializable { public String getMode() { return this.mode; } - + public String getEntityName() { return this.entityName; } - + public String getFieldName() { return this.fieldName; } - + public boolean getInternal() { return this.internal; } diff --git a/framework/service/src/org/ofbiz/service/ModelService.java b/framework/service/src/org/ofbiz/service/ModelService.java index b23b2423fb..0d452aed49 100644 --- a/framework/service/src/org/ofbiz/service/ModelService.java +++ b/framework/service/src/org/ofbiz/service/ModelService.java @@ -1205,7 +1205,7 @@ public class ModelService extends AbstractMap implements Seriali throw new WSDLException("can not create WSDL", module); } def.setTypes(this.getTypes(document, def)); - + // set the IN parameters Input input = def.createInput(); Set inParam = this.getInParamNames(); @@ -1325,7 +1325,7 @@ public class ModelService extends AbstractMap implements Seriali SOAPOperation soapOperation = new SOAPOperationImpl(); // soapAction should be set to the location of the SOAP URI, or Visual Studio won't construct the correct SOAP message - soapOperation.setSoapActionURI(locationURI); + soapOperation.setSoapActionURI(locationURI); // this is the RPC/literal style. See http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ // this parameter is necessary or Apache Synapse won't recognize the WSDL soapOperation.setStyle("rpc"); @@ -1350,7 +1350,7 @@ public class ModelService extends AbstractMap implements Seriali service.addPort(port); def.addService(service); } - + public Types getTypes(Document document, Definition def) { Types types = def.createTypes(); /* Schema */ @@ -1360,7 +1360,7 @@ public class ModelService extends AbstractMap implements Seriali /*-----------------------------------*/ /*--------- Standard Objects --------*/ /*-----------------------------------*/ - + /* std-String Element */ Element stdStringElement = document.createElement("xsd:element"); stdStringElement.setAttribute("name", "std-String"); @@ -1442,7 +1442,7 @@ public class ModelService extends AbstractMap implements Seriali /*-----------------------------------*/ /*----------- SQL Objects -----------*/ /*-----------------------------------*/ - + /* sql-Timestamp Element */ Element sqlTimestampElement = document.createElement("xsd:element"); sqlTimestampElement.setAttribute("name", "sql-Timestamp"); @@ -1480,7 +1480,7 @@ public class ModelService extends AbstractMap implements Seriali /*-----------------------------------*/ /*----------- List Objects -----------*/ /*-----------------------------------*/ - + /* col-ArrayList Element */ Element colArrayListElement = document.createElement("xsd:element"); colArrayListElement.setAttribute("name", "col-ArrayList"); @@ -1516,11 +1516,11 @@ public class ModelService extends AbstractMap implements Seriali colCollectionElement.setAttribute("name", "col-Collection"); colCollectionElement.setAttribute("type", "tns:col-Collection"); schema.appendChild(colCollectionElement); - + /*-----------------------------------*/ /*----------- Map Objects -----------*/ /*-----------------------------------*/ - + /* map-TreeMap Element */ Element mapTreeMapElement = document.createElement("xsd:element"); mapTreeMapElement.setAttribute("name", "map-TreeMap"); @@ -1590,7 +1590,7 @@ public class ModelService extends AbstractMap implements Seriali /*-----------------------------------*/ /*----------- Custom Objects -----------*/ /*-----------------------------------*/ - + /* cus-obj Element */ Element cusObjElement = document.createElement("xsd:element"); cusObjElement.setAttribute("name", "cus-obj"); @@ -1604,7 +1604,7 @@ public class ModelService extends AbstractMap implements Seriali /*-----------------------------------*/ /*---------- Complex Types ----------*/ /*-----------------------------------*/ - + /* map-Map Complex Type */ Element mapMapComplexType = document.createElement("xsd:complexType"); mapMapComplexType.setAttribute("name", "map-Map"); @@ -1774,7 +1774,7 @@ public class ModelService extends AbstractMap implements Seriali mapValueComplexType25.setAttribute("maxOccurs", "1"); mapValueComplexType0.appendChild(mapValueComplexType25); schema.appendChild(mapValueComplexType); - + /* col-Collection Complex Type */ Element colCollectionComplexType = document.createElement("xsd:complexType"); colCollectionComplexType.setAttribute("name", "col-Collection"); @@ -1906,7 +1906,7 @@ public class ModelService extends AbstractMap implements Seriali colCollectionComplexType25.setAttribute("maxOccurs", "unbounded"); colCollectionComplexType0.appendChild(colCollectionComplexType25); schema.appendChild(colCollectionComplexType); - + types.setDocumentationElement(schema); return types; } diff --git a/framework/service/src/org/ofbiz/service/ServiceDispatcher.java b/framework/service/src/org/ofbiz/service/ServiceDispatcher.java index 72bfaddd0e..734c0cd819 100644 --- a/framework/service/src/org/ofbiz/service/ServiceDispatcher.java +++ b/framework/service/src/org/ofbiz/service/ServiceDispatcher.java @@ -807,7 +807,7 @@ public class ServiceDispatcher { public Authorization getAuthorization() { return this.authz; } - + /** * Gets the Security object associated with this dispatcher * @return Security object associated with this dispatcher diff --git a/framework/service/src/org/ofbiz/service/ServiceUtil.java b/framework/service/src/org/ofbiz/service/ServiceUtil.java index 3ecac3387f..532b19b535 100644 --- a/framework/service/src/org/ofbiz/service/ServiceUtil.java +++ b/framework/service/src/org/ofbiz/service/ServiceUtil.java @@ -76,11 +76,11 @@ public class ServiceUtil { /** A little short-cut method to check to see if a service was successful (neither error or failed) */ public static boolean isSuccess(Map results) { if (ServiceUtil.isError(results) || ServiceUtil.isFailure(results)) { - return false; + return false; } return true; } - + /** A small routine used all over to improve code efficiency, make a result map with the message and the error response code */ public static Map returnError(String errorMessage) { return returnProblem(ModelService.RESPOND_ERROR, errorMessage, null, null, null); diff --git a/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java b/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java index 5aff0a4c09..2c0fadd6c0 100644 --- a/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java +++ b/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java @@ -189,7 +189,7 @@ public class ServiceEcaRule implements java.io.Serializable { return false; } } - + @Override public String toString() { return "ServiceEcaRule:" + this.serviceName + ":" + this.eventName + ":runOnError=" + this.runOnError + ":runOnFailure=" + this.runOnFailure + ":enabled=" + this.enabled + ":conditions=" + this.conditions + ":actionsAndSets=" + this.actionsAndSets; diff --git a/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java b/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java index f63e99dada..1dcfe0527f 100644 --- a/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java +++ b/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java @@ -81,7 +81,7 @@ public class ServiceEcaSetField { } else if (UtilValidate.isNotEmpty(this.envName) && context.get(this.envName) != null) { newValue = this.format((String) context.get(this.envName), context); } - + if (newValue != null) { if (UtilValidate.isNotEmpty(this.mapName)) { valueMap.put(this.fieldName, newValue); diff --git a/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java b/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java index 22e4b0c376..a3b6143db0 100644 --- a/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java +++ b/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java @@ -82,10 +82,10 @@ public final class SOAPClientEngine extends GenericAsyncEngine { Delegator delegator = dispatcher.getDelegator(); if (modelService.location == null || modelService.invoke == null) throw new GenericServiceException("Cannot locate service to invoke"); - + ServiceClient client = null; QName serviceName = null; - + try { client = new ServiceClient(); Options options = new Options(); @@ -95,19 +95,19 @@ public final class SOAPClientEngine extends GenericAsyncEngine { } catch (AxisFault e) { throw new GenericServiceException("RPC service error", e); } - + List inModelParamList = modelService.getInModelParamList(); - + if (Debug.infoOn()) Debug.logInfo("[SOAPClientEngine.invoke] : Parameter length - " + inModelParamList.size(), module); - + if (UtilValidate.isNotEmpty(modelService.nameSpace)) { serviceName = new QName(modelService.nameSpace, modelService.invoke); } else { serviceName = new QName(modelService.invoke); } - + int i = 0; - + Map parameterMap = FastMap.newInstance(); for (ModelParam p: inModelParamList) { if (Debug.infoOn()) Debug.logInfo("[SOAPClientEngine.invoke} : Parameter: " + p.name + " (" + p.mode + ") - " + i, module); @@ -120,7 +120,7 @@ public final class SOAPClientEngine extends GenericAsyncEngine { } OMElement parameterSer = null; - + try { String xmlParameters = XmlSerializer.serialize(parameterMap); XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlParameters)); @@ -129,7 +129,7 @@ public final class SOAPClientEngine extends GenericAsyncEngine { } catch (Exception e) { Debug.logError(e, module); } - + Map results = null; try { OMFactory factory = OMAbstractFactory.getOMFactory(); diff --git a/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java b/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java index b1aa5c5b43..ac11aa9dd6 100644 --- a/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java +++ b/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java @@ -100,7 +100,7 @@ public final class StandardJavaEngine extends GenericAsyncEngine { result = m.invoke(null, dctx, context); } else { result = m.invoke(c.newInstance(), dctx, context); - } + } } catch (ClassNotFoundException cnfe) { throw new GenericServiceException("Cannot find service [" + modelService.name + "] location class", cnfe); } catch (NoSuchMethodException nsme) { diff --git a/framework/service/src/org/ofbiz/service/job/AbstractJob.java b/framework/service/src/org/ofbiz/service/job/AbstractJob.java index 0997dbaad8..e513d5aaf7 100644 --- a/framework/service/src/org/ofbiz/service/job/AbstractJob.java +++ b/framework/service/src/org/ofbiz/service/job/AbstractJob.java @@ -77,7 +77,7 @@ public abstract class AbstractJob implements Job { * Executes the Job. */ public abstract void exec() throws InvalidJobException; - + public boolean isQueued() { return queued; } diff --git a/framework/service/src/org/ofbiz/service/job/JobInvoker.java b/framework/service/src/org/ofbiz/service/job/JobInvoker.java index e3e1dd18d3..42b6331cbc 100644 --- a/framework/service/src/org/ofbiz/service/job/JobInvoker.java +++ b/framework/service/src/org/ofbiz/service/job/JobInvoker.java @@ -216,7 +216,7 @@ public class JobInvoker implements Runnable { this.thread.interrupt(); this.thread = null; } - + public synchronized void run() { while (run) { Job job = jp.next(); @@ -270,7 +270,7 @@ public class JobInvoker implements Runnable { // increment the count count++; if (Debug.verboseOn()) Debug.logVerbose("Invoker: " + thread.getName() + " (" + count + ") total.", module); - + // reset thread local security AbstractAuthorization.clearThreadLocal(); } diff --git a/framework/service/src/org/ofbiz/service/job/JobManager.java b/framework/service/src/org/ofbiz/service/job/JobManager.java index 5e73f92743..bbef5bf52c 100644 --- a/framework/service/src/org/ofbiz/service/job/JobManager.java +++ b/framework/service/src/org/ofbiz/service/job/JobManager.java @@ -82,7 +82,7 @@ public class JobManager { jp = new JobPoller(this, enabled); JobManager.registeredManagers.put(delegator.getDelegatorName(), this); } - + public static JobManager getInstance(Delegator delegator, boolean enabled) { JobManager jm = JobManager.registeredManagers.get(delegator.getDelegatorName()); diff --git a/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java b/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java index 99f5d7e51a..ab822efcee 100644 --- a/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java +++ b/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java @@ -315,7 +315,7 @@ public class JavaMailContainer implements Container { long messageSize = message.getSize(); if (message instanceof MimeMessage && messageSize >= maxSize) { Debug.logWarning("Message from: " + message.getFrom()[0] + "not received, too big, size:" + messageSize + " cannot be more than " + maxSize + " bytes", module); - + // set the message as read so it doesn't continue to try to process; but don't delete it message.setFlag(Flags.Flag.SEEN, true); } else { @@ -323,14 +323,14 @@ public class JavaMailContainer implements Container { if (Debug.verboseOn()) Debug.logVerbose("Message from " + UtilMisc.toListArray(message.getFrom()) + " with subject [" + message.getSubject() + "] has been processed." , module); message.setFlag(Flags.Flag.SEEN, true); if (Debug.verboseOn()) Debug.logVerbose("Message [" + message.getSubject() + "] is marked seen", module); - + // delete the message after processing if (deleteMail) { if (Debug.verboseOn()) Debug.logVerbose("Message [" + message.getSubject() + "] is being deleted", module); message.setFlag(Flags.Flag.DELETED, true); } } - } + } } // expunge and close the folder diff --git a/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java b/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java index fef64439cd..ff16ff562a 100644 --- a/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java +++ b/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java @@ -76,14 +76,14 @@ public class MimeMessageWrapper implements java.io.Serializable { public void setMessage(MimeMessage message) { if (message != null) { // serialize the message - this.message = message; + this.message = message; ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { message.writeTo(baos); baos.flush(); serializedBytes = baos.toByteArray(); this.contentType = message.getContentType(); - + // see if this is a multi-part message Object content = message.getContent(); if (content instanceof Multipart) { @@ -121,7 +121,7 @@ public class MimeMessageWrapper implements java.io.Serializable { } return message; } - + public String getFirstHeader(String header) { String[] headers = getHeader(header); if (headers != null && headers.length > 0) { @@ -139,67 +139,67 @@ public class MimeMessageWrapper implements java.io.Serializable { return null; } } - + public Address[] getFrom() { MimeMessage message = getMessage(); try { return message.getFrom(); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public Address[] getTo() { MimeMessage message = getMessage(); try { return message.getRecipients(MimeMessage.RecipientType.TO); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public Address[] getCc() { MimeMessage message = getMessage(); try { return message.getRecipients(MimeMessage.RecipientType.CC); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public Address[] getBcc() { MimeMessage message = getMessage(); try { return message.getRecipients(MimeMessage.RecipientType.BCC); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public String getSubject() { MimeMessage message = getMessage(); try { return message.getSubject(); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public String getMessageId() { MimeMessage message = getMessage(); try { return message.getMessageID(); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public Timestamp getSentDate() { MimeMessage message = getMessage(); try { @@ -209,7 +209,7 @@ public class MimeMessageWrapper implements java.io.Serializable { return null; } } - + public Timestamp getReceivedDate() { MimeMessage message = getMessage(); try { @@ -219,15 +219,15 @@ public class MimeMessageWrapper implements java.io.Serializable { return null; } } - + public String getContentType() { return contentType; } - + public int getMainPartCount() { return this.parts; } - + public int getSubPartCount(int index) { BodyPart part = getPart(Integer.toString(index)); try { @@ -242,10 +242,10 @@ public class MimeMessageWrapper implements java.io.Serializable { return -1; } } - + public List getAttachmentIndexes() { - List attachments = FastList.newInstance(); - if (getMainPartCount() == 0) { // single part message (no attachments) + List attachments = FastList.newInstance(); + if (getMainPartCount() == 0) { // single part message (no attachments) return attachments; } else { for (int i = 0; i < getMainPartCount(); i++) { @@ -253,23 +253,23 @@ public class MimeMessageWrapper implements java.io.Serializable { String idx = Integer.toString(i); if (subPartCount > 0) { for (int si = 0; si < subPartCount; si++) { - String sidx = idx + "." + Integer.toString(si); + String sidx = idx + "." + Integer.toString(si); if (getPartDisposition(sidx) != null && (getPartDisposition(sidx).equals(Part.ATTACHMENT) || getPartDisposition(sidx).equals(Part.INLINE))) { - attachments.add(sidx); + attachments.add(sidx); } } - } else { + } else { if (getPartDisposition(idx) != null && (getPartDisposition(idx).equals(Part.ATTACHMENT) || getPartDisposition(idx).equals(Part.INLINE))) { - attachments.add(idx); + attachments.add(idx); } } } return attachments; } } - + public String getMessageBody() { MimeMessage message = getMessage(); if (getMainPartCount() == 0) { // single part message @@ -278,7 +278,7 @@ public class MimeMessageWrapper implements java.io.Serializable { return getContentText(content); } catch (Exception e) { Debug.logError(e, module); - return null; + return null; } } else { // multi-part message StringBuffer body = new StringBuffer(); @@ -290,7 +290,7 @@ public class MimeMessageWrapper implements java.io.Serializable { String sidx = idx + "." + Integer.toString(si); if (getPartContentType(sidx) != null && getPartContentType(sidx).toLowerCase().startsWith("text")) { if (getPartDisposition(sidx) == null || getPartDisposition(sidx).equals(Part.INLINE)) { - body.append(getPartText(sidx)).append("\n"); + body.append(getPartText(sidx)).append("\n"); } } } @@ -298,15 +298,15 @@ public class MimeMessageWrapper implements java.io.Serializable { if (getPartContentType(idx) != null && getPartContentType(idx).toLowerCase().startsWith("text")) { // make sure the part isn't an attachment if (getPartDisposition(idx) == null || getPartDisposition(idx).equals(Part.INLINE)) { - body.append(getPartText(idx)).append("\n"); + body.append(getPartText(idx)).append("\n"); } } } } return body.toString(); - } + } } - + public String getMessageBodyContentType() { String contentType = getContentType(); if (contentType != null && contentType.toLowerCase().startsWith("text")) { @@ -320,7 +320,7 @@ public class MimeMessageWrapper implements java.io.Serializable { String sidx = idx + "." + Integer.toString(si); if (getPartContentType(sidx) != null && getPartContentType(sidx).toLowerCase().startsWith("text")) { if (getPartDisposition(sidx) == null || getPartDisposition(sidx).equals(Part.INLINE)) { - return getPartContentType(sidx); + return getPartContentType(sidx); } } } @@ -328,7 +328,7 @@ public class MimeMessageWrapper implements java.io.Serializable { if (getPartContentType(idx) != null && getPartContentType(idx).toLowerCase().startsWith("text")) { // make sure the part isn't an attachment if (getPartDisposition(idx) == null || getPartDisposition(idx).equals(Part.INLINE)) { - return getPartContentType(idx); + return getPartContentType(idx); } } } @@ -336,21 +336,21 @@ public class MimeMessageWrapper implements java.io.Serializable { } return "text/html"; } - + public String getMessageRawText() { MimeMessage message = getMessage(); try { return getTextFromStream(message.getInputStream()); } catch (Exception e) { Debug.logError(e, module); - return null; + return null; } } - - public String getPartDescription(String index) { + + public String getPartDescription(String index) { BodyPart part = getPart(index); if (part != null) { - try { + try { return part.getDescription(); } catch (MessagingException e) { Debug.logError(e, module); @@ -358,13 +358,13 @@ public class MimeMessageWrapper implements java.io.Serializable { } } else { return null; - } + } } - - public String getPartContentType(String index) { + + public String getPartContentType(String index) { BodyPart part = getPart(index); if (part != null) { - try { + try { return part.getContentType(); } catch (MessagingException e) { Debug.logError(e, module); @@ -372,9 +372,9 @@ public class MimeMessageWrapper implements java.io.Serializable { } } else { return null; - } + } } - + public String getPartDisposition(String index) { BodyPart part = getPart(index); if (part != null) { @@ -388,7 +388,7 @@ public class MimeMessageWrapper implements java.io.Serializable { return null; } } - + public String getPartFilename(String index) { BodyPart part = getPart(index); if (part != null) { @@ -402,23 +402,23 @@ public class MimeMessageWrapper implements java.io.Serializable { return null; } } - + public ByteBuffer getPartByteBuffer(String index) { BodyPart part = getPart(index); - if (part != null) { + if (part != null) { try { InputStream stream = part.getInputStream(); return getByteBufferFromStream(stream); } catch (Exception e) { Debug.logError(e, module); return null; - } + } } else { return null; - } + } } - - public String getPartText(String index) { + + public String getPartText(String index) { BodyPart part = getPart(index); if (part != null) { try { @@ -431,8 +431,8 @@ public class MimeMessageWrapper implements java.io.Serializable { return null; } } - - public String getPartRawText(String index) { + + public String getPartRawText(String index) { BodyPart part = getPart(index); if (part != null) { try { @@ -445,15 +445,15 @@ public class MimeMessageWrapper implements java.io.Serializable { return null; } } - + public BodyPart getPart(String indexStr) { - int mainIndex, subIndex; + int mainIndex, subIndex; try { if (indexStr.indexOf(".") == -1) { mainIndex = Integer.parseInt(indexStr); subIndex = -1; } else { - String[] indexSplit = indexStr.split("\\."); + String[] indexSplit = indexStr.split("\\."); mainIndex = Integer.parseInt(indexSplit[0]); subIndex = Integer.parseInt(indexSplit[1]); } @@ -464,7 +464,7 @@ public class MimeMessageWrapper implements java.io.Serializable { Debug.logError(e, "Illegal index string format. Should be part 'dot' subpart: " + indexStr, module); return null; } - + if (getMainPartCount() > 0 && getMainPartCount() > mainIndex) { MimeMessage message = this.getMessage(); try { @@ -495,7 +495,7 @@ public class MimeMessageWrapper implements java.io.Serializable { return null; } } - + protected String getContentText(Object content) { if (content == null) return null; if (content instanceof String) { @@ -507,14 +507,14 @@ public class MimeMessageWrapper implements java.io.Serializable { return getTextFromStream(((Message) content).getInputStream()); } catch (Exception e) { Debug.logError(e, module); - return null; + return null; } } else { Debug.logWarning("Content was not a string or a stream; no known handler -- " + content.toString(), module); return null; } } - + protected String getTextFromStream(InputStream stream) { StringBuilder builder = new StringBuilder(); byte[] buffer = new byte[4096]; @@ -528,11 +528,11 @@ public class MimeMessageWrapper implements java.io.Serializable { } return builder.toString(); } - + protected ByteBuffer getByteBufferFromStream(InputStream stream) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; - try { + try { for (int n; (n = stream.read(buffer)) != -1;) { baos.write(buffer, 0, n); } @@ -540,7 +540,7 @@ public class MimeMessageWrapper implements java.io.Serializable { Debug.logError(e, module); return null; } - + return ByteBuffer.wrap(baos.toByteArray()); } } diff --git a/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java b/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java index ca1f62582e..da7e62560d 100644 --- a/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java +++ b/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java @@ -43,11 +43,11 @@ import org.ofbiz.service.GenericServiceException; * javolution.jar * jdbm.jar * log4j.jar - * + * * Copy the truststore file framework/base/config/ofbizrmi-truststore.jks to the client - * + * * Run the client specifying the path to the client truststore: -Djavax.net.ssl.trustStore=ofbizrmi-truststore.jks - * + * */ public class ExampleRemoteClient { diff --git a/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java b/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java index 7f20adb42f..adec6ccc54 100644 --- a/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java +++ b/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java @@ -11,14 +11,14 @@ import org.ofbiz.entity.GenericValue; import org.ofbiz.service.testtools.OFBizTestCase; public class ServiceSOAPTests extends OFBizTestCase { - + public final static String module = ServiceSOAPTests.class.getName(); public ServiceSOAPTests(String name) { // TODO Auto-generated constructor stub super(name); } - + public void testSOAPSimpleService() throws Exception { Map serviceContext = FastMap.newInstance(); serviceContext.put("defaultValue", new Double("123.4567")); @@ -26,7 +26,7 @@ public class ServiceSOAPTests extends OFBizTestCase { Map results = dispatcher.runSync("testSoapSimple", serviceContext); String resp = (String) results.get("resp"); } - + public void testSOAPService() throws Exception { Map serviceContext = FastMap.newInstance(); GenericValue testing = delegator.makeValue("Testing"); diff --git a/framework/service/src/org/ofbiz/service/testtools/OFBizTestCase.java b/framework/service/src/org/ofbiz/service/testtools/OFBizTestCase.java index 3c41dbdf07..4482727c13 100644 --- a/framework/service/src/org/ofbiz/service/testtools/OFBizTestCase.java +++ b/framework/service/src/org/ofbiz/service/testtools/OFBizTestCase.java @@ -25,7 +25,7 @@ import org.ofbiz.service.LocalDispatcher; public class OFBizTestCase extends EntityTestCase { protected LocalDispatcher dispatcher = null; - + public LocalDispatcher getDispatcher() { return dispatcher; } diff --git a/framework/sql/src/org/ofbiz/sql/Main.java b/framework/sql/src/org/ofbiz/sql/Main.java index e8c28dfc71..933dd15a61 100644 --- a/framework/sql/src/org/ofbiz/sql/Main.java +++ b/framework/sql/src/org/ofbiz/sql/Main.java @@ -22,13 +22,13 @@ import java.util.List; import java.util.Map; public final class Main { - public static void main(String[] args) throws Exception { + public static void main(String[] args) throws Exception { Planner planner = new DebugPlanner(); - List> statements = new Parser(System.in).SQLFile(); + List> statements = new Parser(System.in).SQLFile(); for (SQLStatement statement: statements) { run(statement, planner); } - } + } private static final void run(SQLStatement statement, Planner planner) { System.err.println(statement); diff --git a/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java b/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java index 4f26f4122b..4b6145e0b8 100644 --- a/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java +++ b/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java @@ -66,7 +66,7 @@ public class ModelTestSuite { this.originalDispatcherName = mainElement.getAttribute("dispatcher-name"); if (UtilValidate.isEmpty(this.originalDispatcherName)) this.originalDispatcherName = "test-dispatcher"; - + String uniqueSuffix = "-" + RandomStringUtils.randomAlphanumeric(10); this.delegator = DelegatorFactory.getDelegator(this.originalDelegatorName).makeTestDelegator(this.originalDelegatorName + uniqueSuffix); @@ -150,12 +150,12 @@ public class ModelTestSuite { Delegator getDelegator() { return this.delegator; } - + List getTestList() { return testList; } - - + + public TestSuite makeTestSuite() { TestSuite suite = new TestSuite(); suite.setName(this.getSuiteName()); @@ -166,7 +166,7 @@ public class ModelTestSuite { return suite; } - + private void prepareTest(Test test) { if (test instanceof TestSuite) { diff --git a/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java b/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java index 0af899fabc..0dba16eaaa 100644 --- a/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java +++ b/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java @@ -244,7 +244,7 @@ public class TestRunContainer implements Container { } else { return test.getClass().getName(); } - + } } } diff --git a/framework/testtools/src/org/ofbiz/testtools/VerifySeleniumSetups.java b/framework/testtools/src/org/ofbiz/testtools/VerifySeleniumSetups.java index fe3162ba00..7db1f95c46 100644 --- a/framework/testtools/src/org/ofbiz/testtools/VerifySeleniumSetups.java +++ b/framework/testtools/src/org/ofbiz/testtools/VerifySeleniumSetups.java @@ -42,9 +42,9 @@ public class VerifySeleniumSetups { } - /* prepare lib for selenium test + /* prepare lib for selenium test * Check & download selenium-server.jar from http://downloads.sourceforge.net/seleniumxml/selenium-server-1.0-SNAPSHOT-20081126.jar?use_mirror= - * Check a change use HTTP as the default at file framework/webapp/config/url.properties + * Check a change use HTTP as the default at file framework/webapp/config/url.properties * Check correct the config/seleniumXml.properties and firefox path */ @@ -54,7 +54,7 @@ public class VerifySeleniumSetups { Map msgMap = FastMap.newInstance(); Properties urlProps = null; try{ - /* Check and down load selenium-server.jar */ + /* Check and down load selenium-server.jar */ File file = new File(libPath); URL url = new URL(urlSite); URLConnection connection = url.openConnection(); diff --git a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java index ed824bc3bf..d430d0ea91 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java @@ -40,15 +40,15 @@ public class DataLoader { private SeleniumXml parent; private SeleniumXml currentTest; private List children; - + private int currentRowIndx; - - + + //Objects initialized from csvreader script. private PyDictionary fieldNameMap; private PyList dataList; private PyList fieldNames; - + public DataLoader(String file, String iterations, SeleniumXml parent, List children) { super(); this.file = file; @@ -66,7 +66,7 @@ public class DataLoader { Map map = FastMap.newInstance(); map.put("file", this.file); interp.set("params", map); - + interp.exec("from csvreader import CSVReader"); String cmd = "reader = CSVReader('" + this.file + "')"; interp.exec(cmd); @@ -75,17 +75,17 @@ public class DataLoader { this.fieldNameMap = (PyDictionary) interp.eval("reader.fieldNameMap"); //interp.execfile("c:/dev/ag/seleniumxml/plugins/csvreader.py"); //interp.execfile("c:/dev/ag/seleniumxml/plugins/TestCSVReader.py"); - + //Now get output from script //this.dataList = (PyArray) map.get("dataList"); //this.fieldNames = (PyDictionary) map.get("fieldNames"); - + } - + private void next() { this.currentRowIndx = (this.currentRowIndx + 1) % this.dataList.__len__(); } - + private void loadData() { int size = this.fieldNames.__len__(); @@ -98,9 +98,9 @@ public class DataLoader { PyObject value = valueList.__getitem__(convIndx); this.currentTest.addParam((String) name.__tojava__(String.class), (String) value.__tojava__(String.class)); } - + } - + public void runTest() throws TestCaseException { //Depending on the iteration instruction repeat the following until complete @@ -110,13 +110,13 @@ public class DataLoader { if(iter == -1) { iter = this.dataList.__len__(); } - + this.currentTest = new SeleniumXml(this.parent); for( int i=0; i children; - + private int currentRowIndx; - + public DataLoop(String dataListName, SeleniumXml parent, List children) { super(); this.dataListName = dataListName; this.parent = parent; this.children = children; } - + public void runTest() throws TestCaseException { this.currentTest = new SeleniumXml(this.parent); diff --git a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java index a5ee19eb52..f5603655f2 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java @@ -41,10 +41,10 @@ public class GroovyRunner { private String urlName; private SeleniumXml parent; private SeleniumXml currentTest; - + private int currentRowIndx; - - + + public GroovyRunner(String urlName, SeleniumXml parent) { super(); this.urlName = urlName; @@ -68,8 +68,8 @@ public class GroovyRunner { } catch(IOException e) { System.out.println("Scriptrunner, runTest, IOException error: " + e.getMessage()); } - - + + } - + } diff --git a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/InitJython.java b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/InitJython.java index efd424c32e..27ac83f500 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/InitJython.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/InitJython.java @@ -35,44 +35,44 @@ import org.ofbiz.testtools.seleniumxml.InitJython; public class InitJython { // public Logger logger = Logger.getLogger(InitJython.class.getName()); - + private static PythonInterpreter SINGLETON; - + /** Only allow creation through the factory method */ protected InitJython() { // logger.setLevel(Level.DEBUG); - } - + } + /** - * getInterpreter initializes the Python environment the first time. It then issues a + * getInterpreter initializes the Python environment the first time. It then issues a * new Interpreter for each request. * @return PythonInterpreter */ public static PythonInterpreter getInterpreter() { - + if (SINGLETON == null) { synchronized (InitJython.class) { Properties props = System.getProperties(); //String ofbizHome = props.getProperty("ofbiz.home"); - + Properties pyProps = new Properties(); - + if( props.getProperty("python.home") == null) { //pyProps.setProperty("python.home", "c:/devtools/jython2.2rc2"); pyProps.setProperty("python.home", "c:/devtools/Python24"); - } - + } + //Debug.logInfo(props.toString(), module); ClassLoader loader = Thread.currentThread().getContextClassLoader(); PySystemState.initialize(props, pyProps, new String[0], loader); - + SINGLETON = new PythonInterpreter(); - - SINGLETON.exec("import sys"); - SINGLETON.exec("sys.path.append(\"c:/dev/ag/seleniumXml/plugins\")"); + + SINGLETON.exec("import sys"); + SINGLETON.exec("sys.path.append(\"c:/dev/ag/seleniumXml/plugins\")"); } } - + return SINGLETON; } } diff --git a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/JythonRunner.java b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/JythonRunner.java index 9d0d3fe8b1..50d6a99e5f 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/JythonRunner.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/JythonRunner.java @@ -30,10 +30,10 @@ public class JythonRunner { private String urlName; private SeleniumXml parent; private SeleniumXml currentTest; - + private int currentRowIndx; - - + + public JythonRunner(String urlName, SeleniumXml parent) { super(); this.urlName = urlName; @@ -43,7 +43,7 @@ public class JythonRunner { public void runTest() { PythonInterpreter interp = InitJython.getInterpreter(); - + Map map = this.parent.getMap(); map.put("url", this.urlName); try { @@ -55,8 +55,8 @@ public class JythonRunner { } catch(IOException e) { System.out.println("Scriptrunner, runTest, IOException error: " + e.getMessage()); } - - + + } - + } diff --git a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/RemoteRequest.java b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/RemoteRequest.java index 00ddda0d2f..3e7eaf5e25 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/RemoteRequest.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/RemoteRequest.java @@ -63,20 +63,20 @@ public class RemoteRequest { public static final String module = RemoteRequest.class.getName(); - /** + /** * The default parameters. * Instantiated in {@link #setup setup}. - */ + */ private static HttpParams defaultParameters = null; - + /** * The scheme registry. * Instantiated in {@link #setup setup}. - */ + */ private static SchemeRegistry supportedSchemes; final private static String JsonHandleMode = "JSON_HANDLE"; final private static String HttpHandleMode = "HTTP_HANDLE"; - + private SeleniumXml parent; private SeleniumXml currentTest; private List children; @@ -85,18 +85,18 @@ public class RemoteRequest { private String requestUrl; private String host; private String responseHandlerMode; - + //Login-As parameters private String loginAsUrl; private String loginAsUserParam; private String loginAsPasswordParam; - + private int currentRowIndx; - + static { - + supportedSchemes = new SchemeRegistry(); - + // Register the "http" protocol scheme, it is required // by the default operator to look up socket factories. SocketFactory sf = PlainSocketFactory.getSocketFactory(); @@ -112,18 +112,18 @@ public class RemoteRequest { } public RemoteRequest(SeleniumXml parent, List children, List loginAs, String requestUrl, String hostString, String responseHandlerMode) { - + this(parent, children, requestUrl, hostString, responseHandlerMode); if(loginAs != null && !loginAs.isEmpty()) { Element elem = loginAs.get(0); - + this.loginAsUserParam = elem.getAttributeValue("username-param"); this.loginAsPasswordParam = elem.getAttributeValue("password-param"); this.loginAsUrl = elem.getAttributeValue("url"); - + } } - + public RemoteRequest(SeleniumXml parent, List children, String requestUrl, String hostString, String responseHandlerMode) { super(); this.parent = parent; @@ -137,7 +137,7 @@ public class RemoteRequest { } private void initData() { - + this.inMap = FastMap.newInstance(); this.outMap = FastMap.newInstance(); String nm, name, value, fieldName = null; @@ -145,7 +145,7 @@ public class RemoteRequest { nm = elem.getName(); if (nm.equals("param-in")) { name = elem.getAttributeValue("name"); - value = this.parent.replaceParam(elem.getAttributeValue("value")); + value = this.parent.replaceParam(elem.getAttributeValue("value")); System.out.println("RemoteRequest, param-in, name: " + name + ", value: " + value); this.inMap.put(name, value); } else if (nm.equals("param-out")) { @@ -159,7 +159,7 @@ public class RemoteRequest { } return; } - + public void runTest() { ClientConnectionManager ccm = @@ -180,17 +180,17 @@ public class RemoteRequest { // Create a local instance of cookie store CookieStore cookieStore = new BasicCookieStore(); localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore); - + Header sessionHeader = null; - + if(this.loginAsUrl != null ) { - + String loginAsUri = this.host + this.loginAsUrl; String loginAsParamString = "?" + this.loginAsUserParam + "&" + this.loginAsPasswordParam; - + HttpGet req2 = new HttpGet ( loginAsUri + loginAsParamString ); System.out.println("loginAsUrl:" + loginAsUri + loginAsParamString); - + req2.setHeader("Connection","Keep-Alive"); HttpResponse rsp = client.execute(req2, localContext); @@ -208,7 +208,7 @@ public class RemoteRequest { for (int i = 0; i < cookies.size(); i++) { System.out.println("Local cookie(0): " + cookies.get(i)); } - } + } //String paramString2 = "USERNAME=" + this.parent.getUserName() // + "&PASSWORD=" + this.parent.getPassword(); //String thisUri2 = this.host + "/eng/control/login?" + paramString2; @@ -227,20 +227,20 @@ public class RemoteRequest { // System.out.println(headers[i]); // System.out.println(hdr.getName() + " : " + hdr.getValue()); //} - + //List cookies = cookieStore.getCookies(); //System.out.println("cookies.size(): " + cookies.size()); //for (int i = 0; i < cookies.size(); i++) { // System.out.println("Local cookie(0): " + cookies.get(i)); //} if (HttpHandleMode.equals(this.responseHandlerMode)) { - + } else { responseHandler = new JsonResponseHandler(this); } - + String paramString = urlEncodeArgs(this.inMap, false); - + String thisUri = null; if(sessionHeader != null) { String sessionHeaderValue = sessionHeader.getValue(); @@ -259,7 +259,7 @@ public class RemoteRequest { //String thisUri = this.host + this.requestUrl + ";jsessionid=" + sessionId + "?" + paramString; //String thisUri = this.host + this.requestUrl + "?" + paramString; System.out.println("thisUri: " + thisUri); - + HttpGet req = new HttpGet ( thisUri ); if(sessionHeader != null) { req.setHeader(sessionHeader); @@ -301,19 +301,19 @@ public class RemoteRequest { } return; } - + private void login(DefaultHttpClient client, BasicHttpContext localContext) throws IOException{ - + String paramString = "USERNAME=" + this.parent.getUserName() + "&PASSWORD=" + this.parent.getPassword(); String thisUri = this.host + "/eng/control/login?" + paramString; HttpGet req = new HttpGet ( thisUri ); req.setHeader("Connection","Keep-Alive"); client.execute(req, localContext); - - //client.getCredentialsProvider().setCredentials(new AuthScope("localhost", 8080), + + //client.getCredentialsProvider().setCredentials(new AuthScope("localhost", 8080), // new UsernamePasswordCredentials(this.parent.getUserName(), this.parent.getPassword())); - + return; } /** URL Encodes a Map of arguements */ @@ -356,18 +356,18 @@ public class RemoteRequest { } return buf.toString(); } - + public class JsonResponseHandler extends BasicResponseHandler { - + private RemoteRequest parentRemoteRequest; - + public JsonResponseHandler(RemoteRequest parentRemoteRequest) { super(); this.parentRemoteRequest = parentRemoteRequest; } - public String handleResponse(org.apache.http.HttpResponse response) + public String handleResponse(org.apache.http.HttpResponse response) throws HttpResponseException, IOException { - + String bodyString = super.handleResponse(response); JSONObject jsonObject = null; try { @@ -388,6 +388,6 @@ public class RemoteRequest { } return bodyString; } - + } } diff --git a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/util/TestUtils.java b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/util/TestUtils.java index c75624fa89..de8060dd40 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/util/TestUtils.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/util/TestUtils.java @@ -33,26 +33,26 @@ public class TestUtils { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r', 's','t','u','v','w','x','y','z', '0','1','2','3','4','5','6','7','8','9'}; - + static public String createUniqueString() { long time = System.currentTimeMillis(); - + return String.valueOf(time); } static public String createRandomString(int size) { - + return createRandomString(null, size); } - + static public String createRandomString(String prefix, String size) { return createRandomString(prefix, Integer.valueOf(size).intValue()); } - + static public String createRandomString(String prefix, int size) { StringBuffer buff = new StringBuffer(size); int startIndx = 0; - + if(prefix != null) { buff.append(prefix); startIndx = prefix.length(); @@ -68,7 +68,7 @@ public class TestUtils { public static String readUrlText(String urlString) throws IOException { URL url = new URL(urlString); InputStream stream = url.openStream(); - + StringBuilder buf = new StringBuilder(); BufferedReader in = null; try { @@ -91,7 +91,7 @@ public class TestUtils { } } } - + return buf.toString(); } } diff --git a/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java b/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java index 3d43b7422f..75072a7f28 100644 --- a/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java +++ b/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java @@ -131,7 +131,7 @@ public class ContextFilter implements Filter { if (disableCachedClassloader == null || !"Y".equalsIgnoreCase(disableCachedClassloader)) { Thread.currentThread().setContextClassLoader(localCachedClassLoader); } - + // set the webSiteId in the session httpRequest.getSession().setAttribute("webSiteId", config.getServletContext().getAttribute("webSiteId")); @@ -264,7 +264,7 @@ public class ContextFilter implements Filter { // we're done checking; continue on chain.doFilter(request, response); - + // reset thread local security AbstractAuthorization.clearThreadLocal(); } @@ -341,25 +341,25 @@ public class ContextFilter implements Filter { } protected Authorization getAuthz() { - Authorization authz = (Authorization) config.getServletContext().getAttribute("authorization"); + Authorization authz = (Authorization) config.getServletContext().getAttribute("authorization"); if (authz == null) { Delegator delegator = (Delegator) config.getServletContext().getAttribute("delegator"); if (delegator != null) { try { - authz = AuthorizationFactory.getInstance(delegator); + authz = AuthorizationFactory.getInstance(delegator); } catch (SecurityConfigurationException e) { Debug.logError(e, "[ServiceDispatcher.init] : No instance of authorization implementation found.", module); } } - config.getServletContext().setAttribute("authz", authz); + config.getServletContext().setAttribute("authz", authz); if (authz == null) { Debug.logError("[ContextFilter.init] ERROR: authorization create failed.", module); - } + } } return authz; } - + @Deprecated protected Security getSecurity() { Security security = (Security) config.getServletContext().getAttribute("security"); diff --git a/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java b/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java index a40ef528ab..b0fbdcde86 100644 --- a/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java +++ b/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java @@ -179,12 +179,12 @@ public class ControlServlet extends HttpServlet { Authorization authz = (Authorization) session.getAttribute("authz"); if (authz == null) { authz = (Authorization) getServletContext().getAttribute("authz"); - } + } if (authz == null) { Debug.logError("[ControlServlet] ERROR: authorization not found in ServletContext", module); } request.setAttribute("authz", authz); // maybe we should also add the value to 'security' - + Security security = (Security) session.getAttribute("security"); if (security == null) { security = (Security) getServletContext().getAttribute("security"); @@ -195,7 +195,7 @@ public class ControlServlet extends HttpServlet { request.setAttribute("security", security); request.setAttribute("_REQUEST_HANDLER_", requestHandler); - + ServletContextHashModel ftlServletContext = new ServletContextHashModel(this, BeansWrapper.getDefaultInstance()); request.setAttribute("ftlServletContext", ftlServletContext); diff --git a/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java b/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java index ce11aa3c8a..c1ebf1aba6 100644 --- a/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java +++ b/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java @@ -861,7 +861,7 @@ public class LoginWorker { if (security != null) { if (info != null) { for (String permission: info.getBasePermission()) { - if (!"NONE".equals(permission) && !security.hasEntityPermission(permission, "_VIEW", userLogin) && + if (!"NONE".equals(permission) && !security.hasEntityPermission(permission, "_VIEW", userLogin) && !authz.hasPermission(userLogin.getString("userLoginId"), permission, null)) { return false; } diff --git a/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java b/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java index 6bad10f729..4e7c286afb 100644 --- a/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java +++ b/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java @@ -90,7 +90,7 @@ public class ProtectViewWorker { Long curMaxHits = (Long) hitsByViewAccessed.get(viewNameUserLoginId); if (UtilValidate.isEmpty(curMaxHits)) { hitsByViewAccessed.put(viewNameUserLoginId, one); - Long maxHitsDuration = (Long) protectedView.get("maxHitsDuration") * 1000; + Long maxHitsDuration = (Long) protectedView.get("maxHitsDuration") * 1000; durationByViewAccessed.put(viewNameUserLoginId, now + maxHitsDuration); } else { Long maxDuration = (Long) durationByViewAccessed.get(viewNameUserLoginId); diff --git a/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java b/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java index 6ac20c7ea5..a2b2d30664 100644 --- a/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java +++ b/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java @@ -216,8 +216,8 @@ public class RequestHandler { callRedirect(newUrl, response, request); } } - // if this is a new session and forceHttpSession is true and the request is secure but does not - // need to be then we need the session cookie to be created via an http response (rather than https) + // if this is a new session and forceHttpSession is true and the request is secure but does not + // need to be then we need the session cookie to be created via an http response (rather than https) // so we'll redirect to an unsecure request } else if (forceHttpSession && request.isSecure() && session.isNew() && !requestMap.securityHttps) { StringBuilder urlBuf = new StringBuilder(); @@ -823,7 +823,7 @@ public class RequestHandler { if (viewNoCache) { UtilHttp.setResponseBrowserProxyNoCache(resp); if (Debug.verboseOn()) Debug.logVerbose("Sending no-cache headers for view [" + nextPage + "]", module); - } + } try { if (Debug.verboseOn()) Debug.logVerbose("Rendering view [" + nextPage + "] of type [" + viewMap.type + "]", module); diff --git a/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java b/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java index a789eb7bec..e6d9deb42c 100644 --- a/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java +++ b/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java @@ -104,7 +104,7 @@ public class CoreEvents { */ public static String changeDelegator(HttpServletRequest request, HttpServletResponse response) { String delegatorName = request.getParameter("delegator"); - Authorization authz = (Authorization) request.getAttribute("authz"); + Authorization authz = (Authorization) request.getAttribute("authz"); Locale locale = UtilHttp.getLocale(request); if (!authz.hasPermission(request.getSession(), "ENTITY_MAINT", null)) { @@ -158,10 +158,10 @@ public class CoreEvents { */ public static String changeDispatcher(HttpServletRequest request, HttpServletResponse response) { String dispatcherName = request.getParameter("dispatcher"); - Authorization authz = (Authorization) request.getAttribute("authz"); + Authorization authz = (Authorization) request.getAttribute("authz"); Locale locale = UtilHttp.getLocale(request); - if (!authz.hasPermission(request.getSession(), "ENTITY_MAINT", null)) { + if (!authz.hasPermission(request.getSession(), "ENTITY_MAINT", null)) { String errMsg = UtilProperties.getMessage(CoreEvents.err_resource, "coreEvents.not_authorized_use_fct", locale); request.setAttribute("_ERROR_MESSAGE_", "

  • " + errMsg); return "error"; @@ -201,7 +201,7 @@ public class CoreEvents { */ public static String scheduleService(HttpServletRequest request, HttpServletResponse response) { GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); - Authorization authz = (Authorization) request.getAttribute("authz"); + Authorization authz = (Authorization) request.getAttribute("authz"); LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); //Delegator delegator = (Delegator) request.getAttribute("delegator"); Locale locale = UtilHttp.getLocale(request); @@ -305,7 +305,7 @@ public class CoreEvents { if (locale != null) { serviceContext.put("locale", locale); } - + if (!modelService.export && !authz.hasPermission(request.getSession(), "SERVICE_INVOKE_ANY", null)) { String errMsg = UtilProperties.getMessage(CoreEvents.err_resource, "coreEvents.not_authorized_to_call", locale); request.setAttribute("_ERROR_MESSAGE_", "
  • " + errMsg); @@ -527,7 +527,7 @@ public class CoreEvents { } // now do a security check - Authorization authz = (Authorization) request.getAttribute("authz"); + Authorization authz = (Authorization) request.getAttribute("authz"); LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); //lookup the service definition to see if this service is externally available, if not require the SERVICE_INVOKE_ANY permission diff --git a/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java b/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java index 1a228f2016..6fbb2518a3 100644 --- a/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java +++ b/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java @@ -143,16 +143,16 @@ public class SOAPEventHandler implements EventHandler { // not a wsdl request; invoke the service response.setContentType("text/xml"); - + // request envelope SOAPEnvelope reqEnv = null; - + // get the service name and parameters try { XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(request.getInputStream()); StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(xmlReader); reqEnv = (SOAPEnvelope) builder.getDocumentElement(); - + // log the request message if (Debug.verboseOn()) { try { @@ -164,9 +164,9 @@ public class SOAPEventHandler implements EventHandler { sendError(response, "Problem processing the service"); throw new EventHandlerException("Cannot get the envelope", e); } - + Debug.logVerbose("[Processing]: SOAP Event", module); - + try { // each is a different service call SOAPBody reqBody = reqEnv.getBody(); @@ -191,7 +191,7 @@ public class SOAPEventHandler implements EventHandler { XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlResults)); StAXOMBuilder resultsBuilder = new StAXOMBuilder(reader); OMElement resultSer = resultsBuilder.getDocumentElement(); - + // create the response soap SOAPFactory factory = OMAbstractFactory.getSOAP11Factory(); SOAPEnvelope resEnv = factory.createSOAPEnvelope(); @@ -200,14 +200,14 @@ public class SOAPEventHandler implements EventHandler { resService.addChild(resultSer.getFirstElement()); resBody.addChild(resService); resEnv.addChild(resBody); - + // The declareDefaultNamespace method doesn't work see (https://issues.apache.org/jira/browse/AXIS2-3156) - // so the following doesn't work: + // so the following doesn't work: // resService.declareDefaultNamespace(ModelService.TNS); // instead, create the xmlns attribute directly: OMAttribute defaultNS = factory.createOMAttribute("xmlns", null, ModelService.TNS); resService.addAttribute(defaultNS); - + // log the response message if (Debug.verboseOn()) { try { @@ -230,21 +230,21 @@ public class SOAPEventHandler implements EventHandler { sendError(response, e.getMessage()); throw new EventHandlerException(e.getMessage(), e); } - + return null; } private void sendError(HttpServletResponse res, String errorMessage) throws EventHandlerException { try { // setup the response - res.setContentType("text/xml"); + res.setContentType("text/xml"); Map results = FastMap.newInstance(); results.put("errorMessage", errorMessage); String xmlResults= XmlSerializer.serialize(results); XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlResults)); StAXOMBuilder resultsBuilder = new StAXOMBuilder(xmlReader); OMElement resultSer = resultsBuilder.getDocumentElement(); - + // create the response soap SOAPFactory factory = OMAbstractFactory.getSOAP11Factory(); SOAPEnvelope resEnv = factory.createSOAPEnvelope(); @@ -253,7 +253,7 @@ public class SOAPEventHandler implements EventHandler { errMsg.addChild(resultSer.getFirstElement()); resBody.addChild(errMsg); resEnv.addChild(resBody); - + // log the response message if (Debug.verboseOn()) { try { @@ -261,7 +261,7 @@ public class SOAPEventHandler implements EventHandler { } catch (Throwable t) { } } - + resEnv.serialize(res.getOutputStream()); res.getOutputStream().flush(); } catch (Exception e) { diff --git a/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java b/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java index f76427e8d6..d74998da64 100644 --- a/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java +++ b/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java @@ -355,7 +355,7 @@ public class ServiceMultiEventHandler implements EventHandler { if (resultKey != null && !ModelService.RESPONSE_MESSAGE.equals(resultKey) && !ModelService.ERROR_MESSAGE.equals(resultKey) && !ModelService.ERROR_MESSAGE_LIST.equals(resultKey) && !ModelService.ERROR_MESSAGE_MAP.equals(resultKey) && !ModelService.SUCCESS_MESSAGE.equals(resultKey) && !ModelService.SUCCESS_MESSAGE_LIST.equals(resultKey)) { - //set the result to request w/ and w/o a suffix to handle both cases: to have the result in each iteration and to prevent its overriding + //set the result to request w/ and w/o a suffix to handle both cases: to have the result in each iteration and to prevent its overriding request.setAttribute(resultKey + curSuffix, resultValue); request.setAttribute(resultKey, resultValue); } diff --git a/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java b/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java index ca2e7f7c98..c84fee50e7 100644 --- a/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java +++ b/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java @@ -103,7 +103,7 @@ public class ServerHitBin { for (Map.Entry> entry :binMap.entrySet()) { if (entry.getValue() != null) { for (ServerHitBin bin: entry.getValue()) { - bin.advanceBin(toTime); + bin.advanceBin(toTime); } } } diff --git a/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java b/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java index a0504909b0..00e0419219 100644 --- a/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java +++ b/framework/webapp/src/org/ofbiz/webapp/webdav/PropFindHelper.java @@ -33,11 +33,11 @@ import org.w3c.dom.NodeList; public class PropFindHelper extends ResponseHelper { protected final Document requestDocument; - + public PropFindHelper(Document requestDocument) { this.requestDocument = requestDocument; } - + public Element createPropElement(List propList) { Element element = this.responseDocument.createElementNS(DAV_NAMESPACE_URI, "D:prop"); if (UtilValidate.isNotEmpty(propList)) { diff --git a/framework/webapp/src/org/ofbiz/webapp/webdav/RequestHandlerFactory.java b/framework/webapp/src/org/ofbiz/webapp/webdav/RequestHandlerFactory.java index 03a997a507..054034a83f 100644 --- a/framework/webapp/src/org/ofbiz/webapp/webdav/RequestHandlerFactory.java +++ b/framework/webapp/src/org/ofbiz/webapp/webdav/RequestHandlerFactory.java @@ -21,7 +21,7 @@ package org.ofbiz.webapp.webdav; public interface RequestHandlerFactory { /** Returns a RequestHandler instance appropriate * for the WebDAV HTTP method. - * + * * @param method The WebDAV HTTP method. Implementations MUST * provide handlers for the following methods: PROPFIND, PROPPATCH, * MKCOL, GET, HEAD, POST, DELETE, PUT, COPY, MOVE, LOCK, UNLOCK. diff --git a/framework/webapp/src/org/ofbiz/webapp/webdav/ResponseHelper.java b/framework/webapp/src/org/ofbiz/webapp/webdav/ResponseHelper.java index fbad27a496..2b55ad9785 100644 --- a/framework/webapp/src/org/ofbiz/webapp/webdav/ResponseHelper.java +++ b/framework/webapp/src/org/ofbiz/webapp/webdav/ResponseHelper.java @@ -49,20 +49,20 @@ public class ResponseHelper { response.setStatus(statusCode, statusString); } } - + protected final Document responseDocument; - + public ResponseHelper() { this.responseDocument = UtilXml.makeEmptyXmlDocument(); } - + public Element createElementSetValue(String elementName, String value) { Element element = this.responseDocument.createElementNS(DAV_NAMESPACE_URI, elementName); element.appendChild(element.getOwnerDocument().createTextNode(value)); element.setNodeValue(value); return element; } - + public Element createHrefElement(String hrefUrl) { return createElementSetValue("D:href", hrefUrl); } @@ -78,7 +78,7 @@ public class ResponseHelper { } return element; } - + public Element createResponseElement() { return this.responseDocument.createElementNS(DAV_NAMESPACE_URI, "D:response"); } diff --git a/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java b/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java index ebad70681e..d0355a3e38 100644 --- a/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java +++ b/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java @@ -72,9 +72,9 @@ public class WebDavUtil { * checks for the request parameters USERNAME and PASSWORD. If * those aren't found, then the request is checked for the HTTP Authorization header. * Currently, only Basic authorization is supported.

    - * + * * @param request The WebDAV request - * @return A Map containing login.username and + * @return A Map containing login.username and * login.password elements. */ public static Map getCredentialsFromRequest(HttpServletRequest request) { @@ -104,6 +104,6 @@ public class WebDavUtil { Map result = FastMap.newInstance(); result.put("login.username", username); result.put("login.password", password); - return result; + return result; } } diff --git a/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelReferences.java b/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelReferences.java index 253b2e9853..89b4f43542 100644 --- a/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelReferences.java +++ b/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelReferences.java @@ -100,7 +100,7 @@ public class LabelReferences { for (String rootFolder : this.rootFolders) { fileList.addAll(FileUtil.findXmlFiles(rootFolder + "webapp", null, null, null)); fileList.addAll(FileUtil.findXmlFiles(rootFolder + "widget", null, null, null)); - } + } for (File file : fileList) { String inFile = FileUtil.readString("UTF-8", file); if (inFile.contains("")) { @@ -113,7 +113,7 @@ public class LabelReferences { findLabelKeyInElement(inFile, file.getPath(), "set"); continue; } - + } // get labels from Ofbiz components files getLabelsFromOfbizComponents(); diff --git a/framework/widget/src/org/ofbiz/widget/WidgetWorker.java b/framework/widget/src/org/ofbiz/widget/WidgetWorker.java index af21b37111..25bc641722 100644 --- a/framework/widget/src/org/ofbiz/widget/WidgetWorker.java +++ b/framework/widget/src/org/ofbiz/widget/WidgetWorker.java @@ -191,7 +191,7 @@ public class WidgetWorker { writer.append(""); } } - + public static void makeHiddenFormLinkAnchor(Appendable writer, String linkStyle, String description, String confirmation, ModelFormField modelFormField, HttpServletRequest request, HttpServletResponse response, Map context) throws IOException { if (UtilValidate.isNotEmpty(description) || UtilValidate.isNotEmpty(request.getAttribute("image"))) { writer.append(" context, ModelFormField modelFormField, String titleText) throws IOException { } - + public void renderContainerFindField(Appendable writer, Map context, ContainerField containerField) throws IOException { } } diff --git a/framework/widget/src/org/ofbiz/widget/fo/FoScreenRenderer.java b/framework/widget/src/org/ofbiz/widget/fo/FoScreenRenderer.java index 553f54345f..14dc72be17 100644 --- a/framework/widget/src/org/ofbiz/widget/fo/FoScreenRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/fo/FoScreenRenderer.java @@ -54,7 +54,7 @@ public class FoScreenRenderer extends HtmlWidgetRenderer implements ScreenString } public void renderScreenEnd(Appendable writer, Map context) throws IOException { - + } public void renderSectionBegin(Appendable writer, Map context, ModelScreenWidget.Section section) throws IOException { diff --git a/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java b/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java index bf10c3a484..0c7db8899a 100644 --- a/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java @@ -366,7 +366,7 @@ public class MacroFormRenderer implements FormStringRenderer { String ajaxUrl = createAjaxParamsFromUpdateAreas(updateAreas, null, context); boolean disabled = textField.disabled; - + StringWriter sr = new StringWriter(); sr.append("<@renderTextField "); sr.append("name=\""); @@ -393,7 +393,7 @@ public class MacroFormRenderer implements FormStringRenderer { } sr.append("\" disabled="); sr.append(Boolean.toString(disabled)); - + sr.append(" clientAutocomplete=\""); sr.append(clientAutocomplete); sr.append("\" ajaxUrl=\""); @@ -717,7 +717,7 @@ public class MacroFormRenderer implements FormStringRenderer { List currentValueList = null; if (UtilValidate.isNotEmpty(currentValue) && dropDownField.isAllowMultiple()) { - // If currentValue is Array, it will start with [ + // If currentValue is Array, it will start with [ if (currentValue.startsWith("[")) { currentValueList = StringUtil.toList(currentValue); } @@ -749,7 +749,7 @@ public class MacroFormRenderer implements FormStringRenderer { options.append(""); } } - + options.append("'}"); if (ajaxEnabled) { count++; @@ -1106,7 +1106,7 @@ public class MacroFormRenderer implements FormStringRenderer { String action = modelFormField.getAction(context); String event = modelFormField.getEvent(); String id = modelFormField.getIdName(); - + StringWriter sr = new StringWriter(); sr.append("<@renderHiddenField "); sr.append(" name=\""); @@ -1147,15 +1147,15 @@ public class MacroFormRenderer implements FormStringRenderer { renderHyperlinkTitle(sb, context, modelFormField, titleText); } } - + //check for required field style on single forms if ("single".equals(modelFormField.getModelForm().getType()) && modelFormField.getRequiredField()) { String requiredStyle = modelFormField.getRequiredFieldStyle(); if (UtilValidate.isNotEmpty(requiredStyle)) { style = requiredStyle; } - } - + } + StringWriter sr = new StringWriter(); sr.append("<@renderFieldTitle "); sr.append(" style=\""); @@ -1283,7 +1283,7 @@ public class MacroFormRenderer implements FormStringRenderer { } List childFieldList = modelForm.getFieldList(); List columnStyleList = FastList.newInstance(); - List fieldNameList = FastList.newInstance(); + List fieldNameList = FastList.newInstance(); for (ModelFormField childField : childFieldList) { int childFieldType = childField.getFieldInfo().getFieldType(); if (childFieldType == ModelFormField.FieldInfo.HIDDEN || childFieldType == ModelFormField.FieldInfo.IGNORED) { @@ -1882,7 +1882,7 @@ public class MacroFormRenderer implements FormStringRenderer { String id = modelFormField.getIdName(); List updateAreas = modelFormField.getOnChangeUpdateAreas(); - + //add default ajax auto completer to all lookup fields if (UtilValidate.isEmpty(updateAreas) && UtilValidate.isNotEmpty(lookupFieldFormName)) { String autoCompleterTarget = null; @@ -1895,17 +1895,17 @@ public class MacroFormRenderer implements FormStringRenderer { updateAreas = FastList.newInstance(); updateAreas.add(new ModelForm.UpdateArea("change", id, autoCompleterTarget)); } - + boolean ajaxEnabled = updateAreas != null && this.javaScriptEnabled; String autocomplete = ""; if (!lookupField.getClientAutocompleteField() || ajaxEnabled) { autocomplete = "off"; } - + String event = modelFormField.getEvent(); - String action = modelFormField.getAction(context); + String action = modelFormField.getAction(context); boolean disabled = lookupField.disabled; - + // add lookup pop-up button String descriptionFieldName = lookupField.getDescriptionFieldName(); String formName = modelFormField.getModelForm().getCurrentFormName(context); @@ -1957,7 +1957,7 @@ public class MacroFormRenderer implements FormStringRenderer { } sr.append("\" disabled="); sr.append(Boolean.toString(disabled)); - + sr.append(" autocomplete=\""); sr.append(autocomplete); sr.append("\" descriptionFieldName=\""); @@ -1976,7 +1976,7 @@ public class MacroFormRenderer implements FormStringRenderer { sr.append(Boolean.toString(ajaxEnabled)); sr.append(" />"); executeMacro(sr.toString()); - + this.addAsterisks(writer, context, modelFormField); this.makeHyperlinkString(writer, lookupField.getSubHyperlink(), context); @@ -2020,7 +2020,7 @@ public class MacroFormRenderer implements FormStringRenderer { int viewIndex = modelForm.getViewIndex(context); int viewSize = modelForm.getViewSize(context); int listSize = modelForm.getListSize(context); - + int lowIndex = modelForm.getLowIndex(context); int highIndex = modelForm.getHighIndex(context); int actualPageSize = modelForm.getActualPageSize(context); @@ -2165,7 +2165,7 @@ public class MacroFormRenderer implements FormStringRenderer { selectSizeUrl = rh.makeLink(this.request, this.response, urlPath + linkText); } } - + StringWriter sr = new StringWriter(); sr.append("<@renderNextPrev "); sr.append(" paginateStyle=\""); @@ -2558,8 +2558,8 @@ public class MacroFormRenderer implements FormStringRenderer { } StringWriter sr = new StringWriter(); makeHyperlinkString(sr, modelFormField.getHeaderLinkStyle(), targetType, targetBuffer.toString(), null, titleText, "", modelFormField, this.request, this.response, context, ""); - - String title = sr.toString().replace("\"", "\'"); + + String title = sr.toString().replace("\"", "\'"); sr = new StringWriter(); sr.append("<@renderHyperlinkTitle "); sr.append(" name=\""); @@ -2826,12 +2826,12 @@ public class MacroFormRenderer implements FormStringRenderer { sr.append("\" description=\""); sr.append(description); sr.append("\" confirmation =\""); - sr.append(confirmation ); + sr.append(confirmation ); sr.append("\" />"); executeMacro(sr.toString()); } } - + public void makeHiddenFormLinkAnchor(Appendable writer, String linkStyle, String description, String confirmation , ModelFormField modelFormField, HttpServletRequest request, HttpServletResponse response, Map context) throws IOException { if (UtilValidate.isNotEmpty(description) || UtilValidate.isNotEmpty(request.getAttribute("image"))) { String hiddenFormName = WidgetWorker.makeLinkHiddenFormName(context, modelFormField); @@ -2863,7 +2863,7 @@ public class MacroFormRenderer implements FormStringRenderer { sr.append("\" description=\""); sr.append(description); sr.append("\" confirmation =\""); - sr.append(confirmation ); + sr.append(confirmation ); sr.append("\" />"); executeMacro(sr.toString()); } @@ -2901,7 +2901,7 @@ public class MacroFormRenderer implements FormStringRenderer { sr.append("\" />"); executeMacro(sr.toString()); } - + public void renderContainerFindField(Appendable writer, Map context, ContainerField containerField) throws IOException { diff --git a/framework/widget/src/org/ofbiz/widget/form/ModelForm.java b/framework/widget/src/org/ofbiz/widget/form/ModelForm.java index db5928052b..30a10de4c1 100644 --- a/framework/widget/src/org/ofbiz/widget/form/ModelForm.java +++ b/framework/widget/src/org/ofbiz/widget/form/ModelForm.java @@ -149,7 +149,7 @@ public class ModelForm extends ModelWidget { /** This Map is keyed with the field name and has a ModelFormField for the value. */ protected Map fieldMap = FastMap.newInstance(); - + /** Keeps track of conditional fields to help ensure that only one is rendered */ protected Set useWhenFields = FastSet.newInstance(); @@ -174,7 +174,7 @@ public class ModelForm extends ModelWidget { /** Pagination settings and defaults. */ public static int DEFAULT_PAGE_SIZE = 10; - public static int MAX_PAGE_SIZE = 10000; + public static int MAX_PAGE_SIZE = 10000; protected int defaultViewSize = DEFAULT_PAGE_SIZE; public static String DEFAULT_PAG_INDEX_FIELD = "viewIndex"; public static String DEFAULT_PAG_SIZE_FIELD = "viewSize"; @@ -300,7 +300,7 @@ public class ModelForm extends ModelWidget { this.onSubmitUpdateAreas = parent.onSubmitUpdateAreas; this.onPaginateUpdateAreas = parent.onPaginateUpdateAreas; this.altRowStyles = parent.altRowStyles; - + this.useWhenFields = parent.useWhenFields; //these are done below in a special way... @@ -796,12 +796,12 @@ public class ModelForm extends ModelWidget { if ("list".equals(this.type) || "multi".equals(this.type)) { this.incrementPaginatorNumber(context); } - + //if pagination is disabled, update the defualt view size if (!getPaginate(context)) { setDefaultViewSize(this.MAX_PAGE_SIZE); } - + // Populate the viewSize and viewIndex so they are available for use during form actions context.put("viewIndex", this.getViewIndex(context)); context.put("viewSize", this.getViewSize(context)); @@ -1442,7 +1442,7 @@ public class ModelForm extends ModelWidget { if (UtilValidate.isNotEmpty(context.get("renderFormSeqNumber"))) { localContext.put("formUniqueId", "_"+context.get("renderFormSeqNumber")); } - + this.resetBshInterpreter(localContext); if (Debug.verboseOn()) Debug.logVerbose("In form got another row, context is: " + localContext, module); @@ -1939,16 +1939,16 @@ public class ModelForm extends ModelWidget { return this.getName(); } } - + public String getCurrentContainerId(Map context) { Integer itemIndex = (Integer) context.get("itemIndex"); if (itemIndex != null && "list".equals(this.getType())) { return this.getContainerId() + this.getItemIndexSeparator() + itemIndex.intValue(); - } - + } + return this.getContainerId(); } - + public String getContainerStyle() { return this.containerStyle; } @@ -2192,7 +2192,7 @@ public class ModelForm extends ModelWidget { } return field; } - + public String getMultiPaginateIndexField(Map context) { String field = this.paginateIndexField.expandString(context); if (UtilValidate.isEmpty(field)) { @@ -2221,7 +2221,7 @@ public class ModelForm extends ModelWidget { } } } - + // try paginate index field without paginator number if (value == null) { field = this.getPaginateIndexField(context); @@ -2247,7 +2247,7 @@ public class ModelForm extends ModelWidget { } return field; } - + public String getMultiPaginateSizeField(Map context) { String field = this.paginateSizeField.expandString(context); if (UtilValidate.isEmpty(field)) { @@ -2276,7 +2276,7 @@ public class ModelForm extends ModelWidget { } } } - + // try the page size field without paginator number if (value == null) { field = this.getPaginateSizeField(context); @@ -2377,7 +2377,7 @@ public class ModelForm extends ModelWidget { return Boolean.valueOf(this.paginate.expandString(context)).booleanValue(); } else { return true; - } + } } public boolean getSkipStart() { @@ -2407,11 +2407,11 @@ public class ModelForm extends ModelWidget { public boolean getClientAutocompleteFields() { return this.clientAutocompleteFields; } - + public void setPaginate(boolean val) { this.paginate = FlexibleStringExpander.getInstance(Boolean.valueOf(val).toString()); } - + public void setOverridenListSize(boolean overridenListSize) { this.overridenListSize = overridenListSize; } diff --git a/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java b/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java index 9dca04a0e0..8daa237a82 100644 --- a/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java +++ b/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java @@ -2090,8 +2090,8 @@ public class ModelFormField { String isoCode = null; if (this.currency != null && !this.currency.isEmpty()) { isoCode = this.currency.expandString(context); - } - + } + try { BigDecimal parsedRetVal = (BigDecimal) ObjectType.simpleTypeConvert(retVal, "BigDecimal", null, null, locale, true); retVal = UtilFormatOut.formatCurrency(parsedRetVal, isoCode, locale, 10); // we set the max to 10 digits as an hack to not round numbers in the ui @@ -2280,7 +2280,7 @@ public class ModelFormField { public boolean getAlsoHidden() { return this.alsoHidden; } - + public boolean getRequestConfirmation() { return this.requestConfirmation; } @@ -2296,12 +2296,12 @@ public class ModelFormField { return getConfirmationMsg(context); } return ""; - } - + } + public String getConfirmationMsg(Map context) { return this.confirmationMsgExdr.expandString(context); - } - + } + public String getLinkType() { return this.linkType; } @@ -2362,11 +2362,11 @@ public class ModelFormField { public void setTarget(String string) { this.target = FlexibleStringExpander.getInstance(string); } - + public void setRequestConfirmation(boolean val) { this.requestConfirmation = val; } - + public void setConfirmationMsg(String val) { this.confirmationMsgExdr = FlexibleStringExpander.getInstance(val); } @@ -2402,7 +2402,7 @@ public class ModelFormField { this.modelFormField = modelFormField; } - + public String getLinkStyle() { return this.linkStyle; } @@ -2451,15 +2451,15 @@ public class ModelFormField { return ""; } } - + public boolean getRequestConfirmation() { return this.requestConfirmation; } - + public String getConfirmationMsg(Map context) { return this.confirmationMsgExdr.expandString(context); } - + public String getConfirmation(Map context) { String message = getConfirmationMsg(context); if (UtilValidate.isNotEmpty(message)) { @@ -2471,8 +2471,8 @@ public class ModelFormField { return getConfirmationMsg(context); } return ""; - } - + } + public ModelFormField getModelFormField() { return this.modelFormField; } @@ -2540,12 +2540,12 @@ public class ModelFormField { */ public void setUseWhen(String string) { this.useWhen = FlexibleStringExpander.getInstance(string); - } - + } + public void setRequestConfirmation(boolean val) { this.requestConfirmation = val; } - + public void setConfirmationMsg(String val) { this.confirmationMsgExdr = FlexibleStringExpander.getInstance(val); } @@ -3202,7 +3202,7 @@ public class ModelFormField { this.backgroundSubmitRefreshTargetExdr = FlexibleStringExpander.getInstance(element.getAttribute("background-submit-refresh-target")); setRequestConfirmation("true".equals(element.getAttribute("request-confirmation"))); setConfirmationMsg(element.getAttribute("confirmation-message")); - } + } @Override public void renderFieldString(Appendable writer, Map context, FormStringRenderer formStringRenderer) throws IOException { @@ -3215,16 +3215,16 @@ public class ModelFormField { public String getImageLocation() { return imageLocation; - } + } public boolean getRequestConfirmation() { return this.requestConfirmation; } - + public String getConfirmationMsg(Map context) { return this.confirmationMsgExdr.expandString(context); } - + public String getConfirmation(Map context) { String message = getConfirmationMsg(context); if (UtilValidate.isNotEmpty(message)) { @@ -3236,8 +3236,8 @@ public class ModelFormField { return getConfirmationMsg(context); } return ""; - } - + } + /** * @param string */ @@ -3254,12 +3254,12 @@ public class ModelFormField { public String getBackgroundSubmitRefreshTarget(Map context) { return this.backgroundSubmitRefreshTargetExdr.expandString(context); - } - + } + public void setRequestConfirmation(boolean val) { this.requestConfirmation = val; } - + public void setConfirmationMsg(String val) { this.confirmationMsgExdr = FlexibleStringExpander.getInstance(val); } @@ -3369,7 +3369,7 @@ public class ModelFormField { if(element.hasAttribute("default-option")) { this.defaultOption = element.getAttribute("default-option"); } else { - this.defaultOption = UtilProperties.getPropertyValue("widget", "widget.form.defaultTextFindOption", "like"); + this.defaultOption = UtilProperties.getPropertyValue("widget", "widget.form.defaultTextFindOption", "like"); } this.hideOptions = "true".equals(element.getAttribute("hide-options")) || "options".equals(element.getAttribute("hide-options")) ? true : false; @@ -3663,7 +3663,7 @@ public class ModelFormField { } } - + public static class ContainerField extends FieldInfo { protected String id; diff --git a/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java b/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java index 6cc44f0a82..656094cc65 100644 --- a/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java @@ -190,7 +190,7 @@ public class HtmlMenuRenderer extends HtmlWidgetRenderer implements MenuStringRe txt = simpleEncoder.encode(txt); } writer.append(txt); - + } if (!menuItem.getMenuItemList().isEmpty()) { appendWhitespace(writer); diff --git a/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java b/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java index 08a1d7156e..1adba83659 100644 --- a/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java +++ b/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java @@ -91,7 +91,7 @@ public class MenuFactory { for (Element menuElement: UtilXml.childElementList(rootElement, "menu")){ ModelMenu modelMenu = new ModelMenu(menuElement, delegator, dispatcher); modelMenu.setMenuLocation(menuLocation); - modelMenuMap.put(modelMenu.getName(), modelMenu); + modelMenuMap.put(modelMenu.getName(), modelMenu); } } return modelMenuMap; diff --git a/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java b/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java index b65c090fd2..5ce4744687 100644 --- a/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java +++ b/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java @@ -732,7 +732,7 @@ public class ModelMenuItem { public List getParameterList() { return this.parameterList; } - + public String getConfirmation(Map context) { String message = getConfirmationMsg(context); if (UtilValidate.isNotEmpty(message)) { @@ -745,11 +745,11 @@ public class ModelMenuItem { } return ""; } - + public boolean getRequestConfirmation() { return this.requestConfirmation; } - + public String getConfirmationMsg(Map context) { return this.confirmationMsgExdr.expandString(context); } @@ -815,11 +815,11 @@ public class ModelMenuItem { public void setImage(Image img) { this.image = img; } - + public void setRequestConfirmation(boolean val) { this.requestConfirmation = val; } - + public void setConfirmationMsg(String val) { this.confirmationMsgExdr = FlexibleStringExpander.getInstance(val); } diff --git a/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java b/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java index d65ddbc853..e3a94aa32b 100644 --- a/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java +++ b/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java @@ -62,7 +62,7 @@ public class IterateSectionWidget extends ModelScreenWidget { protected FlexibleStringExpander paginate; public static int DEFAULT_PAGE_SIZE = 5; - public static int MAX_PAGE_SIZE = 10000; + public static int MAX_PAGE_SIZE = 10000; protected int viewIndex = 0; protected int viewSize = DEFAULT_PAGE_SIZE; protected int lowIndex = -1; @@ -87,7 +87,7 @@ public class IterateSectionWidget extends ModelScreenWidget { if (this.paginate == null || iterateSectionElement.hasAttribute("paginate")) { this.paginate = FlexibleStringExpander.getInstance(iterateSectionElement.getAttribute("paginate")); } - + if (iterateSectionElement.hasAttribute("view-size")) { setViewSize(iterateSectionElement.getAttribute("view-size")); } @@ -143,7 +143,7 @@ public class IterateSectionWidget extends ModelScreenWidget { } if (isEntrySet) { Map.Entry entry = UtilGenerics.cast(item); - contextMs.put(entryName, entry.getValue()); + contextMs.put(entryName, entry.getValue()); contextMs.put(keyName, entry.getKey()); } else { contextMs.put(entryName, item); @@ -191,13 +191,13 @@ public class IterateSectionWidget extends ModelScreenWidget { public String getPaginateTarget(Map context) { return this.paginateTarget.expandString(context); } - + public boolean getPaginate(Map context) { if (this.paginate != null && !this.paginate.isEmpty() && UtilValidate.isNotEmpty(this.paginate.expandString(context))) { return Boolean.valueOf(this.paginate.expandString(context)).booleanValue(); } else { return true; - } + } } public void setPaginate(boolean val) { diff --git a/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java b/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java index 8b50e10f1c..c7fecffaf4 100644 --- a/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java @@ -73,7 +73,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer { macroLibrary = FreeMarkerWorker.getTemplate(macroLibraryPath); Map input = UtilMisc.toMap("key", null); environment = FreeMarkerWorker.renderTemplate(macroLibrary, input, writer); - rendererName = name; + rendererName = name; } private String getNextElementId() { diff --git a/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java b/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java index 561cfe45d7..d0c37bb1a4 100644 --- a/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java +++ b/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java @@ -347,7 +347,7 @@ public abstract class ModelScreenWidget extends ModelWidget implements Serializa } // By default, for a collapsible screenlet, the collapsed/expanded status must be saved this.saveCollapsed = !("false".equals(screenletElement.getAttribute("save-collapsed"))); - + this.padded = !"false".equals(screenletElement.getAttribute("padded")); if (this.collapsible && UtilValidate.isEmpty(this.name) && idExdr.isEmpty()) { throw new IllegalArgumentException("Collapsible screenlets must have a name or id [" + this.modelScreen.getName() + "]"); @@ -418,15 +418,15 @@ public abstract class ModelScreenWidget extends ModelWidget implements Serializa public boolean collapsible() { return this.collapsible; } - + //initially-collapsed status, which may be overriden by user preference public boolean getInitiallyCollapsed(Map context) { String screenletId = this.getId(context) + "_collapsed"; Map userPreferences = UtilGenerics.checkMap(context.get("userPreferences")); if (userPreferences != null && userPreferences.containsKey(screenletId)) { - return Boolean.valueOf((String)userPreferences.get(screenletId)).booleanValue() ; + return Boolean.valueOf((String)userPreferences.get(screenletId)).booleanValue() ; } - + return this.initiallyCollapsed; } @@ -925,7 +925,7 @@ public abstract class ModelScreenWidget extends ModelWidget implements Serializa Debug.logError(e, errMsg, module); throw new RuntimeException(errMsg); } - + TreeStringRenderer treeStringRenderer = (TreeStringRenderer) context.get("treeStringRenderer"); if (treeStringRenderer == null) { throw new IllegalArgumentException("Could not find a treeStringRenderer in the context"); @@ -1096,13 +1096,13 @@ public abstract class ModelScreenWidget extends ModelWidget implements Serializa if (UtilValidate.isNotEmpty(mimeTypeId) && ((mimeTypeId.indexOf("application") >= 0) || (mimeTypeId.indexOf("image")) >= 0)) { - -/* + +/* // this code is not yet working, will update it the next few weeks...(Hans) if (mimeTypeId.equals("application/pdf")) { TransformerFactory tfactory = TransformerFactory.newInstance(); try { - + // // this part is not working. If somebody can help to make it work? // currently using only real temp files for debugging purposes. @@ -1135,11 +1135,11 @@ public abstract class ModelScreenWidget extends ModelWidget implements Serializa // fw.write(sw.toString()); // fw.close(); - - FopFactory fopFactory = FopFactory.newInstance(); + + FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); // configure foUserAgent as desired - + // Setup output stream. Note: Using BufferedOutputStream // for performance reasons (helpful with FileOutputStreams). // OutputStream out = new FileOutputStream("/tmp/file.pdf"); @@ -1151,16 +1151,16 @@ public abstract class ModelScreenWidget extends ModelWidget implements Serializa // Setup JAXP using identity transformer TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); // identity transformer - + // Setup input stream Source src = new StreamSource(new ByteArrayInputStream(sw.toString().getBytes())); // Resulting SAX events (the generated FO) must be piped through to FOP Result result = new SAXResult(fop.getDefaultHandler()); - + // Start XSLT transformation and FOP processing transformer.transform(src, result); - + out.flush(); out.close(); // to a file for debugging diff --git a/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java b/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java index 035db8ad2b..6468e14d80 100644 --- a/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java @@ -136,7 +136,7 @@ public class ScreenRenderer { } return ""; } - + public void setRenderFormUniqueSeq (int renderFormSeqNumber) { this.renderFormSeqNumber = renderFormSeqNumber; } @@ -243,7 +243,7 @@ public class ScreenRenderer { TaglibFactory JspTaglibs = new TaglibFactory(servletContext); context.put("JspTaglibs", JspTaglibs); context.put("requestParameters", UtilHttp.getParameterMap(request)); - + ServletContextHashModel ftlServletContext = (ServletContextHashModel) request.getAttribute("ftlServletContext"); context.put("Application", ftlServletContext); context.put("Request", context.get("requestAttributes")); @@ -313,7 +313,7 @@ public class ScreenRenderer { } public void populateContextForService(DispatchContext dctx, Map serviceContext) { - this.populateBasicContext(serviceContext, dctx.getDelegator(), dctx.getDispatcher(), dctx.getAuthorization(), + this.populateBasicContext(serviceContext, dctx.getDelegator(), dctx.getDispatcher(), dctx.getAuthorization(), dctx.getSecurity(), (Locale) serviceContext.get("locale"), (GenericValue) serviceContext.get("userLogin")); } } diff --git a/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java b/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java index c81ea1c51b..4dba67822f 100644 --- a/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java @@ -295,7 +295,7 @@ public class TextFormRenderer implements FormStringRenderer { public void renderHyperlinkTitle(Appendable writer, Map context, ModelFormField modelFormField, String titleText) { } - + public void renderContainerFindField(Appendable writer, Map context, ContainerField containerField) throws IOException { } } diff --git a/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java b/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java index 82a1a85de5..4d926de915 100644 --- a/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java +++ b/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java @@ -179,12 +179,12 @@ public class ModelTree extends ModelWidget { else expColReq = s1; } - - //append also the request parameters + + //append also the request parameters Map paramMap = UtilGenerics.checkMap(context.get("requestParameters")); if (UtilValidate.isNotEmpty(paramMap)) { Map requestParameters = new HashMap(paramMap); - requestParameters.remove(this.getTrailName(context)); + requestParameters.remove(this.getTrailName(context)); if (UtilValidate.isNotEmpty(requestParameters)) { String queryString = UtilHttp.urlEncodeArgs(requestParameters, false); if (expColReq.indexOf("?") < 0) { @@ -192,10 +192,10 @@ public class ModelTree extends ModelWidget { } else { expColReq += "&"; } - expColReq += queryString; - } + expColReq += queryString; + } } - + return expColReq; } diff --git a/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java b/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java index b88f4234ad..b5be1788c6 100644 --- a/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java +++ b/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java @@ -336,7 +336,7 @@ public class XmlFormRenderer implements FormStringRenderer { public void renderHyperlinkTitle(Appendable writer, Map context, ModelFormField modelFormField, String titleText) throws IOException { } - + public void renderContainerFindField(Appendable writer, Map context, ContainerField containerField) throws IOException { } } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/ApplicationAuthenticationContext.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/ApplicationAuthenticationContext.java index 3cde26901b..6c4d6de280 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/ApplicationAuthenticationContext.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/ApplicationAuthenticationContext.java @@ -47,7 +47,7 @@ public class ApplicationAuthenticationContext implements java.io.Serializable { /** * Gets the credential value for this ApplicationAuthenticationContext. - * + * * @return credential */ public com.atlassian.crowd.integration.authentication.PasswordCredential getCredential() { @@ -57,7 +57,7 @@ public class ApplicationAuthenticationContext implements java.io.Serializable { /** * Sets the credential value for this ApplicationAuthenticationContext. - * + * * @param credential */ public void setCredential(com.atlassian.crowd.integration.authentication.PasswordCredential credential) { @@ -67,7 +67,7 @@ public class ApplicationAuthenticationContext implements java.io.Serializable { /** * Gets the name value for this ApplicationAuthenticationContext. - * + * * @return name */ public java.lang.String getName() { @@ -77,7 +77,7 @@ public class ApplicationAuthenticationContext implements java.io.Serializable { /** * Sets the name value for this ApplicationAuthenticationContext. - * + * * @param name */ public void setName(java.lang.String name) { @@ -87,7 +87,7 @@ public class ApplicationAuthenticationContext implements java.io.Serializable { /** * Gets the validationFactors value for this ApplicationAuthenticationContext. - * + * * @return validationFactors */ public com.atlassian.crowd.integration.authentication.ValidationFactor[] getValidationFactors() { @@ -97,7 +97,7 @@ public class ApplicationAuthenticationContext implements java.io.Serializable { /** * Sets the validationFactors value for this ApplicationAuthenticationContext. - * + * * @param validationFactors */ public void setValidationFactors(com.atlassian.crowd.integration.authentication.ValidationFactor[] validationFactors) { @@ -115,14 +115,14 @@ public class ApplicationAuthenticationContext implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.credential==null && other.getCredential()==null) || + _equals = true && + ((this.credential==null && other.getCredential()==null) || (this.credential!=null && this.credential.equals(other.getCredential()))) && - ((this.name==null && other.getName()==null) || + ((this.name==null && other.getName()==null) || (this.name!=null && this.name.equals(other.getName()))) && - ((this.validationFactors==null && other.getValidationFactors()==null) || + ((this.validationFactors==null && other.getValidationFactors()==null) || (this.validationFactors!=null && java.util.Arrays.equals(this.validationFactors, other.getValidationFactors()))); __equalsCalc = null; @@ -198,10 +198,10 @@ public class ApplicationAuthenticationContext implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -210,10 +210,10 @@ public class ApplicationAuthenticationContext implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/AuthenticatedToken.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/AuthenticatedToken.java index 7d76ce56e7..f5b23b5e97 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/AuthenticatedToken.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/AuthenticatedToken.java @@ -43,7 +43,7 @@ public class AuthenticatedToken implements java.io.Serializable { /** * Gets the name value for this AuthenticatedToken. - * + * * @return name */ public java.lang.String getName() { @@ -53,7 +53,7 @@ public class AuthenticatedToken implements java.io.Serializable { /** * Sets the name value for this AuthenticatedToken. - * + * * @param name */ public void setName(java.lang.String name) { @@ -63,7 +63,7 @@ public class AuthenticatedToken implements java.io.Serializable { /** * Gets the token value for this AuthenticatedToken. - * + * * @return token */ public java.lang.String getToken() { @@ -73,7 +73,7 @@ public class AuthenticatedToken implements java.io.Serializable { /** * Sets the token value for this AuthenticatedToken. - * + * * @param token */ public void setToken(java.lang.String token) { @@ -91,11 +91,11 @@ public class AuthenticatedToken implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.name==null && other.getName()==null) || + _equals = true && + ((this.name==null && other.getName()==null) || (this.name!=null && this.name.equals(other.getName()))) && - ((this.token==null && other.getToken()==null) || + ((this.token==null && other.getToken()==null) || (this.token!=null && this.token.equals(other.getToken()))); __equalsCalc = null; @@ -152,10 +152,10 @@ public class AuthenticatedToken implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -164,10 +164,10 @@ public class AuthenticatedToken implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/PasswordCredential.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/PasswordCredential.java index f94f4bb2db..6fbab95eb7 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/PasswordCredential.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/PasswordCredential.java @@ -43,7 +43,7 @@ public class PasswordCredential implements java.io.Serializable { /** * Gets the credential value for this PasswordCredential. - * + * * @return credential */ public java.lang.String getCredential() { @@ -53,7 +53,7 @@ public class PasswordCredential implements java.io.Serializable { /** * Sets the credential value for this PasswordCredential. - * + * * @param credential */ public void setCredential(java.lang.String credential) { @@ -63,7 +63,7 @@ public class PasswordCredential implements java.io.Serializable { /** * Gets the encryptedCredential value for this PasswordCredential. - * + * * @return encryptedCredential */ public java.lang.Boolean getEncryptedCredential() { @@ -73,7 +73,7 @@ public class PasswordCredential implements java.io.Serializable { /** * Sets the encryptedCredential value for this PasswordCredential. - * + * * @param encryptedCredential */ public void setEncryptedCredential(java.lang.Boolean encryptedCredential) { @@ -91,11 +91,11 @@ public class PasswordCredential implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.credential==null && other.getCredential()==null) || + _equals = true && + ((this.credential==null && other.getCredential()==null) || (this.credential!=null && this.credential.equals(other.getCredential()))) && - ((this.encryptedCredential==null && other.getEncryptedCredential()==null) || + ((this.encryptedCredential==null && other.getEncryptedCredential()==null) || (this.encryptedCredential!=null && this.encryptedCredential.equals(other.getEncryptedCredential()))); __equalsCalc = null; @@ -152,10 +152,10 @@ public class PasswordCredential implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -164,10 +164,10 @@ public class PasswordCredential implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/PrincipalAuthenticationContext.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/PrincipalAuthenticationContext.java index 09de63a138..6b70ec0667 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/PrincipalAuthenticationContext.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/PrincipalAuthenticationContext.java @@ -51,7 +51,7 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { /** * Gets the application value for this PrincipalAuthenticationContext. - * + * * @return application */ public java.lang.String getApplication() { @@ -61,7 +61,7 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { /** * Sets the application value for this PrincipalAuthenticationContext. - * + * * @param application */ public void setApplication(java.lang.String application) { @@ -71,7 +71,7 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { /** * Gets the credential value for this PrincipalAuthenticationContext. - * + * * @return credential */ public com.atlassian.crowd.integration.authentication.PasswordCredential getCredential() { @@ -81,7 +81,7 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { /** * Sets the credential value for this PrincipalAuthenticationContext. - * + * * @param credential */ public void setCredential(com.atlassian.crowd.integration.authentication.PasswordCredential credential) { @@ -91,7 +91,7 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { /** * Gets the name value for this PrincipalAuthenticationContext. - * + * * @return name */ public java.lang.String getName() { @@ -101,7 +101,7 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { /** * Sets the name value for this PrincipalAuthenticationContext. - * + * * @param name */ public void setName(java.lang.String name) { @@ -111,7 +111,7 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { /** * Gets the validationFactors value for this PrincipalAuthenticationContext. - * + * * @return validationFactors */ public com.atlassian.crowd.integration.authentication.ValidationFactor[] getValidationFactors() { @@ -121,7 +121,7 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { /** * Sets the validationFactors value for this PrincipalAuthenticationContext. - * + * * @param validationFactors */ public void setValidationFactors(com.atlassian.crowd.integration.authentication.ValidationFactor[] validationFactors) { @@ -139,17 +139,17 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.application==null && other.getApplication()==null) || + _equals = true && + ((this.application==null && other.getApplication()==null) || (this.application!=null && this.application.equals(other.getApplication()))) && - ((this.credential==null && other.getCredential()==null) || + ((this.credential==null && other.getCredential()==null) || (this.credential!=null && this.credential.equals(other.getCredential()))) && - ((this.name==null && other.getName()==null) || + ((this.name==null && other.getName()==null) || (this.name!=null && this.name.equals(other.getName()))) && - ((this.validationFactors==null && other.getValidationFactors()==null) || + ((this.validationFactors==null && other.getValidationFactors()==null) || (this.validationFactors!=null && java.util.Arrays.equals(this.validationFactors, other.getValidationFactors()))); __equalsCalc = null; @@ -235,10 +235,10 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -247,10 +247,10 @@ public class PrincipalAuthenticationContext implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/ValidationFactor.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/ValidationFactor.java index 651291cdc3..d685c66bda 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/ValidationFactor.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/authentication/ValidationFactor.java @@ -43,7 +43,7 @@ public class ValidationFactor implements java.io.Serializable { /** * Gets the name value for this ValidationFactor. - * + * * @return name */ public java.lang.String getName() { @@ -53,7 +53,7 @@ public class ValidationFactor implements java.io.Serializable { /** * Sets the name value for this ValidationFactor. - * + * * @param name */ public void setName(java.lang.String name) { @@ -63,7 +63,7 @@ public class ValidationFactor implements java.io.Serializable { /** * Gets the value value for this ValidationFactor. - * + * * @return value */ public java.lang.String getValue() { @@ -73,7 +73,7 @@ public class ValidationFactor implements java.io.Serializable { /** * Sets the value value for this ValidationFactor. - * + * * @param value */ public void setValue(java.lang.String value) { @@ -91,11 +91,11 @@ public class ValidationFactor implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.name==null && other.getName()==null) || + _equals = true && + ((this.name==null && other.getName()==null) || (this.name!=null && this.name.equals(other.getName()))) && - ((this.value==null && other.getValue()==null) || + ((this.value==null && other.getValue()==null) || (this.value!=null && this.value.equals(other.getValue()))); __equalsCalc = null; @@ -152,10 +152,10 @@ public class ValidationFactor implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -164,10 +164,10 @@ public class ValidationFactor implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ApplicationAccessDeniedException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ApplicationAccessDeniedException.java index 4e86b618ea..e22dc59e09 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ApplicationAccessDeniedException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ApplicationAccessDeniedException.java @@ -75,10 +75,10 @@ public class ApplicationAccessDeniedException extends org.apache.axis.AxisFault * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class ApplicationAccessDeniedException extends org.apache.axis.AxisFault * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ApplicationPermissionException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ApplicationPermissionException.java index 788b65c771..3d6842bad3 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ApplicationPermissionException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ApplicationPermissionException.java @@ -75,10 +75,10 @@ public class ApplicationPermissionException extends org.apache.axis.AxisFault * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class ApplicationPermissionException extends org.apache.axis.AxisFault * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InactiveAccountException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InactiveAccountException.java index f7075ddab3..63953a63d4 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InactiveAccountException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InactiveAccountException.java @@ -75,10 +75,10 @@ public class InactiveAccountException extends org.apache.axis.AxisFault implem * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class InactiveAccountException extends org.apache.axis.AxisFault implem * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidAuthenticationException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidAuthenticationException.java index 70211e1a1b..c1bb031c75 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidAuthenticationException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidAuthenticationException.java @@ -75,10 +75,10 @@ public class InvalidAuthenticationException extends org.apache.axis.AxisFault * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class InvalidAuthenticationException extends org.apache.axis.AxisFault * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidAuthorizationTokenException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidAuthorizationTokenException.java index 2ccb9ea672..03c0e95865 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidAuthorizationTokenException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidAuthorizationTokenException.java @@ -75,10 +75,10 @@ public class InvalidAuthorizationTokenException extends org.apache.axis.AxisFau * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class InvalidAuthorizationTokenException extends org.apache.axis.AxisFau * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidCredentialException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidCredentialException.java index 98b94cc211..1450ee2347 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidCredentialException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidCredentialException.java @@ -75,10 +75,10 @@ public class InvalidCredentialException extends org.apache.axis.AxisFault impl * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class InvalidCredentialException extends org.apache.axis.AxisFault impl * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidGroupException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidGroupException.java index 30bd3136c0..c11f31aeed 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidGroupException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidGroupException.java @@ -75,10 +75,10 @@ public class InvalidGroupException extends org.apache.axis.AxisFault implement * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class InvalidGroupException extends org.apache.axis.AxisFault implement * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidPrincipalException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidPrincipalException.java index a33ec78e1b..19ecbc800d 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidPrincipalException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidPrincipalException.java @@ -75,10 +75,10 @@ public class InvalidPrincipalException extends org.apache.axis.AxisFault imple * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class InvalidPrincipalException extends org.apache.axis.AxisFault imple * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidRoleException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidRoleException.java index 7528833c26..7e24357cb1 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidRoleException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidRoleException.java @@ -75,10 +75,10 @@ public class InvalidRoleException extends org.apache.axis.AxisFault implements * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class InvalidRoleException extends org.apache.axis.AxisFault implements * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidTokenException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidTokenException.java index 0b8b864bcd..f75b47fcfc 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidTokenException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/InvalidTokenException.java @@ -75,10 +75,10 @@ public class InvalidTokenException extends org.apache.axis.AxisFault implement * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class InvalidTokenException extends org.apache.axis.AxisFault implement * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ObjectNotFoundException.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ObjectNotFoundException.java index 7c9d73caaa..caef7ac074 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ObjectNotFoundException.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/exception/ObjectNotFoundException.java @@ -75,10 +75,10 @@ public class ObjectNotFoundException extends org.apache.axis.AxisFault impleme * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -87,10 +87,10 @@ public class ObjectNotFoundException extends org.apache.axis.AxisFault impleme * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPAttribute.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPAttribute.java index 0bb0999d53..d389cb6f1d 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPAttribute.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPAttribute.java @@ -43,7 +43,7 @@ public class SOAPAttribute implements java.io.Serializable { /** * Gets the name value for this SOAPAttribute. - * + * * @return name */ public java.lang.String getName() { @@ -53,7 +53,7 @@ public class SOAPAttribute implements java.io.Serializable { /** * Sets the name value for this SOAPAttribute. - * + * * @param name */ public void setName(java.lang.String name) { @@ -63,7 +63,7 @@ public class SOAPAttribute implements java.io.Serializable { /** * Gets the values value for this SOAPAttribute. - * + * * @return values */ public java.lang.String[] getValues() { @@ -73,7 +73,7 @@ public class SOAPAttribute implements java.io.Serializable { /** * Sets the values value for this SOAPAttribute. - * + * * @param values */ public void setValues(java.lang.String[] values) { @@ -91,11 +91,11 @@ public class SOAPAttribute implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.name==null && other.getName()==null) || + _equals = true && + ((this.name==null && other.getName()==null) || (this.name!=null && this.name.equals(other.getName()))) && - ((this.values==null && other.getValues()==null) || + ((this.values==null && other.getValues()==null) || (this.values!=null && java.util.Arrays.equals(this.values, other.getValues()))); __equalsCalc = null; @@ -161,10 +161,10 @@ public class SOAPAttribute implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -173,10 +173,10 @@ public class SOAPAttribute implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPCookieInfo.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPCookieInfo.java index 95efc1072c..f24dc73e29 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPCookieInfo.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPCookieInfo.java @@ -43,7 +43,7 @@ public class SOAPCookieInfo implements java.io.Serializable { /** * Gets the domain value for this SOAPCookieInfo. - * + * * @return domain */ public java.lang.String getDomain() { @@ -53,7 +53,7 @@ public class SOAPCookieInfo implements java.io.Serializable { /** * Sets the domain value for this SOAPCookieInfo. - * + * * @param domain */ public void setDomain(java.lang.String domain) { @@ -63,7 +63,7 @@ public class SOAPCookieInfo implements java.io.Serializable { /** * Gets the secure value for this SOAPCookieInfo. - * + * * @return secure */ public java.lang.Boolean getSecure() { @@ -73,7 +73,7 @@ public class SOAPCookieInfo implements java.io.Serializable { /** * Sets the secure value for this SOAPCookieInfo. - * + * * @param secure */ public void setSecure(java.lang.Boolean secure) { @@ -91,11 +91,11 @@ public class SOAPCookieInfo implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.domain==null && other.getDomain()==null) || + _equals = true && + ((this.domain==null && other.getDomain()==null) || (this.domain!=null && this.domain.equals(other.getDomain()))) && - ((this.secure==null && other.getSecure()==null) || + ((this.secure==null && other.getSecure()==null) || (this.secure!=null && this.secure.equals(other.getSecure()))); __equalsCalc = null; @@ -152,10 +152,10 @@ public class SOAPCookieInfo implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -164,10 +164,10 @@ public class SOAPCookieInfo implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPGroup.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPGroup.java index 29c46803c2..366667321b 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPGroup.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPGroup.java @@ -71,7 +71,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Gets the ID value for this SOAPGroup. - * + * * @return ID */ public java.lang.Long getID() { @@ -81,7 +81,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Sets the ID value for this SOAPGroup. - * + * * @param ID */ public void setID(java.lang.Long ID) { @@ -91,7 +91,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Gets the active value for this SOAPGroup. - * + * * @return active */ public java.lang.Boolean getActive() { @@ -101,7 +101,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Sets the active value for this SOAPGroup. - * + * * @param active */ public void setActive(java.lang.Boolean active) { @@ -111,7 +111,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Gets the attributes value for this SOAPGroup. - * + * * @return attributes */ public com.atlassian.crowd.integration.soap.SOAPAttribute[] getAttributes() { @@ -121,7 +121,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Sets the attributes value for this SOAPGroup. - * + * * @param attributes */ public void setAttributes(com.atlassian.crowd.integration.soap.SOAPAttribute[] attributes) { @@ -131,7 +131,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Gets the conception value for this SOAPGroup. - * + * * @return conception */ public java.util.Calendar getConception() { @@ -141,7 +141,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Sets the conception value for this SOAPGroup. - * + * * @param conception */ public void setConception(java.util.Calendar conception) { @@ -151,7 +151,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Gets the description value for this SOAPGroup. - * + * * @return description */ public java.lang.String getDescription() { @@ -161,7 +161,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Sets the description value for this SOAPGroup. - * + * * @param description */ public void setDescription(java.lang.String description) { @@ -171,7 +171,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Gets the directoryID value for this SOAPGroup. - * + * * @return directoryID */ public java.lang.Long getDirectoryID() { @@ -181,7 +181,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Sets the directoryID value for this SOAPGroup. - * + * * @param directoryID */ public void setDirectoryID(java.lang.Long directoryID) { @@ -191,7 +191,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Gets the lastModified value for this SOAPGroup. - * + * * @return lastModified */ public java.util.Calendar getLastModified() { @@ -201,7 +201,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Sets the lastModified value for this SOAPGroup. - * + * * @param lastModified */ public void setLastModified(java.util.Calendar lastModified) { @@ -211,7 +211,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Gets the members value for this SOAPGroup. - * + * * @return members */ public java.lang.String[] getMembers() { @@ -221,7 +221,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Sets the members value for this SOAPGroup. - * + * * @param members */ public void setMembers(java.lang.String[] members) { @@ -231,7 +231,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Gets the name value for this SOAPGroup. - * + * * @return name */ public java.lang.String getName() { @@ -241,7 +241,7 @@ public class SOAPGroup implements java.io.Serializable { /** * Sets the name value for this SOAPGroup. - * + * * @param name */ public void setName(java.lang.String name) { @@ -259,32 +259,32 @@ public class SOAPGroup implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.ID==null && other.getID()==null) || + _equals = true && + ((this.ID==null && other.getID()==null) || (this.ID!=null && this.ID.equals(other.getID()))) && - ((this.active==null && other.getActive()==null) || + ((this.active==null && other.getActive()==null) || (this.active!=null && this.active.equals(other.getActive()))) && - ((this.attributes==null && other.getAttributes()==null) || + ((this.attributes==null && other.getAttributes()==null) || (this.attributes!=null && java.util.Arrays.equals(this.attributes, other.getAttributes()))) && - ((this.conception==null && other.getConception()==null) || + ((this.conception==null && other.getConception()==null) || (this.conception!=null && this.conception.equals(other.getConception()))) && - ((this.description==null && other.getDescription()==null) || + ((this.description==null && other.getDescription()==null) || (this.description!=null && this.description.equals(other.getDescription()))) && - ((this.directoryID==null && other.getDirectoryID()==null) || + ((this.directoryID==null && other.getDirectoryID()==null) || (this.directoryID!=null && this.directoryID.equals(other.getDirectoryID()))) && - ((this.lastModified==null && other.getLastModified()==null) || + ((this.lastModified==null && other.getLastModified()==null) || (this.lastModified!=null && this.lastModified.equals(other.getLastModified()))) && - ((this.members==null && other.getMembers()==null) || + ((this.members==null && other.getMembers()==null) || (this.members!=null && java.util.Arrays.equals(this.members, other.getMembers()))) && - ((this.name==null && other.getName()==null) || + ((this.name==null && other.getName()==null) || (this.name!=null && this.name.equals(other.getName()))); __equalsCalc = null; @@ -429,10 +429,10 @@ public class SOAPGroup implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -441,10 +441,10 @@ public class SOAPGroup implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPNestableGroup.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPNestableGroup.java index ba87cb1e06..6033efd32e 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPNestableGroup.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPNestableGroup.java @@ -71,7 +71,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Gets the ID value for this SOAPNestableGroup. - * + * * @return ID */ public java.lang.Long getID() { @@ -81,7 +81,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Sets the ID value for this SOAPNestableGroup. - * + * * @param ID */ public void setID(java.lang.Long ID) { @@ -91,7 +91,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Gets the active value for this SOAPNestableGroup. - * + * * @return active */ public java.lang.Boolean getActive() { @@ -101,7 +101,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Sets the active value for this SOAPNestableGroup. - * + * * @param active */ public void setActive(java.lang.Boolean active) { @@ -111,7 +111,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Gets the attributes value for this SOAPNestableGroup. - * + * * @return attributes */ public com.atlassian.crowd.integration.soap.SOAPAttribute[] getAttributes() { @@ -121,7 +121,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Sets the attributes value for this SOAPNestableGroup. - * + * * @param attributes */ public void setAttributes(com.atlassian.crowd.integration.soap.SOAPAttribute[] attributes) { @@ -131,7 +131,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Gets the conception value for this SOAPNestableGroup. - * + * * @return conception */ public java.util.Calendar getConception() { @@ -141,7 +141,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Sets the conception value for this SOAPNestableGroup. - * + * * @param conception */ public void setConception(java.util.Calendar conception) { @@ -151,7 +151,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Gets the description value for this SOAPNestableGroup. - * + * * @return description */ public java.lang.String getDescription() { @@ -161,7 +161,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Sets the description value for this SOAPNestableGroup. - * + * * @param description */ public void setDescription(java.lang.String description) { @@ -171,7 +171,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Gets the directoryID value for this SOAPNestableGroup. - * + * * @return directoryID */ public java.lang.Long getDirectoryID() { @@ -181,7 +181,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Sets the directoryID value for this SOAPNestableGroup. - * + * * @param directoryID */ public void setDirectoryID(java.lang.Long directoryID) { @@ -191,7 +191,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Gets the groupMembers value for this SOAPNestableGroup. - * + * * @return groupMembers */ public java.lang.String[] getGroupMembers() { @@ -201,7 +201,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Sets the groupMembers value for this SOAPNestableGroup. - * + * * @param groupMembers */ public void setGroupMembers(java.lang.String[] groupMembers) { @@ -211,7 +211,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Gets the lastModified value for this SOAPNestableGroup. - * + * * @return lastModified */ public java.util.Calendar getLastModified() { @@ -221,7 +221,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Sets the lastModified value for this SOAPNestableGroup. - * + * * @param lastModified */ public void setLastModified(java.util.Calendar lastModified) { @@ -231,7 +231,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Gets the name value for this SOAPNestableGroup. - * + * * @return name */ public java.lang.String getName() { @@ -241,7 +241,7 @@ public class SOAPNestableGroup implements java.io.Serializable { /** * Sets the name value for this SOAPNestableGroup. - * + * * @param name */ public void setName(java.lang.String name) { @@ -259,32 +259,32 @@ public class SOAPNestableGroup implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.ID==null && other.getID()==null) || + _equals = true && + ((this.ID==null && other.getID()==null) || (this.ID!=null && this.ID.equals(other.getID()))) && - ((this.active==null && other.getActive()==null) || + ((this.active==null && other.getActive()==null) || (this.active!=null && this.active.equals(other.getActive()))) && - ((this.attributes==null && other.getAttributes()==null) || + ((this.attributes==null && other.getAttributes()==null) || (this.attributes!=null && java.util.Arrays.equals(this.attributes, other.getAttributes()))) && - ((this.conception==null && other.getConception()==null) || + ((this.conception==null && other.getConception()==null) || (this.conception!=null && this.conception.equals(other.getConception()))) && - ((this.description==null && other.getDescription()==null) || + ((this.description==null && other.getDescription()==null) || (this.description!=null && this.description.equals(other.getDescription()))) && - ((this.directoryID==null && other.getDirectoryID()==null) || + ((this.directoryID==null && other.getDirectoryID()==null) || (this.directoryID!=null && this.directoryID.equals(other.getDirectoryID()))) && - ((this.groupMembers==null && other.getGroupMembers()==null) || + ((this.groupMembers==null && other.getGroupMembers()==null) || (this.groupMembers!=null && java.util.Arrays.equals(this.groupMembers, other.getGroupMembers()))) && - ((this.lastModified==null && other.getLastModified()==null) || + ((this.lastModified==null && other.getLastModified()==null) || (this.lastModified!=null && this.lastModified.equals(other.getLastModified()))) && - ((this.name==null && other.getName()==null) || + ((this.name==null && other.getName()==null) || (this.name!=null && this.name.equals(other.getName()))); __equalsCalc = null; @@ -429,10 +429,10 @@ public class SOAPNestableGroup implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -441,10 +441,10 @@ public class SOAPNestableGroup implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPPrincipal.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPPrincipal.java index cf8644166f..331c604e35 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPPrincipal.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPPrincipal.java @@ -67,7 +67,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Gets the ID value for this SOAPPrincipal. - * + * * @return ID */ public java.lang.Long getID() { @@ -77,7 +77,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Sets the ID value for this SOAPPrincipal. - * + * * @param ID */ public void setID(java.lang.Long ID) { @@ -87,7 +87,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Gets the active value for this SOAPPrincipal. - * + * * @return active */ public java.lang.Boolean getActive() { @@ -97,7 +97,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Sets the active value for this SOAPPrincipal. - * + * * @param active */ public void setActive(java.lang.Boolean active) { @@ -107,7 +107,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Gets the attributes value for this SOAPPrincipal. - * + * * @return attributes */ public com.atlassian.crowd.integration.soap.SOAPAttribute[] getAttributes() { @@ -117,7 +117,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Sets the attributes value for this SOAPPrincipal. - * + * * @param attributes */ public void setAttributes(com.atlassian.crowd.integration.soap.SOAPAttribute[] attributes) { @@ -127,7 +127,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Gets the conception value for this SOAPPrincipal. - * + * * @return conception */ public java.util.Calendar getConception() { @@ -137,7 +137,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Sets the conception value for this SOAPPrincipal. - * + * * @param conception */ public void setConception(java.util.Calendar conception) { @@ -147,7 +147,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Gets the description value for this SOAPPrincipal. - * + * * @return description */ public java.lang.String getDescription() { @@ -157,7 +157,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Sets the description value for this SOAPPrincipal. - * + * * @param description */ public void setDescription(java.lang.String description) { @@ -167,7 +167,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Gets the directoryID value for this SOAPPrincipal. - * + * * @return directoryID */ public java.lang.Long getDirectoryID() { @@ -177,7 +177,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Sets the directoryID value for this SOAPPrincipal. - * + * * @param directoryID */ public void setDirectoryID(java.lang.Long directoryID) { @@ -187,7 +187,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Gets the lastModified value for this SOAPPrincipal. - * + * * @return lastModified */ public java.util.Calendar getLastModified() { @@ -197,7 +197,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Sets the lastModified value for this SOAPPrincipal. - * + * * @param lastModified */ public void setLastModified(java.util.Calendar lastModified) { @@ -207,7 +207,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Gets the name value for this SOAPPrincipal. - * + * * @return name */ public java.lang.String getName() { @@ -217,7 +217,7 @@ public class SOAPPrincipal implements java.io.Serializable { /** * Sets the name value for this SOAPPrincipal. - * + * * @param name */ public void setName(java.lang.String name) { @@ -235,29 +235,29 @@ public class SOAPPrincipal implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.ID==null && other.getID()==null) || + _equals = true && + ((this.ID==null && other.getID()==null) || (this.ID!=null && this.ID.equals(other.getID()))) && - ((this.active==null && other.getActive()==null) || + ((this.active==null && other.getActive()==null) || (this.active!=null && this.active.equals(other.getActive()))) && - ((this.attributes==null && other.getAttributes()==null) || + ((this.attributes==null && other.getAttributes()==null) || (this.attributes!=null && java.util.Arrays.equals(this.attributes, other.getAttributes()))) && - ((this.conception==null && other.getConception()==null) || + ((this.conception==null && other.getConception()==null) || (this.conception!=null && this.conception.equals(other.getConception()))) && - ((this.description==null && other.getDescription()==null) || + ((this.description==null && other.getDescription()==null) || (this.description!=null && this.description.equals(other.getDescription()))) && - ((this.directoryID==null && other.getDirectoryID()==null) || + ((this.directoryID==null && other.getDirectoryID()==null) || (this.directoryID!=null && this.directoryID.equals(other.getDirectoryID()))) && - ((this.lastModified==null && other.getLastModified()==null) || + ((this.lastModified==null && other.getLastModified()==null) || (this.lastModified!=null && this.lastModified.equals(other.getLastModified()))) && - ((this.name==null && other.getName()==null) || + ((this.name==null && other.getName()==null) || (this.name!=null && this.name.equals(other.getName()))); __equalsCalc = null; @@ -383,10 +383,10 @@ public class SOAPPrincipal implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -395,10 +395,10 @@ public class SOAPPrincipal implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPRole.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPRole.java index 321a80d01d..a2786180d3 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPRole.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SOAPRole.java @@ -71,7 +71,7 @@ public class SOAPRole implements java.io.Serializable { /** * Gets the ID value for this SOAPRole. - * + * * @return ID */ public java.lang.Long getID() { @@ -81,7 +81,7 @@ public class SOAPRole implements java.io.Serializable { /** * Sets the ID value for this SOAPRole. - * + * * @param ID */ public void setID(java.lang.Long ID) { @@ -91,7 +91,7 @@ public class SOAPRole implements java.io.Serializable { /** * Gets the active value for this SOAPRole. - * + * * @return active */ public java.lang.Boolean getActive() { @@ -101,7 +101,7 @@ public class SOAPRole implements java.io.Serializable { /** * Sets the active value for this SOAPRole. - * + * * @param active */ public void setActive(java.lang.Boolean active) { @@ -111,7 +111,7 @@ public class SOAPRole implements java.io.Serializable { /** * Gets the attributes value for this SOAPRole. - * + * * @return attributes */ public com.atlassian.crowd.integration.soap.SOAPAttribute[] getAttributes() { @@ -121,7 +121,7 @@ public class SOAPRole implements java.io.Serializable { /** * Sets the attributes value for this SOAPRole. - * + * * @param attributes */ public void setAttributes(com.atlassian.crowd.integration.soap.SOAPAttribute[] attributes) { @@ -131,7 +131,7 @@ public class SOAPRole implements java.io.Serializable { /** * Gets the conception value for this SOAPRole. - * + * * @return conception */ public java.util.Calendar getConception() { @@ -141,7 +141,7 @@ public class SOAPRole implements java.io.Serializable { /** * Sets the conception value for this SOAPRole. - * + * * @param conception */ public void setConception(java.util.Calendar conception) { @@ -151,7 +151,7 @@ public class SOAPRole implements java.io.Serializable { /** * Gets the description value for this SOAPRole. - * + * * @return description */ public java.lang.String getDescription() { @@ -161,7 +161,7 @@ public class SOAPRole implements java.io.Serializable { /** * Sets the description value for this SOAPRole. - * + * * @param description */ public void setDescription(java.lang.String description) { @@ -171,7 +171,7 @@ public class SOAPRole implements java.io.Serializable { /** * Gets the directoryID value for this SOAPRole. - * + * * @return directoryID */ public java.lang.Long getDirectoryID() { @@ -181,7 +181,7 @@ public class SOAPRole implements java.io.Serializable { /** * Sets the directoryID value for this SOAPRole. - * + * * @param directoryID */ public void setDirectoryID(java.lang.Long directoryID) { @@ -191,7 +191,7 @@ public class SOAPRole implements java.io.Serializable { /** * Gets the lastModified value for this SOAPRole. - * + * * @return lastModified */ public java.util.Calendar getLastModified() { @@ -201,7 +201,7 @@ public class SOAPRole implements java.io.Serializable { /** * Sets the lastModified value for this SOAPRole. - * + * * @param lastModified */ public void setLastModified(java.util.Calendar lastModified) { @@ -211,7 +211,7 @@ public class SOAPRole implements java.io.Serializable { /** * Gets the members value for this SOAPRole. - * + * * @return members */ public java.lang.String[] getMembers() { @@ -221,7 +221,7 @@ public class SOAPRole implements java.io.Serializable { /** * Sets the members value for this SOAPRole. - * + * * @param members */ public void setMembers(java.lang.String[] members) { @@ -231,7 +231,7 @@ public class SOAPRole implements java.io.Serializable { /** * Gets the name value for this SOAPRole. - * + * * @return name */ public java.lang.String getName() { @@ -241,7 +241,7 @@ public class SOAPRole implements java.io.Serializable { /** * Sets the name value for this SOAPRole. - * + * * @param name */ public void setName(java.lang.String name) { @@ -259,32 +259,32 @@ public class SOAPRole implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.ID==null && other.getID()==null) || + _equals = true && + ((this.ID==null && other.getID()==null) || (this.ID!=null && this.ID.equals(other.getID()))) && - ((this.active==null && other.getActive()==null) || + ((this.active==null && other.getActive()==null) || (this.active!=null && this.active.equals(other.getActive()))) && - ((this.attributes==null && other.getAttributes()==null) || + ((this.attributes==null && other.getAttributes()==null) || (this.attributes!=null && java.util.Arrays.equals(this.attributes, other.getAttributes()))) && - ((this.conception==null && other.getConception()==null) || + ((this.conception==null && other.getConception()==null) || (this.conception!=null && this.conception.equals(other.getConception()))) && - ((this.description==null && other.getDescription()==null) || + ((this.description==null && other.getDescription()==null) || (this.description!=null && this.description.equals(other.getDescription()))) && - ((this.directoryID==null && other.getDirectoryID()==null) || + ((this.directoryID==null && other.getDirectoryID()==null) || (this.directoryID!=null && this.directoryID.equals(other.getDirectoryID()))) && - ((this.lastModified==null && other.getLastModified()==null) || + ((this.lastModified==null && other.getLastModified()==null) || (this.lastModified!=null && this.lastModified.equals(other.getLastModified()))) && - ((this.members==null && other.getMembers()==null) || + ((this.members==null && other.getMembers()==null) || (this.members!=null && java.util.Arrays.equals(this.members, other.getMembers()))) && - ((this.name==null && other.getName()==null) || + ((this.name==null && other.getName()==null) || (this.name!=null && this.name.equals(other.getName()))); __equalsCalc = null; @@ -429,10 +429,10 @@ public class SOAPRole implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -441,10 +441,10 @@ public class SOAPRole implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SearchRestriction.java b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SearchRestriction.java index 6a8c414c39..82d99ca688 100644 --- a/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SearchRestriction.java +++ b/specialpurpose/crowd/src/com/atlassian/crowd/integration/soap/SearchRestriction.java @@ -43,7 +43,7 @@ public class SearchRestriction implements java.io.Serializable { /** * Gets the name value for this SearchRestriction. - * + * * @return name */ public java.lang.String getName() { @@ -53,7 +53,7 @@ public class SearchRestriction implements java.io.Serializable { /** * Sets the name value for this SearchRestriction. - * + * * @param name */ public void setName(java.lang.String name) { @@ -63,7 +63,7 @@ public class SearchRestriction implements java.io.Serializable { /** * Gets the value value for this SearchRestriction. - * + * * @return value */ public java.lang.String getValue() { @@ -73,7 +73,7 @@ public class SearchRestriction implements java.io.Serializable { /** * Sets the value value for this SearchRestriction. - * + * * @param value */ public void setValue(java.lang.String value) { @@ -91,11 +91,11 @@ public class SearchRestriction implements java.io.Serializable { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.name==null && other.getName()==null) || + _equals = true && + ((this.name==null && other.getName()==null) || (this.name!=null && this.name.equals(other.getName()))) && - ((this.value==null && other.getValue()==null) || + ((this.value==null && other.getValue()==null) || (this.value!=null && this.value.equals(other.getValue()))); __equalsCalc = null; @@ -152,10 +152,10 @@ public class SearchRestriction implements java.io.Serializable { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } @@ -164,10 +164,10 @@ public class SearchRestriction implements java.io.Serializable { * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, + java.lang.String mechType, + java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { - return + return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } diff --git a/specialpurpose/crowd/src/org/ofbiz/crowd/CrowdAuthenticator.java b/specialpurpose/crowd/src/org/ofbiz/crowd/CrowdAuthenticator.java index 8676fcabfc..9b46008b78 100644 --- a/specialpurpose/crowd/src/org/ofbiz/crowd/CrowdAuthenticator.java +++ b/specialpurpose/crowd/src/org/ofbiz/crowd/CrowdAuthenticator.java @@ -217,7 +217,7 @@ public class CrowdAuthenticator extends CrowdWorker implements Authenticator { } catch (GenericEntityException e) { Debug.logError(e, e.getMessage(), module); } - + // add it to the user if it exists if (secGroup != null) { Map createSecGrpMap = FastMap.newInstance(); @@ -225,7 +225,7 @@ public class CrowdAuthenticator extends CrowdWorker implements Authenticator { createSecGrpMap.put("groupId", securityGroup); createSecGrpMap.put("fromDate", now); createSecGrpMap.put("userLogin", system); - + Map createSecGrpResult; try { createSecGrpResult = dispatcher.runSync("addUserLoginToSecurityGroup", createSecGrpMap); diff --git a/specialpurpose/crowd/src/org/ofbiz/crowd/security/SecurityServerLocator.java b/specialpurpose/crowd/src/org/ofbiz/crowd/security/SecurityServerLocator.java index 1f22e6f328..9667196835 100644 --- a/specialpurpose/crowd/src/org/ofbiz/crowd/security/SecurityServerLocator.java +++ b/specialpurpose/crowd/src/org/ofbiz/crowd/security/SecurityServerLocator.java @@ -142,11 +142,11 @@ public class SecurityServerLocator extends org.apache.axis.client.Service implem * Set the endpoint address for the specified port name. */ public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { - + if ("SecurityServerHttpPort".equals(portName)) { setSecurityServerHttpPortEndpointAddress(address); } - else + else { // Unknown Port Name throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); } diff --git a/specialpurpose/crowd/src/org/ofbiz/crowd/user/UserAttributeMapper.java b/specialpurpose/crowd/src/org/ofbiz/crowd/user/UserAttributeMapper.java index f9b4f85fa1..56aedfb5be 100644 --- a/specialpurpose/crowd/src/org/ofbiz/crowd/user/UserAttributeMapper.java +++ b/specialpurpose/crowd/src/org/ofbiz/crowd/user/UserAttributeMapper.java @@ -97,14 +97,14 @@ public class UserAttributeMapper { private String getCrowdKey(String name) { Properties props = UtilProperties.getProperties("crowd.properties"); - return (String) props.get("crowd.attribute.map." + name); + return (String) props.get("crowd.attribute.map." + name); } private SOAPAttribute makeAttribute(String name, String value) { SOAPAttribute attr = new SOAPAttribute(); attr.setName(getCrowdKey(name)); - attr.setValues(new String[] {value}); - + attr.setValues(new String[] {value}); + removeAttributeByName(attr.getName()); attributes.add(attr); return attr; diff --git a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java index 5ddc6108ab..eba47229d2 100644 --- a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java +++ b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java @@ -57,7 +57,7 @@ import org.ofbiz.service.ServiceUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; -public class EbayHelper { +public class EbayHelper { private static final String configFileName = "ebayExport.properties"; private static final String module = EbayHelper.class.getName(); public static final String resource = "EbayUiLabels"; @@ -91,9 +91,9 @@ public class EbayHelper { buildEbayConfigContext.put("compatibilityLevel", UtilProperties.getPropertyValue(configFileName, "eBayExport.compatibilityLevel")); buildEbayConfigContext.put("siteID", UtilProperties.getPropertyValue(configFileName, "eBayExport.siteID")); buildEbayConfigContext.put("xmlGatewayUri", UtilProperties.getPropertyValue(configFileName, "eBayExport.xmlGatewayUri")); - } + } return buildEbayConfigContext; - } + } public static void appendRequesterCredentials(Element elem, Document doc, String token) { Element requesterCredentialsElem = UtilXml.addChildElement(elem, "RequesterCredentials", doc); @@ -164,7 +164,7 @@ public class EbayHelper { } return outputBuilder.toString(); } - + public static void setShipmentMethodType(ShoppingCart cart, String shippingService, String productStoreId, Delegator delegator) { String partyId = "_NA_"; String shipmentMethodTypeId = "NO_SHIPPING"; @@ -180,7 +180,7 @@ public class EbayHelper { cart.setCarrierPartyId(partyId); cart.setShipmentMethodTypeId(shipmentMethodTypeId); } - + public static boolean createPaymentFromPaymentPreferences(Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin, String orderId, String externalId, Timestamp orderDate, String partyIdFrom) { List paymentPreferences = null; @@ -412,7 +412,7 @@ public class EbayHelper { return emailContactMechId; } - public static void createEbayCustomer(LocalDispatcher dispatcher, String partyId, String ebayUserIdBuyer, String eias, + public static void createEbayCustomer(LocalDispatcher dispatcher, String partyId, String ebayUserIdBuyer, String eias, GenericValue userLogin) { Map context = FastMap.newInstance(); Map summaryResult = FastMap.newInstance(); @@ -578,7 +578,7 @@ public class EbayHelper { Debug.logInfo("Unable to find matching postal address for partyId " + partyId + ". Creating a new one.", module); return createPartyPhone(dispatcher, partyId, (String) context.get("shippingAddressPhone"), userLogin); } - + public static String retrieveProductIdFromTitle(Delegator delegator, String title) { String productId = ""; try { @@ -604,5 +604,5 @@ public class EbayHelper { productId = ""; } return productId; - } + } } \ No newline at end of file diff --git a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java index ef35977933..bda8c43eaf 100644 --- a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java +++ b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java @@ -54,17 +54,17 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; public class EbayOrderServices { - + private static final String resource = "EbayUiLabels"; private static final String module = EbayOrderServices.class.getName(); private static boolean isGetSellerTransactionsCall = false; private static boolean isGetOrdersCall = false; private static boolean isGetMyeBaySellingCall = false; private static List> orderList = FastList.newInstance(); - private static List getSellerTransactionsContainingOrderList = FastList.newInstance(); + private static List getSellerTransactionsContainingOrderList = FastList.newInstance(); private static List orderImportSuccessMessageList = FastList.newInstance(); private static List orderImportFailureMessageList = FastList.newInstance(); - + public static Map getEbayOrders(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); @@ -79,7 +79,7 @@ public class EbayOrderServices { String eBayConfigErrorMsg = "Configuration settings are missing for connecting to eBay server."; return ServiceUtil.returnError(eBayConfigErrorMsg); } - + StringBuffer sellerTransactionsItemsXml = new StringBuffer(); if (!ServiceUtil.isFailure(buildGetSellerTransactionsRequest(context, sellerTransactionsItemsXml, eBayConfigResult.get("token").toString()))) { result = EbayHelper.postItem(eBayConfigResult.get("xmlGatewayUri").toString(), sellerTransactionsItemsXml, eBayConfigResult.get("devID").toString(), eBayConfigResult.get("appID").toString(), eBayConfigResult.get("certID").toString(), "GetSellerTransactions", eBayConfigResult.get("compatibilityLevel").toString(), eBayConfigResult.get("siteID").toString()); @@ -89,7 +89,7 @@ public class EbayOrderServices { result = checkOrders(delegator, dispatcher, locale, context, getSellerTransactionSuccessMsg); } } - + StringBuffer getOrdersXml = new StringBuffer(); if (!ServiceUtil.isFailure(buildGetOrdersRequest(context, getOrdersXml, eBayConfigResult.get("token").toString()))) { result = EbayHelper.postItem(eBayConfigResult.get("xmlGatewayUri").toString(), getOrdersXml, eBayConfigResult.get("devID").toString(), eBayConfigResult.get("appID").toString(), eBayConfigResult.get("certID").toString(), "GetOrders", eBayConfigResult.get("compatibilityLevel").toString(), eBayConfigResult.get("siteID").toString()); @@ -99,7 +99,7 @@ public class EbayOrderServices { result = checkOrders(delegator, dispatcher, locale, context, getOrdersSuccessMsg); } } - + StringBuffer getMyeBaySellingXml = new StringBuffer(); if (!ServiceUtil.isFailure(buildGetMyeBaySellingRequest(context, getMyeBaySellingXml, eBayConfigResult.get("token").toString()))) { result = EbayHelper.postItem(eBayConfigResult.get("xmlGatewayUri").toString(), getMyeBaySellingXml, eBayConfigResult.get("devID").toString(), eBayConfigResult.get("appID").toString(), eBayConfigResult.get("certID").toString(), "GetMyeBaySelling", eBayConfigResult.get("compatibilityLevel").toString(), eBayConfigResult.get("siteID").toString()); @@ -133,7 +133,7 @@ public class EbayOrderServices { context.putAll(orderMapCtx); break; } - } + } } result = createShoppingCart(delegator, dispatcher, locale, context, true); } catch (Exception e) { @@ -144,14 +144,14 @@ public class EbayOrderServices { result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); result.put(ModelService.SUCCESS_MESSAGE_LIST, orderImportSuccessMessageList); } - + if (UtilValidate.isNotEmpty(orderImportSuccessMessageList)) { result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_FAIL); result.put(ModelService.ERROR_MESSAGE_LIST, orderImportFailureMessageList); } return result; } - + private static Map buildGetOrdersRequest(Map context, StringBuffer dataItemsXml, String token) { Locale locale = (Locale) context.get("locale"); String fromDate = (String) context.get("fromDate"); @@ -163,7 +163,7 @@ public class EbayOrderServices { UtilXml.addChildElementValue(transElem, "DetailLevel", "ReturnAll", transDoc); EbayHelper.appendRequesterCredentials(transElem, transDoc, token); - + if (UtilValidate.isNotEmpty(getSellerTransactionsContainingOrderList)) { Element orderIdArrayElem = UtilXml.addChildElement(transElem, "OrderIDArray", transDoc); Iterator orderIdListIter = getSellerTransactionsContainingOrderList.iterator(); @@ -171,10 +171,10 @@ public class EbayOrderServices { String orderId = (String) orderIdListIter.next(); UtilXml.addChildElementValue(orderIdArrayElem, "OrderID", orderId, transDoc); } - } else { + } else { UtilXml.addChildElementValue(transElem, "OrderRole", "Seller", transDoc); UtilXml.addChildElementValue(transElem, "OrderStatus", "Completed", transDoc); - + String fromDateOut = EbayHelper.convertDate(fromDate, "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); if (fromDateOut != null) { UtilXml.addChildElementValue(transElem, "CreateTimeFrom", fromDateOut, transDoc); @@ -198,7 +198,7 @@ public class EbayOrderServices { } return ServiceUtil.returnSuccess(); } - + private static Map buildGetSellerTransactionsRequest(Map context, StringBuffer sellerTransactionsItemsXml, String token) { Locale locale = (Locale)context.get("locale"); String fromDate = (String)context.get("fromDate"); @@ -244,7 +244,7 @@ public class EbayOrderServices { transElem.setAttribute("xmlns", "urn:ebay:apis:eBLBaseComponents"); EbayHelper.appendRequesterCredentials(transElem, transDoc, token); - + Element deletedFromSoldListElem = UtilXml.addChildElement(transElem, "DeletedFromSoldList", transDoc); UtilXml.addChildElementValue(deletedFromSoldListElem, "Sort", "ItemID", transDoc); //Debug.logInfo("The value of generated string is ======= " + UtilXml.writeXmlDocument(transDoc), module); @@ -255,7 +255,7 @@ public class EbayOrderServices { } return ServiceUtil.returnSuccess(); } - + private static Map checkOrders(Delegator delegator, LocalDispatcher dispatcher, Locale locale, Map context, String responseMsg) { StringBuffer errorMessage = new StringBuffer(); Map result = FastMap.newInstance(); @@ -270,7 +270,7 @@ public class EbayOrderServices { } else if (isGetOrdersCall) { List> getOrdersList = readGetOrdersResponse(responseMsg, locale, (String) context.get("productStoreId"), delegator, dispatcher, errorMessage, userLogin); if (UtilValidate.isNotEmpty(getOrdersList)) { - orderList.addAll(getOrdersList); + orderList.addAll(getOrdersList); } isGetOrdersCall = false; return ServiceUtil.returnSuccess(); @@ -298,9 +298,9 @@ public class EbayOrderServices { } return result; } - -// Sample xml data that is being generated from GetOrders request -// + +// Sample xml data that is being generated from GetOrders request +// // // 2009-09-10T11:17:53.529Z // Success @@ -417,8 +417,8 @@ public class EbayOrderServices { // // // - - + + private static List> readGetOrdersResponse(String responseMsg, Locale locale, String productStoreId, Delegator delegator, LocalDispatcher dispatcher, StringBuffer errorMessage, GenericValue userLogin) { List> fetchedOrders = FastList.newInstance(); try { @@ -428,7 +428,7 @@ public class EbayOrderServices { String ack = UtilXml.childElementValue(elemResponse, "Ack", "Failure"); int totalOrders = 0; - + if (ack != null && "Success".equals(ack)) { List orderArrays = UtilXml.childElementList(elemResponse, "OrderArray"); if (UtilValidate.isNotEmpty(orderArrays)) { @@ -443,9 +443,9 @@ public class EbayOrderServices { // retrieve transaction List orders = UtilXml.childElementList(orderArraysElement, "Order"); Iterator ordersElemIter = orders.iterator(); - + while (ordersElemIter.hasNext()) { - Map orderCtx = FastMap.newInstance(); + Map orderCtx = FastMap.newInstance(); Element ordersElement = (Element) ordersElemIter.next(); String externalOrderId = UtilXml.childElementValue(ordersElement, "OrderID"); GenericValue orderExist = externalOrderExists(delegator, externalOrderId); @@ -454,7 +454,7 @@ public class EbayOrderServices { } else { orderCtx.put("orderId", ""); } - + orderCtx.put("externalId", externalOrderId); orderCtx.put("amountPaid", UtilXml.childElementValue(ordersElement, "Total", "0")); String createdDate = UtilXml.childElementValue(ordersElement, "CreatedTime"); @@ -466,8 +466,8 @@ public class EbayOrderServices { orderCtx.put("shippedTime", UtilXml.childElementValue(ordersElement, "ShippedTime")); orderCtx.put("ebayUserIdBuyer", UtilXml.childElementValue(ordersElement, "BuyerUserID")); orderCtx.put("productStoreId", productStoreId); - - // Retrieve shipping address + + // Retrieve shipping address Map shippingAddressCtx = FastMap.newInstance(); List shippingAddressList = UtilXml.childElementList(ordersElement, "ShippingAddress"); Iterator shippingAddressElemIter = shippingAddressList.iterator(); @@ -484,12 +484,12 @@ public class EbayOrderServices { shippingAddressCtx.put("shippingAddressPostalCode", UtilXml.childElementValue(shippingAddressElement, "PostalCode")); } orderCtx.put("shippingAddressCtx", shippingAddressCtx); - + if (UtilValidate.isEmpty(shippingAddressCtx)) { String shippingAddressMissingMsg = "Shipping Address is missing for eBay Order ID (" + externalOrderId + ")"; orderImportFailureMessageList.add(shippingAddressMissingMsg); } - + // Retrieve shipping service selected Map shippingServiceSelectedCtx = FastMap.newInstance(); List shippingServiceSelectedList = UtilXml.childElementList(ordersElement, "ShippingServiceSelected"); @@ -504,12 +504,12 @@ public class EbayOrderServices { } } orderCtx.put("shippingServiceSelectedCtx", shippingServiceSelectedCtx); - + if (UtilValidate.isEmpty(shippingServiceSelectedCtx.get("shippingService").toString())) { String shippingServiceMissingMsg = "Shipping Method is missing for eBay Order ID (" + externalOrderId + ")"; orderImportFailureMessageList.add(shippingServiceMissingMsg); } - + // Retrieve shipping details Map shippingDetailsCtx = FastMap.newInstance(); List shippingDetailsList = UtilXml.childElementList(ordersElement, "ShippingDetails"); @@ -532,7 +532,7 @@ public class EbayOrderServices { } } orderCtx.put("shippingDetailsCtx", shippingDetailsCtx); - + // Retrieve checkout status Map checkoutStatusCtx = FastMap.newInstance(); List checkoutStatusList = UtilXml.childElementList(ordersElement, "CheckoutStatus"); @@ -544,7 +544,7 @@ public class EbayOrderServices { checkoutStatusCtx.put("completeStatus", UtilXml.childElementValue(statusElement, "Status")); } orderCtx.put("checkoutStatusCtx", checkoutStatusCtx); - + // Retrieve external transaction Map externalTransactionCtx = FastMap.newInstance(); List externalTransactionList = UtilXml.childElementList(ordersElement, "ExternalTransaction"); @@ -557,22 +557,22 @@ public class EbayOrderServices { externalTransactionCtx.put("paymentOrRefundAmount", UtilXml.childElementValue(externalTransactionElement, "PaymentOrRefundAmount", "0")); } orderCtx.put("externalTransactionCtx", externalTransactionCtx); - + // Retrieve Transactions Array --> Transactions | Order Items List> orderItemList = FastList.newInstance(); String buyersEmailId = null; List transactionArrayList = UtilXml.childElementList(ordersElement, "TransactionArray"); Iterator transactionArrayElemIter = transactionArrayList.iterator(); - while (transactionArrayElemIter.hasNext()) { + while (transactionArrayElemIter.hasNext()) { Element transactionArrayElement = (Element) transactionArrayElemIter.next(); - + boolean buyerEmailExists = false; List transactionList = UtilXml.childElementList(transactionArrayElement, "Transaction"); Iterator transactionElemIter = transactionList.iterator(); - while (transactionElemIter.hasNext()) { + while (transactionElemIter.hasNext()) { Map transactionCtx = FastMap.newInstance(); Element transactionElement = (Element) transactionElemIter.next(); - + // Retrieve Buyer email if (!buyerEmailExists) { List buyerList = UtilXml.childElementList(transactionElement, "Buyer"); @@ -585,7 +585,7 @@ public class EbayOrderServices { } } } - + // Retrieve Order Item info List itemList = UtilXml.childElementList(transactionElement, "Item"); Iterator itemElemIter = itemList.iterator(); @@ -607,7 +607,7 @@ public class EbayOrderServices { orderCtx.put("userLogin", userLogin); orderCtx.put("isEbayOrder", "Y"); orderCtx.put("isEbayTransaction", ""); - + //Map result = dispatcher.runSync("importEbayOrders", orderCtx); fetchedOrders.add(orderCtx); } @@ -627,7 +627,7 @@ public class EbayOrderServices { } return fetchedOrders; } - + private static List> readGetSellerTransactionResponse(String responseMsg, Locale locale, String productStoreId, Delegator delegator, LocalDispatcher dispatcher, StringBuffer errorMessage, GenericValue userLogin) { List> fetchedOrders = FastList.newInstance(); try { @@ -659,7 +659,7 @@ public class EbayOrderServices { while (transactionElemIter.hasNext()) { Element transactionElement = (Element) transactionElemIter.next(); Map orderCtx = FastMap.newInstance(); - + orderCtx.put("amountPaid", UtilXml.childElementValue(transactionElement, "AmountPaid", "0")); String createdDate = UtilXml.childElementValue(transactionElement, "CreatedDate"); if (UtilValidate.isNotEmpty(createdDate)) { @@ -669,7 +669,7 @@ public class EbayOrderServices { orderCtx.put("paidTime", UtilXml.childElementValue(transactionElement, "PaidTime")); orderCtx.put("shippedTime", UtilXml.childElementValue(transactionElement, "ShippedTime")); orderCtx.put("productStoreId", productStoreId); - + // if any transaction contains order then add it in the list and give it to GetOrders request. List containingOrders = UtilXml.childElementList(transactionElement, "ContainingOrder"); Iterator containingOrdersIter = containingOrders.iterator(); @@ -679,11 +679,11 @@ public class EbayOrderServices { if (getSellerTransactionsContainingOrderList != null && ! getSellerTransactionsContainingOrderList.contains(orderId)) { getSellerTransactionsContainingOrderList.add(orderId); } - } + } if (UtilValidate.isNotEmpty(containingOrders)) { continue; } - + // retrieve buyer Map shippingAddressCtx = FastMap.newInstance(); Map buyerCtx = FastMap.newInstance(); @@ -721,9 +721,9 @@ public class EbayOrderServices { } orderCtx.put("buyerCtx", buyerCtx); orderCtx.put("shippingAddressCtx", shippingAddressCtx); - + // retrieve shipping service selected - Map shippingServiceSelectedCtx = FastMap.newInstance(); + Map shippingServiceSelectedCtx = FastMap.newInstance(); List shippingServiceSelected = UtilXml.childElementList(transactionElement, "ShippingServiceSelected"); Iterator shippingServiceSelectedElemIter = shippingServiceSelected.iterator(); while (shippingServiceSelectedElemIter.hasNext()) { @@ -753,7 +753,7 @@ public class EbayOrderServices { shippingServiceSelectedCtx.put("shippingTotalAdditionalCost", totalAdditionalCost); } orderCtx.put("shippingServiceSelectedCtx", shippingServiceSelectedCtx); - + // retrieve shipping details Map shippingDetailsCtx = FastMap.newInstance(); List shippingDetails = UtilXml.childElementList(transactionElement, "ShippingDetails"); @@ -793,7 +793,7 @@ public class EbayOrderServices { } } orderCtx.put("shippingDetailsCtx", shippingDetailsCtx); - + // retrieve status Map checkoutStatusCtx = FastMap.newInstance(); List status = UtilXml.childElementList(transactionElement, "Status"); @@ -807,7 +807,7 @@ public class EbayOrderServices { checkoutStatusCtx.put("buyerSelectedShipping", UtilXml.childElementValue(statusElement, "BuyerSelectedShipping", "")); } orderCtx.put("checkoutStatusCtx", checkoutStatusCtx); - + // retrieve external transaction Map externalTransactionCtx = FastMap.newInstance(); List externalTransaction = UtilXml.childElementList(transactionElement, "ExternalTransaction"); @@ -820,7 +820,7 @@ public class EbayOrderServices { externalTransactionCtx.put("paymentOrRefundAmount", UtilXml.childElementValue(externalTransactionElement, "PaymentOrRefundAmount", "0")); } orderCtx.put("externalTransactionCtx", externalTransactionCtx); - + // retrieve item List> orderItemList = FastList.newInstance(); String itemId = ""; @@ -872,20 +872,20 @@ public class EbayOrderServices { // retrieve transaction price orderCtx.put("transactionPrice", UtilXml.childElementValue(transactionElement, "TransactionPrice", "0")); - + if (UtilValidate.isEmpty(shippingServiceSelectedCtx.get("shippingService").toString())) { String shippingServiceMissingMsg = "Shipping Method is missing for eBay Order ID (" + orderCtx.get("externalId").toString() + ")"; orderImportFailureMessageList.add(shippingServiceMissingMsg); } - + // Lets put emailAddress & userId on the root similiar to that of GetOrders request orderCtx.put("emailBuyer", buyerCtx.get("emailBuyer").toString()); orderCtx.put("ebayUserIdBuyer", buyerCtx.get("ebayUserIdBuyer").toString()); - + orderCtx.put("userLogin", userLogin); orderCtx.put("isEbayTransaction", "Y"); orderCtx.put("isEbayOrder", ""); - + // Now finally put the root map in the fetched orders list. fetchedOrders.add(orderCtx); } @@ -904,7 +904,7 @@ public class EbayOrderServices { } return fetchedOrders; } - + private static List readGetMyeBaySellingResponse(String responseMsg, Locale locale, String productStoreId, Delegator delegator, LocalDispatcher dispatcher, StringBuffer errorMessage, GenericValue userLogin) { List fetchDeletedOrdersAndTransactions = FastList.newInstance(); try { @@ -937,12 +937,12 @@ public class EbayOrderServices { if (UtilValidate.isNotEmpty(orderId)) { fetchDeletedOrdersAndTransactions.add(orderId); } - } + } List transactionList = UtilXml.childElementList(orderTransactionElement, "Transaction"); Iterator transactionElemIter = transactionList.iterator(); while (transactionElemIter.hasNext()) { Element transactionElement = (Element) transactionElemIter.next(); - + List itemList = UtilXml.childElementList(transactionElement, "Item"); Iterator itemElemIter = itemList.iterator(); while (itemElemIter.hasNext()) { @@ -954,7 +954,7 @@ public class EbayOrderServices { } } } - } + } } } else { List errorList = UtilXml.childElementList(elemResponse, "Errors"); @@ -969,7 +969,7 @@ public class EbayOrderServices { } return fetchDeletedOrdersAndTransactions; } - + private static Map createShoppingCart(Delegator delegator, LocalDispatcher dispatcher, Locale locale, Map context, boolean create) { try { String productStoreId = (String) context.get("productStoreId"); @@ -1035,21 +1035,21 @@ public class EbayOrderServices { if (UtilValidate.isEmpty(paidTime)) { return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.paymentIsStillNotReceived", locale)); } - + List orderItemList = (List) context.get("orderItemList"); Iterator> orderItemIter = orderItemList.iterator(); while (orderItemIter.hasNext()) { Map orderItem = (Map) orderItemIter.next(); addItem(cart, orderItem, dispatcher, delegator, 0); } - + // set partyId from if (UtilValidate.isNotEmpty(payToPartyId)) { cart.setBillFromVendorPartyId(payToPartyId); } // Apply shipping costs as order adjustment Map shippingServiceSelectedCtx = (Map) context.get("shippingServiceSelectedCtx"); - + String shippingCost = (String) shippingServiceSelectedCtx.get("shippingServiceCost"); if (UtilValidate.isNotEmpty(shippingCost)) { double shippingAmount = new Double(shippingCost).doubleValue(); @@ -1094,20 +1094,20 @@ public class EbayOrderServices { // set partyId to String partyId = null; String contactMechId = null; - + Map shippingAddressCtx = (Map) context.get("shippingAddressCtx"); if (UtilValidate.isNotEmpty(shippingAddressCtx)) { String buyerName = (String) shippingAddressCtx.get("buyerName"); String firstName = (String) buyerName.substring(0, buyerName.indexOf(" ")); String lastName = (String) buyerName.substring(buyerName.indexOf(" ")+1); - + String country = (String) shippingAddressCtx.get("shippingAddressCountry"); String state = (String) shippingAddressCtx.get("shippingAddressStateOrProvince"); String city = (String) shippingAddressCtx.get("shippingAddressCityName"); EbayHelper.correctCityStateCountry(dispatcher, shippingAddressCtx, city, state, country); - - List shipInfo = PartyWorker.findMatchingPartyAndPostalAddress(delegator, shippingAddressCtx.get("shippingAddressStreet1").toString(), - (UtilValidate.isEmpty(shippingAddressCtx.get("shippingAddressStreet2")) ? null : shippingAddressCtx.get("shippingAddressStreet2").toString()), shippingAddressCtx.get("city").toString(), shippingAddressCtx.get("stateProvinceGeoId").toString(), + + List shipInfo = PartyWorker.findMatchingPartyAndPostalAddress(delegator, shippingAddressCtx.get("shippingAddressStreet1").toString(), + (UtilValidate.isEmpty(shippingAddressCtx.get("shippingAddressStreet2")) ? null : shippingAddressCtx.get("shippingAddressStreet2").toString()), shippingAddressCtx.get("city").toString(), shippingAddressCtx.get("stateProvinceGeoId").toString(), shippingAddressCtx.get("shippingAddressPostalCode").toString(), null, shippingAddressCtx.get("countryGeoId").toString(), firstName, null, lastName); if (UtilValidate.isNotEmpty(shipInfo)) { GenericValue first = EntityUtil.getFirst(shipInfo); @@ -1115,16 +1115,16 @@ public class EbayOrderServices { Debug.logInfo("Existing shipping address found for : (party: " + partyId + ")", module); } } - + // If matching party not found then try to find partyId from PartyAttribute entity. GenericValue partyAttribute = null; if (UtilValidate.isNotEmpty(context.get("eiasTokenBuyer"))) { partyAttribute = EntityUtil.getFirst(delegator.findByAnd("PartyAttribute", UtilMisc.toMap("attrValue", (String) context.get("eiasTokenBuyer")))); if (UtilValidate.isNotEmpty(partyAttribute)) { partyId = (String) partyAttribute.get("partyId"); - } + } } - + // if we get a party, check its contact information. if (UtilValidate.isNotEmpty(partyId)) { Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, module); @@ -1154,7 +1154,7 @@ public class EbayOrderServices { String eiasTokenBuyer = null; if (UtilValidate.isNotEmpty(buyerCtx)) { eiasTokenBuyer = (String) buyerCtx.get("eiasTokenBuyer"); - } + } Debug.logInfo("Creating new postal address for party: " + partyId, module); contactMechId = EbayHelper.createAddress(dispatcher, partyId, userLogin, "SHIPPING_LOCATION", shippingAddressCtx); if (UtilValidate.isEmpty(contactMechId)) { @@ -1198,7 +1198,7 @@ public class EbayOrderServices { } String orderId = (String) orderCreate.get("orderId"); Debug.logInfo("Created order with id: " + orderId, module); - + if (UtilValidate.isNotEmpty(orderId)) { String orderCreatedMsg = "Order created successfully with ID (" + orderId + ") & eBay Order ID associated with this order is (" + externalId + ")."; orderImportSuccessMessageList.add(orderCreatedMsg); @@ -1224,7 +1224,7 @@ public class EbayOrderServices { } return ServiceUtil.returnSuccess(); } - + // Made some changes transactionId removed. private static GenericValue externalOrderExists(Delegator delegator, String externalId) throws GenericEntityException { Debug.logInfo("Checking for existing externalId: " + externalId, module); @@ -1235,7 +1235,7 @@ public class EbayOrderServices { } return orderHeader; } - + private static void addItem(ShoppingCart cart, Map orderItem, LocalDispatcher dispatcher, Delegator delegator, int groupIdx) throws GeneralException { String productId = (String) orderItem.get("productId"); GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false); @@ -1250,7 +1250,7 @@ public class EbayOrderServices { } BigDecimal price = new BigDecimal(itemPrice); price = price.setScale(ShoppingCart.scale, ShoppingCart.rounding); - + HashMap attrs = new HashMap(); attrs.put("shipGroup", groupIdx); diff --git a/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java b/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java index 1ae56a2715..78e6ec15e3 100755 --- a/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java +++ b/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java @@ -162,7 +162,7 @@ public class ImportOrdersFromEbay { } Map eBayConfigResult = EbayHelper.buildEbayConfig(context, delegator); - + StringBuffer completeSaleXml = new StringBuffer(); if (!ServiceUtil.isFailure(buildCompleteSaleRequest(delegator, locale, externalId, transactionId, context, completeSaleXml, eBayConfigResult.get("token").toString()))) { @@ -357,7 +357,7 @@ public class ImportOrdersFromEbay { String itemId = ""; Element transactionElement = (Element) transactionElemIter.next(); - List containingOrders = UtilXml.childElementList(transactionElement, "ContainingOrder"); + List containingOrders = UtilXml.childElementList(transactionElement, "ContainingOrder"); if (UtilValidate.isNotEmpty(containingOrders)) { continue; } diff --git a/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java b/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java index 198b52d8ef..7a0b35212f 100755 --- a/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java +++ b/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java @@ -63,7 +63,7 @@ public class ProductsExportToEbay { private static final String module = ProductsExportToEbay.class.getName(); private static List productExportSuccessMessageList = FastList.newInstance(); private static List productExportFailureMessageList = FastList.newInstance(); - + public static Map exportToEbay(DispatchContext dctx, Map context) { Locale locale = (Locale) context.get("locale"); @@ -101,7 +101,7 @@ public class ProductsExportToEbay { return ServiceUtil.returnFailure(ServiceUtil.getErrorMessage(resultMap)); } } - } + } } catch (Exception e) { Debug.logError("Exception in exportToEbay " + e, module); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionInExportToEbay", locale)); @@ -216,18 +216,18 @@ public class ProductsExportToEbay { if (UtilValidate.isNotEmpty(startPriceValue)) { startPrice = startPriceValue.getString("price"); startPriceCurrencyUomId = startPriceValue.getString("currencyUomId"); - } + } } - - // Buy it now is the optional value for a product that you send to eBay. Once this value is entered by user - this option allow user to win auction immediately. + + // Buy it now is the optional value for a product that you send to eBay. Once this value is entered by user - this option allow user to win auction immediately. GenericValue buyItNowPriceValue = EntityUtil.getFirst(EntityUtil.filterByDate(prod.getRelatedByAnd("ProductPrice", UtilMisc.toMap("productPricePurposeId", "EBAY", "productPriceTypeId", "MAXIMUM_PRICE")))); String buyItNowPrice = null; String buyItNowCurrencyUomId = null; if (UtilValidate.isNotEmpty(buyItNowPriceValue)) { buyItNowPrice = buyItNowPriceValue.getString("price"); buyItNowCurrencyUomId = buyItNowPriceValue.getString("currencyUomId"); - } - + } + Element itemElem = UtilXml.addChildElement(itemRequestElem, "Item", itemDocument); UtilXml.addChildElementValue(itemElem, "Country", (String)context.get("country"), itemDocument); String location = (String)context.get("location"); @@ -288,15 +288,15 @@ public class ProductsExportToEbay { startPriceCurrencyUomId = UtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD"); } startPriceElem.setAttribute("currencyID", startPriceCurrencyUomId); - + if (UtilValidate.isNotEmpty(buyItNowPrice)) { Element buyNowPriceElem = UtilXml.addChildElementValue(itemElem, "BuyItNowPrice", buyItNowPrice, itemDocument); if (UtilValidate.isEmpty(buyItNowCurrencyUomId)) { buyItNowCurrencyUomId = UtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD"); } buyNowPriceElem.setAttribute("currencyID", buyItNowCurrencyUomId); - } - //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(itemDocument), module); + } + //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(itemDocument), module); dataItemsXml.append(UtilXml.writeXmlDocument(itemDocument)); } catch (Exception e) { Debug.logError("Exception during building data items to eBay: " + e.getMessage(), module); @@ -464,7 +464,7 @@ public class ProductsExportToEbay { if (UtilValidate.isNotEmpty(customXmlFromUI)) { customXml = customXmlFromUI; } else { - customXml = UtilProperties.getPropertyValue(configFileName, "eBayExport.customXml"); + customXml = UtilProperties.getPropertyValue(configFileName, "eBayExport.customXml"); } if (UtilValidate.isNotEmpty(customXml)) { Document customXmlDoc = UtilXml.readXmlDocument(customXml); @@ -478,7 +478,7 @@ public class ProductsExportToEbay { } } } - + public static Map getEbayCategories(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); Locale locale = (Locale) context.get("locale"); @@ -565,7 +565,7 @@ public class ProductsExportToEbay { } return results; } - + private static Map exportToEbayResponse(String msg, GenericValue product) { Map result = ServiceUtil.returnSuccess(); try { diff --git a/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java b/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java index 5dac72b593..32dbca9946 100644 --- a/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java +++ b/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java @@ -405,7 +405,7 @@ public class ProductsExportToGoogle { Element batchElem = UtilXml.addChildElementNSElement(entryElem, "batch:operation", feedDocument, googleBaseBatchUrl); Element batchOperationElem = UtilXml.firstChildElement(batchElem, "batch:operation"); batchOperationElem.setAttribute("type", itemActionType); - + Element appControlElem = UtilXml.addChildElementNSElement(entryElem, "app:control", feedDocument, googleBaseAppUrl); Element appControlChildElem = UtilXml.firstChildElement(appControlElem, "app:control"); // Add the publishing priority for the product. By default it takes about 24 hours to publish your product if you submit data from Data Feed. By adding publishing priority your data @@ -437,12 +437,12 @@ public class ProductsExportToGoogle { linkElem.setAttribute("rel", "alternate"); linkElem.setAttribute("type", "text/html"); linkElem.setAttribute("href", link); - + // item_type is the categories in which your product should belong. UtilXml.addChildElementNSValue(entryElem, "g:item_type", "products", feedDocument, googleBaseNSUrl); - + List productCategoryMembers = delegator.findList("ProductCategoryMember", EntityCondition.makeCondition("productId", EntityOperator.EQUALS, prod.getString("productId")), null, UtilMisc.toList("productCategoryId"), null, false); - + Iterator productCategoryMembersIter = productCategoryMembers.iterator(); while (productCategoryMembersIter.hasNext()) { GenericValue productCategoryMember = (GenericValue) productCategoryMembersIter.next(); @@ -451,7 +451,7 @@ public class ProductsExportToGoogle { if (UtilValidate.isNotEmpty(productCategoryTypeId) && "GOOGLE_BASE_CATEGORY".equals(productCategoryTypeId)) { String categoryDescription = ""; if (UtilValidate.isNotEmpty(productCategory.getString("categoryName"))) { - categoryDescription = productCategory.getString("categoryName"); + categoryDescription = productCategory.getString("categoryName"); } else if (UtilValidate.isNotEmpty(productCategory.getString("description"))) { categoryDescription = productCategory.getString("description"); } else if (UtilValidate.isNotEmpty(productCategory.getString("longDescription"))) { @@ -462,7 +462,7 @@ public class ProductsExportToGoogle { } } } - + UtilXml.addChildElementNSValue(entryElem, "g:price", price, feedDocument, googleBaseNSUrl); // Might be nicer to load this from the product but for now we'll set it based on the country destination @@ -470,7 +470,7 @@ public class ProductsExportToGoogle { // Ensure the load goes to the correct country location either US dollar, GB sterling or DE euro UtilXml.addChildElementNSValue(entryElem, "g:target_country", countryCode, feedDocument, googleBaseNSUrl); - if (UtilValidate.isNotEmpty(prod.getString("brandName"))) { + if (UtilValidate.isNotEmpty(prod.getString("brandName"))) { UtilXml.addChildElementNSValue(entryElem, "g:brand", prod.getString("brandName"), feedDocument, googleBaseNSUrl); } try { @@ -591,11 +591,11 @@ public class ProductsExportToGoogle { } return ServiceUtil.returnSuccess(); } - + private static Map buildGoogleBaseConfig(Map context, Delegator delegator) { String productStoreId = (String) context.get("productStoreId"); Map buildGoogleBaseConfigContext = FastMap.newInstance(); - + if (UtilValidate.isNotEmpty(productStoreId)) { GenericValue googleBaseConfig = null; try { @@ -619,5 +619,5 @@ public class ProductsExportToGoogle { buildGoogleBaseConfigContext.put("postItemsUrl", UtilProperties.getPropertyValue(configString, "googleBaseExport.postItemsUrl")); } return buildGoogleBaseConfigContext; - } + } } \ No newline at end of file diff --git a/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java b/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java index 7bd1420a6f..ecfe38d7c9 100644 --- a/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java +++ b/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java @@ -63,8 +63,8 @@ import com.google.checkout.notification.StructuredName; public class GoogleCheckoutHelper { - private static final String module = GoogleCheckoutHelper.class.getName(); - + private static final String module = GoogleCheckoutHelper.class.getName(); + public static final String SALES_CHANNEL = "GC_SALES_CHANNEL"; public static final String ORDER_TYPE = "SALES_ORDER"; public static final String PAYMENT_METHOD = "EXT_GOOGLE_CHECKOUT"; @@ -79,7 +79,7 @@ public class GoogleCheckoutHelper { public GoogleCheckoutHelper(LocalDispatcher dispatcher, Delegator delegator) { this.dispatcher = dispatcher; this.delegator = delegator; - + try { system = delegator.findOne("UserLogin", true, "userLoginId", "system"); } catch (GenericEntityException e) { @@ -100,10 +100,10 @@ public class GoogleCheckoutHelper { } catch (GenericEntityException e) { Debug.logError(e, module); } - + if (order != null) { String orderId = order.getString("orderId"); - + // check for a financial state change FinancialOrderState oldFin = info.getPreviousFinancialOrderState(); FinancialOrderState newFin = info.getNewFinancialOrderState(); @@ -115,7 +115,7 @@ public class GoogleCheckoutHelper { OrderChangeHelper.cancelOrder(dispatcher, system, orderId); } } else if (newFin.equals(FinancialOrderState.CHARGEABLE) && oldFin.equals(FinancialOrderState.REVIEWING)) { - // approve the order + // approve the order if (!"ORDER_APPROVED".equals(order.getString("statusId"))) { OrderChangeHelper.approveOrder(dispatcher, system, orderId, hasHoldOrderNotes(orderId)); } @@ -127,15 +127,15 @@ public class GoogleCheckoutHelper { } // TODO: look at how to implement the other state changes // CHARGED, CHARGING - } - } + } + } } - + public void processRiskNotification(RiskInformationNotification info) throws GeneralException { // TODO implement me (if desired) return; // the notification will be accepted } - + public void processAuthNotification(AuthorizationAmountNotification info) throws GeneralException { String externalId = info.getGoogleOrderNumber(); List orders = null; @@ -229,7 +229,7 @@ public class GoogleCheckoutHelper { // TODO: implement me (if desired) return; // the notification will be accepted } - + @SuppressWarnings("unchecked") public void createOrder(NewOrderNotification info, String productStoreId, Locale locale) throws GeneralException { // get the google order number @@ -248,18 +248,18 @@ public class GoogleCheckoutHelper { if (googleCfg == null) { throw new GeneralException("No google configuration found for product store : " + productStoreId); } - + String websiteId = googleCfg.getString("webSiteId"); String currencyUom = googleCfg.getString("currencyUomId"); String prodCatalogId = googleCfg.getString("prodCatalogId"); - boolean errorOnUnknownItem = googleCfg.get("errorOnBadItem") != null && + boolean errorOnUnknownItem = googleCfg.get("errorOnBadItem") != null && "Y".equalsIgnoreCase(googleCfg.getString("errorOnBadItem")) ? true : false; - + // Initialize the shopping cart - ShoppingCart cart = new ShoppingCart(delegator, productStoreId, websiteId, locale, currencyUom); + ShoppingCart cart = new ShoppingCart(delegator, productStoreId, websiteId, locale, currencyUom); cart.setUserLogin(system, dispatcher); cart.setOrderType(ORDER_TYPE); - cart.setChannelType(SALES_CHANNEL); + cart.setChannelType(SALES_CHANNEL); //cart.setOrderDate(UtilDateTime.toTimestamp(info.getTimestamp().())); cart.setExternalId(externalId); @@ -304,9 +304,9 @@ public class GoogleCheckoutHelper { for (Item item : items) { try { addItem(cart, item, prodCatalogId, 0); - } catch (ItemNotFoundException e) { + } catch (ItemNotFoundException e) { Debug.logWarning(e, "Item was not found : " + item.getMerchantItemId(), module); - // throwing this exception tell google the order failed; it will continue to retry + // throwing this exception tell google the order failed; it will continue to retry if (errorOnUnknownItem) { throw new GeneralException("Invalid item requested from Google Checkout - " + item.getMerchantItemId()); } @@ -321,7 +321,7 @@ public class GoogleCheckoutHelper { Shipping shipping = info.getOrderAdjustment().getShipping(); addShipInfo(cart, shipping, partyInfo[1]); } - + // set the cart payment method cart.addPaymentAmount(PAYMENT_METHOD, new BigDecimal(info.getOrderTotal())); @@ -338,13 +338,13 @@ public class GoogleCheckoutHelper { if (ServiceUtil.isError(createResp)) { throw new GeneralException(ServiceUtil.getErrorMessage(createResp)); } - + // notify google of our order number try { dispatcher.runAsync("sendGoogleOrderNumberRequest", UtilMisc.toMap("orderId", orderId), true); } catch (GeneralException e) { Debug.logError(e, module); - } + } } protected void addItem(ShoppingCart cart, Item item, String prodCatalogId, int groupIdx) throws GeneralException { @@ -352,7 +352,7 @@ public class GoogleCheckoutHelper { BigDecimal qty = new BigDecimal(item.getQuantity()); BigDecimal price = new BigDecimal(item.getUnitPriceAmount()); price = price.setScale(ShoppingCart.scale, ShoppingCart.rounding); - + HashMap attrs = new HashMap(); attrs.put("shipGroup", groupIdx); @@ -375,7 +375,7 @@ public class GoogleCheckoutHelper { // assign the item to its ship group cart.setItemShipGroupQty(cartItem, qty, groupIdx); } - + @SuppressWarnings("unchecked") protected void addAdjustments(ShoppingCart cart, OrderAdjustment adjustment) { // handle shipping @@ -400,16 +400,16 @@ public class GoogleCheckoutHelper { promoAdj.set("orderAdjustmentTypeId", "PROMOTION_ADJUSTMENT"); promoAdj.set("description", "Promotion Code: " + codes.getCode()); promoAdj.set("comments", "Google Promotion: " + codes.getMessage()); - promoAdj.set("amount", new BigDecimal(-1 * (codes.getAppliedAmount()))); // multiply by -1 + promoAdj.set("amount", new BigDecimal(-1 * (codes.getAppliedAmount()))); // multiply by -1 cart.addAdjustment(promoAdj); } } - protected void addShipInfo(ShoppingCart cart, Shipping shipping, String shipContactMechId) { - String shippingName = shipping.getShippingName(); - GenericValue googleShipping = null; + protected void addShipInfo(ShoppingCart cart, Shipping shipping, String shipContactMechId) { + String shippingName = shipping.getShippingName(); + GenericValue googleShipping = null; try { - googleShipping = delegator.findOne("GoogleCoShippingMethod", UtilMisc.toMap("shipmentMethodName", shippingName, + googleShipping = delegator.findOne("GoogleCoShippingMethod", UtilMisc.toMap("shipmentMethodName", shippingName, "productStoreId", cart.getProductStoreId()), false); } catch (GenericEntityException e) { Debug.logError(e, module); @@ -417,8 +417,8 @@ public class GoogleCheckoutHelper { if (googleShipping != null) { String shipmentMethodTypeId = googleShipping.getString("shipmentMethodTypeId"); String carrierPartyId = googleShipping.getString("carrierPartyId"); - Boolean maySplit = Boolean.FALSE; - + Boolean maySplit = Boolean.FALSE; + cart.setShipmentMethodTypeId(shipmentMethodTypeId); cart.setCarrierPartyId(carrierPartyId); cart.setMaySplit(maySplit); @@ -432,26 +432,26 @@ public class GoogleCheckoutHelper { String shipCmId = null; String billCmId = null; String partyId = null; - + // look for an existing shipping address - List shipInfo = PartyWorker.findMatchingPartyAndPostalAddress(delegator, shipAddr.getAddress1(), - (UtilValidate.isEmpty(shipAddr.getAddress2()) ? null : shipAddr.getAddress2()), shipAddr.getCity(), shipAddr.getRegion(), - shipAddr.getPostalCode(), null, getCountryGeoId(shipAddr.getCountryCode()), shipAddr.getStructuredName().getFirstName(), + List shipInfo = PartyWorker.findMatchingPartyAndPostalAddress(delegator, shipAddr.getAddress1(), + (UtilValidate.isEmpty(shipAddr.getAddress2()) ? null : shipAddr.getAddress2()), shipAddr.getCity(), shipAddr.getRegion(), + shipAddr.getPostalCode(), null, getCountryGeoId(shipAddr.getCountryCode()), shipAddr.getStructuredName().getFirstName(), null, shipAddr.getStructuredName().getLastName()); - + if (UtilValidate.isNotEmpty(shipInfo)) { GenericValue first = EntityUtil.getFirst(shipInfo); shipCmId = first.getString("contactMechId"); partyId = first.getString("partyId"); Debug.logInfo("Existing shipping address found : " + shipCmId + " (party: " + partyId + ")", module); } - + // look for an existing billing address - List billInfo = PartyWorker.findMatchingPartyAndPostalAddress(delegator, billAddr.getAddress1(), - (UtilValidate.isEmpty(billAddr.getAddress2()) ? null : billAddr.getAddress2()), billAddr.getCity(), billAddr.getRegion(), - billAddr.getPostalCode(), null, getCountryGeoId(billAddr.getCountryCode()), billAddr.getStructuredName().getFirstName(), + List billInfo = PartyWorker.findMatchingPartyAndPostalAddress(delegator, billAddr.getAddress1(), + (UtilValidate.isEmpty(billAddr.getAddress2()) ? null : billAddr.getAddress2()), billAddr.getCity(), billAddr.getRegion(), + billAddr.getPostalCode(), null, getCountryGeoId(billAddr.getCountryCode()), billAddr.getStructuredName().getFirstName(), null, billAddr.getStructuredName().getLastName()); - + if (UtilValidate.isNotEmpty(billInfo)) { GenericValue first = EntityUtil.getFirst(billInfo); billCmId = first.getString("contactMechId"); @@ -481,11 +481,11 @@ public class GoogleCheckoutHelper { // create the billing address if necessary if (billCmId == null) { // check the billing address again (in case it was just created) - billInfo = PartyWorker.findMatchingPartyAndPostalAddress(delegator, billAddr.getAddress1(), - billAddr.getAddress2(), billAddr.getCity(), billAddr.getRegion(), - billAddr.getPostalCode(), null, getCountryGeoId(billAddr.getCountryCode()), billAddr.getStructuredName().getFirstName(), + billInfo = PartyWorker.findMatchingPartyAndPostalAddress(delegator, billAddr.getAddress1(), + billAddr.getAddress2(), billAddr.getCity(), billAddr.getRegion(), + billAddr.getPostalCode(), null, getCountryGeoId(billAddr.getCountryCode()), billAddr.getStructuredName().getFirstName(), null, billAddr.getStructuredName().getLastName()); - + if (UtilValidate.isNotEmpty(billInfo)) { GenericValue first = EntityUtil.getFirst(billInfo); billCmId = first.getString("contactMechId"); @@ -509,11 +509,11 @@ public class GoogleCheckoutHelper { throw new GeneralException("Unable to create new customer account: " + ServiceUtil.getErrorMessage(personResp)); } String partyId = (String) personResp.get("partyId"); - + Debug.logInfo("New party created : " + partyId, module); return partyId; } - + protected String createPartyAddress(String partyId, Address addr) throws GeneralException { // check for zip+4 String postalCode = addr.getPostalCode(); @@ -538,7 +538,7 @@ public class GoogleCheckoutHelper { addrMap.put("allowSolicitation", "Y"); addrMap.put("contactMechPurposeTypeId", "GENERAL_LOCATION"); addrMap.put("userLogin", system); // run as the system user - + // invoke the create address service Map addrResp = dispatcher.runSync("createPartyPostalAddress", addrMap); if (ServiceUtil.isError(addrResp)) { @@ -546,33 +546,33 @@ public class GoogleCheckoutHelper { ServiceUtil.getErrorMessage(addrResp)); } String contactMechId = (String) addrResp.get("contactMechId"); - + Debug.logInfo("Created new address for partyId [" + partyId + "] :" + contactMechId, module); return contactMechId; } - + protected void addPurposeToAddress(String partyId, String contactMechId, int addrType) throws GeneralException { // convert the int to a purpose type ID String contactMechPurposeTypeId = getAddressType(addrType); - + // check to make sure the purpose doesn't already exist - List values = delegator.findByAnd("PartyContactMechPurpose", UtilMisc.toMap("partyId", partyId, + List values = delegator.findByAnd("PartyContactMechPurpose", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId)); - + if (UtilValidate.isEmpty(values)) { Map addPurposeMap = FastMap.newInstance(); addPurposeMap.put("contactMechId", contactMechId); - addPurposeMap.put("partyId", partyId); + addPurposeMap.put("partyId", partyId); addPurposeMap.put("contactMechPurposeTypeId", contactMechPurposeTypeId); addPurposeMap.put("userLogin", system); - + Map addPurposeResp = dispatcher.runSync("createPartyContactMechPurpose", addPurposeMap); if (addPurposeResp != null && ServiceUtil.isError(addPurposeResp)) { throw new GeneralException(ServiceUtil.getErrorMessage(addPurposeResp)); } } } - + protected String getAddressType(int addrType) { String contactMechPurposeTypeId = "GENERAL_LOCATION"; switch (addrType) { @@ -585,7 +585,7 @@ public class GoogleCheckoutHelper { } return contactMechPurposeTypeId; } - + protected void setContactInfo(ShoppingCart cart, String contactMechPurposeTypeId, String infoString) throws GeneralException { Map lookupMap = FastMap.newInstance(); String cmId = null; @@ -650,7 +650,7 @@ public class GoogleCheckoutHelper { cart.addContactMech(contactMechPurposeTypeId, cmId); } } - + protected String getCountryGeoId(String geoCode) { if (geoCode != null && geoCode.length() == 3) { return geoCode; @@ -667,12 +667,12 @@ public class GoogleCheckoutHelper { return "_NA_"; } } - + protected boolean hasHoldOrderNotes(String orderId) { EntityCondition idCond = EntityCondition.makeCondition("orderId", EntityOperator.EQUALS, orderId); EntityCondition content = EntityCondition.makeCondition("noteInfo", EntityOperator.LIKE, "%Order is held%"); EntityCondition mainCond = EntityCondition.makeCondition(UtilMisc.toList(idCond, content), EntityOperator.AND); - List holdOrderNotes = null; + List holdOrderNotes = null; try { holdOrderNotes = delegator.findList("OrderHeaderNoteView", mainCond, null, null, null, false); } catch (GenericEntityException e) { diff --git a/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutResponseEvents.java b/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutResponseEvents.java index beeffd95fb..f991156319 100644 --- a/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutResponseEvents.java +++ b/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutResponseEvents.java @@ -47,13 +47,13 @@ public class GoogleCheckoutResponseEvents { public static String checkNotification(HttpServletRequest request, HttpServletResponse response) { LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); Delegator delegator = (Delegator) request.getAttribute("delegator"); - + GoogleCheckoutHelper helper = new GoogleCheckoutHelper(dispatcher, delegator); - + // check and parse the document Document document = null; try { - document = Utils.newDocumentFromInputStream(request.getInputStream()); + document = Utils.newDocumentFromInputStream(request.getInputStream()); } catch (CheckoutException e) { Debug.logError(e, module); sendResponse(response, null, e); @@ -61,13 +61,13 @@ public class GoogleCheckoutResponseEvents { Debug.logError(e, module); sendResponse(response, null, e); } - - // check the document type and process + + // check the document type and process if (document != null) { String nodeValue = document.getDocumentElement().getNodeName(); if ("new-order-notification".equals(nodeValue)) { // handle create new order - NewOrderNotification info = new NewOrderNotification(document); + NewOrderNotification info = new NewOrderNotification(document); String serialNumber = info.getSerialNumber(); try { helper.createOrder(info, ProductStoreWorker.getProductStoreId(request), ProductStoreWorker.getStoreLocale(request)); @@ -93,7 +93,7 @@ public class GoogleCheckoutResponseEvents { String serialNumber = info.getSerialNumber(); try { helper.processRiskNotification(info); - sendResponse(response, serialNumber, null); + sendResponse(response, serialNumber, null); } catch (GeneralException e) { Debug.logError(e, module); sendResponse(response, serialNumber, e); @@ -104,53 +104,53 @@ public class GoogleCheckoutResponseEvents { String serialNumber = info.getSerialNumber(); try { helper.processAuthNotification(info); - sendResponse(response, serialNumber, null); + sendResponse(response, serialNumber, null); } catch (GeneralException e) { Debug.logError(e, module); sendResponse(response, serialNumber, e); return null; - } + } } else if ("charge-amount-notification".equals(nodeValue)) { ChargeAmountNotification info = new ChargeAmountNotification(document); String serialNumber = info.getSerialNumber(); try { helper.processChargeNotification(info); - sendResponse(response, serialNumber, null); + sendResponse(response, serialNumber, null); } catch (GeneralException e) { Debug.logError(e, module); sendResponse(response, serialNumber, e); return null; - } + } } else if ("chargeback-amount-notification".equals(nodeValue)) { ChargebackAmountNotification info = new ChargebackAmountNotification(document); String serialNumber = info.getSerialNumber(); try { helper.processChargeBackNotification(info); - sendResponse(response, serialNumber, null); + sendResponse(response, serialNumber, null); } catch (GeneralException e) { Debug.logError(e, module); sendResponse(response, serialNumber, e); return null; - } + } } else if ("refund-amount-notification".equals(nodeValue)) { RefundAmountNotification info = new RefundAmountNotification(document); String serialNumber = info.getSerialNumber(); try { helper.processRefundNotification(info); - sendResponse(response, serialNumber, null); + sendResponse(response, serialNumber, null); } catch (GeneralException e) { Debug.logError(e, module); sendResponse(response, serialNumber, e); return null; - } + } } else { Debug.logWarning("Unsupported document type submitted by Google; [" + nodeValue + "] has not yet been implemented.", module); } } - + return null; } - + private static void sendResponse(HttpServletResponse response, String serialNumber, Exception error) { if (error != null) { try { @@ -170,5 +170,5 @@ public class GoogleCheckoutResponseEvents { out.close(); } } - } + } } diff --git a/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java b/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java index 731eeb2f84..b296e39bd4 100644 --- a/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java +++ b/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java @@ -61,13 +61,13 @@ import com.google.checkout.orderprocessing.lineitem.ReturnItemsRequest; import com.google.checkout.orderprocessing.lineitem.ShipItemsRequest; public class GoogleRequestServices { - + private static final String module = GoogleRequestServices.class.getName(); private static int decimals = UtilNumber.getBigDecimalScale("invoice.decimals"); private static int rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding"); - + @SuppressWarnings("unchecked") - public static Map sendShoppingCartRequest(DispatchContext dctx, Map context) { + public static Map sendShoppingCartRequest(DispatchContext dctx, Map context) { ShoppingCart cart = (ShoppingCart) context.get("shoppingCart"); String productStoreId = cart.getProductStoreId(); Delegator delegator = dctx.getDelegator(); @@ -77,7 +77,7 @@ public class GoogleRequestServices { Debug.logError("Invalid Google Chechout Merchant settings, check your configuration!", module); return ServiceUtil.returnError("Google checkout configuration error"); } - + // the checkout request object CheckoutShoppingCartRequest req = new CheckoutShoppingCartRequest(mInfo, 300); String requestAuthStr = googleCfg.getString("requestAuthDetails"); @@ -86,46 +86,46 @@ public class GoogleRequestServices { } boolean requestAuth = "Y".equalsIgnoreCase(requestAuthStr) ? true : false; req.setRequestInitialAuthDetails(requestAuth); // send the auth notification - + String sendPromoItemStr = googleCfg.getString("sendPromoItems"); if (sendPromoItemStr == null) { sendPromoItemStr = "Y"; } boolean sendPromoItems = "Y".equalsIgnoreCase(sendPromoItemStr) ? true : false; - + // add the items List items = cart.items(); - for (ShoppingCartItem item : items) { + for (ShoppingCartItem item : items) { if (!item.getIsPromo() || sendPromoItems) { - Item i = new Item(); + Item i = new Item(); i.setItemName(item.getName()); i.setItemDescription(item.getDescription()); i.setMerchantItemId(item.getProductId()); i.setQuantity(item.getQuantity().intValue()); i.setUnitPriceAmount(item.getBasePrice().floatValue()); - i.setUnitPriceCurrency(cart.getCurrency()); - //i.setItemWeight(item.getWeight().floatValue()); // must convert weight to Lb + i.setUnitPriceCurrency(cart.getCurrency()); + //i.setItemWeight(item.getWeight().floatValue()); // must convert weight to Lb if (!item.taxApplies()) { i.setTaxTableSelector("tax_exempt"); } req.addItem(i); } } - + // flow support URLs String contShoppingUrl = UtilProperties.getPropertyValue("googleCheckout.properties", "continueShoppingUrl"); String editCartUrl = UtilProperties.getPropertyValue("googleCheckout.properties", "editCartUrl"); req.setContinueShoppingUrl(contShoppingUrl); req.setEditCartUrl(editCartUrl); - + // setup exempt tax support TaxArea exemptArea = new TaxArea(); exemptArea.addWorldArea(); req.addAlternateTaxRule("tax_exempt", true, 0, exemptArea); - + // setup default tax table // TODO: implement this; for now use the tax table in Google Checkout Settings - + // setup shipping options support List shippingOptions = null; try { @@ -142,13 +142,13 @@ public class GoogleRequestServices { } if ("GOOGLE_FLAT_RATE".equals(option.getString("methodTypeEnumId"))) { req.addFlatRateShippingMethod(shippingName, amount.floatValue()); - } else if ("GOOGLE_MERCHANT_CALC".equals(option.getString("methodTypeEnumId"))) { + } else if ("GOOGLE_MERCHANT_CALC".equals(option.getString("methodTypeEnumId"))) { req.addMerchantCalculatedShippingMethod(shippingName, amount.floatValue()); } else if ("GOOGLE_PICKUP".equals(option.getString("methodTypeEnumId"))) { - req.addPickupShippingMethod(shippingName, amount.floatValue()); + req.addPickupShippingMethod(shippingName, amount.floatValue()); } else if ("GOOGLE_CARRIER_CALC".equals(option.getString("methodTypeEnumId"))) { String carrierPartyId = option.getString("carrierPartyId"); - + Double additionalAmount = option.getDouble("additionalAmount"); Double additionalPercent = option.getDouble("additionalPercent"); if (additionalAmount == null) { @@ -157,12 +157,12 @@ public class GoogleRequestServices { if (additionalPercent == null) { additionalPercent = 0.0; } - + String shippingCompany = null; if ("ups".equalsIgnoreCase(carrierPartyId)) { shippingCompany = "UPS"; } else if ("fedex".equalsIgnoreCase(carrierPartyId)) { - shippingCompany = "FedEx"; + shippingCompany = "FedEx"; } else if ("usps".equalsIgnoreCase(carrierPartyId)) { shippingCompany = "USPS"; } @@ -170,38 +170,38 @@ public class GoogleRequestServices { return ServiceUtil.returnError("Invalid Google Checkout Shipping Configuration! Carriers can only be UPS, FedEx or USPS."); } req.addCarrierCalculatedShippingOption(amount.floatValue(), shippingCompany, CarrierPickup.REGULAR_PICKUP, - shippingName, additionalAmount.floatValue(), additionalPercent.floatValue()); + shippingName, additionalAmount.floatValue(), additionalPercent.floatValue()); } } } - + // merchant stuff String acceptCouponStr = googleCfg.getString("acceptCoupons"); if (acceptCouponStr == null) { acceptCouponStr = "N"; } boolean acceptCoupons = "Y".equalsIgnoreCase(acceptCouponStr) ? true : false; - + String acceptCertStr = googleCfg.getString("acceptGiftCerts"); if (acceptCertStr == null) { acceptCertStr = "N"; } boolean acceptGiftCerts = "Y".equalsIgnoreCase(acceptCertStr) ? true : false; - + if (acceptCoupons || acceptGiftCerts) { - req.setAcceptMerchantCoupons(acceptCoupons); + req.setAcceptMerchantCoupons(acceptCoupons); req.setAcceptMerchantGiftCertificates(acceptGiftCerts); - + // TODO: merchant calc support needs to be implemented if these are ever TRUE } - + String requestPhoneStr = googleCfg.getString("requestPhone"); if (requestPhoneStr == null) { requestPhoneStr = "Y"; } - boolean requestPhone = "Y".equalsIgnoreCase(requestPhoneStr) ? true : false; + boolean requestPhone = "Y".equalsIgnoreCase(requestPhoneStr) ? true : false; req.setRequestBuyerPhoneNumber(requestPhone); - + // send the request CheckoutResponse resp = null; try { @@ -218,12 +218,12 @@ public class GoogleRequestServices { Debug.logError("Error returned from Google: " + resp.getErrorMessage(), module); return ServiceUtil.returnError(resp.getErrorMessage()); } - + Map result = ServiceUtil.returnSuccess(); result.put("redirect", resp.getRedirectUrl()); return result; } - + public static Map sendOrderNumberRequest(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); String orderId = (String) context.get("orderId"); @@ -231,19 +231,19 @@ public class GoogleRequestServices { if (order != null) { MerchantInfo mInfo = getMerchantInfo(delegator, getProductStoreFromOrder(order)); if (mInfo != null) { - String externalId = order.getString("externalId"); + String externalId = order.getString("externalId"); AddMerchantOrderNumberRequest aor = new AddMerchantOrderNumberRequest(mInfo, externalId, orderId); try { aor.send(); } catch (CheckoutException e) { Debug.logError(e, module); - } + } } } - + return ServiceUtil.returnSuccess(); } - + public static Map sendAuthorizeRequest(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); String orderId = (String) context.get("orderId"); @@ -257,13 +257,13 @@ public class GoogleRequestServices { aor.send(); } catch (CheckoutException e) { Debug.logError(e, module); - } + } } } - + return ServiceUtil.returnSuccess(); } - + // trigger on captureOrderPayments public static Map sendChargeRequest(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); @@ -287,14 +287,14 @@ public class GoogleRequestServices { } } } - + return ServiceUtil.returnSuccess(); } - + public static Map sendReturnRequest(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); - String returnId = (String) context.get("returnId"); - + String returnId = (String) context.get("returnId"); + // sort by order Map toRefund = FastMap.newInstance(); Map> toReturn = FastMap.newInstance(); @@ -306,7 +306,7 @@ public class GoogleRequestServices { } catch (GenericEntityException e) { Debug.logError(e, module); } - + // go through the items and sort them by order if (UtilValidate.isNotEmpty(returnItems)) { for (GenericValue returnItem : returnItems) { @@ -345,7 +345,7 @@ public class GoogleRequestServices { } } } - + // create the return items request for (String returnOrderId : toReturn.keySet()) { GenericValue gOrder = findGoogleOrder(delegator, returnOrderId); @@ -366,7 +366,7 @@ public class GoogleRequestServices { } } } - + // create the refund request for (String refundOrderId : toRefund.keySet()) { GenericValue gOrder = findGoogleOrder(delegator, refundOrderId); @@ -378,7 +378,7 @@ public class GoogleRequestServices { String reason = "Item(s) Returned"; if (amount.floatValue() > 0) { try { - RefundOrderRequest ror = new RefundOrderRequest(mInfo, externalId, reason, amount.floatValue(), ""); + RefundOrderRequest ror = new RefundOrderRequest(mInfo, externalId, reason, amount.floatValue(), ""); ror.send(); } catch (CheckoutException e) { Debug.logError(e, module); @@ -390,22 +390,22 @@ public class GoogleRequestServices { } } } - + return ServiceUtil.returnSuccess(); } - + public static Map sendShipRequest(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); - String shipmentId = (String) context.get("shipmentId"); + String shipmentId = (String) context.get("shipmentId"); try { sendItemsShipped(delegator, shipmentId); } catch (GeneralException e) { Debug.logError(e, module); } - + return ServiceUtil.returnSuccess(); } - + public static Map sendOrderCancelRequest(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); String orderId = (String) context.get("orderId"); @@ -413,19 +413,19 @@ public class GoogleRequestServices { if (order != null) { MerchantInfo mInfo = getMerchantInfo(delegator, getProductStoreFromOrder(order)); if (mInfo != null) { - String externalId = order.getString("externalId"); + String externalId = order.getString("externalId"); CancelOrderRequest cor = new CancelOrderRequest(mInfo, externalId, "Order Cancelled", ""); // TODO: configure the reason and comment try { cor.send(); } catch (CheckoutException e) { Debug.logError(e, module); - } + } } } - + return ServiceUtil.returnSuccess(); } - + public static Map sendOrderItemCancelRequest(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); String orderId = (String) context.get("orderId"); @@ -438,25 +438,25 @@ public class GoogleRequestServices { } catch (GenericEntityException e) { Debug.logError(e, module); } - + if (orderItem != null) { MerchantInfo mInfo = getMerchantInfo(delegator, getProductStoreFromOrder(order)); if (mInfo != null) { - String externalId = order.getString("externalId"); + String externalId = order.getString("externalId"); CancelItemsRequest cir = new CancelItemsRequest(mInfo, externalId, "Item Cancelled", ""); // TODO: configure the reason and comment cir.addItem(orderItem.getString("productId")); try { cir.send(); } catch (CheckoutException e) { Debug.logError(e, module); - } + } } } } - + return ServiceUtil.returnSuccess(); } - + public static Map sendArchiveOrderRequest(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); String orderId = (String) context.get("orderId"); @@ -464,7 +464,7 @@ public class GoogleRequestServices { if (order != null) { MerchantInfo mInfo = getMerchantInfo(delegator, getProductStoreFromOrder(order)); if (mInfo != null) { - String externalId = order.getString("externalId"); + String externalId = order.getString("externalId"); ArchiveOrderRequest aor = new ArchiveOrderRequest(mInfo, externalId); try { aor.send(); @@ -473,10 +473,10 @@ public class GoogleRequestServices { } } } - + return ServiceUtil.returnSuccess(); } - + public static Map sendUnarchiveOrderRequest(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); String orderId = (String) context.get("orderId"); @@ -493,10 +493,10 @@ public class GoogleRequestServices { } } } - + return ServiceUtil.returnSuccess(); } - + // special service to tigger off of events which prevent editing orders public static Map catchEditGoogleOrder(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); @@ -506,8 +506,8 @@ public class GoogleRequestServices { Debug.log("Returning FAILURE; this IS an Google Checkout order and cannot be modified as requested!", module); return ServiceUtil.returnFailure("Google Checkout orders cannot be modified. You may cancel orders/items only!"); } - return ServiceUtil.returnSuccess(); - } + return ServiceUtil.returnSuccess(); + } private static void sendItemsShipped(Delegator delegator, String shipmentId) throws GeneralException { List issued = delegator.findByAnd("ItemIssuance", UtilMisc.toMap("shipmentId", shipmentId)); @@ -517,7 +517,7 @@ public class GoogleRequestServices { ShipItemsRequest isr = null; for (GenericValue issue : issued) { GenericValue orderItem = issue.getRelatedOne("OrderItem"); - String shipmentItemSeqId = issue.getString("shipmentItemSeqId"); + String shipmentItemSeqId = issue.getString("shipmentItemSeqId"); String productId = orderItem.getString("productId"); String orderId = issue.getString("orderId"); googleOrder = findGoogleOrder(delegator, orderId); @@ -545,7 +545,7 @@ public class GoogleRequestServices { List srs = packageRoute.getRelated("ShipmentRouteSegment"); GenericValue route = EntityUtil.getFirst(srs); String track = packageRoute.getString("trackingCode"); - if (UtilValidate.isNotEmpty(route)) { + if (UtilValidate.isNotEmpty(route)) { carrier = route.getString("carrierPartyId"); if (UtilValidate.isEmpty(track)) { track = route.getString("trackingIdNumber"); @@ -586,10 +586,10 @@ public class GoogleRequestServices { return order; } } - + return null; } - + public static String getProductStoreFromShipment(Delegator delegator, String shipmentId) { GenericValue shipment = null; try { @@ -603,14 +603,14 @@ public class GoogleRequestServices { } return null; } - + public static String getProductStoreFromOrder(GenericValue order) { if (order != null) { return order.getString("productStoreId"); } return null; } - + public static GenericValue getGoogleConfiguration(Delegator delegator, String productStoreId) { if (productStoreId == null) return null; GenericValue config = null; @@ -621,7 +621,7 @@ public class GoogleRequestServices { } return config; } - + public static MerchantInfo getMerchantInfo(Delegator delegator, String productStoreId) { // google configuration GenericValue config = getGoogleConfiguration(delegator, productStoreId); @@ -629,24 +629,24 @@ public class GoogleRequestServices { Debug.logError("No google configuration found for product store ID : " + productStoreId, module); return null; } - + // merchant information String merchantId = config.getString("merchantId"); String merchantKey = config.getString("merchantKey"); String envEnumId = config.getString("envEnumId"); String currencyCode = config.getString("currencyUomId"); - + if (UtilValidate.isEmpty(merchantId) || UtilValidate.isEmpty(merchantKey)) { return null; } - + // base URLs String productionRoot = UtilProperties.getPropertyValue("google-checkout.properties", "production.root.url"); String sandboxRoot = UtilProperties.getPropertyValue("google-checkout.properties", "sandbox.root.url"); - + // command strings String merchantCheckoutCommand = UtilProperties.getPropertyValue("google-checkout.properties", "merchant.checkout.command", "merchantCheckout"); - String checkoutCommand = UtilProperties.getPropertyValue("google-checkout.properties", "checkout.command", "checkout"); + String checkoutCommand = UtilProperties.getPropertyValue("google-checkout.properties", "checkout.command", "checkout"); String requestCommand = UtilProperties.getPropertyValue("google-checkout.properties", "request.command", "request"); String environment = null; @@ -657,18 +657,18 @@ public class GoogleRequestServices { // build the URLs based on the Environment type if ("GOOGLE_SANDBOX".equals(envEnumId)) { merchantCheckoutUrl = sandboxRoot + "/" + merchantCheckoutCommand + "/Merchant/" + merchantId; - checkoutUrl = sandboxRoot + "/" + checkoutCommand + "/Merchant/" + merchantId; + checkoutUrl = sandboxRoot + "/" + checkoutCommand + "/Merchant/" + merchantId; requestUrl = sandboxRoot + "/" + requestCommand + "/Merchant/" + merchantId; environment = EnvironmentType.Sandbox; } else if ("GOOGLE_PRODUCTION".equals(envEnumId)) { merchantCheckoutUrl = productionRoot + "/" + merchantCheckoutCommand + "/Merchant/" + merchantId; - checkoutUrl = productionRoot + "/" + checkoutCommand + "/Merchant/" + merchantId; + checkoutUrl = productionRoot + "/" + checkoutCommand + "/Merchant/" + merchantId; requestUrl = productionRoot + "/" + requestCommand + "/Merchant/" + merchantId; environment = EnvironmentType.Production; } else { Debug.logError("Environment must be one of " + EnvironmentType.Sandbox + " or " + EnvironmentType.Production + ".", module); return null; } - return new MerchantInfo(merchantId, merchantKey, environment, currencyCode, checkoutUrl, merchantCheckoutUrl, requestUrl); - } + return new MerchantInfo(merchantId, merchantKey, environment, currencyCode, checkoutUrl, merchantCheckoutUrl, requestUrl); + } } diff --git a/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java b/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java index ced15769ee..698f89340f 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java @@ -129,8 +129,8 @@ public class PosTransaction implements Serializable { this.productStoreId = (String) session.getAttribute("productStoreId"); this.facilityId = (String) session.getAttribute("facilityId"); this.currency = (String) session.getAttribute("currency"); -// this.locale = (Locale) session.getAttribute("locale"); This is legacy code and may come (demo) from ProductStore.defaultLocaleString defined in demoRetail and is incompatible with how localisation is handled in the POS - this.locale = Locale.getDefault(); +// this.locale = (Locale) session.getAttribute("locale"); This is legacy code and may come (demo) from ProductStore.defaultLocaleString defined in demoRetail and is incompatible with how localisation is handled in the POS + this.locale = Locale.getDefault(); this.cart = new ShoppingCart(session.getDelegator(), productStoreId, locale, currency); this.ch = new CheckOutHelper(session.getDispatcher(), session.getDelegator(), cart); @@ -168,11 +168,11 @@ public class PosTransaction implements Serializable { public String getUserId() { return session.getUserId(); } - + public String getPartyId() { return partyId; } - + public void setPartyId(String partyId) { this.partyId = partyId; this.cart.setPlacingCustomerPartyId(partyId); @@ -182,7 +182,7 @@ public class PosTransaction implements Serializable { Debug.logError(e, module); } } - + public int getDrawerNumber() { return drawerIdx + 1; } @@ -403,8 +403,8 @@ public class PosTransaction implements Serializable { payInfo.put("cardNumber", cardStr); // masked cardNumber } else if ("GIFT_CARD".equals(paymentMethodTypeId)) { - @SuppressWarnings("unused") - GenericValue gc = null; + @SuppressWarnings("unused") + GenericValue gc = null; try { gc = infValue.getRelatedOne("GiftCard"); //FIXME is this really useful ? (Maybe later...) } catch (GenericEntityException e) { @@ -997,7 +997,7 @@ public class PosTransaction implements Serializable { BigDecimal total = cart.getGrandTotal(); List adjustments = cart.getAdjustments(); BigDecimal itemsAdjustmentsAmount = BigDecimal.ZERO; - + Iterator i = cart.iterator(); while (i.hasNext()) { ShoppingCartItem item = (ShoppingCartItem) i.next(); @@ -1552,19 +1552,19 @@ public class PosTransaction implements Serializable { if (UtilValidate.isNotEmpty(email)) { // ContactMech (email) - dynamicView.addMemberEntity("PM", "PartyContactMechPurpose"); + dynamicView.addMemberEntity("PM", "PartyContactMechPurpose"); dynamicView.addAlias("PM", "contactMechId"); - dynamicView.addAlias("PM", "contactMechPurposeTypeId"); + dynamicView.addAlias("PM", "contactMechPurposeTypeId"); dynamicView.addAlias("PM", "thruDate"); dynamicView.addMemberEntity("CM", "ContactMech"); - dynamicView.addAlias("CM", "infoString"); + dynamicView.addAlias("CM", "infoString"); dynamicView.addViewLink("PT", "PM", Boolean.FALSE, ModelKeyMap.makeKeyMapList("partyId")); dynamicView.addViewLink("PM", "CM", Boolean.FALSE, ModelKeyMap.makeKeyMapList("contactMechId")); } else if (UtilValidate.isNotEmpty(phone)) { - dynamicView.addMemberEntity("PM", "PartyContactMechPurpose"); + dynamicView.addMemberEntity("PM", "PartyContactMechPurpose"); dynamicView.addAlias("PM", "contactMechId"); dynamicView.addAlias("PM", "thruDate"); - dynamicView.addAlias("PM", "contactMechPurposeTypeId"); + dynamicView.addAlias("PM", "contactMechPurposeTypeId"); dynamicView.addMemberEntity("TN", "TelecomNumber"); dynamicView.addAlias("TN", "contactNumber"); dynamicView.addViewLink("PT", "PM", Boolean.FALSE, ModelKeyMap.makeKeyMapList("partyId")); @@ -1597,7 +1597,7 @@ public class PosTransaction implements Serializable { } else { // andExprs.add(EntityCondition.makeCondition("lastName", EntityOperator.LIKE, "%"+name+"%")); // Less restrictive andExprs.add(EntityCondition.makeCondition(EntityFunction.UPPER_FIELD("lastName"), EntityOperator.LIKE, EntityFunction.UPPER("%"+name+"%"))); // Even less restrictive - } + } } if (UtilValidate.isNotEmpty(card)) { andExprs.add(EntityCondition.makeCondition("cardId", EntityOperator.EQUALS, card)); @@ -1611,7 +1611,7 @@ public class PosTransaction implements Serializable { andExprs.add(EntityCondition.makeCondition("contactMechPurposeTypeId", EntityOperator.EQUALS, "PHONE_HOME")); andExprs.add(EntityCondition.makeCondition("thruDate", EntityOperator.EQUALS, null)); } - + mainCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND); orderBy.add("lastName"); @@ -1672,18 +1672,18 @@ public class PosTransaction implements Serializable { } else { // both empty partyMap.put("infoString", ""); partyMap.put("contactNumber", ""); - + } resultList.add(partyMap); } - + if (UtilValidate.isNotEmpty(email)) { resultList = searchContactMechs(delegator, pos, resultList, phone, "TELECOM_NUMBER"); } else if (UtilValidate.isNotEmpty(phone)) { resultList = searchContactMechs(delegator, pos, resultList, "", "EMAIL_ADDRESS"); // "" is more clear than email which is by definition here is empty } else { // both empty resultList = searchContactMechs(delegator, pos, resultList, "", "TELECOM_NUMBER"); // "" is more clear than phone which is by definition here is empty - resultList = searchContactMechs(delegator, pos, resultList, "", "EMAIL_ADDRESS"); + resultList = searchContactMechs(delegator, pos, resultList, "", "EMAIL_ADDRESS"); } } else { resultList = FastList.newInstance(); @@ -1698,7 +1698,7 @@ public class PosTransaction implements Serializable { // we suppose only one phone number (should be ok anyway because of the contactMechPurposeTypeId == "PHONE_HOME") LocalDispatcher dispatcher = session.getDispatcher(); GenericValue userLogin = session.getUserLogin(); - GenericValue partyUserLogin = null; + GenericValue partyUserLogin = null; String result = null; Map svcCtx = FastMap.newInstance(); @@ -1745,12 +1745,12 @@ public class PosTransaction implements Serializable { if (ServiceUtil.isError(svcRes)) { pos.showDialog("dialog/error/exception", ServiceUtil.getErrorMessage(svcRes)); return result; - } + } partyId = (String) svcRes.get("partyId"); partyUserLogin = userLogin; } - if (UtilValidate.isNotEmpty(email)) { + if (UtilValidate.isNotEmpty(email)) { // createPartyEmailAddress trace("createPartyEmailAddress"); svcCtx.clear(); @@ -1773,7 +1773,7 @@ public class PosTransaction implements Serializable { if (UtilValidate.isNotEmpty(phone)) { if (phone.length() < 5 ) { - pos.showDialog("dialog/error/exception", UtilProperties.getMessage(PosTransaction.resource, "PosPhoneField5Required", locale)); + pos.showDialog("dialog/error/exception", UtilProperties.getMessage(PosTransaction.resource, "PosPhoneField5Required", locale)); } else { // createPartyTelecomNumber trace("createPartyTelecomNumber"); @@ -1795,9 +1795,9 @@ public class PosTransaction implements Serializable { } } } - + result = partyId; - + // Update } else if (UtilValidate.isNotEmpty(partyId)){ trace("Update a client profile"); @@ -1810,7 +1810,7 @@ public class PosTransaction implements Serializable { pos.showDialog("dialog/error/exception", e.getMessage()); return null; } - + Boolean newLogin = true; try { List userLogins = session.getDelegator().findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId)); @@ -1833,7 +1833,7 @@ public class PosTransaction implements Serializable { svcCtx.put("lastName", name); if (UtilValidate.isNotEmpty(card)) { svcCtx.put("cardId", card); - } + } try { // updatePerson trace("updatePerson"); @@ -1849,7 +1849,7 @@ public class PosTransaction implements Serializable { } } - + if (UtilValidate.isNotEmpty(phone)) { // Create or update phone if (phone.length() < 5 ) { @@ -1859,11 +1859,11 @@ public class PosTransaction implements Serializable { String contactMechId = null; svcCtx.clear(); svcCtx.put("partyId", partyId); - svcCtx.put("thruDate", null); // last one + svcCtx.put("thruDate", null); // last one try { List PartyTelecomNumbers = session.getDelegator().findByAnd("PartyAndTelecomNumber", svcCtx); if (UtilValidate.isNotEmpty(PartyTelecomNumbers)) { - GenericValue PartyTelecomNumber = PartyTelecomNumbers.get(0); // There is only one phone number (contactMechPurposeTypeId == "PHONE_HOME") + GenericValue PartyTelecomNumber = PartyTelecomNumbers.get(0); // There is only one phone number (contactMechPurposeTypeId == "PHONE_HOME") contactNumber = PartyTelecomNumber.getString("contactNumber"); contactMechId = PartyTelecomNumber.getString("contactMechId"); } @@ -1871,7 +1871,7 @@ public class PosTransaction implements Serializable { Debug.logError(e, module); pos.showDialog("dialog/error/exception", e.getMessage()); return null; - } + } // Create or update phone trace("createUpdatePartyTelecomNumber"); @@ -1893,7 +1893,7 @@ public class PosTransaction implements Serializable { pos.showDialog("dialog/error/exception", ServiceUtil.getErrorMessage(svcRes)); return null; } - + // Handle login aspect where phone is taken as pwd if (UtilValidate.isNotEmpty(contactNumber) && !phone.equals(contactNumber)) { if (!newLogin) { // to create a new login we need also an email address @@ -1904,42 +1904,42 @@ public class PosTransaction implements Serializable { try { passwordAcceptEncryptedAndPlain = UtilProperties.getPropertyValue("security.properties", "password.accept.encrypted.and.plain"); UtilProperties.setPropertyValueInMemory("security.properties", "password.accept.encrypted.and.plain", "true"); - svcRes = dispatcher.runSync("updatePassword", + svcRes = dispatcher.runSync("updatePassword", UtilMisc.toMap("userLogin", userLogin, - "userLoginId", userLogin.getString("userLoginId"), - "currentPassword", userLogin.getString("currentPassword"), - "newPassword", phone, - "newPasswordVerify", phone)); + "userLoginId", userLogin.getString("userLoginId"), + "currentPassword", userLogin.getString("currentPassword"), + "newPassword", phone, + "newPasswordVerify", phone)); } catch (GenericServiceException e) { Debug.logError(e, "Error calling updatePassword service", module); pos.showDialog("dialog/error/exception", e.getMessage()); - UtilProperties.setPropertyValueInMemory("security.properties", "password.accept.encrypted.and.plain", passwordAcceptEncryptedAndPlain); + UtilProperties.setPropertyValueInMemory("security.properties", "password.accept.encrypted.and.plain", passwordAcceptEncryptedAndPlain); return null; } finally { // Put back passwordAcceptEncryptedAndPlain value in memory UtilProperties.setPropertyValueInMemory("security.properties", "password.accept.encrypted.and.plain", passwordAcceptEncryptedAndPlain); - } + } if (ServiceUtil.isError(svcRes)) { pos.showDialog("dialog/error/exception", ServiceUtil.getErrorMessage(svcRes)); return null; } - } + } } } } if (UtilValidate.isNotEmpty(email)) { - // Update email + // Update email svcCtx.clear(); svcCtx.put("partyId", partyId); - svcCtx.put("thruDate", null); // last one - svcCtx.put("contactMechTypeId", "EMAIL_ADDRESS"); + svcCtx.put("thruDate", null); // last one + svcCtx.put("contactMechTypeId", "EMAIL_ADDRESS"); String contactMechId = null; String infoString = null; try { List PartyEmails = session.getDelegator().findByAnd("PartyAndContactMech", svcCtx); if (UtilValidate.isNotEmpty(PartyEmails)) { - GenericValue PartyEmail = PartyEmails.get(0); // There is only one email address (contactMechPurposeTypeId == "PRIMARY_EMAIL") + GenericValue PartyEmail = PartyEmails.get(0); // There is only one email address (contactMechPurposeTypeId == "PRIMARY_EMAIL") contactMechId = PartyEmail.getString("contactMechId"); infoString = PartyEmail.getString("infoString"); } @@ -1950,7 +1950,7 @@ public class PosTransaction implements Serializable { } svcCtx.remove("thruDate"); - svcCtx.remove("contactMechTypeId"); + svcCtx.remove("contactMechTypeId"); svcCtx.put("userLogin", userLogin); svcCtx.put("emailAddress", email); svcCtx.put("contactMechPurposeTypeId", "PRIMARY_EMAIL"); @@ -1959,7 +1959,7 @@ public class PosTransaction implements Serializable { } if (UtilValidate.isNotEmpty(infoString) && !email.equals(infoString) || UtilValidate.isEmpty(infoString)) { - // Create or update email + // Create or update email trace("createUpdatePartyEmailAddress"); try { svcRes = dispatcher.runSync("createUpdatePartyEmailAddress", svcCtx); @@ -1991,14 +1991,14 @@ public class PosTransaction implements Serializable { } } else if (newLogin && UtilValidate.isNotEmpty(phone)) { // createUserLogin - trace("createUserLogin"); + trace("createUserLogin"); try { - svcRes = dispatcher.runSync("createUserLogin", + svcRes = dispatcher.runSync("createUserLogin", UtilMisc.toMap("userLogin", userLogin, - "userLoginId", email, - "currentPassword", phone, + "userLoginId", email, + "currentPassword", phone, "currentPasswordVerify", phone, - "partyId", partyId)); + "partyId", partyId)); } catch (GenericServiceException e) { Debug.logError(e, "Error calling updatePassword service", module); pos.showDialog("dialog/error/exception", e.getMessage()); @@ -2012,7 +2012,7 @@ public class PosTransaction implements Serializable { } } else { pos.showDialog("dialog/error/exception", UtilProperties.getMessage(resource, "PosNoClientProfile", locale)); - return null; + return null; } return null; } diff --git a/specialpurpose/pos/src/org/ofbiz/pos/component/PromoStatusBar.java b/specialpurpose/pos/src/org/ofbiz/pos/component/PromoStatusBar.java index a1d77bae91..2fa38f159b 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/component/PromoStatusBar.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/component/PromoStatusBar.java @@ -79,4 +79,3 @@ public class PromoStatusBar { return statusbarClient; } } - \ No newline at end of file diff --git a/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java b/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java index b8a6903413..89b722bd19 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java @@ -120,7 +120,7 @@ public class Receipt extends GenericDevice implements DialogCallback { } Debug.log("Print Report Requested", module); String[] report = this.readReportTemplate(resource); - + if (report != null) { for (int i = 0; i < report.length; i++) { if (report[i] != null) { diff --git a/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java b/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java index dffe309ce4..6cfccb5c99 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java @@ -377,7 +377,7 @@ public class ManagerEvents { pos.refresh(); } } - + public static synchronized void SwapKeyboard(PosScreen pos) { if (!mgrLoggedIn) { pos.showDialog("dialog/error/mgrnotloggedin"); @@ -387,12 +387,12 @@ public class ManagerEvents { if ("N".equalsIgnoreCase(showKeyboardInSaveSale)) { UtilProperties.setPropertyValueInMemory("parameters.properties", "ShowKeyboardInSaveSale", "Y"); } else { - UtilProperties.setPropertyValueInMemory("parameters.properties", "ShowKeyboardInSaveSale", "N"); + UtilProperties.setPropertyValueInMemory("parameters.properties", "ShowKeyboardInSaveSale", "N"); } } } - - + + public static synchronized void shutdown(PosScreen pos) { if (!mgrLoggedIn) { @@ -483,24 +483,24 @@ public class ManagerEvents { boolean beganTransaction = false; try { beganTransaction = TransactionUtil.begin(); - + Delegator delegator = pos.getSession().getDelegator(); List exprs = UtilMisc.toList(EntityCondition.makeCondition("originFacilityId", EntityOperator.EQUALS, trans.getFacilityId()), EntityCondition.makeCondition("terminalId", EntityOperator.EQUALS, trans.getTerminalId())); EntityListIterator eli = null; - + try { eli = delegator.find("OrderHeaderAndPaymentPref", EntityCondition.makeCondition(exprs, EntityOperator.AND), null, null, null, null); } catch (GenericEntityException e) { Debug.logError(e, module); } - + Timestamp dayStart = state.getTimestamp("openedDate"); Timestamp dayEnd = state.getTimestamp("closedDate"); if (dayEnd == null) { dayEnd = UtilDateTime.nowTimestamp(); } - + if (eli != null) { GenericValue ohpp; while (((ohpp = (GenericValue) eli.next()) != null)) { @@ -508,7 +508,7 @@ public class ManagerEvents { if (orderDate.after(dayStart) && orderDate.before(dayEnd)) { String pmt = ohpp.getString("paymentMethodTypeId"); BigDecimal amt = ohpp.getBigDecimal("maxAmount"); - + if ("CASH".equals(pmt)) { cashTotal = cashTotal.add(amt); } else if ("PERSONAL_CHECK".equals(pmt)) { @@ -523,12 +523,12 @@ public class ManagerEvents { total = total.add(amt); } } - + try { eli.close(); } catch (GenericEntityException e) { Debug.logWarning(e, "Trouble closing ELI", module); - pos.showDialog("dialog/error/exception", e.getMessage()); + pos.showDialog("dialog/error/exception", e.getMessage()); } } } catch (GenericTransactionException e) { @@ -548,7 +548,7 @@ public class ManagerEvents { pos.showDialog("dialog/error/exception", e.getMessage()); } } - + Map reportMap = FastMap.newInstance(); String reportTemplate = "totals.txt"; diff --git a/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java b/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java index c8eccccb8a..9188aad6dd 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/event/PromoEvents.java @@ -60,9 +60,9 @@ public class PromoEvents { } } } - + public static synchronized void clientProfile(PosScreen pos) { PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession()); trans.clientProfile(pos); - } + } } diff --git a/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java b/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java index 430cf6cfdf..196e5887e5 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/screen/ConfigureItem.java @@ -369,7 +369,7 @@ public class ConfigureItem extends XPage { public void buttonClicked() { DefaultListModel listModel = new DefaultListModel(); List options = question.getOptions(); - + for (ConfigOption configoption : options) { listModel.addElement(configoption.getDescription()); //Debug.logInfo("Found option " + configoption.getDescription(), module); diff --git a/specialpurpose/pos/src/org/ofbiz/pos/screen/NumericKeypad.java b/specialpurpose/pos/src/org/ofbiz/pos/screen/NumericKeypad.java index e738e057a1..ef6c6a08df 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/screen/NumericKeypad.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/screen/NumericKeypad.java @@ -44,13 +44,13 @@ public class NumericKeypad extends XPage String originalText; public NumericKeypad(PosScreen pos) { - m_pos = pos; + m_pos = pos; m_pageSupport = pageMgr.loadPage(m_pos.getScreenLocation() + "/dialog/numerickeypad"); m_dialog = (XDialog) m_pageSupport; m_edit = (XEdit) m_pageSupport.findComponent("numeric_input"); m_edit.setText(""); m_dialog.setCaption(UtilProperties.getMessage(PosTransaction.resource, "PosVirtualNumPadTitle", Locale.getDefault())); - + } public String openDlg() { @@ -72,7 +72,7 @@ public class NumericKeypad extends XPage public String getText() { return m_edit.getText(); } - + //call before openDlg public void setMinus(boolean minus) { m_minus = minus; @@ -219,7 +219,7 @@ public class NumericKeypad extends XPage { cancel(); } - + public void triggerMinus() { prependUnique('-'); @@ -312,7 +312,7 @@ public class NumericKeypad extends XPage return; } } - + private synchronized void append(String c) { if (wasMouseClicked()) { String text = ""; diff --git a/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java b/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java index 24cb9b8da1..8e76c910ff 100644 --- a/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java +++ b/specialpurpose/pos/src/org/ofbiz/pos/screen/PosScreen.java @@ -94,7 +94,7 @@ public class PosScreen extends XPage implements Runnable, DialogCallback, FocusL // setup the shared components this.session = XuiContainer.getSession(); - this.output = new Output(this); + this.output = new Output(this); this.input = new InputWithPassword(this); this.journal = new Journal(this); this.operator = new Operator(this);