svn commit: r757087 - in /ofbiz/trunk/applications/party/src/org/ofbiz/party: communication/ contact/ content/ party/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r757087 - in /ofbiz/trunk/applications/party/src/org/ofbiz/party: communication/ contact/ content/ party/

doogie-3
Author: doogie
Date: Sat Mar 21 23:43:58 2009
New Revision: 757087

URL: http://svn.apache.org/viewvc?rev=757087&view=rev
Log:
Fix purely empty whitespace lines, and remove trailing whitespace.

Modified:
    ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
    ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactHelper.java
    ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java
    ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java
    ofbiz/trunk/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java
    ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyHelper.java
    ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java
    ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
    ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java

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=757087&r1=757086&r2=757087&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 Sat Mar 21 23:43:58 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -63,21 +63,21 @@
 import org.ofbiz.service.mail.MimeMessageWrapper;
 
 public class CommunicationEventServices {
-    
+
     public static final String module = CommunicationEventServices.class.getName();
     public static final String resource = "PartyErrorUiLabels";
-    
+
     public static Map<String, Object> sendCommEventAsEmail(DispatchContext ctx, Map<String, ? extends Object> context) {
         GenericDelegator delegator = ctx.getDelegator();
         LocalDispatcher dispatcher = ctx.getDispatcher();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         Locale locale = (Locale) context.get("locale");
-                
+
         String communicationEventId = (String) context.get("communicationEventId");
-        
+
         Map<String, Object> result = ServiceUtil.returnSuccess();
         List<Object> errorMessages = FastList.newInstance(); // used to keep a list of all error messages returned from sending emails to contact list
-        
+
         try {
             // find the communication event and make sure that it is actually an email
             GenericValue communicationEvent = delegator.findByPrimaryKey("CommunicationEvent", UtilMisc.toMap("communicationEventId", communicationEventId));
@@ -106,7 +106,7 @@
             if (UtilValidate.isEmpty(communicationEvent.getString("content"))) {
                 communicationEvent.put("content", " ");
             }
-            
+
             // prepare the email
             Map<String, Object> sendMailParams = FastMap.newInstance();
             sendMailParams.put("sendFrom", communicationEvent.getRelatedOne("FromContactMech").getString("infoString"));
@@ -114,7 +114,7 @@
             sendMailParams.put("body", communicationEvent.getString("content"));
             sendMailParams.put("contentType", communicationEvent.getString("contentMimeTypeId"));
             sendMailParams.put("userLogin", userLogin);
-            
+
             // if there is no contact list, then send look for a contactMechIdTo and partyId
             if ((UtilValidate.isEmpty(communicationEvent.getString("contactListId")))) {
                 // send to address
@@ -134,7 +134,7 @@
                 sendMailParams.put("communicationEventId", communicationEventId);
                 sendMailParams.put("sendTo", sendTo);
                 sendMailParams.put("partyId", communicationEvent.getString("partyIdTo"));  // who it's going to
-                
+
                 // send it
                 Map<String, Object> tmpResult = dispatcher.runSync("sendMail", sendMailParams);
                 if (ServiceUtil.isError(tmpResult)) {
@@ -150,7 +150,7 @@
                         return ServiceUtil.returnError(e.getMessage());
                     }
 
-                    Map<String, Object> completeResult = dispatcher.runSync("setCommEventComplete", UtilMisc.<String, Object>toMap("communicationEventId", communicationEventId, "userLogin", userLogin));                    
+                    Map<String, Object> completeResult = dispatcher.runSync("setCommEventComplete", UtilMisc.<String, Object>toMap("communicationEventId", communicationEventId, "userLogin", userLogin));
                     if (ServiceUtil.isError(completeResult)) {
                         errorMessages.add(ServiceUtil.getErrorMessage(completeResult));
                     }
@@ -176,14 +176,14 @@
         } catch (GenericServiceException esx) {
             ServiceUtil.returnError(esx.getMessage());
         }
-        
+
         // If there were errors, then the result of this service should be error with the full list of messages
         if (errorMessages.size() > 0) {
             result = ServiceUtil.returnError(errorMessages);
         }
         return result;
     }
-    
+
     public static Map<String, Object> sendEmailToContactList(DispatchContext ctx, Map<String, ? extends Object> context) {
         GenericDelegator delegator = ctx.getDelegator();
         LocalDispatcher dispatcher = ctx.getDispatcher();
@@ -195,13 +195,13 @@
         String errorCallingSendMailService = UtilProperties.getMessage(resource, "commeventservices.errorCallingSendMailService", locale);
         String errorInSendEmailToContactListService = UtilProperties.getMessage(resource, "commeventservices.errorInSendEmailToContactListService", locale);
         String skippingInvalidEmailAddress = UtilProperties.getMessage(resource, "commeventservices.skippingInvalidEmailAddress", locale);
-        
+
         String contactListId = (String) context.get("contactListId");
         String communicationEventId = (String) context.get("communicationEventId");
 
         // Any exceptions thrown in this block will cause the service to return error
         try {
-            
+
             GenericValue communicationEvent = delegator.findByPrimaryKey("CommunicationEvent", UtilMisc.toMap("communicationEventId", communicationEventId));
             GenericValue contactList = delegator.findByPrimaryKey("ContactList", UtilMisc.toMap("contactListId", contactListId));
 
@@ -225,95 +225,95 @@
 
             List<GenericValue> sendToEmails = delegator.findList("ContactListPartyAndContactMech", conditions, fieldsToSelect, null,
                     new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true), false);
-            
+
             // Send an email to each contact list member
-            // TODO: Contact lists for emails really should be written as an EntityListIterator for very large lists!
+            // TODO: Contact lists for emails really should be written as an EntityListIterator for very large lists!
             List<String> orderBy = UtilMisc.toList("-fromDate");
             for (GenericValue contactListPartyAndContactMech: sendToEmails) {
                 // Any exceptions thrown in this inner block will only relate to a single email of the list, so should
                 //  only be logged and not cause the service to return an error
                 try {
-    
+
                     String emailAddress = contactListPartyAndContactMech.getString("infoString");
                     if (UtilValidate.isEmpty(emailAddress)) continue;
                     emailAddress = emailAddress.trim();
-                    
+
                     if (! UtilValidate.isEmail(emailAddress)) {
-                        
+
                         // If validation fails, just log and skip the email address
                         Debug.logError(skippingInvalidEmailAddress + ": " + emailAddress, module);
                         errorMessages.add(skippingInvalidEmailAddress + ": " + emailAddress);
                         continue;
                     }
-    
+
                     // Because we're retrieving infoString only above (so as not to pollute the distinctness), we
                     //      need to retrieve the partyId it's related to. Since this could be multiple parties, get
                     //      only the most recent valid one via ContactListPartyAndContactMech.
                     List<EntityCondition> clpConditionList = UtilMisc.makeListWritable(conditionList);
                     clpConditionList.add(EntityCondition.makeCondition("infoString", EntityOperator.EQUALS, emailAddress));
                     EntityConditionList clpConditions = EntityCondition.makeCondition(clpConditionList, EntityOperator.AND);
-    
+
                     List<GenericValue> emailCLPaCMs = delegator.findList("ContactListPartyAndContactMech", clpConditions, null, orderBy, null, true);
                     GenericValue lastContactListPartyACM = EntityUtil.getFirst(emailCLPaCMs);
                     if (lastContactListPartyACM == null) continue;
-                    
+
                     String partyId = lastContactListPartyACM.getString("partyId");
-                    
+
                     sendMailParams.put("sendTo", emailAddress);
                     sendMailParams.put("partyId", partyId);
-                  
+
                     // if it is a NEWSLETTER then we do not want the outgoing emails stored, so put a communicationEventId in the sendMail context to prevent storeEmailAsCommunicationEvent from running
                     if ("NEWSLETTER".equals(contactList.getString("contactListTypeId"))) {
                         sendMailParams.put("communicationEventId", communicationEventId);
                     }
-                    
+
                     // Retrieve a record for this contactMechId from ContactListCommStatus
-                    Map<String, String> contactListCommStatusRecordMap = UtilMisc.toMap("contactListId", contactListId, "communicationEventId", communicationEventId, "contactMechId", lastContactListPartyACM.getString("preferredContactMechId"));
+                    Map<String, String> contactListCommStatusRecordMap = UtilMisc.toMap("contactListId", contactListId, "communicationEventId", communicationEventId, "contactMechId", lastContactListPartyACM.getString("preferredContactMechId"));
                     GenericValue contactListCommStatusRecord = delegator.findByPrimaryKey("ContactListCommStatus", contactListCommStatusRecordMap);
                     if (contactListCommStatusRecord == null) {
-                        
+
                         // 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");
                         contactListCommStatusRecord = delegator.create("ContactListCommStatus", newContactListCommStatusRecordMap);
                     } else if (contactListCommStatusRecord.get("statusId") != null && contactListCommStatusRecord.getString("statusId").equals("COM_COMPLETE")) {
-    
+
                         // There was a successful earlier attempt, so skip this address
                         continue;
                     }
 
                     Map<String, Object> tmpResult = null;
-                    
+
                     // Make the attempt to send the email to the address
                     tmpResult = dispatcher.runSync("sendMail", sendMailParams);
                     if (tmpResult == null || ServiceUtil.isError(tmpResult)) {
-    
+
                         // If the send attempt fails, just log and skip the email address
                         Debug.logError(errorCallingSendMailService + ": " + ServiceUtil.getErrorMessage(tmpResult), module);
                         errorMessages.add(errorCallingSendMailService + ": " + ServiceUtil.getErrorMessage(tmpResult));
                         continue;
                     }
-                    
+
                     if ("Y".equals(contactList.get("singleUse"))) {
-                        
+
                         // Expire the ContactListParty if the list is single use and sendEmail finishes successfully
                         tmpResult = dispatcher.runSync("updateContactListParty", UtilMisc.toMap("contactListId", lastContactListPartyACM.get("contactListId"),
                                                                                                 "partyId", partyId, "fromDate", lastContactListPartyACM.get("fromDate"),
                                                                                                 "thruDate", UtilDateTime.nowTimestamp(), "userLogin", userLogin));
                         if (ServiceUtil.isError(tmpResult)) {
-    
+
                             // If the expiry fails, just log and skip the email address
                             Debug.logError(errorCallingUpdateContactListPartyService + ": " + ServiceUtil.getErrorMessage(tmpResult), module);
                             errorMessages.add(errorCallingUpdateContactListPartyService + ": " + ServiceUtil.getErrorMessage(tmpResult));
                             continue;
                         }
                     }
-    
+
                     // All is successful, so update the ContactListCommStatus record
                     contactListCommStatusRecord.set("statusId", "COM_COMPLETE");
                     delegator.store(contactListCommStatusRecord);
-                    
+
                 // Don't return a service error just because of failure for one address - just log the error and continue
                 } catch (GenericEntityException nonFatalGEE) {
                     Debug.logError(nonFatalGEE, errorInSendEmailToContactListService, module);
@@ -323,19 +323,19 @@
                     errorMessages.add(errorInSendEmailToContactListService + ": " + nonFatalGSE.getMessage());
                 }
             }
-            
+
         } catch (GenericEntityException fatalGEE) {
             ServiceUtil.returnError(fatalGEE.getMessage());
         }
 
         return errorMessages.size() == 0 ? ServiceUtil.returnSuccess() : ServiceUtil.returnError(errorMessages);
     }
-    
+
     public static Map<String, Object> setCommEventComplete(DispatchContext dctx, Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         String communicationEventId = (String) context.get("communicationEventId");
-        
+
         try {
             Map<String, Object> result = dispatcher.runSync("updateCommunicationEvent", UtilMisc.<String, Object>toMap("communicationEventId", communicationEventId,
                     "statusId", "COM_COMPLETE", "userLogin", userLogin));
@@ -358,14 +358,14 @@
      public static Map<String, Object> storeEmailAsCommunication(DispatchContext dctx, Map<String, ? extends Object> serviceContext) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericValue userLogin = (GenericValue) serviceContext.get("userLogin");
-        
+
         String subject = (String) serviceContext.get("subject");
         String body = (String) serviceContext.get("body");
         String partyId = (String) serviceContext.get("partyId");
         String communicationEventId = (String) serviceContext.get("communicationEventId");
         String contentType = (String) serviceContext.get("contentType");
-        String emailType = (String) serviceContext.get("emailType");        
-        
+        String emailType = (String) serviceContext.get("emailType");
+
         // only create a new communication event if the email is not already associated with one
         if (communicationEventId == null) {
             String partyIdFrom = (String) userLogin.get("partyId");
@@ -383,7 +383,7 @@
             commEventMap.put("contentMimeTypeId", contentType);
             String runService = "createCommunicationEvent";
             if ("PARTY_REGIS_CONFIRM".equals(emailType)) {
-                runService = "createCommunicationEventWithoutPermission"; // used to create a new Customer, Prospect or Employee  
+                runService = "createCommunicationEventWithoutPermission"; // used to create a new Customer, Prospect or Employee
             }
             try {
                 dispatcher.runSync(runService, commEventMap);
@@ -392,41 +392,41 @@
                 return ServiceUtil.returnError("Cannot store email as communication event; see logs");
             }
         }
-        
+
         return ServiceUtil.returnSuccess();
     }
 
     /**
      * This service is the main one for processing incoming emails.
-     *
-     * Its only argument is a wrapper for the JavaMail MimeMessage object.
+     *
+     * Its only argument is a wrapper for the JavaMail MimeMessage object.
      * From this object, all the fields, headers and content of the message can be accessed.
-     *
+     *
      * The first thing this service does is try to discover the partyId of the message sender
      * by doing a reverse find on the email address. It uses the findPartyFromEmailAddress service to do this.
-     *
+     *
      * It then creates a CommunicationEvent entity by calling the createCommunicationEvent service using the appropriate fields from the email and the
      * discovered partyId, if it exists, as the partyIdFrom. Note that it sets the communicationEventTypeId
      * field to AUTO_EMAIL_COMM. This is useful for tracking email generated communications.
-     *
-     * The service tries to find appropriate content for inclusion in the CommunicationEvent.content field.
+     *
+     * The service tries to find appropriate content for inclusion in the CommunicationEvent.content field.
      * If the contentType of the content starts with "text", the getContent() call returns a string and it is used.
      * If the contentType starts with "multipart", then the "parts" of the content are iterated thru and the first
      * one of mime type, "text/..." is used.
-     *
-     * If the contentType has a value of "multipart" then the parts of the content (except the one used in the main
-     * CommunicationEvent.content field) are cycled thru and attached to the CommunicationEvent entity using the
+     *
+     * If the contentType has a value of "multipart" then the parts of the content (except the one used in the main
+     * CommunicationEvent.content field) are cycled thru and attached to the CommunicationEvent entity using the
      * createCommContentDataResource service. This happens in the EmailWorker.addAttachmentsToCommEvent method.
-     *
+     *
      * However multiparts can contain multiparts. A recursive function has been added.
-     *
+     *
      * -Al Byers - Hans Bakker
      * @param dctx
      * @param context
      * @return
      */
     public static Map<String, Object> storeIncomingEmail(DispatchContext dctx, Map<String, ? extends Object> context) {
-        
+
         GenericDelegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper");
@@ -439,7 +439,7 @@
         String communicationEventId = null;
         String contactMechIdFrom = null;
         String contactMechIdTo = null;
-        
+
         Map result = null;
         try {
             String contentTypeRaw = message.getContentType();
@@ -453,9 +453,9 @@
             Address[] addressesCC = message.getRecipients(MimeMessage.RecipientType.CC);
             Address[] addressesBCC = message.getRecipients(MimeMessage.RecipientType.BCC);
             String messageId = message.getMessageID();
-            
-            String aboutThisEmail = "message [" + messageId + "] from [" +
-                (addressesFrom[0] == null? "not found" : addressesFrom[0].toString()) + "] to [" +
+
+            String aboutThisEmail = "message [" + messageId + "] from [" +
+                (addressesFrom[0] == null? "not found" : addressesFrom[0].toString()) + "] to [" +
                 (addressesTo[0] == null? "not found" : addressesTo[0].toString()) + "]";
             if (Debug.verboseOn()) Debug.logVerbose("Processing Incoming Email " + aboutThisEmail, module);
 
@@ -463,7 +463,7 @@
             String spamHeaderName = UtilProperties.getPropertyValue("general.properties", "mail.spam.name", "N");
             String configHeaderValue = UtilProperties.getPropertyValue("general.properties", "mail.spam.value");
             //          only execute when config file has been set && header variable found
-            if (!spamHeaderName.equals("N") && message.getHeader(spamHeaderName) != null && message.getHeader(spamHeaderName).length > 0) {
+            if (!spamHeaderName.equals("N") && message.getHeader(spamHeaderName) != null && message.getHeader(spamHeaderName).length > 0) {
                 String msgHeaderValue = message.getHeader(spamHeaderName)[0];
                 if (msgHeaderValue != null && msgHeaderValue.startsWith(configHeaderValue)) {
                     Debug.logInfo("Incoming Email message ignored, was detected by external spam checker", module);
@@ -492,9 +492,9 @@
                 Debug.logInfo("Persisting New Email: " + aboutThisEmail, module);
             }
 
-            
+
             // get the related partId's
-            List toParties = buildListOfPartyInfoFromEmailAddresses(addressesTo, userLogin, dispatcher);        
+            List toParties = buildListOfPartyInfoFromEmailAddresses(addressesTo, userLogin, dispatcher);
             List ccParties = buildListOfPartyInfoFromEmailAddresses(addressesCC, userLogin, dispatcher);
             List bccParties = buildListOfPartyInfoFromEmailAddresses(addressesBCC, userLogin, dispatcher);
 
@@ -515,34 +515,34 @@
                     deliveredTo = deliveredTo.substring(dn.length()+1, deliveredTo.length());
                 }
             }
-            
+
             // if partyIdTo not found try to find the "to" address using the delivered-to header
             if ((partyIdTo == null) && (deliveredTo != null)) {
-                result = dispatcher.runSync("findPartyFromEmailAddress", UtilMisc.<String, Object>toMap("address", deliveredTo, "userLogin", userLogin));          
+                result = dispatcher.runSync("findPartyFromEmailAddress", UtilMisc.<String, Object>toMap("address", deliveredTo, "userLogin", userLogin));
                 partyIdTo = (String)result.get("partyId");
                 contactMechIdTo = (String)result.get("contactMechId");
             }
-            if (userLogin.get("partyId") == null && partyIdTo != null) {
+            if (userLogin.get("partyId") == null && partyIdTo != null) {
                 int ch = 0;
                 for (ch=partyIdTo.length(); ch > 0 && Character.isDigit(partyIdTo.charAt(ch-1)); ch--) {
                     ;
                 }
                 userLogin.put("partyId", partyIdTo.substring(0,ch)); //allow services to be called to have prefix
             }
-            
+
             // get the 'from' partyId
             result = getParyInfoFromEmailAddress(addressesFrom, userLogin, dispatcher);
             partyIdFrom = (String)result.get("partyId");
             contactMechIdFrom = (String)result.get("contactMechId");
-            
+
             Map commEventMap = FastMap.newInstance();
             commEventMap.put("communicationEventTypeId", "AUTO_EMAIL_COMM");
             commEventMap.put("contactMechTypeId", "EMAIL_ADDRESS");
             commEventMap.put("messageId", messageId);
-            
+
             String subject = message.getSubject();
             commEventMap.put("subject", subject);
-                                    
+
             // Set sent and received dates
             commEventMap.put("entryDate", nowTimestamp);
             commEventMap.put("datetimeStarted", UtilDateTime.toTimestamp(message.getSentDate()));
@@ -578,7 +578,7 @@
                     if (orgCommEventId == null) orgCommEventId = parentCommEventId;
                     commEventMap.put("parentCommEventId", parentCommEventId);
                     commEventMap.put("origCommEventId", orgCommEventId);
-                }
+                }
             }
 
             // Retrieve all the addresses from the email
@@ -609,13 +609,13 @@
 
             if (UtilValidate.isNotEmpty(fromString)) commEventMap.put("fromString", fromString);
             if (UtilValidate.isNotEmpty(toString)) commEventMap.put("toString", toString);
-            if (UtilValidate.isNotEmpty(ccString)) commEventMap.put("ccString", ccString);            
+            if (UtilValidate.isNotEmpty(ccString)) commEventMap.put("ccString", ccString);
             if (UtilValidate.isNotEmpty(bccString)) commEventMap.put("bccString", bccString);
 
             // 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) {
-                commEventMap.put("partyIdFrom", partyIdFrom);                
+                commEventMap.put("partyIdFrom", partyIdFrom);
                 commEventMap.put("contactMechIdFrom", contactMechIdFrom);
             } else {
                 commNote += "Sent from: " +  ((InternetAddress)addressesFrom[0]).getAddress() + "; ";
@@ -623,7 +623,7 @@
             }
 
             if (partyIdTo != null) {
-                commEventMap.put("partyIdTo", partyIdTo);              
+                commEventMap.put("partyIdTo", partyIdTo);
                 commEventMap.put("contactMechIdTo", contactMechIdTo);
             } else {
                 commNote += "Sent to: " + ((InternetAddress)addressesTo[0]).getAddress()  + "; ";
@@ -631,7 +631,7 @@
                     commNote += "Delivered-To: " + deliveredTo + "; ";
                 }
             }
