Author: snjeza
Date: 2012-01-22 13:05:50 -0500 (Sun, 22 Jan 2012)
New Revision: 38020
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/IGoogleAnalyticsParameters.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/PreferencesMessages.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferencePage.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/JBossToolsEclipseEnvironment.java
Log:
JBIDE-10653 detect who have central enabled
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-22
17:32:08 UTC (rev 38019)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java 2012-01-22
18:05:50 UTC (rev 38020)
@@ -70,6 +70,8 @@
// appendParameter(IGoogleAnalyticsParameters.PARAM_HID,
// getRandomNumber(), builder);
appendParameter(IGoogleAnalyticsParameters.PARAM_FLASH_VERSION,
googleParameters.getFlashVersion(), builder);
+ appendParameter(IGoogleAnalyticsParameters.PARAM_EVENT_TRACKING,
googleParameters.getCentralEnabled(), builder);
+
appendParameter(IGoogleAnalyticsParameters.PARAM_REFERRAL,
googleParameters.getReferral(), builder);
appendParameter(IGoogleAnalyticsParameters.PARAM_PAGE_REQUEST, focusPoint.getURI(),
builder);
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/IGoogleAnalyticsParameters.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/IGoogleAnalyticsParameters.java 2012-01-22
17:32:08 UTC (rev 38019)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/IGoogleAnalyticsParameters.java 2012-01-22
18:05:50 UTC (rev 38020)
@@ -33,6 +33,7 @@
public static final String PARAM_PAGE_REQUEST = "utmp";
public static final String PARAM_ACCOUNT_NAME = "utmac";
public static final String PARAM_HOST_NAME = "utmhn";
+ public static final String PARAM_EVENT_TRACKING = "utme";
public static final String PARAM_COOKIES = "utmcc";
public static final String PARAM_COOKIES_UNIQUE_VISITOR_ID = "__utma";
public static final String PARAM_COOKIES_SESSION = "__utmb";
@@ -110,4 +111,8 @@
* @return a user defined value
*/
public String getUserDefined();
+
+ public String getCentralEnabled();
+
+ public String getCentralEnabledValue();
}
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/PreferencesMessages.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/PreferencesMessages.java 2012-01-22
17:32:08 UTC (rev 38019)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/PreferencesMessages.java 2012-01-22
18:05:50 UTC (rev 38020)
@@ -32,7 +32,8 @@
public static String UsageReportPreferencePage_ScreenColors;
public static String UsageReportPreferencePage_ScreenResolution;
public static String UsageReportPreferencePage_Error_Saving;
-
+ public static String UsageReportPreferencePage_JBossCentralEnabled;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, PreferencesMessages.class);
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferencePage.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferencePage.java 2012-01-22
17:32:08 UTC (rev 38019)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferencePage.java 2012-01-22
18:05:50 UTC (rev 38020)
@@ -127,6 +127,9 @@
appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_CurrentUsageHit,
getFormattedDate(eclipseEnvironment.getCurrentVisit()), builder,
styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_JBossCentralEnabled,
+ eclipseEnvironment.getCentralEnabledValue(), builder,
+ styles);
text.setText(builder.toString());
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties 2012-01-22
17:32:08 UTC (rev 38019)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties 2012-01-22
18:05:50 UTC (rev 38020)
@@ -5,6 +5,7 @@
UsageReportPreferencePage_JBossToolsVersion=Version\:
UsageReportPreferencePage_LastUsageHit=Last usage reported on\:
UsageReportPreferencePage_Locale=Locale\:
+UsageReportPreferencePage_JBossCentralEnabled=JBoss Central Enabled\:
UsageReportPreferencePage_NumberOfUsageHits=Number of usage-hits\:
UsageReportPreferencePage_OperatingSystem=Operating system\:
UsageReportPreferencePage_OperatingSystemVersion=Operating system version\:
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/JBossToolsEclipseEnvironment.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/JBossToolsEclipseEnvironment.java 2012-01-22
17:32:08 UTC (rev 38019)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/JBossToolsEclipseEnvironment.java 2012-01-22
18:05:50 UTC (rev 38020)
@@ -15,16 +15,25 @@
import org.eclipse.core.runtime.IBundleGroupProvider;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.jboss.tools.usage.googleanalytics.IJBossToolsEclipseEnvironment;
import org.jboss.tools.usage.googleanalytics.eclipse.AbstractEclipseEnvironment;
import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
+import org.osgi.framework.Bundle;
/**
* @author Andre Dietisheim
*/
public class JBossToolsEclipseEnvironment extends AbstractEclipseEnvironment implements
IJBossToolsEclipseEnvironment {
+ private static final String CLOSED_BRACKET = ")"; //$NON-NLS-1$
+ private static final String TRUE = "true";
+ private static final String FALSE = "false";
private static final char JBOSS_COMPONENTS_DELIMITER = '-';
+ private static final String JBOSS_CENTRAL_PLUGIN_ID =
"org.jboss.tools.central"; //$NON-NLS-1$
+ private static final String SHOW_JBOSS_CENTRAL_ON_STARTUP =
"showJBossCentralOnStartup"; //$NON-NLS-1$
+ private static final boolean SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE = true;
+ private static final String JBOSS_CENTRAL_PARAMETER =
"5(central*showOnStartup*"; //$NON-NLS-1$
public JBossToolsEclipseEnvironment(String accountName, String hostName,
IEclipsePreferences preferences) {
super(accountName, hostName, preferences);
@@ -57,4 +66,22 @@
public boolean isLinuxDistro() {
return getLinuxDistroNameAndVersion() != null;
}
+
+ public String getCentralEnabled() {
+ return JBOSS_CENTRAL_PARAMETER + getCentralEnabledValue() + CLOSED_BRACKET;
+ }
+
+ public String getCentralEnabledValue() {
+ Bundle bundle = Platform.getBundle(JBOSS_CENTRAL_PLUGIN_ID);
+ if (bundle == null) {
+ return FALSE;
+ }
+ IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(JBOSS_CENTRAL_PLUGIN_ID);
+ boolean showOnStartup = prefs.getBoolean(SHOW_JBOSS_CENTRAL_ON_STARTUP,
+ SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
+ if (showOnStartup) {
+ return TRUE;
+ }
+ return FALSE;
+ }
}