This is an automated email from the ASF dual-hosted git repository.
surajk 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 26ddcc0 Improved: Corrected line is longer than 150 characters checkstyle issues in plugins component. (OFBIZ-11921) Also fixed some other extra space and naming related checkstyle issues observed. Thanks Jacques for review. new f475253 Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-plugins into trunk 26ddcc0 is described below commit 26ddcc0c8e2189b0adb421fa4669b934b372407d Author: Suraj Khurana <[hidden email]> AuthorDate: Fri Sep 4 12:27:09 2020 +0530 Improved: Corrected line is longer than 150 characters checkstyle issues in plugins component. (OFBIZ-11921) Also fixed some other extra space and naming related checkstyle issues observed. Thanks Jacques for review. --- .../apache/ofbiz/bi/util/DimensionServices.java | 6 +++-- .../ofbiz/birt/flexible/ReportDesignGenerator.java | 3 ++- .../ofbiz/ecommerce/misc/ThirdPartyEvents.java | 15 +++++++---- .../ecommerce/webapp/view/JspViewHandler.java | 5 ++-- .../org/apache/ofbiz/ldap/LdapLoginWorker.java | 3 ++- .../ldap/cas/OFBizCasAuthenticationHandler.java | 8 +++--- .../AbstractOFBizAuthenticationHandler.java | 31 +++++++++++++++++----- .../ofbiz/content/search/ProductDocument.java | 3 ++- .../apache/ofbiz/content/search/SearchWorker.java | 8 +++--- .../ofbiz/htmlreport/AbstractReportThread.java | 16 ++++++++++- .../org/apache/ofbiz/htmlreport/HtmlReport.java | 5 ++++ .../apache/ofbiz/pricat/AbstractPricatParser.java | 10 +++++++ .../apache/ofbiz/pricat/InterfacePricatParser.java | 6 +++-- .../java/org/apache/ofbiz/solr/CategoryUtil.java | 5 ++-- .../java/org/apache/ofbiz/solr/ProductUtil.java | 12 ++++++--- .../apache/ofbiz/webpos/session/WebPosSession.java | 3 ++- 16 files changed, 104 insertions(+), 35 deletions(-) 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 5805028..02741f1 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 @@ -73,7 +73,8 @@ public class DimensionServices { andCondition.put(naturalKeyField, dimensionValue.get(naturalKeyField)); } if (andCondition.isEmpty()) { - return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "BusinessIntelligenceNaturalKeyWithourDimension", UtilMisc.toMap("naturalKeyFields", naturalKeyFields, "dimensionValue", dimensionValue), locale)); + return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "BusinessIntelligenceNaturalKeyWithourDimension", + UtilMisc.toMap("naturalKeyFields", naturalKeyFields, "dimensionValue", dimensionValue), locale)); } List<GenericValue> existingDimensionValues = null; try { @@ -97,7 +98,8 @@ public class DimensionServices { dimensionValue.set("dimensionId", delegator.getNextSeqId(dimensionValue.getEntityName())); dimensionValue.create(); } else { - return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "BusinessIntelligenceUpdateModeStillNotSupported", UtilMisc.toMap("updateMode", updateMode), locale)); + return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "BusinessIntelligenceUpdateModeStillNotSupported", + UtilMisc.toMap("updateMode", updateMode), locale)); } } } catch (GenericEntityException gee) { 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 369e926..5addb0e 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 @@ -282,7 +282,8 @@ public class ReportDesignGenerator { 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"); + + ".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"); 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 9d485ab..8445010 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 @@ -145,7 +145,8 @@ public class ThirdPartyEvents { // create distributor Party ?? why? // create distributor PartyRole ?? why? // create PartyRelationship - GenericValue partyRelationship = delegator.makeValue("PartyRelationship", UtilMisc.toMap("partyIdFrom", party.getString("partyId"), "partyIdTo", distributorId, "roleTypeIdFrom", "CUSTOMER", "roleTypeIdTo", "DISTRIBUTOR")); + GenericValue partyRelationship = delegator.makeValue("PartyRelationship", UtilMisc.toMap("partyIdFrom", + party.getString("partyId"), "partyIdTo", distributorId, "roleTypeIdFrom", "CUSTOMER", "roleTypeIdTo", "DISTRIBUTOR")); partyRelationship.set("fromDate", UtilDateTime.nowTimestamp()); partyRelationship.set("partyRelationshipTypeId", "DISTRIBUTION_CHANNEL"); @@ -198,12 +199,14 @@ public class ThirdPartyEvents { String store = UtilProperties.getPropertyValue(ecommercePropertiesUrl, "affiliate.store.customer"); - if (store == null || store.toUpperCase().startsWith("N")) + if (store == null || store.toUpperCase().startsWith("N")) { return "success"; + } String storeOnClick = UtilProperties.getPropertyValue(ecommercePropertiesUrl, "affiliate.store.onclick"); - if (storeOnClick == null || storeOnClick.toUpperCase().startsWith("N")) + if (storeOnClick == null || storeOnClick.toUpperCase().startsWith("N")) { return "success"; + } try { party = userLogin == null ? null : userLogin.getRelatedOne("Party", false); @@ -220,7 +223,8 @@ public class ThirdPartyEvents { if (UtilValidate.isNotEmpty(affiliateId)) { // create PartyRelationship - GenericValue partyRelationship = delegator.makeValue("PartyRelationship", UtilMisc.toMap("partyIdFrom", party.getString("partyId"), "partyIdTo", affiliateId, "roleTypeIdFrom", "CUSTOMER", "roleTypeIdTo", "AFFILIATE")); + GenericValue partyRelationship = delegator.makeValue("PartyRelationship", UtilMisc.toMap("partyIdFrom", + party.getString("partyId"), "partyIdTo", affiliateId, "roleTypeIdFrom", "CUSTOMER", "roleTypeIdTo", "AFFILIATE")); partyRelationship.set("fromDate", UtilDateTime.nowTimestamp()); partyRelationship.set("partyRelationshipTypeId", "SALES_AFFILIATE"); @@ -251,7 +255,8 @@ public class ThirdPartyEvents { private static GenericValue getPartyRelationship(GenericValue party, String roleTypeTo) { try { - return EntityUtil.getFirst(EntityUtil.filterByDate(party.getRelated("FromPartyRelationship", UtilMisc.toMap("roleTypeIdTo", roleTypeTo), null, false), true)); + return EntityUtil.getFirst(EntityUtil.filterByDate(party.getRelated("FromPartyRelationship", UtilMisc.toMap("roleTypeIdTo", + roleTypeTo), null, false), true)); } catch (GenericEntityException gee) { Debug.logWarning(gee, MODULE); } 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 f187d50..ff9ecc6 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 @@ -41,7 +41,7 @@ public class JspViewHandler extends AbstractViewHandler { private static final String MODULE = JspViewHandler.class.getName(); - protected ServletContext context; + private ServletContext context; @Override public void init(ServletContext context) throws ViewHandlerException { @@ -49,7 +49,8 @@ public class JspViewHandler extends AbstractViewHandler { } @Override - public void render(String name, String page, String contentType, String encoding, String info, HttpServletRequest request, HttpServletResponse response) throws ViewHandlerException { + public void render(String name, String page, String contentType, String encoding, String info, HttpServletRequest request, + HttpServletResponse response) throws ViewHandlerException { // some containers call filters on EVERY request, even forwarded ones, // so let it know that it came from the control servlet 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 f2e8314..bbc6273 100644 --- a/ldap/src/main/java/org/apache/ofbiz/ldap/LdapLoginWorker.java +++ b/ldap/src/main/java/org/apache/ofbiz/ldap/LdapLoginWorker.java @@ -88,7 +88,8 @@ public final class LdapLoginWorker { } } - if (!LoginWorker.hasBasePermission(userLogin, request) || LoginWorker.isFlaggedLoggedOut(userLogin, userLogin.getDelegator()) || hasLdapLoggedOut) { + if (!LoginWorker.hasBasePermission(userLogin, request) || LoginWorker.isFlaggedLoggedOut(userLogin, userLogin.getDelegator()) + || hasLdapLoggedOut) { Debug.logInfo("User does not have permission or is flagged as logged out", MODULE); LoginWorker.doBasicLogout(userLogin, request, response); userLogin = null; diff --git a/ldap/src/main/java/org/apache/ofbiz/ldap/cas/OFBizCasAuthenticationHandler.java b/ldap/src/main/java/org/apache/ofbiz/ldap/cas/OFBizCasAuthenticationHandler.java index c097ab2..b5083ae 100644 --- a/ldap/src/main/java/org/apache/ofbiz/ldap/cas/OFBizCasAuthenticationHandler.java +++ b/ldap/src/main/java/org/apache/ofbiz/ldap/cas/OFBizCasAuthenticationHandler.java @@ -134,8 +134,9 @@ public final class OFBizCasAuthenticationHandler extends AbstractOFBizAuthentica java.util.Random rn = new SecureRandom(); int n = hi - lo + 1; int i = rn.nextInt() % n; - if (i < 0) - i = -i; + if (i < 0) { + i = -i; + } return lo + i; } @@ -161,7 +162,8 @@ public final class OFBizCasAuthenticationHandler extends AbstractOFBizAuthentica String className = UtilXml.childElementValue(rootElement, "CasLdapHandler", "org.apache.ofbiz.ldap.openldap.OFBizLdapAuthenticationHandler"); try { Class<?> handlerClass = Class.forName(className); - InterfaceOFBizAuthenticationHandler casLdapHandler = (InterfaceOFBizAuthenticationHandler) handlerClass.getDeclaredConstructor().newInstance(); + InterfaceOFBizAuthenticationHandler casLdapHandler = (InterfaceOFBizAuthenticationHandler) handlerClass + .getDeclaredConstructor().newInstance(); return casLdapHandler.getLdapSearchResult(username, password, rootElement, bindRequired); } catch (ReflectiveOperationException e) { throw new NamingException(e.getLocalizedMessage()); diff --git a/ldap/src/main/java/org/apache/ofbiz/ldap/commons/AbstractOFBizAuthenticationHandler.java b/ldap/src/main/java/org/apache/ofbiz/ldap/commons/AbstractOFBizAuthenticationHandler.java index 85632d1..39751db 100644 --- a/ldap/src/main/java/org/apache/ofbiz/ldap/commons/AbstractOFBizAuthenticationHandler.java +++ b/ldap/src/main/java/org/apache/ofbiz/ldap/commons/AbstractOFBizAuthenticationHandler.java @@ -96,9 +96,22 @@ public abstract class AbstractOFBizAuthenticationHandler implements InterfaceOFB } @Override - public abstract SearchResult getLdapSearchResult(String username, String password, Element rootElement, boolean bindRequired) throws NamingException; + public abstract SearchResult getLdapSearchResult(String username, String password, Element rootElement, boolean bindRequired) + throws NamingException; - public String login(HttpServletRequest request, HttpServletResponse response, String username, String password, Element rootElement, SearchResult result) throws Exception { + /** + * Login string. + * @param request the request + * @param response the response + * @param username the username + * @param password the password + * @param rootElement the root element + * @param result the result + * @return the string + * @throws Exception the exception + */ + public String login(HttpServletRequest request, HttpServletResponse response, String username, String password, Element rootElement, + SearchResult result) throws Exception { HttpSession session = request.getSession(); // get the visit id to pass to the userLogin for history @@ -121,23 +134,26 @@ public abstract class AbstractOFBizAuthenticationHandler implements InterfaceOFB throw new GenericEntityException(e.getLocalizedMessage()); } - GenericValue userLoginSecurityGroup = delegator.makeValue("UserLoginSecurityGroup", UtilMisc.toMap("userLoginId", username, "groupId", getSecurityGroup(rootElement, result), "fromDate", UtilDateTime.nowTimestamp())); + GenericValue userLoginSecurityGroup = delegator.makeValue("UserLoginSecurityGroup", UtilMisc.toMap("userLoginId", + username, "groupId", getSecurityGroup(rootElement, result), "fromDate", UtilDateTime.nowTimestamp())); try { userLoginSecurityGroup.create(); } catch (GenericEntityException e) { throw new GenericEntityException(e.getLocalizedMessage()); } } else { - userTryToLogin.setString("currentPassword", useEncryption ? HashCrypt.cryptUTF8(LoginServices.getHashType(), null, password) : password); + userTryToLogin.setString("currentPassword", useEncryption ? HashCrypt.cryptUTF8(LoginServices.getHashType(), null, + password) : password); userTryToLogin.store(); } Map<String, Object> loginResult = null; try { - loginResult = dispatcher.runSync("userLogin", UtilMisc.toMap("login.username", username, "login.password", password, "visitId", visitId, "locale", UtilHttp.getLocale(request))); + loginResult = dispatcher.runSync("userLogin", UtilMisc.toMap("login.username", username, "login.password", password, + "visitId", visitId, "locale", UtilHttp.getLocale(request))); if (ServiceUtil.isError(loginResult)) { - throw new Exception(ServiceUtil.getErrorMessage(loginResult)); + throw new Exception(ServiceUtil.getErrorMessage(loginResult)); } } catch (GenericServiceException e) { throw new GenericServiceException(e.getLocalizedMessage()); @@ -148,7 +164,8 @@ public abstract class AbstractOFBizAuthenticationHandler implements InterfaceOFB return LoginWorker.doMainLogin(request, response, userLogin, userLoginSession); } else { Map<String, String> messageMap = UtilMisc.toMap("errorMessage", (String) loginResult.get(ModelService.ERROR_MESSAGE)); - String errMsg = UtilProperties.getMessage("SecurityextUiLabels", "loginevents.following_error_occurred_during_login", messageMap, UtilHttp.getLocale(request)); + String errMsg = UtilProperties.getMessage("SecurityextUiLabels", "loginevents.following_error_occurred_during_login", + messageMap, UtilHttp.getLocale(request)); throw new Exception(errMsg); } } 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 7ae034a..82f33ca 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 @@ -100,7 +100,8 @@ public class ProductDocument implements LuceneDocument { EntityCondition.makeCondition(thruDateName, EntityOperator.GREATER_THAN, UtilDateTime.nowTimestamp()))); } - private static Timestamp getCategoryCatalogs(Document doc, GenericValue productCategory, Set<String> indexedCatalogIds) throws GenericEntityException { + private static Timestamp getCategoryCatalogs(Document doc, GenericValue productCategory, Set<String> indexedCatalogIds) + throws GenericEntityException { Timestamp nextReIndex = null; List<GenericValue> prodCatalogCategories = productCategory.getRelated("ProdCatalogCategory", null, null, false); prodCatalogCategories = filterByThruDate(prodCatalogCategories); 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 42da4e3..3a3fdf8 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 @@ -47,12 +47,14 @@ public final class SearchWorker { public static void indexContentTree(LocalDispatcher dispatcher, Delegator delegator, String siteId) throws Exception { GenericValue content = delegator.makeValue("Content", UtilMisc.toMap("contentId", siteId)); - List<GenericValue> siteList = ContentWorker.getAssociatedContent(content, "To", UtilMisc.toList("SUBSITE", "PUBLISH_LINK", "SUB_CONTENT"), null, UtilDateTime.nowTimestamp().toString(), null); + List<GenericValue> siteList = ContentWorker.getAssociatedContent(content, "To", UtilMisc.toList("SUBSITE", + "PUBLISH_LINK", "SUB_CONTENT"), null, UtilDateTime.nowTimestamp().toString(), null); if (siteList != null) { for (GenericValue siteContent : siteList) { String siteContentId = siteContent.getString("contentId"); - List<GenericValue> subContentList = ContentWorker.getAssociatedContent(siteContent, "To", UtilMisc.toList("SUBSITE", "PUBLISH_LINK", "SUB_CONTENT"), null, UtilDateTime.nowTimestamp().toString(), null); + List<GenericValue> subContentList = ContentWorker.getAssociatedContent(siteContent, "To", + UtilMisc.toList("SUBSITE", "PUBLISH_LINK", "SUB_CONTENT"), null, UtilDateTime.nowTimestamp().toString(), null); if (subContentList != null) { List<String> contentIdList = new ArrayList<>(); @@ -68,7 +70,7 @@ public final class SearchWorker { public static String getIndexPath(String path) { String basePath = UtilProperties.getPropertyValue("lucene", "defaultIndex", "index"); - return (UtilValidate.isNotEmpty(path)? basePath + "/" + path + "/index" : basePath); + return (UtilValidate.isNotEmpty(path) ? basePath + "/" + path + "/index" : basePath); } public static void indexContentList(LocalDispatcher dispatcher, Delegator delegator, List<String> idList) throws Exception { diff --git a/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java b/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java index 8d0ed0d..a33521e 100644 --- a/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java +++ b/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java @@ -179,10 +179,24 @@ public abstract class AbstractReportThread extends Thread implements InterfaceRe ((HtmlReport) report).setParamThread(getUUID().toString()); } - protected void initHtmlReport(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient, String logFileName) { + /** + * Init html report. + * @param request the request + * @param response the response + * @param writeHtml the write html + * @param isTransient the is transient + * @param logFileName the log file name + */ + protected void initHtmlReport(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient, + String logFileName) { report = HtmlReport.getInstance(request, response, writeHtml, isTransient, logFileName); ((HtmlReport) report).setParamThread(getUUID().toString()); } + + /** + * Gets locale. + * @return the locale + */ protected Locale getLocale() { return locale; } 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 c513fea..4003573 100644 --- a/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java +++ b/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java @@ -1252,6 +1252,11 @@ public class HtmlReport extends AbstractReport { } return logFileName; } + + /** + * Gets log file name. + * @return the log file name + */ public String getLogFileName() { return logFileName; } 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 3644ac3..1a760ac 100644 --- a/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java +++ b/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java @@ -685,6 +685,13 @@ public abstract class AbstractPricatParser implements InterfacePricatParser { this.selectedFacilityId = selectedFacilityId; } + /** + * Is empty row boolean. + * @param row the row + * @param size the size + * @param display the display + * @return the boolean + */ protected boolean isEmptyRow(XSSFRow row, int size, boolean display) { // check whether this row is empty if (UtilValidate.isEmpty(row)) { @@ -764,6 +771,9 @@ public abstract class AbstractPricatParser implements InterfacePricatParser { return !errorMessages.keySet().isEmpty(); } + /** + * Cleanup log and commented excel. + */ protected void cleanupLogAndCommentedExcel() { try { report.print(UtilProperties.getMessage(RESOURCE, "CLEANUP_LOGANDEXCEL_BEGIN", locale), InterfaceReport.FORMAT_DEFAULT); diff --git a/pricat/src/main/java/org/apache/ofbiz/pricat/InterfacePricatParser.java b/pricat/src/main/java/org/apache/ofbiz/pricat/InterfacePricatParser.java index 0abe72c..0b50936 100644 --- a/pricat/src/main/java/org/apache/ofbiz/pricat/InterfacePricatParser.java +++ b/pricat/src/main/java/org/apache/ofbiz/pricat/InterfacePricatParser.java @@ -37,7 +37,8 @@ import org.apache.ofbiz.entity.transaction.GenericTransactionException; public interface InterfacePricatParser { String PARSE_EXCEL = "parse_excel"; String CONFIRM = "confirm_action"; - String[] MESSAGE_LABELS = new String[] {"FORMAT_DEFAULT", "FORMAT_WARNING", "FORMAT_HEADLINE", "FORMAT_NOTE", "FORMAT_OK", "FORMAT_ERROR", "FORMAT_THROWABLE"}; + String[] MESSAGE_LABELS = new String[] {"FORMAT_DEFAULT", "FORMAT_WARNING", "FORMAT_HEADLINE", "FORMAT_NOTE", "FORMAT_OK", + "FORMAT_ERROR", "FORMAT_THROWABLE"}; List<String> MESSAGES = Collections.unmodifiableList(Arrays.asList(MESSAGE_LABELS)); String TEMP_FILES_FOLDER = "runtime/pricat/"; String FILE_DATETIME_PATTERN = "yyyyMMddHHmmss"; @@ -68,7 +69,8 @@ public interface InterfacePricatParser { Map<String, Object> getColorIds(String productId, String ownerPartyId, String color); - String getProductId(XSSFRow row, String brandId, String modelName, String productName, String productCategoryId, String ownerPartyId, BigDecimal listPrice); + String getProductId(XSSFRow row, String brandId, String modelName, String productName, String productCategoryId, + String ownerPartyId, BigDecimal listPrice); String getBrandId(String brandName, String ownerPartyId); 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 760fc48..427d8d2 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/CategoryUtil.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/CategoryUtil.java @@ -66,7 +66,7 @@ public final class CategoryUtil { return catalogIds; } public static List<List<String>> getCategoryTrail(String productCategoryId, DispatchContext dctx) { - GenericDelegator delegator = (GenericDelegator) dctx.getDelegator(); + GenericDelegator delegator = (GenericDelegator) dctx.getDelegator(); List<List<String>> trailElements = new ArrayList<>(); String parentProductCategoryId = productCategoryId; while (UtilValidate.isNotEmpty(parentProductCategoryId)) { @@ -75,7 +75,8 @@ public final class CategoryUtil { List<EntityCondition> rolllupConds = new ArrayList<>(); rolllupConds.add(EntityCondition.makeCondition("productCategoryId", parentProductCategoryId)); rolllupConds.add(EntityUtil.getFilterByDateExpr()); - List<GenericValue> productCategoryRollups = delegator.findList("ProductCategoryRollup", EntityCondition.makeCondition(rolllupConds), null, UtilMisc.toList("-fromDate"), null, true); + List<GenericValue> productCategoryRollups = delegator.findList("ProductCategoryRollup", + EntityCondition.makeCondition(rolllupConds), null, UtilMisc.toList("-fromDate"), null, true); if (UtilValidate.isNotEmpty(productCategoryRollups)) { List<List<String>> trailElementsAux = new ArrayList<>(); trailElementsAux.addAll(trailElements); 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 ff1e90f..b06ebee 100644 --- a/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java +++ b/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java @@ -85,7 +85,8 @@ public final class ProductUtil { // if (product.get("productWeight") != null) dispatchContext.put("weight", ""); // Trying to set a correctand trail - List<GenericValue> category = delegator.findList("ProductCategoryMember", EntityCondition.makeCondition(UtilMisc.toMap("productId", productId)), null, null, null, false); + List<GenericValue> category = delegator.findList("ProductCategoryMember", + EntityCondition.makeCondition(UtilMisc.toMap("productId", productId)), null, null, null, false); List<String> trails = new ArrayList<>(); for (Iterator<GenericValue> catIterator = category.iterator(); catIterator.hasNext();) { GenericValue cat = catIterator.next(); @@ -139,7 +140,8 @@ public final class ProductUtil { dispatchContext.put("features", featureSet.get("featureSet")); } - Map<String, Object> productInventoryAvailable = dispatcher.runSync("getProductInventoryAvailable", UtilMisc.toMap("productId", productId)); + Map<String, Object> productInventoryAvailable = dispatcher.runSync("getProductInventoryAvailable", + UtilMisc.toMap("productId", productId)); if (ServiceUtil.isError(productInventoryAvailable)) { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(productInventoryAvailable)); } @@ -219,7 +221,8 @@ public final class ProductUtil { // dispatchContext.put("last_modified", ""); if ("AGGREGATED".equals(product.getString("productTypeId"))) { - ProductConfigWrapper configWrapper = new ProductConfigWrapper(delegator, dispatcher, productId, null, null, null, null, locale, userLogin); + ProductConfigWrapper configWrapper = new ProductConfigWrapper(delegator, dispatcher, productId, null, + null, null, null, locale, userLogin); String listPrice = configWrapper.getTotalListPrice().setScale(2, RoundingMode.HALF_DOWN).toString(); if (listPrice != null) { dispatchContext.put("listPrice", listPrice); @@ -240,8 +243,9 @@ public final class ProductUtil { } if (priceMap.get("defaultPrice") != null) { String defaultPrice = ((BigDecimal) priceMap.get("defaultPrice")).setScale(2, RoundingMode.HALF_DOWN).toString(); - if (defaultPrice != null) + if (defaultPrice != null) { dispatchContext.put("defaultPrice", defaultPrice); + } } } } 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 69256d3..c231291 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 @@ -56,7 +56,8 @@ public class WebPosSession { private WebPosTransaction webPosTransaction = null; private ShoppingCart cart = null; - public WebPosSession(String id, Map<String, Object> attributes, GenericValue userLogin, Locale locale, String productStoreId, String facilityId, String currencyUomId, Delegator delegator, LocalDispatcher dispatcher, ShoppingCart cart) { + public WebPosSession(String id, Map<String, Object> attributes, GenericValue userLogin, Locale locale, String productStoreId, + String facilityId, String currencyUomId, Delegator delegator, LocalDispatcher dispatcher, ShoppingCart cart) { this.id = id; this.attributes = attributes; this.userLogin = userLogin; |
Free forum by Nabble | Edit this page |