-            
+
             commNote += "Sent to: " + ((InternetAddress)addressesTo[0]).getAddress()  + "; ";
             commNote += "Delivered-To: " + deliveredTo + "; ";
 
@@ -641,13 +641,13 @@
                 commEventMap.put("statusId", "COM_UNKNOWN_PARTY");
             }
             if (commNote.length() > 255) commNote = commNote.substring(0,255);
-            
+
             if (!("".equals(commNote))) {
                 commEventMap.put("note", commNote);
             }
-            
+
             commEventMap.put("userLogin", userLogin);
-            
+
             // Populate the CommunicationEvent.headerString field with the email headers
             String headerString = "";
             Enumeration headerLines = message.getAllHeaderLines();
@@ -659,18 +659,18 @@
 
             result = dispatcher.runSync("createCommunicationEvent", commEventMap);
             communicationEventId = (String)result.get("communicationEventId");
-            
+
             if (messageContent instanceof Multipart) {
                 Debug.logInfo("===message has attachments=====", module);
                 int attachmentCount = addAttachmentsToCommEvent((Multipart) messageContent, subject, communicationEventId, dispatcher, userLogin);
                 if (Debug.infoOn()) Debug.logInfo(attachmentCount + " attachments added to CommunicationEvent:" + communicationEventId,module);
             }
