|
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java Fri Jan 15 21:00:23 2010 @@ -48,11 +48,11 @@ public static final String resourceErr = "AccountingErrorUiLabels"; public static final String module = ExpressCheckoutEvents.class.getName(); public static enum CheckoutType {PAYFLOW, STANDARD, NONE}; - + public static String setExpressCheckout(HttpServletRequest request, HttpServletResponse response) { Locale locale = UtilHttp.getLocale(request); LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); - + ShoppingCart cart = ShoppingCartEvents.getCartObject(request); CheckoutType checkoutType = determineCheckoutType(request); if (!checkoutType.equals(CheckoutType.NONE)) { @@ -98,7 +98,7 @@ } return "success"; } - + public static String expressCheckoutUpdate(HttpServletRequest request, HttpServletResponse response) { LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); CheckoutType checkoutType = determineCheckoutType(request); @@ -118,7 +118,7 @@ public static String getExpressCheckoutDetails(HttpServletRequest request, HttpServletResponse response) { Locale locale = UtilHttp.getLocale(request); LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); - + ShoppingCart cart = ShoppingCartEvents.getCartObject(request); CheckoutType checkoutType = determineCheckoutType(request); if (!checkoutType.equals(CheckoutType.NONE)) { @@ -142,10 +142,10 @@ return "error"; } } - + return "success"; } - + public static Map<String, Object> doExpressCheckout(String productStoreId, String orderId, GenericValue paymentPref, GenericValue userLogin, Delegator delegator, LocalDispatcher dispatcher) { CheckoutType checkoutType = determineCheckoutType(delegator, productStoreId); if (!checkoutType.equals(CheckoutType.NONE)) { @@ -166,7 +166,7 @@ } return result; } - + return ServiceUtil.returnSuccess(); } @@ -205,5 +205,5 @@ } return CheckoutType.NONE; } - + } \ No newline at end of file Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Fri Jan 15 21:00:23 2010 @@ -121,9 +121,9 @@ sendMailParams.put("subject", communicationEvent.getString("subject")); sendMailParams.put("contentType", communicationEvent.getString("contentMimeTypeId")); sendMailParams.put("userLogin", userLogin); - + Debug.logInfo("Sending communicationEvent: " + communicationEventId, module); - + // check for attachments boolean isMultiPart = false; List <GenericValue> comEventContents = communicationEvent.getRelated("CommEventContentAssoc"); @@ -159,7 +159,7 @@ String errMsg = UtilProperties.getMessage(resource,"commeventservices.communication_event_to_contact_mech_must_be_email", locale); return ServiceUtil.returnError(errMsg + " " + communicationEventId); } - + // add other parties from roles String sendCc = null; String sendBcc = null; @@ -303,16 +303,16 @@ EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "CLPT_ACCEPTED"), EntityCondition.makeCondition("preferredContactMechId", EntityOperator.NOT_EQUAL, null), EntityUtil.getFilterByDateExpr(), EntityUtil.getFilterByDateExpr("contactFromDate", "contactThruDate")); - + EntityConditionList<EntityCondition> conditions = EntityCondition.makeCondition(conditionList, EntityOperator.AND); Set<String> fieldsToSelect = UtilMisc.toSet("infoString"); eli = delegator.find("ContactListPartyAndContactMech", conditions, null, fieldsToSelect, null, new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true)); - - // Send an email to each contact list member + + // Send an email to each contact list member List<String> orderBy = UtilMisc.toList("-fromDate"); - + // loop through the list iterator for (GenericValue contactListPartyAndContactMech; (contactListPartyAndContactMech = eli.next()) != null;) { Debug.logInfo("Contact info: " + contactListPartyAndContactMech, module); @@ -363,7 +363,7 @@ // No attempt has been made previously to send to this address, so create a record to reflect // the beginning of the current attempt Map<String, String> newContactListCommStatusRecordMap = UtilMisc.makeMapWritable(contactListCommStatusRecordMap); - newContactListCommStatusRecordMap.put("statusId", "COM_IN_PROGRESS"); + newContactListCommStatusRecordMap.put("statusId", "COM_IN_PROGRESS"); newContactListCommStatusRecordMap.put("partyId", partyId); contactListCommStatusRecord = delegator.create("ContactListCommStatus", newContactListCommStatusRecordMap); } else if (contactListCommStatusRecord.get("statusId") != null && contactListCommStatusRecord.getString("statusId").equals("COM_COMPLETE")) { @@ -377,9 +377,9 @@ Map<String, Object> tmpResult = dispatcher.runSync("sendMail", sendMailParams, 360, true); if (tmpResult == null || ServiceUtil.isError(tmpResult)) { if (ServiceUtil.getErrorMessage(tmpResult).startsWith("[ADDRERR]")) { - // address error; mark the communication event as BOUNCED + // address error; mark the communication event as BOUNCED contactListCommStatusRecord.set("statusId", "COM_BOUNCED"); - try { + try { contactListCommStatusRecord.store(); } catch (GenericEntityException e) { Debug.logError(e, module); @@ -406,11 +406,11 @@ } else { // attach the parent communication event to the new event created when sending the mail String thisCommEventId = (String) tmpResult.get("communicationEventId"); - GenericValue thisCommEvent = delegator.findOne("CommunicationEvent", false, "communicationEventId", thisCommEventId); + GenericValue thisCommEvent = delegator.findOne("CommunicationEvent", false, "communicationEventId", thisCommEventId); if (thisCommEvent != null) { thisCommEvent.set("contactListId", contactListId); thisCommEvent.set("parentCommEventId", communicationEventId); - thisCommEvent.store(); + thisCommEvent.store(); } String messageId = (String) tmpResult.get("messageId"); //contactListCommStatusRecord.set("communicationEventId", thisCommEventId); @@ -453,7 +453,7 @@ try { eli.close(); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, module); } } } @@ -480,25 +480,25 @@ } /* - * Store an outgoing email as a communication event; + * Store an outgoing email as a communication event; * runs as a pre-invoke ECA on sendMail and sendMultipartMail services * - service should run as the 'system' user */ public static Map<String, Object> createCommEventFromEmail(DispatchContext dctx, Map<String, ? extends Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - + GenericValue userLogin = (GenericValue) context.get("userLogin"); String subject = (String) context.get("subject"); String sendFrom = (String) context.get("sendFrom"); String sendTo = (String) context.get("sendTo"); - String partyId = (String) context.get("partyId"); - String contentType = (String) context.get("contentType"); + String partyId = (String) context.get("partyId"); + String contentType = (String) context.get("contentType"); String statusId = (String) context.get("statusId"); if (statusId == null) { statusId = "COM_PENDING"; } - + // get the from contact mech info String contactMechIdFrom = null; String partyIdFrom = null; @@ -515,7 +515,7 @@ contactMechIdFrom = fromCm.getString("contactMechId"); partyIdFrom = fromCm.getString("partyId"); } - + // get the to contact mech info String contactMechIdTo = null; GenericValue toCm; @@ -530,25 +530,25 @@ if (toCm != null) { contactMechIdTo = toCm.getString("contactMechId"); } - + Timestamp now = UtilDateTime.nowTimestamp(); - + Map<String, Object> commEventMap = FastMap.newInstance(); commEventMap.put("communicationEventTypeId", "EMAIL_COMMUNICATION"); commEventMap.put("contactMechTypeId", "EMAIL_ADDRESS"); commEventMap.put("contactMechIdFrom", contactMechIdFrom); commEventMap.put("contactMechIdTo", contactMechIdTo); commEventMap.put("statusId", statusId); - + commEventMap.put("partyIdFrom", partyIdFrom); commEventMap.put("partyIdTo", partyId); commEventMap.put("datetimeStarted", now); commEventMap.put("entryDate", now); - - commEventMap.put("subject", subject); + + commEventMap.put("subject", subject); commEventMap.put("userLogin", userLogin); commEventMap.put("contentMimeTypeId", contentType); - + Map<String, Object> createResult; try { createResult = dispatcher.runSync("createCommunicationEvent", commEventMap); @@ -560,12 +560,12 @@ return ServiceUtil.returnError(ServiceUtil.getErrorMessage(createResult)); } String communicationEventId = (String) createResult.get("communicationEventId"); - + Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("communicationEventId", communicationEventId); return result; } - + /* * Update the communication event with information from the email; * runs as a post-commit ECA on sendMail and sendMultiPartMail services @@ -573,11 +573,11 @@ */ public static Map<String, Object> updateCommEventAfterEmail(DispatchContext dctx, Map<String, ? extends Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); - + GenericValue userLogin = (GenericValue) context.get("userLogin"); String communicationEventId = (String) context.get("communicationEventId"); MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper"); - + Map<String, Object> commEventMap = FastMap.newInstance(); commEventMap.put("communicationEventId", communicationEventId); commEventMap.put("subject", wrapper.getSubject()); @@ -587,27 +587,27 @@ commEventMap.put("messageId", wrapper.getMessageId()); commEventMap.put("userLogin", userLogin); commEventMap.put("content", wrapper.getMessageBody()); - + // populate the address (to/from/cc/bcc) data populateAddressesFromMessage(wrapper, commEventMap); - - // save the communication event + + // save the communication event try { dispatcher.runSync("updateCommunicationEvent", commEventMap); } catch (GenericServiceException e) { return ServiceUtil.returnError(e.getMessage()); } - + // attachments try { createAttachmentContent(dispatcher, wrapper, communicationEventId, userLogin); } catch (GenericServiceException e) { return ServiceUtil.returnError(e.getMessage()); - } - + } + return ServiceUtil.returnSuccess(); } - + /** * This service is the main one for processing incoming emails. * @@ -643,7 +643,7 @@ Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper"); - + Timestamp nowTimestamp = UtilDateTime.nowTimestamp(); GenericValue userLogin = (GenericValue) context.get("userLogin"); String partyIdTo = null; @@ -717,7 +717,7 @@ } String deliveredTo = wrapper.getFirstHeader("Delivered-To"); - if (deliveredTo != null) { + if (deliveredTo != null) { // check if started with the domain name if yes remove including the dash. String dn = deliveredTo.substring(deliveredTo.indexOf("@")+1, deliveredTo.length()); if (deliveredTo.startsWith(dn)) { @@ -766,7 +766,7 @@ if (messageBodyContentType.indexOf(";") > -1) { messageBodyContentType = messageBodyContentType.substring(0, messageBodyContentType.indexOf(";")); } - + // select the plain text bodypart String messageBody = null; if (wrapper.getMainPartCount() > 1) { @@ -778,13 +778,13 @@ } } } - + if (messageBody == null) { messageBody = wrapper.getMessageBody(); } - + commEventMap.put("content", messageBody); - commEventMap.put("contentMimeTypeId", messageBodyContentType.toLowerCase()); + commEventMap.put("contentMimeTypeId", messageBodyContentType.toLowerCase()); // check for for a reply to communication event (using in-reply-to the parent messageID) String[] inReplyTo = wrapper.getHeader("In-Reply-To"); @@ -807,7 +807,7 @@ // populate the address (to/from/cc/bcc) data populateAddressesFromMessage(wrapper, commEventMap); - + // store from/to parties, but when not found make a note of the email to/from address in the workEffort Note Section. String commNote = ""; if (partyIdFrom != null) { @@ -859,17 +859,17 @@ // handle the attachments createAttachmentContent(dispatcher, wrapper, communicationEventId, userLogin); - + // For all addresses create a CommunicationEventRoles createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, toParties, "ADDRESSEE"); createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, ccParties, "CC"); createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, bccParties, "BCC"); - + // get the related work effort info List<Map<String, Object>> toWorkEffortInfos = buildListOfWorkEffortInfoFromEmailAddresses(addressesTo, userLogin, dispatcher); List<Map<String, Object>> ccWorkEffortInfos = buildListOfWorkEffortInfoFromEmailAddresses(addressesCC, userLogin, dispatcher); List<Map<String, Object>> bccWorkEffortInfos = buildListOfWorkEffortInfoFromEmailAddresses(addressesBCC, userLogin, dispatcher); - + // For all WorkEffort addresses create a CommunicationEventWorkEffs createCommunicationEventWorkEffs(userLogin, dispatcher, toWorkEffortInfos, communicationEventId); createCommunicationEventWorkEffs(userLogin, dispatcher, ccWorkEffortInfos, communicationEventId); @@ -884,7 +884,7 @@ return ServiceUtil.returnError(e.getMessage()); } catch (GenericServiceException e) { Debug.logError(e, module); - return ServiceUtil.returnError(e.getMessage()); + return ServiceUtil.returnError(e.getMessage()); } catch (Exception e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -897,7 +897,7 @@ Address[] addressesTo = wrapper.getTo(); Address[] addressesCC = wrapper.getCc(); Address[] addressesBCC = wrapper.getBcc(); - + Set<String> emailAddressesFrom = new TreeSet<String>(); Set<String> emailAddressesTo = new TreeSet<String>(); Set<String> emailAddressesCC = new TreeSet<String>(); @@ -928,12 +928,12 @@ if (UtilValidate.isNotEmpty(ccString)) commEventMap.put("ccString", ccString); if (UtilValidate.isNotEmpty(bccString)) commEventMap.put("bccString", bccString); } - + private static void createAttachmentContent(LocalDispatcher dispatcher, MimeMessageWrapper wrapper, String communicationEventId, GenericValue userLogin) throws GenericServiceException { // handle the attachments - String subject = wrapper.getSubject(); + String subject = wrapper.getSubject(); List<String> attachmentIndexes = wrapper.getAttachmentIndexes(); - + if (attachmentIndexes.size() > 0) { Debug.logInfo("=== message has attachments [" + attachmentIndexes.size() + "] =====", module); for (String attachmentIdx : attachmentIndexes) { @@ -945,40 +945,40 @@ if (subject != null && subject.length() > 80) { subject = subject.substring(0,80); // make sure not too big for database field. (20 characters for filename) } - + String attFileName = wrapper.getPartFilename(attachmentIdx); String attContentType = wrapper.getPartContentType(attachmentIdx); if (attContentType != null && attContentType.indexOf(";") > -1) { attContentType = attContentType.toLowerCase().substring(0, attContentType.indexOf(";")); - } - + } + if (!UtilValidate.isEmpty(attFileName)) { attachmentMap.put("contentName", attFileName); attachmentMap.put("description", subject + "-" + attachmentIdx); } else { attachmentMap.put("contentName", subject + "-" + attachmentIdx); } - + attachmentMap.put("drMimeTypeId", attContentType); if (attContentType.startsWith("text")) { String text = wrapper.getPartText(attachmentIdx); attachmentMap.put("drDataResourceTypeId", "ELECTRONIC_TEXT"); attachmentMap.put("textData", text); } else { - ByteBuffer data = wrapper.getPartByteBuffer(attachmentIdx); + ByteBuffer data = wrapper.getPartByteBuffer(attachmentIdx); if (Debug.infoOn()) Debug.logInfo("Binary attachment size: " + data.limit(), module); attachmentMap.put("drDataResourceName", attFileName); attachmentMap.put("imageData", data); attachmentMap.put("drDataResourceTypeId", "IMAGE_OBJECT"); // TODO: why always use IMAGE attachmentMap.put("_imageData_contentType", attContentType); } - + // save the content - dispatcher.runSync("createCommContentDataResource", attachmentMap); + dispatcher.runSync("createCommContentDataResource", attachmentMap); } } } - + private static void createCommEventRoles(GenericValue userLogin, Delegator delegator, LocalDispatcher dispatcher, String communicationEventId, List<Map<String, Object>> parties, String roleTypeId) { // It's not clear what the "role" of this communication event should be, so we'll just put _NA_ // check and see if this role was already created and ignore if true @@ -1003,7 +1003,7 @@ Debug.logError(e, module); } } - + private static void createCommunicationEventWorkEffs(GenericValue userLogin, LocalDispatcher dispatcher, List<Map<String, Object>> workEffortInfos, String communicationEventId) { // create relationship between communication event and work efforts try { @@ -1053,7 +1053,7 @@ * Calls findPartyFromEmailAddress service and returns a List of the results for the array of addresses */ private static List<Map<String, Object>> buildListOfPartyInfoFromEmailAddresses(Address [] addresses, GenericValue userLogin, LocalDispatcher dispatcher) throws GenericServiceException { - InternetAddress emailAddress = null; + InternetAddress emailAddress = null; Map<String, Object> result = null; List<Map<String, Object>> tempResults = FastList.newInstance(); @@ -1074,7 +1074,7 @@ } return tempResults; } - + /* * Gets WorkEffort info from e-mail address and returns a List of the results for the array of addresses */ @@ -1096,9 +1096,9 @@ result = dispatcher.runSync("performFind", UtilMisc.<String, Object>toMap("entityName", "WorkEffortContactMechView" ,"inputFields", inputFields, "userLogin", userLogin)); EntityListIterator listIt = (EntityListIterator) result.get("listIt"); - + try { - List<GenericValue> list = listIt.getCompleteList(); + List<GenericValue> list = listIt.getCompleteList(); List<GenericValue> filteredList = EntityUtil.filterByDate(list); tempResults.addAll(filteredList); } catch (GenericEntityException e) { @@ -1113,20 +1113,20 @@ /* * Service to process incoming email and look for a bounce message. If the email is indeed a bounce message - * the CommunicationEvent will be updated with the proper COM_BOUNCED status. + * the CommunicationEvent will be updated with the proper COM_BOUNCED status. */ public static Map<String,Object> processBouncedMessage(DispatchContext dctx, Map<String, ? extends Object> context) { Debug.logInfo("Running process bounced message check...", module); - MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper"); - + MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper"); + LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - + int parts = wrapper.getMainPartCount(); - if (parts >= 3) { // it must have all three parts in order to process correctly + if (parts >= 3) { // it must have all three parts in order to process correctly // get the second part (delivery report) - String contentType = wrapper.getPartContentType("1"); // index 1 should be the second part + String contentType = wrapper.getPartContentType("1"); // index 1 should be the second part if (contentType != null && "message/delivery-status".equalsIgnoreCase(contentType)) { Debug.logInfo("Delivery status report part found; processing...", module); @@ -1138,7 +1138,7 @@ if (Debug.verboseOn()) Debug.logVerbose("Part 2 Text :\n\n" + part2Text, module); - // find the "Action" element and obtain its value (looking for "failed") + // find the "Action" element and obtain its value (looking for "failed") Pattern p2 = Pattern.compile("^Action: (.*)$", Pattern.MULTILINE | Pattern.CASE_INSENSITIVE); Matcher m2 = p2.matcher(part2Text); String action = null; @@ -1148,14 +1148,14 @@ if (action != null && "failed".equalsIgnoreCase(action)) { // message bounced -- get the original message - String part3Text = wrapper.getPartRawText("2"); // index 2 should be the third part + String part3Text = wrapper.getPartRawText("2"); // index 2 should be the third part if (part3Text == null) { part3Text = ""; } if (Debug.verboseOn()) Debug.logVerbose("Part 3 Text :\n\n" + part3Text, module); - // find the "Message-Id" element and obtain its value (looking for "failed") + // find the "Message-Id" element and obtain its value (looking for "failed") Pattern p3 = Pattern.compile("^Message-Id: (.*)$", Pattern.MULTILINE | Pattern.CASE_INSENSITIVE); Matcher m3 = p3.matcher(part3Text); String messageId = null; @@ -1194,10 +1194,10 @@ } } else { if (Debug.infoOn()) { - Debug.logInfo("Unable to find CommunicationEvent with the matching messageId : " + messageId, module); + Debug.logInfo("Unable to find CommunicationEvent with the matching messageId : " + messageId, module); } - // no communication events found for that message ID; possible this is a NEWSLETTER + // no communication events found for that message ID; possible this is a NEWSLETTER try { values = delegator.findByAnd("ContactListCommStatus", UtilMisc.toMap("messageId", messageId)); @@ -1229,7 +1229,7 @@ } else { if (Debug.infoOn()) { Debug.logInfo("Unable to find ContactListCommStatus with the matching messageId : " + messageId, module); - + } } } @@ -1239,10 +1239,10 @@ } } } - + return ServiceUtil.returnSuccess(); } - + public static Map<String,Object> logIncomingMessage(DispatchContext dctx, Map<String, ? extends Object> context) { MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper"); Debug.logInfo("Message recevied : " + wrapper.getSubject(), module); @@ -1250,9 +1250,9 @@ Debug.logInfo("-- Number of parts : " + wrapper.getMainPartCount(), module); Debug.logInfo("-- Number of attachments : " + wrapper.getAttachmentIndexes().size(), module); Debug.logInfo("-- Message ID : " + wrapper.getMessageId(), module); - + Debug.logInfo("### MESSAGE ###\n\n" + wrapper.getMessageBody(), module); - + List<String> attachmentIndexes = wrapper.getAttachmentIndexes(); if (attachmentIndexes.size() > 0) { Debug.logInfo("### ATTACHMENTS ###", module); @@ -1261,19 +1261,19 @@ Debug.logInfo("### -- Content Type : " + wrapper.getPartContentType(idx), module); } } - + return ServiceUtil.returnSuccess(); - + } - + /* * Event which marks a communication event as read, and returns a 1px image to the browser/mail client * Is updated because the read status is now stored in the communicationEventRole * This services is updated but could not be tested. assumed is "read" for partyIdTo on the commevent */ - public static String markCommunicationAsRead(HttpServletRequest request, HttpServletResponse response) { - String communicationEventId = null; - + public static String markCommunicationAsRead(HttpServletRequest request, HttpServletResponse response) { + String communicationEventId = null; + // pull the communication event from path info, so we can hide the process from the user String pathInfo = request.getPathInfo(); String[] pathParsed = pathInfo.split("/", 3); @@ -1284,39 +1284,39 @@ } if (pathInfo != null && pathInfo.indexOf("/") > -1) { pathParsed = pathInfo.split("/"); - communicationEventId = pathParsed[0]; + communicationEventId = pathParsed[0]; } - + // update the communication event if (communicationEventId != null) { Debug.logInfo("Marking communicationEventId [" + communicationEventId + "] from path info : " + request.getPathInfo() + " as read.", module); Delegator delegator = (Delegator) request.getAttribute("delegator"); GenericValue communicationEvent = null; - try { - communicationEvent = delegator.findOne("CommunicationEvent", UtilMisc.toMap("communicationEventId", communicationEventId), true); + try { + communicationEvent = delegator.findOne("CommunicationEvent", UtilMisc.toMap("communicationEventId", communicationEventId), true); } catch (GenericEntityException e) { - Debug.logError(e, module); + Debug.logError(e, module); } LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); - try { - dispatcher.runAsync("setCommEventRoleToRead", UtilMisc.toMap("communicationEventId", communicationEventId, "partyId", communicationEvent.getString("partyIdTo"))); + try { + dispatcher.runAsync("setCommEventRoleToRead", UtilMisc.toMap("communicationEventId", communicationEventId, "partyId", communicationEvent.getString("partyIdTo"))); } catch (GenericServiceException e) { - Debug.logError(e, module); + Debug.logError(e, module); } } - + // return the 1px image (spacer.gif) URL imageUrl; try { imageUrl = FlexibleLocation.resolveLocation("component://images/webapp/images/spacer.gif"); InputStream imageStream = imageUrl.openStream(); - UtilHttp.streamContentToBrowser(response, imageStream, 43, "image/gif", null); + UtilHttp.streamContentToBrowser(response, imageStream, 43, "image/gif", null); } catch (MalformedURLException e) { Debug.logError(e, module); } catch (IOException e) { Debug.logError(e, module); } - + // return null to not return any view return null; } Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipHelper.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipHelper.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipHelper.java Fri Jan 15 21:00:23 2010 @@ -41,13 +41,13 @@ public class PartyRelationshipHelper { public static final String module = PartyRelationshipHelper.class.getName(); - + /** Return A List of the active Party Relationships (ie with valid from and thru dates) *@param delegator needed Delegator *@param partyRelationshipValues Map containing the input parameters (primaries keys + partyRelationshipTypeId) *@return List of the active Party Relationships */ - public static List<GenericValue> getActivePartyRelationships(Delegator delegator, Map<String, ?> partyRelationshipValues) { + public static List<GenericValue> getActivePartyRelationships(Delegator delegator, Map<String, ?> partyRelationshipValues) { String partyIdFrom = (String) partyRelationshipValues.get("partyIdFrom") ; String partyIdTo = (String) partyRelationshipValues.get("partyIdTo") ; String roleTypeIdFrom = (String) partyRelationshipValues.get("roleTypeIdFrom") ; @@ -64,11 +64,11 @@ condList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, fromDate)); EntityCondition thruCond = EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition("thruDate", null), - EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN, fromDate)), + EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN, fromDate)), EntityOperator.OR); condList.add(thruCond); EntityCondition condition = EntityCondition.makeCondition(condList); - + List<GenericValue> partyRelationships = null; try { partyRelationships = delegator.findList("PartyRelationship", condition, null, null, null, false); @@ -81,5 +81,5 @@ } else { return null; } - } + } } Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java Fri Jan 15 21:00:23 2010 @@ -93,7 +93,7 @@ return result; } - /** Creates and updates a PartyRelationship creating related PartyRoles if needed. + /** Creates and updates a PartyRelationship creating related PartyRoles if needed. * A side of the relationship is checked to maintain history *@param ctx The DispatchContext that this service is operating in *@param context Map containing the input parameters @@ -102,10 +102,10 @@ public static Map<String, Object> createUpdatePartyRelationshipAndRoles(DispatchContext ctx, Map<String, ? extends Object> context) { Map<String, Object> result = FastMap.newInstance(); Delegator delegator = ctx.getDelegator(); - LocalDispatcher dispatcher = ctx.getDispatcher(); - + LocalDispatcher dispatcher = ctx.getDispatcher(); + try { - List<GenericValue> partyRelationShipList = PartyRelationshipHelper.getActivePartyRelationships(delegator, context); + List<GenericValue> partyRelationShipList = PartyRelationshipHelper.getActivePartyRelationships(delegator, context); if (UtilValidate.isEmpty(partyRelationShipList)) { // If already exists and active nothing to do: keep the current one String partyId = (String) context.get("partyId") ; String partyIdFrom = (String) context.get("partyIdFrom") ; @@ -116,28 +116,28 @@ // Before creating the partyRelationShip, create the partyRoles if they don't exist GenericValue partyToRole = null; - partyToRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", partyIdTo, "roleTypeId", roleTypeIdTo), false); + partyToRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", partyIdTo, "roleTypeId", roleTypeIdTo), false); if (partyToRole == null) { partyToRole = delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", partyIdTo, "roleTypeId", roleTypeIdTo)); partyToRole.create(); } - + GenericValue partyFromRole= null; partyFromRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", partyIdFrom, "roleTypeId", roleTypeIdFrom), false); if (partyFromRole == null) { partyFromRole = delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", partyIdFrom, "roleTypeId", roleTypeIdFrom)); partyFromRole.create(); - } + } // Check if there is already a partyRelationship of that type with another party from the side indicated String sideChecked = partyIdFrom.equals(partyId)? "partyIdFrom" : "partyIdTo"; partyRelationShipList = delegator.findByAnd("PartyRelationship", UtilMisc.toMap(sideChecked, partyId, - "roleTypeIdFrom", roleTypeIdFrom, + "roleTypeIdFrom", roleTypeIdFrom, "roleTypeIdTo", roleTypeIdTo, - "partyRelationshipTypeId", partyRelationshipTypeId)); + "partyRelationshipTypeId", partyRelationshipTypeId)); // We consider the last one (in time) as sole active (we try to maintain a unique relationship and keep changes history) - partyRelationShipList = EntityUtil.filterByDate(partyRelationShipList); - GenericValue oldPartyRelationShip = EntityUtil.getFirst(partyRelationShipList); + partyRelationShipList = EntityUtil.filterByDate(partyRelationShipList); + GenericValue oldPartyRelationShip = EntityUtil.getFirst(partyRelationShipList); if (UtilValidate.isNotEmpty(oldPartyRelationShip)) { oldPartyRelationShip.setFields(UtilMisc.toMap("thruDate", UtilDateTime.nowTimestamp())); // Current becomes inactive oldPartyRelationShip.store(); @@ -154,6 +154,6 @@ return ServiceUtil.returnError("Could not create party relationship (write failure): " + e.getMessage()); } result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); - return result; + return result; } } Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java Fri Jan 15 21:00:23 2010 @@ -181,7 +181,7 @@ person = delegator.makeValue("Person", UtilMisc.toMap("partyId", partyId)); person.setNonPKFields(context); toBeStored.add(person); - + try { delegator.storeAll(toBeStored); } catch (GenericEntityException e) { @@ -287,7 +287,7 @@ if (person == null || party == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "person.update.not_found", locale)); } - + // update status by separate service String oldStatusId = party.getString("statusId"); if (party.get("statusId") == null) { // old records @@ -298,7 +298,7 @@ party.setNonPKFields(context); party.set("statusId", oldStatusId); - + try { person.store(); party.store(); @@ -306,7 +306,7 @@ Debug.logWarning(e.getMessage(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "person.update.write_failure", new Object[] { e.getMessage() }, locale)); } - + if (UtilValidate.isNotEmpty(context.get("statusId")) && !context.get("statusId").equals(oldStatusId)) { try { dispatcher.runSync("setPartyStatus", UtilMisc.toMap("partyId", partyId, "statusId", context.get("statusId"), "userLogin", context.get("userLogin"))); @@ -415,7 +415,7 @@ partyGroup = delegator.makeValue("PartyGroup", UtilMisc.toMap("partyId", partyId)); partyGroup.setNonPKFields(context); partyGroup.create(); - + } catch (GenericEntityException e) { Debug.logWarning(e, module); Map<String, String> messageMap = UtilMisc.toMap("errMessage", e.getMessage()); @@ -464,7 +464,7 @@ return ServiceUtil.returnError(errMsg); } - + // update status by separate service String oldStatusId = party.getString("statusId"); partyGroup.setNonPKFields(context); @@ -1735,8 +1735,8 @@ } return partyId; } - - + + /** * Finds partyId(s) corresponding to a party reference, partyId or a GoodIdentification idValue * @param dctx Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyTypeHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyTypeHelper.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyTypeHelper.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyTypeHelper.java Fri Jan 15 21:00:23 2010 @@ -33,17 +33,17 @@ public class PartyTypeHelper { public static final String module = PartyTypeHelper.class.getName(); - + /** Check if a related party is of the right party type (PERSON or PARTY_GROUP) *@param delegator needed Delegator - *@param partyId a a valid Party Id string + *@param partyId a a valid Party Id string *@param checkedPartyType a string in {PERSON, PARTY_GROUP} *@return Boolean, false in case of error - */ - public static Boolean checkPartyType(Delegator delegator, String partyId, String checkedPartyType) { + */ + public static Boolean checkPartyType(Delegator delegator, String partyId, String checkedPartyType) { GenericValue party = null; GenericValue partyType = null; - GenericValue checkedTypeOfParty = null; + GenericValue checkedTypeOfParty = null; try { party = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false); if (UtilValidate.isNotEmpty(party)) { @@ -53,8 +53,8 @@ return false; } } catch (GenericEntityException e) { - Debug.logWarning(e, module); - } + Debug.logWarning(e, module); + } return EntityTypeUtil.isType(partyType, checkedTypeOfParty); - } + } } Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java Fri Jan 15 21:00:23 2010 @@ -397,7 +397,7 @@ } return partyIds; } - + /** * Generic service to find party by id. * By default return the party find by partyId Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigWrapper.java Fri Jan 15 21:00:23 2010 @@ -647,10 +647,10 @@ public String getDescription() { return (configOption.getString("description") != null? configOption.getString("description"): "no description"); } - + public String getDescription(Locale locale) { return (configOption.getString("description") != null? (String) configOption.get("description", locale): "no description"); - } + } public String getId() { return configOption.getString("configOptionId"); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java Fri Jan 15 21:00:23 2010 @@ -1072,7 +1072,7 @@ public static String addProductToComparisonList(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); Delegator delegator = (Delegator) request.getAttribute("delegator"); - + String productId = request.getParameter("productId"); GenericValue product = null; if (UtilValidate.isNotEmpty(productId)) { @@ -1082,15 +1082,15 @@ Debug.logError(e, module); } } - + if (product == null) { String errMsg = UtilProperties.getMessage(resource, "productevents.product_with_id_not_found", UtilMisc.toMap("productId", productId), UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } - + List<GenericValue> compareList = getProductCompareList(request); - boolean alreadyInList = false; + boolean alreadyInList = false; for (GenericValue compProduct : compareList) { if (product.getString("productId").equals(compProduct.getString("productId"))) { alreadyInList = true; @@ -1110,7 +1110,7 @@ public static String removeProductFromComparisonList(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); Delegator delegator = (Delegator) request.getAttribute("delegator"); - + String productId = request.getParameter("productId"); GenericValue product = null; if (UtilValidate.isNotEmpty(productId)) { @@ -1121,13 +1121,13 @@ Debug.logError(e, module); } } - + if (product == null) { String errMsg = UtilProperties.getMessage(resource, "productevents.product_with_id_not_found", UtilMisc.toMap("productId", productId), UtilHttp.getLocale(request)); request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } - + List<GenericValue> compareList = getProductCompareList(request); Iterator<GenericValue> it = compareList.iterator(); while (it.hasNext()) { @@ -1151,7 +1151,7 @@ request.setAttribute("_EVENT_MESSAGE_", eventMsg); return "success"; } - + /** * Return nulls for empty strings, as the entity engine can deal with nulls. This will provide blanks * in fields where BigDecimal display. Blank meaning null, vs. 0 which means 0 Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Fri Jan 15 21:00:23 2010 @@ -894,7 +894,7 @@ Map<String, Object> requestParams = UtilHttp.getParameterMap(request); String noConditionFind = (String) requestParams.get("noConditionFind"); if (UtilValidate.isEmpty(noConditionFind)) { - noConditionFind = UtilProperties.getPropertyValue("widget", "widget.defaultNoConditionFind"); + noConditionFind = UtilProperties.getPropertyValue("widget", "widget.defaultNoConditionFind"); } // if noConditionFind to Y then find without conditions otherwise search according to constraints. if ("Y".equals(noConditionFind) || UtilValidate.isNotEmpty(productSearchConstraintList)) { @@ -1168,7 +1168,7 @@ return searchParamString.toString(); } - + /** * This method returns a list of productId counts grouped by productFeatureId's of input productFeatureTypeId, * the constraint being applied on current ProductSearchConstraint list in session. @@ -1179,7 +1179,7 @@ */ public static List<Map<String, String>> listCountByFeatureForType(String productFeatureTypeId, HttpSession session, Delegator delegator) { String visitId = VisitHandler.getVisitId(session); - + ProductSearchContext productSearchContext = new ProductSearchContext(delegator, visitId); List<ProductSearchConstraint> productSearchConstraintList = ProductSearchOptions.getConstraintList(session); if (UtilValidate.isNotEmpty(productSearchConstraintList)) { @@ -1187,11 +1187,11 @@ } productSearchContext.finishKeywordConstraints(); productSearchContext.finishCategoryAndFeatureConstraints(); - + DynamicViewEntity dynamicViewEntity = productSearchContext.dynamicViewEntity; List<EntityCondition> entityConditionList = productSearchContext.entityConditionList; List<String> fieldsToSelect = FastList.newInstance(); - + dynamicViewEntity.addMemberEntity("PFAC", "ProductFeatureAppl"); dynamicViewEntity.addAlias("PFAC", "pfacProductFeatureId", "productFeatureId", null, null, Boolean.TRUE, null); dynamicViewEntity.addAlias("PFAC", "pfacFromDate", "fromDate", null, null, null, null); @@ -1202,7 +1202,7 @@ fieldsToSelect.add("featureCount"); entityConditionList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("pfacThruDate", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("pfacThruDate", EntityOperator.GREATER_THAN, UtilDateTime.nowTimestamp()))); entityConditionList.add(EntityCondition.makeCondition("pfacFromDate", EntityOperator.LESS_THAN, UtilDateTime.nowTimestamp())); - + dynamicViewEntity.addMemberEntity("PFC", "ProductFeature"); dynamicViewEntity.addAlias("PFC", "pfcProductFeatureTypeId", "productFeatureTypeId", null, null, Boolean.TRUE, null); dynamicViewEntity.addAlias("PFC", "pfcDescription", "description", null, null, Boolean.TRUE, null); @@ -1210,12 +1210,12 @@ fieldsToSelect.add("pfcDescription"); fieldsToSelect.add("pfcProductFeatureTypeId"); entityConditionList.add(EntityCondition.makeCondition("pfcProductFeatureTypeId", EntityOperator.EQUALS, productFeatureTypeId)); - + EntityCondition whereCondition = EntityCondition.makeCondition(entityConditionList, EntityOperator.AND); - + EntityFindOptions efo = new EntityFindOptions(); efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE); - + EntityListIterator eli = null; try { eli = delegator.findListIteratorByCondition(dynamicViewEntity, whereCondition, null, fieldsToSelect, productSearchContext.orderByList, efo); @@ -1223,13 +1223,13 @@ Debug.logError(e, "Error in product search", module); return null; } - + List<Map<String, String>> featureCountList = FastList.newInstance(); GenericValue searchResult = null; while ((searchResult = (GenericValue) eli.next()) != null) { featureCountList.add(UtilMisc.toMap("productFeatureId", (String) searchResult.get("pfacProductFeatureId"), "productFeatureTypeId", (String) searchResult.get("pfcProductFeatureTypeId"), "description", (String) searchResult.get("pfcDescription"), "featureCount", Long.toString((Long) searchResult.get("featureCount")))); } - + if (eli != null) { try { eli.close(); @@ -1239,7 +1239,7 @@ } return featureCountList; } - + public static int getCategoryCostraintIndex(HttpSession session) { int index = 0; List<ProductSearchConstraint> productSearchConstraintList = ProductSearchOptions.getConstraintList(session); @@ -1250,9 +1250,9 @@ } return index; } - + /** - * This method returns count of products within a given price range, the constraint being + * This method returns count of products within a given price range, the constraint being * applied on current ProductSearchConstraint list in session. * @param priceLow The low price. * @param priceHigh The high price. @@ -1262,7 +1262,7 @@ */ public static long getCountForListPriceRange(BigDecimal priceLow, BigDecimal priceHigh, HttpSession session, Delegator delegator) { String visitId = VisitHandler.getVisitId(session); - + ProductSearchContext productSearchContext = new ProductSearchContext(delegator, visitId); List<ProductSearchConstraint> productSearchConstraintList = ProductSearchOptions.getConstraintList(session); if (UtilValidate.isNotEmpty(productSearchConstraintList)) { @@ -1270,11 +1270,11 @@ } productSearchContext.finishKeywordConstraints(); productSearchContext.finishCategoryAndFeatureConstraints(); - + DynamicViewEntity dynamicViewEntity = productSearchContext.dynamicViewEntity; List<EntityCondition> entityConditionList = productSearchContext.entityConditionList; List<String> fieldsToSelect = FastList.newInstance(); - + dynamicViewEntity.addMemberEntity("PPC", "ProductPrice"); dynamicViewEntity.addAlias("PPC", "ppcProductPriceTypeId", "productPriceTypeId", null, null, null, null); dynamicViewEntity.addAlias("PPC", "ppcFromDate", "fromDate", null, null, null, null); @@ -1288,12 +1288,12 @@ entityConditionList.add(EntityCondition.makeCondition("ppcPrice", EntityOperator.GREATER_THAN_EQUAL_TO, priceLow)); entityConditionList.add(EntityCondition.makeCondition("ppcPrice", EntityOperator.LESS_THAN_EQUAL_TO, priceHigh)); entityConditionList.add(EntityCondition.makeCondition("ppcProductPriceTypeId", EntityOperator.EQUALS, "LIST_PRICE")); - + EntityCondition whereCondition = EntityCondition.makeCondition(entityConditionList, EntityOperator.AND); - + EntityFindOptions efo = new EntityFindOptions(); efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE); - + EntityListIterator eli = null; try { eli = delegator.findListIteratorByCondition(dynamicViewEntity, whereCondition, null, fieldsToSelect, productSearchContext.orderByList, efo); @@ -1301,13 +1301,13 @@ Debug.logError(e, "Error in product search", module); return 0; } - + GenericValue searchResult = null; Long priceRangeCount = Long.valueOf(0); while ((searchResult = (GenericValue) eli.next()) != null) { priceRangeCount = searchResult.getLong("priceRangeCount"); } - + if (eli != null) { try { eli.close(); @@ -1317,9 +1317,9 @@ } return priceRangeCount; } - + /** - * This method returns count of products in a given category (including all sub categories), the constraint being + * This method returns count of products in a given category (including all sub categories), the constraint being * applied on current ProductSearchConstraint list in session. * @param productCategoryId productCategoryId for which the count should be returned. * @param session Current session. @@ -1328,7 +1328,7 @@ */ public static long getCountForProductCategory(String productCategoryId, HttpSession session, Delegator delegator) { String visitId = VisitHandler.getVisitId(session); - + ProductSearchContext productSearchContext = new ProductSearchContext(delegator, visitId); List<ProductSearchConstraint> productSearchConstraintList = ProductSearchOptions.getConstraintList(session); if (UtilValidate.isNotEmpty(productSearchConstraintList)) { @@ -1336,11 +1336,11 @@ } productSearchContext.finishKeywordConstraints(); productSearchContext.finishCategoryAndFeatureConstraints(); - + DynamicViewEntity dynamicViewEntity = productSearchContext.dynamicViewEntity; List<EntityCondition> entityConditionList = productSearchContext.entityConditionList; List<String> fieldsToSelect = FastList.newInstance(); - + dynamicViewEntity.addMemberEntity("PCMC", "ProductCategoryMember"); dynamicViewEntity.addAlias("PCMC", "pcmcProductCategoryId", "productCategoryId", null, null, null, null); dynamicViewEntity.addAlias("PCMC", "pcmcFromDate", "fromDate", null, null, null, null); @@ -1350,16 +1350,16 @@ fieldsToSelect.add("categoryCount"); entityConditionList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("pcmcThruDate", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("pcmcThruDate", EntityOperator.GREATER_THAN, productSearchContext.nowTimestamp))); entityConditionList.add(EntityCondition.makeCondition("pcmcFromDate", EntityOperator.LESS_THAN, productSearchContext.nowTimestamp)); - + Set<String> productCategoryIdSet = FastSet.newInstance(); ProductSearch.getAllSubCategoryIds(productCategoryId, productCategoryIdSet, delegator, productSearchContext.nowTimestamp); entityConditionList.add(EntityCondition.makeCondition("pcmcProductCategoryId", EntityOperator.IN, productCategoryIdSet)); - + EntityCondition whereCondition = EntityCondition.makeCondition(entityConditionList, EntityOperator.AND); - + EntityFindOptions efo = new EntityFindOptions(); efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE); - + EntityListIterator eli = null; try { eli = delegator.findListIteratorByCondition(dynamicViewEntity, whereCondition, null, fieldsToSelect, productSearchContext.orderByList, efo); @@ -1367,13 +1367,13 @@ Debug.logError(e, "Error in product search", module); return 0; } - + GenericValue searchResult = null; Long categoryCount = Long.valueOf(0); while ((searchResult = (GenericValue) eli.next()) != null) { categoryCount = searchResult.getLong("categoryCount"); } - + if (eli != null) { try { eli.close(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductServices.java Fri Jan 15 21:00:23 2010 @@ -477,7 +477,7 @@ try { List<GenericValue> productAssocs = null; - + List<String> orderBy = FastList.newInstance(); if (sortDescending) { orderBy.add("sequenceNum DESC"); @@ -488,7 +488,7 @@ if (bidirectional) { EntityCondition cond = EntityCondition.makeCondition( UtilMisc.toList( - EntityCondition.makeCondition("productId", productId), + EntityCondition.makeCondition("productId", productId), EntityCondition.makeCondition("productIdTo", productId) ), EntityJoinOperator.OR); cond = EntityCondition.makeCondition(cond, EntityCondition.makeCondition("productAssocTypeId", type)); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java Fri Jan 15 21:00:23 2010 @@ -556,7 +556,7 @@ } return featureTypeFeatures; } - + /** * For a given variant product, returns the list of features that would qualify it for * selection from the virtual product @@ -579,7 +579,7 @@ List<GenericValue> standardFeatures = ProductWorker.getProductFeaturesByApplTypeId(variantProduct, "STANDARD_FEATURE"); List<GenericValue> result = FastList.newInstance(); for (GenericValue standardFeature : standardFeatures) { - // For each standard variant feature check it is also a virtual selectable feature and + // For each standard variant feature check it is also a virtual selectable feature and // if a feature of the same type hasn't already been added to the list if (selectableTypes.contains(standardFeature.getString("productFeatureTypeId")) && selectableFeatures.contains(standardFeature)) { result.add(standardFeature); @@ -879,12 +879,12 @@ return null; } - /* - * Returns the product's unit weight converted to the desired Uom. If the weight is null, - * then a check is made for an associated virtual product to retrieve the weight from. If the + /* + * Returns the product's unit weight converted to the desired Uom. If the weight is null, + * then a check is made for an associated virtual product to retrieve the weight from. If the * weight is still null then null is returned. If a weight is found and a desiredUomId has - * been supplied and the product specifies a weightUomId then an attempt will be made to - * convert the value otherwise the weight is returned as is. + * been supplied and the product specifies a weightUomId then an attempt will be made to + * convert the value otherwise the weight is returned as is. */ public static BigDecimal getProductWeight(GenericValue product, String desiredUomId, Delegator delegator, LocalDispatcher dispatcher) { BigDecimal weight = product.getBigDecimal("weight"); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java Fri Jan 15 21:00:23 2010 @@ -119,8 +119,8 @@ return ServiceUtil.returnError("Uploaded file not valid or corrupted"); } - String encoding = System.getProperty("file.encoding"); - String file = Charset.forName(encoding).decode(fileBytes).toString(); + String encoding = System.getProperty("file.encoding"); + String file = Charset.forName(encoding).decode(fileBytes).toString(); // get the createProductPromoCode Model ModelService promoModel; try { Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java Fri Jan 15 21:00:23 2010 @@ -50,9 +50,9 @@ /* * Returns the value of a given ShipmentPackageContent record. Calculated by working out the total value (from the OrderItems) of all ItemIssuances - * for the ShipmentItem then dividing that by the total quantity issued for the same to get an average item value then multiplying that by the package + * for the ShipmentItem then dividing that by the total quantity issued for the same to get an average item value then multiplying that by the package * content quantity. - * Note: No rounding of the calculation is performed so you will need to round it to the accuracy that you require + * Note: No rounding of the calculation is performed so you will need to round it to the accuracy that you require */ public static BigDecimal getShipmentPackageContentValue(GenericValue shipmentPackageContent) { BigDecimal quantity = shipmentPackageContent.getBigDecimal("quantity"); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java Fri Jan 15 21:00:23 2010 @@ -274,7 +274,7 @@ Debug.logInfo("Voice notification service will not be requested for COD shipmentId " + shipmentId + ", shipmentRouteSegmentId " + shipmentRouteSegmentId + " - destination address is not residential", module); } } - + // Determine the currency by trying the shipmentRouteSegment, then the Shipment, then the framework's default currency, and finally default to USD String currencyCode = null; if (UtilValidate.isNotEmpty(shipmentRouteSegment.getString("currencyUomId"))) { @@ -387,7 +387,7 @@ UtilXml.addChildElementValue(soldToAddressElement, "StateProvinceCode", destPostalAddress.getString("stateProvinceGeoId"), shipmentConfirmRequestDoc); UtilXml.addChildElementValue(soldToAddressElement, "PostalCode", destPostalAddress.getString("postalCode"), shipmentConfirmRequestDoc); UtilXml.addChildElementValue(soldToAddressElement, "CountryCode", destCountryGeo.getString("geoCode"), shipmentConfirmRequestDoc); - + // Child of Shipment: PaymentInformation Element paymentInformationElement = UtilXml.addChildElement(shipmentElement, "PaymentInformation", shipmentConfirmRequestDoc); @@ -528,7 +528,7 @@ Element referenceNumberElement = UtilXml.addChildElement(packageElement, "ReferenceNumber", shipmentConfirmRequestDoc); UtilXml.addChildElementValue(referenceNumberElement, "Code", "MK", shipmentConfirmRequestDoc); UtilXml.addChildElementValue(referenceNumberElement, "Value", shipmentPackage.getString("shipmentPackageSeqId"), shipmentConfirmRequestDoc); - } + } if (carrierShipmentBoxType != null && carrierShipmentBoxType.get("oversizeCode") != null) { UtilXml.addChildElementValue(packageElement, "OversizePackage", carrierShipmentBoxType.getString("oversizeCode"), shipmentConfirmRequestDoc); } @@ -1105,14 +1105,14 @@ } } } - + //save International Invoice image if it exists (upscie is not returning this at this moment) //Commenting because it might be useful in the future as there are other types of forms that may be returned /* Element formElement = UtilXml.firstChildElement(packageResultsElement, "Form"); if (formElement != null) { String code = UtilXml.childElementValue(formElement, "Code"); String description = UtilXml.childElementValue(formElement, "Description"); - + Element imageElement = UtilXml.firstChildElement(formElement, "Image"); Element imageFormatElement = UtilXml.firstChildElement(imageElement, "ImageFormat"); String formatCode = UtilXml.childElementValue(imageFormatElement, "Code"); @@ -1130,7 +1130,7 @@ Debug.log(e, "Could not save UPS International Invoice: [[[" + imgStringDecoded + "]]] to file: " + outFile, module); } } - String formGroupId = UtilXml.childElementValue(formElement, "FormGroupId"); + String formGroupId = UtilXml.childElementValue(formElement, "FormGroupId"); */ shipmentPackageRouteSeg.store(); } @@ -1142,7 +1142,7 @@ errorList.add("Error: No PackageResults were returned for the Package [" + shipmentPackageRouteSeg.getString("shipmentPackageSeqId") + "]"); } } - + // save the High Value Report image if it exists Element controlLogReceiptElement = UtilXml.firstChildElement(shipmentResultsElement, "ControlLogReceipt"); if (controlLogReceiptElement != null) { @@ -2330,7 +2330,7 @@ return ServiceUtil.returnError(errorList); } } - + public static Map<String, Object> upsEmailReturnLabel(DispatchContext dctx, Map<String, ? extends Object> context) { Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); @@ -2348,7 +2348,7 @@ shipmentUpsSaveCertificationFile.mkdirs(); } } - + //Shipment Confirm request String shipmentConfirmResponseString = null; @@ -2421,7 +2421,7 @@ if (carrierShipmentMethod == null) { return ServiceUtil.returnError("CarrierShipmentMethod not found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId + "; partyId is " + shipmentRouteSegment.get("carrierPartyId") + " and shipmentMethodTypeId is " + shipmentRouteSegment.get("shipmentMethodTypeId")); } - + Map<String, Object> destEmail = dispatcher.runSync("getPartyEmail", UtilMisc.toMap("partyId", shipment.get("partyIdTo"), "userLogin", userLogin)); String recipientEmail = null; if (UtilValidate.isNotEmpty(destEmail.get("emailAddress"))) { @@ -2546,7 +2546,7 @@ Element packageWeightUnitOfMeasurementElement = UtilXml.addChildElement(packageElement, "UnitOfMeasurement", shipmentConfirmRequestDoc); UtilXml.addChildElementValue(packageWeightUnitOfMeasurementElement, "Code", "LBS", shipmentConfirmRequestDoc); UtilXml.addChildElementValue(packageWeightElement, "Weight", UtilProperties.getPropertyValue("shipment", "shipment.default.weight.value"), shipmentConfirmRequestDoc); - + String shipmentConfirmRequestString = null; try { shipmentConfirmRequestString = UtilXml.writeXmlDocument(shipmentConfirmRequestDoc); @@ -2616,7 +2616,7 @@ if (UtilValidate.isEmpty(shipmentPackageRouteSegs)) { return ServiceUtil.returnError("No ShipmentPackageRouteSegs found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId); } - + String shipmentDigest = UtilXml.childElementValue(shipmentConfirmResponseElement, "ShipmentDigest"); if (UtilValidate.isEmpty(shipmentDigest)) { return ServiceUtil.returnError("ERROR: The trackingDigest was not set for this Route Segment, meaning that a UPS shipment confirm has not been done."); @@ -2632,7 +2632,7 @@ Element acceptTransactionReferenceElement = UtilXml.addChildElement(acceptRequestElement, "TransactionReference", shipmentAcceptRequestDoc); UtilXml.addChildElementValue(acceptTransactionReferenceElement, "CustomerContext", "ShipAccept / 01", shipmentAcceptRequestDoc); UtilXml.addChildElementValue(acceptTransactionReferenceElement, "XpciVersion", "1.0001", shipmentAcceptRequestDoc); - + UtilXml.addChildElementValue(acceptRequestElement, "RequestAction", "ShipAccept", shipmentAcceptRequestDoc); UtilXml.addChildElementValue(acceptRequestElement, "RequestOption", "01", shipmentAcceptRequestDoc); @@ -2688,13 +2688,13 @@ } catch (GenericServiceException e) { Debug.logError(e, module); return ServiceUtil.returnError("Error reading or writing Shipment data for UPS Shipment Confirm: " + e.toString()); - } + } return ServiceUtil.returnSuccess(UtilProperties.getMessage("OrderUiLabels", "OrderReturnLabelEmailSuccessful", locale)); } - + public static Map<String, Object> upsShipmentAlternateRatesInquiry(DispatchContext dctx, Map<String, ? extends Object> context) { Delegator delegator = dctx.getDelegator(); - + // prepare the data String upsRateInquireMode = (String) context.get("upsRateInquireMode"); String shipmentId = (String) context.get("shipmentId"); @@ -2703,21 +2703,21 @@ String productStoreId = (String) context.get("productStoreId"); List<Map<String, Object>> shippingRates = FastList.newInstance(); GenericValue shipmentRouteSegment = null; - + try { if (shipmentRouteSegmentId != null) { - + shipmentRouteSegment = delegator.findOne("ShipmentRouteSegment", false, UtilMisc.toMap("shipmentId", shipmentId, "shipmentRouteSegmentId", shipmentRouteSegmentId)); } else { List<GenericValue> shipmentRouteSegments = delegator.findList("ShipmentRouteSegment", EntityCondition.makeCondition("shipmentId", EntityOperator.EQUALS, shipmentId), null, null, null, false); shipmentRouteSegment = EntityUtil.getFirst(shipmentRouteSegments); } - + if (shipmentRouteSegment == null) { return ServiceUtil.returnError("ShipmentRouteSegment not found with shipmentId " + shipmentId); } shipmentRouteSegmentId = shipmentRouteSegment.getString("shipmentRouteSegmentId"); - + if (!"UPS".equals(shipmentRouteSegment.getString("carrierPartyId"))) { return ServiceUtil.returnError("ERROR: The Carrier for ShipmentRouteSegment " + shipmentRouteSegmentId + " of Shipment " + shipmentId + ", is not UPS."); } @@ -2773,15 +2773,15 @@ if (destCountryGeo == null) { return ServiceUtil.returnError("DestCountryGeo not found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId); } - + // grab the pickup type; if none is defined we will assume daily pickup String pickupType = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipper.pickup.type", "01"); // grab the customer classification; if none is defined we will assume daily pickup String customerClassification = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.customerclassification", "01"); - + // should be shop to get estimates for all the possible shipping method of UPS upsRateInquireMode = "Shop"; - + // prepare the XML Document Document rateRequestDoc = UtilXml.makeEmptyXmlDocument("RatingServiceSelectionRequest"); Element rateRequestElement = rateRequestDoc.getDocumentElement(); @@ -2800,15 +2800,15 @@ // set the pickup type Element pickupElement = UtilXml.addChildElement(rateRequestElement, "PickupType", rateRequestDoc); UtilXml.addChildElementValue(pickupElement, "Code", pickupType, rateRequestDoc); - + Element customerClassificationElement = UtilXml.addChildElement(rateRequestElement, "CustomerClassification", rateRequestDoc); UtilXml.addChildElementValue(customerClassificationElement, "Code", customerClassification, rateRequestDoc); - + // shipment info Element shipmentElement = UtilXml.addChildElement(rateRequestElement, "Shipment", rateRequestDoc); Element rateInformationElement = UtilXml.addChildElement(shipmentElement, "RateInformation", rateRequestDoc); Element negotiatedRatesIndicatorElement = UtilXml.addChildElement(rateInformationElement, "NegotiatedRatesIndicator", rateRequestDoc); - + Element shipperElement = UtilXml.addChildElement(shipmentElement, "Shipper", rateRequestDoc); UtilXml.addChildElementValue(shipperElement, "Name", UtilValidate.isNotEmpty(originPostalAddress.getString("toName")) ? originPostalAddress.getString("toName") : "", rateRequestDoc); UtilXml.addChildElementValue(shipperElement, "AttentionName", UtilValidate.isNotEmpty(originPostalAddress.getString("attnName")) ? originPostalAddress.getString("attnName") : "", rateRequestDoc); @@ -2820,7 +2820,7 @@ if (UtilValidate.isNotEmpty(originPostalAddress.getString("address2"))) { UtilXml.addChildElementValue(shipperAddressElement, "AddressLine2", originPostalAddress.getString("address2"), rateRequestDoc); } - + UtilXml.addChildElementValue(shipperAddressElement, "City", originPostalAddress.getString("city"), rateRequestDoc); UtilXml.addChildElementValue(shipperAddressElement, "StateProvinceCode", originPostalAddress.getString("stateProvinceGeoId"), rateRequestDoc); UtilXml.addChildElementValue(shipperAddressElement, "PostalCode", originPostalAddress.getString("postalCode"), rateRequestDoc); @@ -2838,7 +2838,7 @@ if (UtilValidate.isNotEmpty(destPostalAddress.getString("address2"))) { UtilXml.addChildElementValue(shipToAddressElement, "AddressLine2", destPostalAddress.getString("address2"), rateRequestDoc); } - + UtilXml.addChildElementValue(shipToAddressElement, "City", destPostalAddress.getString("city"), rateRequestDoc); UtilXml.addChildElementValue(shipToAddressElement, "StateProvinceCode", destPostalAddress.getString("stateProvinceGeoId"), rateRequestDoc); UtilXml.addChildElementValue(shipToAddressElement, "PostalCode", destPostalAddress.getString("postalCode"), rateRequestDoc); @@ -2861,13 +2861,13 @@ UtilXml.addChildElementValue(shipFromAddressElement, "StateProvinceCode", originPostalAddress.getString("stateProvinceGeoId"), rateRequestDoc); UtilXml.addChildElementValue(shipFromAddressElement, "PostalCode", originPostalAddress.getString("postalCode"), rateRequestDoc); UtilXml.addChildElementValue(shipFromAddressElement, "CountryCode", originCountryGeo.getString("geoCode"), rateRequestDoc); - + List<GenericValue> shipmentPackageRouteSegs = shipmentRouteSegment.getRelated("ShipmentPackageRouteSeg", null, UtilMisc.toList("+shipmentPackageSeqId")); if (UtilValidate.isEmpty(shipmentPackageRouteSegs)) { return ServiceUtil.returnError("No ShipmentPackageRouteSegs (ie No Packages) found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId); } for (GenericValue shipmentPackageRouteSeg :shipmentPackageRouteSegs) { - + GenericValue shipmentPackage = shipmentPackageRouteSeg.getRelatedOne("ShipmentPackage"); GenericValue shipmentBoxType = shipmentPackage.getRelatedOne("ShipmentBoxType"); List<GenericValue> carrierShipmentBoxTypes = shipmentPackage.getRelated("CarrierShipmentBoxType", UtilMisc.toMap("partyId", "UPS"), null); @@ -2900,8 +2900,8 @@ UtilXml.addChildElementValue(dimensionsElement, "Width", UtilValidate.isNotEmpty(boxWidth) ? ""+boxWidth.intValue() : "", rateRequestDoc); UtilXml.addChildElementValue(dimensionsElement, "Height", UtilValidate.isNotEmpty(boxHeight) ? ""+boxHeight.intValue() : "", rateRequestDoc); } - else if - (UtilValidate.isNotEmpty(shipmentPackage.get("boxLength")) && UtilValidate.isNotEmpty(shipmentPackage.get("boxWidth")) && + else if + (UtilValidate.isNotEmpty(shipmentPackage.get("boxLength")) && UtilValidate.isNotEmpty(shipmentPackage.get("boxWidth")) && UtilValidate.isNotEmpty(shipmentPackage.get("boxHeight"))) { Element dimensionsElement = UtilXml.addChildElement(packageElement, "Dimensions", rateRequestDoc); Element unitOfMeasurementElement = UtilXml.addChildElement(dimensionsElement, "UnitOfMeasurement", rateRequestDoc); @@ -2913,7 +2913,7 @@ UtilXml.addChildElementValue(dimensionsElement, "Width", width.setScale(decimals, rounding).toString(), rateRequestDoc); UtilXml.addChildElementValue(dimensionsElement, "Height", height.setScale(decimals, rounding).toString(), rateRequestDoc); } - + Element packageWeightElement = UtilXml.addChildElement(packageElement, "PackageWeight", rateRequestDoc); Element packageWeightUnitOfMeasurementElement = UtilXml.addChildElement(packageElement, "UnitOfMeasurement", rateRequestDoc); String weightUomUps = unitsOfbizToUps.get(shipmentPackage.get("weightUomId")); @@ -2923,14 +2923,14 @@ // might as well default to LBS UtilXml.addChildElementValue(packageWeightUnitOfMeasurementElement, "Code", "LBS", rateRequestDoc); } - + if (shipmentPackage.getString("weight") == null) { return ServiceUtil.returnError("Weight value not found for ShipmentRouteSegment with shipmentId " + shipmentId + ", shipmentRouteSegmentId " + shipmentRouteSegmentId + ", and shipmentPackageSeqId " + shipmentPackage.getString("shipmentPackageSeqId")); } BigDecimal boxWeight = shipmentPackage.getBigDecimal("weight"); UtilXml.addChildElementValue(packageWeightElement, "Weight", UtilValidate.isNotEmpty(boxWeight) ? ""+boxWeight.intValue() : "", rateRequestDoc); } - + // service options UtilXml.addChildElement(shipmentElement, "ShipmentServiceOptions", rateRequestDoc); String rateRequestString = null; @@ -2941,7 +2941,7 @@ Debug.logError(e, ioeErrMsg, module); return ServiceUtil.returnFailure(ioeErrMsg); } - + // create AccessRequest XML doc Document accessRequestDocument = createAccessRequestDocument("shipment.properties"); String accessRequestString = null; @@ -2961,7 +2961,7 @@ // send the request try { rateResponseString = sendUpsRequest("Rate", xmlString.toString()); - + } catch (UpsConnectException e) { String uceErrMsg = "Error sending UPS request for UPS Service Rate: " + e.toString(); Debug.logError(e, uceErrMsg, module); @@ -3023,7 +3023,7 @@ } } } - + public static Map<String, Object> handleUpsAlternateRatesInquireResponse(Document rateResponseDocument) { Element rateResponseElement = rateResponseDocument.getDocumentElement(); |
| Free forum by Nabble | Edit this page |
