diff --git a/applications/accounting/build.xml b/applications/accounting/build.xml index 64fad48bfe..f2919f3e64 100644 --- a/applications/accounting/build.xml +++ b/applications/accounting/build.xml @@ -60,7 +60,7 @@ under the License. - + diff --git a/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java b/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java index 3183a17cc4..31f993fb0e 100644 --- a/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java @@ -157,31 +157,31 @@ public class TaxAuthorityServices { GenericValue productStore = null; // Check value productStore *** New if (productStoreId!=null) { - try { - getTaxAuthorities(delegator, shippingAddress, taxAuthoritySet); - 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); - return ServiceUtil.returnError(errMsg); - } + try { + getTaxAuthorities(delegator, shippingAddress, taxAuthoritySet); + 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); + return ServiceUtil.returnError(errMsg); + } - if (productStore == null && payToPartyId == null) { - throw new IllegalArgumentException("Could not find payToPartyId [" + payToPartyId + "] or ProductStore [" + productStoreId + "] for tax calculation"); - } + if (productStore == null && payToPartyId == null) { + throw new IllegalArgumentException("Could not find payToPartyId [" + payToPartyId + "] or ProductStore [" + productStoreId + "] for tax calculation"); + } } else { - try { - 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); - } + try { + 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. diff --git a/applications/accounting/webapp/accounting/invoice/InvoiceItemsPayrol.ftl b/applications/accounting/webapp/accounting/invoice/InvoiceItemsPayrol.ftl index 317b286f10..c8e587a4f7 100644 --- a/applications/accounting/webapp/accounting/invoice/InvoiceItemsPayrol.ftl +++ b/applications/accounting/webapp/accounting/invoice/InvoiceItemsPayrol.ftl @@ -23,13 +23,13 @@ under the License. <#if PayrolGroup?has_content> <#list PayrolGroup as payrolGroup> - - [${payrolGroup.description}] - -   -   -   -   + + [${payrolGroup.description}] + +   +   +   +   @@ -39,21 +39,21 @@ under the License.     - <#if PayrolList?has_content> - <#list PayrolList as payrolList> - <#if payrolList.parentTypeId?if_exists == payrolGroup.invoiceItemTypeId?if_exists> + <#if PayrolList?has_content> + <#list PayrolList as payrolList> + <#if payrolList.parentTypeId?if_exists == payrolGroup.invoiceItemTypeId?if_exists> - - ${payrolList.description} : - - - -   -   + + ${payrolList.description} : + + + +   +   - - - + + + @@ -64,11 +64,11 @@ under the License.   - Add all values : - -   -   -   + Add all values : + +   +   +   diff --git a/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl b/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl index e2f93459cf..8e45726791 100644 --- a/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl +++ b/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl @@ -174,28 +174,28 @@ by hand from a real template using a ruler. <#assign InvoiceItems = invoice.getRelated("InvoiceItem")?if_exists> <#assign PayrolGroups = PayrolGroup?if_exists> <#list PayrolGroups as payrolGroup> - <#assign fontSize = "75%"> - <#assign lineStyle = "dashed"> + <#assign fontSize = "75%"> + <#assign lineStyle = "dashed"> - <#assign sumQuantity = 0> - <#assign sumAmount = 0> - <#assign sumSubTotal = 0> - <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> - <#assign quantity = 0> - <#assign amount = 0> - <#assign subTotal = 0> - <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> - <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> - <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> - <#if amount != 0 && quantity == 0 ><#assign quantity = 1> - <#assign subTotal = quantity * amount> - <#assign sumQuantity = sumQuantity + quantity> - <#assign sumAmount = sumAmount + amount> - <#assign sumSubTotal = sumSubTotal + subTotal> - - - <#if sumSubTotal != 0> + <#assign sumQuantity = 0> + <#assign sumAmount = 0> + <#assign sumSubTotal = 0> + <#list InvoiceItems as invoiceItem> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign quantity = 0> + <#assign amount = 0> + <#assign subTotal = 0> + <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> + <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> + <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> + <#if amount != 0 && quantity == 0 ><#assign quantity = 1> + <#assign subTotal = quantity * amount> + <#assign sumQuantity = sumQuantity + quantity> + <#assign sumAmount = sumAmount + amount> + <#assign sumSubTotal = sumSubTotal + subTotal> + + + <#if sumSubTotal != 0> @@ -208,25 +208,25 @@ by hand from a real template using a ruler. Amount - Sum - + Sum + <#assign sumQuantity = 0> <#assign sumAmount = 0> - <#assign sumSubTotal = 0> - <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> - <#assign subTotal = 0> - <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> - <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> - <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> - <#if amount != 0 && quantity == 0 ><#assign quantity = 1> - <#assign subTotal = quantity * amount> - <#assign sumQuantity = sumQuantity + quantity> - <#assign sumAmount = sumAmount + amount> - <#assign sumSubTotal = sumSubTotal + subTotal> + <#assign sumSubTotal = 0> + <#list InvoiceItems as invoiceItem> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign subTotal = 0> + <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> + <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> + <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> + <#if amount != 0 && quantity == 0 ><#assign quantity = 1> + <#assign subTotal = quantity * amount> + <#assign sumQuantity = sumQuantity + quantity> + <#assign sumAmount = sumAmount + amount> + <#assign sumSubTotal = sumSubTotal + subTotal> ${invoiceItemType.description?if_exists} @@ -234,26 +234,26 @@ by hand from a real template using a ruler. ${amount?if_exists} ${subTotal?if_exists} - - + + - <#assign sumQuantity = 0> + <#assign sumQuantity = 0> <#assign sumAmount = 0> - <#assign sumSubTotal = 0> - <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> - <#assign subTotal = 0> - <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> - <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> - <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> - <#if amount != 0 && quantity == 0><#assign quantity = 1> - <#assign subTotal = quantity * amount> - <#assign sumQuantity = sumQuantity + quantity> - <#assign sumAmount = sumAmount + amount> - <#assign sumSubTotal = sumSubTotal + subTotal> - - - <#if sumSubTotal != 0> + <#assign sumSubTotal = 0> + <#list InvoiceItems as invoiceItem> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign subTotal = 0> + <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> + <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> + <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> + <#if amount != 0 && quantity == 0><#assign quantity = 1> + <#assign subTotal = quantity * amount> + <#assign sumQuantity = sumQuantity + quantity> + <#assign sumAmount = sumAmount + amount> + <#assign sumSubTotal = sumSubTotal + subTotal> + + + <#if sumSubTotal != 0> @@ -264,7 +264,7 @@ by hand from a real template using a ruler. - + @@ -370,28 +370,28 @@ by hand from a real template using a ruler. <#assign InvoiceItems = invoice.getRelated("InvoiceItem")?if_exists> <#assign PayrolGroups = PayrolGroup?if_exists> <#list PayrolGroups as payrolGroup> - <#assign fontSize = "75%"> - <#assign lineStyle = "dashed"> + <#assign fontSize = "75%"> + <#assign lineStyle = "dashed"> - <#assign sumQuantity = 0> - <#assign sumAmount = 0> - <#assign sumSubTotal = 0> - <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> - <#assign quantity = 0> - <#assign amount = 0> - <#assign subTotal = 0> - <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> - <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> - <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> - <#if amount != 0 && quantity == 0 ><#assign quantity = 1> - <#assign subTotal = quantity * amount> - <#assign sumQuantity = sumQuantity + quantity> - <#assign sumAmount = sumAmount + amount> - <#assign sumSubTotal = sumSubTotal + subTotal> - - - <#if sumSubTotal != 0> + <#assign sumQuantity = 0> + <#assign sumAmount = 0> + <#assign sumSubTotal = 0> + <#list InvoiceItems as invoiceItem> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign quantity = 0> + <#assign amount = 0> + <#assign subTotal = 0> + <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> + <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> + <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> + <#if amount != 0 && quantity == 0 ><#assign quantity = 1> + <#assign subTotal = quantity * amount> + <#assign sumQuantity = sumQuantity + quantity> + <#assign sumAmount = sumAmount + amount> + <#assign sumSubTotal = sumSubTotal + subTotal> + + + <#if sumSubTotal != 0> @@ -404,25 +404,25 @@ by hand from a real template using a ruler. Amount - Sum - + Sum + <#assign sumQuantity = 0> <#assign sumAmount = 0> - <#assign sumSubTotal = 0> - <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> - <#assign subTotal = 0> - <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> - <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> - <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> - <#if amount != 0 && quantity == 0 ><#assign quantity = 1> - <#assign subTotal = quantity * amount> - <#assign sumQuantity = sumQuantity + quantity> - <#assign sumAmount = sumAmount + amount> - <#assign sumSubTotal = sumSubTotal + subTotal> + <#assign sumSubTotal = 0> + <#list InvoiceItems as invoiceItem> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign subTotal = 0> + <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> + <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> + <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> + <#if amount != 0 && quantity == 0 ><#assign quantity = 1> + <#assign subTotal = quantity * amount> + <#assign sumQuantity = sumQuantity + quantity> + <#assign sumAmount = sumAmount + amount> + <#assign sumSubTotal = sumSubTotal + subTotal> ${invoiceItemType.description?if_exists} @@ -430,26 +430,26 @@ by hand from a real template using a ruler. ${amount?if_exists} ${subTotal?if_exists} - - + + - <#assign sumQuantity = 0> + <#assign sumQuantity = 0> <#assign sumAmount = 0> - <#assign sumSubTotal = 0> - <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> - <#assign subTotal = 0> - <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> - <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> - <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> - <#if amount != 0 && quantity == 0><#assign quantity = 1> - <#assign subTotal = quantity * amount> - <#assign sumQuantity = sumQuantity + quantity> - <#assign sumAmount = sumAmount + amount> - <#assign sumSubTotal = sumSubTotal + subTotal> - - - <#if sumSubTotal != 0> + <#assign sumSubTotal = 0> + <#list InvoiceItems as invoiceItem> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign subTotal = 0> + <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> + <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> + <#if invoiceItem.amount?has_content><#assign amount = invoiceItem.amount?if_exists><#else><#assign amount = 0> + <#if amount != 0 && quantity == 0><#assign quantity = 1> + <#assign subTotal = quantity * amount> + <#assign sumQuantity = sumQuantity + quantity> + <#assign sumAmount = sumAmount + amount> + <#assign sumSubTotal = sumSubTotal + subTotal> + + + <#if sumSubTotal != 0> @@ -460,7 +460,7 @@ by hand from a real template using a ruler. - + diff --git a/applications/accounting/webapp/accounting/reports/SalesInvoiceByProductCategorySummary.ftl b/applications/accounting/webapp/accounting/reports/SalesInvoiceByProductCategorySummary.ftl index 11e087cc94..23bc6d7c10 100644 --- a/applications/accounting/webapp/accounting/reports/SalesInvoiceByProductCategorySummary.ftl +++ b/applications/accounting/webapp/accounting/reports/SalesInvoiceByProductCategorySummary.ftl @@ -34,14 +34,14 @@ under the License.
NOTE: each set of numbers is: <quantity>:<total amount>:<average amount>
<#-- Create the header row --> - - - + + + <#list productList as product> - + <#list productCategoryList as productCategory> - + <#-- Days of the month --> @@ -49,32 +49,32 @@ under the License. <#assign productResultMap = productResultMapByDayList.get(productNullResult_index)/> <#assign categoryResultMap = categoryResultMapByDayList.get(productNullResult_index)/> - <#-- now do the null product, then iterate through the products, then categories --> - - - + <#-- now do the null product, then iterate through the products, then categories --> + + + <#list productList as product> <#assign productResult = productResultMap[product.productId]?if_exists/> - + <#list productCategoryList as productCategory> <#assign categoryResult = categoryResultMap[productCategory.productCategoryId]?if_exists/> - + <#-- Totals for the month --> - - - + + + <#list productList as product> <#assign productResult = monthProductResultMap[product.productId]?if_exists/> - + <#list productCategoryList as productCategory> <#assign categoryResult = monthCategoryResultMap[productCategory.productCategoryId]?if_exists/> - +
Day[No Product]
Day[No Product]${product.internalName?default((Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(product, "PRODUCT_NAME", locale, dispatcher))?if_exists)}
P:[${product.productId}]
${product.internalName?default((Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(product, "PRODUCT_NAME", locale, dispatcher))?if_exists)}
P:[${product.productId}]
${(Static["org.ofbiz.product.category.CategoryContentWrapper"].getProductCategoryContentAsText(productCategory, "CATEGORY_NAME", locale, dispatcher))?if_exists}
C:[${productCategory.productCategoryId}]
${(Static["org.ofbiz.product.category.CategoryContentWrapper"].getProductCategoryContentAsText(productCategory, "CATEGORY_NAME", locale, dispatcher))?if_exists}
C:[${productCategory.productCategoryId}]
${(productNullResult_index + 1)}<@resultSummary resultMap=productNullResult/>
${(productNullResult_index + 1)}<@resultSummary resultMap=productNullResult/><@resultSummary resultMap=productResult/><@resultSummary resultMap=productResult/> <@resultSummary resultMap=categoryResult/><@resultSummary resultMap=categoryResult/>
Month Total<@resultSummary resultMap=monthProductNullResult/>
Month Total<@resultSummary resultMap=monthProductNullResult/><@resultSummary resultMap=productResult/><@resultSummary resultMap=productResult/> <@resultSummary resultMap=categoryResult/><@resultSummary resultMap=categoryResult/>
diff --git a/applications/content/template/mime-type/flash-flv.ftl b/applications/content/template/mime-type/flash-flv.ftl index 07b389ab21..df805b0707 100644 --- a/applications/content/template/mime-type/flash-flv.ftl +++ b/applications/content/template/mime-type/flash-flv.ftl @@ -17,15 +17,15 @@ under the License. --> - - + + - + \ No newline at end of file diff --git a/applications/content/template/mime-type/flash-swf.ftl b/applications/content/template/mime-type/flash-swf.ftl index 44851bdb52..30b9e4141c 100644 --- a/applications/content/template/mime-type/flash-swf.ftl +++ b/applications/content/template/mime-type/flash-swf.ftl @@ -18,5 +18,5 @@ --> - + diff --git a/applications/content/template/mime-type/quicktime.ftl b/applications/content/template/mime-type/quicktime.ftl index 29783e3753..12369b0e56 100644 --- a/applications/content/template/mime-type/quicktime.ftl +++ b/applications/content/template/mime-type/quicktime.ftl @@ -26,6 +26,6 @@ + pluginspage="http://www.apple.com/quicktime/download/"> diff --git a/applications/content/template/survey/genericsurvey.ftl b/applications/content/template/survey/genericsurvey.ftl index 81337aca07..6d3d320403 100644 --- a/applications/content/template/survey/genericsurvey.ftl +++ b/applications/content/template/survey/genericsurvey.ftl @@ -255,9 +255,9 @@ under the License. <#-- special formatting for select boxes --> <#assign align = "left"/> <#if surveyQuestionAndAppl?exists && surveyQuestionAndAppl.surveyQuestionTypeId?has_content> - <#if (surveyQuestionAndAppl.surveyQuestionTypeId == "BOOLEAN" || surveyQuestionAndAppl.surveyQuestionTypeId == "CONTENT" || surveyQuestionAndAppl.surveyQuestionTypeId == "OPTION")> - <#assign align = "right"/> - + <#if (surveyQuestionAndAppl.surveyQuestionTypeId == "BOOLEAN" || surveyQuestionAndAppl.surveyQuestionTypeId == "CONTENT" || surveyQuestionAndAppl.surveyQuestionTypeId == "OPTION")> + <#assign align = "right"/> + <#-- get an answer from the answerMap --> diff --git a/applications/content/webapp/content/cms/CMSSites.ftl b/applications/content/webapp/content/cms/CMSSites.ftl index 599296ce91..d7d80ce1a6 100644 --- a/applications/content/webapp/content/cms/CMSSites.ftl +++ b/applications/content/webapp/content/cms/CMSSites.ftl @@ -18,9 +18,9 @@ under the License. --> @@ -265,9 +265,9 @@ function call_fieldlookup4(rootForumId, parentForumId ) { diff --git a/applications/content/webapp/content/content/nav.ftl b/applications/content/webapp/content/content/nav.ftl index 7043b819ca..bf70a4b46a 100644 --- a/applications/content/webapp/content/content/nav.ftl +++ b/applications/content/webapp/content/content/nav.ftl @@ -58,8 +58,8 @@ diff --git a/applications/content/webapp/content/contentsetup/UserPermissions.ftl b/applications/content/webapp/content/contentsetup/UserPermissions.ftl index 08d11644ad..9b6184d70e 100644 --- a/applications/content/webapp/content/contentsetup/UserPermissions.ftl +++ b/applications/content/webapp/content/contentsetup/UserPermissions.ftl @@ -18,9 +18,9 @@ under the License. --> diff --git a/applications/order/webapp/ordermgr/entry/setAdditionalParty.ftl b/applications/order/webapp/ordermgr/entry/setAdditionalParty.ftl index 7588fd260a..6e6d3e0e0c 100644 --- a/applications/order/webapp/ordermgr/entry/setAdditionalParty.ftl +++ b/applications/order/webapp/ordermgr/entry/setAdditionalParty.ftl @@ -36,7 +36,7 @@ under the License. checked="checked"> - +
${uiLabelMap.CommonPerson}
diff --git a/applications/order/webapp/ordermgr/order/appendorderitem.ftl b/applications/order/webapp/ordermgr/order/appendorderitem.ftl index 68566d1b91..5ff45548d1 100644 --- a/applications/order/webapp/ordermgr/order/appendorderitem.ftl +++ b/applications/order/webapp/ordermgr/order/appendorderitem.ftl @@ -79,13 +79,13 @@ under the License. ${uiLabelMap.OrderShipGroup} - + <#list shipGroups as shipGroup> + + + + - + ${uiLabelMap.OrderDesiredDeliveryDate} diff --git a/applications/order/webapp/ordermgr/order/editorderitems.ftl b/applications/order/webapp/ordermgr/order/editorderitems.ftl index b1fa29af82..57e22cf355 100644 --- a/applications/order/webapp/ordermgr/order/editorderitems.ftl +++ b/applications/order/webapp/ordermgr/order/editorderitems.ftl @@ -195,12 +195,12 @@ float: right; <#-- now update/cancel reason and comment field --> <#if orderItem.statusId != "ITEM_CANCELLED" && orderItem.statusId != "ITEM_COMPLETED" && ("Y" != orderItem.isPromo?if_exists)> ${uiLabelMap.OrderReturnReason} - + ${uiLabelMap.CommonComments} <#if (orderHeader.orderTypeId == 'PURCHASE_ORDER')> diff --git a/applications/order/webapp/ordermgr/reports/reportlist.ftl b/applications/order/webapp/ordermgr/reports/reportlist.ftl index 52970b9901..0dce05397a 100644 --- a/applications/order/webapp/ordermgr/reports/reportlist.ftl +++ b/applications/order/webapp/ordermgr/reports/reportlist.ftl @@ -47,13 +47,13 @@ these reports and helping to improve them.
Report:
@@ -85,13 +85,13 @@ these reports and helping to improve them.
Report:
diff --git a/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java b/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java index 866908ae75..81caf5c547 100644 --- a/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java +++ b/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java @@ -128,10 +128,10 @@ public class CommunicationEventServices { boolean isMultiPart = false; List comEventContents = communicationEvent.getRelated("CommEventContentAssoc"); if (UtilValidate.isNotEmpty(comEventContents)) { - isMultiPart = true; + isMultiPart = true; List> bodyParts = FastList.newInstance(); if (UtilValidate.isNotEmpty(communicationEvent.getString("content"))) { - bodyParts.add(UtilMisc.toMap("content", communicationEvent.getString("content"), "type", communicationEvent.getString("contentMimeTypeId"))); + bodyParts.add(UtilMisc.toMap("content", communicationEvent.getString("content"), "type", communicationEvent.getString("contentMimeTypeId"))); } for (GenericValue comEventContent : comEventContents) { GenericValue content = comEventContent.getRelatedOne("FromContent"); @@ -139,7 +139,7 @@ public class CommunicationEventServices { ByteBuffer dataContent = DataResourceWorker.getContentAsByteBuffer(delegator, dataResource.getString("dataResourceId"), null, null, locale, null); bodyParts.add(UtilMisc.toMap("content", dataContent.array(), "type", dataResource.getString("mimeTypeId"), "filename", dataResource.getString("dataResourceName"))); } - sendMailParams.put("bodyParts", bodyParts); + sendMailParams.put("bodyParts", bodyParts); } else { sendMailParams.put("body", communicationEvent.getString("content")); } @@ -165,29 +165,29 @@ public class CommunicationEventServices { String sendBcc = null; List commRoles = communicationEvent.getRelated("CommunicationEventRole"); if (UtilValidate.isNotEmpty(commRoles)) { - for (GenericValue commRole : commRoles) { // 'from' and 'to' already defined on communication event - if (commRole.getString("partyId").equals(communicationEvent.getString("partyIdFrom")) || commRole.getString("partyId").equals(communicationEvent.getString("partyIdTo"))) { - continue; - } - GenericValue contactMech = commRole.getRelatedOne("ContactMech"); - if (UtilValidate.isNotEmpty(contactMech) && UtilValidate.isNotEmpty(contactMech.getString("infoString"))) { - if ("ADDRESSEE".equals(commRole.getString("roleTypeId"))) { - sendTo += "," + contactMech.getString("infoString"); - } else if ("CC".equals(commRole.getString("roleTypeId"))) { - if (sendCc != null) { - sendCc += "," + contactMech.getString("infoString"); - } else { - sendCc = contactMech.getString("infoString"); - } - } else if ("BCC".equals(commRole.getString("roleTypeId"))) { - if (sendBcc != null) { - sendBcc += "," + contactMech.getString("infoString"); - } else { - sendBcc = contactMech.getString("infoString"); - } - } - } - } + for (GenericValue commRole : commRoles) { // 'from' and 'to' already defined on communication event + if (commRole.getString("partyId").equals(communicationEvent.getString("partyIdFrom")) || commRole.getString("partyId").equals(communicationEvent.getString("partyIdTo"))) { + continue; + } + GenericValue contactMech = commRole.getRelatedOne("ContactMech"); + if (UtilValidate.isNotEmpty(contactMech) && UtilValidate.isNotEmpty(contactMech.getString("infoString"))) { + if ("ADDRESSEE".equals(commRole.getString("roleTypeId"))) { + sendTo += "," + contactMech.getString("infoString"); + } else if ("CC".equals(commRole.getString("roleTypeId"))) { + if (sendCc != null) { + sendCc += "," + contactMech.getString("infoString"); + } else { + sendCc = contactMech.getString("infoString"); + } + } else if ("BCC".equals(commRole.getString("roleTypeId"))) { + if (sendBcc != null) { + sendBcc += "," + contactMech.getString("infoString"); + } else { + sendBcc = contactMech.getString("infoString"); + } + } + } + } } sendMailParams.put("communicationEventId", communicationEventId); @@ -770,17 +770,17 @@ public class CommunicationEventServices { // select the plain text bodypart String messageBody = null; if (wrapper.getMainPartCount() > 1) { - for (int ind=0; ind < wrapper.getMainPartCount(); ind++) { - BodyPart p = wrapper.getPart(ind + ""); - if (p.getContentType().toLowerCase().indexOf("text/plain") > -1) { - messageBody = (String) p.getContent(); - break; - } - } + for (int ind=0; ind < wrapper.getMainPartCount(); ind++) { + BodyPart p = wrapper.getPart(ind + ""); + if (p.getContentType().toLowerCase().indexOf("text/plain") > -1) { + messageBody = (String) p.getContent(); + break; + } + } } if (messageBody == null) { - messageBody = wrapper.getMessageBody(); + messageBody = wrapper.getMessageBody(); } commEventMap.put("content", messageBody); diff --git a/applications/party/src/org/ofbiz/party/party/PartyServices.java b/applications/party/src/org/ofbiz/party/party/PartyServices.java index db3cf73342..110bf685d0 100644 --- a/applications/party/src/org/ofbiz/party/party/PartyServices.java +++ b/applications/party/src/org/ofbiz/party/party/PartyServices.java @@ -212,38 +212,38 @@ public class PartyServices { GenericValue party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); if (party.get("statusId") == null) { // old records - party.set("statusId", "PARTY_ENABLED"); + party.set("statusId", "PARTY_ENABLED"); } - String oldStatusId = party.getString("statusId"); + String oldStatusId = party.getString("statusId"); if (!party.getString("statusId").equals(statusId)) { - // check that status is defined as a valid change - GenericValue statusValidChange = delegator.findByPrimaryKey("StatusValidChange", UtilMisc.toMap("statusId", party.getString("statusId"), "statusIdTo", statusId)); - if (statusValidChange == null) { - String errorMsg = "Cannot change party status from " + party.getString("statusId") + " to " + statusId; - Debug.logWarning(errorMsg, module); - return ServiceUtil.returnError(errorMsg); - } + // check that status is defined as a valid change + GenericValue statusValidChange = delegator.findByPrimaryKey("StatusValidChange", UtilMisc.toMap("statusId", party.getString("statusId"), "statusIdTo", statusId)); + if (statusValidChange == null) { + String errorMsg = "Cannot change party status from " + party.getString("statusId") + " to " + statusId; + Debug.logWarning(errorMsg, module); + return ServiceUtil.returnError(errorMsg); + } - party.set("statusId", statusId); - party.store(); + party.set("statusId", statusId); + party.store(); - // record this status change in PartyStatus table - GenericValue partyStatus = delegator.makeValue("PartyStatus", UtilMisc.toMap("partyId", partyId, "statusId", statusId, "statusDate", statusDate)); - partyStatus.create(); + // record this status change in PartyStatus table + GenericValue partyStatus = delegator.makeValue("PartyStatus", UtilMisc.toMap("partyId", partyId, "statusId", statusId, "statusDate", statusDate)); + partyStatus.create(); - // disable all userlogins for this user when the new status is disabled - if (("PARTY_DISABLED").equals(statusId)) { - List userLogins = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId)); - for(GenericValue userLogin : userLogins) { - if (!"N".equals(userLogin.getString("enabled"))) { - userLogin.set("enabled", "N"); - userLogin.set("disabledDateTime", UtilDateTime.nowTimestamp()); - userLogin.store(); - } - } - } + // disable all userlogins for this user when the new status is disabled + if (("PARTY_DISABLED").equals(statusId)) { + List userLogins = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId)); + for(GenericValue userLogin : userLogins) { + if (!"N".equals(userLogin.getString("enabled"))) { + userLogin.set("enabled", "N"); + userLogin.set("disabledDateTime", UtilDateTime.nowTimestamp()); + userLogin.store(); + } + } + } } Map results = ServiceUtil.returnSuccess(); @@ -290,7 +290,7 @@ public class PartyServices { // update status by separate service String oldStatusId = party.getString("statusId"); if (party.get("statusId") == null) { // old records - party.set("statusId", "PARTY_ENABLED"); + party.set("statusId", "PARTY_ENABLED"); } person.setNonPKFields(context); diff --git a/applications/product/entitydef/entitymodel.xml b/applications/product/entitydef/entitymodel.xml index dc53aa84bf..ac3a7bb6ca 100644 --- a/applications/product/entitydef/entitymodel.xml +++ b/applications/product/entitydef/entitymodel.xml @@ -585,20 +585,20 @@ under the License. - - - - - - - - - - - - + + + + + + + + + + + + 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 50ddb2a24a..05e86452a2 100644 --- a/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java +++ b/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java @@ -2651,7 +2651,7 @@ public class UpsServices { Document acceptAccessRequestDocument = createAccessRequestDocument(); String acceptAccessRequestString = null; try { - acceptAccessRequestString = UtilXml.writeXmlDocument(acceptAccessRequestDocument); + acceptAccessRequestString = UtilXml.writeXmlDocument(acceptAccessRequestDocument); } catch (IOException e) { String ioeErrMsg = "Error writing the AccessRequest XML Document to a String: " + e.toString(); Debug.logError(e, ioeErrMsg, module); diff --git a/applications/product/webapp/catalog/find/exportproducts.ftl b/applications/product/webapp/catalog/find/exportproducts.ftl index 1884ecfecd..e43047807e 100644 --- a/applications/product/webapp/catalog/find/exportproducts.ftl +++ b/applications/product/webapp/catalog/find/exportproducts.ftl @@ -16,5 +16,5 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --><#list productExportList as productExportMap><#assign productCategoryCount=0/><#assign productFeatureCount=0/> -${productExportMap.productId} <#if productExportMap.productFeatureCustom?has_content>${productExportMap.productFeatureCustom.description?if_exists} <#list productExportMap.productCategories as productCategoryAndMember><#if productCategoryAndMember.categoryName?has_content><#if productCategoryCount > 0>,${productCategoryAndMember.categoryName}<#assign productCategoryCount=productCategoryCount + 1/> <#list productExportMap.productFeatures as productFeatureAndAppl><#if productFeatureAndAppl.description?has_content><#if productFeatureCount > 0>,${productFeatureAndAppl.description}<#assign productFeatureCount=productFeatureCount + 1/> +${productExportMap.productId} <#if productExportMap.productFeatureCustom?has_content>${productExportMap.productFeatureCustom.description?if_exists} <#list productExportMap.productCategories as productCategoryAndMember><#if productCategoryAndMember.categoryName?has_content><#if productCategoryCount > 0>,${productCategoryAndMember.categoryName}<#assign productCategoryCount=productCategoryCount + 1/> <#list productExportMap.productFeatures as productFeatureAndAppl><#if productFeatureAndAppl.description?has_content><#if productFeatureCount > 0>,${productFeatureAndAppl.description}<#assign productFeatureCount=productFeatureCount + 1/> \ No newline at end of file diff --git a/applications/product/webapp/catalog/reviews/pendingReviews.ftl b/applications/product/webapp/catalog/reviews/pendingReviews.ftl index 3a8211d631..c7af974033 100644 --- a/applications/product/webapp/catalog/reviews/pendingReviews.ftl +++ b/applications/product/webapp/catalog/reviews/pendingReviews.ftl @@ -60,9 +60,9 @@ under the License. <#assign party = postedUserLogin.getRelatedOne("Party")> <#assign partyTypeId = party.get("partyTypeId")> <#if partyTypeId == "PERSON"> - <#assign postedPerson = postedUserLogin.getRelatedOne("Person")> + <#assign postedPerson = postedUserLogin.getRelatedOne("Person")> <#else> - <#assign postedPerson = postedUserLogin.getRelatedOne("PartyGroup")> + <#assign postedPerson = postedUserLogin.getRelatedOne("PartyGroup")> class="alternate-row"> @@ -70,9 +70,9 @@ under the License. ${review.postedDateTime?if_exists} <#if postedPerson.firstName?has_content && postedPerson.lastName?has_content> - ${postedPerson.firstName} ${postedPerson.lastName} + ${postedPerson.firstName} ${postedPerson.lastName} <#else> - ${postedPerson.groupName} + ${postedPerson.groupName} + <#else> diff --git a/framework/common/webcommon/includes/lookup.ftl b/framework/common/webcommon/includes/lookup.ftl index a0ef6d1401..62a2f30f99 100644 --- a/framework/common/webcommon/includes/lookup.ftl +++ b/framework/common/webcommon/includes/lookup.ftl @@ -97,15 +97,15 @@ under the License. var thisForm = obj_caller.target.form; var evalString = ""; - if (arguments.length > 2 ) { - for(var i=1; i < arguments.length; i=i+2) { + if (arguments.length > 2 ) { + for(var i=1; i < arguments.length; i=i+2) { evalString = "setSourceColor(thisForm." + arguments[i] + ")"; eval(evalString); - evalString = "thisForm." + arguments[i] + ".value='" + arguments[i+1] + "'"; - eval(evalString); - } - } - window.close(); + evalString = "thisForm." + arguments[i] + ".value='" + arguments[i+1] + "'"; + eval(evalString); + } + } + window.close(); } diff --git a/framework/common/webcommon/portal/editPortalPage.ftl b/framework/common/webcommon/portal/editPortalPage.ftl index ec3d58b642..4c0773184f 100644 --- a/framework/common/webcommon/portal/editPortalPage.ftl +++ b/framework/common/webcommon/portal/editPortalPage.ftl @@ -30,15 +30,15 @@ under the License. - - - - + + + + <#if portalPageColumn_has_next>   diff --git a/framework/common/widget/CommonScreens.xml b/framework/common/widget/CommonScreens.xml index d766f89c1f..c35a43b922 100644 --- a/framework/common/widget/CommonScreens.xml +++ b/framework/common/widget/CommonScreens.xml @@ -232,14 +232,14 @@ under the License. - - - + + + - - - + + + diff --git a/framework/entity/config/entityengine.xml b/framework/entity/config/entityengine.xml index c15054fa32..6826d92952 100644 --- a/framework/entity/config/entityengine.xml +++ b/framework/entity/config/entityengine.xml @@ -38,7 +38,7 @@ access. For a detailed description see the core/docs/entityconfig.html file. --> @@ -58,11 +58,11 @@ under the License. - + - - + + diff --git a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java index 2276ed1f44..023952a3aa 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java @@ -31,40 +31,40 @@ import org.python.util.PythonInterpreter; public class DataLoader { - private String file; - private String iterations; - private SeleniumXml parent; - private SeleniumXml currentTest; - private List children; + private String file; + private String iterations; + private SeleniumXml parent; + private SeleniumXml currentTest; + private List children; - private int currentRowIndx; + private int currentRowIndx; - //Objects initialized from csvreader script. - private PyDictionary fieldNameMap; - private PyList dataList; - private PyList fieldNames; + //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; - this.iterations = iterations; - this.parent = parent; - this.children = children; - initData(); - } + public DataLoader(String file, String iterations, SeleniumXml parent, List children) { + super(); + this.file = file; + this.iterations = iterations; + this.parent = parent; + this.children = children; + initData(); + } - private void initData() { - // Run the python script - // Read header and get record count - PythonInterpreter interp = InitJython.getInterpreter(); + private void initData() { + // Run the python script + // Read header and get record count + PythonInterpreter interp = InitJython.getInterpreter(); - Map map = new HashMap(); - map.put("file", this.file); - interp.set("params", map); + Map map = new HashMap(); + map.put("file", this.file); + interp.set("params", map); interp.exec("from csvreader import CSVReader"); String cmd = "reader = CSVReader('" + this.file + "')"; interp.exec(cmd); @@ -78,43 +78,43 @@ public class DataLoader { //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 next() { + this.currentRowIndx = (this.currentRowIndx + 1) % this.dataList.__len__(); + } - private void loadData() { + private void loadData() { - int size = this.fieldNames.__len__(); - for(int i=0; i children) { - super(); - this.dataListName = dataListName; - this.parent = parent; - this.children = children; - } + private SeleniumXml currentTest; + private List 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() { + public void runTest() { - this.currentTest = new SeleniumXml(this.parent); + this.currentTest = new SeleniumXml(this.parent); Map dataMap = this.parent.getMap(); List dataList = (List)dataMap.get(this.dataListName); Iterator iter = dataList.iterator(); @@ -66,8 +66,8 @@ public class DataLoop { Object value = entry.getValue(); dataMap.put(name, value); } - currentTest.runCommands(this.children); - } - - } + currentTest.runCommands(this.children); + } + + } } diff --git a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java index e5e18642f8..e0de5916e4 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java @@ -37,21 +37,21 @@ import org.ofbiz.testtools.seleniumxml.util.TestUtils; public class GroovyRunner { - private String urlName; - private SeleniumXml parent; - private SeleniumXml currentTest; - - private int currentRowIndx; + private String urlName; + private SeleniumXml parent; + private SeleniumXml currentTest; + + private int currentRowIndx; public static GroovyClassLoader groovyClassLoader = new GroovyClassLoader(); - - - public GroovyRunner(String urlName, SeleniumXml parent) { - super(); - this.urlName = urlName; - this.parent = parent; - } + + + public GroovyRunner(String urlName, SeleniumXml parent) { + super(); + this.urlName = urlName; + this.parent = parent; + } - public void runTest() { + public void runTest() { Map map = this.parent.getMap(); map.put("url", this.urlName); @@ -69,7 +69,7 @@ public class GroovyRunner { 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 d38ca01764..d663ce0683 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/InitJython.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/InitJython.java @@ -33,45 +33,45 @@ import org.python.util.PythonInterpreter; */ 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 - * 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\")"); - } - } - - return SINGLETON; +// 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 + * 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\")"); + } + } + + 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 6b5637d2b8..781cb3ede5 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/JythonRunner.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/JythonRunner.java @@ -38,20 +38,20 @@ import org.python.util.PythonInterpreter; 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; - this.parent = parent; - } + private String urlName; + private SeleniumXml parent; + private SeleniumXml currentTest; + + private int currentRowIndx; + + + public JythonRunner(String urlName, SeleniumXml parent) { + super(); + this.urlName = urlName; + this.parent = parent; + } - public void runTest() { + public void runTest() { PythonInterpreter interp = InitJython.getInterpreter(); @@ -67,7 +67,7 @@ public class JythonRunner { System.out.println("Scriptrunner, runTest, IOException error: " + e.getMessage()); } - - } + + } } diff --git a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/SeleniumIDEConverter.java b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/SeleniumIDEConverter.java index 723493c203..bca9f2aba7 100644 --- a/framework/testtools/src/org/ofbiz/testtools/seleniumxml/SeleniumIDEConverter.java +++ b/framework/testtools/src/org/ofbiz/testtools/seleniumxml/SeleniumIDEConverter.java @@ -42,142 +42,142 @@ import org.xml.sax.SAXException; public class SeleniumIDEConverter { - private Document ideFile; - private Element xmlDestRoot; + private Document ideFile; + private Element xmlDestRoot; - private Namespace ns = Namespace.getNamespace("http://www.w3.org/1999/xhtml"); - private Map root; + private Namespace ns = Namespace.getNamespace("http://www.w3.org/1999/xhtml"); + private Map root; - public void convert(String ideFile, String xmlFile) throws JDOMException, IOException, SAXException, ParserConfigurationException { + public void convert(String ideFile, String xmlFile) throws JDOMException, IOException, SAXException, ParserConfigurationException { - readInputFile(ideFile); + readInputFile(ideFile); - convertIDECommands(); + convertIDECommands(); - createSeleniumXml(xmlFile); - } + createSeleniumXml(xmlFile); + } - private void readInputFile(String input) throws JDOMException, IOException, SAXException, ParserConfigurationException { + private void readInputFile(String input) throws JDOMException, IOException, SAXException, ParserConfigurationException { - File xmlFile = new File(input); - SAXBuilder builder = new SAXBuilder(); - this.ideFile = builder.build(xmlFile); + File xmlFile = new File(input); + SAXBuilder builder = new SAXBuilder(); + this.ideFile = builder.build(xmlFile); - //this.root = new HashMap(); - //this.root.put("doc", freemarker.ext.dom.NodeModel.parse(xmlFile)); - } + //this.root = new HashMap(); + //this.root.put("doc", freemarker.ext.dom.NodeModel.parse(xmlFile)); + } - private void convertIDECommands() throws JDOMException { + private void convertIDECommands() throws JDOMException { - //XPath path = XPath.newInstance("html/body/table/tbody"); - Element root = this.ideFile.getRootElement(); + //XPath path = XPath.newInstance("html/body/table/tbody"); + Element root = this.ideFile.getRootElement(); - this.xmlDestRoot = new Element("testcase"); + this.xmlDestRoot = new Element("testcase"); - //TODO: there must be a better way to do this with JDom - Element e1 = root.getChild("body",ns); - Element e2 = e1.getChild("table",ns); - Element e3 = e2.getChild("tbody",ns); - List list = e3.getChildren("tr", ns); - List commands = root.getChild("body",ns).getChild("table",ns).getChild("tbody",ns).getChildren("tr", ns); - for(Element elem: commands) { - processIDECommand(elem); - } + //TODO: there must be a better way to do this with JDom + Element e1 = root.getChild("body",ns); + Element e2 = e1.getChild("table",ns); + Element e3 = e2.getChild("tbody",ns); + List list = e3.getChildren("tr", ns); + List commands = root.getChild("body",ns).getChild("table",ns).getChild("tbody",ns).getChildren("tr", ns); + for(Element elem: commands) { + processIDECommand(elem); + } - } + } - private void processIDECommand(Element elem) throws JDOMException { + private void processIDECommand(Element elem) throws JDOMException { - List cmd = elem.getChildren("td", ns); - Element cmdElem = cmd.get(0); + List cmd = elem.getChildren("td", ns); + Element cmdElem = cmd.get(0); - String cmdToCompare = cmdElem.getValue(); - System.out.println("Checking for cmd: " + cmdToCompare); - if ("clickAndWait".compareTo(cmdElem.getValue()) == 0) { - System.out.println("Found clickAndWait"); - this.xmlDestRoot.addContent(buildCommand("click", "locator", cmd.get(1).getValue(), null, null)); - this.xmlDestRoot.addContent(buildCommand("waitForPageToLoad", "value", "10000", null, null)); + String cmdToCompare = cmdElem.getValue(); + System.out.println("Checking for cmd: " + cmdToCompare); + if ("clickAndWait".compareTo(cmdElem.getValue()) == 0) { + System.out.println("Found clickAndWait"); + this.xmlDestRoot.addContent(buildCommand("click", "locator", cmd.get(1).getValue(), null, null)); + this.xmlDestRoot.addContent(buildCommand("waitForPageToLoad", "value", "10000", null, null)); - } else if ("type".compareTo(cmdElem.getValue()) == 0 ) { - System.out.println("Found type"); - this.xmlDestRoot.addContent (buildCommand("type", "name", cmd.get(1).getValue(), "value", cmd.get(2).getValue())); + } else if ("type".compareTo(cmdElem.getValue()) == 0 ) { + System.out.println("Found type"); + this.xmlDestRoot.addContent (buildCommand("type", "name", cmd.get(1).getValue(), "value", cmd.get(2).getValue())); - } else if ("select".compareTo(cmdElem.getValue()) == 0) { - System.out.println("Found select"); - this.xmlDestRoot.addContent(buildCommand("select", "locator", cmd.get(1).getValue(), "option", cmd.get(2).getValue())); + } else if ("select".compareTo(cmdElem.getValue()) == 0) { + System.out.println("Found select"); + this.xmlDestRoot.addContent(buildCommand("select", "locator", cmd.get(1).getValue(), "option", cmd.get(2).getValue())); - } else if ("open".compareTo(cmdElem.getValue()) == 0) { - System.out.println("Found open"); - this.xmlDestRoot.addContent(buildCommand("open", "value", cmd.get(1).getValue(), null, null)); + } else if ("open".compareTo(cmdElem.getValue()) == 0) { + System.out.println("Found open"); + this.xmlDestRoot.addContent(buildCommand("open", "value", cmd.get(1).getValue(), null, null)); - } else if ("click".compareTo(cmdElem.getValue()) == 0) { - Element newCmd = new Element("click"); - newCmd.setAttribute("locator", cmd.get(1).getValue()); - this.xmlDestRoot.addContent(newCmd); + } else if ("click".compareTo(cmdElem.getValue()) == 0) { + Element newCmd = new Element("click"); + newCmd.setAttribute("locator", cmd.get(1).getValue()); + this.xmlDestRoot.addContent(newCmd); - } else if ("doubleClick".compareTo(cmdElem.getValue()) == 0) { - Element newCmd = new Element("doubleClick"); - newCmd.setAttribute("locator", cmd.get(1).getValue()); - this.xmlDestRoot.addContent(newCmd); + } else if ("doubleClick".compareTo(cmdElem.getValue()) == 0) { + Element newCmd = new Element("doubleClick"); + newCmd.setAttribute("locator", cmd.get(1).getValue()); + this.xmlDestRoot.addContent(newCmd); - } else { - System.out.println("WARNING: No definition for " + cmdElem.getValue() + " defaulting to us 'reflection'."); - Element newCmd = new Element(cmdElem.getValue()); - //List attributes = cmdElem.getAttributes(); - int size = cmd.size()-1; - for(int i=1; i map; - private Document doc; - private DefaultSelenium sel; - private static Properties props; + public static final int MAX_STR_LENGTH = 15; + static String testPath; + private Map map; + private Document doc; + private DefaultSelenium sel; + private static Properties props; private String testSourcePath; private String username; private String password; - - public static void main(String[] args) throws JDOMException, IOException{ - if (args.length == 0) { - System.out.println("Please include a path for the selenium XML test file."); - } else { + + public static void main(String[] args) throws JDOMException, IOException{ + if (args.length == 0) { + System.out.println("Please include a path for the selenium XML test file."); + } else { SeleniumXml sel = new SeleniumXml(); for (String arg: args) { if (arg.startsWith("-username")) { @@ -78,160 +78,160 @@ public class SeleniumXml { sel.testSourcePath = arg; } } - sel.runTest(args[0]); - } - } - - public SeleniumXml() throws IOException { - this.map = new HashMap(); - if (props == null) { - props = new Properties(); - initConfig(); - } - logger.setLevel(Level.DEBUG); - } + sel.runTest(args[0]); + } + } + + public SeleniumXml() throws IOException { + this.map = new HashMap(); + if (props == null) { + props = new Properties(); + initConfig(); + } + logger.setLevel(Level.DEBUG); + } - private static void initConfig() throws IOException { - try { - String configFile = System.getProperty(PROPS_NAME); - if (configFile == null) { - String errMsg = "The Java environment (-Dxxx=yyy) variable with name " + PROPS_NAME + " is not set, cannot resolve location."; - throw new MalformedURLException(errMsg); - } - BasicConfigurator.configure(); - InputStream in = new FileInputStream(configFile); - props.load(in); - in.close(); + private static void initConfig() throws IOException { + try { + String configFile = System.getProperty(PROPS_NAME); + if (configFile == null) { + String errMsg = "The Java environment (-Dxxx=yyy) variable with name " + PROPS_NAME + " is not set, cannot resolve location."; + throw new MalformedURLException(errMsg); + } + BasicConfigurator.configure(); + InputStream in = new FileInputStream(configFile); + props.load(in); + in.close(); - } catch (IOException e) { - e.printStackTrace(); - throw e; - } - } - - /** - * Constructor to preset with an existing Map of parameters. Intended to be used - * for nested Selenium tests. - * @param map - */ - public SeleniumXml(SeleniumXml selenium) { - this.sel = selenium.getSelenium(); - this.map = selenium.getParameterMap(); - } + } catch (IOException e) { + e.printStackTrace(); + throw e; + } + } + + /** + * Constructor to preset with an existing Map of parameters. Intended to be used + * for nested Selenium tests. + * @param map + */ + public SeleniumXml(SeleniumXml selenium) { + this.sel = selenium.getSelenium(); + this.map = selenium.getParameterMap(); + } - public DefaultSelenium getSelenium() { - return this.sel; - } - public Map getParameterMap() { - return this.map; - } - public void runTest(String fileName) throws JDOMException, IOException { - readFile(fileName); - setupSelenium(); - runCommands(); - } + public DefaultSelenium getSelenium() { + return this.sel; + } + public Map getParameterMap() { + return this.map; + } + public void runTest(String fileName) throws JDOMException, IOException { + readFile(fileName); + setupSelenium(); + runCommands(); + } - public void runCommands() { - Element root = this.doc.getRootElement(); - List nodes = root.getChildren(); - runCommands(nodes); - } - - public void runCommands(List nodes) { - - for(Element elem: nodes) { - if ("type" == elem.getName()) { - typeCmd(elem); - - } else if ("clickAt" == elem.getName()) { - clickAt(elem); - } else if ("waitForValue" == elem.getName()) { - waitForValue(elem); - } else if ("waitForCondition" == elem.getName()) { - waitForCondition(elem); - } else if ("loadData" == elem.getName()) { - loadData(elem); + public void runCommands() { + Element root = this.doc.getRootElement(); + List nodes = root.getChildren(); + runCommands(nodes); + } + + public void runCommands(List nodes) { + + for(Element elem: nodes) { + if ("type" == elem.getName()) { + typeCmd(elem); + + } else if ("clickAt" == elem.getName()) { + clickAt(elem); + } else if ("waitForValue" == elem.getName()) { + waitForValue(elem); + } else if ("waitForCondition" == elem.getName()) { + waitForCondition(elem); + } else if ("loadData" == elem.getName()) { + loadData(elem); } else if ("loadData" == elem.getName()) { loadData(elem); } else if ("jythonRunner" == elem.getName()) { - jythonRunner(elem); + jythonRunner(elem); } else if ("groovyRunner" == elem.getName()) { - groovyRunner(elem); + groovyRunner(elem); } else if ("dataLoop" == elem.getName()) { dataLoop(elem); } else if ("remoteRequest" == elem.getName()) { remoteRequest(elem); - } else if ("selectPopup" == elem.getName()) { - selectPopup(elem); - } else if ("getAllWindowIds" == elem.getName()) { - getAllWindowIds(elem); - } else if ("captureTextInPage" == elem.getName()) { - captureTextInPageCmd(elem); - } else if ("getSelectedLabel" == elem.getName()) { - getSelectedLabel(elem); - } else if ("getSelectedValue" == elem.getName()) { - getSelectedValue(elem); - } else if ("getSelectedId" == elem.getName()) { - getSelectedId(elem); - } else if ("testcase" == elem.getName()) { - testcase(elem); - } else if ("assertContains" == elem.getName()) { - assertContains(elem); - } else if ("getHtmlSource" == elem.getName()) { - getHtmlSource(elem); - } else if ("getBodyText" == elem.getName()) { - getBodyText(elem); - } else if ("setup" == elem.getName()) { - continue; //setup is handled previously - } else if ("print" == elem.getName()) { - printCmd(elem); - } else if ("waitForPageToLoad" == elem.getName()) { - waitForPageToLoadCmd(elem); - } else if ("getSelectedIds" == elem.getName()) { - getSelectedIdsCmd(elem); - } else if ("copy" == elem.getName()) { - copyCmd(elem); - } else if ("append" == elem.getName()) { - appendCmd(elem); - } else if ("open" == elem.getName()) { - openCmd(elem); - } else if ("click" == elem.getName()) { - clickCmd(elem); - } else if ("select" == elem.getName()) { - selectCmd(elem); - } else if ("uniqueId" == elem.getName()) { - uniqueIdCmd(elem); - } else if ("randomAlphaString" == elem.getName()) { - randomAlphaStringCmd(elem); - } else if ("randomString" == elem.getName()) { - randomStringCmd(elem); + } else if ("selectPopup" == elem.getName()) { + selectPopup(elem); + } else if ("getAllWindowIds" == elem.getName()) { + getAllWindowIds(elem); + } else if ("captureTextInPage" == elem.getName()) { + captureTextInPageCmd(elem); + } else if ("getSelectedLabel" == elem.getName()) { + getSelectedLabel(elem); + } else if ("getSelectedValue" == elem.getName()) { + getSelectedValue(elem); + } else if ("getSelectedId" == elem.getName()) { + getSelectedId(elem); + } else if ("testcase" == elem.getName()) { + testcase(elem); + } else if ("assertContains" == elem.getName()) { + assertContains(elem); + } else if ("getHtmlSource" == elem.getName()) { + getHtmlSource(elem); + } else if ("getBodyText" == elem.getName()) { + getBodyText(elem); + } else if ("setup" == elem.getName()) { + continue; //setup is handled previously + } else if ("print" == elem.getName()) { + printCmd(elem); + } else if ("waitForPageToLoad" == elem.getName()) { + waitForPageToLoadCmd(elem); + } else if ("getSelectedIds" == elem.getName()) { + getSelectedIdsCmd(elem); + } else if ("copy" == elem.getName()) { + copyCmd(elem); + } else if ("append" == elem.getName()) { + appendCmd(elem); + } else if ("open" == elem.getName()) { + openCmd(elem); + } else if ("click" == elem.getName()) { + clickCmd(elem); + } else if ("select" == elem.getName()) { + selectCmd(elem); + } else if ("uniqueId" == elem.getName()) { + uniqueIdCmd(elem); + } else if ("randomAlphaString" == elem.getName()) { + randomAlphaStringCmd(elem); + } else if ("randomString" == elem.getName()) { + randomStringCmd(elem); } else if ("setSpeed" == elem.getName()) { setSpeed(elem); - } else { - //logger.error("Unknown SeleniumXml command found:"+elem.getName()); - //Use reflection with parameters using the naming convention param1, param2, and any return results stored - //in map using "out" - logger.info("Undefined command calling by reflection for command: " + elem.getName()); - callByReflection(elem); - } - } - - } - - private void callByReflection(Element elem) { - - String methodName = elem.getName(); - //Support two parameters for all selenium RC calls - String param1 = elem.getAttributeValue("param1"); - String param2 = elem.getAttributeValue("param2"); - - Class[] paramTypes = null; - Object[] args = null; - if ((param1 != null) && (param2 != null)) { - paramTypes = new Class[] {String.class, String.class}; - args = new Object[] {param1, param2}; - } else if (param1 != null) { + } else { + //logger.error("Unknown SeleniumXml command found:"+elem.getName()); + //Use reflection with parameters using the naming convention param1, param2, and any return results stored + //in map using "out" + logger.info("Undefined command calling by reflection for command: " + elem.getName()); + callByReflection(elem); + } + } + + } + + private void callByReflection(Element elem) { + + String methodName = elem.getName(); + //Support two parameters for all selenium RC calls + String param1 = elem.getAttributeValue("param1"); + String param2 = elem.getAttributeValue("param2"); + + Class[] paramTypes = null; + Object[] args = null; + if ((param1 != null) && (param2 != null)) { + paramTypes = new Class[] {String.class, String.class}; + args = new Object[] {param1, param2}; + } else if (param1 != null) { paramTypes = new Class[] {String.class}; args = new Object[] {param1}; } else { @@ -239,73 +239,73 @@ public class SeleniumXml { args = new Object[] {}; } - //Capture the output name for "get" methods - String out = elem.getAttributeValue("out"); - - Method m; - try { - m = (Method) this.sel.getClass().getDeclaredMethod(methodName, paramTypes); - Object results = m.invoke(this.sel, args); - - //Add output parameter to common map - if ((out != null) && (results != null)) { - addParam(out, results); - } - } catch (Exception e) { - // TODO Auto-generated catch block - logger.error("Exception occurred when Unknown SeleniumXml command found:"+elem.getName()); - e.printStackTrace(); - } - - - } - - public void waitForValue(Element elem) { - - String locator = elem.getAttributeValue("locator"); - String timeout = elem.getAttributeValue("timeout"); - String outParam = elem.getAttributeValue("out"); - - int maxTime = Integer.parseInt(timeout); - int maxSeconds = maxTime/1000; - logger.debug("waitForValue: locator=" + locator + " timeout=" + timeout); - //this.sel.waitForCondition(script, timeout); - String foundValue = null; - for(int second=0;; second++) { - if (second >= maxSeconds) { -// throw new SeleniumException("waitForValue exceeded timeout: " + maxTime); - } - try { - //getValue throws an exception if it can't find locator - // - sleep for 1 sec and try again - // - otherwise break as we found the value - foundValue = sel.getValue(locator); - if (outParam != null) { - this.addParam(outParam, foundValue); - } - break; // - } catch (Exception e) { - //wait for 1 second and then resume - try { - Thread.sleep(1000); - } catch (InterruptedException threadE) { - // TODO Auto-generated catch block - threadE.printStackTrace(); - - } - } - } - } - - public void waitForCondition(Element elem) { - - String script = elem.getAttributeValue("script"); - String timeout = elem.getAttributeValue("timeout"); - - logger.debug("waitForCondition: script=" + script + " timeout=" + timeout); - this.sel.waitForCondition(script, timeout); - } - + //Capture the output name for "get" methods + String out = elem.getAttributeValue("out"); + + Method m; + try { + m = (Method) this.sel.getClass().getDeclaredMethod(methodName, paramTypes); + Object results = m.invoke(this.sel, args); + + //Add output parameter to common map + if ((out != null) && (results != null)) { + addParam(out, results); + } + } catch (Exception e) { + // TODO Auto-generated catch block + logger.error("Exception occurred when Unknown SeleniumXml command found:"+elem.getName()); + e.printStackTrace(); + } + + + } + + public void waitForValue(Element elem) { + + String locator = elem.getAttributeValue("locator"); + String timeout = elem.getAttributeValue("timeout"); + String outParam = elem.getAttributeValue("out"); + + int maxTime = Integer.parseInt(timeout); + int maxSeconds = maxTime/1000; + logger.debug("waitForValue: locator=" + locator + " timeout=" + timeout); + //this.sel.waitForCondition(script, timeout); + String foundValue = null; + for(int second=0;; second++) { + if (second >= maxSeconds) { +// throw new SeleniumException("waitForValue exceeded timeout: " + maxTime); + } + try { + //getValue throws an exception if it can't find locator + // - sleep for 1 sec and try again + // - otherwise break as we found the value + foundValue = sel.getValue(locator); + if (outParam != null) { + this.addParam(outParam, foundValue); + } + break; // + } catch (Exception e) { + //wait for 1 second and then resume + try { + Thread.sleep(1000); + } catch (InterruptedException threadE) { + // TODO Auto-generated catch block + threadE.printStackTrace(); + + } + } + } + } + + public void waitForCondition(Element elem) { + + String script = elem.getAttributeValue("script"); + String timeout = elem.getAttributeValue("timeout"); + + logger.debug("waitForCondition: script=" + script + " timeout=" + timeout); + this.sel.waitForCondition(script, timeout); + } + public void loadData(Element elem) { String file = elem.getAttributeValue("file"); @@ -371,126 +371,126 @@ public class SeleniumXml { this.map.put(name, value); } - private void assertContains(Element elem) { - String src = replaceParam(elem.getAttributeValue("src")); - String test = replaceParam(elem.getAttributeValue("test")); - int indxSearch = src.indexOf(test); - if (indxSearch == -1) { - logger.info("assertContains didn't find " + test + " in the src"); - } else { - logger.info("assertContains found " + test + " in the src"); - } - Assert.assertTrue(indxSearch != -1); - //String text = this.sel.getHtmlSource(); - } - - private void selectPopup(Element elem) { - String locator = elem.getAttributeValue("locator"); -// String winId = elem.getAttributeValue("windowId"); - String timeout = elem.getAttributeValue("timeout"); - - //this.sel.waitForPopUp(winId, timeout); - this.sel.click(locator); - - String[] winNames = this.sel.getAllWindowNames(); - this.sel.selectWindow("name=" + winNames[1]); - } - - private void getAllWindowIds(Element elem) { - String[] winIds = this.sel.getAllWindowIds(); - for(int i=0; i