-            
+
             // 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");
-            
+
             Map results = ServiceUtil.returnSuccess();
             results.put("communicationEventId", communicationEventId);
             results.put("statusId", commEventMap.get("statusId"));
@@ -689,7 +689,7 @@
             return ServiceUtil.returnError(e.getMessage());
         }
     }
-    
+
     private static void createCommEventRoles(GenericValue userLogin, GenericDelegator delegator, LocalDispatcher dispatcher, String communicationEventId, List 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
@@ -698,11 +698,11 @@
             while (it.hasNext()) {
                 Map result = (Map) it.next();
                 String partyId = (String) result.get("partyId");
-                GenericValue commEventRole = delegator.findByPrimaryKey("CommunicationEventRole",
+                GenericValue commEventRole = delegator.findByPrimaryKey("CommunicationEventRole",
                         UtilMisc.toMap("communicationEventId", communicationEventId, "partyId", partyId, "roleTypeId", roleTypeId));
                 if (commEventRole == null) {
-                    Map input = UtilMisc.toMap("communicationEventId", communicationEventId,
-                            "partyId", partyId, "roleTypeId", roleTypeId, "userLogin", userLogin,
+                    Map input = UtilMisc.toMap("communicationEventId", communicationEventId,
+                            "partyId", partyId, "roleTypeId", roleTypeId, "userLogin", userLogin,
                             "contactMechId", (String) result.get("contactMechId"),
                             "statusId", "COM_ROLE_CREATED");
                     dispatcher.runSync("createCommunicationEventRole", input);
@@ -722,28 +722,28 @@
         InternetAddress emailAddress = null;
         Map map = null;
         Map result = null;
-        
+
         if (addresses == null) {
             return null;
         }
-        
+
         if (addresses.length > 0) {
             Address addr = addresses[0];
             if (addr instanceof InternetAddress) {
                 emailAddress = (InternetAddress)addr;
             }
         }
-        
+
         if (!UtilValidate.isEmpty(emailAddress)) {
             map = FastMap.newInstance();
             map.put("address", emailAddress.getAddress());
             map.put("userLogin", userLogin);
-            result = dispatcher.runSync("findPartyFromEmailAddress", map);            
-        }        
-        
+            result = dispatcher.runSync("findPartyFromEmailAddress", map);
+        }
+
         return result;
     }
-    
+
     /*
      * Calls findPartyFromEmailAddress service and returns a List of the results for the array of addresses
      */
@@ -753,31 +753,31 @@
         Map map = null;
         Map result = null;
         List tempResults = FastList.newInstance();
-        
+
         if (addresses != null) {
             for (int i = 0; i < addresses.length; i++) {
                 addr = addresses[i];
                 if (addr instanceof InternetAddress) {
                     emailAddress = (InternetAddress)addr;
-                    
+
                     if (!UtilValidate.isEmpty(emailAddress)) {
-                        result = dispatcher.runSync("findPartyFromEmailAddress",
+                        result = dispatcher.runSync("findPartyFromEmailAddress",
                                 UtilMisc.<String, Object>toMap("address", emailAddress.getAddress(), "userLogin", userLogin));
                         if (result.get("partyId") != null) {
                             tempResults.add(result);
                         }
                     }
-                }    
+                }
             }
         }
         return tempResults;
-    }  
+    }
 
     public static String contentIndex = "";
     private static Map addMessageBody( Map commEventMap, Multipart multipart) throws MessagingException, IOException {
         try {
             int multipartCount = multipart.getCount();
-            for (int i=0; i < multipartCount  && i < 10; i++) {
+            for (int i=0; i < multipartCount  && i < 10; i++) {
                 Part part = multipart.getBodyPart(i);
                 String thisContentTypeRaw = part.getContentType();
                 String content = null;
@@ -826,15 +826,15 @@
         String fieldValue = null;
         return fieldValue;
     }
-    
-    public static int addAttachmentsToCommEvent(Multipart messageContent, String subject, String communicationEventId, LocalDispatcher dispatcher, GenericValue userLogin)
+
+    public static int addAttachmentsToCommEvent(Multipart messageContent, String subject, String communicationEventId, LocalDispatcher dispatcher, GenericValue userLogin)
         throws MessagingException, IOException, GenericServiceException {
         Map commEventMap = FastMap.newInstance();
         commEventMap.put("communicationEventId", communicationEventId);
         commEventMap.put("contentTypeId", "DOCUMENT");
         commEventMap.put("mimeTypeId", "text/html");
         commEventMap.put("userLogin", userLogin);
-        if (subject != null && subject.length() > 80) {
+        if (subject != null && subject.length() > 80) {
             subject = subject.substring(0,80); // make sure not too big for database field. (20 characters for filename)
         }
         currentIndex = "";
@@ -869,15 +869,15 @@
 
                 // The first test should not pass, because if it exists, it should be the bodyContentIndex part
                 // Debug.logInfo("====check for disposition: " + disposition + " contentType: '" + thisContentType + "' variable i:" + i, module);
-                if ((disposition == null && thisContentType.startsWith("text"))
+                if ((disposition == null && thisContentType.startsWith("text"))
                         || ((disposition != null)
                                 && (disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE))
                                 ) )
                 {
                     String attFileName = part.getFileName();
                     Debug.logInfo("===processing attachment: " + attFileName, module);
-                    if (!UtilValidate.isEmpty(attFileName)) {
-                           commEventMap.put("contentName", attFileName);
+                    if (!UtilValidate.isEmpty(attFileName)) {
+                           commEventMap.put("contentName", attFileName);
                            commEventMap.put("description", subject + "-" + attachmentCount);
                     } else {
                         commEventMap.put("contentName", subject + "-" + attachmentCount);

Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactHelper.java?rev=757087&r1=757086&r2=757087&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactHelper.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactHelper.java Sat Mar 21 23:43:58 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -33,9 +33,9 @@
  * Accessors for Contact Mechanisms
  */
 public class ContactHelper {
-    
+
     public static final String module = ContactHelper.class.getName();
-    
+
     public static Collection<GenericValue> getContactMech(GenericValue party, boolean includeOld) {
         return getContactMech(party, null, null, includeOld);
     }

Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java?rev=757087&r1=757086&r2=757087&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java Sat Mar 21 23:43:58 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -959,10 +959,10 @@
         result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
         return result;
     }
-    
+
     /**
      * Just wraps the ContactMechWorker method of the same name.
-     *
+     *
      *@param ctx The DispatchContext that this service is operating in
      *@param context Map containing the input parameters
      *@return Map with the result of the service, the output parameters
@@ -974,7 +974,7 @@
         String partyId = (String)context.get("partyId");
         if (UtilValidate.isEmpty(partyId) ) {
             if (userLogin != null) {
-                partyId = userLogin.getString("partyId");  
+                partyId = userLogin.getString("partyId");
             } else {
                 return ServiceUtil.returnError("Both 'partyId' and 'userLogin' are empty.");
             }
@@ -1013,7 +1013,7 @@
 
                 // create a new party contact mech for the partyIdTo
                 Map<String, Object> serviceResults = dispatcher.runSync("createPartyContactMech", UtilMisc.<String, Object>toMap("partyId", partyIdTo, "userLogin", userLogin,
-                            "contactMechId", contactMechId, "fromDate", UtilDateTime.nowTimestamp(),
+                            "contactMechId", contactMechId, "fromDate", UtilDateTime.nowTimestamp(),
                             "allowSolicitation", partyContactMech.getString("allowSolicitation"), "extension", partyContactMech.getString("extension")));
                 if (ServiceUtil.isError(serviceResults)) {
                     return serviceResults;
@@ -1035,7 +1035,7 @@
         }
         return ServiceUtil.returnSuccess();
     }
-    
+
     /**
      * Creates an EmailAddressVerification
      */
@@ -1043,14 +1043,14 @@
         GenericDelegator delegator = (GenericDelegator) dctx.getDelegator();
         String emailAddress = (String) context.get("emailAddress");
         String verifyHash = null;
-        
+
         String expireTime = UtilProperties.getPropertyValue("security", "email_verification.expire.hours");
         Integer expTime = Integer.valueOf(expireTime);
         Calendar calendar = Calendar.getInstance();
         calendar.add(Calendar.HOUR, expTime.intValue());
         Date date = calendar.getTime();
         Timestamp expireDate = UtilDateTime.toTimestamp(date);
-        
+
         SecureRandom secureRandom = new SecureRandom();
 
         synchronized(ContactMechServices.class) {
@@ -1079,10 +1079,10 @@
                 }
             }
         }
-        
+
         Map<String, Object> result = ServiceUtil.returnSuccess();
         result.put("verifyHash", verifyHash);
         return result;
     }
-    
+
 }

Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java?rev=757087&r1=757086&r2=757087&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java Sat Mar 21 23:43:58 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -44,9 +44,9 @@
  * Worker methods for Contact Mechanisms
  */
 public class ContactMechWorker {
-    
+
     public static final String module = ContactMechWorker.class.getName();
-    
+
     /** @deprecated */
     public static void getPartyContactMechValueMaps(PageContext pageContext, String partyId, boolean showOld, String partyContactMechValueMapsAttr) {
         GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator");
@@ -55,11 +55,11 @@
             pageContext.setAttribute(partyContactMechValueMapsAttr, partyContactMechValueMaps);
         }
     }
-    
+
     public static List<Map<String, Object>> getPartyContactMechValueMaps(GenericDelegator delegator, String partyId, boolean showOld) {
-       return getPartyContactMechValueMaps(delegator, partyId, showOld, null);    
+       return getPartyContactMechValueMaps(delegator, partyId, showOld, null);
     }
-    
+
     public static List<Map<String, Object>> getPartyContactMechValueMaps(GenericDelegator delegator, String partyId, boolean showOld, String contactMechTypeId) {
         List<Map<String, Object>> partyContactMechValueMaps = FastList.newInstance();
 
@@ -74,10 +74,10 @@
                     if (contactMech != null && contactMechTypeId.equals(contactMech.getString("contactMechTypeId"))) {
                         tempColTemp.add(partyContactMech);
                     }
-                        
+
                 }
                 tempCol = tempColTemp;
-            }
+            }
             if (!showOld) tempCol = EntityUtil.filterByDate(tempCol, true);
             allPartyContactMechs = tempCol;
         } catch (GenericEntityException e) {
@@ -130,7 +130,7 @@
 
         return partyContactMechValueMaps;
     }
-    
+
     public static List<Map<String, Object>> getFacilityContactMechValueMaps(GenericDelegator delegator, String facilityId, boolean showOld, String contactMechTypeId) {
         List<Map<String, Object>> facilityContactMechValueMaps = FastList.newInstance();
 
@@ -145,10 +145,10 @@
                     if (contactMech != null && contactMechTypeId.equals(contactMech.getString("contactMechTypeId"))) {
                         tempColTemp.add(partyContactMech);
                     }
-                        
+
                 }
                 tempCol = tempColTemp;
-            }
+            }
             if (!showOld) tempCol = EntityUtil.filterByDate(tempCol, true);
             allFacilityContactMechs = tempCol;
         } catch (GenericEntityException e) {
@@ -201,7 +201,7 @@
 
         return facilityContactMechValueMaps;
     }
