svn commit: r757090 - in /ofbiz/trunk/applications/marketing/src/org/ofbiz: marketing/marketing/MarketingServices.java marketing/report/ReportHelper.java marketing/tracking/TrackingCodeEvents.java sfa/vcard/VCard.java

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

svn commit: r757090 - in /ofbiz/trunk/applications/marketing/src/org/ofbiz: marketing/marketing/MarketingServices.java marketing/report/ReportHelper.java marketing/tracking/TrackingCodeEvents.java sfa/vcard/VCard.java

doogie-3
Author: doogie
Date: Sat Mar 21 23:44:30 2009
New Revision: 757090

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

Modified:
    ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/marketing/MarketingServices.java
    ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/report/ReportHelper.java
    ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java
    ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java

Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/marketing/MarketingServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/marketing/MarketingServices.java?rev=757090&r1=757089&r2=757090&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/marketing/MarketingServices.java (original)
+++ ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/marketing/MarketingServices.java Sat Mar 21 23:44:30 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
@@ -81,7 +81,7 @@
             String contactMechId = (String) serviceResults.get("contactMechId");
 
             // create a new association at this fromDate to the anonymous party with status accepted
-            input = UtilMisc.toMap("userLogin", userLogin, "contactListId", contactList.get("contactListId"),
+            input = UtilMisc.toMap("userLogin", userLogin, "contactListId", contactList.get("contactListId"),
                     "partyId", "_NA_", "fromDate", fromDate, "statusId", "CLPT_ACCEPTED", "preferredContactMechId", contactMechId);
             serviceResults = dispatcher.runSync("createContactListParty", input);
             if (ServiceUtil.isError(serviceResults)) {

Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/report/ReportHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/report/ReportHelper.java?rev=757090&r1=757089&r2=757090&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/report/ReportHelper.java (original)
+++ ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/report/ReportHelper.java Sat Mar 21 23:44:30 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
@@ -31,9 +31,9 @@
 public class ReportHelper {
 
     public static final String module = ReportHelper.class.getName();
-    
+
 /**
- * Calculate conversion rates based on a List of visits and orders.  Designed to be used for reporting on
+ * Calculate conversion rates based on a List of visits and orders.  Designed to be used for reporting on
  * tracking code or marketing campaigns
  * @param visits
  * @param orders
@@ -43,16 +43,16 @@
  */
     public static List<Map<String, Object>> calcConversionRates(List<GenericValue> visits, List<GenericValue> orders, String keyFieldName) {
         List<Map<String, Object>> conversionRates = FastList.newInstance();
-        
+
         // loop through all the visits
         for (GenericValue visit: visits) {
             Map<String, Object> reportValue = FastMap.newInstance();
             reportValue.put(keyFieldName, visit.getString(keyFieldName));
             reportValue.put("visits", visit.getLong("visitId")); // actually # of visits
-            
+
             // find the matching entry in orders for the given key field
             List<GenericValue> ordersForThisKey = EntityUtil.filterByAnd(orders, UtilMisc.toMap(keyFieldName, visit.getString(keyFieldName)));
-            
+
             // if there are matching orders, then calculate orders, order amount, and conversion rate
             if ((ordersForThisKey != null) && (ordersForThisKey.size() > 0)) {
                 // note: there should be only one line of order stats per key, so .get(0) should work
@@ -60,15 +60,15 @@
 
                 reportValue.put("orders", orderValue.getLong("orderId")); // # of orders
                 if (orderValue.getDouble("grandTotal") == null) {
-                    reportValue.put("orderAmount", Double.valueOf(0));                    
+                    reportValue.put("orderAmount", Double.valueOf(0));
                 } else {
-                    reportValue.put("orderAmount", orderValue.getDouble("grandTotal"));
+                    reportValue.put("orderAmount", orderValue.getDouble("grandTotal"));
                 }
-                if ((orderValue.getLong("orderId") == null) || (visit.getLong("visitId") == null) ||
+                if ((orderValue.getLong("orderId") == null) || (visit.getLong("visitId") == null) ||
                     (visit.getLong("visitId").intValue() == 0)) {
                     reportValue.put("conversionRate", Double.valueOf(0));
                 } else {
-                    reportValue.put("conversionRate", Double.valueOf(orderValue.getLong("orderId").doubleValue() / visit.getLong("visitId").doubleValue()));    
+                    reportValue.put("conversionRate", Double.valueOf(orderValue.getLong("orderId").doubleValue() / visit.getLong("visitId").doubleValue()));
                 }
             } else {
                 // no matching orders - all those values are zeroes
@@ -76,10 +76,10 @@
                 reportValue.put("orderAmount", Double.valueOf(0));
                 reportValue.put("conversionRate", Double.valueOf(0));
             }
-            
+
             conversionRates.add(reportValue);
         }
-        
+
         return conversionRates;
     }
 }

Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java?rev=757090&r1=757089&r2=757090&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java (original)
+++ ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java Sat Mar 21 23:44:30 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
@@ -47,14 +47,14 @@
 
     public static final String module = TrackingCodeEvents.class.getName();
 
-    /** If TrackingCode monitoring is desired this event should be added to the list
-     * of events that run on every request. This event looks for the parameter
+    /** If TrackingCode monitoring is desired this event should be added to the list
+     * of events that run on every request. This event looks for the parameter
      * <code>autoTrackingCode</code> or a shortened version: <code>atc</code>.
      */
     public static String checkTrackingCodeUrlParam(HttpServletRequest request, HttpServletResponse response) {
         String trackingCodeId = request.getParameter("autoTrackingCode");
         if (UtilValidate.isEmpty(trackingCodeId)) trackingCodeId = request.getParameter("atc");
-        
+
         if (UtilValidate.isNotEmpty(trackingCodeId)) {
             //tracking code is specified on the request, get the TrackingCode value and handle accordingly
             GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
@@ -65,7 +65,7 @@
                 Debug.logError(e, "Error looking up TrackingCode with trackingCodeId [" + trackingCodeId + "], ignoring this trackingCodeId", module);
                 return "error";
             }
-            
+
             if (trackingCode == null) {
                 Debug.logError("TrackingCode not found for trackingCodeId [" + trackingCodeId + "], ignoring this trackingCodeId.", module);
                 //this return value will be ignored, but we'll designate this as an error anyway
@@ -78,12 +78,12 @@
         }
     }
 
-    /** If TrackingCode monitoring is desired this event should be added to the list
-     * of events that run on every request. This event looks for the parameter
+    /** If TrackingCode monitoring is desired this event should be added to the list
+     * of events that run on every request. This event looks for the parameter
      * <code>ptc</code> and handles the value as a Partner Managed Tracking Code.
-     *
+     *
      * If the specified trackingCodeId exists then it is used as is, otherwise a new one
-     * is created with the ptc value as the trackingCodeId. The values for the fields of
+     * is created with the ptc value as the trackingCodeId. The values for the fields of
      * the new TrackingCode can come from one of two places: if a <code>dtc</code> parameter
      * is included the value will be used to lookup a TrackingCode with default values,
      * otherwise the default trackingCodeId will be looked up in the <code>partner.trackingCodeId.default</code>
@@ -91,7 +91,7 @@
      */
     public static String checkPartnerTrackingCodeUrlParam(HttpServletRequest request, HttpServletResponse response) {
         String trackingCodeId = request.getParameter("ptc");
-        
+
         if (UtilValidate.isNotEmpty(trackingCodeId)) {
             //partner managed tracking code is specified on the request
             GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
@@ -102,10 +102,10 @@
                 Debug.logError(e, "Error looking up TrackingCode with trackingCodeId [" + trackingCodeId + "], ignoring this trackingCodeId", module);
                 return "error";
             }
-            
+
             if (trackingCode == null) {
                 //create new TrackingCode with default values from a "dtc" parameter or from a properties file
-                
+
                 String dtc = request.getParameter("dtc");
                 if (UtilValidate.isEmpty(dtc)) {
                     dtc = UtilProperties.getPropertyValue("general", "partner.trackingCodeId.default");
@@ -117,16 +117,16 @@
                     } catch (GenericEntityException e) {
                         Debug.logError(e, "Error looking up Default values TrackingCode with trackingCodeId [" + dtc + "], not using the dtc value for new TrackingCode defaults", module);
                     }
-                    
+
                     if (defaultTrackingCode != null) {
                         defaultTrackingCode.set("trackingCodeId", trackingCodeId);
-                        defaultTrackingCode.set("trackingCodeTypeId", "PARTNER_MGD");
+                        defaultTrackingCode.set("trackingCodeTypeId", "PARTNER_MGD");
                         //null out userLogin fields, no use tracking to customer, or is there?; set dates to current
                         defaultTrackingCode.set("createdDate", UtilDateTime.nowTimestamp());
                         defaultTrackingCode.set("createdByUserLogin", null);
                         defaultTrackingCode.set("lastModifiedDate", UtilDateTime.nowTimestamp());
                         defaultTrackingCode.set("lastModifiedByUserLogin", null);
-                        
+
                         trackingCode = defaultTrackingCode;
                         try {
                             trackingCode.create();
@@ -136,7 +136,7 @@
                         }
                     }
                 }
-                
+
                 //if trackingCode is still null then the defaultTrackingCode thing didn't work out, use empty TrackingCode
                 if (trackingCode == null) {
                     trackingCode = delegator.makeValue("TrackingCode");
@@ -152,9 +152,9 @@
                     trackingCode.set("billableLifetime", Long.valueOf(2592000));
 
                     trackingCode.set("comments", "This TrackingCode has default values because no default TrackingCode could be found.");
-                    
+
                     Debug.logWarning("No default TrackingCode record was found, using a TrackingCode with hard coded default values: " + trackingCode, module);
-                    
+
                     try {
                         trackingCode.create();
                     } catch (GenericEntityException e) {
@@ -173,7 +173,7 @@
     private static String processTrackingCode(GenericValue trackingCode, HttpServletRequest request, HttpServletResponse response) {
         GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
         String trackingCodeId = trackingCode.getString("trackingCodeId");
-        
+
         //check effective dates
         java.sql.Timestamp nowStamp = UtilDateTime.nowTimestamp();
         if (trackingCode.get("fromDate") != null && nowStamp.before(trackingCode.getTimestamp("fromDate"))) {
@@ -184,14 +184,14 @@
             if (Debug.infoOn()) Debug.logInfo("The TrackingCode with ID [" + trackingCodeId + "] has expired, ignoring this trackingCodeId", module);
             return "success";
         }
-        
+
         //persist that info by associating with the current visit
         GenericValue visit = VisitHandler.getVisit(request.getSession());
         if (visit == null) {
             Debug.logWarning("Could not get visit, not associating trackingCode [" + trackingCodeId + "] with visit", module);
         } else {
-            GenericValue trackingCodeVisit = delegator.makeValue("TrackingCodeVisit",
-                    UtilMisc.toMap("trackingCodeId", trackingCodeId, "visitId", visit.get("visitId"),
+            GenericValue trackingCodeVisit = delegator.makeValue("TrackingCodeVisit",
+                    UtilMisc.toMap("trackingCodeId", trackingCodeId, "visitId", visit.get("visitId"),
                     "fromDate", UtilDateTime.nowTimestamp(), "sourceEnumId", "TKCDSRC_URL_PARAM"));
             try {
                 trackingCodeVisit.create();
@@ -200,13 +200,13 @@
             }
         }
 
-        
+
         // write trackingCode cookies with the value set to the trackingCodeId
         // NOTE: just write these cookies and if others exist from other tracking codes they will be overwritten, ie only keep the newest
-        
-        // load the properties from the website entity        
+
+        // load the properties from the website entity
         String cookieDomain = null;
-        
+
         String webSiteId = WebSiteWorker.getWebSiteId(request);
         if (webSiteId != null) {
             try {
@@ -232,7 +232,7 @@
             if (cookieDomain.length() > 0) trackableCookie.setDomain(cookieDomain);
             response.addCookie(trackableCookie);
         }
-        
+
         // if trackingCode.billableLifetime not null and is > 0 write a billable cookie with name in the form: TKCDB_{trackingCode.trackingCodeTypeId} and timeout will be trackingCode.billableLifetime
         Long billableLifetime = trackingCode.getLong("billableLifetime");
         if (billableLifetime != null && (billableLifetime.longValue() > 0 || billableLifetime.longValue() == -1)) {
@@ -242,7 +242,7 @@
             if (cookieDomain.length() > 0) billableCookie.setDomain(cookieDomain);
             response.addCookie(billableCookie);
         }
-        
+
         // if site id exist in cookies then not req to create it if exist with diffrent site then create it
         int siteIdCookieAge = (60 * 60 * 24 * 365); // should this be configurable?
         String siteId = request.getParameter("siteId");
@@ -283,13 +283,13 @@
             session.setAttribute("overrideLogo", overrideLogo);
         String overrideCss = trackingCode.getString("overrideCss");
         if (overrideCss != null)
-            session.setAttribute("overrideCss", overrideCss);  
+            session.setAttribute("overrideCss", overrideCss);
         String prodCatalogId = trackingCode.getString("prodCatalogId");
-        if (prodCatalogId != null && prodCatalogId.length() > 0) {  
-            session.setAttribute("CURRENT_CATALOG_ID", prodCatalogId);  
-            CategoryWorker.setTrail(request, new ArrayList());      
+        if (prodCatalogId != null && prodCatalogId.length() > 0) {
+            session.setAttribute("CURRENT_CATALOG_ID", prodCatalogId);
+            CategoryWorker.setTrail(request, new ArrayList());
         }
-        
+
         // if forward/redirect is needed, do a response.sendRedirect and return null to tell the control servlet to not do any other requests/views
         String redirectUrl = trackingCode.getString("redirectUrl");
         if (UtilValidate.isNotEmpty(redirectUrl)) {
@@ -300,11 +300,11 @@
             }
             return null;
         }
-                
+
         return "success";
     }
-    
-    /** If attaching TrackingCode Cookies to the visit is desired this event should be added to the list
+
+    /** If attaching TrackingCode Cookies to the visit is desired this event should be added to the list
      * of events that run on the first hit in a visit.
      */
     public static String checkTrackingCodeCookies(HttpServletRequest request, HttpServletResponse response) {
@@ -344,10 +344,10 @@
                             if (Debug.infoOn()) Debug.logInfo("The TrackingCode with ID [" + trackingCodeId + "] has expired, ignoring this trackingCodeId", module);
                             continue;
                         }
-                        
+
                         // for each trackingCodeId found in this way attach to the visit with the TKCDSRC_COOKIE sourceEnumId
-                        GenericValue trackingCodeVisit = delegator.makeValue("TrackingCodeVisit",
-                                UtilMisc.toMap("trackingCodeId", trackingCodeId, "visitId", visit.get("visitId"),
+                        GenericValue trackingCodeVisit = delegator.makeValue("TrackingCodeVisit",
+                                UtilMisc.toMap("trackingCodeId", trackingCodeId, "visitId", visit.get("visitId"),
                                 "fromDate", nowStamp, "sourceEnumId", "TKCDSRC_COOKIE"));
                         try {
                             //not doing this inside a transaction, want each one possible to go in
@@ -360,7 +360,7 @@
                 }
             }
         }
-        
+
         return "success";
     }
 
@@ -375,7 +375,7 @@
             if (cookies != null) {
                 for (Cookie cookie : cookies) {
                     if ("TKCDT_ACCESS".equals(cookie.getName())) {
-                        trackingCodeId = cookie.getValue();                        
+                        trackingCodeId = cookie.getValue();
                     }
                 }
             }
@@ -416,7 +416,7 @@
             }
         }
 
-        // no tracking code or tracking code invalid; redirect to the access page (i.e. request named 'protect')  
+        // no tracking code or tracking code invalid; redirect to the access page (i.e. request named 'protect')
         return ":_protect_:";
     }
 
@@ -439,12 +439,12 @@
         GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
         java.sql.Timestamp nowStamp = UtilDateTime.nowTimestamp();
         List trackingCodeOrders = new LinkedList();
-        
+
         Cookie[] cookies = request.getCookies();
         Timestamp affiliateReferredTimeStamp = null;
         String siteId = null;
         String isBillable = null;
-        String trackingCodeId = null;
+        String trackingCodeId = null;
         if (cookies != null && cookies.length > 0) {
             for (int i = 0; i < cookies.length; i++) {
                 String cookieName = cookies[i].getName();
@@ -478,7 +478,7 @@
                     isBillable = "N";
                     trackingCodeId = cookies[i].getValue();
                 }
-                
+
             }
         }
         GenericValue trackingCode = null;
@@ -496,11 +496,11 @@
             if (trackingCode.get("thruDate") != null && nowStamp.after(trackingCode.getTimestamp("thruDate"))) {
                 if (Debug.infoOn()) Debug.logInfo("The TrackingCode with ID [" + trackingCodeId + "] has expired, ignoring this trackingCodeId", module);
             }
-            GenericValue trackingCodeOrder = delegator.makeValue("TrackingCodeOrder",
-                    UtilMisc.toMap("trackingCodeTypeId", trackingCode.get("trackingCodeTypeId"),
+            GenericValue trackingCodeOrder = delegator.makeValue("TrackingCodeOrder",
+                    UtilMisc.toMap("trackingCodeTypeId", trackingCode.get("trackingCodeTypeId"),
                     "trackingCodeId", trackingCodeId, "isBillable", isBillable, "siteId", siteId,
                     "hasExported", "N", "affiliateReferredTimeStamp",affiliateReferredTimeStamp ));
-            
+
             Debug.logInfo(" trackingCodeOrder is " + trackingCodeOrder, module);
             trackingCodeOrders.add(trackingCodeOrder);
         } else {

Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java?rev=757090&r1=757089&r2=757090&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java (original)
+++ ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java Sat Mar 21 23:44:30 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
@@ -67,7 +67,7 @@
 
 public class VCard {
     public static final String module = VCard.class.getName();
-    
+
     public static Map<String, Object> importVCard(DispatchContext dctx, Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = (LocalDispatcher) dctx.getDispatcher();
         GenericDelegator delegator = (GenericDelegator) dctx.getDelegator();
@@ -82,11 +82,11 @@
             ContactIOFactory ciof = Pim.getContactIOFactory();
             ContactUnmarshaller unmarshaller = ciof.createContactUnmarshaller();
             Contact[] contacts = unmarshaller.unmarshallContacts(in);
-            
+
             for (Contact contact: contacts) {
                 PersonalIdentity pid = contact.getPersonalIdentity();
                 Map<String, Object> serviceCtx = UtilMisc.<String, Object>toMap("firstName", pid.getFirstname(), "lastName", pid.getLastname());
-                
+
                 for (Iterator iter = contact.getAddresses(); iter.hasNext();) {
                     Address address = (AddressImpl) iter.next();
                     if (contact.isPreferredAddress(address)) {
@@ -100,7 +100,7 @@
                     }
                 }
                 serviceCtx.put("address1", workAddress.getStreet());
-                serviceCtx.put("city", workAddress.getCity());
+                serviceCtx.put("city", workAddress.getCity());
                 serviceCtx.put("postalCode", workAddress.getPostalCode());
                 EntityCondition cond = EntityCondition.makeCondition(UtilMisc.toList(
                                                     EntityCondition.makeCondition("geoTypeId", EntityOperator.EQUALS, "COUNTRY"),
@@ -110,10 +110,10 @@
 
                 EntityCondition condition = EntityCondition.makeCondition(UtilMisc.toList(
                         EntityCondition.makeCondition("geoTypeId", EntityOperator.EQUALS, "STATE"),
-                        EntityCondition.makeCondition("geoName", EntityOperator.LIKE, workAddress.getRegion())), EntityOperator.AND);
+                        EntityCondition.makeCondition("geoName", EntityOperator.LIKE, workAddress.getRegion())), EntityOperator.AND);
                 GenericValue stateGeo = EntityUtil.getFirst(delegator.findList("Geo", condition, null, null, null, true));
                 serviceCtx.put("stateProvinceGeoId", stateGeo.get("geoId"));
-                
+
                 Communications communications = contact.getCommunications();
                 for (Iterator iter = communications.getEmailAddresses(); iter.hasNext();) {
                     EmailAddress emailAddress = (EmailAddressImpl) iter.next();
@@ -126,7 +126,7 @@
                     }
                 }
                 serviceCtx.put("emailAddress", email);
-                
+
                 for (Iterator iter = communications.getPhoneNumbers(); iter.hasNext();) {
                     PhoneNumber phoneNumber = (PhoneNumberImpl) iter.next();
                     if (phoneNumber.isPreferred()) {
@@ -138,7 +138,7 @@
                     } else { // for now use only preffered / work phone numbers
                         continue;
                     }
-                }
+                }
                 String[] numberParts = phone.split("\\D");
                 String telNumber = "";
                 for (String number: numberParts) {
@@ -148,7 +148,7 @@
                 }
                 serviceCtx.put("areaCode", telNumber.substring(0, 3));
                 serviceCtx.put("contactNumber", telNumber.substring(3));
-                
+
                 GenericValue userLogin = (GenericValue) context.get("userLogin");
                 serviceCtx.put("userLogin", userLogin);
                 String serviceName = (String) context.get("serviceName");
@@ -164,7 +164,7 @@
         }
         return result;
     }
-    
+
     public static Map<String, Object> exportVCard(DispatchContext dctx, Map<String, ? extends Object> context) {
         GenericDelegator delegator = (GenericDelegator) dctx.getDelegator();
         String partyId = (String) context.get("partyId");
@@ -172,28 +172,28 @@
         try {
             ContactModelFactory cmf = Pim.getContactModelFactory();
             Contact contact = cmf.createContact();
-            
+
             PersonalIdentity pid = cmf.createPersonalIdentity();
             String fullName = PartyHelper.getPartyName(delegator, partyId, false);
             String[] name = fullName.split("\\s");
             pid.setFirstname(name[0]);
             pid.setLastname(name[1]);
             contact.setPersonalIdentity(pid);
-            
+
             GenericValue postalAddress = PartyWorker.findPartyLatestPostalAddress(partyId, delegator);
             Address address = cmf.createAddress();
             address.setStreet(postalAddress.getString("address1"));
             address.setCity(postalAddress.getString("city"));
-            
+
             address.setPostalCode(postalAddress.getString("postalCode"));
             String state = postalAddress.getRelatedOne("StateProvinceGeo").getString("geoName");
             address.setRegion(state);
-            
+
             String country = postalAddress.getRelatedOne("CountryGeo").getString("geoName");
             address.setCountry(country);
             address.setWork(true); // this can be better set by checking contactMechPurposeTypeId
             contact.addAddress(address);
-            
+
             Communications communication = cmf.createCommunications();
             contact.setCommunications(communication);
 
@@ -214,7 +214,7 @@
             ContactMarshaller marshaller = ciof.createContactMarshaller();
             String saveToDirectory = UtilProperties.getPropertyValue("sfa.properties", "save.outgoing.directory", "");
             if (UtilValidate.isEmpty(saveToDirectory)) {
-                saveToDirectory = System.getProperty("ofbiz.home");
+                saveToDirectory = System.getProperty("ofbiz.home");
             }
             String saveToFilename = fullName + ".vcf";
             file = FileUtil.getFile(saveToDirectory + "/" + saveToFilename);
@@ -228,7 +228,7 @@
             Debug.logError(e, module);
             return ServiceUtil.returnError("Unable to write data to: " + file.getAbsolutePath());
         } catch (GenericEntityException e) {
-            return ServiceUtil.returnError(e.getMessage());            
+            return ServiceUtil.returnError(e.getMessage());
         }
         return ServiceUtil.returnSuccess();
     }