Improved: Corrected checkstyle formatting issues, 'is preceded/not preceded with whitespace' for plugins component.

(OFBIZ-11874)
This fixes following checkstyle issues:
'{' is not preceded with whitespace.

'{' is not followed by whitespace.

'}' is not followed by whitespace.

'}' is not preceded with whitespace.

'typecast' is not followed by whitespace.

'try' is not followed by whitespace.

';' is preceded with whitespace.
This commit is contained in:
Suraj Khurana
2020-07-11 14:27:09 +05:30
parent 845de6eb63
commit b18669cddc
32 changed files with 163 additions and 180 deletions
@@ -50,11 +50,11 @@ public class FixedAssetMaintServices {
LocalDispatcher dispatcher = ctx.getDispatcher();
Delegator delegator = ctx.getDelegator();
Locale locale = (Locale) context.get("locale");
String fixedAssetId = (String)context.get("fixedAssetId");
String maintHistSeqId = (String)context.get("maintHistSeqId");
String productId = (String)context.get("productId");
String facilityId = (String)context.get("facilityId");
Double quantity = (Double)context.get("quantity");
String fixedAssetId = (String) context.get("fixedAssetId");
String maintHistSeqId = (String) context.get("maintHistSeqId");
String productId = (String) context.get("productId");
String facilityId = (String) context.get("facilityId");
Double quantity = (Double) context.get("quantity");
double requestedQty = quantity;
try {
@@ -66,7 +66,7 @@ public class BirtFactory {
* @throws ParserConfigurationException
*/
public static InputStream getReportInputStreamFromLocation(String resourceName)
throws IOException, SAXException, ParserConfigurationException{
throws IOException, SAXException, ParserConfigurationException {
InputStream reportInputStream = null;
synchronized (BirtFactory.class) {
@@ -72,7 +72,7 @@ public final class BirtWorker {
private final static HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();
private BirtWorker() {}
private BirtWorker() { }
private static final Map<Integer, Level> levelIntMap = new HashMap<>();
static {
@@ -113,7 +113,7 @@ public final class BirtUtil {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document", "docx",
"application/vnd.openxmlformats-officedocument.presentationml.presentation", "pptx");
private BirtUtil() {}
private BirtUtil() { }
/**
* Return birt field type corresponding to given entity field type
@@ -209,8 +209,8 @@ public class EbayOrderServices {
private static Map<String, Object> buildGetSellerTransactionsRequest(Map<String, Object> context, StringBuffer sellerTransactionsItemsXml, String token) {
Locale locale = (Locale)context.get("locale");
String fromDate = (String)context.get("fromDate");
String thruDate = (String)context.get("thruDate");
String fromDate = (String) context.get("fromDate");
String thruDate = (String) context.get("thruDate");
try {
Document transDoc = UtilXml.makeEmptyXmlDocument("GetSellerTransactionsRequest");
Element transElem = transDoc.getDocumentElement();
@@ -170,7 +170,7 @@ public class ImportOrdersFromEbay {
String successMessage = (String)result.get("successMessage");
if (successMessage != null) {
return readCompleteSaleResponse(successMessage, locale);
} else{
} else {
ServiceUtil.returnFailure(UtilProperties.getMessage(RESOURCE, "ordersImportFromEbay.errorDuringPostCompleteSaleRequest", locale));
}
}
@@ -183,7 +183,7 @@ public class ImportOrdersFromEbay {
private static Map<String, Object> checkOrders(Delegator delegator, LocalDispatcher dispatcher, Locale locale, Map<String, Object> context, String response) {
StringBuffer errorMessage = new StringBuffer();
List<Map<String, Object>> orders = readResponseFromEbay(response, locale, (String)context.get("productStoreId"), delegator, errorMessage);
List<Map<String, Object>> orders = readResponseFromEbay(response, locale, (String) context.get("productStoreId"), delegator, errorMessage);
if (orders == null) {
Debug.logError("Error :" + errorMessage.toString(), MODULE);
return ServiceUtil.returnFailure(errorMessage.toString());
@@ -213,8 +213,8 @@ public class ImportOrdersFromEbay {
private static Map<String, Object> buildGetSellerTransactionsRequest(Map<String, Object> context, StringBuffer dataItemsXml, String token) {
Locale locale = (Locale)context.get("locale");
String fromDate = (String)context.get("fromDate");
String thruDate = (String)context.get("thruDate");
String fromDate = (String) context.get("fromDate");
String thruDate = (String) context.get("thruDate");
try {
Document transDoc = UtilXml.makeEmptyXmlDocument("GetSellerTransactionsRequest");
Element transElem = transDoc.getDocumentElement();
@@ -250,8 +250,8 @@ public class ImportOrdersFromEbay {
}
public static Map<String, Object> buildCompleteSaleRequest(Delegator delegator, Locale locale, String externalId, String transactionId, Map<String, Object> context, StringBuffer dataItemsXml, String token) {
String paid = (String)context.get("paid");
String shipped = (String)context.get("shipped");
String paid = (String) context.get("paid");
String shipped = (String) context.get("shipped");
try {
if (externalId == null) {
@@ -177,7 +177,7 @@ public class ProductsExportToEbay {
Locale locale = (Locale)context.get("locale");
try {
Delegator delegator = dctx.getDelegator();
String webSiteUrl = (String)context.get("webSiteUrl");
String webSiteUrl = (String) context.get("webSiteUrl");
UtilCodec.SimpleEncoder encoder = UtilCodec.getEncoder("xml");
@@ -190,7 +190,7 @@ public class ProductsExportToEbay {
appendRequesterCredentials(itemRequestElem, itemDocument, token);
String title = prod.getString("internalName");
String qnt = (String)context.get("quantity");
String qnt = (String) context.get("quantity");
if (UtilValidate.isEmpty(qnt)) {
qnt = "1";
}
@@ -204,7 +204,7 @@ public class ProductsExportToEbay {
} else if (UtilValidate.isNotEmpty(prod.getString("productName"))) {
productDescription = prod.getString("productName");
}
String startPrice = (String)context.get("startPrice");
String startPrice = (String) context.get("startPrice");
String startPriceCurrencyUomId = null;
if (UtilValidate.isEmpty(startPrice)) {
GenericValue startPriceValue = EntityUtil.getFirst(EntityUtil.filterByDate(prod.getRelated("ProductPrice", UtilMisc.toMap("productPricePurposeId", "EBAY", "productPriceTypeId", "MINIMUM_PRICE"), null, false)));
@@ -215,7 +215,7 @@ public class ProductsExportToEbay {
}
// Buy it now is the optional value for a product that you send to eBay. Once this value is entered by user - this option allow user to win auction immediately.
String buyItNowPrice = (String)context.get("buyItNowPrice");
String buyItNowPrice = (String) context.get("buyItNowPrice");
String buyItNowCurrencyUomId = null;
if (UtilValidate.isEmpty(buyItNowPrice)) {
GenericValue buyItNowPriceValue = EntityUtil.getFirst(EntityUtil.filterByDate(prod.getRelated("ProductPrice", UtilMisc.toMap("productPricePurposeId", "EBAY", "productPriceTypeId", "MAXIMUM_PRICE"), null, false)));
@@ -227,15 +227,15 @@ public class ProductsExportToEbay {
Element itemElem = UtilXml.addChildElement(itemRequestElem, "Item", itemDocument);
UtilXml.addChildElementValue(itemElem, "Country", (String)context.get("country"), itemDocument);
String location = (String)context.get("location");
UtilXml.addChildElementValue(itemElem, "Country", (String) context.get("country"), itemDocument);
String location = (String) context.get("location");
if (UtilValidate.isNotEmpty(location)) {
UtilXml.addChildElementValue(itemElem, "Location", location, itemDocument);
}
UtilXml.addChildElementValue(itemElem, "ApplicationData", prod.getString("productId"), itemDocument);
UtilXml.addChildElementValue(itemElem, "SKU", prod.getString("productId"), itemDocument);
UtilXml.addChildElementValue(itemElem, "Title", title, itemDocument);
UtilXml.addChildElementValue(itemElem, "ListingDuration", (String)context.get("listingDuration"), itemDocument);
UtilXml.addChildElementValue(itemElem, "ListingDuration", (String) context.get("listingDuration"), itemDocument);
UtilXml.addChildElementValue(itemElem, "Quantity", qnt, itemDocument);
String listingFormat = "";
@@ -289,7 +289,7 @@ public class ProductsExportToEbay {
setPaymentMethodAccepted(itemDocument, itemElem, context);
setMiscDetails(itemDocument, itemElem, context, delegator);
String categoryCode = (String)context.get("ebayCategory");
String categoryCode = (String) context.get("ebayCategory");
String primaryCategoryId = "";
if (categoryCode != null) {
if (categoryCode.indexOf("_") != -1) {
@@ -299,7 +299,7 @@ public class ProductsExportToEbay {
} else {
primaryCategoryId = params[1];
}
}else{
} else {
primaryCategoryId = categoryCode;
}
} else {
@@ -418,19 +418,19 @@ public class ProductsExportToEbay {
*/
private static void setPaymentMethodAccepted(Document itemDocument, Element itemElem, Map<String, Object> context) {
String payPal = (String)context.get("paymentPayPal");
String payPalEmail = (String)context.get("payPalEmail");
String visaMC = (String)context.get("paymentVisaMC");
String amEx = (String)context.get("paymentAmEx");
String discover = (String)context.get("paymentDiscover");
String ccAccepted = (String)context.get("paymentCCAccepted");
String cashInPerson = (String)context.get("paymentCashInPerson");
String cashOnPickup = (String)context.get("paymentCashOnPickup");
String cod = (String)context.get("paymentCOD");
String codPrePayDelivery = (String)context.get("paymentCODPrePayDelivery");
String mocc = (String)context.get("paymentMOCC");
String moneyXferAccepted = (String)context.get("paymentMoneyXferAccepted");
String personalCheck = (String)context.get("paymentPersonalCheck");
String payPal = (String) context.get("paymentPayPal");
String payPalEmail = (String) context.get("payPalEmail");
String visaMC = (String) context.get("paymentVisaMC");
String amEx = (String) context.get("paymentAmEx");
String discover = (String) context.get("paymentDiscover");
String ccAccepted = (String) context.get("paymentCCAccepted");
String cashInPerson = (String) context.get("paymentCashInPerson");
String cashOnPickup = (String) context.get("paymentCashOnPickup");
String cod = (String) context.get("paymentCOD");
String codPrePayDelivery = (String) context.get("paymentCODPrePayDelivery");
String mocc = (String) context.get("paymentMOCC");
String moneyXferAccepted = (String) context.get("paymentMoneyXferAccepted");
String personalCheck = (String) context.get("paymentPersonalCheck");
// PayPal
if (UtilValidate.isNotEmpty(payPal) && "on".equals(payPal)) {
@@ -509,7 +509,7 @@ public class ProductsExportToEbay {
public static Map<String, Object> getEbayCategories(DispatchContext dctx, Map<String, Object> context) {
Delegator delegator = dctx.getDelegator();
Locale locale = (Locale) context.get("locale");
String categoryCode = (String)context.get("categoryCode");
String categoryCode = (String) context.get("categoryCode");
Map<String, Object> result = null;
try {
@@ -605,11 +605,11 @@ public class ProductsExportToEbay {
}
return result;
}
public static List<String> getProductExportSuccessMessageList(){
public static List<String> getProductExportSuccessMessageList() {
return productExportSuccessMessageList;
}
public static List<String> getproductExportFailureMessageList(){
public static List<String> getproductExportFailureMessageList() {
return productExportFailureMessageList;
}
}
@@ -302,7 +302,7 @@ public class EbayEvents {
return "success";
}
public static EbayStoreSiteFacade getSiteFacade(ApiContext apiContext, HttpServletRequest request) throws ApiException, SdkException, Exception{
public static EbayStoreSiteFacade getSiteFacade(ApiContext apiContext, HttpServletRequest request) throws ApiException, SdkException, Exception {
String siteFacadeName = null;
EbayStoreSiteFacade siteFacade = null;
@@ -371,7 +371,7 @@ public class EbayEvents {
}
// make ebay category list
public static List<CategoryType> getChildCategories(HttpServletRequest request) throws ApiException, SdkException, Exception{
public static List<CategoryType> getChildCategories(HttpServletRequest request) throws ApiException, SdkException, Exception {
List<CategoryType> categories = new LinkedList<CategoryType>();
EbayStoreSiteFacade sf = null;
String categoryId = null;
@@ -479,7 +479,7 @@ public class EbayEvents {
return categories;
}
public static CategoryType getCsCategoriesMapped(HttpServletRequest request) throws ApiException, SdkException, Exception{
public static CategoryType getCsCategoriesMapped(HttpServletRequest request) throws ApiException, SdkException, Exception {
EbayStoreSiteFacade sf = null;
String categoryId = null;
CategoryType cate = null;
@@ -667,7 +667,7 @@ public class EbayEvents {
valueListType = (String) paramMap.remove("categorySpecifics" + thisSuffix);
}
if ((UtilValidate.isNotEmpty(nameValueListType)) && (UtilValidate.isNotEmpty(valueListType))){
if ((UtilValidate.isNotEmpty(nameValueListType)) && (UtilValidate.isNotEmpty(valueListType))) {
nameSpecificList.add(nameValueListType);
valueSpecificList.add(valueListType);
}
@@ -987,7 +987,7 @@ public class EbayEvents {
}
}
request.setAttribute("productStoreId", requestParams.get("productStoreId"));
} catch(Exception e) {
} catch (Exception e) {
Debug.logError(e.getMessage(), MODULE);
request.setAttribute("_ERROR_MESSAGE_","Exception: ".concat(e.getMessage()));
return "error";
@@ -233,7 +233,7 @@ public class EbayStore {
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE, "EbayStorePartyWithoutRoleEbayAccount", UtilMisc.toMap("partyId", context.get("partyId").toString()), locale));
}
try {
SetStoreCategoriesCall call = new SetStoreCategoriesCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
SetStoreCategoriesCall call = new SetStoreCategoriesCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
catalogCategories = EntityQuery.use(delegator).from("ProdCatalogCategory").where("prodCatalogId", context.get("prodCatalogId").toString(),"prodCatalogCategoryTypeId","PCCT_EBAY_ROOT").orderBy("sequenceNum ASC").queryList();
if (catalogCategories != null && catalogCategories.size() > 0) {
@@ -373,7 +373,7 @@ public class EbayStore {
StoreCustomCategoryType[] storeCustomCategoryTypeArry = null;
if (list != null && list.size() > 0) {
storeCustomCategoryTypeArry = new StoreCustomCategoryType[list.size()];
int i=0;
int i = 0;
for (StoreCustomCategoryType val : list) {
storeCustomCategoryTypeArry[i] = val;
}
@@ -517,7 +517,7 @@ public class EbayStore {
UtilXml.addChildElementValue(storeRequestElem, "Action", "Add", storeDocument);
Element StoreCategoriesElem = UtilXml.addChildElement(storeRequestElem, "StoreCategories", storeDocument);
//UtilXml.addChildElementValue(StoreCategoriesElem, "Country", (String)context.get("country"), storeDocument);
//UtilXml.addChildElementValue(StoreCategoriesElem, "Country", (String) context.get("country"), storeDocument);
GenericValue category = null;
if (UtilValidate.isNotEmpty(context.get("prodCatalogId"))) {
category = EntityQuery.use(delegator).from("ProductCategory").where("productCategoryId", productCategoryId).cache().queryOne();
@@ -638,8 +638,8 @@ public class EbayStore {
e1.printStackTrace();
}
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));
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);
call.setUserID(userLoginId);
@@ -705,7 +705,7 @@ public class EbayStore {
StoreHeaderStyleCodeType[] storeHeaderStyleCodeList = StoreHeaderStyleCodeType.values();
if (storeHeaderStyleCodeList != null) {
List<Map<String, Object>> storeHeaderStyleList = new LinkedList<>();
int i=0;
int i = 0;
while (i<storeHeaderStyleCodeList.length) {
Map<String, Object> storeHeaderStyleMap = new HashMap<>();
StoreHeaderStyleCodeType storeHeaderStyleCode = storeHeaderStyleCodeList[i];
@@ -881,9 +881,9 @@ public class EbayStore {
try {
if (context.get("productStoreId") != null) {
String themeId = (String)context.get("themeId");
String themeId = (String) context.get("themeId");
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
req = new GetStoreOptionsRequestType();
resp = (GetStoreOptionsResponseType) call.execute(req);
@@ -945,7 +945,7 @@ public class EbayStore {
GetStoreOptionsResponseType resp = null;
try {
if (context.get("productStoreId") != null) {
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
req = new GetStoreOptionsRequestType();
resp = (GetStoreOptionsResponseType) call.execute(req);
@@ -990,7 +990,7 @@ public class EbayStore {
GetStoreOptionsResponseType resp = null;
try {
if (context.get("productStoreId") != null) {
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
req = new GetStoreOptionsRequestType();
resp = (GetStoreOptionsResponseType) call.execute(req);
@@ -1042,7 +1042,7 @@ public class EbayStore {
GetStoreOptionsResponseType resp = null;
try {
if (context.get("productStoreId") != null) {
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
req = new GetStoreOptionsRequestType();
resp = (GetStoreOptionsResponseType) call.execute(req);
@@ -1100,7 +1100,7 @@ public class EbayStore {
GetStoreOptionsResponseType resp = null;
try {
if (context.get("productStoreId") != null) {
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
req = new GetStoreOptionsRequestType();
resp = (GetStoreOptionsResponseType) call.execute(req);
@@ -1227,20 +1227,20 @@ public class EbayStore {
StoreType storeType = null;
try {
if (context.get("productStoreId") != null) {
SetStoreCall call = new SetStoreCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
SetStoreCall call = new SetStoreCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
req = new SetStoreRequestType();
storeType = new StoreType();
storeType.setName((String)context.get("storeName"));
storeType.setDescription((String)context.get("storeDesc"));
storeType.setURL((String)context.get("storeUrl"));
storeType.setName((String) context.get("storeName"));
storeType.setDescription((String) context.get("storeDesc"));
storeType.setURL((String) context.get("storeUrl"));
storeType.setURLPath("");
StoreLogoType storeLogo = new StoreLogoType();
if (context.get("storeLogoURL") == null) {
if (context.get("storeLogoId") != null) storeLogo.setLogoID(Integer.parseInt((String)context.get("storeLogoId")));
storeLogo.setName((String)context.get("storeLogoName"));
if (context.get("storeLogoId") != null) storeLogo.setLogoID(Integer.parseInt((String) context.get("storeLogoId")));
storeLogo.setName((String) context.get("storeLogoName"));
} else {
storeLogo.setURL((String)context.get("storeLogoURL"));
storeLogo.setURL((String) context.get("storeLogoURL"));
}
storeType.setLogo(storeLogo);
@@ -1250,20 +1250,20 @@ public class EbayStore {
StoreFontType storeFont = null;
if ("Advanced".equals(context.get("themeType"))) {
storeColorScheme = new StoreColorSchemeType();
if (context.get("storeAdvancedThemeColor") != null) storeColorScheme.setColorSchemeID(Integer.parseInt((String)context.get("storeAdvancedThemeColor")));
if (context.get("storeAdvancedThemeColor") != null) storeColorScheme.setColorSchemeID(Integer.parseInt((String) context.get("storeAdvancedThemeColor")));
storecolor = new StoreColorType();
storecolor.setPrimary((String)context.get("storePrimaryColor"));
storecolor.setSecondary((String)context.get("storeSecondaryColor"));
storecolor.setAccent((String)context.get("storeAccentColor"));
storecolor.setPrimary((String) context.get("storePrimaryColor"));
storecolor.setSecondary((String) context.get("storeSecondaryColor"));
storecolor.setAccent((String) context.get("storeAccentColor"));
storeColorScheme.setColor(storecolor);
storeTheme.setColorScheme(storeColorScheme);
storeTheme.setName(null);
storeTheme.setThemeID(Integer.parseInt((String)context.get("storeAdvancedTheme")));
storeTheme.setThemeID(Integer.parseInt((String) context.get("storeAdvancedTheme")));
} else if ("Basic".equals(context.get("themeType"))) {
storeColorScheme = new StoreColorSchemeType();
if (context.get("storeBasicTheme")!=null) {
String storeBasicTheme = (String)context.get("storeBasicTheme");
String storeBasicTheme = (String) context.get("storeBasicTheme");
String storeThemeId = null;
String storeColorSchemeId = null;
if (storeBasicTheme.indexOf("-") != -1) {
@@ -1273,23 +1273,23 @@ public class EbayStore {
if (storeColorSchemeId != null) storeColorScheme.setColorSchemeID(Integer.parseInt(storeColorSchemeId));
storecolor = new StoreColorType();
storecolor.setPrimary((String)context.get("storePrimaryColor"));
storecolor.setSecondary((String)context.get("storeSecondaryColor"));
storecolor.setAccent((String)context.get("storeAccentColor"));
storecolor.setPrimary((String) context.get("storePrimaryColor"));
storecolor.setSecondary((String) context.get("storeSecondaryColor"));
storecolor.setAccent((String) context.get("storeAccentColor"));
storeColorScheme.setColor(storecolor);
storeFont = new StoreFontType();
storeFont.setNameColor((String)context.get("storeNameFontColor"));
storeFont.setNameFace(StoreFontFaceCodeType.valueOf((String)context.get("storeNameFont")));
storeFont.setNameSize(StoreFontSizeCodeType.valueOf((String)context.get("storeNameFontSize")));
storeFont.setNameColor((String) context.get("storeNameFontColor"));
storeFont.setNameFace(StoreFontFaceCodeType.valueOf((String) context.get("storeNameFont")));
storeFont.setNameSize(StoreFontSizeCodeType.valueOf((String) context.get("storeNameFontSize")));
storeFont.setTitleColor((String)context.get("storeTitleFontColor"));
storeFont.setTitleFace(StoreFontFaceCodeType.valueOf((String)context.get("storeTitleFont")));
storeFont.setTitleSize(StoreFontSizeCodeType.valueOf((String)context.get("storeTitleFontSize")));
storeFont.setTitleColor((String) context.get("storeTitleFontColor"));
storeFont.setTitleFace(StoreFontFaceCodeType.valueOf((String) context.get("storeTitleFont")));
storeFont.setTitleSize(StoreFontSizeCodeType.valueOf((String) context.get("storeTitleFontSize")));
storeFont.setDescColor((String)context.get("storeDescFontColor"));
storeFont.setDescFace(StoreFontFaceCodeType.valueOf((String)context.get("storeDescFont")));
storeFont.setDescSize(StoreFontSizeCodeType.valueOf((String)context.get("storeDescFontSize")));
storeFont.setDescColor((String) context.get("storeDescFontColor"));
storeFont.setDescFace(StoreFontFaceCodeType.valueOf((String) context.get("storeDescFont")));
storeFont.setDescSize(StoreFontSizeCodeType.valueOf((String) context.get("storeDescFontSize")));
storeColorScheme.setFont(storeFont);
@@ -1299,14 +1299,14 @@ public class EbayStore {
}
}
storeType.setTheme(storeTheme);
storeType.setHeaderStyle(StoreHeaderStyleCodeType.valueOf((String)context.get("storeHeaderStyle")));
storeType.setItemListLayout(StoreItemListLayoutCodeType.valueOf((String)context.get("storeItemLayout")));
storeType.setItemListSortOrder(StoreItemListSortOrderCodeType.valueOf((String)context.get("storeItemSortOrder")));
storeType.setMerchDisplay(MerchDisplayCodeType.valueOf((String)context.get("storeMerchDisplay")));
storeType.setSubscriptionLevel(StoreSubscriptionLevelCodeType.valueOf((String)context.get("storeSubscriptionDisplay")));
storeType.setHeaderStyle(StoreHeaderStyleCodeType.valueOf((String) context.get("storeHeaderStyle")));
storeType.setItemListLayout(StoreItemListLayoutCodeType.valueOf((String) context.get("storeItemLayout")));
storeType.setItemListSortOrder(StoreItemListSortOrderCodeType.valueOf((String) context.get("storeItemSortOrder")));
storeType.setMerchDisplay(MerchDisplayCodeType.valueOf((String) context.get("storeMerchDisplay")));
storeType.setSubscriptionLevel(StoreSubscriptionLevelCodeType.valueOf((String) context.get("storeSubscriptionDisplay")));
storeType.setCustomHeader((String)context.get("storeCustomHeader"));
storeType.setCustomHeaderLayout(StoreCustomHeaderLayoutCodeType.valueOf((String)context.get("storeCustomHeaderLayout")));
storeType.setCustomHeader((String) context.get("storeCustomHeader"));
storeType.setCustomHeaderLayout(StoreCustomHeaderLayoutCodeType.valueOf((String) context.get("storeCustomHeaderLayout")));
req.setStore(storeType);
resp = (SetStoreResponseType) call.execute(req);
@@ -1709,7 +1709,7 @@ public class EbayStore {
try {
String itemId = (String) context.get("itemId");
String transactionId = (String) context.get("transactionId");
DisputeReasonCodeType drct = EbayStore.getEbayDisputeReasonCodeType((String)context.get("disputeReasonCodeType"));
DisputeReasonCodeType drct = EbayStore.getEbayDisputeReasonCodeType((String) context.get("disputeReasonCodeType"));
DisputeExplanationCodeType dect = EbayStore.getEbayDisputeExplanationCodeType((String) context.get("disputeExplanationCodeType"));
DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] {
DetailLevelCodeType.RETURN_ALL,
@@ -2074,7 +2074,7 @@ public class EbayStore {
return colsList;
}
public static Map<String, Object> getTransaction(TransactionType transaction){
public static Map<String, Object> getTransaction(TransactionType transaction) {
Map<String, Object> cols = new HashMap<>();
ItemType item = transaction.getItem();
String itemId = null;
@@ -2467,7 +2467,7 @@ public class EbayStore {
if (product != null) {
checkResult = true;
}
} catch(GenericEntityException e) {
} catch (GenericEntityException e) {
return false;
}
return checkResult;
@@ -31,7 +31,7 @@ import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.LocalDispatcher;
public class EbayStoreAutoPrefEvents{
public class EbayStoreAutoPrefEvents {
private static final String MODULE = EbayStoreAutoPrefEvents.class.getName();
@@ -1077,7 +1077,7 @@ public class EbayStoreAutoPreferences {
GetSellingManagerInventoryResponseType resp = null;
if (context.get("productStoreId") != null) {
GetSellingManagerInventoryCall call = new GetSellingManagerInventoryCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
GetSellingManagerInventoryCall call = new GetSellingManagerInventoryCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
try {
SellingManagerProductType[] returnedSellingManagerProductType = null;
@@ -1379,9 +1379,9 @@ public class EbayStoreAutoPreferences {
}
}
}
} catch (ApiException e){
} catch (ApiException e) {
return ServiceUtil.returnError(e.getMessage());
}catch(Exception e){
} catch (Exception e) {
return ServiceUtil.returnError(e.getMessage());
}
return ServiceUtil.returnSuccess();
@@ -416,7 +416,7 @@ public class EbayStoreHelper {
item.setShipToLocations(tempShipLocation);
}
}
} catch(Exception e) {
} catch (Exception e) {
Debug.logError(e.getMessage(), MODULE);
}
}
@@ -86,11 +86,11 @@ public class EbayStoreInventoryServices {
return result;
}
String productId = (String)context.get("productId");
String folderId = (String)context.get("folderId");
String productId = (String) context.get("productId");
String folderId = (String) context.get("folderId");
// start upload/update products which selected to an ebay inventory
if (folderId != null) {
GetSellingManagerInventoryCall invenCall = new GetSellingManagerInventoryCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
GetSellingManagerInventoryCall invenCall = new GetSellingManagerInventoryCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
invenReq = new GetSellingManagerInventoryRequestType();
invenResp = (GetSellingManagerInventoryResponseType) invenCall.execute(invenReq);
if (invenResp != null && "SUCCESS".equals(invenResp.getAck().toString())) {
@@ -143,9 +143,9 @@ public class EbayStoreInventoryServices {
try {
if (context.get("productStoreId") != null && context.get("productId") != null && context.get("folderId") != null) {
String productId = (String)context.get("productId");
String folderId = (String)context.get("folderId");
AddSellingManagerProductCall productCall = new AddSellingManagerProductCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
String productId = (String) context.get("productId");
String folderId = (String) context.get("folderId");
AddSellingManagerProductCall productCall = new AddSellingManagerProductCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
productReq = new AddSellingManagerProductRequestType();
productReq.setFolderID(new Long(folderId));
SellingManagerProductDetailsType sellingManagerProductDetailsType = new SellingManagerProductDetailsType();
@@ -187,9 +187,9 @@ public class EbayStoreInventoryServices {
try {
if (context.get("productStoreId") != null && context.get("productId") != null && context.get("folderId") != null) {
String productId = (String)context.get("productId");
String folderId = (String)context.get("folderId");
ReviseSellingManagerProductCall call = new ReviseSellingManagerProductCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
String productId = (String) context.get("productId");
String folderId = (String) context.get("folderId");
ReviseSellingManagerProductCall call = new ReviseSellingManagerProductCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
req = new ReviseSellingManagerProductRequestType();
SellingManagerProductDetailsType sellingManagerProductDetailsType = new SellingManagerProductDetailsType();
GenericValue ebayProductStoreInventory = EntityQuery.use(delegator).from("EbayProductStoreInventory").where("productId", productId, "facilityId", context.get("facilityId"), "productStoreId", context.get("productStoreId")).queryOne();
@@ -239,7 +239,7 @@ public class EbayStoreInventoryServices {
try {
if (context.get("productStoreId") != null) {
GetSellingManagerInventoryFolderCall call = new GetSellingManagerInventoryFolderCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
GetSellingManagerInventoryFolderCall call = new GetSellingManagerInventoryFolderCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
req = new GetSellingManagerInventoryFolderRequestType();
resp = (GetSellingManagerInventoryFolderResponseType) call.execute(req);
if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
@@ -282,7 +282,7 @@ public class EbayStoreInventoryServices {
try {
if (context.get("productStoreId") != null) {
AddSellingManagerInventoryFolderCall call = new AddSellingManagerInventoryFolderCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
AddSellingManagerInventoryFolderCall call = new AddSellingManagerInventoryFolderCall(EbayStoreHelper.getApiContext((String) context.get("productStoreId"), locale, delegator));
req = new AddSellingManagerInventoryFolderRequestType();
req.setFolderName(defaultFolderName);//req.setComment(value);//req.setParentFolderID(value)
resp = (AddSellingManagerInventoryFolderResponseType) call.execute(req);
@@ -306,10 +306,10 @@ public class EbayStoreInventoryServices {
GenericValue userLogin = (GenericValue) context.get("userLogin");
Map<String, Object> result = new HashMap<>();
Delegator delegator = dctx.getDelegator();
String productStoreId = (String)context.get("productStoreId");
String facilityId = (String)context.get("facilityId");
String folderId = (String)context.get("folderId");
String productId = (String)context.get("productId");
String productStoreId = (String) context.get("productStoreId");
String facilityId = (String) context.get("facilityId");
String folderId = (String) context.get("folderId");
String productId = (String) context.get("productId");
String ebayProductId = null;
GetSellingManagerInventoryRequestType req = null;
GetSellingManagerInventoryResponseType resp = null;
@@ -364,10 +364,10 @@ public class EbayStoreInventoryServices {
try {
if (context.get("productStoreId") != null && context.get("facilityId") != null) {
ebayProductStoreInventoryList = EntityQuery.use(delegator).from("EbayProductStoreInventory").where("facilityId", (String)context.get("facilityId"),"productStoreId", (String)context.get("productStoreId")).queryList();
ebayProductStoreInventoryList = EntityQuery.use(delegator).from("EbayProductStoreInventory").where("facilityId", (String) context.get("facilityId"),"productStoreId", (String) context.get("productStoreId")).queryList();
for (GenericValue ebayProductStoreInventory : ebayProductStoreInventoryList) {
if (ebayProductStoreInventory.get("ebayProductId") != null) {
Map<String, Object> result = dispatcher.runSync("updateEbayInventoryStatusByProductId", UtilMisc.toMap("productStoreId", (String)context.get("productStoreId"), "facilityId", (String)context.get("facilityId"), "folderId", ebayProductStoreInventory.get("folderId"), "productId", ebayProductStoreInventory.get("productId"), "ebayProductId", ebayProductStoreInventory.get("ebayProductId"), "userLogin", context.get("userLogin")));
Map<String, Object> result = dispatcher.runSync("updateEbayInventoryStatusByProductId", UtilMisc.toMap("productStoreId", (String) context.get("productStoreId"), "facilityId", (String) context.get("facilityId"), "folderId", ebayProductStoreInventory.get("folderId"), "productId", ebayProductStoreInventory.get("productId"), "ebayProductId", ebayProductStoreInventory.get("ebayProductId"), "userLogin", context.get("userLogin")));
if (ServiceUtil.isError(result)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));
}
@@ -80,7 +80,7 @@ public class EbayStoreOptions {
returnedBasicThemeArray = resp.getBasicThemeArray();
StoreThemeType[] storeBasicTheme = returnedBasicThemeArray.getTheme();
int i=0;
int i = 0;
String colorSchemeId = themeId.substring(themeId.indexOf("-")+1);
themeId = themeId.substring(0, themeId.indexOf("-"));
@@ -186,7 +186,7 @@ public class JanrainHelper {
}
}
public static String janrainCheckLogin(HttpServletRequest request, HttpServletResponse response){
public static String janrainCheckLogin(HttpServletRequest request, HttpServletResponse response) {
Delegator delegator = (Delegator) request.getAttribute("delegator");
String token = request.getParameter("token");
String errMsg = "";
@@ -44,8 +44,8 @@ public class ExampleWebSockets {
try {
if (session.isOpen()) {
synchronized (clients) {
for(Session client : clients){
if (!client.equals(session)){
for (Session client : clients) {
if (!client.equals(session)) {
client.getBasicRemote().sendText(msg);
}
}
@@ -115,12 +115,12 @@ public class FirstDataPaymentServices {
String responseString = EntityUtils.toString(entity);
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> convertedMap = objectMapper.readValue(responseString, new TypeReference<Map<String, Object>>(){});
Map<String, Object> convertedMap = objectMapper.readValue(responseString, new TypeReference<Map<String, Object>>() {});
String transactionStatus = (String) convertedMap.get("transactionStatus");
String transactionId = (String) convertedMap.get("ipgTransactionId");
String fdOrderId = (String) convertedMap.get("orderId");
Map<String, Object> processor = objectMapper.convertValue(convertedMap.get("processor"), new TypeReference<Map<String, Object>>(){});
Map<String, Object> processor = objectMapper.convertValue(convertedMap.get("processor"), new TypeReference<Map<String, Object>>() {});
String gatewayMessage = (String) processor.get("responseMessage");
int statusCode = response.getStatusLine().getStatusCode();
result.put("authCode", String.valueOf(statusCode));
@@ -196,12 +196,12 @@ public class FirstDataPaymentServices {
String responseString = EntityUtils.toString(entity);
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> convertedMap = objectMapper.readValue(responseString, new TypeReference<Map<String, Object>>(){});
Map<String, Object> convertedMap = objectMapper.readValue(responseString, new TypeReference<Map<String, Object>>() {});
String transactionStatus = (String) convertedMap.get("transactionStatus");
String transactionId = (String) convertedMap.get("ipgTransactionId");
String fdOrderId = (String) convertedMap.get("orderId");
Map<String, Object> processor = objectMapper.convertValue(convertedMap.get("processor"), new TypeReference<Map<String, Object>>(){});
Map<String, Object> processor = objectMapper.convertValue(convertedMap.get("processor"), new TypeReference<Map<String, Object>>() {});
String gatewayMessage = (String) processor.get("responseMessage");
int statusCode = response.getStatusLine().getStatusCode();
result.put("captureCode", String.valueOf(statusCode));
@@ -280,12 +280,12 @@ public class FirstDataPaymentServices {
String responseString = EntityUtils.toString(entity);
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> convertedMap = objectMapper.readValue(responseString, new TypeReference<Map<String, Object>>(){});
Map<String, Object> convertedMap = objectMapper.readValue(responseString, new TypeReference<Map<String, Object>>() {});
String transactionStatus = (String) convertedMap.get("transactionStatus");
String transactionId = (String) convertedMap.get("ipgTransactionId");
String fdOrderId = (String) convertedMap.get("orderId");
Map<String, Object> processor = objectMapper.convertValue(convertedMap.get("processor"), new TypeReference<Map<String, Object>>(){});
Map<String, Object> processor = objectMapper.convertValue(convertedMap.get("processor"), new TypeReference<Map<String, Object>>() {});
String gatewayMessage = (String) processor.get("responseMessage");
int statusCode = response.getStatusLine().getStatusCode();
result.put("refundCode", String.valueOf(statusCode));
@@ -360,12 +360,12 @@ public class FirstDataPaymentServices {
String responseString = EntityUtils.toString(entity);
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> convertedMap = objectMapper.readValue(responseString, new TypeReference<Map<String, Object>>(){});
Map<String, Object> convertedMap = objectMapper.readValue(responseString, new TypeReference<Map<String, Object>>() {});
String transactionStatus = (String) convertedMap.get("transactionStatus");
String transactionId = (String) convertedMap.get("ipgTransactionId");
String fdOrderId = (String) convertedMap.get("orderId");
Map<String, Object> processor = objectMapper.convertValue(convertedMap.get("processor"), new TypeReference<Map<String, Object>>(){});
Map<String, Object> processor = objectMapper.convertValue(convertedMap.get("processor"), new TypeReference<Map<String, Object>>() {});
String gatewayMessage = (String) processor.get("responseMessage");
int statusCode = response.getStatusLine().getStatusCode();
result.put("releaseCode", String.valueOf(statusCode));
@@ -184,7 +184,7 @@ public final class OFBizCasAuthenticationHandler extends AbstractOFBizAuthentica
String casUrl = UtilXml.childElementValue(rootElement, "CasUrl", "https://localhost:8443/cas");
Cookie[] cookies = request.getCookies();
if (cookies == null) return true;
for (int i=0; i < cookies.length; i++) {
for (int i = 0; i < cookies.length; i++) {
Cookie cookie = cookies[i];
if (cookie.getName().equals(casTGC) && casUrl.indexOf(cookie.getDomain()) > -1) {
return false;
@@ -88,7 +88,7 @@ public class DocumentIndexer extends Thread {
try {
indexWriter.close();
indexWriter = null;
} catch(IOException ioe) {
} catch (IOException ioe) {
Debug.logError(ioe, MODULE);
}
}
@@ -121,13 +121,13 @@ public class DocumentIndexer extends Thread {
indexWriter.updateDocument(documentIdentifier, document);
if (Debug.infoOn()) Debug.logInfo(getName() + ": indexed Lucene document: " + ofbizDocument, MODULE);
}
} catch(Exception e) {
} catch (Exception e) {
Debug.logError(e, getName() + ": error processing Lucene document: " + ofbizDocument, MODULE);
if (documentIndexQueue.peek() == null) {
try {
indexWriter.close();
indexWriter = null;
} catch(IOException ioe) {
} catch (IOException ioe) {
Debug.logError(ioe, MODULE);
}
}
@@ -43,7 +43,7 @@ public final class SearchWorker {
private static final Version LUCENE_VERSION = Version.LUCENE_8_5_0;
private SearchWorker() {}
private SearchWorker() { }
public static void indexContentTree(LocalDispatcher dispatcher, Delegator delegator, String siteId) throws Exception {
GenericValue content = delegator.makeValue("Content", UtilMisc.toMap("contentId", siteId));
@@ -40,7 +40,6 @@ public class Msg91Services {
public static Map<String, Object> sendMsg91Sms(DispatchContext ctx, Map<String, ? extends Object> context) {
Delegator delegator = ctx.getDelegator();
Map<String, Object> result = ServiceUtil.returnSuccess();
List<String> numbers = UtilGenerics.cast(context.get("numbers"));
String message = (String) context.get("message");
@@ -1272,7 +1272,6 @@ public class HtmlReport extends AbstractReport {
public String dialogEnd() {
return dialog(HTML_END, null);
}
/**
* Returns the http URI of the current dialog, to be used
* as value for the "action" attribute of a html form.<p>
@@ -1284,7 +1283,6 @@ public class HtmlReport extends AbstractReport {
public String getDialogRealUri(HttpServletRequest request) {
return String.valueOf(request.getAttribute(DIALOG_URI));
}
/**
* Set the report form uri.
*
@@ -1294,7 +1292,6 @@ public class HtmlReport extends AbstractReport {
public void setFormRealUri(HttpServletRequest request, String formUri) {
request.setAttribute(FORM_URI, formUri);
}
/**
* Get the report form uri.
*
@@ -1304,7 +1301,6 @@ public class HtmlReport extends AbstractReport {
public String getFormRealUri(HttpServletRequest request) {
return (String) request.getAttribute(FORM_URI);
}
@Override
public void addLogFile(String logFileName) {
if (logFile == null || logFileOutputStream == null) {
@@ -1317,7 +1313,6 @@ public class HtmlReport extends AbstractReport {
}
}
}
@Override
public String closeLogFile() {
if (logFileOutputStream != null) {
@@ -1338,16 +1333,13 @@ public class HtmlReport extends AbstractReport {
}
return logFileName;
}
public String getLogFileName() {
return logFileName;
}
@Override
public long getSequenceNum() {
return sequenceNum;
}
@Override
public void setSequenceNum(long sequenceNum) {
this.sequenceNum = sequenceNum;
@@ -322,7 +322,7 @@ public class PricatParseExcelHtmlThread extends AbstractReportThread {
}
}
}
}catch (GenericEntityException e) {
} catch (GenericEntityException e) {
Debug.logError(e.getMessage(), MODULE);
}
return facilities;
@@ -83,7 +83,7 @@ public class SamplePricatParser extends AbstractPricatParser {
try {
workbook = new XSSFWorkbook(is);
report.println(UtilProperties.getMessage(RESOURCE, "ok", locale), InterfaceReport.FORMAT_OK);
} catch(IOException e) {
} catch (IOException e) {
report.println(e);
report.println(UtilProperties.getMessage(RESOURCE, "PricatSuggestion", locale), InterfaceReport.FORMAT_ERROR);
return;
@@ -170,7 +170,7 @@ public class SamplePricatParser extends AbstractPricatParser {
errorMessages.put(new CellReference(currencyIdCell), errorMessage);
return false;
}
} catch(GenericEntityException e) {
} catch (GenericEntityException e) {
String errorMessage = UtilProperties.getMessage(RESOURCE, "CurrencyIdNotFound", new Object[] {currencyId}, locale);
report.println(errorMessage, InterfaceReport.FORMAT_ERROR);
errorMessages.put(new CellReference(currencyIdCell), errorMessage);
@@ -469,7 +469,7 @@ public class SamplePricatParser extends AbstractPricatParser {
* @param version
* @return List of Object[]
*/
private static List<Object[]> genExcelHeaderNames(String version){
private static List<Object[]> genExcelHeaderNames(String version) {
switch (version) {
case "V1.1":
default:
@@ -41,7 +41,7 @@ public final class CategoryUtil {
private static final String MODULE = CategoryUtil.class.getName();
private CategoryUtil () {}
private CategoryUtil() { }
/**
* Gets catalog IDs for specified product category.
@@ -130,7 +130,7 @@ public final class CategoryUtil {
for (List<String> trailElement : trailElements) {
for (Iterator<String> trailIter = trailElement.iterator(); trailIter.hasNext();) {
String trailString = trailIter.next();
if (catMember.length() > 0){
if (catMember.length() > 0) {
catMember.append("/");
i++;
}
@@ -139,10 +139,11 @@ public final class CategoryUtil {
}
}
if (catMember.length() == 0){catMember.append(productCategoryId);}
if (catMember.length() == 0) {
catMember.append(productCategoryId);
}
if (showDepth) {
cm = i +"/"+ catMember.toString();
cm = i + "/" + catMember.toString();
} else {
cm = catMember.toString();
}
@@ -155,7 +156,7 @@ public final class CategoryUtil {
* Ie for "1/SYRACUS2_CATEGORY/FICTION_C/" the returned value would be 2.
*/
public static int getNextLevelFromCategoryId(String productCategoryId, DispatchContext dctx) {
try{
try {
if (productCategoryId.contains("/")) {
String[] productCategories = productCategoryId.split("/");
int level = Integer.parseInt(productCategories[0]);
@@ -163,7 +164,7 @@ public final class CategoryUtil {
} else {
return 0;
}
} catch(Exception e) {
} catch (Exception e) {
return 0;
}
}
@@ -175,13 +176,13 @@ public final class CategoryUtil {
* "2/SYRACUS2_CATEGORY/FICTION_C/".
*/
public static String getFacetFilterForCategory(String productCategoryId, DispatchContext dctx) {
try{
try {
String[] productCategories = productCategoryId.split("/");
int level = Integer.parseInt(productCategories[0]);
int nextLevel = level+1;
productCategories[0] = ""+nextLevel;
return StringUtils.join(productCategories,"/");
} catch(Exception e) {
int nextLevel = level + 1;
productCategories[0] = "" + nextLevel;
return StringUtils.join(productCategories, "/");
} catch (Exception e) {
return productCategoryId;
}
}
@@ -47,7 +47,7 @@ import org.apache.ofbiz.service.ServiceUtil;
public final class ProductUtil {
private static final String MODULE = ProductUtil.class.getName();
private ProductUtil () {}
private ProductUtil() { }
public static Map<String, Object> getProductContent(GenericValue product, DispatchContext dctx, Map<String, Object> context) {
GenericDelegator delegator = (GenericDelegator) dctx.getDelegator();
@@ -98,7 +98,7 @@ public final class ProductUtil {
while (trailIter.hasNext()) {
String trailString = trailIter.next();
if (catMember.length() > 0){
if (catMember.length() > 0) {
catMember.append("/");
i++;
}
@@ -339,7 +339,7 @@ public abstract class SolrProductSearch {
solrQuery.setFields((String) context.get("returnFields"));
}
// if ((Boolean)context.get("sortByReverse"))order.reverse();
// if ((Boolean) context.get("sortByReverse"))order.reverse();
if ((String) context.get("sortBy") != null && ((String) context.get("sortBy")).length() > 0) {
SolrQuery.ORDER order;
if (!((Boolean) context.get("sortByReverse")))
@@ -52,7 +52,7 @@ import org.apache.ofbiz.entity.GenericEntityException;
*/
public final class SolrUtil {
private SolrUtil() {}
private SolrUtil() { }
private static final String MODULE = SolrUtil.class.getName();
private static final String[] solrProdAttribute = { "productId", "internalName", "manu", "size", "smallImage", "mediumImage", "largeImage", "listPrice", "defaultPrice", "inStock", "isVirtual" };
@@ -138,14 +138,13 @@ public final class SolrUtil {
WebappInfo solrApp = null;
try {
ComponentConfig cc = ComponentConfig.getComponentConfig("solr");
for(WebappInfo currApp : cc.getWebappInfos()) {
for (WebappInfo currApp : cc.getWebappInfos()) {
if ("solr".equals(currApp.getName())) {
solrApp = currApp;
break;
}
}
}
catch(ComponentException e) {
} catch (ComponentException e) {
throw new IllegalStateException(e);
}
return solrApp;
@@ -268,7 +267,7 @@ public final class SolrUtil {
solrQuery.setRows(0);
}
if (UtilValidate.isNotEmpty(facetPrefix)){
if (UtilValidate.isNotEmpty(facetPrefix)) {
solrQuery.setFacetPrefix(facetPrefix);
}
@@ -27,7 +27,7 @@ import org.apache.ofbiz.webapp.control.LoginWorker;
/**
* OFBiz Solr Login Workers
*/
public final class OFBizSolrLoginWorker{
public final class OFBizSolrLoginWorker {
private final static String MODULE = OFBizSolrLoginWorker.class.getName();
protected OFBizSolrLoginWorker() { }
@@ -73,7 +73,7 @@ public class SolrTests extends OFBizTestCase {
}
public void testAddToSolrIndex() throws Exception{
public void testAddToSolrIndex() throws Exception {
context = new HashMap<>();
context.put("productId", validTestProductId);
response = dispatcher.runSync("addToSolrIndex", context);
@@ -198,7 +198,7 @@ public class WebPosEvents {
request.setAttribute("variantTree", variantTree);
request.setAttribute("variantTreeSize", variantTree.size());
List<String> featureOrder = new LinkedList<>(featureSet);
for (int i=0; i < featureOrder.size(); i++) {
for (int i = 0; i < featureOrder.size(); i++) {
String featureKey = featureOrder.get(i);
GenericValue featureValue = EntityQuery.use(delegator).from("ProductFeatureType").where("productFeatureTypeId", featureOrder.get(i)).cache().queryOne();
if (featureValue != null &&
@@ -42,7 +42,7 @@ import org.apache.ofbiz.service.ServiceUtil;
public class WebPosSearch {
private static final String MODULE = WebPosSearch.class.getName();
public static Map<String, Object> findProducts(DispatchContext dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
String searchByProductIdValue = (String) context.get("searchByProductIdValue");
@@ -50,11 +50,10 @@ public class WebPosSearch {
String searchByProductDescription = (String) context.get("searchByProductDescription");
String goodIdentificationTypeId = (String) context.get("goodIdentificationTypeId");
Map<String, Object> result = ServiceUtil.returnSuccess();
List<EntityCondition> andExprs = new LinkedList<>();
EntityCondition mainCond = null;
String entityName = "Product";
// search by product name
if (UtilValidate.isNotEmpty(searchByProductName)) {
searchByProductName = searchByProductName.toUpperCase().trim();
@@ -84,7 +83,6 @@ public class WebPosSearch {
result.put("productsList", products);
return result;
}
public static Map<String, Object> findParties(DispatchContext dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
String searchByPartyLastName = (String) context.get("searchByPartyLastName");
@@ -94,12 +92,12 @@ public class WebPosSearch {
String billingLocation = (String) context.get("billingLocation");
String shippingLocation = (String) context.get("shippingLocation");
Map<String, Object> result = ServiceUtil.returnSuccess();
List<EntityCondition> andExprs = new LinkedList<>();
List<EntityCondition> orExprs = new LinkedList<>();
EntityCondition mainCond = null;
List<String> orderBy = new LinkedList<>();
// default view settings
DynamicViewEntity dynamicView = new DynamicViewEntity();
dynamicView.addMemberEntity("PT", "Party");
@@ -132,29 +130,23 @@ public class WebPosSearch {
dynamicView.addAlias("PA", "countryGeoId");
dynamicView.addAlias("PA", "stateProvinceGeoId");
dynamicView.addViewLink("CM", "PA", Boolean.TRUE, ModelKeyMap.makeKeyMapList("contactMechId"));
if (UtilValidate.isNotEmpty(billingLocation) && "Y".equalsIgnoreCase(billingLocation)) {
orExprs.add(EntityCondition.makeCondition("contactMechPurposeTypeId", EntityOperator.EQUALS, "BILLING_LOCATION"));
}
if (UtilValidate.isNotEmpty(shippingLocation) && "Y".equalsIgnoreCase(shippingLocation)) {
orExprs.add(EntityCondition.makeCondition("contactMechPurposeTypeId", EntityOperator.EQUALS, "SHIPPING_LOCATION"));
}
if (orExprs.size() > 0) {
andExprs.add(EntityCondition.makeCondition(orExprs, EntityOperator.OR));
}
andExprs.add(EntityCondition.makeCondition("partyTypeId", EntityOperator.EQUALS, "PERSON"));
andExprs.add(EntityCondition.makeCondition("contactMechTypeId", EntityOperator.EQUALS, "POSTAL_ADDRESS"));
if (UtilValidate.isNotEmpty(shippingLocation) && "N".equalsIgnoreCase(shippingLocation) && UtilValidate.isNotEmpty(billingLocation) && "N".equalsIgnoreCase(billingLocation)) {
andExprs.add(EntityCondition.makeCondition("contactMechPurposeTypeId", EntityOperator.IN, UtilMisc.toList("SHIPPING_LOCATION", "BILLING_LOCATION")));
}
mainCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND);
orderBy.add("lastName");
orderBy.add("firstName");
// search by last name
if (UtilValidate.isNotEmpty(searchByPartyLastName)) {
searchByPartyLastName = searchByPartyLastName.toUpperCase().trim();