-    
+
 
     /** @deprecated */
     public static void getOrderContactMechValueMaps(PageContext pageContext, String orderId, String orderContactMechValueMapsAttr) {
@@ -211,7 +211,7 @@
             pageContext.setAttribute(orderContactMechValueMapsAttr, maps);
         }
     }
-    public static List<Map<String, GenericValue>> getOrderContactMechValueMaps(GenericDelegator delegator, String orderId) {        
+    public static List<Map<String, GenericValue>> getOrderContactMechValueMaps(GenericDelegator delegator, String orderId) {
         List<Map<String, GenericValue>> orderContactMechValueMaps = FastList.newInstance();
 
         List<GenericValue> allOrderContactMechs = null;
@@ -316,7 +316,7 @@
 
         return workEffortContactMechValueMaps.size() > 0 ? workEffortContactMechValueMaps : null;
     }
-    
+
     public static void getContactMechAndRelated(ServletRequest request, String partyId, Map<String, Object> target) {
         GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
 
@@ -483,7 +483,7 @@
             Debug.logWarning(e, module);
         }
     }
-    
+
     /** Returns the first valid FacilityContactMech found based on the given facilityId and a prioritized list of purposes
      * @param delegator
      * @param facilityId
@@ -493,9 +493,9 @@
     public static GenericValue getFacilityContactMechByPurpose(GenericDelegator delegator, String facilityId, List<String> purposeTypes) {
         if (UtilValidate.isEmpty(facilityId)) return null;
         if (UtilValidate.isEmpty(purposeTypes)) return null;
-        
+
         for (String purposeType: purposeTypes) {
-            List<GenericValue> facilityContactMechPurposes = null;            
+            List<GenericValue> facilityContactMechPurposes = null;
             List<EntityCondition> conditionList = FastList.newInstance();
             conditionList.add(EntityCondition.makeCondition("facilityId", facilityId));
             conditionList.add(EntityCondition.makeCondition("contactMechPurposeTypeId", purposeType));
@@ -523,10 +523,10 @@
                     return EntityUtil.getFirst(facilityContactMechs);
                 }
             }
-            
+
         }
         return null;
-    }    
+    }
 
     public static void getFacilityContactMechAndRelated(ServletRequest request, String facilityId, Map<String, Object> target) {
         GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
@@ -693,7 +693,7 @@
         } catch (GenericEntityException e) {
             Debug.logWarning(e, module);
         }
-    }    
+    }
 
     public static List<Map<String, Object>> getPartyPostalAddresses(ServletRequest request, String partyId, String curContactMechId) {
         GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
@@ -746,7 +746,7 @@
     public static Map<String, Object> getCurrentPostalAddress(ServletRequest request, String partyId, String curContactMechId) {
         GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
         Map<String, Object> results = FastMap.newInstance();
-        
+
         if (curContactMechId != null) {
             List<GenericValue> partyContactMechs = null;
 
@@ -911,13 +911,13 @@
             return attr.getString("attrValue");
         }
     }
-    
+
     public static String getPostalAddressPostalCodeGeoId(GenericValue postalAddress, GenericDelegator delegator) throws GenericEntityException {
         // if postalCodeGeoId not empty use that
         if (UtilValidate.isNotEmpty(postalAddress.getString("postalCodeGeoId"))) {
             return postalAddress.getString("postalCodeGeoId");
         }
-        
+
         // no postalCodeGeoId, see if there is a Geo record matching the countryGeoId and postalCode fields
         if (UtilValidate.isNotEmpty(postalAddress.getString("countryGeoId")) && UtilValidate.isNotEmpty(postalAddress.getString("postalCode"))) {
             // first try the shortcut with the geoId convention for "{countryGeoId}-{postalCode}"
@@ -926,23 +926,23 @@
                 // save the value to the database for quicker future reference
                 postalAddress.set("postalCodeGeoId", geo.getString("geoId"));
                 postalAddress.store();
-                
+
                 return geo.getString("geoId");
             }
 
             // no shortcut, try the longcut to see if there is something with a geoCode associated to the countryGeoId
-            List<GenericValue> geoAssocAndGeoToList = delegator.findByAndCache("GeoAssocAndGeoTo",
+            List<GenericValue> geoAssocAndGeoToList = delegator.findByAndCache("GeoAssocAndGeoTo",
                     UtilMisc.toMap("geoIdFrom", postalAddress.getString("countryGeoId"), "geoCode", postalAddress.getString("postalCode"), "geoAssocTypeId", "REGIONS"));
             GenericValue geoAssocAndGeoTo = EntityUtil.getFirst(geoAssocAndGeoToList);
             if (geoAssocAndGeoTo != null) {
                 // save the value to the database for quicker future reference
                 postalAddress.set("postalCodeGeoId", geoAssocAndGeoTo.getString("geoId"));
                 postalAddress.store();
-                
+
                 return geoAssocAndGeoTo.getString("geoId");
             }
         }
-        
+
         // nothing found, return null
         return null;
     }

Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java?rev=757087&r1=757086&r2=757087&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java Sat Mar 21 23:43:58 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -85,7 +85,7 @@
             return null;
         }
     }
-    
+
     public List<String> getList(String contentTypeId) {
         try {
             return getPartyContentTextList(party, contentTypeId, locale, mimeTypeId, party.getDelegator(), dispatcher);
@@ -219,7 +219,7 @@
         if (contentId != null) {
             partyContent = delegator.findByPrimaryKeyCache("PartyContent", UtilMisc.toMap("partyId", partyId, "contentId", contentId));
         } else {
-            partyContent = getFirstPartyContentByType(partyId, party, partyContentTypeId, delegator);            
+            partyContent = getFirstPartyContentByType(partyId, party, partyContentTypeId, delegator);
         }
         if (partyContent != null) {
             // when rendering the product content, always include the Product and ProductContent records that this comes from

Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyHelper.java?rev=757087&r1=757086&r2=757087&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyHelper.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyHelper.java Sat Mar 21 23:43:58 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -38,9 +38,9 @@
  * PartyHelper
  */
 public class PartyHelper {
-    
+
     public static final String module = PartyHelper.class.getName();
-    
+
     public static String getPartyName(GenericValue partyObject) {
         return getPartyName(partyObject, false);
     }
@@ -56,7 +56,7 @@
             return partyId;
         } else {
             return formatPartyNameObject(partyObject, lastNameFirst);
-        }        
+        }
     }
 
     public static String getPartyName(GenericValue partyObject, boolean lastNameFirst) {
@@ -81,7 +81,7 @@
             }
         }
     }
