This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git The following commit(s) were added to refs/heads/trunk by this push: new 208ef1b Improved: replaces module by MODULE everywhere 208ef1b is described below commit 208ef1b1be4c41a5099c251f623cdb9e1cda086c Author: Jacques Le Roux <[hidden email]> AuthorDate: Mon Apr 6 12:14:23 2020 +0200 Improved: replaces module by MODULE everywhere --- .../ofbiz/assetmaint/FixedAssetMaintServices.java | 6 +- .../apache/ofbiz/bi/util/DimensionServices.java | 2 +- .../java/org/apache/ofbiz/birt/BirtFactory.java | 4 +- .../java/org/apache/ofbiz/birt/BirtWorker.java | 12 +-- .../apache/ofbiz/birt/container/BirtContainer.java | 12 +-- .../apache/ofbiz/birt/email/BirtEmailServices.java | 34 ++++----- .../birt/flexible/BirtMasterReportServices.java | 6 +- .../apache/ofbiz/birt/flexible/BirtServices.java | 68 ++++++++--------- .../org/apache/ofbiz/birt/flexible/BirtUtil.java | 2 +- .../ofbiz/birt/flexible/ReportDesignGenerator.java | 14 ++-- .../birt/report/servlet/BirtEngineServlet.java | 2 +- .../birt/report/servlet/BirtViewerServlet.java | 2 +- .../birt/report/servlet/ViewerServletRequest.java | 4 +- .../ofbiz/birt/webapp/view/BirtViewHandler.java | 6 +- .../java/org/apache/ofbiz/ebay/EbayHelper.java | 82 ++++++++++----------- .../org/apache/ofbiz/ebay/EbayOrderServices.java | 86 +++++++++++----------- .../apache/ofbiz/ebay/ImportOrdersFromEbay.java | 72 +++++++++--------- .../apache/ofbiz/ebay/ProductsExportToEbay.java | 26 +++---- .../ofbiz/ebaystore/EbayBestOfferAutoPref.java | 2 +- .../org/apache/ofbiz/ebaystore/EbayEvents.java | 76 +++++++++---------- .../java/org/apache/ofbiz/ebaystore/EbayStore.java | 24 +++--- .../ofbiz/ebaystore/EbayStoreAutoPrefEvents.java | 6 +- .../ofbiz/ebaystore/EbayStoreAutoPreferences.java | 22 +++--- .../ofbiz/ebaystore/EbayStoreCategoryFacade.java | 4 +- .../ofbiz/ebaystore/EbayStoreCustomerService.java | 2 +- .../apache/ofbiz/ebaystore/EbayStoreHelper.java | 32 ++++---- .../ebaystore/EbayStoreInventoryServices.java | 40 +++++----- .../apache/ofbiz/ebaystore/EbayStoreOptions.java | 22 +++--- .../org/apache/ofbiz/ebaystore/EbayStoreOrder.java | 82 ++++++++++----------- .../ofbiz/ebaystore/EbayStoreSiteFacade.java | 2 +- .../ofbiz/ecommerce/janrain/JanrainHelper.java | 4 +- .../ofbiz/ecommerce/misc/ThirdPartyEvents.java | 28 +++---- .../ecommerce/webapp/view/JspViewHandler.java | 10 +-- ecommerce/template/includes/HeaderHead.ftl | 2 +- .../apache/ofbiz/example/ExamplePrintServices.java | 16 ++-- .../org/apache/ofbiz/example/ExampleServices.java | 4 +- .../apache/ofbiz/example/ExampleWebSockets.java | 4 +- .../org/apache/ofbiz/ldap/LdapLoginWorker.java | 18 ++--- .../ofbiz/content/search/ContentDocument.java | 10 +-- .../ofbiz/content/search/DocumentIndexer.java | 30 ++++---- .../ofbiz/content/search/ProductDocument.java | 10 +-- .../apache/ofbiz/content/search/SearchEvents.java | 6 +- .../ofbiz/content/search/SearchServices.java | 22 +++--- .../apache/ofbiz/content/search/SearchWorker.java | 4 +- .../org/apache/ofbiz/content/test/LuceneTests.java | 4 +- .../java/org/apache/ofbiz/msg91/Msg91Services.java | 6 +- .../apache/ofbiz/passport/event/GitHubEvents.java | 28 +++---- .../ofbiz/passport/event/LinkedInEvents.java | 24 +++--- .../ofbiz/passport/user/GitHubAuthenticator.java | 22 +++--- .../ofbiz/passport/user/LinkedInAuthenticator.java | 26 +++---- .../apache/ofbiz/passport/util/PassportUtil.java | 4 +- .../ofbiz/htmlreport/AbstractHtmlReport.java | 2 +- .../org/apache/ofbiz/htmlreport/HtmlReport.java | 8 +- .../apache/ofbiz/pricat/AbstractPricatParser.java | 24 +++--- .../java/org/apache/ofbiz/pricat/PricatEvents.java | 22 +++--- .../ofbiz/pricat/PricatParseExcelHtmlThread.java | 10 +-- .../ofbiz/pricat/sample/SamplePricatEvents.java | 6 +- .../ofbiz/pricat/sample/SamplePricatParser.java | 6 +- .../apache/ofbiz/pricat/util/OFBizPricatUtil.java | 6 +- .../java/org/apache/ofbiz/project/Various.java | 6 +- .../java/org/apache/ofbiz/scrum/ScrumEvents.java | 6 +- .../java/org/apache/ofbiz/scrum/ScrumServices.java | 20 ++--- .../java/org/apache/ofbiz/solr/CategoryUtil.java | 8 +- .../java/org/apache/ofbiz/solr/ProductUtil.java | 10 +-- .../org/apache/ofbiz/solr/SolrProductSearch.java | 82 ++++++++++----------- .../main/java/org/apache/ofbiz/solr/SolrUtil.java | 6 +- .../ofbiz/solr/control/OFBizSolrLoginWorker.java | 6 +- .../ofbiz/solr/webapp/OFBizSolrContextFilter.java | 14 ++-- .../solr/webapp/OFBizSolrLoadAdminUiServlet.java | 2 +- .../solr/webapp/OFBizSolrRedirectServlet.java | 2 +- .../java/org/apache/ofbiz/webpos/WebPosEvents.java | 14 ++-- .../apache/ofbiz/webpos/search/WebPosSearch.java | 6 +- .../apache/ofbiz/webpos/session/WebPosSession.java | 10 +-- .../webpos/transaction/WebPosTransaction.java | 70 +++++++++--------- 74 files changed, 691 insertions(+), 691 deletions(-) diff --git a/assetmaint/src/main/java/org/apache/ofbiz/assetmaint/FixedAssetMaintServices.java b/assetmaint/src/main/java/org/apache/ofbiz/assetmaint/FixedAssetMaintServices.java index 0d1f7e8..112c3a8 100644 --- a/assetmaint/src/main/java/org/apache/ofbiz/assetmaint/FixedAssetMaintServices.java +++ b/assetmaint/src/main/java/org/apache/ofbiz/assetmaint/FixedAssetMaintServices.java @@ -43,7 +43,7 @@ import org.apache.ofbiz.service.ServiceUtil; public class FixedAssetMaintServices { - public static final String module = FixedAssetMaintServices.class.getName(); + public static final String MODULE = FixedAssetMaintServices.class.getName(); public static final String resource = "AssetMaintUiLabels"; public static Map<String, Object> addPartFixedAssetMaint(DispatchContext ctx, Map<String, Object> context) { @@ -109,9 +109,9 @@ public class FixedAssetMaintServices { requestedQty = requestedQty - issueQuantity; } } catch (GenericEntityException e) { - Debug.logError("Problem in retriving data from database", module); + Debug.logError("Problem in retriving data from database", MODULE); } catch (GenericServiceException e) { - Debug.logError("Problem in calling service issueInventoryItemToFixedAssetMaint", module); + Debug.logError("Problem in calling service issueInventoryItemToFixedAssetMaint", MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AssetMaintProblemCallingService", locale)); } return ServiceUtil.returnSuccess(); diff --git a/bi/src/main/java/org/apache/ofbiz/bi/util/DimensionServices.java b/bi/src/main/java/org/apache/ofbiz/bi/util/DimensionServices.java index dbebc3b..9e2d5f9 100644 --- a/bi/src/main/java/org/apache/ofbiz/bi/util/DimensionServices.java +++ b/bi/src/main/java/org/apache/ofbiz/bi/util/DimensionServices.java @@ -41,7 +41,7 @@ import org.apache.ofbiz.service.ServiceUtil; public class DimensionServices { - public static final String module = DimensionServices.class.getName(); + public static final String MODULE = DimensionServices.class.getName(); public static final String resource = "BiUiLabels"; public static Map<String, Object> getDimensionIdFromNaturalKey(DispatchContext ctx, Map<String, ? extends Object> context) { diff --git a/birt/src/main/java/org/apache/ofbiz/birt/BirtFactory.java b/birt/src/main/java/org/apache/ofbiz/birt/BirtFactory.java index c47958b..331f1f4 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/BirtFactory.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/BirtFactory.java @@ -37,7 +37,7 @@ import org.xml.sax.SAXException; */ public class BirtFactory { - public final static String module = BirtFactory.class.getName(); + public final static String MODULE = BirtFactory.class.getName(); private static IReportEngine engine; @@ -82,7 +82,7 @@ public class BirtFactory { } reportInputStream = reportFileUrl.openStream(); double totalSeconds = (System.currentTimeMillis() - startTime)/1000.0; - Debug.logInfo("Got report in " + totalSeconds + "s from: " + reportFileUrl.toExternalForm(), module); + Debug.logInfo("Got report in " + totalSeconds + "s from: " + reportFileUrl.toExternalForm(), MODULE); } if (reportInputStream == null) { diff --git a/birt/src/main/java/org/apache/ofbiz/birt/BirtWorker.java b/birt/src/main/java/org/apache/ofbiz/birt/BirtWorker.java index 0559b95..ee7136b 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/BirtWorker.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/BirtWorker.java @@ -61,7 +61,7 @@ import org.eclipse.birt.report.engine.api.RenderOption; public final class BirtWorker { - public final static String module = BirtWorker.class.getName(); + public final static String MODULE = BirtWorker.class.getName(); private final static String BIRT_PARAMETERS = "birtParameters"; private final static String BIRT_LOCALE = "birtLocale"; @@ -110,19 +110,19 @@ public final class BirtWorker { if (birtImageDirectory == null) { birtImageDirectory = "/"; } - Debug.logInfo("Get report engine", module); + Debug.logInfo("Get report engine", MODULE); IReportEngine engine = BirtFactory.getReportEngine(); IRunAndRenderTask task = engine.createRunAndRenderTask(design); if (birtLocale != null) { - Debug.logInfo("Set BIRT locale:" + birtLocale, module); + Debug.logInfo("Set BIRT locale:" + birtLocale, MODULE); task.setLocale(birtLocale); } // set parameters if exists Map<String, Object> parameters = UtilGenerics.cast(context.get(BirtWorker.getBirtParameters())); if (parameters != null) { - //Debug.logInfo("Set BIRT parameters:" + parameters, module); + //Debug.logInfo("Set BIRT parameters:" + parameters, MODULE); task.setParameterValues(parameters); } @@ -151,8 +151,8 @@ public final class BirtWorker { // run report if (Debug.infoOn()) { - Debug.logInfo("BIRT's locale is: " + task.getLocale(), module); - Debug.logInfo("Run report's task", module); + Debug.logInfo("BIRT's locale is: " + task.getLocale(), MODULE); + Debug.logInfo("Run report's task", MODULE); } task.run(); task.close(); diff --git a/birt/src/main/java/org/apache/ofbiz/birt/container/BirtContainer.java b/birt/src/main/java/org/apache/ofbiz/birt/container/BirtContainer.java index 9036f2b..dc12104 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/container/BirtContainer.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/container/BirtContainer.java @@ -36,7 +36,7 @@ import org.apache.ofbiz.birt.BirtWorker; public class BirtContainer implements Container { - public static final String module = BirtContainer.class.getName(); + public static final String MODULE = BirtContainer.class.getName(); protected String configFile; @@ -53,7 +53,7 @@ public class BirtContainer implements Container { */ @Override public boolean start() throws ContainerException { - Debug.logInfo("Start BIRT container", module); + Debug.logInfo("Start BIRT container", MODULE); // make sure the subclass sets the config name if (getName() == null) { @@ -73,20 +73,20 @@ public class BirtContainer implements Container { // startup platform try { - Debug.logInfo("Startup BIRT platform", module); + Debug.logInfo("Startup BIRT platform", MODULE); Platform.startup(config); } catch (BirtException e) { throw new ContainerException(e); } // create report engine - Debug.logInfo("Create factory object", module); + Debug.logInfo("Create factory object", MODULE); IReportEngineFactory factory = (IReportEngineFactory) Platform .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY); if (factory == null) { throw new ContainerException("can not create birt engine factory"); } - Debug.logInfo("Create report engine", module); + Debug.logInfo("Create report engine", MODULE); IReportEngine engine = factory.createReportEngine(config); BirtFactory.setReportEngine(engine); @@ -100,7 +100,7 @@ public class BirtContainer implements Container { formatList = supportedFormat; } } - Debug.logInfo("BIRT supported formats: " + formatList, module); + Debug.logInfo("BIRT supported formats: " + formatList, MODULE); return false; } diff --git a/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java b/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java index 37e29dc..1098ee0 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java @@ -63,7 +63,7 @@ import freemarker.template.TemplateException; public class BirtEmailServices { - public static final String module = BirtEmailServices.class.getName(); + public static final String MODULE = BirtEmailServices.class.getName(); public static final String resource = "BirtUiLabels"; /** * send birt mail @@ -120,11 +120,11 @@ public class BirtEmailServices { screenStringRenderer = new MacroScreenRenderer("screen", visualTheme.getModelTheme().getScreenRendererLocation("screen")); } catch (TemplateException e) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (IOException e) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } ScreenRenderer screens = new ScreenRenderer(bodyWriter, screenContext, screenStringRenderer); @@ -136,19 +136,19 @@ public class BirtEmailServices { screens.render(bodyScreenUri); } catch (GeneralException e) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (IOException e) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorIORenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (SAXException e) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorSAXRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (ParserConfigurationException e) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorParserConfigRenderingScreenForEmail", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } } @@ -185,7 +185,7 @@ public class BirtEmailServices { InputStream reportInputStream = BirtFactory.getReportInputStreamFromLocation(birtReportLocation); IReportRunnable design = engine.openReportDesign(reportInputStream); - Debug.logInfo("Export report as content type:" + birtContentType, module); + Debug.logInfo("Export report as content type:" + birtContentType, MODULE); BirtWorker.exportReport(design, context, birtContentType, baos); baos.flush(); baos.close(); @@ -202,31 +202,31 @@ public class BirtEmailServices { serviceContext.put("bodyParts", bodyParts); } catch (GeneralException ge) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", ge.toString()), locale); - Debug.logError(ge, errMsg, module); + Debug.logError(ge, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (IOException ie) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorIORenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", ie.toString()), locale); - Debug.logError(ie, errMsg, module); + Debug.logError(ie, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (FOPException fe) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorFOPRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", fe.toString()), locale); - Debug.logError(fe, errMsg, module); + Debug.logError(fe, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (SAXException se) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorSAXRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", se.toString()), locale); - Debug.logError(se, errMsg, module); + Debug.logError(se, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (ParserConfigurationException pe) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorParserRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", pe.toString()), locale); - Debug.logError(pe, errMsg, module); + Debug.logError(pe, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (EngineException ee) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", ee.toString()), locale); - Debug.logError(ee, errMsg, module); + Debug.logError(ee, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (SQLException se) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorSQLRenderingAttachmentForEmail", UtilMisc.toMap("birtContentType", birtContentType, "errorString", se.toString()), locale); - Debug.logError(se, errMsg, module); + Debug.logError(se, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } } else { @@ -254,7 +254,7 @@ public class BirtEmailServices { serviceContext.put("subject", subject); serviceContext.put("partyId", partyId); - if (Debug.verboseOn()) Debug.logVerbose("sendMailFromScreen sendMail context: " + serviceContext, module); + if (Debug.verboseOn()) Debug.logVerbose("sendMailFromScreen sendMail context: " + serviceContext, MODULE); Map<String, Object> result = ServiceUtil.returnSuccess(); try { @@ -271,7 +271,7 @@ public class BirtEmailServices { } } catch (GenericServiceException e) { String errMsg = UtilProperties.getMessage(resource, "BirtErrorInSendingEmail", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } result.put("body", bodyWriter.toString()); diff --git a/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java b/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java index 539cc34..6b56782 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtMasterReportServices.java @@ -50,7 +50,7 @@ import org.eclipse.birt.report.engine.api.script.IReportContext; public class BirtMasterReportServices { - public static final String module = BirtServices.class.getName(); + public static final String MODULE = BirtServices.class.getName(); public static final String resource = "BirtUiLabels"; public static final String resource_error = "BirtErrorUiLabels"; @@ -144,7 +144,7 @@ public class BirtMasterReportServices { .where(ecl).select("hours", "fromDate", "thruDate") .queryList(); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); ServiceUtil.returnError("Error getting party from person name."); } List<GenericValue> listCompiled = new ArrayList<>(); @@ -362,7 +362,7 @@ public class BirtMasterReportServices { listInvoiceEditable.add(invoiceEditable); } } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "BirtErrorRetrievingTurnOver", locale)); } Map<String, Object> result = ServiceUtil.returnSuccess(); diff --git a/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtServices.java b/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtServices.java index 5a60e2f..c48f676 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtServices.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtServices.java @@ -88,7 +88,7 @@ import com.ibm.icu.util.ULocale; public class BirtServices { - public static final String module = BirtServices.class.getName(); + public static final String MODULE = BirtServices.class.getName(); public static final String resource = "BirtUiLabels"; public static final String resource_error = "BirtErrorUiLabels"; public static final String resourceProduct = "BirtUiLabels"; @@ -101,13 +101,13 @@ public class BirtServices { try { rptGenerator = new ReportDesignGenerator(context, dctx); } catch (Exception e1) { - Debug.logError(e1, module); + Debug.logError(e1, MODULE); return ServiceUtil.returnError(e1.getMessage()); } try { rptGenerator.buildReport(); } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(e.getMessage()); } return ServiceUtil.returnSuccess(); @@ -144,7 +144,7 @@ public class BirtServices { return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorConversionFieldToBirtFailed", locale)); } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorConversionFieldToBirtFailed", locale)); } // make more general when report forms have been made so too. @@ -189,7 +189,7 @@ public class BirtServices { return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorRunningPerformFind", locale)); } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorRunningPerformFind", locale)); } @@ -200,7 +200,7 @@ public class BirtServices { return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorRunningPerformFind", locale)); } } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorRunningPerformFind", locale)); } resultToBirt = ServiceUtil.returnSuccess(); @@ -232,7 +232,7 @@ public class BirtServices { EntityCondition entityCondition = EntityCondition.makeCondition("contentId", masterContentId); masterContentAttribute = EntityQuery.use(delegator).from("ContentAttribute").where(entityCondition).queryFirst(); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorNoAttributeFound", locale)); } @@ -255,7 +255,7 @@ public class BirtServices { } reportContentId = (String) resultContent.get("contentId"); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCannotDetermineDataSource", locale)); } } else if ("Service".equalsIgnoreCase(attrName)) { @@ -268,7 +268,7 @@ public class BirtServices { } reportContentId = (String) resultContent.get("contentId"); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCannotDetermineDataSource", locale)); } } else { @@ -286,7 +286,7 @@ public class BirtServices { } textForm = (String) resultFormDisplay.get("textForm"); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCreatingDefaultSearchForm", locale).concat(": ").concat(e.getMessage())); } @@ -327,7 +327,7 @@ public class BirtServices { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result)); } } catch (GeneralException | SAXException | ParserConfigurationException | IOException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in overrideReportForm service."); //TODO labelise } return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "BirtSearchFormSuccessfullyOverridde", locale)); @@ -390,7 +390,7 @@ public class BirtServices { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result)); } } catch (GeneralException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in createFlexibleReportFromMasterEntityWorkflow service"); //TODO labelise } result.put("contentId", contentId); @@ -429,7 +429,7 @@ public class BirtServices { @SuppressWarnings("unused") // Used only to passively check ModelService modelService = dctx.getModelService(serviceName); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("No service define with name " + serviceName); //TODO labelise } contentId = BirtWorker.recordReportContent(delegator, dispatcher, context); @@ -456,7 +456,7 @@ public class BirtServices { return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCreatingFlexibleReport", locale)); } } catch (GeneralException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCreatingFlexibleReport", locale)); } result.put("contentId", contentId); @@ -547,11 +547,11 @@ public class BirtServices { GenericValue electronicText = EntityQuery.use(delegator).from("ElectronicText").where("dataResourceId", dataResourceId).cache().queryOne(); textData = electronicText.getString("textData"); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in createFormForDisplay service."); //TODO labelise } - if (Debug.infoOn()) Debug.logInfo(textData, module); + if (Debug.infoOn()) Debug.logInfo(textData, MODULE); textData = textData.substring(textData.indexOf("<form "), textData.length()); if (textData.contains("</form>")) { textData = textData.substring(0, textData.indexOf("</form>") + 7); @@ -578,7 +578,7 @@ public class BirtServices { try { listContent = EntityQuery.use(delegator).from("Content").where(entityConditionContent).select("contentId").queryList(); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in deleteAllReports service."); //TODO labelise } if (UtilValidate.isEmpty(listContent)) { @@ -594,7 +594,7 @@ public class BirtServices { } } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in deleteAllReports service."); //TODO labelise } return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "BirtFlexibleReportsSuccessfullyDeleted", locale)); @@ -625,7 +625,7 @@ public class BirtServices { .select("drObjectInfo") .queryList(); } catch (GenericEntityException e1) { - Debug.logError(e1, module); + Debug.logError(e1, MODULE); return ServiceUtil.returnError("Error in deleteFlexibleReport service."); //TODO labelise } if (listRptDesignFileGV.size() > 1) { @@ -639,7 +639,7 @@ public class BirtServices { ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorCannotLocateReportFile", locale)); } } catch (IOException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in deleteFlexibleReport service."); //TODO labelise } try { @@ -653,7 +653,7 @@ public class BirtServices { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result)); } } catch (GenericServiceException | GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in deleteFlexibleReport service."); //TODO labelise } return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "BirtFlexibleReportSuccessfullyDeleted", locale)); @@ -678,7 +678,7 @@ public class BirtServices { IDesignEngineFactory factory = (IDesignEngineFactory) Platform.createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY); engine = factory.createDesignEngine(config); } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise } SessionHandle session = engine.newSessionHandle(ULocale.forLocale(locale)); @@ -693,7 +693,7 @@ public class BirtServices { try { dataResource = EntityQuery.use(delegator).from("DataResource").where("dataResourceId", dataResourceId).queryOne(); } catch (GenericEntityException e1) { - Debug.logError(e1, module); + Debug.logError(e1, MODULE); return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise } String rptDesignName = dataResource.getString("objectInfo"); @@ -701,7 +701,7 @@ public class BirtServices { try { Platform.startup(); } catch (BirtException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Cannot start Birt platform"); } @@ -710,7 +710,7 @@ public class BirtServices { try { designStored = session.openDesign(rptDesignName); } catch (DesignFileException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise } @@ -724,7 +724,7 @@ public class BirtServices { try { iter.remove(); } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise } } @@ -746,7 +746,7 @@ public class BirtServices { Path path = Paths.get(nameTempRpt); Files.deleteIfExists(path); } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "BirtErrorInuploadRptDesignNoFile", locale)); } @@ -761,7 +761,7 @@ public class BirtServices { try { designStored.getCubes().add(copy); } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise } } @@ -777,7 +777,7 @@ public class BirtServices { try { designStored.getBody().add(copy); } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise } } @@ -802,7 +802,7 @@ public class BirtServices { } } } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise } @@ -812,7 +812,7 @@ public class BirtServices { try { designStored.setPageVariable(pageVariable.getName(), pageVariable.getPropertyBindingExpression(pageVariable.getName())); } catch (SemanticException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise } } @@ -841,7 +841,7 @@ public class BirtServices { try { designStored.getStyles().add(copy); } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise } } @@ -850,12 +850,12 @@ public class BirtServices { try { designStored.saveAs(rptDesignName); } catch (IOException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError("Error in uploadRptDesign service."); //TODO labelise } designFromUser.close(); designStored.close(); - if (Debug.infoOn()) Debug.logInfo("####### Design uploaded: ".concat(rptDesignName), module); + if (Debug.infoOn()) Debug.logInfo("####### Design uploaded: ".concat(rptDesignName), MODULE); // TODO check: should we, as a secondary safety precaution, delete any file finishing with _TEMP_.rptdesign? listSuccessMessage.add(UtilProperties.getMessage(resource, "BirtFlexibleRptDesignSuccessfullyUploaded", locale)); diff --git a/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtUtil.java b/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtUtil.java index 9edae19..c1db5f5 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtUtil.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/flexible/BirtUtil.java @@ -39,7 +39,7 @@ import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants; public final class BirtUtil { - public final static String module = BirtUtil.class.getName(); + public final static String MODULE = BirtUtil.class.getName(); private final static Map<String, String> entityFieldTypeBirtTypeMap = MapUtils.unmodifiableMap(UtilMisc.toMap( "id", DesignChoiceConstants.COLUMN_DATA_TYPE_STRING, diff --git a/birt/src/main/java/org/apache/ofbiz/birt/flexible/ReportDesignGenerator.java b/birt/src/main/java/org/apache/ofbiz/birt/flexible/ReportDesignGenerator.java index 0236b3f..832fb7a 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/flexible/ReportDesignGenerator.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/flexible/ReportDesignGenerator.java @@ -66,7 +66,7 @@ import com.ibm.icu.util.ULocale; public class ReportDesignGenerator { - private static final String module = ReportDesignGenerator.class.getName(); + private static final String MODULE = ReportDesignGenerator.class.getName(); private Locale locale; private ElementFactory factory; /** The generated design */ @@ -222,7 +222,7 @@ public class ReportDesignGenerator { design.saveAs(rptDesignName); design.close(); - if (Debug.infoOn())Debug.logInfo("####### Design generated: " + rptDesignName, module); + if (Debug.infoOn())Debug.logInfo("####### Design generated: " + rptDesignName, MODULE); session.closeAll(false); Platform.shutdown(); } @@ -232,7 +232,7 @@ public class ReportDesignGenerator { * <p>This script is used to populate Birt design parameters from input</p> */ private void createScriptedBeforeFactory() { - StringBuffer beforeFactoryScript = new StringBuffer("Debug.logInfo(\"###### In beforeFactory\", module);\n"); + StringBuffer beforeFactoryScript = new StringBuffer("Debug.logInfo(\"###### In beforeFactory\", MODULE);\n"); beforeFactoryScript.append("var inputFields = reportContext.getParameterValue(\"parameters\");\n"); beforeFactoryScript.append("//get a list of all report parameters\n"); beforeFactoryScript.append("var parameters = reportContext.getDesignHandle().getAllParameters();\n"); @@ -262,20 +262,20 @@ public class ReportDesignGenerator { dataSetInitializeScript.append("importPackage(Packages.org.apache.ofbiz.service);\n"); dataSetInitializeScript.append("importPackage(Packages.org.apache.ofbiz.base.util);\n"); dataSetInitializeScript.append("importPackage(java.util);\n"); - dataSetInitializeScript.append("module = \"" + rptDesignName + "\";"); - dataSetInitializeScript.append("Debug.logInfo(\"###### In initialize \", module);"); + dataSetInitializeScript.append("MODULE = \"" + rptDesignName + "\";"); + dataSetInitializeScript.append("Debug.logInfo(\"###### In initialize \", MODULE);"); design.setInitialize(dataSetInitializeScript.toString()); // set open Birt script StringBuffer dataSetOpenScript = new StringBuffer("importPackage(Packages.org.apache.ofbiz.birt);\n"); - dataSetOpenScript.append("Debug.logInfo(\"#### In open\", module)\n"); + dataSetOpenScript.append("Debug.logInfo(\"#### In open\", MODULE)\n"); dataSetOpenScript.append("try {\n"); dataSetOpenScript.append(" listRes = dispatcher.runSync(\"" + serviceName + "\", UtilMisc.toMap(\"userLogin\", reportContext.getParameterValue(\"userLogin\"), \"locale\", reportContext.getParameterValue(\"locale\"), \"reportContext\", reportContext));\n"); dataSetOpenScript.append(" if (ServiceUtil.isError(listRes)) {\n"); dataSetOpenScript.append(" Debug.logError(ServiceUtil.getErrorMessage(listRes));\n"); dataSetOpenScript.append(" }\n"); dataSetOpenScript.append("}\n"); - dataSetOpenScript.append("catch (e) { Debug.logError(e, module); }\n"); + dataSetOpenScript.append("catch (e) { Debug.logError(e, MODULE); }\n"); dataSetOpenScript.append("records = listRes.get(\"records\");\n"); dataSetOpenScript.append("countOfRow = 0;\n"); dataSetOpenScript.append("totalRow = records.size();\n"); diff --git a/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/BirtEngineServlet.java b/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/BirtEngineServlet.java index 9aafe40..37197b6 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/BirtEngineServlet.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/BirtEngineServlet.java @@ -36,7 +36,7 @@ import org.apache.ofbiz.birt.BirtWorker; @SuppressWarnings("serial") public class BirtEngineServlet extends org.eclipse.birt.report.servlet.BirtEngineServlet { - public final static String module = BirtEngineServlet.class.getName(); + public final static String MODULE = BirtEngineServlet.class.getName(); @Override protected IContext __getContext(HttpServletRequest request, HttpServletResponse response) throws BirtException { diff --git a/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/BirtViewerServlet.java b/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/BirtViewerServlet.java index 88cc1d9..108d3d8 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/BirtViewerServlet.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/BirtViewerServlet.java @@ -37,7 +37,7 @@ import org.apache.ofbiz.birt.BirtWorker; @SuppressWarnings("serial") public class BirtViewerServlet extends ViewerServlet { - public final static String module = BirtViewerServlet.class.getName(); + public final static String MODULE = BirtViewerServlet.class.getName(); @Override protected IContext __getContext(HttpServletRequest request, HttpServletResponse response) throws BirtException { diff --git a/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/ViewerServletRequest.java b/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/ViewerServletRequest.java index 55824fe..77deb5e 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/ViewerServletRequest.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/ViewerServletRequest.java @@ -31,7 +31,7 @@ import org.apache.ofbiz.base.util.Debug; public class ViewerServletRequest extends HttpServletRequestWrapper { - public final static String module = ViewerServletRequest.class.getName(); + public final static String MODULE = ViewerServletRequest.class.getName(); protected String originalReportParam = null; @@ -53,7 +53,7 @@ public class ViewerServletRequest extends HttpServletRequestWrapper { try { reportFileUrl = FlexibleLocation.resolveLocation(reportParam, loader); } catch (MalformedURLException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } if (reportFileUrl == null) { throw new IllegalArgumentException("Could not resolve location to URL: " + reportParam); diff --git a/birt/src/main/java/org/apache/ofbiz/birt/webapp/view/BirtViewHandler.java b/birt/src/main/java/org/apache/ofbiz/birt/webapp/view/BirtViewHandler.java index 7077d77..1b72465 100644 --- a/birt/src/main/java/org/apache/ofbiz/birt/webapp/view/BirtViewHandler.java +++ b/birt/src/main/java/org/apache/ofbiz/birt/webapp/view/BirtViewHandler.java @@ -51,7 +51,7 @@ import org.xml.sax.SAXException; public class BirtViewHandler implements ViewHandler { - public static final String module = BirtViewHandler.class.getName(); + public static final String MODULE = BirtViewHandler.class.getName(); public static final String resource_error = "BirtErrorUiLabels"; protected ServletContext servletContext = null; @@ -155,11 +155,11 @@ public class BirtViewHandler implements ViewHandler { throw new ViewHandlerException("general error: " + e.toString(), e); } catch (SAXException se) { String errMsg = "Error SAX rendering " + page + " view handler: " + se.toString(); - Debug.logError(se, errMsg, module); + Debug.logError(se, errMsg, MODULE); throw new ViewHandlerException(errMsg, se); } catch (ParserConfigurationException pe) { String errMsg = "Error parser rendering " + page + " view handler: " + pe.toString(); - Debug.logError(pe, errMsg, module); + Debug.logError(pe, errMsg, MODULE); throw new ViewHandlerException(errMsg, pe); } } diff --git a/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java b/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java index 78f2006..0f0cedc 100644 --- a/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java +++ b/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java @@ -59,7 +59,7 @@ import org.w3c.dom.Element; public class EbayHelper { private static final String configFileName = "ebayExport.properties"; - private static final String module = EbayHelper.class.getName(); + private static final String MODULE = EbayHelper.class.getName(); public static final String resource = "EbayUiLabels"; public static Map<String, Object> buildEbayConfig(Map<String, Object> context, Delegator delegator) { @@ -105,7 +105,7 @@ public class EbayHelper { public static Map<String, Object> postItem(String postItemsUrl, StringBuffer generatedXmlData, String devID, String appID, String certID, String callName, String compatibilityLevel, String siteID) throws IOException { if (Debug.verboseOn()) { - Debug.logVerbose("Request of " + callName + " To eBay:\n" + generatedXmlData.toString(), module); + Debug.logVerbose("Request of " + callName + " To eBay:\n" + generatedXmlData.toString(), MODULE); } HttpURLConnection connection = (HttpURLConnection) (new URL(postItemsUrl)).openConnection(); connection.setDoInput(true); @@ -137,7 +137,7 @@ public class EbayHelper { result = ServiceUtil.returnFailure(EbayHelper.toString(inputStream)); } if (Debug.verboseOn()) { - Debug.logVerbose("Response of " + callName + " From eBay:\n" + response, module); + Debug.logVerbose("Response of " + callName + " From eBay:\n" + response, MODULE); } return result; } @@ -184,7 +184,7 @@ public class EbayHelper { shipmentMethodTypeId = ebayShippingMethod.getString("shipmentMethodTypeId"); } } catch (GenericEntityException e) { - Debug.logInfo("Unable to find EbayShippingMethod", module); + Debug.logInfo("Unable to find EbayShippingMethod", MODULE); } cart.setAllCarrierPartyId(partyId); cart.setAllShipmentMethodTypeId(shipmentMethodTypeId); @@ -222,10 +222,10 @@ public class EbayHelper { } } } catch (GenericEntityException gee) { - Debug.logError(gee, "Cannot get payment preferences for order #" + orderId, module); + Debug.logError(gee, "Cannot get payment preferences for order #" + orderId, MODULE); return false; } catch (Exception e) { - Debug.logError(e, "Cannot get payment preferences for order #" + orderId, module); + Debug.logError(e, "Cannot get payment preferences for order #" + orderId, MODULE); return false; } return true; @@ -254,19 +254,19 @@ public class EbayHelper { "orderPaymentPreferenceId", paymentPreference.get("orderPaymentPreferenceId"), "paymentFromId", partyIdFrom, "paymentRefNum", externalId, "comments", "Payment receive via eBay")); if (ServiceUtil.isError(results)) { - Debug.logError(ServiceUtil.getErrorMessage(results) + " - " + results, module); + Debug.logError(ServiceUtil.getErrorMessage(results) + " - " + results, MODULE); } if ((results == null) || (results.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR))) { - Debug.logError((String) results.get(ModelService.ERROR_MESSAGE), module); + Debug.logError((String) results.get(ModelService.ERROR_MESSAGE), MODULE); return false; } return true; } catch (GenericEntityException e) { - Debug.logError(e, "Failed to create the payment for order " + orderId, module); + Debug.logError(e, "Failed to create the payment for order " + orderId, MODULE); return false; } catch (GenericServiceException e) { - Debug.logError(e, "Failed to create the payment for order " + orderId, module); + Debug.logError(e, "Failed to create the payment for order " + orderId, MODULE); return false; } } @@ -291,7 +291,7 @@ public class EbayHelper { } orderAdjustment = delegator.makeValue("OrderAdjustment", inputMap); } catch (Exception e) { - Debug.logError(e, "Failed to made order adjustment for order " + orderId, module); + Debug.logError(e, "Failed to made order adjustment for order " + orderId, MODULE); } return orderAdjustment; } @@ -301,7 +301,7 @@ public class EbayHelper { try { if (UtilValidate.isNotEmpty(name) && userLogin != null) { - if (Debug.verboseOn()) Debug.logVerbose("Creating Customer Party: " + name, module); + if (Debug.verboseOn()) Debug.logVerbose("Creating Customer Party: " + name, MODULE); // Try to split the lastname from the firstname String firstName = ""; @@ -319,23 +319,23 @@ public class EbayHelper { name, "firstName", firstName, "lastName", lastName, "userLogin", userLogin, "comments", "Created via eBay")); if (ServiceUtil.isError(summaryResult)) { - Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, module); + Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, MODULE); return null; } partyId = (String) summaryResult.get("partyId"); - if (Debug.verboseOn()) Debug.logVerbose("Created Customer Party: " + partyId, module); + if (Debug.verboseOn()) Debug.logVerbose("Created Customer Party: " + partyId, MODULE); } } catch (GenericServiceException e) { - Debug.logError(e, "Failed to createPerson", module); + Debug.logError(e, "Failed to createPerson", MODULE); } catch (Exception e) { - Debug.logError(e, "Failed to createPerson", module); + Debug.logError(e, "Failed to createPerson", MODULE); } return partyId; } public static String createAddress(LocalDispatcher dispatcher, String partyId, GenericValue userLogin, String contactMechPurposeTypeId, Map<String, Object> address) { - Debug.logInfo("Creating postal address with input map: " + address, module); + Debug.logInfo("Creating postal address with input map: " + address, MODULE); String contactMechId = null; try { Map<String, Object> context = new HashMap<>(); @@ -354,7 +354,7 @@ public class EbayHelper { Map<String, Object> summaryResult = dispatcher.runSync("createPartyPostalAddress", context); if (ServiceUtil.isError(summaryResult)) { - Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, module); + Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, MODULE); return null; } contactMechId = (String) summaryResult.get("contactMechId"); @@ -366,11 +366,11 @@ public class EbayHelper { context.put("userLogin", userLogin); summaryResult = dispatcher.runSync("createPartyContactMechPurpose", context); if (ServiceUtil.isError(summaryResult)) { - Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, module); + Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, MODULE); return null; } } catch (GenericServiceException e) { - Debug.logError(e, "Failed to createAddress", module); + Debug.logError(e, "Failed to createAddress", MODULE); } return contactMechId; } @@ -378,7 +378,7 @@ public class EbayHelper { public static void correctCityStateCountry(LocalDispatcher dispatcher, Map<String, Object> map, String city, String state, String country) { try { String geoCode = null; - Debug.logInfo("correctCityStateCountry params: " + city + ", " + state + ", " + country, module); + Debug.logInfo("correctCityStateCountry params: " + city + ", " + state + ", " + country, MODULE); if (UtilValidate.isEmpty(country)) { geoCode = "US"; } @@ -389,7 +389,7 @@ public class EbayHelper { if (UtilValidate.isEmpty(geoCode)) { geoCode = country; } - Debug.logInfo("GeoCode: " + geoCode, module); + Debug.logInfo("GeoCode: " + geoCode, MODULE); Map<String, Object> outMap = getCountryGeoId(dispatcher.getDelegator(), geoCode); String geoId = (String) outMap.get("geoId"); if (UtilValidate.isEmpty(geoId)) { @@ -397,7 +397,7 @@ public class EbayHelper { } map.put("countryGeoId", geoId); country = geoId; - Debug.logInfo("Country geoid: " + geoId, module); + Debug.logInfo("Country geoid: " + geoId, MODULE); if ("USA".equals(geoId) || "CAN".equals(geoId)) { if (UtilValidate.isNotEmpty(state)) { map.put("stateProvinceGeoId", state.toUpperCase()); @@ -406,9 +406,9 @@ public class EbayHelper { } else { map.put("city", city + ", " + state); } - Debug.logInfo("State geoid: " + state, module); + Debug.logInfo("State geoid: " + state, MODULE); } catch (Exception e) { - Debug.logError(e, "Failed to correctCityStateCountry", module); + Debug.logError(e, "Failed to correctCityStateCountry", MODULE); } } @@ -425,12 +425,12 @@ public class EbayHelper { context.put("contactMechPurposeTypeId", "PHONE_SHIPPING"); summaryResult = dispatcher.runSync("createPartyTelecomNumber", context); if (ServiceUtil.isError(summaryResult)) { - Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, module); + Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, MODULE); return null; } phoneContactMechId = (String) summaryResult.get("contactMechId"); } catch (GenericServiceException e) { - Debug.logError(e, "Failed to createPartyPhone", module); + Debug.logError(e, "Failed to createPartyPhone", MODULE); } return phoneContactMechId; } @@ -448,7 +448,7 @@ public class EbayHelper { context.put("contactMechTypeId", "EMAIL_ADDRESS"); summaryResult = dispatcher.runSync("createEmailAddress", context); if (ServiceUtil.isError(summaryResult)) { - Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, module); + Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, MODULE); } emailContactMechId = (String) summaryResult.get("contactMechId"); @@ -459,11 +459,11 @@ public class EbayHelper { context.put("userLogin", userLogin); summaryResult = dispatcher.runSync("createPartyContactMech", context); if (ServiceUtil.isError(summaryResult)) { - Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, module); + Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, MODULE); } } } catch (GenericServiceException e) { - Debug.logError(e, "Failed to createPartyEmail", module); + Debug.logError(e, "Failed to createPartyEmail", MODULE); } return emailContactMechId; } @@ -480,7 +480,7 @@ public class EbayHelper { context.put("userLogin", userLogin); summaryResult = dispatcher.runSync("createPartyAttribute", context); if (ServiceUtil.isError(summaryResult)) { - Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, module); + Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, MODULE); } } catch (GenericServiceException e) { Debug.logError(e, "Failed to create eBay EIAS party attribute"); @@ -496,7 +496,7 @@ public class EbayHelper { context.put("userLogin", userLogin); summaryResult = dispatcher.runSync("createPartyAttribute", context); if (ServiceUtil.isError(summaryResult)) { - Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, module); + Debug.logError(ServiceUtil.getErrorMessage(summaryResult) + " - " + summaryResult, MODULE); } } catch (GenericServiceException e) { Debug.logError(e, "Failed to create eBay userId party attribute"); @@ -507,10 +507,10 @@ public class EbayHelper { public static Map<String, Object> getCountryGeoId(Delegator delegator, String geoCode) { GenericValue geo = null; try { - Debug.logInfo("geocode: " + geoCode, module); + Debug.logInfo("geocode: " + geoCode, MODULE); geo = EntityQuery.use(delegator).from("Geo").where("geoCode", geoCode.toUpperCase(), "geoTypeId", "COUNTRY").queryFirst(); - Debug.logInfo("Found a geo entity " + geo, module); + Debug.logInfo("Found a geo entity " + geo, MODULE); if (UtilValidate.isEmpty(geo)) { geo = delegator.makeValue("Geo"); geo.set("geoId", geoCode + "_IMPORTED"); @@ -519,11 +519,11 @@ public class EbayHelper { geo.set("geoCode", geoCode + "_IMPORTED"); geo.set("abbreviation", geoCode + "_IMPORTED"); delegator.create(geo); - Debug.logInfo("Creating new geo entity: " + geo, module); + Debug.logInfo("Creating new geo entity: " + geo, MODULE); } } catch (GenericEntityException e) { String errMsg = "Failed to find/setup geo id"; - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } @@ -571,12 +571,12 @@ public class EbayHelper { return contactMechId; } } catch (Exception e) { - Debug.logError(e, "Problem with verifying postal addresses for contactMechId " + contactMechId + ".", module); + Debug.logError(e, "Problem with verifying postal addresses for contactMechId " + contactMechId + ".", MODULE); } } // none of the existing contact mechs/postal addresses match (or none // were found). Create a new one and return the related contact mech id. - Debug.logInfo("Unable to find matching postal address for partyId " + partyId + ". Creating a new one.", module); + Debug.logInfo("Unable to find matching postal address for partyId " + partyId + ". Creating a new one.", MODULE); return createAddress(dispatcher, partyId, userLogin, "SHIPPING_LOCATION", context); } @@ -601,7 +601,7 @@ public class EbayHelper { } // none of the existing contact mechs/email addresses match (or none // were found). Create a new one and return the related contact mech id. - Debug.logInfo("Unable to find matching postal address for partyId " + partyId + ". Creating a new one.", module); + Debug.logInfo("Unable to find matching postal address for partyId " + partyId + ". Creating a new one.", MODULE); return createPartyEmail(dispatcher, partyId, (String) context.get("emailBuyer"), userLogin); } @@ -630,12 +630,12 @@ public class EbayHelper { return contactMechId; } } catch (GenericEntityException e) { - Debug.logError("Problem with verifying phone number for contactMechId " + contactMechId + ".", module); + Debug.logError("Problem with verifying phone number for contactMechId " + contactMechId + ".", MODULE); } } // none of the existing contact mechs/email addresses match (or none // were found). Create a new one and return the related contact mech id. - Debug.logInfo("Unable to find matching postal address for partyId " + partyId + ". Creating a new one.", module); + 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); } diff --git a/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java b/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java index 7efd0ad..810a046 100644 --- a/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java +++ b/ebay/src/main/java/org/apache/ofbiz/ebay/EbayOrderServices.java @@ -58,7 +58,7 @@ import org.w3c.dom.Element; public class EbayOrderServices { private static final String resource = "EbayUiLabels"; - private static final String module = EbayOrderServices.class.getName(); + private static final String MODULE = EbayOrderServices.class.getName(); private static boolean isGetSellerTransactionsCall = false; private static boolean isGetOrdersCall = false; private static boolean isGetMyeBaySellingCall = false; @@ -140,7 +140,7 @@ public class EbayOrderServices { } result = createShoppingCart(delegator, dispatcher, locale, context, true); } catch (Exception e) { - Debug.logError("Exception in importOrderFromEbay " + e, module); + Debug.logError("Exception in importOrderFromEbay " + e, MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionInImportOrderFromEbay", locale)); } if (UtilValidate.isNotEmpty(orderImportSuccessMessageList)) { @@ -182,21 +182,21 @@ public class EbayOrderServices { if (fromDateOut != null) { UtilXml.addChildElementValue(transElem, "CreateTimeFrom", fromDateOut, transDoc); } else { - Debug.logError("Cannot convert from date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", module); + Debug.logError("Cannot convert from date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.cannotConvertFromDate", locale)); } fromDateOut = EbayHelper.convertDate(thruDate, "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); if (fromDateOut != null) { UtilXml.addChildElementValue(transElem, "CreateTimeTo", fromDateOut, transDoc); } else { - Debug.logError("Cannot convert thru date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", module); + Debug.logError("Cannot convert thru date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.cannotConvertThruDate", locale)); } } - //Debug.logInfo("The value of generated string is ======= " + UtilXml.writeXmlDocument(transDoc), module); + //Debug.logInfo("The value of generated string is ======= " + UtilXml.writeXmlDocument(transDoc), MODULE); dataItemsXml.append(UtilXml.writeXmlDocument(transDoc)); } catch (Exception e) { - Debug.logError("Exception during building get seller transactions request", module); + Debug.logError("Exception during building get seller transactions request", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionDuringBuildingGetSellerTransactionRequest", locale)); } return ServiceUtil.returnSuccess(); @@ -219,7 +219,7 @@ public class EbayOrderServices { if (fromDateOut != null) { UtilXml.addChildElementValue(transElem, "ModTimeFrom", fromDateOut, transDoc); } else { - Debug.logError("Cannot convert from date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", module); + Debug.logError("Cannot convert from date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.cannotConvertFromDate", locale)); } @@ -227,13 +227,13 @@ public class EbayOrderServices { if (fromDateOut != null) { UtilXml.addChildElementValue(transElem, "ModTimeTo", fromDateOut, transDoc); } else { - Debug.logError("Cannot convert thru date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", module); + Debug.logError("Cannot convert thru date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.cannotConvertThruDate", locale)); } - //Debug.logInfo("The value of generated string is ======= " + UtilXml.writeXmlDocument(transDoc), module); + //Debug.logInfo("The value of generated string is ======= " + UtilXml.writeXmlDocument(transDoc), MODULE); sellerTransactionsItemsXml.append(UtilXml.writeXmlDocument(transDoc)); } catch (Exception e) { - Debug.logError("Exception during building get seller transactions request", module); + Debug.logError("Exception during building get seller transactions request", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionDuringBuildingGetSellerTransactionRequest", locale)); } return ServiceUtil.returnSuccess(); @@ -250,10 +250,10 @@ public class EbayOrderServices { 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); + //Debug.logInfo("The value of generated string is ======= " + UtilXml.writeXmlDocument(transDoc), MODULE); getMyeBaySellingXml.append(UtilXml.writeXmlDocument(transDoc)); } catch (Exception e) { - Debug.logError("Exception during building MyeBaySelling request", module); + Debug.logError("Exception during building MyeBaySelling request", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionDuringBuildingMyeBaySellingRequest", locale)); } return ServiceUtil.returnSuccess(); @@ -281,7 +281,7 @@ public class EbayOrderServices { // for now fetching only deleted transaction & orders value from the sold list. List<String> eBayDeletedOrdersAndTransactionList = readGetMyeBaySellingResponse(responseMsg, locale, (String) context.get("productStoreId"), delegator, dispatcher, errorMessage, userLogin); if (UtilValidate.isNotEmpty(eBayDeletedOrdersAndTransactionList)) { - Debug.logInfo("The value of getMyeBaySellingList" + eBayDeletedOrdersAndTransactionList, module); + Debug.logInfo("The value of getMyeBaySellingList" + eBayDeletedOrdersAndTransactionList, MODULE); Iterator<Map<String, Object>> orderListIter = orderList.iterator(); while (orderListIter.hasNext()) { Map<String, Object> orderCtx = orderListIter.next(); @@ -293,7 +293,7 @@ public class EbayOrderServices { } } if (UtilValidate.isEmpty(orderList)) { - Debug.logError("No orders found", module); + Debug.logError("No orders found", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.noOrdersFound", locale)); } if (UtilValidate.isNotEmpty(orderList)) { @@ -426,7 +426,7 @@ public class EbayOrderServices { List<Map<String, Object>> fetchedOrders = new LinkedList<>(); try { Document docResponse = UtilXml.readXmlDocument(responseMsg, true); - //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), module); + //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), MODULE); Element elemResponse = docResponse.getDocumentElement(); String ack = UtilXml.childElementValue(elemResponse, "Ack", "Failure"); @@ -616,7 +616,7 @@ public class EbayOrderServices { } } } - //Debug.logInfo("The generated string is ======= " + fetchedOrders.toString(), module); + //Debug.logInfo("The generated string is ======= " + fetchedOrders.toString(), MODULE); } else { List<? extends Element> errorList = UtilXml.childElementList(elemResponse, "Errors"); Iterator<? extends Element> errorElemIter = errorList.iterator(); @@ -626,7 +626,7 @@ public class EbayOrderServices { } } } catch (Exception e) { - Debug.logError("Exception during read response from Ebay", module); + Debug.logError("Exception during read response from Ebay", MODULE); } return fetchedOrders; } @@ -635,7 +635,7 @@ public class EbayOrderServices { List<Map<String, Object>> fetchedOrders = new LinkedList<>(); try { Document docResponse = UtilXml.readXmlDocument(responseMsg, true); - //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), module); + //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), MODULE); Element elemResponse = docResponse.getDocumentElement(); String ack = UtilXml.childElementValue(elemResponse, "Ack", "Failure"); List<? extends Element> paginationList = UtilXml.childElementList(elemResponse, "PaginationResult"); @@ -909,7 +909,7 @@ public class EbayOrderServices { } } } catch (Exception e) { - Debug.logError("Exception during read response from Ebay", module); + Debug.logError("Exception during read response from Ebay", MODULE); } return fetchedOrders; } @@ -918,7 +918,7 @@ public class EbayOrderServices { List<String> fetchDeletedOrdersAndTransactions = new LinkedList<>(); try { Document docResponse = UtilXml.readXmlDocument(responseMsg, true); - //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), module); + //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), MODULE); Element elemResponse = docResponse.getDocumentElement(); String ack = UtilXml.childElementValue(elemResponse, "Ack", "Failure"); @@ -974,7 +974,7 @@ public class EbayOrderServices { } } } catch (Exception e) { - Debug.logError("Exception during read response from Ebay", module); + Debug.logError("Exception during read response from Ebay", MODULE); } return fetchDeletedOrdersAndTransactions; } @@ -1101,7 +1101,7 @@ public class EbayOrderServices { } // order has to be created ? if (create) { - Debug.logInfo("Importing new order from eBay", module); + Debug.logInfo("Importing new order from eBay", MODULE); // set partyId to String partyId = null; String contactMechId = null; @@ -1133,7 +1133,7 @@ public class EbayOrderServices { if (UtilValidate.isNotEmpty(shipInfo)) { GenericValue first = EntityUtil.getFirst(shipInfo); partyId = first.getString("partyId"); - Debug.logInfo("Existing shipping address found for : (party: " + partyId + ")", module); + Debug.logInfo("Existing shipping address found for : (party: " + partyId + ")", MODULE); } } @@ -1148,7 +1148,7 @@ public class EbayOrderServices { // 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); + Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, MODULE); GenericValue party = EntityQuery.use(delegator).from("Party").where("partyId", partyId).queryOne(); contactMechId = EbayHelper.setShippingAddressContactMech(dispatcher, delegator, party, userLogin, shippingAddressCtx); @@ -1161,10 +1161,10 @@ public class EbayOrderServices { // create party if none exists already if (UtilValidate.isEmpty(partyId)) { - Debug.logInfo("Creating new party for the eBay buyer.", module); + Debug.logInfo("Creating new party for the eBay buyer.", MODULE); partyId = EbayHelper.createCustomerParty(dispatcher, (String) shippingAddressCtx.get("buyerName"), userLogin); if (UtilValidate.isEmpty(partyId)) { - Debug.logWarning("Using admin party for the eBay buyer.", module); + Debug.logWarning("Using admin party for the eBay buyer.", MODULE); partyId = "admin"; } } @@ -1176,41 +1176,41 @@ public class EbayOrderServices { if (UtilValidate.isNotEmpty(buyerCtx)) { eiasTokenBuyer = (String) buyerCtx.get("eiasTokenBuyer"); } - Debug.logInfo("Creating new postal address for party: " + partyId, module); + Debug.logInfo("Creating new postal address for party: " + partyId, MODULE); contactMechId = EbayHelper.createAddress(dispatcher, partyId, userLogin, "SHIPPING_LOCATION", shippingAddressCtx); if (UtilValidate.isEmpty(contactMechId)) { return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "EbayStoreUnableToCreatePostalAddress", locale) + shippingAddressCtx); } - Debug.logInfo("Created postal address: " + contactMechId, module); - Debug.logInfo("Creating new phone number for party: " + partyId, module); + Debug.logInfo("Created postal address: " + contactMechId, MODULE); + Debug.logInfo("Creating new phone number for party: " + partyId, MODULE); EbayHelper.createPartyPhone(dispatcher, partyId, (String) shippingAddressCtx.get("shippingAddressPhone"), userLogin); - Debug.logInfo("Creating association to eBay buyer for party: " + partyId, module); + Debug.logInfo("Creating association to eBay buyer for party: " + partyId, MODULE); EbayHelper.createEbayCustomer(dispatcher, partyId, (String) context.get("ebayUserIdBuyer"), eiasTokenBuyer, userLogin); String emailBuyer = (String) context.get("emailBuyer"); if (UtilValidate.isNotEmpty(emailBuyer) && !"Invalid Request".equalsIgnoreCase(emailBuyer)) { - Debug.logInfo("Creating new email for party: " + partyId, module); + Debug.logInfo("Creating new email for party: " + partyId, MODULE); EbayHelper.createPartyEmail(dispatcher, partyId, emailBuyer, userLogin); } } - Debug.logInfo("Setting cart roles for party: " + partyId, module); + Debug.logInfo("Setting cart roles for party: " + partyId, MODULE); cart.setBillToCustomerPartyId(partyId); cart.setPlacingCustomerPartyId(partyId); cart.setShipToCustomerPartyId(partyId); cart.setEndUserCustomerPartyId(partyId); - Debug.logInfo("Setting contact mech in cart: " + contactMechId, module); + Debug.logInfo("Setting contact mech in cart: " + contactMechId, MODULE); cart.setAllShippingContactMechId(contactMechId); cart.setAllMaySplit(Boolean.FALSE); - Debug.logInfo("Setting shipment method: " + (String) shippingServiceSelectedCtx.get("shippingService"), module); + Debug.logInfo("Setting shipment method: " + (String) shippingServiceSelectedCtx.get("shippingService"), MODULE); EbayHelper.setShipmentMethodType(cart, (String) shippingServiceSelectedCtx.get("shippingService"), productStoreId, delegator); cart.makeAllShipGroupInfos(dispatcher); // create the order - Debug.logInfo("Creating CheckOutHelper.", module); + Debug.logInfo("Creating CheckOutHelper.", MODULE); CheckOutHelper checkout = new CheckOutHelper(dispatcher, delegator, cart); - Debug.logInfo("Creating order.", module); + Debug.logInfo("Creating order.", MODULE); Map<?, ?> orderCreate = checkout.createOrder(userLogin); if ("error".equals(orderCreate.get("responseMessage"))) { @@ -1218,7 +1218,7 @@ public class EbayOrderServices { return ServiceUtil.returnError(errorMessageList); } String orderId = (String) orderCreate.get("orderId"); - Debug.logInfo("Created order with id: " + orderId, module); + 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 + ")."; @@ -1227,20 +1227,20 @@ public class EbayOrderServices { // approve the order if (UtilValidate.isNotEmpty(orderId)) { - Debug.logInfo("Approving order with id: " + orderId, module); + Debug.logInfo("Approving order with id: " + orderId, MODULE); boolean approved = OrderChangeHelper.approveOrder(dispatcher, userLogin, orderId); - Debug.logInfo("Order approved with result: " + approved, module); + Debug.logInfo("Order approved with result: " + approved, MODULE); // create the payment from the preference if (approved) { - Debug.logInfo("Creating payment for approved order.", module); + Debug.logInfo("Creating payment for approved order.", MODULE); EbayHelper.createPaymentFromPaymentPreferences(delegator, dispatcher, userLogin, orderId, externalId, cart.getOrderDate(), amountPaid, partyId); - Debug.logInfo("Payment created.", module); + Debug.logInfo("Payment created.", MODULE); } } } } catch (Exception e) { - Debug.logError("Exception in createShoppingCart: " + e.getMessage(), module); + Debug.logError("Exception in createShoppingCart: " + e.getMessage(), MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionInCreateShoppingCart", locale) + ": " + e.getMessage()); } return ServiceUtil.returnSuccess(); @@ -1248,7 +1248,7 @@ public class EbayOrderServices { // Made some changes transactionId removed. private static GenericValue externalOrderExists(Delegator delegator, String externalId) throws GenericEntityException { - Debug.logInfo("Checking for existing externalId: " + externalId, module); + Debug.logInfo("Checking for existing externalId: " + externalId, MODULE); EntityCondition condition = EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("externalId", EntityComparisonOperator.EQUALS, externalId), EntityCondition.makeCondition("statusId", EntityComparisonOperator.NOT_EQUAL, "ORDER_CANCELLED")), EntityComparisonOperator.AND); GenericValue orderHeader = EntityQuery.use(delegator).from("OrderHeader") .where(condition) diff --git a/ebay/src/main/java/org/apache/ofbiz/ebay/ImportOrdersFromEbay.java b/ebay/src/main/java/org/apache/ofbiz/ebay/ImportOrdersFromEbay.java index 72fc480..716a4ed 100755 --- a/ebay/src/main/java/org/apache/ofbiz/ebay/ImportOrdersFromEbay.java +++ b/ebay/src/main/java/org/apache/ofbiz/ebay/ImportOrdersFromEbay.java @@ -54,7 +54,7 @@ import org.w3c.dom.Element; public class ImportOrdersFromEbay { private static final String resource = "EbayUiLabels"; - private static final String module = ImportOrdersFromEbay.class.getName(); + private static final String MODULE = ImportOrdersFromEbay.class.getName(); public static Map<String, Object> importOrdersSearchFromEbay(DispatchContext dctx, Map<String, Object> context) { Delegator delegator = dctx.getDelegator(); @@ -73,7 +73,7 @@ public class ImportOrdersFromEbay { } } } catch (Exception e) { - Debug.logError("Exception in importOrdersSearchFromEbay " + e, module); + Debug.logError("Exception in importOrdersSearchFromEbay " + e, MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionInImportOrdersSearchFromEbay", locale)); } @@ -116,7 +116,7 @@ public class ImportOrdersFromEbay { result = createShoppingCart(delegator, dispatcher, locale, order, true); } catch (Exception e) { - Debug.logError("Exception in importOrderFromEbay " + e, module); + Debug.logError("Exception in importOrderFromEbay " + e, MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionInImportOrderFromEbay", locale)); } @@ -132,7 +132,7 @@ public class ImportOrdersFromEbay { Map<String, Object> result = new HashMap<>(); try { if (orderId == null && externalId == null) { - Debug.logError("orderId or externalId must be filled", module); + Debug.logError("orderId or externalId must be filled", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.orderIdOrExternalIdAreMandatory", locale)); } @@ -142,7 +142,7 @@ public class ImportOrdersFromEbay { // from eBay (i.e. sales channel = EBAY_CHANNEL and externalId is set) orderHeader = EntityQuery.use(delegator).from("OrderHeader").where("orderId", orderId).queryOne(); if (orderHeader == null) { - Debug.logError("Cannot find order with orderId [" + orderId + "]", module); + Debug.logError("Cannot find order with orderId [" + orderId + "]", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.errorRetrievingOrderFromOrderId", locale)); } @@ -175,7 +175,7 @@ public class ImportOrdersFromEbay { } } } catch (Exception e) { - Debug.logError("Exception in setEbayOrderToComplete " + e, module); + Debug.logError("Exception in setEbayOrderToComplete " + e, MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionInSetEbayOrderToComplete", locale)); } return ServiceUtil.returnSuccess(); @@ -185,10 +185,10 @@ public class ImportOrdersFromEbay { StringBuffer errorMessage = new StringBuffer(); List<Map<String, Object>> orders = readResponseFromEbay(response, locale, (String)context.get("productStoreId"), delegator, errorMessage); if (orders == null) { - Debug.logError("Error :" + errorMessage.toString(), module); + Debug.logError("Error :" + errorMessage.toString(), MODULE); return ServiceUtil.returnFailure(errorMessage.toString()); } else if (orders.size() == 0) { - Debug.logError("No orders found", module); + Debug.logError("No orders found", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.noOrdersFound", locale)); } else { Iterator<Map<String, Object>> orderIter = orders.iterator(); @@ -228,7 +228,7 @@ public class ImportOrdersFromEbay { if (fromDateOut != null) { UtilXml.addChildElementValue(transElem, "ModTimeFrom", fromDateOut, transDoc); } else { - Debug.logError("Cannot convert from date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", module); + Debug.logError("Cannot convert from date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.cannotConvertFromDate", locale)); } @@ -237,13 +237,13 @@ public class ImportOrdersFromEbay { if (fromDateOut != null) { UtilXml.addChildElementValue(transElem, "ModTimeTo", fromDateOut, transDoc); } else { - Debug.logError("Cannot convert thru date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", module); + Debug.logError("Cannot convert thru date from yyyy-MM-dd HH:mm:ss.SSS date format to yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.cannotConvertThruDate", locale)); } - //Debug.logInfo("The value of generated string is ======= " + UtilXml.writeXmlDocument(transDoc), module); + //Debug.logInfo("The value of generated string is ======= " + UtilXml.writeXmlDocument(transDoc), MODULE); dataItemsXml.append(UtilXml.writeXmlDocument(transDoc)); } catch (Exception e) { - Debug.logError("Exception during building get seller transactions request", module); + Debug.logError("Exception during building get seller transactions request", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionDuringBuildingGetSellerTransactionRequest", locale)); } return ServiceUtil.returnSuccess(); @@ -307,7 +307,7 @@ public class ImportOrdersFromEbay { dataItemsXml.append(UtilXml.writeXmlDocument(transDoc)); } catch (Exception e) { - Debug.logError("Exception during building complete sale request", module); + Debug.logError("Exception during building complete sale request", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionDuringBuildingCompleteSaleRequest", locale)); } return ServiceUtil.returnSuccess(); @@ -338,7 +338,7 @@ public class ImportOrdersFromEbay { List<Map<String, Object>> orders = null; try { Document docResponse = UtilXml.readXmlDocument(msg, true); - //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), module); + //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(docResponse), MODULE); Element elemResponse = docResponse.getDocumentElement(); String ack = UtilXml.childElementValue(elemResponse, "Ack", "Failure"); List<? extends Element> paginationList = UtilXml.childElementList(elemResponse, "PaginationResult"); @@ -582,7 +582,7 @@ public class ImportOrdersFromEbay { } } } catch (Exception e) { - Debug.logError("Exception during read response from Ebay", module); + Debug.logError("Exception during read response from Ebay", MODULE); } return orders; } @@ -721,7 +721,7 @@ public class ImportOrdersFromEbay { // order has to be created ? if (create) { - Debug.logInfo("Importing new order from eBay", module); + Debug.logInfo("Importing new order from eBay", MODULE); // set partyId to String partyId = null; String contactMechId = ""; @@ -733,7 +733,7 @@ public class ImportOrdersFromEbay { // if we get a party, check its contact information. if (UtilValidate.isNotEmpty(partyAttribute)) { partyId = (String) partyAttribute.get("partyId"); - Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, module); + Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, MODULE); GenericValue party = EntityQuery.use(delegator).from("Party").where("partyId", partyId).queryOne(); contactMechId = EbayHelper.setShippingAddressContactMech(dispatcher, delegator, party, userLogin, parameters); @@ -746,73 +746,73 @@ public class ImportOrdersFromEbay { // create party if none exists already if (UtilValidate.isEmpty(partyId)) { - Debug.logInfo("Creating new party for the eBay buyer.", module); + Debug.logInfo("Creating new party for the eBay buyer.", MODULE); partyId = EbayHelper.createCustomerParty(dispatcher, (String) parameters.get("buyerName"), userLogin); if (UtilValidate.isEmpty(partyId)) { - Debug.logWarning("Using admin party for the eBay buyer.", module); + Debug.logWarning("Using admin party for the eBay buyer.", MODULE); partyId = "admin"; } } // create new party's contact information if (UtilValidate.isEmpty(contactMechId)) { - Debug.logInfo("Creating new postal address for party: " + partyId, module); + Debug.logInfo("Creating new postal address for party: " + partyId, MODULE); contactMechId = EbayHelper.createAddress(dispatcher, partyId, userLogin, "SHIPPING_LOCATION", parameters); if (UtilValidate.isEmpty(contactMechId)) { return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "EbayUnableToCreatePostalAddress", locale) + parameters); } - Debug.logInfo("Created postal address: " + contactMechId, module); - Debug.logInfo("Creating new phone number for party: " + partyId, module); + Debug.logInfo("Created postal address: " + contactMechId, MODULE); + Debug.logInfo("Creating new phone number for party: " + partyId, MODULE); EbayHelper.createPartyPhone(dispatcher, partyId, (String) parameters.get("shippingAddressPhone"), userLogin); - Debug.logInfo("Creating association to eBay buyer for party: " + partyId, module); + Debug.logInfo("Creating association to eBay buyer for party: " + partyId, MODULE); EbayHelper.createEbayCustomer(dispatcher, partyId, (String) parameters.get("ebayUserIdBuyer"), (String) parameters.get("eiasTokenBuyer"), userLogin); String emailBuyer = (String) parameters.get("emailBuyer"); if (UtilValidate.isNotEmpty(emailBuyer) && !"Invalid Request".equalsIgnoreCase(emailBuyer)) { - Debug.logInfo("Creating new email for party: " + partyId, module); + Debug.logInfo("Creating new email for party: " + partyId, MODULE); EbayHelper.createPartyEmail(dispatcher, partyId, emailBuyer, userLogin); } } - Debug.logInfo("Setting cart roles for party: " + partyId, module); + Debug.logInfo("Setting cart roles for party: " + partyId, MODULE); cart.setBillToCustomerPartyId(partyId); cart.setPlacingCustomerPartyId(partyId); cart.setShipToCustomerPartyId(partyId); cart.setEndUserCustomerPartyId(partyId); - Debug.logInfo("Setting contact mech in cart: " + contactMechId, module); + Debug.logInfo("Setting contact mech in cart: " + contactMechId, MODULE); cart.setAllShippingContactMechId(contactMechId); cart.setAllMaySplit(Boolean.FALSE); - Debug.logInfo("Setting shipment method: " + (String) parameters.get("shippingService"), module); + Debug.logInfo("Setting shipment method: " + (String) parameters.get("shippingService"), MODULE); EbayHelper.setShipmentMethodType(cart, (String) parameters.get("shippingService"), productStoreId, delegator); cart.makeAllShipGroupInfos(dispatcher); // create the order - Debug.logInfo("Creating CheckOutHelper.", module); + Debug.logInfo("Creating CheckOutHelper.", MODULE); CheckOutHelper checkout = new CheckOutHelper(dispatcher, delegator, cart); - Debug.logInfo("Creating order.", module); + Debug.logInfo("Creating order.", MODULE); Map<String, Object> orderCreate = checkout.createOrder(userLogin); String orderId = (String)orderCreate.get("orderId"); - Debug.logInfo("Created order with id: " + orderId, module); + Debug.logInfo("Created order with id: " + orderId, MODULE); // approve the order if (UtilValidate.isNotEmpty(orderId)) { - Debug.logInfo("Approving order with id: " + orderId, module); + Debug.logInfo("Approving order with id: " + orderId, MODULE); boolean approved = OrderChangeHelper.approveOrder(dispatcher, userLogin, orderId); - Debug.logInfo("Order approved with result: " + approved, module); + Debug.logInfo("Order approved with result: " + approved, MODULE); // create the payment from the preference if (approved) { - Debug.logInfo("Creating payment for approved order.", module); + Debug.logInfo("Creating payment for approved order.", MODULE); EbayHelper.createPaymentFromPaymentPreferences(delegator, dispatcher, userLogin, orderId, externalId, cart.getOrderDate(), amountPaid, partyId); - Debug.logInfo("Payment created.", module); + Debug.logInfo("Payment created.", MODULE); } } } } catch (Exception e) { - Debug.logError("Exception in createShoppingCart: " + e.getMessage(), module); + Debug.logError("Exception in createShoppingCart: " + e.getMessage(), MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.exceptionInCreateShoppingCart", locale) + ": " + e.getMessage()); } return ServiceUtil.returnSuccess(); @@ -820,7 +820,7 @@ public class ImportOrdersFromEbay { private static GenericValue externalOrderExists(Delegator delegator, String externalId) throws GenericEntityException { - Debug.logInfo("Checking for existing externalId: " + externalId, module); + Debug.logInfo("Checking for existing externalId: " + externalId, MODULE); EntityCondition condition = EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("externalId", EntityComparisonOperator.EQUALS, externalId), EntityCondition.makeCondition("statusId", EntityComparisonOperator.NOT_EQUAL, "ORDER_CANCELLED")), EntityComparisonOperator.AND); GenericValue orderHeader = EntityQuery.use(delegator).from("OrderHeader") .where(condition) diff --git a/ebay/src/main/java/org/apache/ofbiz/ebay/ProductsExportToEbay.java b/ebay/src/main/java/org/apache/ofbiz/ebay/ProductsExportToEbay.java index 520df6f..33dcc24 100755 --- a/ebay/src/main/java/org/apache/ofbiz/ebay/ProductsExportToEbay.java +++ b/ebay/src/main/java/org/apache/ofbiz/ebay/ProductsExportToEbay.java @@ -58,7 +58,7 @@ public class ProductsExportToEbay { private static final String resource = "EbayUiLabels"; private static final String configFileName = "ebayExport.properties"; - private static final String module = ProductsExportToEbay.class.getName(); + private static final String MODULE = ProductsExportToEbay.class.getName(); private static List<String> productExportSuccessMessageList = new LinkedList<>(); private static List<String> productExportFailureMessageList = new LinkedList<>(); @@ -99,7 +99,7 @@ public class ProductsExportToEbay { } } } catch (Exception e) { - Debug.logError("Exception in exportToEbay " + e, module); + Debug.logError("Exception in exportToEbay " + e, MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionInExportToEbay", locale)); } if (UtilValidate.isNotEmpty(productExportSuccessMessageList)) { @@ -133,7 +133,7 @@ public class ProductsExportToEbay { private static Map<String, Object> postItem(String postItemsUrl, StringBuffer dataItems, String devID, String appID, String certID, String callName, String compatibilityLevel, String siteID) throws IOException { if (Debug.verboseOn()) { - Debug.logVerbose("Request of " + callName + " To eBay:\n" + dataItems.toString(), module); + Debug.logVerbose("Request of " + callName + " To eBay:\n" + dataItems.toString(), MODULE); } HttpURLConnection connection = (HttpURLConnection)(new URL(postItemsUrl)).openConnection(); connection.setDoInput(true); @@ -167,7 +167,7 @@ public class ProductsExportToEbay { } if (Debug.verboseOn()) { - Debug.logVerbose("Response of " + callName + " From eBay:\n" + response, module); + Debug.logVerbose("Response of " + callName + " From eBay:\n" + response, MODULE); } return result; @@ -320,14 +320,14 @@ public class ProductsExportToEbay { UtilXml.addChildElementValue(nameValueListElem, "Name", "Condition", itemDocument); UtilXml.addChildElementValue(nameValueListElem, "Value", "New: With Tags", itemDocument); - //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); + Debug.logError("Exception during building data items to eBay: " + e.getMessage(), MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingDataItemsToEbay", locale)); } } catch (Exception e) { - Debug.logError("Exception during building data items to eBay: " + e.getMessage(), module); + Debug.logError("Exception during building data items to eBay: " + e.getMessage(), MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingDataItemsToEbay", locale)); } return ServiceUtil.returnSuccess(); @@ -358,7 +358,7 @@ public class ProductsExportToEbay { dataItemsXml.append(UtilXml.writeXmlDocument(itemRequest)); } catch (Exception e) { - Debug.logError("Exception during building data items to eBay", module); + Debug.logError("Exception during building data items to eBay", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingGetCategoriesRequest", locale)); } return ServiceUtil.returnSuccess(); @@ -383,7 +383,7 @@ public class ProductsExportToEbay { setTaxTableRequestXml.append(UtilXml.writeXmlDocument(taxRequestDocument)); } catch (Exception e) { - Debug.logError("Exception during building request set tax table to eBay", module); + Debug.logError("Exception during building request set tax table to eBay", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingRequestSetTaxTableToEbay", locale)); } return ServiceUtil.returnSuccess(); @@ -408,9 +408,9 @@ public class ProductsExportToEbay { UtilXml.addChildElementValue(transElem, "RecipientUserID", "buyer_anytime", transDoc); dataItemsXml.append(UtilXml.writeXmlDocument(transDoc)); - Debug.logInfo(dataItemsXml.toString(), module); + Debug.logInfo(dataItemsXml.toString(), MODULE); } catch (Exception e) { - Debug.logError("Exception during building AddTransactionConfirmationItemRequest eBay", module); + Debug.logError("Exception during building AddTransactionConfirmationItemRequest eBay", MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingAddTransactionConfirmationItemRequestToEbay", locale)); } return ServiceUtil.returnSuccess(); @@ -540,7 +540,7 @@ public class ProductsExportToEbay { } } } catch (Exception e) { - Debug.logError("Exception in GetEbayCategories " + e, module); + Debug.logError("Exception in GetEbayCategories " + e, MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionInGetEbayCategories", locale)); } return result; @@ -600,7 +600,7 @@ public class ProductsExportToEbay { productExportSuccessMessageList.add(productSuccessfullyExportedMsg); } } catch (Exception e) { - Debug.logError("Error in processing xml string" + e.getMessage(), module); + Debug.logError("Error in processing xml string" + e.getMessage(), MODULE); return ServiceUtil.returnFailure(); } return result; diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayBestOfferAutoPref.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayBestOfferAutoPref.java index b614e2d..99a3474 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayBestOfferAutoPref.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayBestOfferAutoPref.java @@ -37,7 +37,7 @@ import org.apache.ofbiz.service.ServiceUtil; public class EbayBestOfferAutoPref { - public static final String module = EbayBestOfferAutoPref.class.getName(); + public static final String MODULE = EbayBestOfferAutoPref.class.getName(); public static final String resource = "EbayStoreUiLabels"; public static Map<String, Object> ebayBestOfferPrefCond(DispatchContext dctx, Map<String, ? extends Object> context) { diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java index f326188..0413b26 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java @@ -92,7 +92,7 @@ import com.ebay.soap.eBLBaseComponents.AddItemResponseType; public class EbayEvents { private static final int SHIPPING_SERVICE_ID_LIMIT = 50000; - public static final String module = EbayEvents.class.getName(); + public static final String MODULE = EbayEvents.class.getName(); public static String sendLeaveFeedback(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(true); @@ -137,11 +137,11 @@ public class EbayEvents { if (ServiceUtil.isError(resultMap)) { String errorMessage = ServiceUtil.getErrorMessage(resultMap); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(e.getMessage())); return "error"; } @@ -196,7 +196,7 @@ public class EbayEvents { } } } - Debug.logInfo("run in with productIds "+productIds, module); + Debug.logInfo("run in with productIds "+productIds, MODULE); for (String productId : productIds) { AddItemCall addItemCall = new AddItemCall(apiContext); ItemType item = new ItemType(); @@ -263,7 +263,7 @@ public class EbayEvents { } addItemObject.put("itemListing", itemObjs); } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(e.getMessage())); return "error"; } @@ -307,7 +307,7 @@ public class EbayEvents { EbayStoreSiteFacade siteFacade = null; if (request.getParameter("productStoreId") == null) { - Debug.logError("Required productStoreId for get ebay information.", module); + Debug.logError("Required productStoreId for get ebay information.", MODULE); return siteFacade; } @@ -324,7 +324,7 @@ public class EbayEvents { } else { siteFacade = (EbayStoreSiteFacade)session.getAttribute(siteFacadeName); } - Debug.logInfo("loaded session for ebay site Facade is ".concat(siteFacadeName).concat(session.getAttribute(siteFacadeName).toString()),module); + Debug.logInfo("loaded session for ebay site Facade is ".concat(siteFacadeName).concat(session.getAttribute(siteFacadeName).toString()),MODULE); return siteFacade; } @@ -333,7 +333,7 @@ public class EbayEvents { Delegator delegator = (Delegator) request.getAttribute("delegator"); if (request.getParameter("productStoreId") == null && request.getAttribute("productStoreId") == null) { - Debug.logError("Required productStoreId for get ebay API config data.", module); + Debug.logError("Required productStoreId for get ebay API config data.", MODULE); return null; } ApiContext apiContext = EbayStoreHelper.getApiContext(request.getParameter("productStoreId") != null ? request.getParameter("productStoreId"):(String)request.getAttribute("productStoreId"), locale, delegator); @@ -377,14 +377,14 @@ public class EbayEvents { String categoryId = null; if (request.getParameter("productStoreId") == null && request.getAttribute("productStoreId") == null) { - Debug.logError("Required productStoreId for get ebay LeafCategories.", module); + Debug.logError("Required productStoreId for get ebay LeafCategories.", MODULE); return categories; } if (request.getParameter("categoryId") != null || request.getAttribute("categoryId") != null) { categoryId = request.getParameter("categoryId") != null ? request.getParameter("categoryId") : (String) request.getAttribute("categoryId"); - Debug.logInfo("Load child categories from session following site id and categoryId is ".concat(categoryId), module); + Debug.logInfo("Load child categories from session following site id and categoryId is ".concat(categoryId), MODULE); } else { - Debug.logWarning("No categoryId to get child categories.", module); + Debug.logWarning("No categoryId to get child categories.", MODULE); } ApiContext apiContext = getApiContext(request); @@ -436,14 +436,14 @@ public class EbayEvents { String categoryId = null; if (UtilValidate.isEmpty(request.getParameter("productStoreId")) && UtilValidate.isEmpty(request.getAttribute("productStoreId"))) { - Debug.logError("Required productStoreId for get ebay LeafCategories.", module); + Debug.logError("Required productStoreId for get ebay LeafCategories.", MODULE); return categories; } if (UtilValidate.isNotEmpty(request.getParameter("categoryId")) || UtilValidate.isNotEmpty(request.getAttribute("categoryId"))) { categoryId = request.getParameter("categoryId") != null ? request.getParameter("categoryId") : (String) request.getAttribute("categoryId"); - Debug.logInfo("Load child categories from session following site id and categoryId is ".concat(categoryId), module); + Debug.logInfo("Load child categories from session following site id and categoryId is ".concat(categoryId), MODULE); } else { - Debug.logWarning("No categoryId to get child categories.", module); + Debug.logWarning("No categoryId to get child categories.", MODULE); } ApiContext apiContext = getApiContext(request); @@ -489,14 +489,14 @@ public class EbayEvents { CategoryType cate = null; if (request.getParameter("productStoreId") == null && request.getAttribute("productStoreId") == null) { - Debug.logError("Required productStoreId for get ebay LeafCategories.", module); + Debug.logError("Required productStoreId for get ebay LeafCategories.", MODULE); return null; } if (request.getParameter("categoryId") != null || request.getAttribute("categoryId") != null) { categoryId = request.getParameter("categoryId") != null ? request.getParameter("categoryId") : (String)request.getAttribute("categoryId"); - Debug.logInfo("Load child categories from session following site id and categoryId is ".concat(categoryId), module); + Debug.logInfo("Load child categories from session following site id and categoryId is ".concat(categoryId), MODULE); } else { - Debug.logWarning("No categoryId to get child categories.", module); + Debug.logWarning("No categoryId to get child categories.", MODULE); return null; } @@ -561,7 +561,7 @@ public class EbayEvents { request.setAttribute("categoryId", categoryId); CategoryType csCate = getCsCategoriesMapped(request); if (UtilValidate.isNotEmpty(csCate)) { - Debug.logInfo("Set selected ebay category ".concat(csCate.getCategoryID().toString().concat(csCate.getCategoryName()).concat(String.valueOf((csCate.isLeafCategory())))), module); + Debug.logInfo("Set selected ebay category ".concat(csCate.getCategoryID().toString().concat(csCate.getCategoryName()).concat(String.valueOf((csCate.isLeafCategory())))), MODULE); item.setPrimaryCategory(csCate); // get category feature and attributes sf = getSiteFacade(apiContext, request); @@ -572,7 +572,7 @@ public class EbayEvents { } request.setAttribute("_EVENT_MESSAGE_","Set selected ebay category ".concat(csCate.getCategoryID().toString()).concat(" with product ".concat(productId).concat(" successed."))); } else { - Debug.logWarning(categoryId.concat(" This category is not leaf category or ?"), module); + Debug.logWarning(categoryId.concat(" This category is not leaf category or ?"), MODULE); } break; } @@ -580,7 +580,7 @@ public class EbayEvents { } } } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } catch (ApiException e) { request.setAttribute("_ERROR_MESSAGE_","ApiException ".concat(e.getMessage())); @@ -890,11 +890,11 @@ public class EbayEvents { if (ServiceUtil.isError(resultMap)) { String errorMessage = ServiceUtil.getErrorMessage(resultMap); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } } catch (GenericServiceException ex) { - Debug.logError(ex.getMessage(), module); + Debug.logError(ex.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(ex.getMessage())); return "error"; } @@ -924,7 +924,7 @@ public class EbayEvents { } } } catch (GenericEntityException ex) { - Debug.logError(ex.getMessage(), module); + Debug.logError(ex.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(ex.getMessage())); return "error"; } @@ -936,14 +936,14 @@ public class EbayEvents { if (ServiceUtil.isError(result)) { String errorMessage = ServiceUtil.getErrorMessage(result); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } productListingId = result.get("productListingId").toString(); itemObj.put("productListingId", productListingId); itemObj.put("isSaved", "Y"); } catch (GenericServiceException ex) { - Debug.logError(ex.getMessage(), module); + Debug.logError(ex.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(ex.getMessage())); return "error"; } @@ -955,11 +955,11 @@ public class EbayEvents { if (ServiceUtil.isError(result)) { String errorMessage = ServiceUtil.getErrorMessage(result); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } } catch (GenericServiceException ex) { - Debug.logError(ex.getMessage(), module); + Debug.logError(ex.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(ex.getMessage())); return "error"; } @@ -977,11 +977,11 @@ public class EbayEvents { if (ServiceUtil.isError(result)) { String errorMessage = ServiceUtil.getErrorMessage(result); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } } catch (GenericServiceException ex) { - Debug.logError(ex.getMessage(), module); + Debug.logError(ex.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(ex.getMessage())); return "error"; } @@ -991,7 +991,7 @@ public class EbayEvents { } request.setAttribute("productStoreId", requestParams.get("productStoreId")); } catch(Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(e.getMessage())); return "error"; } @@ -1056,7 +1056,7 @@ public class EbayEvents { //request.setAttribute("itemFee", feesummary); request.setAttribute("productStoreId", requestParams.get("productStoreId")); } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(e.getMessage())); return "error"; } @@ -1095,7 +1095,7 @@ public class EbayEvents { } request.setAttribute("productStoreId", requestParams.get("productStoreId")); } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(e.getMessage())); return "error"; } @@ -1125,16 +1125,16 @@ public class EbayEvents { if (ServiceUtil.isError(result)) { String errorMessage = ServiceUtil.getErrorMessage(result); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } } } catch (GenericServiceException gse) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(gse.getMessage())); return "error"; } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(e.getMessage())); return "error"; } @@ -1168,7 +1168,7 @@ public class EbayEvents { revReq.setSellingManagerProductDetails(prodDetailType); revResp = (ReviseSellingManagerProductResponseType) revProdCall.execute(revReq); if (revResp != null && "SUCCESS".equals(revResp.getAck().toString())) { - Debug.logInfo(" Already update quantity on eBay inventory with product id ::"+revResp.getSellingManagerProductDetails().getProductID(), module); + Debug.logInfo(" Already update quantity on eBay inventory with product id ::"+revResp.getSellingManagerProductDetails().getProductID(), MODULE); } else { EbayStoreHelper.createErrorLogMessage(userLogin, dispatcher, productStoreId, revResp.getAck().toString(), "ReviseSellingManagerProductCall : updateQuantityInventoryProduct", revResp.getErrors(0).getLongMessage()); } @@ -1180,7 +1180,7 @@ public class EbayEvents { } } } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } } @@ -1220,7 +1220,7 @@ public class EbayEvents { recommendationMap.put("categorySpecifics", nameRecommendationMap); } } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return null; } return recommendationMap; diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java index 9a09812..e7caf7b 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java @@ -154,7 +154,7 @@ import com.ibm.icu.text.SimpleDateFormat; public class EbayStore { private static final String resource = "EbayStoreUiLabels"; - private static final String module = ProductsExportToEbay.class.getName(); + private static final String MODULE = ProductsExportToEbay.class.getName(); public static ProductsExportToEbay productExportEbay = new ProductsExportToEbay(); private static void appendRequesterCredentials(Element elem, Document doc, String token) { @@ -165,7 +165,7 @@ public class EbayStore { private static Map<String, Object> postItem(String postItemsUrl, StringBuffer dataItems, String devID, String appID, String certID, String callName, String compatibilityLevel, String siteID) throws IOException { if (Debug.verboseOn()) { - Debug.logVerbose("Request of " + callName + " To eBay:\n" + dataItems.toString(), module); + Debug.logVerbose("Request of " + callName + " To eBay:\n" + dataItems.toString(), MODULE); } HttpURLConnection connection = (HttpURLConnection)(new URL(postItemsUrl)).openConnection(); connection.setDoInput(true); @@ -199,7 +199,7 @@ public class EbayStore { } if (Debug.verboseOn()) { - Debug.logVerbose("Response of " + callName + " From eBay:\n" + response, module); + Debug.logVerbose("Response of " + callName + " From eBay:\n" + response, MODULE); } return result; @@ -378,7 +378,7 @@ public class EbayStore { } } } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); // TODO why is there an Exception catching here? } return storeCustomCategoryTypeArry; @@ -400,7 +400,7 @@ public class EbayStore { for (GenericValue productCategory : productCategoryList) { if (EbayStoreHelper.veriflyCategoryInCatalog(delegator,catalogCategories,productCategory.getString("productCategoryId"))) { if (EbayStoreHelper.createEbayCategoryIdByPartyId(delegator, productCategory.getString("productCategoryId"), partyId, String.valueOf(returnCategoryType.getCategoryID()))) { - Debug.logInfo("Create new ProductCategoryRollup with partyId "+partyId+" categoryId "+productCategory.getString("productCategoryId")+ " and ebayCategoryId "+String.valueOf(returnCategoryType.getCategoryID()), module); + Debug.logInfo("Create new ProductCategoryRollup with partyId "+partyId+" categoryId "+productCategory.getString("productCategoryId")+ " and ebayCategoryId "+String.valueOf(returnCategoryType.getCategoryID()), MODULE); } break; } @@ -452,7 +452,7 @@ public class EbayStore { dataStoreXml.append(UtilXml.writeXmlDocument(storeDocument)); } catch (Exception e) { - Debug.logError("Exception during building data items to eBay: " + e.getMessage(), module); + Debug.logError("Exception during building data items to eBay: " + e.getMessage(), MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingDataItemsToEbay", locale)); } return ServiceUtil.returnSuccess(); @@ -477,7 +477,7 @@ public class EbayStore { result = "Successfully exported with ID (" + productStoreId + ")."; } } catch (Exception e) { - Debug.logError("Error in processing xml string" + e.getMessage(), module); + Debug.logError("Error in processing xml string" + e.getMessage(), MODULE); result = "Failure"; } return result; @@ -496,7 +496,7 @@ public class EbayStore { UtilXml.addChildElementValue(storeRequestElem, "LevelLimit", "1", storeDocument); dataStoreXml.append(UtilXml.writeXmlDocument(storeDocument)); } catch (Exception e) { - Debug.logError("Exception during building data to eBay: " + e.getMessage(), module); + Debug.logError("Exception during building data to eBay: " + e.getMessage(), MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingDataItemsToEbay", locale)); } return ServiceUtil.returnSuccess(); @@ -532,7 +532,7 @@ public class EbayStore { dataStoreXml.append(UtilXml.writeXmlDocument(storeDocument)); } catch (Exception e) { - Debug.logError("Exception during building data to eBay: " + e.getMessage(), module); + Debug.logError("Exception during building data to eBay: " + e.getMessage(), MODULE); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingDataItemsToEbay", locale)); } return ServiceUtil.returnSuccess(); @@ -636,7 +636,7 @@ public class EbayStore { } catch (GenericEntityException e1) { e1.printStackTrace(); } - Debug.logInfo("userLoginId is "+userLoginId+" and productStoreId is "+ context.get("productStoreId"), module); + Debug.logInfo("userLoginId is "+userLoginId+" and productStoreId is "+ context.get("productStoreId"), MODULE); GetStoreCall call = new GetStoreCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator)); //call.setSite(EbayHelper.getSiteCodeType((String)context.get("productStoreId"), locale, delegator)); call.setCategoryStructureOnly(false); @@ -865,7 +865,7 @@ public class EbayStore { } } } catch (GenericServiceException e) { - Debug.logError("error message"+e, module); + Debug.logError("error message"+e, MODULE); } } @@ -1804,7 +1804,7 @@ public class EbayStore { } result.put("allBidders", allBidders); } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); result.put("allBidders", allBidders); return result; } diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPrefEvents.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPrefEvents.java index 75184fe..4fbade7 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPrefEvents.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPrefEvents.java @@ -33,7 +33,7 @@ import org.apache.ofbiz.service.LocalDispatcher; public class EbayStoreAutoPrefEvents{ - public static final String module = EbayStoreAutoPrefEvents.class.getName(); + public static final String MODULE = EbayStoreAutoPrefEvents.class.getName(); public static String ebayAutoPrefCond (HttpServletRequest request, HttpServletResponse response) { LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); @@ -103,11 +103,11 @@ public class EbayStoreAutoPrefEvents{ Map<String, Object> result = dispatcher.runSync("ebayBestOfferPrefCond", bestOfferCondition); if (ServiceUtil.isError(result)) { request.setAttribute("_ERROR_MESSAGE_", ServiceUtil.getErrorMessage(result)); - Debug.log( ServiceUtil.getErrorMessage(result),module); + Debug.log( ServiceUtil.getErrorMessage(result),MODULE); return "error"; } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return "error"; } return "Success."; diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java index df4351a..5615298 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java @@ -117,7 +117,7 @@ import com.ebay.soap.eBLBaseComponents.TransactionType; import com.ebay.soap.eBLBaseComponents.UserType; public class EbayStoreAutoPreferences { - public static String module = EbayStoreAutoPreferences.class.getName(); + public static String MODULE = EbayStoreAutoPreferences.class.getName(); private static final String resource = "EbayStoreUiLabels"; public EbayStoreAutoPreferences() { @@ -204,7 +204,7 @@ public class EbayStoreAutoPreferences { leaveFeedbackCall.setTargetUser(item.getBuyerID()); leaveFeedbackCall.setTransactionID(String.valueOf(soldTran.getTransactionID())); leaveFeedbackCall.leaveFeedback(); - Debug.logInfo("Auto leave feedback with site ".concat(apiContext.getSite().value()).concat("itemId ".concat(soldTran.getItemID())).concat(" comment is ".concat(comment)), module); + Debug.logInfo("Auto leave feedback with site ".concat(apiContext.getSite().value()).concat("itemId ".concat(soldTran.getItemID())).concat(" comment is ".concat(comment)), MODULE); } } } @@ -286,7 +286,7 @@ public class EbayStoreAutoPreferences { if (ServiceUtil.isError(resultMap)) { String errorMessage = ServiceUtil.getErrorMessage(resultMap); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } } else { @@ -294,7 +294,7 @@ public class EbayStoreAutoPreferences { if (ServiceUtil.isError(resultMap)) { String errorMessage = ServiceUtil.getErrorMessage(resultMap); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } } @@ -355,7 +355,7 @@ public class EbayStoreAutoPreferences { Calendar afterShippedTime = orderStatus.getShippedTime(); afterShippedTime.add(Calendar.DAY_OF_MONTH, afterDays); Debug.logInfo("Verify date for send reminder feedback eamil by auto service: buyer " + solditem.getBuyerID() + " seller shippedTime " + - "" + formatter.format(shippedTime) + " codition days " + afterDays + " after shippedTime :" + formatter.format(afterShippedTime) + " now date" + formatter.format(right_now), module); + "" + formatter.format(shippedTime) + " codition days " + afterDays + " after shippedTime :" + formatter.format(afterShippedTime) + " now date" + formatter.format(right_now), MODULE); // if now date is after shipped time follow after days condition would be send reminder email to buyer if (right_now.after(afterShippedTime)) { items.add(solditem); @@ -387,7 +387,7 @@ public class EbayStoreAutoPreferences { try { dispatcher.runAsync("sendMailFromScreen", sendMap); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(e.getMessage()); } } @@ -519,7 +519,7 @@ public class EbayStoreAutoPreferences { GenericValue productStore = EntityQuery.use(delegator).from("Product").where("productId", product.getString("productId")).queryOne(); productStore.set("isVirtual", "Y"); productStore.store(); - Debug.logInfo("Relisted Item - " + product.getString("productId"), module); + Debug.logInfo("Relisted Item - " + product.getString("productId"), MODULE); } } } @@ -747,7 +747,7 @@ public class EbayStoreAutoPreferences { try { dispatcher.runAsync("sendMailFromScreen", sendMap); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(e.getMessage()); } } @@ -901,7 +901,7 @@ public class EbayStoreAutoPreferences { resp = (AddOrderResponseType) call.execute(req); if (resp != null && "SUCCESS".equals(resp.getAck().toString())) { String orderId = resp.getOrderID(); - Debug.logInfo(":: new order id is = " + orderId, module); + Debug.logInfo(":: new order id is = " + orderId, MODULE); } else { EbayStoreHelper.createErrorLogMessage(userLogin, dispatcher, productStoreId, resp.getAck().toString(), "Add order : runCombineOrders", resp.getErrors(0).getLongMessage()); } @@ -1009,7 +1009,7 @@ public class EbayStoreAutoPreferences { try { dispatcher.runAsync("sendMailFromScreen", sendMap); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(e.getMessage()); } } @@ -1072,7 +1072,7 @@ public class EbayStoreAutoPreferences { try { dispatcher.runAsync("sendMailFromScreen", sendMap); } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(e.getMessage()); } diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCategoryFacade.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCategoryFacade.java index adc5e38..9d1a473 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCategoryFacade.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCategoryFacade.java @@ -55,7 +55,7 @@ import com.ebay.soap.eBLBaseComponents.StoreOwnerExtendedListingDurationsType; import com.ebay.soap.eBLBaseComponents.ThemeGroupType; public class EbayStoreCategoryFacade { - public static final String module = EbayStoreCategoryFacade.class.getName(); + public static final String MODULE = EbayStoreCategoryFacade.class.getName(); private ApiContext apiContext = null; private String catId = null; private IAttributesMaster attrMaster = null; @@ -229,7 +229,7 @@ public class EbayStoreCategoryFacade { resp = (GetDescriptionTemplatesResponseType) call.execute(req); if (resp != null && "SUCCESS".equals(resp.getAck().toString())) { DescriptionTemplateType[] descriptionTemplateTypeList = resp.getDescriptionTemplate(); - Debug.logInfo("layout of category "+ this.catId +":"+ resp.getLayoutTotal(), module); + Debug.logInfo("layout of category "+ this.catId +":"+ resp.getLayoutTotal(), MODULE); for (DescriptionTemplateType descTemplateType : descriptionTemplateTypeList) { List<Map<String,Object>> templateList = null; Map<String,Object> templateGroup = null; diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCustomerService.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCustomerService.java index 74cfdc0..b551808 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCustomerService.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreCustomerService.java @@ -43,7 +43,7 @@ import com.ebay.soap.eBLBaseComponents.UserType; public class EbayStoreCustomerService { - public static String module = EbayStoreCustomerService.class.getName(); + public static String MODULE = EbayStoreCustomerService.class.getName(); private static final String resource = "EbayStoreUiLabels"; public static Map<String, Object> listBestOfferIncludeMessage(DispatchContext dctx, Map<String, ? extends Object> context) { diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreHelper.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreHelper.java index a37aaff..008811a 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreHelper.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreHelper.java @@ -91,7 +91,7 @@ import com.ebay.soap.eBLBaseComponents.VATDetailsType; import com.ibm.icu.text.SimpleDateFormat; public class EbayStoreHelper { - private static final String module = EbayStoreHelper.class.getName(); + private static final String MODULE = EbayStoreHelper.class.getName(); public static final String resource = "EbayStoreUiLabels"; public static ApiContext getApiContext(String productStoreId,Locale locale, Delegator delegator) { @@ -168,16 +168,16 @@ public class EbayStoreHelper { GenericValue partyRole = null; try { if (partyId == null) { - Debug.logError("Require field partyId.",module); + Debug.logError("Require field partyId.",MODULE); return false; } partyRole = EntityQuery.use(delegator).from("PartyRole").where("partyId", partyId, "roleTypeId", "EBAY_ACCOUNT").queryOne(); if (partyRole == null) { - Debug.logError("Party Id ".concat(partyId).concat("not have roleTypeId EBAY_ACCOUNT"),module); + Debug.logError("Party Id ".concat(partyId).concat("not have roleTypeId EBAY_ACCOUNT"),MODULE); return false; } } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return false; } return true; @@ -188,7 +188,7 @@ public class EbayStoreHelper { List<GenericValue> productCategoryRoles = null; try { if (partyId == null) { - Debug.logError("Require field partyId.",module); + Debug.logError("Require field partyId.",MODULE); return ebayCategoryId; } productCategoryRoles = EntityQuery.use(delegator).from("ProductCategoryRole").where("productCategoryId", productCategoryId, "partyId", partyId, "roleTypeId", "EBAY_ACCOUNT").queryList(); @@ -197,11 +197,11 @@ public class EbayStoreHelper { ebayCategoryId = productCategoryRole.getString("comments"); } } else { - Debug.logInfo("Party Id ".concat(partyId).concat(" Not found productCategoryRole with productCategoryId "+ productCategoryId),module); + Debug.logInfo("Party Id ".concat(partyId).concat(" Not found productCategoryRole with productCategoryId "+ productCategoryId),MODULE); return ebayCategoryId; } } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } return ebayCategoryId; } @@ -209,7 +209,7 @@ public class EbayStoreHelper { public static boolean createEbayCategoryIdByPartyId(Delegator delegator, String productCategoryId, String partyId, String ebayCategoryId) { try { if (partyId == null && ebayCategoryId != null) { - Debug.logError("Require field partyId and ebayCategoryId.",module); + Debug.logError("Require field partyId and ebayCategoryId.",MODULE); return false; } GenericValue productCategoryRole = delegator.makeValue("ProductCategoryRole"); @@ -220,7 +220,7 @@ public class EbayStoreHelper { productCategoryRole.put("comments",ebayCategoryId); productCategoryRole.create(); } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return false; } return true; @@ -255,7 +255,7 @@ public class EbayStoreHelper { } } } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return false; } return flag; @@ -428,7 +428,7 @@ public class EbayStoreHelper { } } } catch(Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } } @@ -461,7 +461,7 @@ public class EbayStoreHelper { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result)); } } catch (GenericServiceException ex) { - Debug.logError(ex.getMessage(), module); + Debug.logError(ex.getMessage(), MODULE); return ServiceUtil.returnError(ex.getMessage()); } } @@ -620,7 +620,7 @@ public class EbayStoreHelper { } } } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return null; } return item; @@ -697,7 +697,7 @@ public class EbayStoreHelper { addReq.setOrder(newOrder); addResp = (AddOrderResponseType) addOrderCall.execute(addReq); if (addResp != null && "SUCCESS".equals(addResp.getAck().toString())) { - Debug.logInfo("Upload tracking code to eBay success...", module); + Debug.logInfo("Upload tracking code to eBay success...", MODULE); } else { createErrorLogMessage(userLogin, dctx.getDispatcher(), productStoreId, addResp.getAck().toString(), "Update order : uploadTrackingInfoBackToEbay", addResp.getErrors(0).getLongMessage()); } @@ -731,7 +731,7 @@ public class EbayStoreHelper { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result)); } } catch (Exception ex) { - Debug.logError("Error from create error log messages : "+ex.getMessage(), module); + Debug.logError("Error from create error log messages : "+ex.getMessage(), MODULE); } } } @@ -748,7 +748,7 @@ public class EbayStoreHelper { } } } catch (Exception ex) { - Debug.logError("Error from get eBay Inventory data : "+ ex.getMessage(), module); + Debug.logError("Error from get eBay Inventory data : "+ ex.getMessage(), MODULE); } return isReserve; } diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreInventoryServices.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreInventoryServices.java index 916a6ba..2900ce2 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreInventoryServices.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreInventoryServices.java @@ -60,7 +60,7 @@ import com.ebay.soap.eBLBaseComponents.SellingManagerProductInventoryStatusType; import com.ebay.soap.eBLBaseComponents.SellingManagerProductType; public class EbayStoreInventoryServices { - private static final String module = EbayStoreInventoryServices.class.getName(); + private static final String MODULE = EbayStoreInventoryServices.class.getName(); public static final String resource = "EbayStoreUiLabels"; private static final String defaultFolderName = "OFBizProducts"; private static String folderId = null; @@ -115,7 +115,7 @@ public class EbayStoreInventoryServices { status = createNewProductInEbayInventoryFolder(dctx,context); } if (status) { - Debug.logInfo("Done to updated product ".concat(context.get("productId").toString()), module); + Debug.logInfo("Done to updated product ".concat(context.get("productId").toString()), MODULE); result = ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "EbayStoreInventoryFolderIdUpdated", UtilMisc.toMap("folderId", context.get("folderId")), locale)); } else { result = ServiceUtil.returnError(UtilProperties.getMessage(resource, "EbayStoreInventoryFolderIdUpdatedFailed", locale)); @@ -169,17 +169,17 @@ public class EbayStoreInventoryServices { ebayProductStoreInventory.store(); } else { EbayStoreHelper.createErrorLogMessage(userLogin, dctx.getDispatcher(), context.get("productStoreId").toString(), productResp.getAck().toString(), "AddSellingManagerProductCall : createNewProductInEbayInventoryFolder", productResp.getErrors(0).getLongMessage()); - Debug.logError("Fail to create inventory product ".concat(productId).concat("in productStore ").concat(context.get("productStoreId").toString()).concat(" message from ebay : ").concat(productResp.getMessage()), module); + Debug.logError("Fail to create inventory product ".concat(productId).concat("in productStore ").concat(context.get("productStoreId").toString()).concat(" message from ebay : ").concat(productResp.getMessage()), MODULE); } } } catch (ApiException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (SdkSoapException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (SdkException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } return flag; } @@ -203,7 +203,7 @@ public class EbayStoreInventoryServices { GenericValue ebayProductStoreInventory = EntityQuery.use(delegator).from("EbayProductStoreInventory").where("productId", productId, "facilityId", context.get("facilityId"), "productStoreId", context.get("productStoreId")).queryOne(); Long ebayProductId = null; if (ebayProductStoreInventory != null && ebayProductStoreInventory.getLong("ebayProductId") == null) { - Debug.logError("Can not update product "+productId+" has no ebay product Id in EbayProductStoreInventory. ", module); + Debug.logError("Can not update product "+productId+" has no ebay product Id in EbayProductStoreInventory. ", MODULE); return flag; } if (ebayProductStoreInventory != null && ebayProductStoreInventory.getLong("ebayProductId") != null) { @@ -225,17 +225,17 @@ public class EbayStoreInventoryServices { ebayProductStoreInventory.store(); } else { EbayStoreHelper.createErrorLogMessage(userLogin, dctx.getDispatcher(), context.get("productStoreId").toString(), resp.getAck().toString(), "ReviseSellingManagerProductCall : updateProductInEbayInventoryFolder", resp.getErrors(0).getLongMessage()); - Debug.logError("Fail to update inventory product ".concat(productId).concat("in productStore ").concat(context.get("productStoreId").toString()).concat(" message from ebay : ").concat(resp.getMessage()), module); + Debug.logError("Fail to update inventory product ".concat(productId).concat("in productStore ").concat(context.get("productStoreId").toString()).concat(" message from ebay : ").concat(resp.getMessage()), MODULE); } } } catch (ApiException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (SdkSoapException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (SdkException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } return flag; } @@ -259,7 +259,7 @@ public class EbayStoreInventoryServices { if (sellingManagerFolderDetailsType != null) { SellingManagerFolderDetailsType[] SellingManagerFolderDetailsTypeList = sellingManagerFolderDetailsType.getChildFolder(); for (SellingManagerFolderDetailsType sellingManagerFolderDetails : SellingManagerFolderDetailsTypeList) { - Debug.logInfo("ebay inventory folders name ".concat(sellingManagerFolderDetails.getFolderName()), module); + Debug.logInfo("ebay inventory folders name ".concat(sellingManagerFolderDetails.getFolderName()), MODULE); if (sellingManagerFolderDetails.getFolderName().equals(defaultFolderName)) { folderId = String.valueOf(sellingManagerFolderDetails.getFolderID()); flag = true; @@ -284,7 +284,7 @@ public class EbayStoreInventoryServices { } if (result.get("responseMessage") != null && "fail".equals(result.get("responseMessage"))) folderId = null; result.put("folderId", folderId); - Debug.logInfo("service return result "+ result, module); + Debug.logInfo("service return result "+ result, MODULE); return result; } @@ -306,16 +306,16 @@ public class EbayStoreInventoryServices { folderId = String.valueOf(resp.getFolderID()); } else { EbayStoreHelper.createErrorLogMessage(userLogin, dctx.getDispatcher(), context.get("productStoreId").toString(), resp.getAck().toString(), "AddSellingManagerInventoryFolderCall : createNewFolderInEbayStoreInventory", resp.getErrors(0).getLongMessage()); - Debug.logError("The problem with create new folder on ebay site.", module); + Debug.logError("The problem with create new folder on ebay site.", MODULE); return folderId; } } } catch (ApiException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (SdkSoapException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (SdkException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } return folderId; } @@ -361,7 +361,7 @@ public class EbayStoreInventoryServices { } } else { EbayStoreHelper.createErrorLogMessage(userLogin, dctx.getDispatcher(), context.get("productStoreId").toString(), resp.getAck().toString(), "GetSellingManagerInventoryCall : updateEbayInventoryStatusByProductId", resp.getErrors(0).getLongMessage()); - Debug.logError("The problem with get manage inventory detail from ebay site.", module); + Debug.logError("The problem with get manage inventory detail from ebay site.", MODULE); } } } catch (ApiException e) { diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOptions.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOptions.java index 9fb1cc7..f5fa337 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOptions.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOptions.java @@ -54,7 +54,7 @@ import com.ebay.soap.eBLBaseComponents.StoreCustomCategoryType; public class EbayStoreOptions { - private static final String module = EbayStoreOptions.class.getName(); + private static final String MODULE = EbayStoreOptions.class.getName(); public static String retrieveThemeColorSchemeByThemeId(HttpServletRequest request, HttpServletResponse response) { Locale locale = UtilHttp.getLocale(request); @@ -192,15 +192,15 @@ public class EbayStoreOptions { } } } catch (GenericServiceException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (EventHandlerException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (ApiException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (SdkException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } return "success"; } @@ -248,15 +248,15 @@ public class EbayStoreOptions { } } } catch (GenericServiceException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (EventHandlerException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (ApiException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (SdkException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } return "success"; } diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java index a2c5e22..a8a0a07 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java @@ -54,7 +54,7 @@ import org.apache.ofbiz.service.ServiceUtil; public class EbayStoreOrder { private static final String resource = "EbayUiLabels"; - private static final String module = EbayStoreOrder.class.getName(); + private static final String MODULE = EbayStoreOrder.class.getName(); public static Map<String, Object> EbayStoreImportTransaction(DispatchContext dctx, Map<String, Object> context) { Map<String, Object> result = new HashMap<String, Object>(); @@ -212,7 +212,7 @@ public class EbayStoreOrder { } } - Debug.logInfo("Importing new order from eBay", module); + Debug.logInfo("Importing new order from eBay", MODULE); // set partyId to String partyId = null; String contactMechId = ""; @@ -224,7 +224,7 @@ public class EbayStoreOrder { // if we get a party, check its contact information. if (partyAttribute != null) { partyId = (String) partyAttribute.get("partyId"); - Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, module); + Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, MODULE); GenericValue party = EntityQuery.use(delegator).from("Party").where("partyId", partyId).queryOne(); contactMechId = EbayHelper.setShippingAddressContactMech(dispatcher, delegator, party, userLogin, context); @@ -237,68 +237,68 @@ public class EbayStoreOrder { // create party if none exists already if (UtilValidate.isEmpty(partyId)) { - Debug.logInfo("Creating new party for the eBay buyer.", module); + Debug.logInfo("Creating new party for the eBay buyer.", MODULE); partyId = EbayHelper.createCustomerParty(dispatcher, context.get("buyerName").toString(), userLogin); if (UtilValidate.isEmpty(partyId)) { - Debug.logWarning("Using admin party for the eBay buyer.", module); + Debug.logWarning("Using admin party for the eBay buyer.", MODULE); partyId = "admin"; } } // create new party's contact information if (UtilValidate.isEmpty(contactMechId)) { - Debug.logInfo("Creating new postal address for party: " + partyId, module); + Debug.logInfo("Creating new postal address for party: " + partyId, MODULE); contactMechId = EbayHelper.createAddress(dispatcher, partyId, userLogin, "SHIPPING_LOCATION", context); if (UtilValidate.isEmpty(contactMechId)) { return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "EbayStoreUnableToCreatePostalAddress", locale) + context); } - Debug.logInfo("Created postal address: " + contactMechId, module); - Debug.logInfo("Creating new phone number for party: " + partyId, module); + Debug.logInfo("Created postal address: " + contactMechId, MODULE); + Debug.logInfo("Creating new phone number for party: " + partyId, MODULE); EbayHelper.createPartyPhone(dispatcher, partyId, context.get("shippingAddressPhone").toString(), userLogin); - Debug.logInfo("Creating association to eBay buyer for party: " + partyId, module); + Debug.logInfo("Creating association to eBay buyer for party: " + partyId, MODULE); EbayHelper.createEbayCustomer(dispatcher, partyId, context.get("ebayUserIdBuyer").toString(), context.get("eiasTokenBuyer").toString(), userLogin); String emailBuyer = context.get("emailBuyer").toString(); if (UtilValidate.isNotEmpty(emailBuyer) && !"Invalid Request".equalsIgnoreCase(emailBuyer)) { - Debug.logInfo("Creating new email for party: " + partyId, module); + Debug.logInfo("Creating new email for party: " + partyId, MODULE); EbayHelper.createPartyEmail(dispatcher, partyId, emailBuyer, userLogin); } } - Debug.logInfo("Setting cart roles for party: " + partyId, module); + Debug.logInfo("Setting cart roles for party: " + partyId, MODULE); cart.setBillToCustomerPartyId(partyId); cart.setPlacingCustomerPartyId(partyId); cart.setShipToCustomerPartyId(partyId); cart.setEndUserCustomerPartyId(partyId); - Debug.logInfo("Setting contact mech in cart: " + contactMechId, module); + Debug.logInfo("Setting contact mech in cart: " + contactMechId, MODULE); cart.setAllShippingContactMechId(contactMechId); cart.setAllMaySplit(Boolean.FALSE); - Debug.logInfo("Setting shipment method: " + context.get("shippingService").toString(), module); + Debug.logInfo("Setting shipment method: " + context.get("shippingService").toString(), MODULE); EbayHelper.setShipmentMethodType(cart, context.get("shippingService").toString(), productStoreId, delegator); cart.makeAllShipGroupInfos(dispatcher); // create the order - Debug.logInfo("Creating CheckOutHelper.", module); + Debug.logInfo("Creating CheckOutHelper.", MODULE); CheckOutHelper checkout = new CheckOutHelper(dispatcher, delegator, cart); - Debug.logInfo("Creating order.", module); + Debug.logInfo("Creating order.", MODULE); Map<String, Object> orderCreate = checkout.createOrder(userLogin); String orderId = orderCreate.get("orderId").toString(); - Debug.logInfo("Created order with id: " + orderId, module); + Debug.logInfo("Created order with id: " + orderId, MODULE); // approve the order if (UtilValidate.isNotEmpty(orderId)) { - Debug.logInfo("Approving order with id: " + orderId, module); + Debug.logInfo("Approving order with id: " + orderId, MODULE); boolean approved = OrderChangeHelper.approveOrder(dispatcher, userLogin, orderId); - Debug.logInfo("Order approved with result: " + approved, module); + Debug.logInfo("Order approved with result: " + approved, MODULE); // create the payment from the preference if (approved) { - Debug.logInfo("Creating payment for approved order.", module); + Debug.logInfo("Creating payment for approved order.", MODULE); EbayHelper.createPaymentFromPaymentPreferences(delegator, dispatcher, userLogin, orderId, externalId, cart.getOrderDate(), amountPaid, partyId); - Debug.logInfo("Payment created.", module); + Debug.logInfo("Payment created.", MODULE); } } } catch (Exception e) { @@ -413,7 +413,7 @@ public class EbayStoreOrder { } } - Debug.logInfo("Importing new order from eBay", module); + Debug.logInfo("Importing new order from eBay", MODULE); // set partyId to String partyId = null; String contactMechId = null; @@ -442,7 +442,7 @@ public class EbayStoreOrder { if (UtilValidate.isNotEmpty(shipInfo)) { GenericValue first = EntityUtil.getFirst(shipInfo); partyId = first.getString("partyId"); - Debug.logInfo("Existing shipping address found for : (party: " + partyId + ")", module); + Debug.logInfo("Existing shipping address found for : (party: " + partyId + ")", MODULE); } } @@ -457,7 +457,7 @@ public class EbayStoreOrder { // 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); + Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, MODULE); GenericValue party = EntityQuery.use(delegator).from("Party").where("partyId", partyId).queryOne(); contactMechId = EbayHelper.setShippingAddressContactMech(dispatcher, delegator, party, userLogin, shippingAddressCtx); @@ -470,10 +470,10 @@ public class EbayStoreOrder { // create party if none exists already if (UtilValidate.isEmpty(partyId)) { - Debug.logInfo("Creating new party for the eBay buyer.", module); + Debug.logInfo("Creating new party for the eBay buyer.", MODULE); partyId = EbayHelper.createCustomerParty(dispatcher, (String) shippingAddressCtx.get("buyerName"), userLogin); if (UtilValidate.isEmpty(partyId)) { - Debug.logWarning("Using admin party for the eBay buyer.", module); + Debug.logWarning("Using admin party for the eBay buyer.", MODULE); partyId = "admin"; } } @@ -481,41 +481,41 @@ public class EbayStoreOrder { // create new party's contact information if (UtilValidate.isEmpty(contactMechId)) { - Debug.logInfo("Creating new postal address for party: " + partyId, module); + Debug.logInfo("Creating new postal address for party: " + partyId, MODULE); contactMechId = EbayHelper.createAddress(dispatcher, partyId, userLogin, "SHIPPING_LOCATION", shippingAddressCtx); if (UtilValidate.isEmpty(contactMechId)) { return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "EbayStoreUnableToCreatePostalAddress", locale) + shippingAddressCtx); } - Debug.logInfo("Created postal address: " + contactMechId, module); - Debug.logInfo("Creating new phone number for party: " + partyId, module); + Debug.logInfo("Created postal address: " + contactMechId, MODULE); + Debug.logInfo("Creating new phone number for party: " + partyId, MODULE); EbayHelper.createPartyPhone(dispatcher, partyId, (String) shippingAddressCtx.get("shippingAddressPhone"), userLogin); - Debug.logInfo("Creating association to eBay buyer for party: " + partyId, module); + Debug.logInfo("Creating association to eBay buyer for party: " + partyId, MODULE); EbayHelper.createEbayCustomer(dispatcher, partyId, (String) context.get("ebayUserIdBuyer"), null, userLogin); String emailBuyer = (String) context.get("emailBuyer"); if (UtilValidate.isNotEmpty(emailBuyer) && !"Invalid Request".equalsIgnoreCase(emailBuyer)) { - Debug.logInfo("Creating new email for party: " + partyId, module); + Debug.logInfo("Creating new email for party: " + partyId, MODULE); EbayHelper.createPartyEmail(dispatcher, partyId, emailBuyer, userLogin); } } - Debug.logInfo("Setting cart roles for party: " + partyId, module); + Debug.logInfo("Setting cart roles for party: " + partyId, MODULE); cart.setBillToCustomerPartyId(partyId); cart.setPlacingCustomerPartyId(partyId); cart.setShipToCustomerPartyId(partyId); cart.setEndUserCustomerPartyId(partyId); - Debug.logInfo("Setting contact mech in cart: " + contactMechId, module); + Debug.logInfo("Setting contact mech in cart: " + contactMechId, MODULE); cart.setAllShippingContactMechId(contactMechId); cart.setAllMaySplit(Boolean.FALSE); - Debug.logInfo("Setting shipment method: " + (String) shippingServiceSelectedCtx.get("shippingService"), module); + Debug.logInfo("Setting shipment method: " + (String) shippingServiceSelectedCtx.get("shippingService"), MODULE); EbayHelper.setShipmentMethodType(cart, (String) shippingServiceSelectedCtx.get("shippingService"), productStoreId, delegator); cart.makeAllShipGroupInfos(dispatcher); // create the order - Debug.logInfo("Creating CheckOutHelper.", module); + Debug.logInfo("Creating CheckOutHelper.", MODULE); CheckOutHelper checkout = new CheckOutHelper(dispatcher, delegator, cart); - Debug.logInfo("Creating order.", module); + Debug.logInfo("Creating order.", MODULE); Map<?, ?> orderCreate = checkout.createOrder(userLogin); if ("error".equals(orderCreate.get("responseMessage"))) { @@ -523,19 +523,19 @@ public class EbayStoreOrder { return ServiceUtil.returnError(errorMessageList); } String orderId = (String) orderCreate.get("orderId"); - Debug.logInfo("Created order with id: " + orderId, module); + Debug.logInfo("Created order with id: " + orderId, MODULE); // approve the order if (UtilValidate.isNotEmpty(orderId)) { - Debug.logInfo("Approving order with id: " + orderId, module); + Debug.logInfo("Approving order with id: " + orderId, MODULE); boolean approved = OrderChangeHelper.approveOrder(dispatcher, userLogin, orderId); - Debug.logInfo("Order approved with result: " + approved, module); + Debug.logInfo("Order approved with result: " + approved, MODULE); // create the payment from the preference if (approved) { - Debug.logInfo("Creating payment for approved order.", module); + Debug.logInfo("Creating payment for approved order.", MODULE); EbayHelper.createPaymentFromPaymentPreferences(delegator, dispatcher, userLogin, orderId, externalId, cart.getOrderDate(), amountPaid, partyId); - Debug.logInfo("Payment created.", module); + Debug.logInfo("Payment created.", MODULE); } result = ServiceUtil.returnFailure(UtilProperties.getMessage("EbayStoreUiLabels", "EbayOrderCreatedSuccessfully", UtilMisc.toMap("orderId", orderId, "externalId", externalId), locale)); } @@ -549,7 +549,7 @@ public class EbayStoreOrder { String productId = orderItem.get("productId").toString(); GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne(); if (UtilValidate.isEmpty(product)) { - Debug.logError("The product having ID (" + productId + ") is misssing in the system.", module); + Debug.logError("The product having ID (" + productId + ") is misssing in the system.", MODULE); } BigDecimal qty = new BigDecimal(orderItem.get("quantity").toString()); String itemPrice = orderItem.get("transactionPrice").toString(); diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreSiteFacade.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreSiteFacade.java index e941354..f1d7192 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreSiteFacade.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreSiteFacade.java @@ -52,7 +52,7 @@ import com.ebay.soap.eBLBaseComponents.StoreCustomCategoryType; import com.ebay.soap.eBLBaseComponents.StoreType; public class EbayStoreSiteFacade { - public static final String module = EbayStoreSiteFacade.class.getName(); + public static final String MODULE = EbayStoreSiteFacade.class.getName(); private ApiContext apiContext = null; private IAttributesMaster attrMaster = null; private static final int MAP_SIZE = 30000; diff --git a/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java b/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java index 707bd38..a2355a1 100644 --- a/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java +++ b/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java @@ -61,7 +61,7 @@ import org.xml.sax.SAXException; */ public class JanrainHelper { - public static final String module = JanrainHelper.class.getName(); + public static final String MODULE = JanrainHelper.class.getName(); private static String apiKey = UtilProperties.getPropertyValue("ecommerce", "janrain.apiKey"); private static String baseUrl = UtilProperties.getPropertyValue("ecommerce", "janrain.baseUrl"); public JanrainHelper(String apiKey, String baseUrl) { @@ -239,7 +239,7 @@ public class JanrainHelper { return "userLoginMissing"; } } catch (GenericEntityException e) { - Debug.logError(e, "Error finding the userLogin for distributed cache clear", module); + Debug.logError(e, "Error finding the userLogin for distributed cache clear", MODULE); } } return "success"; diff --git a/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/misc/ThirdPartyEvents.java b/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/misc/ThirdPartyEvents.java index 6fe7c1c..67aa485 100644 --- a/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/misc/ThirdPartyEvents.java +++ b/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/misc/ThirdPartyEvents.java @@ -39,7 +39,7 @@ import org.apache.ofbiz.entity.util.EntityUtil; public class ThirdPartyEvents { - public static final String module = ThirdPartyEvents.class.getName(); + public static final String MODULE = ThirdPartyEvents.class.getName(); public final static String DISTRIBUTOR_ID = "_DISTRIBUTOR_ID_"; public final static String AFFILIATE_ID = "_AFFILIATE_ID_"; @@ -111,7 +111,7 @@ public class ThirdPartyEvents { try { ecommercePropertiesUrl = request.getServletContext().getResource("/WEB-INF/ecommerce.properties"); } catch (java.net.MalformedURLException e) { - Debug.logWarning(e, module); + Debug.logWarning(e, MODULE); } String store = UtilProperties.getPropertyValue(ecommercePropertiesUrl, "distributor.store.customer"); @@ -129,7 +129,7 @@ public class ThirdPartyEvents { try { party = userLogin == null ? null : userLogin.getRelatedOne("Party", false); } catch (GenericEntityException gee) { - Debug.logWarning(gee, module); + Debug.logWarning(gee, MODULE); } if (party != null) { @@ -155,13 +155,13 @@ public class ThirdPartyEvents { toBeStored.add(delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", distributorId, "roleTypeId", "DISTRIBUTOR"))); try { delegator.storeAll(toBeStored); - if (Debug.infoOn()) Debug.logInfo("Distributor for user " + party.getString("partyId") + " set to " + distributorId, module); + if (Debug.infoOn()) Debug.logInfo("Distributor for user " + party.getString("partyId") + " set to " + distributorId, MODULE); } catch (GenericEntityException gee) { - Debug.logWarning(gee, module); + Debug.logWarning(gee, MODULE); } } else { // no distributorId is available - Debug.logInfo("No distributor in session or already associated with user " + userLogin.getString("partyId"), module); + Debug.logInfo("No distributor in session or already associated with user " + userLogin.getString("partyId"), MODULE); return "success"; } } else { @@ -171,7 +171,7 @@ public class ThirdPartyEvents { return "success"; } else { // not logged in - Debug.logWarning("Cannot associate distributor since not logged in yet", module); + Debug.logWarning("Cannot associate distributor since not logged in yet", MODULE); return "success"; } } @@ -191,7 +191,7 @@ public class ThirdPartyEvents { try { ecommercePropertiesUrl = request.getServletContext().getResource("/WEB-INF/ecommerce.properties"); } catch (java.net.MalformedURLException e) { - Debug.logWarning(e, module); + Debug.logWarning(e, MODULE); } String store = UtilProperties.getPropertyValue(ecommercePropertiesUrl, "affiliate.store.customer"); @@ -206,7 +206,7 @@ public class ThirdPartyEvents { try { party = userLogin == null ? null : userLogin.getRelatedOne("Party", false); } catch (GenericEntityException gee) { - Debug.logWarning(gee, module); + Debug.logWarning(gee, MODULE); } if (party != null) { @@ -224,13 +224,13 @@ public class ThirdPartyEvents { partyRelationship.set("partyRelationshipTypeId", "SALES_AFFILIATE"); try { delegator.create(partyRelationship); - if (Debug.infoOn()) Debug.logInfo("Affiliate for user " + party.getString("partyId") + " set to " + affiliateId, module); + if (Debug.infoOn()) Debug.logInfo("Affiliate for user " + party.getString("partyId") + " set to " + affiliateId, MODULE); } catch (GenericEntityException gee) { - Debug.logWarning(gee, module); + Debug.logWarning(gee, MODULE); } } else { // no distributorId is available - Debug.logInfo("No affiliate in session or already associated with user " + userLogin.getString("partyId"), module); + Debug.logInfo("No affiliate in session or already associated with user " + userLogin.getString("partyId"), MODULE); return "success"; } } else { @@ -240,7 +240,7 @@ public class ThirdPartyEvents { return "success"; } else { // not logged in - Debug.logWarning("Cannot associate affiliate since not logged in yet", module); + Debug.logWarning("Cannot associate affiliate since not logged in yet", MODULE); return "success"; } } @@ -249,7 +249,7 @@ public class ThirdPartyEvents { try { return EntityUtil.getFirst(EntityUtil.filterByDate(party.getRelated("FromPartyRelationship", UtilMisc.toMap("roleTypeIdTo", roleTypeTo), null, false), true)); } catch (GenericEntityException gee) { - Debug.logWarning(gee, module); + Debug.logWarning(gee, MODULE); } return null; } diff --git a/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java b/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java index 91faa7e..d8b4289 100644 --- a/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java +++ b/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java @@ -39,7 +39,7 @@ import org.apache.ofbiz.webapp.view.ViewHandlerException; */ public class JspViewHandler extends AbstractViewHandler { - public static final String module = JspViewHandler.class.getName(); + public static final String MODULE = JspViewHandler.class.getName(); protected ServletContext context; @@ -60,7 +60,7 @@ public class JspViewHandler extends AbstractViewHandler { throw new ViewHandlerException("Null or empty source"); } - // Debug.logInfo("Requested Page : " + page, module); + // Debug.logInfo("Requested Page : " + page, MODULE); // Debug.logInfo("Physical Path : " + context.getRealPath(page)); // tell the ControlFilter we are forwarding @@ -68,10 +68,10 @@ public class JspViewHandler extends AbstractViewHandler { RequestDispatcher rd = request.getRequestDispatcher(page); if (rd == null) { - Debug.logInfo("HttpServletRequest.getRequestDispatcher() failed; trying ServletContext", module); + Debug.logInfo("HttpServletRequest.getRequestDispatcher() failed; trying ServletContext", MODULE); rd = context.getRequestDispatcher(page); if (rd == null) { - Debug.logInfo("ServletContext.getRequestDispatcher() failed; trying ServletContext.getNamedDispatcher(\"jsp\")", module); + Debug.logInfo("ServletContext.getRequestDispatcher() failed; trying ServletContext.getNamedDispatcher(\"jsp\")", MODULE); rd = context.getNamedDispatcher("jsp"); if (rd == null) { throw new ViewHandlerException("Source returned a null dispatcher (" + page + ")"); @@ -98,7 +98,7 @@ public class JspViewHandler extends AbstractViewHandler { throwable = jspe.getCause() != null ? jspe.getCause() : jspe; } - Debug.logError(throwable, "ServletException rendering JSP view", module); + Debug.logError(throwable, "ServletException rendering JSP view", MODULE); throw new ViewHandlerException(e.getMessage(), throwable); } } diff --git a/ecommerce/template/includes/HeaderHead.ftl b/ecommerce/template/includes/HeaderHead.ftl index fb0ae48..75c21c7 100644 --- a/ecommerce/template/includes/HeaderHead.ftl +++ b/ecommerce/template/includes/HeaderHead.ftl @@ -25,7 +25,7 @@ under the License. <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <#assign csrfDefenseStrategy = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("security", "csrf.defense.strategy", delegator)> + <#assign csrfDefenseStrategy = Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("security", "csrf.defense.strategy", "org.apache.ofbiz.security.NoCsrfDefenseStrategy", delegator)> <#if csrfDefenseStrategy != "org.apache.ofbiz.security.NoCsrfDefenseStrategy"> <meta name="csrf-token" content="<@csrfTokenAjax/>"/> </#if> diff --git a/example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java b/example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java index 54053eb..81b7440 100644 --- a/example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java +++ b/example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java @@ -61,7 +61,7 @@ import org.xml.sax.SAXException; import freemarker.template.TemplateException; public class ExamplePrintServices { - public static final String module = ExamplePrintServices.class.getName(); + public static final String MODULE = ExamplePrintServices.class.getName(); public static final String resource = "ExampleUiLabels"; public static Map<String, Object> printReportPdf(DispatchContext dctx, Map<String, ? extends Object> context) { @@ -83,11 +83,11 @@ public class ExamplePrintServices { screenStringRenderer = new MacroScreenRenderer("screen", visualTheme.getModelTheme().getScreenRendererLocation("screen")); } catch (TemplateException e) { String errMsg = UtilProperties.getMessage(resource, "ExampleGeneralErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (IOException e) { String errMsg = UtilProperties.getMessage(resource, "ExampleIOErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } @@ -101,19 +101,19 @@ public class ExamplePrintServices { reportScreenRenderer.render(screenLocation, reportScreenName); } catch (GeneralException e) { String errMsg = UtilProperties.getMessage(resource, "ExampleGeneralErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (IOException e) { String errMsg = UtilProperties.getMessage(resource, "ExampleIOErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (SAXException e) { String errMsg = UtilProperties.getMessage(resource, "ExampleSAXErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } catch (ParserConfigurationException e) { String errMsg = UtilProperties.getMessage(resource, "ExampleParserConfigurationErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale); - Debug.logError(e, errMsg, module); + Debug.logError(e, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } @@ -160,7 +160,7 @@ public class ExamplePrintServices { job.print(myDoc, aset); } catch (PrintException pe) { String errMsg = UtilProperties.getMessage(resource, "ExampleUnableToPrintPDFFromXSL-FO", UtilMisc.toMap("errorString", pe.toString()), locale); - Debug.logError(pe, errMsg, module); + Debug.logError(pe, errMsg, MODULE); return ServiceUtil.returnError(errMsg); } } diff --git a/example/src/main/java/org/apache/ofbiz/example/ExampleServices.java b/example/src/main/java/org/apache/ofbiz/example/ExampleServices.java index cbcafed..a98a391 100644 --- a/example/src/main/java/org/apache/ofbiz/example/ExampleServices.java +++ b/example/src/main/java/org/apache/ofbiz/example/ExampleServices.java @@ -29,7 +29,7 @@ import org.apache.ofbiz.service.DispatchContext; import org.apache.ofbiz.service.ServiceUtil; public class ExampleServices { - public static final String module = ExampleServices.class.getName(); + public static final String MODULE = ExampleServices.class.getName(); public static Map<String, Object> sendExamplePushNotifications(DispatchContext dctx, Map<String, ? extends Object> context) { String exampleId = (String) context.get("exampleId"); @@ -42,7 +42,7 @@ public class ExampleServices { } } } catch (IOException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } return ServiceUtil.returnSuccess(); } diff --git a/example/src/main/java/org/apache/ofbiz/example/ExampleWebSockets.java b/example/src/main/java/org/apache/ofbiz/example/ExampleWebSockets.java index 728ad7a..36eaf75 100644 --- a/example/src/main/java/org/apache/ofbiz/example/ExampleWebSockets.java +++ b/example/src/main/java/org/apache/ofbiz/example/ExampleWebSockets.java @@ -35,7 +35,7 @@ import org.apache.ofbiz.base.util.Debug; @ServerEndpoint("/ws/pushNotifications") public class ExampleWebSockets { - public static final String module = ExampleWebSockets.class.getName(); + public static final String MODULE = ExampleWebSockets.class.getName(); private static Set<Session> clients = Collections.synchronizedSet(new HashSet<Session>()); @@ -55,7 +55,7 @@ public class ExampleWebSockets { try { session.close(); } catch (IOException ioe) { - Debug.logError(ioe.getMessage(), module); + Debug.logError(ioe.getMessage(), MODULE); } } } diff --git a/ldap/src/main/java/org/apache/ofbiz/ldap/LdapLoginWorker.java b/ldap/src/main/java/org/apache/ofbiz/ldap/LdapLoginWorker.java index 81615af..7c3dce4 100644 --- a/ldap/src/main/java/org/apache/ofbiz/ldap/LdapLoginWorker.java +++ b/ldap/src/main/java/org/apache/ofbiz/ldap/LdapLoginWorker.java @@ -75,7 +75,7 @@ public class LdapLoginWorker extends LoginWorker { InterfaceOFBizAuthenticationHandler authenticationHandler = (InterfaceOFBizAuthenticationHandler) handlerClass.getDeclaredConstructor().newInstance(); hasLdapLoggedOut = authenticationHandler.hasLdapLoggedOut(request, response, rootElement); } catch (Exception e) { - Debug.logError(e, "Error calling checkLogin service", module); + Debug.logError(e, "Error calling checkLogin service", MODULE); Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); String errMsg = UtilProperties.getMessage(resourceWebapp, "loginevents.following_error_occurred_during_login", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); @@ -83,7 +83,7 @@ public class LdapLoginWorker extends LoginWorker { } if (!hasBasePermission(userLogin, request) || isFlaggedLoggedOut(userLogin, userLogin.getDelegator()) || hasLdapLoggedOut) { - Debug.logInfo("User does not have permission or is flagged as logged out", module); + Debug.logInfo("User does not have permission or is flagged as logged out", MODULE); doBasicLogout(userLogin, request, response); userLogin = null; } @@ -115,7 +115,7 @@ public class LdapLoginWorker extends LoginWorker { InterfaceOFBizAuthenticationHandler authenticationHandler = (InterfaceOFBizAuthenticationHandler) handlerClass.getDeclaredConstructor().newInstance(); result = authenticationHandler.login(request, response, rootElement); } catch (Exception e) { - Debug.logError(e, "Error calling userLogin service", module); + Debug.logError(e, "Error calling userLogin service", MODULE); Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); String errMsg = UtilProperties.getMessage(resourceWebapp, "loginevents.following_error_occurred_during_login", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); @@ -159,7 +159,7 @@ public class LdapLoginWorker extends LoginWorker { InterfaceOFBizAuthenticationHandler authenticationHandler = (InterfaceOFBizAuthenticationHandler) handlerClass.getDeclaredConstructor().newInstance(); result = authenticationHandler.logout(request, response, rootElement); } catch (Exception e) { - Debug.logError(e, "Error calling userLogin service", module); + Debug.logError(e, "Error calling userLogin service", MODULE); Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); String errMsg = UtilProperties.getMessage(resourceWebapp, "loginevents.following_error_occurred_during_login", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); @@ -174,7 +174,7 @@ public class LdapLoginWorker extends LoginWorker { protected static Element getRootElement(HttpServletRequest request) { if (Debug.infoOn()) { - Debug.logInfo("LDAP config file: " + ldapConfig, module); + Debug.logInfo("LDAP config file: " + ldapConfig, MODULE); } File configFile = new File(ldapConfig); FileInputStream configFileIS = null; @@ -184,22 +184,22 @@ public class LdapLoginWorker extends LoginWorker { Document configDoc = UtilXml.readXmlDocument(configFileIS, "LDAP configuration file " + ldapConfig); rootElement = configDoc.getDocumentElement(); } catch (FileNotFoundException e) { - Debug.logError(e, "Error calling userLogin service", module); + Debug.logError(e, "Error calling userLogin service", MODULE); Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); String errMsg = UtilProperties.getMessage(resourceWebapp, "loginevents.following_error_occurred_during_login", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); } catch (SAXException e) { - Debug.logError(e, "Error calling userLogin service", module); + Debug.logError(e, "Error calling userLogin service", MODULE); Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); String errMsg = UtilProperties.getMessage(resourceWebapp, "loginevents.following_error_occurred_during_login", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); } catch (ParserConfigurationException e) { - Debug.logError(e, "Error calling userLogin service", module); + Debug.logError(e, "Error calling userLogin service", MODULE); Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); String errMsg = UtilProperties.getMessage(resourceWebapp, "loginevents.following_error_occurred_during_login", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); } catch (IOException e) { - Debug.logError(e, "Error calling userLogin service", module); + Debug.logError(e, "Error calling userLogin service", MODULE); Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); String errMsg = UtilProperties.getMessage(resourceWebapp, "loginevents.following_error_occurred_during_login", messageMap, UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); diff --git a/lucene/src/main/java/org/apache/ofbiz/content/search/ContentDocument.java b/lucene/src/main/java/org/apache/ofbiz/content/search/ContentDocument.java index 7f6440c..fe829e3 100644 --- a/lucene/src/main/java/org/apache/ofbiz/content/search/ContentDocument.java +++ b/lucene/src/main/java/org/apache/ofbiz/content/search/ContentDocument.java @@ -47,7 +47,7 @@ import org.apache.ofbiz.service.LocalDispatcher; public class ContentDocument implements LuceneDocument { - private static final String module = ContentDocument.class.getName(); + private static final String MODULE = ContentDocument.class.getName(); private final Term documentIdentifier; private final LocalDispatcher dispatcher; private final GenericValue content; @@ -111,7 +111,7 @@ public class ContentDocument implements LuceneDocument { try { dataResource = content.getRelatedOne("DataResource", true); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return false; } if (dataResource == null) { @@ -130,10 +130,10 @@ public class ContentDocument implements LuceneDocument { try { text = ContentWorker.renderContentAsText(dispatcher, contentId, null, locale, mimeTypeId, true); } catch (GeneralException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return false; } catch (IOException e2) { - Debug.logError(e2, module); + Debug.logError(e2, MODULE); return false; } if (UtilValidate.isNotEmpty(text)) { @@ -144,7 +144,7 @@ public class ContentDocument implements LuceneDocument { try { featureDataResourceList = content.getRelated("ProductFeatureDataResource", null, null, true); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return false; } List<String> featureList = new ArrayList<>(); diff --git a/lucene/src/main/java/org/apache/ofbiz/content/search/DocumentIndexer.java b/lucene/src/main/java/org/apache/ofbiz/content/search/DocumentIndexer.java index 9859e49..8c0bd14 100644 --- a/lucene/src/main/java/org/apache/ofbiz/content/search/DocumentIndexer.java +++ b/lucene/src/main/java/org/apache/ofbiz/content/search/DocumentIndexer.java @@ -39,7 +39,7 @@ import org.apache.lucene.store.LockObtainFailedException; public class DocumentIndexer extends Thread { - public static final String module = DocumentIndexer.class.getName(); + public static final String MODULE = DocumentIndexer.class.getName(); private static Map<String, DocumentIndexer> documentIndexerMap = new HashMap<>(); private LinkedBlockingQueue<LuceneDocument> documentIndexQueue = new LinkedBlockingQueue<>(); @@ -53,11 +53,11 @@ public class DocumentIndexer extends Thread { try { this.indexDirectory = FSDirectory.open(new File(SearchWorker.getIndexPath(indexName)).toPath()); } catch (CorruptIndexException e) { - Debug.logError("Corrupted lucene index: " + e.getMessage(), module); + Debug.logError("Corrupted lucene index: " + e.getMessage(), MODULE); } catch (LockObtainFailedException e) { - Debug.logError("Could not obtain Lock on lucene index " + e.getMessage(), module); + Debug.logError("Could not obtain Lock on lucene index " + e.getMessage(), MODULE); } catch (IOException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } } @@ -83,13 +83,13 @@ public class DocumentIndexer extends Thread { // Execution will pause here until the queue receives a LuceneDocument for indexing ofbizDocument = documentIndexQueue.take(); } catch (InterruptedException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); if (indexWriter != null) { try { indexWriter.close(); indexWriter = null; } catch(IOException ioe) { - Debug.logError(ioe, module); + Debug.logError(ioe, MODULE); } } break; @@ -102,33 +102,33 @@ public class DocumentIndexer extends Thread { analyzer.setVersion(SearchWorker.getLuceneVersion()); indexWriter = new IndexWriter(this.indexDirectory, new IndexWriterConfig(analyzer)); } catch (CorruptIndexException e) { - Debug.logError("Corrupted lucene index: " + e.getMessage(), module); + Debug.logError("Corrupted lucene index: " + e.getMessage(), MODULE); break; } catch (LockObtainFailedException e) { - Debug.logError("Could not obtain Lock on lucene index " + e.getMessage(), module); + Debug.logError("Could not obtain Lock on lucene index " + e.getMessage(), MODULE); // TODO: put the thread to sleep waiting for the locked to be released break; } catch (IOException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); break; } } try { if (document == null) { indexWriter.deleteDocuments(documentIdentifier); - if (Debug.infoOn()) Debug.logInfo(getName() + ": deleted Lucene document: " + ofbizDocument, module); + if (Debug.infoOn()) Debug.logInfo(getName() + ": deleted Lucene document: " + ofbizDocument, MODULE); } else { indexWriter.updateDocument(documentIdentifier, document); - if (Debug.infoOn()) Debug.logInfo(getName() + ": indexed Lucene document: " + ofbizDocument, module); + if (Debug.infoOn()) Debug.logInfo(getName() + ": indexed Lucene document: " + ofbizDocument, MODULE); } } catch(Exception e) { - Debug.logError(e, getName() + ": error processing Lucene document: " + ofbizDocument, module); + Debug.logError(e, getName() + ": error processing Lucene document: " + ofbizDocument, MODULE); if (documentIndexQueue.peek() == null) { try { indexWriter.close(); indexWriter = null; } catch(IOException ioe) { - Debug.logError(ioe, module); + Debug.logError(ioe, MODULE); } } continue; @@ -139,7 +139,7 @@ public class DocumentIndexer extends Thread { try { indexWriter.commit(); } catch (IOException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } uncommittedDocs = 0; } @@ -148,7 +148,7 @@ public class DocumentIndexer extends Thread { indexWriter.close(); indexWriter = null; } catch (IOException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } } diff --git a/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java b/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java index a6c4c67..62adbc4 100644 --- a/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java +++ b/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java @@ -48,7 +48,7 @@ import org.apache.ofbiz.entity.util.EntityUtil; import org.apache.ofbiz.entity.util.EntityUtilProperties; public class ProductDocument implements LuceneDocument { - private static final String module = ProductDocument.class.getName(); + private static final String MODULE = ProductDocument.class.getName(); private static final String NULL_STRING = "NULL"; private final Term documentIdentifier; @@ -185,7 +185,7 @@ public class ProductDocument implements LuceneDocument { try { EntityUtilProperties.getPropertyAsInteger("prodsearch", "index.weight.ProductContent." + productContentTypeId, 1); } catch (Exception e) { - Debug.logWarning("Could not parse weight number: " + e.toString(), module); + Debug.logWarning("Could not parse weight number: " + e.toString(), MODULE); } List<GenericValue> productContentAndInfos = EntityQuery.use(delegator).from("ProductContentAndInfo").where("productId", productId, "productContentTypeId", productContentTypeId).queryList(); @@ -205,9 +205,9 @@ public class ProductDocument implements LuceneDocument { String contentText = DataResourceWorker.renderDataResourceAsText(null, delegator, productContentAndInfo.getString("dataResourceId"), drContext, null, null, false); addTextField(doc, "content", contentText, false, "fullText", delegator); } catch (IOException e1) { - Debug.logError(e1, "Error getting content text to index", module); + Debug.logError(e1, "Error getting content text to index", MODULE); } catch (GeneralException e1) { - Debug.logError(e1, "Error getting content text to index", module); + Debug.logError(e1, "Error getting content text to index", MODULE); } // TODO: Not indexing alternate locales, needs special handling @@ -273,7 +273,7 @@ public class ProductDocument implements LuceneDocument { return doc; } } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } return null; } diff --git a/lucene/src/main/java/org/apache/ofbiz/content/search/SearchEvents.java b/lucene/src/main/java/org/apache/ofbiz/content/search/SearchEvents.java index a68581a..b82c0d4 100644 --- a/lucene/src/main/java/org/apache/ofbiz/content/search/SearchEvents.java +++ b/lucene/src/main/java/org/apache/ofbiz/content/search/SearchEvents.java @@ -39,7 +39,7 @@ import org.apache.ofbiz.service.ServiceUtil; */ public class SearchEvents { - public static final String module = SearchEvents.class.getName(); + public static final String MODULE = SearchEvents.class.getName(); public static String indexContentTree(HttpServletRequest request, HttpServletResponse response) { @@ -57,12 +57,12 @@ public class SearchEvents { if (ServiceUtil.isError(result)) { String errorMessage = ServiceUtil.getErrorMessage(result); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } } catch (GenericServiceException e) { String errorMsg = "Error calling the indexContentTree service." + e.toString(); - Debug.logError(e, errorMsg, module); + Debug.logError(e, errorMsg, MODULE); request.setAttribute("_ERROR_MESSAGE_", errorMsg + e.toString()); return "error"; } diff --git a/lucene/src/main/java/org/apache/ofbiz/content/search/SearchServices.java b/lucene/src/main/java/org/apache/ofbiz/content/search/SearchServices.java index fca2d97..64c32ad 100644 --- a/lucene/src/main/java/org/apache/ofbiz/content/search/SearchServices.java +++ b/lucene/src/main/java/org/apache/ofbiz/content/search/SearchServices.java @@ -43,7 +43,7 @@ import java.util.HashMap; */ public class SearchServices { - public static final String module = SearchServices.class.getName(); + public static final String MODULE = SearchServices.class.getName(); public static final String resource = "ContentUiLabels"; public static Map<String, Object> indexContentTree(DispatchContext dctx, Map<String, ? extends Object> context) { @@ -54,7 +54,7 @@ public class SearchServices { try { SearchWorker.indexContentTree(dispatcher, delegator, siteId); } catch (Exception e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentIndexingTreeError", UtilMisc.toMap("errorString", e.toString()), locale)); } @@ -83,12 +83,12 @@ public class SearchServices { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result)); } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } return ServiceUtil.returnSuccess(); } @@ -106,7 +106,7 @@ public class SearchServices { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result)); } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } return ServiceUtil.returnSuccess(); } @@ -127,9 +127,9 @@ public class SearchServices { } } } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } return ServiceUtil.returnSuccess(); } @@ -145,11 +145,11 @@ public class SearchServices { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result)); } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } return ServiceUtil.returnSuccess(); } @@ -161,7 +161,7 @@ public class SearchServices { indexProductCategoryMembers(productCategoryId, delegator, dispatcher); indexProductCategoryRollup(productCategoryId, delegator, dispatcher, UtilMisc.<String>toSet(productCategoryId)); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } return ServiceUtil.returnSuccess(); } @@ -188,7 +188,7 @@ public class SearchServices { throw new GenericEntityException(ServiceUtil.getErrorMessage(result)); } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } } diff --git a/lucene/src/main/java/org/apache/ofbiz/content/search/SearchWorker.java b/lucene/src/main/java/org/apache/ofbiz/content/search/SearchWorker.java index 1f935d4..835b3d3 100644 --- a/lucene/src/main/java/org/apache/ofbiz/content/search/SearchWorker.java +++ b/lucene/src/main/java/org/apache/ofbiz/content/search/SearchWorker.java @@ -39,7 +39,7 @@ import org.apache.ofbiz.service.LocalDispatcher; */ public final class SearchWorker { - public static final String module = SearchWorker.class.getName(); + public static final String MODULE = SearchWorker.class.getName(); private static final Version LUCENE_VERSION = Version.LUCENE_8_2_0; @@ -81,7 +81,7 @@ public final class SearchWorker { contentList.add(content); } } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return; } } diff --git a/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java b/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java index becc470..58182d8 100644 --- a/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java +++ b/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java @@ -44,7 +44,7 @@ import org.apache.ofbiz.service.testtools.OFBizTestCase; public class LuceneTests extends OFBizTestCase { protected GenericValue userLogin = null; - public final static String module = LuceneTests.class.getName(); + public final static String MODULE = LuceneTests.class.getName(); public LuceneTests(String name) { super(name); @@ -73,7 +73,7 @@ public class LuceneTests extends OFBizTestCase { try { Thread.sleep(3000); // sleep 3 seconds to give enough time to the indexer to process the entries } catch (InterruptedException e) { - Debug.logError("Thread interrupted :" + e, module); + Debug.logError("Thread interrupted :" + e, MODULE); } Directory directory = FSDirectory.open(new File(SearchWorker.getIndexPath("content")).toPath()); diff --git a/msggateway/src/main/java/org/apache/ofbiz/msg91/Msg91Services.java b/msggateway/src/main/java/org/apache/ofbiz/msg91/Msg91Services.java index 9f294a6..10d5bf2 100644 --- a/msggateway/src/main/java/org/apache/ofbiz/msg91/Msg91Services.java +++ b/msggateway/src/main/java/org/apache/ofbiz/msg91/Msg91Services.java @@ -35,7 +35,7 @@ import org.apache.ofbiz.service.DispatchContext; import org.apache.ofbiz.service.ServiceUtil; public class Msg91Services { - public final static String module = Msg91Services.class.getName(); + public final static String MODULE = Msg91Services.class.getName(); public static Map<String, Object> sendMsg91Sms(DispatchContext ctx, Map<String, ? extends Object> context) { Delegator delegator = ctx.getDelegator(); @@ -60,11 +60,11 @@ public class Msg91Services { String response = httpClient.get(); result.put("response", response); } else { - Debug.logError("Message not sent as the telecom gateway configuration settings are not found", module); + Debug.logError("Message not sent as the telecom gateway configuration settings are not found", MODULE); return ServiceUtil.returnError("Message not sent as the telecom gateway configuration settings are not found"); } } catch (GenericEntityException | HttpClientException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return ServiceUtil.returnError(e.getMessage()); } return result; diff --git a/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java b/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java index 59ec6f5..f8bfca3 100644 --- a/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java +++ b/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java @@ -68,7 +68,7 @@ import org.apache.ofbiz.service.LocalDispatcher; */ public class GitHubEvents { - public static final String module = GitHubEvents.class.getName(); + public static final String MODULE = GitHubEvents.class.getName(); public static final String resource = "PassportUiLabels"; @@ -111,7 +111,7 @@ public class GitHubEvents { + "&scope=" + DEFAULT_SCOPE + "&redirect_uri=" + URLEncoder.encode(returnURI, "UTF-8") + "&state=" + state; - Debug.logInfo("Request to GitHub: " + redirectUrl, module); + Debug.logInfo("Request to GitHub: " + redirectUrl, MODULE); response.sendRedirect(redirectUrl); } catch (NullPointerException e) { String errMsg = UtilProperties.getMessage(resource, "GitHubRedirectToOAuth2NullException", UtilHttp.getLocale(request)); @@ -152,7 +152,7 @@ public class GitHubEvents { request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } - Debug.logInfo("GitHub authorization code: " + authorizationCode, module); + Debug.logInfo("GitHub authorization code: " + authorizationCode, MODULE); GenericValue oauth2GitHub = getOAuth2GitHubConfig(request); if (UtilValidate.isEmpty(oauth2GitHub)) { @@ -181,22 +181,22 @@ public class GitHubEvents { .build(); HttpPost postMethod = new HttpPost(uri); CloseableHttpClient jsonClient = HttpClients.custom().build(); - // Debug.logInfo("GitHub get access token query string: " + postMethod.getURI(), module); + // Debug.logInfo("GitHub get access token query string: " + postMethod.getURI(), MODULE); postMethod.setConfig(PassportUtil.StandardRequestConfig); postMethod.setHeader(PassportUtil.ACCEPT_HEADER, "application/json"); CloseableHttpResponse postResponse = jsonClient.execute(postMethod); String responseString = new BasicResponseHandler().handleResponse(postResponse); - // Debug.logInfo("GitHub get access token response code: " + postResponse.getStatusLine().getStatusCode(), module); - // Debug.logInfo("GitHub get access token response content: " + responseString, module); + // Debug.logInfo("GitHub get access token response code: " + postResponse.getStatusLine().getStatusCode(), MODULE); + // Debug.logInfo("GitHub get access token response content: " + responseString, MODULE); if (postResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { - Debug.logInfo("Json Response from GitHub: " + responseString, module); + Debug.logInfo("Json Response from GitHub: " + responseString, MODULE); JSON jsonObject = JSON.from(responseString); JSONToMap jsonMap = new JSONToMap(); Map<String, Object> userMap = jsonMap.convert(jsonObject); accessToken = (String) userMap.get("access_token"); tokenType = (String) userMap.get("token_type"); - // Debug.logInfo("Generated Access Token : " + accessToken, module); - // Debug.logInfo("Token Type: " + tokenType, module); + // Debug.logInfo("Generated Access Token : " + accessToken, MODULE); + // Debug.logInfo("Token Type: " + tokenType, MODULE); } else { String errMsg = UtilProperties.getMessage(resource, "GitHubGetOAuth2AccessTokenError", UtilMisc.toMap("error", responseString), UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); @@ -227,7 +227,7 @@ public class GitHubEvents { } finally { getMethod.releaseConnection(); } - // Debug.logInfo("GitHub User Info:" + userInfo, module); + // Debug.logInfo("GitHub User Info:" + userInfo, MODULE); // Store the user info and check login the user return checkLoginGitHubUser(request, userInfo, accessToken); @@ -263,7 +263,7 @@ public class GitHubEvents { try { gitHubUser.store(); } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } } } else { @@ -274,7 +274,7 @@ public class GitHubEvents { try { gitHubUser.create(); } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } } try { @@ -292,11 +292,11 @@ public class GitHubEvents { request.setAttribute("USERNAME", userLogin.getString("userLoginId")); request.setAttribute("PASSWORD", autoPassword); } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_", e.toString()); return "error"; } catch (AuthenticatorException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_", e.toString()); return "error"; } diff --git a/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java b/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java index 406c478..59ece75 100644 --- a/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java +++ b/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java @@ -71,7 +71,7 @@ import org.xml.sax.SAXException; */ public class LinkedInEvents { - public static final String module = LinkedInEvents.class.getName(); + public static final String MODULE = LinkedInEvents.class.getName(); public static final String resource = "PassportUiLabels"; @@ -153,7 +153,7 @@ public class LinkedInEvents { request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } - // Debug.logInfo("LinkedIn authorization code: " + authorizationCode, module); + // Debug.logInfo("LinkedIn authorization code: " + authorizationCode, MODULE); GenericValue oauth2LinkedIn = getOAuth2LinkedInConfig(request); if (UtilValidate.isEmpty(oauth2LinkedIn)) { @@ -182,19 +182,19 @@ public class LinkedInEvents { .build(); HttpPost postMethod = new HttpPost(uri); CloseableHttpClient jsonClient = HttpClients.custom().build(); - // Debug.logInfo("LinkedIn get access token query string: " + postMethod.getURI(), module); + // Debug.logInfo("LinkedIn get access token query string: " + postMethod.getURI(), MODULE); postMethod.setConfig(PassportUtil.StandardRequestConfig); CloseableHttpResponse postResponse = jsonClient.execute(postMethod); String responseString = new BasicResponseHandler().handleResponse(postResponse); - // Debug.logInfo("LinkedIn get access token response code: " + postResponse.getStatusLine().getStatusCode(), module); - // Debug.logInfo("LinkedIn get access token response content: " + responseString, module); + // Debug.logInfo("LinkedIn get access token response code: " + postResponse.getStatusLine().getStatusCode(), MODULE); + // Debug.logInfo("LinkedIn get access token response content: " + responseString, MODULE); if (postResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { - // Debug.logInfo("Json Response from LinkedIn: " + responseString, module); + // Debug.logInfo("Json Response from LinkedIn: " + responseString, MODULE); JSON jsonObject = JSON.from(responseString); JSONToMap jsonMap = new JSONToMap(); Map<String, Object> userMap = jsonMap.convert(jsonObject); accessToken = (String) userMap.get("access_token"); - // Debug.logInfo("Generated Access Token : " + accessToken, module); + // Debug.logInfo("Generated Access Token : " + accessToken, MODULE); } else { String errMsg = UtilProperties.getMessage(resource, "LinkedInGetOAuth2AccessTokenError", UtilMisc.toMap("error", responseString), UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); @@ -234,7 +234,7 @@ public class LinkedInEvents { } finally { getMethod.releaseConnection(); } - // Debug.logInfo("LinkedIn User Info:" + userInfo, module); + // Debug.logInfo("LinkedIn User Info:" + userInfo, MODULE); // Store the user info and check login the user return checkLoginLinkedInUser(request, userInfo, accessToken); @@ -270,7 +270,7 @@ public class LinkedInEvents { try { linkedInUser.store(); } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } } } else { @@ -281,7 +281,7 @@ public class LinkedInEvents { try { linkedInUser.create(); } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } } try { @@ -299,11 +299,11 @@ public class LinkedInEvents { request.setAttribute("USERNAME", userLogin.getString("userLoginId")); request.setAttribute("PASSWORD", autoPassword); } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_", e.toString()); return "error"; } catch (AuthenticatorException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); request.setAttribute("_ERROR_MESSAGE_", e.toString()); return "error"; } diff --git a/passport/src/main/java/org/apache/ofbiz/passport/user/GitHubAuthenticator.java b/passport/src/main/java/org/apache/ofbiz/passport/user/GitHubAuthenticator.java index abca178..695f68f 100644 --- a/passport/src/main/java/org/apache/ofbiz/passport/user/GitHubAuthenticator.java +++ b/passport/src/main/java/org/apache/ofbiz/passport/user/GitHubAuthenticator.java @@ -62,7 +62,7 @@ import org.apache.ofbiz.base.util.UtilValidate; */ public class GitHubAuthenticator implements Authenticator { - private static final String module = GitHubAuthenticator.class.getName(); + private static final String MODULE = GitHubAuthenticator.class.getName(); public static final String props = "gitHubAuth.properties"; @@ -124,7 +124,7 @@ public class GitHubAuthenticator implements Authenticator { } } - Debug.logInfo("GitHub auth called; returned user info: " + user, module); + Debug.logInfo("GitHub auth called; returned user info: " + user, MODULE); return user != null; } @@ -171,7 +171,7 @@ public class GitHubAuthenticator implements Authenticator { try { parentTx = TransactionUtil.suspend(); } catch (GenericTransactionException e) { - Debug.logError(e, "Could not suspend transaction: " + e.getMessage(), module); + Debug.logError(e, "Could not suspend transaction: " + e.getMessage(), MODULE); } try { @@ -186,12 +186,12 @@ public class GitHubAuthenticator implements Authenticator { } } catch (GenericTransactionException e) { - Debug.logError(e, "Could not suspend transaction: " + e.getMessage(), module); + Debug.logError(e, "Could not suspend transaction: " + e.getMessage(), MODULE); } finally { try { TransactionUtil.commit(beganTransaction); } catch (GenericTransactionException e) { - Debug.logError(e, "Could not commit nested transaction: " + e.getMessage(), module); + Debug.logError(e, "Could not commit nested transaction: " + e.getMessage(), MODULE); } } } finally { @@ -199,9 +199,9 @@ public class GitHubAuthenticator implements Authenticator { if (parentTx != null) { try { TransactionUtil.resume(parentTx); - if (Debug.verboseOn()) Debug.logVerbose("Resumed the parent transaction.", module); + if (Debug.verboseOn()) Debug.logVerbose("Resumed the parent transaction.", MODULE); } catch (GenericTransactionException e) { - Debug.logError(e, "Could not resume parent nested transaction: " + e.getMessage(), module); + Debug.logError(e, "Could not resume parent nested transaction: " + e.getMessage(), MODULE); } } } @@ -272,7 +272,7 @@ public class GitHubAuthenticator implements Authenticator { try { delegator.create(partyRole); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); throw new AuthenticatorException(e.getMessage(), e); } @@ -302,7 +302,7 @@ public class GitHubAuthenticator implements Authenticator { try { secGroup = EntityQuery.use(delegator).from("SecurityGroup").where("groupId", securityGroup).cache().queryOne(); } catch (GenericEntityException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); } // add it to the user if it exists @@ -342,7 +342,7 @@ public class GitHubAuthenticator implements Authenticator { */ @Override public void updatePassword(String username, String password, String newPassword) throws AuthenticatorException { - Debug.logInfo("Calling GitHub:updatePassword() - ignored!!!", module); + Debug.logInfo("Calling GitHub:updatePassword() - ignored!!!", MODULE); } /** @@ -396,7 +396,7 @@ public class GitHubAuthenticator implements Authenticator { getResponse = jsonClient.execute(httpGet); String responseString = new BasicResponseHandler().handleResponse(getResponse); if (getResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { - // Debug.logInfo("Json Response from GitHub: " + responseString, module); + // Debug.logInfo("Json Response from GitHub: " + responseString, MODULE); userInfo = JSON.from(responseString); } else { String errMsg = UtilProperties.getMessage(resource, "GetOAuth2AccessTokenError", UtilMisc.toMap("error", responseString), locale); diff --git a/passport/src/main/java/org/apache/ofbiz/passport/user/LinkedInAuthenticator.java b/passport/src/main/java/org/apache/ofbiz/passport/user/LinkedInAuthenticator.java index ad0e566..65e1e78 100644 --- a/passport/src/main/java/org/apache/ofbiz/passport/user/LinkedInAuthenticator.java +++ b/passport/src/main/java/org/apache/ofbiz/passport/user/LinkedInAuthenticator.java @@ -63,7 +63,7 @@ import org.xml.sax.SAXException; */ public class LinkedInAuthenticator implements Authenticator { - private static final String module = LinkedInAuthenticator.class.getName(); + private static final String MODULE = LinkedInAuthenticator.class.getName(); public static final String props = "linkedInAuth.properties"; @@ -130,7 +130,7 @@ public class LinkedInAuthenticator implements Authenticator { } } - Debug.logInfo("LinkedIn auth called; returned user info: " + user, module); + Debug.logInfo("LinkedIn auth called; returned user info: " + user, MODULE); return user != null; } @@ -178,7 +178,7 @@ public class LinkedInAuthenticator implements Authenticator { try { parentTx = TransactionUtil.suspend(); } catch (GenericTransactionException e) { - Debug.logError(e, "Could not suspend transaction: " + e.getMessage(), module); + Debug.logError(e, "Could not suspend transaction: " + e.getMessage(), MODULE); } try { @@ -193,12 +193,12 @@ public class LinkedInAuthenticator implements Authenticator { } } catch (GenericTransactionException e) { - Debug.logError(e, "Could not suspend transaction: " + e.getMessage(), module); + Debug.logError(e, "Could not suspend transaction: " + e.getMessage(), MODULE); } finally { try { TransactionUtil.commit(beganTransaction); } catch (GenericTransactionException e) { - Debug.logError(e, "Could not commit nested transaction: " + e.getMessage(), module); + Debug.logError(e, "Could not commit nested transaction: " + e.getMessage(), MODULE); } } } finally { @@ -206,9 +206,9 @@ public class LinkedInAuthenticator implements Authenticator { if (parentTx != null) { try { TransactionUtil.resume(parentTx); - if (Debug.verboseOn()) Debug.logVerbose("Resumed the parent transaction.", module); + if (Debug.verboseOn()) Debug.logVerbose("Resumed the parent transaction.", MODULE); } catch (GenericTransactionException e) { - Debug.logError(e, "Could not resume parent nested transaction: " + e.getMessage(), module); + Debug.logError(e, "Could not resume parent nested transaction: " + e.getMessage(), MODULE); } } } @@ -292,7 +292,7 @@ public class LinkedInAuthenticator implements Authenticator { try { delegator.create(partyRole); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); throw new AuthenticatorException(e.getMessage(), e); } @@ -322,7 +322,7 @@ public class LinkedInAuthenticator implements Authenticator { try { secGroup = EntityQuery.use(delegator).from("SecurityGroup").where("groupId", securityGroup).cache().queryOne(); } catch (GenericEntityException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); } // add it to the user if it exists @@ -362,7 +362,7 @@ public class LinkedInAuthenticator implements Authenticator { */ @Override public void updatePassword(String username, String password, String newPassword) throws AuthenticatorException { - Debug.logInfo("Calling LinkedIn:updatePassword() - ignored!!!", module); + Debug.logInfo("Calling LinkedIn:updatePassword() - ignored!!!", MODULE); } /** @@ -412,7 +412,7 @@ public class LinkedInAuthenticator implements Authenticator { CloseableHttpResponse getResponse = jsonClient.execute(httpGet); String responseString = new BasicResponseHandler().handleResponse(getResponse); if (getResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { - // Debug.logInfo("Json Response from LinkedIn: " + responseString, module); + // Debug.logInfo("Json Response from LinkedIn: " + responseString, MODULE); userInfo = UtilXml.readXmlDocument(responseString); } else { String errMsg = UtilProperties.getMessage(resource, "GetOAuth2AccessTokenError", UtilMisc.toMap("error", responseString), locale); @@ -433,7 +433,7 @@ public class LinkedInAuthenticator implements Authenticator { if (UtilValidate.isNotEmpty(urlContent)) { String id = urlContent.substring(urlContent.indexOf("?id=")); id = id.substring(0, id.indexOf("&")); - Debug.logInfo("LinkedIn user id: " + id, module); + Debug.logInfo("LinkedIn user id: " + id, MODULE); return id; } } @@ -454,7 +454,7 @@ public class LinkedInAuthenticator implements Authenticator { if (UtilValidate.isNotEmpty(urlContent)) { String id = urlContent.substring(urlContent.indexOf("?id=")); id = id.substring(0, id.indexOf("&")); - Debug.logInfo("LinkedIn user id: " + id, module); + Debug.logInfo("LinkedIn user id: " + id, MODULE); results.put("userId", id); } } diff --git a/passport/src/main/java/org/apache/ofbiz/passport/util/PassportUtil.java b/passport/src/main/java/org/apache/ofbiz/passport/util/PassportUtil.java index 309b7a6..e709309 100644 --- a/passport/src/main/java/org/apache/ofbiz/passport/util/PassportUtil.java +++ b/passport/src/main/java/org/apache/ofbiz/passport/util/PassportUtil.java @@ -28,7 +28,7 @@ import org.apache.ofbiz.base.util.Debug; public class PassportUtil { - public static final String module = PassportUtil.class.getName(); + public static final String MODULE = PassportUtil.class.getName(); public static final String ClientIdLabel = "ClientId"; @@ -113,7 +113,7 @@ public class PassportUtil { } prefix = "live"; } catch (UnknownHostException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } return prefix; } diff --git a/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java b/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java index 34c1cb3..5f080e4 100644 --- a/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java +++ b/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractHtmlReport.java @@ -30,7 +30,7 @@ import org.apache.ofbiz.htmlreport.util.ReportStringUtil; */ public abstract class AbstractHtmlReport extends HtmlReport { - public static final String module = AbstractHtmlReport.class.getName(); + public static final String MODULE = AbstractHtmlReport.class.getName(); public final static String THREAD_TYPE = "thread_type"; diff --git a/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java b/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java index 5dabca1..af789c2 100644 --- a/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java +++ b/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java @@ -50,7 +50,7 @@ import org.apache.ofbiz.htmlreport.util.ReportStringUtil; */ public class HtmlReport extends AbstractReport { - public static final String module = HtmlReport.class.getName(); + public static final String MODULE = HtmlReport.class.getName(); /** The delimiter that is used in the resource list request parameter. */ public static final String DELIMITER_RESOURCES = "|"; @@ -288,7 +288,7 @@ public class HtmlReport extends AbstractReport { logFileOutputStream.write((logResult.toString() + "\n").getBytes()); logFileOutputStream.flush(); } catch (IOException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } } return result.toString(); @@ -886,7 +886,7 @@ public class HtmlReport extends AbstractReport { for (int i = 0; i < length; i++) { Method method = methods[i]; if (method.getName().startsWith("getParam") && (method.getParameterTypes().length == 0)) { - // Debug.logInfo("getMethod: " + method.getName(), module); + // Debug.logInfo("getMethod: " + method.getName(), MODULE); list.add(method); } } @@ -1333,7 +1333,7 @@ public class HtmlReport extends AbstractReport { logFileOutputStream.close(); } catch (IOException e) { // do nothing - Debug.logError(e, HtmlReport.module); + Debug.logError(e, HtmlReport.MODULE); } } } diff --git a/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java b/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java index 012e93d..2951f0b 100644 --- a/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java +++ b/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java @@ -79,7 +79,7 @@ import org.apache.ofbiz.service.ServiceUtil; */ public abstract class AbstractPricatParser implements InterfacePricatParser { - public static final String module = AbstractPricatParser.class.getName(); + public static final String MODULE = AbstractPricatParser.class.getName(); protected LocalDispatcher dispatcher; @@ -268,23 +268,23 @@ public abstract class AbstractPricatParser implements InterfacePricatParser { workbook.close(); } catch (FileNotFoundException e) { report.println(e); - Debug.logError(e, module); + Debug.logError(e, MODULE); } catch (IOException e) { report.println(e); - Debug.logError(e, module); + Debug.logError(e, MODULE); } finally { if (fos != null) { try { fos.close(); } catch (IOException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } if (workbook != null) { try { workbook.close(); } catch (IOException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } } @@ -606,7 +606,7 @@ public abstract class AbstractPricatParser implements InterfacePricatParser { public static boolean isCommentedExcelExists(HttpServletRequest request, Long sequenceNum) { GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); if (UtilValidate.isEmpty(sequenceNum) || UtilValidate.isEmpty(userLogin)) { - Debug.logError("sequenceNum[" + sequenceNum + "] or userLogin is empty", module); + Debug.logError("sequenceNum[" + sequenceNum + "] or userLogin is empty", MODULE); return false; } String userLoginId = userLogin.getString("userLoginId"); @@ -615,14 +615,14 @@ public abstract class AbstractPricatParser implements InterfacePricatParser { try { historyValue = EntityQuery.use(delegator).from("ExcelImportHistory").where("userLoginId", userLoginId, "sequenceNum", Long.valueOf(sequenceNum)).queryOne(); } catch (NumberFormatException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return false; } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return false; } if (UtilValidate.isEmpty(historyValue)) { - Debug.logError("No ExcelImportHistory value found by sequenceNum[" + sequenceNum + "] and userLoginId[" + userLoginId + "].", module); + Debug.logError("No ExcelImportHistory value found by sequenceNum[" + sequenceNum + "] and userLoginId[" + userLoginId + "].", MODULE); return false; } File file = FileUtil.getFile(tempFilesFolder + userLoginId + "/" + sequenceNum + ".xlsx"); @@ -648,7 +648,7 @@ public abstract class AbstractPricatParser implements InterfacePricatParser { try { excelFile.delete(); } catch (SecurityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); report.print(e.getMessage(), InterfaceReport.FORMAT_ERROR); } } @@ -657,7 +657,7 @@ public abstract class AbstractPricatParser implements InterfacePricatParser { try { logFile.delete(); } catch (SecurityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); report.print(e.getMessage(), InterfaceReport.FORMAT_ERROR); } } @@ -667,7 +667,7 @@ public abstract class AbstractPricatParser implements InterfacePricatParser { } report.println(); } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } } } diff --git a/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java b/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java index e7dc093..2ccf36e 100644 --- a/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java +++ b/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java @@ -43,7 +43,7 @@ import org.apache.ofbiz.entity.util.EntityQuery; public class PricatEvents { - public static final String module = PricatEvents.class.getName(); + public static final String MODULE = PricatEvents.class.getName(); public static final String PricatLatestVersion = UtilProperties.getPropertyValue("pricat", "pricat.latest.version", "V1.1"); @@ -75,10 +75,10 @@ public class PricatEvents { byte[] bytes = Files.readAllBytes(file); UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(fileName, "UTF-8")); } catch (MalformedURLException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } catch (IOException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } return "success"; @@ -117,10 +117,10 @@ public class PricatEvents { path = Paths.get(originalPricatFileName); UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(path.getName(path.getNameCount() - 1).toString(), "UTF-8")); } catch (MalformedURLException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } catch (IOException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } request.getSession().removeAttribute(PricatParseExcelHtmlThread.PRICAT_FILE); @@ -142,7 +142,7 @@ public class PricatEvents { String sequenceNum = request.getParameter("sequenceNum"); GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); if (UtilValidate.isEmpty(sequenceNum) || UtilValidate.isEmpty(userLogin)) { - Debug.logError("sequenceNum[" + sequenceNum + "] or userLogin is empty", module); + Debug.logError("sequenceNum[" + sequenceNum + "] or userLogin is empty", MODULE); return "error"; } String userLoginId = userLogin.getString("userLoginId"); @@ -151,14 +151,14 @@ public class PricatEvents { try { historyValue = EntityQuery.use(delegator).from("ExcelImportHistory").where("userLoginId", userLoginId, "sequenceNum", Long.valueOf(sequenceNum)).queryOne(); } catch (NumberFormatException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } if (UtilValidate.isEmpty(historyValue)) { - Debug.logError("No ExcelImportHistory value found by sequenceNum[" + sequenceNum + "] and userLoginId[" + userLoginId + "].", module); + Debug.logError("No ExcelImportHistory value found by sequenceNum[" + sequenceNum + "] and userLoginId[" + userLoginId + "].", MODULE); return "error"; } String fileName = historyValue.getString("fileName"); @@ -173,10 +173,10 @@ public class PricatEvents { UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(fileName, "UTF-8")); } } catch (MalformedURLException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } catch (IOException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } return "success"; diff --git a/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java b/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java index 2a4a69f..d6c6dc1 100644 --- a/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java +++ b/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java @@ -66,7 +66,7 @@ import org.apache.ofbiz.service.LocalDispatcher; */ public class PricatParseExcelHtmlThread extends AbstractReportThread { - public static final String module = PricatParseExcelHtmlThread.class.getName(); + public static final String MODULE = PricatParseExcelHtmlThread.class.getName(); public static final String PARSE_EXCEL = "parse_excel"; @@ -192,12 +192,12 @@ public class PricatParseExcelHtmlThread extends AbstractReportThread { } } else { getReport().println(getName(), InterfaceReport.FORMAT_ERROR); - Debug.logError(getName(), module); + Debug.logError(getName(), MODULE); thruReasonId = "EXCEL_IMPORT_ERROR"; } } catch (Exception e) { getReport().println(e); - Debug.logError(e, module); + Debug.logError(e, MODULE); thruReasonId = "EXCEL_IMPORT_ERROR"; } finally { // wait 5 seconds to wait page output @@ -323,7 +323,7 @@ public class PricatParseExcelHtmlThread extends AbstractReportThread { } } }catch (GenericEntityException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } return facilities; } @@ -348,7 +348,7 @@ public class PricatParseExcelHtmlThread extends AbstractReportThread { "fromDate", UtilDateTime.nowTimestamp(), "threadName", getName(), "logFileName", InterfacePricatParser.tempFilesFolder + userLoginId + "/" + latestId + ".log")); newHistoryValue.create(); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return -1; } return latestId; diff --git a/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatEvents.java b/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatEvents.java index 0745c34..8b97037 100644 --- a/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatEvents.java +++ b/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatEvents.java @@ -37,7 +37,7 @@ import org.apache.ofbiz.pricat.PricatEvents; public class SamplePricatEvents extends PricatEvents { - public static final String module = SamplePricatEvents.class.getName(); + public static final String MODULE = SamplePricatEvents.class.getName(); public static final String PricatLatestVersion = UtilProperties.getPropertyValue("pricat", "pricat.latest.version", "V1.1"); @@ -70,10 +70,10 @@ public class SamplePricatEvents extends PricatEvents { byte[] bytes = Files.readAllBytes(file); UtilHttp.streamContentToBrowser(response, bytes, "application/octet-stream", URLEncoder.encode(fileName, "UTF-8")); } catch (MalformedURLException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } catch (IOException e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); return "error"; } return "success"; diff --git a/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java b/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java index ab45b26..43b2df3 100644 --- a/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java +++ b/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java @@ -56,7 +56,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; */ public class SamplePricatParser extends AbstractPricatParser { - public static final String module = SamplePricatParser.class.getName(); + public static final String MODULE = SamplePricatParser.class.getName(); public static final Map<String, List<Object[]>> ColNamesList = UtilMisc.toMap("V1.1", genExcelHeaderNames("V1.1")); @@ -131,7 +131,7 @@ public class SamplePricatParser extends AbstractPricatParser { cleanupLogAndCommentedExcel(); } catch (IOException e) { report.println(e); - Debug.logError(e, module); + Debug.logError(e, MODULE); } finally { if (UtilValidate.isNotEmpty(fileItems)) { // remove tmp files @@ -145,7 +145,7 @@ public class SamplePricatParser extends AbstractPricatParser { try { workbook.close(); } catch (IOException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } } diff --git a/pricat/src/main/java/org/apache/ofbiz/pricat/util/OFBizPricatUtil.java b/pricat/src/main/java/org/apache/ofbiz/pricat/util/OFBizPricatUtil.java index 0db155c..9260193 100644 --- a/pricat/src/main/java/org/apache/ofbiz/pricat/util/OFBizPricatUtil.java +++ b/pricat/src/main/java/org/apache/ofbiz/pricat/util/OFBizPricatUtil.java @@ -30,7 +30,7 @@ import com.microsoft.schemas.vml.CTShape; public final class OFBizPricatUtil { - public static final String module = OFBizPricatUtil.class.getName(); + public static final String MODULE = OFBizPricatUtil.class.getName(); protected static Method VMLDrawingMethod; @@ -66,7 +66,7 @@ public final class OFBizPricatUtil { CTShape ctshape = (CTShape) FindCommentShapeMethod.invoke(vml, cell.getRow(), cell.getCol()); ctshape.setType("#_x0000_t202"); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } } @@ -81,7 +81,7 @@ public final class OFBizPricatUtil { CTShape ctshape = (CTShape) FindCommentShapeMethod.invoke(vml, rowNum, colNum); ctshape.setType("#_x0000_t202"); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } } diff --git a/projectmgr/src/main/java/org/apache/ofbiz/project/Various.java b/projectmgr/src/main/java/org/apache/ofbiz/project/Various.java index d370cdd..7a02c94 100644 --- a/projectmgr/src/main/java/org/apache/ofbiz/project/Various.java +++ b/projectmgr/src/main/java/org/apache/ofbiz/project/Various.java @@ -31,7 +31,7 @@ import org.apache.ofbiz.entity.util.EntityQuery; public class Various { - public static final String module = Various.class.getName(); + public static final String MODULE = Various.class.getName(); public static void setDatesFollowingTasks(GenericValue task) { @@ -51,7 +51,7 @@ public class Various { } } catch (GenericEntityException e) { - Debug.logError("Could not updte task: " + e.getMessage(), module); + Debug.logError("Could not updte task: " + e.getMessage(), MODULE); } } @@ -70,7 +70,7 @@ public class Various { } } catch (GenericEntityException e) { - Debug.logError("Could not updte task: " + e.getMessage(), module); + Debug.logError("Could not updte task: " + e.getMessage(), MODULE); } if (plannedHours == 0.00) { plannedHours = Double.valueOf("24.00"); // default length of task is 3 days. diff --git a/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumEvents.java b/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumEvents.java index 4b70776..3e3f25f 100644 --- a/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumEvents.java +++ b/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumEvents.java @@ -50,7 +50,7 @@ import org.apache.ofbiz.entity.util.EntityQuery; */ public class ScrumEvents { - public static final String module = ScrumEvents.class.getName(); + public static final String MODULE = ScrumEvents.class.getName(); public static String timeSheetChecker(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); @@ -99,7 +99,7 @@ public class ScrumEvents { } } catch (GenericEntityException EntEx) { EntEx.printStackTrace(); - Debug.logError(EntEx.getMessage(), module); + Debug.logError(EntEx.getMessage(), MODULE); } if (UtilValidate.isNotEmpty(noTimeEntryList)) { StringBuilder warningDataBuffer = new StringBuilder(); @@ -113,7 +113,7 @@ public class ScrumEvents { warningDataBuffer.append(dataMap.get("timesheetId")); } String warningData = warningDataBuffer.toString(); - Debug.logInfo("The following time sheet no time entry: [" + warningData + "]", module); + Debug.logInfo("The following time sheet no time entry: [" + warningData + "]", MODULE); request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("scrumUiLabels", "ScrumTimesheetWarningMessage", UtilMisc.toMap("warningMessage", warningData), UtilHttp.getLocale(request))); } return "success"; diff --git a/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java b/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java index 0c2a735..3a1c2b2 100644 --- a/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java +++ b/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java @@ -48,14 +48,14 @@ import org.apache.ofbiz.service.ServiceUtil; */ public class ScrumServices { - public static final String module = ScrumServices.class.getName(); + public static final String MODULE = ScrumServices.class.getName(); public static final String resource = "scrumUiLabels"; public static Map<String, Object> linkToProduct(DispatchContext ctx, Map<String, ? extends Object> context) { Delegator delegator = ctx.getDelegator(); Locale locale = (Locale)context.get("locale"); LocalDispatcher dispatcher = ctx.getDispatcher(); String communicationEventId = (String) context.get("communicationEventId"); - // Debug.logInfo("==== Processing Commevent: " + communicationEventId, module); + // Debug.logInfo("==== Processing Commevent: " + communicationEventId, MODULE); if (UtilValidate.isNotEmpty(communicationEventId)) { try { @@ -71,7 +71,7 @@ public class ScrumServices { nonDigitLocation++; } String productId = subject.substring(pdLocation + 3, nonDigitLocation); - // Debug.logInfo("=======================Product id found in subject: >>" + custRequestId + "<<", module); + // Debug.logInfo("=======================Product id found in subject: >>" + custRequestId + "<<", MODULE); GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne(); if (product != null) { GenericValue communicationEventProductMap = EntityQuery.use(delegator).from("CommunicationEventProduct").where("productId", productId, "communicationEventId", communicationEventId).queryOne(); @@ -90,11 +90,11 @@ public class ScrumServices { } } } catch (GenericServiceException e1) { - Debug.logError(e1, "Error calling updating commevent status", module); + Debug.logError(e1, "Error calling updating commevent status", MODULE); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ScrumErrorCallingUpdatingCommeventStatus", locale) + e1.toString()); } } else { - Debug.logInfo("Product id " + productId + " found in subject but not in database", module); + Debug.logInfo("Product id " + productId + " found in subject but not in database", MODULE); } } } @@ -206,7 +206,7 @@ public class ScrumServices { } } String revisionLink = repositoryRoot.substring(repositoryRoot.lastIndexOf("svn/") + 4, repositoryRoot.length()) + "&revision=" + i; - Debug.logInfo("Revision Link ============== >>>>>>>>>>> "+ revisionLink, module); + Debug.logInfo("Revision Link ============== >>>>>>>>>>> "+ revisionLink, MODULE); if (UtilValidate.isNotEmpty(taskId)) { String version = "R" + i; List <GenericValue> workeffContentList = EntityQuery.use(delegator).from("WorkEffortAndContentDataResource").where("contentName",version.trim() ,"drObjectInfo", revisionLink.trim()).queryList(); @@ -229,7 +229,7 @@ public class ScrumServices { inputMap.put("revisionLink", revisionLink); inputMap.put("revisionDescription", taskInfo); inputMap.put("userLogin", userLogin); - Debug.logInfo("inputMap ============== >>>>>>>>>>> "+ inputMap, module); + Debug.logInfo("inputMap ============== >>>>>>>>>>> "+ inputMap, MODULE); result = dispatcher.runSync("updateScrumRevision", inputMap); if (ServiceUtil.isError(result)) { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result)); @@ -275,7 +275,7 @@ public class ScrumServices { exprsAnd.add(EntityCondition.makeCondition("drObjectInfo", EntityOperator.LIKE, revisionLink + "%")); List<GenericValue> workEffortDataResourceList = EntityQuery.use(delegator).from("WorkEffortAndContentDataResource").where(exprsAnd).queryList(); if (UtilValidate.isNotEmpty(workEffortDataResourceList)) { - Debug.logInfo("Total Content Size ============== >>>>>>>>>>> "+ workEffortDataResourceList.size(), module); + Debug.logInfo("Total Content Size ============== >>>>>>>>>>> "+ workEffortDataResourceList.size(), MODULE); Set<String> keys = new HashSet<>(); Set<GenericValue> exclusions = new HashSet<>(); for (GenericValue workEffort : workEffortDataResourceList) { @@ -287,10 +287,10 @@ public class ScrumServices { } } // remove the duplicate entry - Debug.logInfo("Remove size ============== >>>>>>>>>>> "+ exclusions.size(), module); + Debug.logInfo("Remove size ============== >>>>>>>>>>> "+ exclusions.size(), MODULE); if (UtilValidate.isNotEmpty(exclusions)) { for (GenericValue contentResourceMap : exclusions) { - Debug.logInfo("Remove contentId ============== >>>>>>>>>>> "+ contentResourceMap.getString("contentId"), module); + Debug.logInfo("Remove contentId ============== >>>>>>>>>>> "+ contentResourceMap.getString("contentId"), MODULE); GenericValue dataResourceMap = EntityQuery.use(delegator).from("DataResource").where("dataResourceId", contentResourceMap.getString("dataResourceId")).queryOne(); GenericValue contentMap = EntityQuery.use(delegator).from("Content").where("contentId", contentResourceMap.getString("contentId")).queryOne(); contentMap.removeRelated("WorkEffortContent"); diff --git a/solr/src/main/java/org/apache/ofbiz/solr/CategoryUtil.java b/solr/src/main/java/org/apache/ofbiz/solr/CategoryUtil.java index 655e4a0..063058a 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/CategoryUtil.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/CategoryUtil.java @@ -39,7 +39,7 @@ import org.apache.ofbiz.service.DispatchContext; */ public final class CategoryUtil { - public static final String module = CategoryUtil.class.getName(); + public static final String MODULE = CategoryUtil.class.getName(); private CategoryUtil () {} @@ -56,7 +56,7 @@ public final class CategoryUtil { // catalogs = delegator.findList("ProdCatalog", null, null, UtilMisc.toList("catalogName"), null, false); catalogs = delegator.findList("ProdCatalogCategory", condition, null, null, null, false); } catch (GenericEntityException e) { - Debug.logError(e, "Error looking up all catalogs", module); + Debug.logError(e, "Error looking up all catalogs", MODULE); } if (catalogs != null) { for (GenericValue c : catalogs) { @@ -103,7 +103,7 @@ public final class CategoryUtil { } } catch (GenericEntityException e) { - Debug.logError(e, "Cannot generate trail from product category", module); + Debug.logError(e, "Cannot generate trail from product category", MODULE); } } if (trailElements.size() == 0) { @@ -146,7 +146,7 @@ public final class CategoryUtil { } else { cm = catMember.toString(); } - //Debug.logInfo("catMember "+cm,module); + //Debug.logInfo("catMember "+cm,MODULE); return cm; } diff --git a/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java b/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java index df36678..def595b 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java @@ -45,7 +45,7 @@ import org.apache.ofbiz.service.ServiceUtil; * Product utility class for solr. */ public final class ProductUtil { - public static final String module = ProductUtil.class.getName(); + public static final String MODULE = ProductUtil.class.getName(); private ProductUtil () {} @@ -58,7 +58,7 @@ public final class ProductUtil { Locale locale = new Locale("de_DE"); if (Debug.verboseOn()) { - Debug.logVerbose("Solr: Getting product content for productId '" + productId + "'", module); + Debug.logVerbose("Solr: Getting product content for productId '" + productId + "'", MODULE); } try { @@ -105,7 +105,7 @@ public final class ProductUtil { catMember.append(trailString); String cm = i +"/"+ catMember.toString(); if (!trails.contains(cm)) { - //Debug.logInfo("cm : "+cm, module); + //Debug.logInfo("cm : "+cm, MODULE); trails.add(cm); // Debug.log("trail for product " + productId + " ====> " + catMember.toString()); } @@ -231,9 +231,9 @@ public final class ProductUtil { } } } catch (GenericEntityException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); } catch (Exception e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); } return dispatchContext; } diff --git a/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java b/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java index 47782fb..5128634 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java @@ -62,7 +62,7 @@ import org.apache.ofbiz.service.ServiceValidationException; */ public abstract class SolrProductSearch { - public static final String module = SolrProductSearch.class.getName(); + public static final String MODULE = SolrProductSearch.class.getName(); public static final String resource = "SolrUiLabels"; /** @@ -78,7 +78,7 @@ public abstract class SolrProductSearch { String solrIndexName = (String) context.get("indexName"); if (SolrUtil.isSolrEcaEnabled()) { - // Debug.logVerbose("Solr: addToSolr: Running indexing for productId '" + productId + "'", module); + // Debug.logVerbose("Solr: addToSolr: Running indexing for productId '" + productId + "'", MODULE); try { GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne(); Map<String, Object> dispatchContext = ProductUtil.getProductContent(product, dctx, context); @@ -98,20 +98,20 @@ public abstract class SolrProductSearch { } } catch (GenericEntityException gee) { - Debug.logError(gee, gee.getMessage(), module); + Debug.logError(gee, gee.getMessage(), MODULE); result = ServiceUtil.returnError(gee.toString()); } catch (GenericServiceException gse) { - Debug.logError(gse, gse.getMessage(), module); + Debug.logError(gse, gse.getMessage(), MODULE); result = ServiceUtil.returnError(gse.toString()); } catch (Exception e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } } else { final String statusMsg = "Solr ECA indexing disabled; skipping indexing for productId '" + productId + "'"; - if (Debug.verboseOn()) Debug.logVerbose("Solr: addToSolr: " + statusMsg, module); + if (Debug.verboseOn()) Debug.logVerbose("Solr: addToSolr: " + statusMsg, MODULE); result = ServiceUtil.returnSuccess(); } return result; @@ -130,7 +130,7 @@ public abstract class SolrProductSearch { // don't want to return error and abort transactions in these cases. Boolean treatConnectErrorNonFatal = (Boolean) context.get("treatConnectErrorNonFatal"); try { - Debug.logInfo("Solr: Generating and indexing document for productId '" + productId + "'", module); + Debug.logInfo("Solr: Generating and indexing document for productId '" + productId + "'", MODULE); SolrUtil.getInstance(); client = SolrUtil.getHttpSolrClient(solrIndexName); @@ -140,7 +140,7 @@ public abstract class SolrProductSearch { Collection<SolrInputDocument> docs = new ArrayList<>(); if (Debug.verboseOn()) { - Debug.logVerbose("Solr: Indexing document: " + doc1.toString(), module); + Debug.logVerbose("Solr: Indexing document: " + doc1.toString(), MODULE); } docs.add(doc1); @@ -150,11 +150,11 @@ public abstract class SolrProductSearch { client.commit(); final String statusStr = UtilProperties.getMessage(resource, "SolrDocumentForProductIdAddedToSolrIndex", UtilMisc.toMap("productId", context.get("productId")), locale); - Debug.logInfo("Solr: " + statusStr, module); + Debug.logInfo("Solr: " + statusStr, MODULE); result = ServiceUtil.returnSuccess(statusStr); } catch (MalformedURLException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); result.put("errorType", "urlError"); } @@ -163,21 +163,21 @@ public abstract class SolrProductSearch { final String statusStr = UtilProperties.getMessage(resource, "SolrFailureConnectingToSolrServerToCommitProductId", UtilMisc.toMap("productId", context.get("productId")), locale); if (Boolean.TRUE.equals(treatConnectErrorNonFatal)) { - Debug.logWarning(e, "Solr: " + statusStr, module); + Debug.logWarning(e, "Solr: " + statusStr, MODULE); result = ServiceUtil.returnFailure(statusStr); } else { - Debug.logError(e, "Solr: " + statusStr, module); + Debug.logError(e, "Solr: " + statusStr, MODULE); result = ServiceUtil.returnError(statusStr); } result.put("errorType", "connectError"); } else { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); result.put("errorType", "solrServerError"); } } catch (IOException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); result.put("errorType", "ioError"); } @@ -211,12 +211,12 @@ public abstract class SolrProductSearch { // Construct Documents List<Map<String, Object>> fieldList = UtilGenerics.cast(context.get("fieldList")); - Debug.logInfo("Solr: Generating and adding " + fieldList.size() + " documents to solr index", module); + Debug.logInfo("Solr: Generating and adding " + fieldList.size() + " documents to solr index", MODULE); for (Iterator<Map<String, Object>> fieldListIterator = fieldList.iterator(); fieldListIterator.hasNext();) { SolrInputDocument doc1 = SolrUtil.generateSolrDocument(fieldListIterator.next()); if (Debug.verboseOn()) { - Debug.logVerbose("Solr: Indexing document: " + doc1.toString(), module); + Debug.logVerbose("Solr: Indexing document: " + doc1.toString(), MODULE); } docs.add(doc1); } @@ -227,11 +227,11 @@ public abstract class SolrProductSearch { client.commit(); final String statusStr = UtilProperties.getMessage(resource, "SolrAddedDocumentsToSolrIndex", UtilMisc.toMap("fieldList", fieldList.size()), locale); - Debug.logInfo("Solr: " + statusStr, module); + Debug.logInfo("Solr: " + statusStr, MODULE); result = ServiceUtil.returnSuccess(statusStr); } catch (MalformedURLException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); result.put("errorType", "urlError"); } @@ -240,21 +240,21 @@ public abstract class SolrProductSearch { final String statusStr = UtilProperties.getMessage(resource, "SolrFailureConnectingToSolrServerToCommitProductList", UtilMisc.toMap("productId", context.get("productId")), locale); if (Boolean.TRUE.equals(treatConnectErrorNonFatal)) { - Debug.logWarning(e, "Solr: " + statusStr, module); + Debug.logWarning(e, "Solr: " + statusStr, MODULE); result = ServiceUtil.returnFailure(statusStr); } else { - Debug.logError(e, "Solr: " + statusStr, module); + Debug.logError(e, "Solr: " + statusStr, MODULE); result = ServiceUtil.returnError(statusStr); } result.put("errorType", "connectError"); } else { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); result.put("errorType", "solrServerError"); } } catch (IOException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); result.put("errorType", "ioError"); } @@ -367,7 +367,7 @@ public abstract class SolrProductSearch { result.put("queryResult", rsp); } catch (Exception e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } finally { @@ -428,7 +428,7 @@ public abstract class SolrProductSearch { } } catch (Exception e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } return result; @@ -471,7 +471,7 @@ public abstract class SolrProductSearch { Iterator<Suggestion> iter = queryResult.getSpellCheckResponse().getSuggestions().iterator(); while (iter.hasNext()) { Suggestion resultDoc = iter.next(); - Debug.logInfo("Suggestion " + resultDoc.getAlternatives(), module); + Debug.logInfo("Suggestion " + resultDoc.getAlternatives(), MODULE); suggestions.add(resultDoc.getAlternatives()); } } @@ -514,7 +514,7 @@ public abstract class SolrProductSearch { } catch (Exception e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } return result; @@ -543,7 +543,7 @@ public abstract class SolrProductSearch { String productCategoryId = (String) context.get("productCategoryId") != null ? CategoryUtil.getCategoryNameWithTrail((String) context.get("productCategoryId"), dctx) : null; - Debug.logInfo("productCategoryId " + productCategoryId, module); + Debug.logInfo("productCategoryId " + productCategoryId, MODULE); Map<String, Object> query = SolrUtil.categoriesAvailable(catalogId, productCategoryId, (String) context.get("productId"), displayProducts, viewIndex, viewSize, solrIndexName); @@ -556,7 +556,7 @@ public abstract class SolrProductSearch { FacetField field = catIterator.next(); List<Count> catL = field.getValues(); if (catL != null) { - // Debug.logInfo("FacetFields = " + catL, module); + // Debug.logInfo("FacetFields = " + catL, MODULE); for (Iterator<Count> catIter = catL.iterator(); catIter.hasNext();) { FacetField.Count f = catIter.next(); if (f.getCount() > 0) { @@ -565,7 +565,7 @@ public abstract class SolrProductSearch { } result.put("categories", categories); result.put("numFound", cat.getResults().getNumFound()); - // Debug.logInfo("The returned map is this:" + result, module); + // Debug.logInfo("The returned map is this:" + result, MODULE); } } } @@ -591,7 +591,7 @@ public abstract class SolrProductSearch { : null; result = ServiceUtil.returnSuccess(); Map<String, List<Map<String, Object>>> catLevel = new HashMap<>(); - Debug.logInfo("productCategoryId: " + productCategoryId, module); + Debug.logInfo("productCategoryId: " + productCategoryId, MODULE); //Add toplevel categories String[] trailElements = productCategoryId.split("/"); @@ -600,7 +600,7 @@ public abstract class SolrProductSearch { for (String elements : trailElements) { //catIds must be greater than 3 chars if (elements.length() > 3) { - Debug.logInfo("elements: " + elements, module); + Debug.logInfo("elements: " + elements, MODULE); String categoryPath = CategoryUtil.getCategoryNameWithTrail(elements, dctx); String[] categoryPathArray = categoryPath.split("/"); int level = Integer.parseInt(categoryPathArray[0]); @@ -676,7 +676,7 @@ public abstract class SolrProductSearch { numDocs = products.size(); } - Debug.logInfo("Solr: Clearing solr index and rebuilding with " + numDocs + " found products", module); + Debug.logInfo("Solr: Clearing solr index and rebuilding with " + numDocs + " found products", MODULE); Iterator<GenericValue> productIterator = products.iterator(); while (productIterator.hasNext()) { @@ -709,42 +709,42 @@ public abstract class SolrProductSearch { } } catch (MalformedURLException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } catch (SolrServerException e) { if (e.getCause() != null && e.getCause() instanceof ConnectException) { final String statusStr = UtilProperties.getMessage(resource, "SolrFailureConnectingToSolrServerToRebuildIndex", locale); if (Boolean.TRUE.equals(treatConnectErrorNonFatal)) { - Debug.logWarning(e, "Solr: " + statusStr, module); + Debug.logWarning(e, "Solr: " + statusStr, MODULE); result = ServiceUtil.returnFailure(statusStr); } else { - Debug.logError(e, "Solr: " + statusStr, module); + Debug.logError(e, "Solr: " + statusStr, MODULE); result = ServiceUtil.returnError(statusStr); } } else { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } } catch (IOException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } catch (ServiceAuthException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } catch (ServiceValidationException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } catch (GenericServiceException e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } catch (Exception e) { - Debug.logError(e, e.getMessage(), module); + Debug.logError(e, e.getMessage(), MODULE); result = ServiceUtil.returnError(e.toString()); } finally { diff --git a/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java b/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java index 106a451..3e05b70 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java @@ -53,7 +53,7 @@ import org.apache.ofbiz.entity.GenericEntityException; public final class SolrUtil { private SolrUtil() {} - public static final String module = SolrUtil.class.getName(); + public static final String MODULE = SolrUtil.class.getName(); private static final String[] solrProdAttribute = { "productId", "internalName", "manu", "size", "smallImage", "mediumImage", "largeImage", "listPrice", "defaultPrice", "inStock", "isVirtual" }; private static final String solrConfigName = "solrconfig.properties"; @@ -276,12 +276,12 @@ public final class SolrUtil { solrQuery.setFacet(true); solrQuery.addFacetField("cat"); solrQuery.setFacetLimit(-1); - if (Debug.verboseOn()) Debug.logVerbose("solr: solrQuery: " + solrQuery, module); + if (Debug.verboseOn()) Debug.logVerbose("solr: solrQuery: " + solrQuery, MODULE); returnMap = client.query(solrQuery, METHOD.POST); result.put("rows", returnMap); result.put("numFound", returnMap.getResults().getNumFound()); } catch (Exception e) { - Debug.logError(e.getMessage(), module); + Debug.logError(e.getMessage(), MODULE); } return result; } diff --git a/solr/src/main/java/org/apache/ofbiz/solr/control/OFBizSolrLoginWorker.java b/solr/src/main/java/org/apache/ofbiz/solr/control/OFBizSolrLoginWorker.java index 5e85efa..1dd08fd 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/control/OFBizSolrLoginWorker.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/control/OFBizSolrLoginWorker.java @@ -29,7 +29,7 @@ import org.apache.ofbiz.webapp.control.LoginWorker; */ public class OFBizSolrLoginWorker extends LoginWorker { - public final static String module = OFBizSolrLoginWorker.class.getName(); + public final static String MODULE = OFBizSolrLoginWorker.class.getName(); /** * An HTTP WebEvent handler that logs in a userLogin. This should run before the security check. @@ -48,7 +48,7 @@ public class OFBizSolrLoginWorker extends LoginWorker { response.setHeader("Location", request.getContextPath()); response.setHeader("Connection", "close"); } catch (IllegalStateException ise) { - Debug.logError(ise.getMessage(), module); + Debug.logError(ise.getMessage(), MODULE); return "error"; } } @@ -64,7 +64,7 @@ public class OFBizSolrLoginWorker extends LoginWorker { response.setHeader("Location", request.getContextPath()); response.setHeader("Connection", "close"); } catch (IllegalStateException ise) { - Debug.logError(ise.getMessage(), module); + Debug.logError(ise.getMessage(), MODULE); return "error"; } } diff --git a/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrContextFilter.java b/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrContextFilter.java index 98297ae..185e64a 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrContextFilter.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrContextFilter.java @@ -57,7 +57,7 @@ import org.apache.solr.servlet.SolrDispatchFilter; */ public class OFBizSolrContextFilter extends SolrDispatchFilter { - public static final String module = OFBizSolrContextFilter.class.getName(); + public static final String MODULE = OFBizSolrContextFilter.class.getName(); private static final String resource = "SolrUiLabels"; @@ -99,9 +99,9 @@ public class OFBizSolrContextFilter extends SolrDispatchFilter { } else { message = UtilProperties.getMessage(resource, "SolrErrorNoManagePermission", locale); } - Debug.logInfo("[" + httpRequest.getRequestURI().substring(1) + "(Domain:" + request.getScheme() + "://" + request.getServerName() + ")] Request error: " + message, module); + Debug.logInfo("[" + httpRequest.getRequestURI().substring(1) + "(Domain:" + request.getScheme() + "://" + request.getServerName() + ")] Request error: " + message, MODULE); } catch (ConversionException e) { - Debug.logError("Error while converting Solr ofbizLogin map to JSON.", module); + Debug.logError("Error while converting Solr ofbizLogin map to JSON.", MODULE); } finally { if (os != null) { os.close(); @@ -142,11 +142,11 @@ public class OFBizSolrContextFilter extends SolrDispatchFilter { if (Debug.timingOn() && rname != null) { timer = new UtilTimer(); timer.setLog(true); - timer.timerString("[" + rname + "(Domain:" + request.getScheme() + "://" + request.getServerName() + ")] Request Begun, encoding=[" + charset + "]", module); + timer.timerString("[" + rname + "(Domain:" + request.getScheme() + "://" + request.getServerName() + ")] Request Begun, encoding=[" + charset + "]", MODULE); } // NOTE: there's a chain.doFilter in SolrDispatchFilter's doFilter super.doFilter(request, response, chain); - if (Debug.timingOn() && rname != null) timer.timerString("[" + rname + "(Domain:" + request.getScheme() + "://" + request.getServerName() + ")] Request Done", module); + if (Debug.timingOn() && rname != null) timer.timerString("[" + rname + "(Domain:" + request.getScheme() + "://" + request.getServerName() + ")] Request Done", MODULE); } @Override @@ -199,9 +199,9 @@ public class OFBizSolrContextFilter extends SolrDispatchFilter { json = mapToJson.convert(UtilMisc.toMap("responseHeader", (Object) responseHeader)); os.write(json.toString().getBytes()); os.flush(); - Debug.logInfo("[" + httpRequest.getRequestURI().substring(1) + "(Domain:" + httpRequest.getScheme() + "://" + httpRequest.getServerName() + ")] Request error: " + message, module); + Debug.logInfo("[" + httpRequest.getRequestURI().substring(1) + "(Domain:" + httpRequest.getScheme() + "://" + httpRequest.getServerName() + ")] Request error: " + message, MODULE); } catch (ConversionException e) { - Debug.logError("Error while converting responseHeader map to JSON.", module); + Debug.logError("Error while converting responseHeader map to JSON.", MODULE); } finally { if (os != null) { os.close(); diff --git a/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrLoadAdminUiServlet.java b/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrLoadAdminUiServlet.java index 8b45057..230107e 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrLoadAdminUiServlet.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrLoadAdminUiServlet.java @@ -41,7 +41,7 @@ import org.apache.solr.core.SolrCore; public class OFBizSolrLoadAdminUiServlet extends OFBizSolrRedirectServlet { private static final long serialVersionUID = 1L; - public static final String module = OFBizSolrLoadAdminUiServlet.class.getName(); + public static final String MODULE = OFBizSolrLoadAdminUiServlet.class.getName(); @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { diff --git a/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java b/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java index 4e13400..0d521cf 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java @@ -37,7 +37,7 @@ import org.apache.solr.servlet.RedirectServlet; @SuppressWarnings("serial") public class OFBizSolrRedirectServlet extends RedirectServlet { - public static final String module = OFBizSolrRedirectServlet.class.getName(); + public static final String MODULE = OFBizSolrRedirectServlet.class.getName(); /** * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) diff --git a/webpos/src/main/java/org/apache/ofbiz/webpos/WebPosEvents.java b/webpos/src/main/java/org/apache/ofbiz/webpos/WebPosEvents.java index 7f9f069..9a5ff1b 100755 --- a/webpos/src/main/java/org/apache/ofbiz/webpos/WebPosEvents.java +++ b/webpos/src/main/java/org/apache/ofbiz/webpos/WebPosEvents.java @@ -51,7 +51,7 @@ import org.apache.ofbiz.service.ServiceUtil; public class WebPosEvents { - public static String module = WebPosEvents.class.getName(); + public static String MODULE = WebPosEvents.class.getName(); public static String posLogin(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException { HttpSession session = request.getSession(true); @@ -115,7 +115,7 @@ public class WebPosEvents { webPosSession = new WebPosSession(posTerminalId, null, userLogin, request.getLocale(), productStoreId, facilityId, currencyUomId, delegator, dispatcher, cart); session.setAttribute("webPosSession", webPosSession); } else { - Debug.logError("PosTerminalId is empty cannot create a webPosSession", module); + Debug.logError("PosTerminalId is empty cannot create a webPosSession", MODULE); } } return webPosSession; @@ -178,7 +178,7 @@ public class WebPosEvents { if (ServiceUtil.isError(featureMap)) { String errorMessage = ServiceUtil.getErrorMessage(featureMap); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } Set<String> featureSet = UtilGenerics.cast(featureMap.get("featureSet")); @@ -190,7 +190,7 @@ public class WebPosEvents { if (ServiceUtil.isError(variantTreeMap)) { String errorMessage = ServiceUtil.getErrorMessage(variantTreeMap); request.setAttribute("_ERROR_MESSAGE_", errorMessage); - Debug.logError(errorMessage, module); + Debug.logError(errorMessage, MODULE); return "error"; } Map<String, Object> variantTree = UtilGenerics.cast(variantTreeMap.get("variantTree")); @@ -223,12 +223,12 @@ public class WebPosEvents { request.setAttribute("variantSampleSize", imageMap.size()); } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return "error"; } } } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return "error"; } } @@ -238,7 +238,7 @@ public class WebPosEvents { } } } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return "error"; } } diff --git a/webpos/src/main/java/org/apache/ofbiz/webpos/search/WebPosSearch.java b/webpos/src/main/java/org/apache/ofbiz/webpos/search/WebPosSearch.java index 61ec9b7..b8dc3cc 100644 --- a/webpos/src/main/java/org/apache/ofbiz/webpos/search/WebPosSearch.java +++ b/webpos/src/main/java/org/apache/ofbiz/webpos/search/WebPosSearch.java @@ -41,7 +41,7 @@ import org.apache.ofbiz.service.ServiceUtil; public class WebPosSearch { - public static final String module = WebPosSearch.class.getName(); + public static final String MODULE = WebPosSearch.class.getName(); public static Map<String, Object> findProducts(DispatchContext dctx, Map<String, ? extends Object> context) { Delegator delegator = dctx.getDelegator(); @@ -79,7 +79,7 @@ public class WebPosSearch { try { products = EntityQuery.use(delegator).from(entityName).where(mainCond).orderBy("productName", "description").queryList(); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } result.put("productsList", products); return result; @@ -178,7 +178,7 @@ public class WebPosSearch { try (EntityListIterator pli = delegator.findListIteratorByCondition(dynamicView, mainCond, null, null, orderBy, null)) { parties = EntityUtil.filterByDate(pli.getCompleteList(), true); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } result.put("partiesList", parties); return result; diff --git a/webpos/src/main/java/org/apache/ofbiz/webpos/session/WebPosSession.java b/webpos/src/main/java/org/apache/ofbiz/webpos/session/WebPosSession.java index c2638f2..1a4719d 100755 --- a/webpos/src/main/java/org/apache/ofbiz/webpos/session/WebPosSession.java +++ b/webpos/src/main/java/org/apache/ofbiz/webpos/session/WebPosSession.java @@ -40,7 +40,7 @@ import org.apache.ofbiz.webpos.transaction.WebPosTransaction; public class WebPosSession { - public static final String module = WebPosSession.class.getName(); + public static final String MODULE = WebPosSession.class.getName(); private String id = null; private Map<String, Object> attributes = new HashMap<>(); @@ -75,7 +75,7 @@ public class WebPosSession { this.dispatcher = dispatcher; this.cart = cart; - Debug.logInfo("Created WebPosSession [" + id + "]", module); + Debug.logInfo("Created WebPosSession [" + id + "]", MODULE); } public GenericValue getUserLogin() { @@ -193,10 +193,10 @@ public class WebPosSession { try { result = dispatcher.runSync("userLogin", UtilMisc.toMap("login.username", username, "login.password", password)); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); throw new UserLoginFailure(e); } catch (Throwable t) { - Debug.logError(t, "Throwable caught!", module); + Debug.logError(t, "Throwable caught!", MODULE); } // check for errors @@ -220,7 +220,7 @@ public class WebPosSession { try { partyRole = getDelegator().findOne("PartyRole", false, "partyId", partyId, "roleTypeId", roleTypeId); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return false; } diff --git a/webpos/src/main/java/org/apache/ofbiz/webpos/transaction/WebPosTransaction.java b/webpos/src/main/java/org/apache/ofbiz/webpos/transaction/WebPosTransaction.java index facbcd3..5a52584 100755 --- a/webpos/src/main/java/org/apache/ofbiz/webpos/transaction/WebPosTransaction.java +++ b/webpos/src/main/java/org/apache/ofbiz/webpos/transaction/WebPosTransaction.java @@ -49,7 +49,7 @@ import org.apache.ofbiz.webpos.session.WebPosSession; public class WebPosTransaction { public static final String resource = "WebPosUiLabels"; - public static final String module = WebPosTransaction.class.getName(); + public static final String MODULE = WebPosTransaction.class.getName(); public static final int NO_PAYMENT = 0; public static final int INTERNAL_PAYMENT = 1; public static final int EXTERNAL_PAYMENT = 2; @@ -91,10 +91,10 @@ public class WebPosTransaction { txLog.create(); cart.setTransactionId(transactionId); } catch (GenericEntityException e) { - Debug.logError(e, "Unable to create TX log - not fatal", module); + Debug.logError(e, "Unable to create TX log - not fatal", MODULE); } - Debug.logInfo("Created WebPosTransaction [" + this.transactionId + "]", module); + Debug.logInfo("Created WebPosTransaction [" + this.transactionId + "]", MODULE); } public String getUserLoginId() { @@ -138,7 +138,7 @@ public class WebPosTransaction { try { states = delegator.findList("PosTerminalState", EntityCondition.makeCondition(UtilMisc.toMap("posTerminalId", webPosSession.getId(), "startingTxId", getTransactionId())), null, null, null, false); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } states = EntityUtil.filterByDate(states, UtilDateTime.nowTimestamp(), "openedDate", "closedDate", true); return EntityUtil.getFirst(states); @@ -152,10 +152,10 @@ public class WebPosTransaction { try { txLog.store(); } catch (GenericEntityException e) { - Debug.logError(e, "Unable to store TX log - not fatal", module); + Debug.logError(e, "Unable to store TX log - not fatal", MODULE); } getCart().clear(); - Debug.logInfo("Transaction closed", module); + Debug.logInfo("Transaction closed", MODULE); } } @@ -166,20 +166,20 @@ public class WebPosTransaction { try { txLog.store(); } catch (GenericEntityException e) { - Debug.logError(e, "Unable to store TX log - not fatal", module); + Debug.logError(e, "Unable to store TX log - not fatal", MODULE); } webPosSession.setCurrentTransaction(null); - Debug.logInfo("Paid "+ type, module); + Debug.logInfo("Paid "+ type, MODULE); } } public void modifyPrice(int cartLineIdx, BigDecimal price) { ShoppingCartItem item = getCart().findCartItem(cartLineIdx); if (UtilValidate.isNotEmpty(item)) { - Debug.logInfo("Modify item price " + item.getProductId() + "/" + price, module); + Debug.logInfo("Modify item price " + item.getProductId() + "/" + price, MODULE); item.setBasePrice(price); } else { - Debug.logInfo("Item " + cartLineIdx + " not found", module); + Debug.logInfo("Item " + cartLineIdx + " not found", MODULE); } } @@ -187,12 +187,12 @@ public class WebPosTransaction { try { ch.calcAndAddTax(this.getStoreOrgAddress()); } catch (GeneralException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } public BigDecimal processSale() throws GeneralException { - Debug.logInfo("Process sale", module); + Debug.logInfo("Process sale", MODULE); BigDecimal grandTotal = this.getGrandTotal(); BigDecimal paymentAmt = this.getPaymentTotal(); if (grandTotal.compareTo(paymentAmt) > 0) { @@ -203,14 +203,14 @@ public class WebPosTransaction { getCart().setOrderPartyId(partyId); // validate payment methods - Debug.logInfo("Validating payment methods", module); + Debug.logInfo("Validating payment methods", MODULE); Map<String, ? extends Object> valRes = UtilGenerics.cast(ch.validatePaymentMethods()); if (valRes != null && ServiceUtil.isError(valRes)) { throw new GeneralException(ServiceUtil.getErrorMessage(valRes)); } // store the order - Debug.logInfo("Store order", module); + Debug.logInfo("Store order", MODULE); Map<String, ? extends Object> orderRes = UtilGenerics.cast(ch.createOrder(webPosSession.getUserLogin())); if (orderRes != null && ServiceUtil.isError(orderRes)) { @@ -220,12 +220,12 @@ public class WebPosTransaction { } // process the payment(s) - Debug.logInfo("Processing the payment(s)", module); + Debug.logInfo("Processing the payment(s)", MODULE); Map<String, ? extends Object> payRes = null; try { payRes = UtilGenerics.cast(ch.processPayment(ProductStoreWorker.getProductStore(webPosSession.getProductStoreId(), webPosSession.getDelegator()), webPosSession.getUserLogin(), true)); } catch (GeneralException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); throw e; } @@ -250,7 +250,7 @@ public class WebPosTransaction { try { txLog.store(); } catch (GenericEntityException e) { - Debug.logError(e, "Unable to store TX log - not fatal", module); + Debug.logError(e, "Unable to store TX log - not fatal", MODULE); } return change; @@ -263,7 +263,7 @@ public class WebPosTransaction { try { facility = webPosSession.getDelegator().findOne("Facility", UtilMisc.toMap("facilityId", webPosSession.getFacilityId()), false); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } if (UtilValidate.isEmpty(facility)) { return null; @@ -273,7 +273,7 @@ public class WebPosTransaction { try { fcp = facility.getRelated("FacilityContactMechPurpose", UtilMisc.toMap("contactMechPurposeTypeId", "SHIP_ORIG_LOCATION"), null, false); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } fcp = EntityUtil.filterByDate(fcp); GenericValue purp = EntityUtil.getFirst(fcp); @@ -282,7 +282,7 @@ public class WebPosTransaction { this.shipAddress = webPosSession.getDelegator().findOne("PostalAddress", UtilMisc.toMap("contactMechId", purp.getString("contactMechId")), false); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } } } @@ -290,17 +290,17 @@ public class WebPosTransaction { } public void clearPayments() { - Debug.logInfo("all payments cleared from sale", module); + Debug.logInfo("all payments cleared from sale", MODULE); getCart().clearPayments(); } public void clearPayment(int index) { - Debug.logInfo("removing payment " + index, module); + Debug.logInfo("removing payment " + index, MODULE); getCart().clearPayment(index); } public void clearPayment(String id) { - Debug.logInfo("removing payment " + id, module); + Debug.logInfo("removing payment " + id, MODULE); getCart().clearPayment(id); } @@ -318,7 +318,7 @@ public class WebPosTransaction { try { values = webPosSession.getDelegator().findList("ProductStorePaymentSetting", EntityCondition.makeCondition(fields), null, null, null, true); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); } final String externalCode = "PRDS_PAY_EXTERNAL"; @@ -329,7 +329,7 @@ public class WebPosTransaction { Iterator<GenericValue> i = values.iterator(); while (i.hasNext() && isExternal) { GenericValue v = i.next(); - //Debug.logInfo("Testing [" + paymentMethodTypeId + "] - " + v, module); + //Debug.logInfo("Testing [" + paymentMethodTypeId + "] - " + v, MODULE); if (!externalCode.equals(v.getString("paymentServiceTypeEnumId"))) { isExternal = false; } @@ -360,7 +360,7 @@ public class WebPosTransaction { } public BigDecimal addPayment(String id, BigDecimal amount, String refNum, String authCode) { - Debug.logInfo("Added payment " + id + "/" + amount, module); + Debug.logInfo("Added payment " + id + "/" + amount, MODULE); if ("CASH".equals(id)) { // clear cash payments first; so there is only one getCart().clearPayment(id); @@ -371,7 +371,7 @@ public class WebPosTransaction { public BigDecimal processAmount(BigDecimal amount) throws GeneralException { if (UtilValidate.isEmpty(amount)) { - Debug.logInfo("Amount is empty; assumption is full amount : " + this.getTotalDue(), module); + Debug.logInfo("Amount is empty; assumption is full amount : " + this.getTotalDue(), MODULE); amount = this.getTotalDue(); if (amount.compareTo(BigDecimal.ZERO) <= 0) { throw new GeneralException(); @@ -383,7 +383,7 @@ public class WebPosTransaction { public synchronized void processNoPayment(String paymentMethodTypeId) { try { BigDecimal amount = processAmount(null); - Debug.logInfo("Processing [" + paymentMethodTypeId + "] Amount : " + amount, module); + Debug.logInfo("Processing [" + paymentMethodTypeId + "] Amount : " + amount, MODULE); // add the payment addPayment(paymentMethodTypeId, amount, null, null); @@ -400,7 +400,7 @@ public class WebPosTransaction { try { amount = processAmount(amount); - Debug.logInfo("Processing [" + paymentMethodTypeId + "] Amount : " + amount, module); + Debug.logInfo("Processing [" + paymentMethodTypeId + "] Amount : " + amount, MODULE); // add the payment addPayment(paymentMethodTypeId, amount, refNum, null); @@ -432,11 +432,11 @@ public class WebPosTransaction { try { svcRes = dispatcher.runSync("createCreditCard", svcCtx); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, MODULE); return null; } if (ServiceUtil.isError(svcRes)) { - Debug.logError(ServiceUtil.getErrorMessage(svcRes) + " - " + svcRes, module); + Debug.logError(ServiceUtil.getErrorMessage(svcRes) + " - " + svcRes, MODULE); return null; } else { return (String) svcRes.get("paymentMethodId"); @@ -444,7 +444,7 @@ public class WebPosTransaction { } public void setPaymentRefNum(int paymentIndex, String refNum, String authCode) { - Debug.logInfo("setting payment index reference number " + paymentIndex + " / " + refNum + " / " + authCode, module); + Debug.logInfo("setting payment index reference number " + paymentIndex + " / " + refNum + " / " + authCode, MODULE); ShoppingCart.CartPaymentInfo inf = getCart().getPaymentInfo(paymentIndex); inf.refNum[0] = refNum; inf.refNum[1] = authCode; @@ -452,7 +452,7 @@ public class WebPosTransaction { /* CVV2 code should be entered when a card can't be swiped */ public void setPaymentSecurityCode(String paymentId, String refNum, String securityCode) { - Debug.logInfo("setting payment security code " + paymentId, module); + Debug.logInfo("setting payment security code " + paymentId, MODULE); int paymentIndex = getCart().getPaymentInfoIndex(paymentId, refNum); ShoppingCart.CartPaymentInfo inf = getCart().getPaymentInfo(paymentIndex); inf.securityCode = securityCode; @@ -461,7 +461,7 @@ public class WebPosTransaction { /* Track2 data should be sent to processor when a card is swiped. */ public void setPaymentTrack2(String paymentId, String refNum, String securityCode) { - Debug.logInfo("setting payment security code " + paymentId, module); + Debug.logInfo("setting payment security code " + paymentId, MODULE); int paymentIndex = getCart().getPaymentInfoIndex(paymentId, refNum); ShoppingCart.CartPaymentInfo inf = getCart().getPaymentInfo(paymentIndex); inf.securityCode = securityCode; @@ -470,7 +470,7 @@ public class WebPosTransaction { /* Postal code should be entered when a card can't be swiped */ public void setPaymentPostalCode(String paymentId, String refNum, String postalCode) { - Debug.logInfo("setting payment security code " + paymentId, module); + Debug.logInfo("setting payment security code " + paymentId, MODULE); int paymentIndex = getCart().getPaymentInfoIndex(paymentId, refNum); ShoppingCart.CartPaymentInfo inf = getCart().getPaymentInfo(paymentIndex); inf.postalCode = postalCode; |
Free forum by Nabble | Edit this page |