svn commit: r948441 - /ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java

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

svn commit: r948441 - /ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java

doogie-3
Author: doogie
Date: Wed May 26 14:22:27 2010
New Revision: 948441

URL: http://svn.apache.org/viewvc?rev=948441&view=rev
Log:
Allow processTrackingCode to be called externally, to allow for other ways of extracting the code.

Modified:
    ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java

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=948441&r1=948440&r2=948441&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 Wed May 26 14:22:27 2010
@@ -72,7 +72,7 @@ public class TrackingCodeEvents {
                 return "error";
             }
 
-            return processTrackingCode(trackingCode, request, response);
+            return processTrackingCode(trackingCode, request, response, "TKCDSRC_URL_PARAM");
         } else {
             return "success";
         }
@@ -164,13 +164,13 @@ public class TrackingCodeEvents {
                 }
             }
 
-            return processTrackingCode(trackingCode, request, response);
+            return processTrackingCode(trackingCode, request, response, "TKCDSRC_URL_PARAM");
         } else {
             return "success";
         }
     }
 
-    private static String processTrackingCode(GenericValue trackingCode, HttpServletRequest request, HttpServletResponse response) {
+    public static String processTrackingCode(GenericValue trackingCode, HttpServletRequest request, HttpServletResponse response, String sourceEnumId) {
         Delegator delegator = (Delegator) request.getAttribute("delegator");
         String trackingCodeId = trackingCode.getString("trackingCodeId");
 
@@ -192,7 +192,7 @@ public class TrackingCodeEvents {
         } else {
             GenericValue trackingCodeVisit = delegator.makeValue("TrackingCodeVisit",
                     UtilMisc.toMap("trackingCodeId", trackingCodeId, "visitId", visit.get("visitId"),
-                    "fromDate", UtilDateTime.nowTimestamp(), "sourceEnumId", "TKCDSRC_URL_PARAM"));
+                    "fromDate", UtilDateTime.nowTimestamp(), "sourceEnumId", sourceEnumId));
             try {
                 trackingCodeVisit.create();
             } catch (GenericEntityException e) {