-    
+
     public static String formatPartyNameObject(GenericValue partyValue, boolean lastNameFirst) {
         if (partyValue == null) {
             return "";

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=757087&r1=757086&r2=757087&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 Sat Mar 21 23:43:58 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

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=757087&r1=757086&r2=757087&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 Sat Mar 21 23:43:58 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,7 +24,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.nio.ByteBuffer;
+import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 
 import javolution.util.FastList;
@@ -218,7 +218,7 @@
                 Debug.logWarning(errorMsg, module);
                 return ServiceUtil.returnError(errorMsg);
             }
-            
+
             // record the oldStatusId and change the party status
             String oldStatusId = party.getString("statusId");
             party.set("statusId", statusId);
@@ -943,7 +943,7 @@
             Debug.logError(e, errMsg, module);
             return ServiceUtil.returnError(errMsg);
         }
-        
+
         //get party types
         try {
             List<GenericValue> partyTypes = delegator.findList("PartyType", null, null, UtilMisc.toList("description"), null, false);
@@ -953,7 +953,7 @@
             Debug.logError(e, errMsg, module);
             return ServiceUtil.returnError(errMsg);
         }
-        
+
         // current party type
         String partyTypeId;
         try {
@@ -1047,14 +1047,14 @@
                 String partyIdFrom = userLogin.getString("partyId");
                 paramList = paramList + "&partyIdFrom=" + partyIdFrom;
                 dynamicView.addAlias("PR", "partyIdFrom");
-                // add the expr
+                // add the expr
                 andExprs.add(EntityCondition.makeCondition(
-                        EntityCondition.makeCondition(EntityFunction.UPPER_FIELD("partyIdFrom"), EntityOperator.EQUALS, EntityFunction.UPPER(partyIdFrom)),
-                        EntityOperator.AND,
+                        EntityCondition.makeCondition(EntityFunction.UPPER_FIELD("partyIdFrom"), EntityOperator.EQUALS, EntityFunction.UPPER(partyIdFrom)),
+                        EntityOperator.AND,
                         EntityCondition.makeCondition(EntityFunction.UPPER_FIELD("partyRelationshipTypeId"), EntityOperator.EQUALS, EntityFunction.UPPER(partyRelationshipTypeId))));
                 fieldsToSelect.add("partyIdTo");
             }
