Author: adietish
Date: 2012-01-24 04:02:49 -0500 (Tue, 24 Jan 2012)
New Revision: 38073
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/AbstractGoogleAnalyticsParameters.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java
Log:
[JBIDE-10653] moved url building to GoogleAnalyticsUrlStrategy, keeping
AbstractGooleAnalyticsParameter a simple value holder
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/AbstractGoogleAnalyticsParameters.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/AbstractGoogleAnalyticsParameters.java 2012-01-24
08:50:26 UTC (rev 38072)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/AbstractGoogleAnalyticsParameters.java 2012-01-24
09:02:49 UTC (rev 38073)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.usage.googleanalytics;
-import java.text.MessageFormat;
/**
@@ -73,9 +72,5 @@
public String getValue() {
return value;
}
-
- public String toString() {
- return MessageFormat.format("5({0}*{1}*{2})", name, label, value);
- }
}
}
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java 2012-01-24
08:50:26 UTC (rev 38072)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java 2012-01-24
09:02:49 UTC (rev 38073)
@@ -18,7 +18,9 @@
package org.jboss.tools.usage.googleanalytics;
import java.io.UnsupportedEncodingException;
+import java.text.MessageFormat;
+import
org.jboss.tools.usage.googleanalytics.AbstractGoogleAnalyticsParameters.GoogleAnalyticsEvent;
import org.jboss.tools.usage.tracker.IFocusPoint;
import org.jboss.tools.usage.tracker.IURLBuildingStrategy;
import org.jboss.tools.usage.util.HttpEncodingUtils;
@@ -73,7 +75,7 @@
/**
* TODO: support multiple events. Obviously these would just get appended to the very
same string
*/
- appendParameter(IGoogleAnalyticsParameters.PARAM_EVENT_TRACKING,
googleParameters.getEvent().toString(), builder);
+ appendParameter(IGoogleAnalyticsParameters.PARAM_EVENT_TRACKING,
googleParameters.getEvent(), builder);
appendParameter(IGoogleAnalyticsParameters.PARAM_REFERRAL,
googleParameters.getReferral(), builder);
appendParameter(IGoogleAnalyticsParameters.PARAM_PAGE_REQUEST, focusPoint.getURI(),
builder);
@@ -186,6 +188,13 @@
return Integer.toString((int) (Math.random() * 0x7fffffff));
}
+ private void appendParameter(String name, GoogleAnalyticsEvent event, StringBuilder
builder) {
+ appendParameter(name,
+ MessageFormat.format("5({0}*{1}*{2})", event.getName(), event.getLabel(),
event.getValue()),
+ true,
+ builder);
+ }
+
private void appendParameter(String name, String value, StringBuilder builder) {
appendParameter(name, value, true, builder);
}
Show replies by date