-            
+
             // get the params
             String partyId = (String) context.get("partyId");
             String statusId = (String) context.get("statusId");
@@ -1183,7 +1183,7 @@
                 if (UtilValidate.isNotEmpty(inventoryItemId) ||
                     UtilValidate.isNotEmpty(serialNumber) ||
                     UtilValidate.isNotEmpty(softIdentifier)) {
-                    
+
                     // add role to view
                     dynamicView.addMemberEntity("II", "InventoryItem");
                     dynamicView.addAlias("II", "ownerPartyId");
@@ -1357,7 +1357,7 @@
                     if (highIndex > partyListSize) {
                         highIndex = partyListSize;
                     }
-                    
+
                     // close the list iterator
                     pli.close();
                 } catch (GenericEntityException e) {
@@ -1384,7 +1384,7 @@
      * Changes the association of contact mechs, purposes, notes, orders and attributes from
      * one party to another for the purpose of merging records together. Flags the from party
      * as disabled so it no longer appears in a search.
-     *
+     *
      * @param dctx
      * @param context
      * @return
@@ -1609,7 +1609,7 @@
                 return ServiceUtil.returnError(e.getMessage());
             }
         }
-                
+
         Map<String, Object> resp = ServiceUtil.returnSuccess();
         resp.put("partyId", partyIdTo);
         return resp;
@@ -1657,7 +1657,7 @@
                         delegator.create(addrMap);
                     } catch (GenericEntityException e) {
                         Debug.logError(e, module);
-                        return ServiceUtil.returnError(e.getMessage());                        
+                        return ServiceUtil.returnError(e.getMessage());
                     }
                 }
             } else {

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=757087&r1=757086&r2=757087&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 Sat Mar 21 23:43:58 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -48,9 +48,9 @@
  * Worker methods for Party Information
  */
 public class PartyWorker {
-    
+
     public static String module = PartyWorker.class.getName();
-    
+
     public static Map<String, GenericValue> getPartyOtherValues(ServletRequest request, String partyId, String partyAttr, String personAttr, String partyGroupAttr) {
         GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
         Map<String, GenericValue> result = FastMap.newInstance();
@@ -81,15 +81,15 @@
             Debug.logWarning(e, "Problems getting PartyGroup entity", module);
         }
         return result;
-    }              
-    
+    }
+
     /** @deprecated */
     public static void getPartyOtherValues(PageContext pageContext, String partyId, String partyAttr, String personAttr, String partyGroupAttr) {
         Map<String, GenericValue> partyMap = getPartyOtherValues(pageContext.getRequest(), partyId, partyAttr, personAttr, partyGroupAttr);
         for (Map.Entry<String, GenericValue> e: partyMap.entrySet()) {
             pageContext.setAttribute(e.getKey(), e.getValue());
-            
-        }      
+
+        }
     }
 
     /**
@@ -183,12 +183,12 @@
                 return v.getTimestamp("fromDate");
             } else {
                 return null;
-            }            
+            }
         } catch (GenericEntityException e) {
             Debug.logError(e, "Error while finding latest login time for party with ID [" + partyId + "]: " + e.toString(), module);
             return null;
         }
-        
+
     }
 
     public static Locale findPartyLastLocale(String partyId, GenericDelegator delegator) {