Author: adietish
Date: 2010-09-22 12:12:17 -0400 (Wed, 22 Sep 2010)
New Revision: 25098
Added:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSConstants.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSMessageKeysUtils.java
Removed:
trunk/usage/plugins/org.jboss.tools.usage/OSGI-INF/propertiesprovider-factory.xml
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/FocusPoint.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/ILoggingAdapter.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/ITracker.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/IURLBuildingStrategy.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/JBossToolsFocusPoint.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/PluginLogger.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/Tracker.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/UsageMessages.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/messages.properties
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageSettings.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/PreferencesMessages.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/UsageReportPreferencePage.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/messages.properties
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingMessages.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/UsageReport.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/UsageReportEnablementDialog.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/messages.properties
Log:
[JBDS-1321] extracted reporting (GA) url into message.properties, renamed the account-key
Deleted:
trunk/usage/plugins/org.jboss.tools.usage/OSGI-INF/propertiesprovider-factory.xml
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/OSGI-INF/propertiesprovider-factory.xml 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/OSGI-INF/propertiesprovider-factory.xml 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component
xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
activate="activate" immediate="true" modified="updated"
name="org.jboss.tools.usage.propertiesprovider.factory">
- <implementation
class="org.jboss.tools.usage.http.HttpRemotePropertiesProviderFactory"/>
- <property name="url" type="String"
value="testUrl"/>
- <service>
- <provide
interface="org.jboss.tools.usage.http.IPropertiesProviderFactory"/>
- <provide interface="org.osgi.service.cm.ManagedService"/>
- </service>
-</scr:component>
Deleted:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/FocusPoint.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/FocusPoint.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/FocusPoint.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.usage;
-
-import org.jboss.tools.usage.util.HttpEncodingUtils;
-
-/**
- * Focus point of the application. It can represent data points like application
- * load, application module load, user actions, error events etc.
- *
- * @author Andre Dietisheim
- * @see based on <a
- *
href="http://jgoogleAnalytics.googlecode.com">http://jgoogleAnalytics
- * .googlecode.com</a>
- */
-public class FocusPoint {
-
- private String name;
- private FocusPoint childFocusPoint;
- public static final String URI_SEPARATOR = "/";
- public static final String TITLE_SEPARATOR = "-";
-
- public FocusPoint(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public FocusPoint setChild(FocusPoint childFocusPoint) {
- this.childFocusPoint = childFocusPoint;
- return this;
- }
-
- public FocusPoint getChild() {
- return childFocusPoint;
- }
-
- public String getURI() {
- StringBuilder builder = new StringBuilder();
- appendContentURI(builder, this);
- return HttpEncodingUtils.checkedEncodeUtf8(builder.toString());
- }
-
- protected void appendContentURI(StringBuilder builder, FocusPoint focusPoint) {
- FocusPoint parentFocuPoint = focusPoint.getChild();
- builder.append(URI_SEPARATOR);
- builder.append(focusPoint.getName());
- if (parentFocuPoint != null) {
- appendContentURI(builder, parentFocuPoint);
- }
- }
-
- public String getTitle() {
- StringBuilder builder = new StringBuilder();
- appendContentTitle(builder, this);
- return HttpEncodingUtils.checkedEncodeUtf8(builder.toString());
- }
-
- protected void appendContentTitle(StringBuilder builder, FocusPoint focusPoint) {
- FocusPoint childFocusPoint = focusPoint.getChild();
- builder.append(focusPoint.getName());
- if (childFocusPoint != null) {
- builder.append(TITLE_SEPARATOR);
- appendContentTitle(builder, childFocusPoint);
- }
- }
-}
Deleted:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/ILoggingAdapter.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/ILoggingAdapter.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/ILoggingAdapter.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.usage;
-
-/**
- * @author Andre Dietisheim
- */
-public interface ILoggingAdapter {
-
- public void logError(String errorMessage);
-
- public void logMessage(String message);
-
-}
Deleted:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/ITracker.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/ITracker.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/ITracker.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.usage;
-
-import java.io.UnsupportedEncodingException;
-
-/**
- * @author Andre Dietisheim
- */
-public interface ITracker {
-
- /**
- * Track the focusPoint in the application synchronously. <br/>
- * <red><b>Please be cognizant while using this method. Since, it would
have
- * a peformance hit on the actual application. Use it unless it's really
- * needed</b></red>
- *
- * @param focusPoint
- * Focus point of the application like application load,
- * application module load, user actions, error events etc.
- * @throws UnsupportedEncodingException
- */
-
- public abstract void trackSynchronously(FocusPoint focusPoint);
-
- /**
- * Track the focusPoint in the application asynchronously. <br/>
- *
- * @param focusPoint
- * Focus point of the application like application load,
- * application module load, user actions, error events etc.
- */
-
- public abstract void trackAsynchronously(FocusPoint focusPoint);
-
-}
\ No newline at end of file
Deleted:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/IURLBuildingStrategy.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/IURLBuildingStrategy.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/IURLBuildingStrategy.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.usage;
-
-import java.io.UnsupportedEncodingException;
-
-/**
- * Interface for the URL building strategy
- *
- * @author Andre Dietisheim
- *
- */
-public interface IURLBuildingStrategy {
-
- public String build(FocusPoint focusPoint) throws UnsupportedEncodingException;
-
-}
Deleted:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/JBossToolsFocusPoint.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/JBossToolsFocusPoint.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/JBossToolsFocusPoint.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.usage;
-
-import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
-import org.jboss.tools.usage.util.HttpEncodingUtils;
-
-/**
- * A focus point that always reports the current jboss tools version as last
- * component.
- */
-public class JBossToolsFocusPoint extends FocusPoint {
-
- public JBossToolsFocusPoint(String name) {
- super(name);
- }
-
- @Override
- public String getURI() {
- StringBuilder builder = new StringBuilder();
- appendContentURI(builder, this);
- appendJBossToolsVersion(builder, URI_SEPARATOR);
- return HttpEncodingUtils.checkedEncodeUtf8(builder.toString());
- }
-
- protected void appendJBossToolsVersion(StringBuilder builder, String separator) {
- builder.append(separator);
- builder.append(getJBossToolsVersion());
- }
-
- @Override
- public String getTitle() {
- StringBuilder builder = new StringBuilder();
- appendContentTitle(builder, this);
- appendJBossToolsVersion(builder, TITLE_SEPARATOR);
- return HttpEncodingUtils.checkedEncodeUtf8(builder.toString());
- }
-
- protected String getJBossToolsVersion() {
- return JBossToolsUsageActivator.getDefault().getBundle().getVersion().toString();
- }
-}
Deleted:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/PluginLogger.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/PluginLogger.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/PluginLogger.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.usage;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.jboss.tools.usage.util.LoggingUtils;
-
-/**
- * @author Andre Dietisheim
- */
-public class PluginLogger implements ILoggingAdapter {
-
- private final boolean tracingEnabled;
-
- private Plugin plugin;
-
- public PluginLogger(Plugin plugin) {
- this.tracingEnabled = LoggingUtils.isPluginTracingEnabled(plugin);
- this.plugin = plugin;
- }
-
- public void logError(String message) {
- log(IStatus.ERROR, message);
- }
-
- public void logMessage(String message) {
- log(IStatus.INFO, message);
- }
-
- private void log(int severity, String message) {
- if (!tracingEnabled) {
- return;
- }
-
- if (plugin != null) {
- IStatus status = new Status(severity, plugin.getBundle().getSymbolicName(), message);
- plugin.getLog().log(status);
- }
- }
-}
Deleted: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/Tracker.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/Tracker.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/Tracker.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.usage;
-
-import java.io.UnsupportedEncodingException;
-import java.text.MessageFormat;
-
-import org.jboss.tools.usage.http.IHttpGetRequest;
-
-/**
- * Reports (tracks) usage
- *
- * @author Andre Dietisheim
- * @see based on <a
- *
href="http://jgoogleAnalytics.googlecode.com">http://jgoogleAnalytics
- * .googlecode.com</a>
- */
-public class Tracker implements ITracker {
-
- private IURLBuildingStrategy urlBuildingStrategy = null;
- private IHttpGetRequest httpRequest;
- private ILoggingAdapter loggingAdapter;
-
- public Tracker(IURLBuildingStrategy urlBuildingStrategy, IHttpGetRequest httpGetRequest,
ILoggingAdapter loggingAdapter) {
- this.httpRequest = httpGetRequest;
- this.loggingAdapter = loggingAdapter;
- this.urlBuildingStrategy = urlBuildingStrategy;
- }
-
- public void trackSynchronously(FocusPoint focusPoint) {
- loggingAdapter
- .logMessage(MessageFormat.format(UsageMessages.Tracker_Synchronous,
focusPoint.getTitle()));
- try {
- httpRequest.request(getTrackingUrl(focusPoint));
- } catch (Exception e) {
- loggingAdapter.logError(MessageFormat.format(UsageMessages.Tracker_Error,
e.getMessage()));
- }
- }
-
- protected String getTrackingUrl(FocusPoint focusPoint) throws
UnsupportedEncodingException {
- return urlBuildingStrategy.build(focusPoint);
- }
-
- public void trackAsynchronously(FocusPoint focusPoint) {
- loggingAdapter.logMessage(MessageFormat
- .format(UsageMessages.Tracker_Asynchronous, focusPoint.getTitle()));
- new Thread(new TrackingRunnable(focusPoint)).start();
- }
-
- private class TrackingRunnable implements Runnable {
- private FocusPoint focusPoint;
-
- private TrackingRunnable(FocusPoint focusPoint) {
- this.focusPoint = focusPoint;
- }
-
- public void run() {
- try {
- httpRequest.request(getTrackingUrl(focusPoint));
- } catch (Exception e) {
- loggingAdapter.logError(MessageFormat.format(UsageMessages.Tracker_Error,
e.getMessage()));
- }
- }
- }
-}
Deleted:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/UsageMessages.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/UsageMessages.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/UsageMessages.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.usage;
-
-import org.eclipse.osgi.util.NLS;
-
-public class UsageMessages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.usage.messages";
//$NON-NLS-1$
- public static String Tracker_Synchronous;
- public static String Tracker_Asynchronous;
- public static String Tracker_Error;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, UsageMessages.class);
- }
-
- private UsageMessages() {
- }
-}
Added:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSConstants.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSConstants.java
(rev 0)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSConstants.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.usage.internal;
+
+public class JBDSConstants {
+ /** the suffix that gets added to message keys when reporting JBDS */
+ public static final String JBDS_MESSAGEKEY_SUFFIX = "_JBDS";
+
+ /** the JBDS product feature id */
+ public static final String JBDS_PRODUCT_ID =
"com.jboss.jbds.product.feature";
+}
Property changes on:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSMessageKeysUtils.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSMessageKeysUtils.java
(rev 0)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSMessageKeysUtils.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.usage.internal;
+
+import org.eclipse.core.runtime.IProduct;
+import org.eclipse.core.runtime.Platform;
+
+public class JBDSMessageKeysUtils {
+
+ private static Boolean isJBDS = null;
+
+ /**
+ * Returns the JBDS specific message key if the current product is JBDS or
+ * the original, given, untouched message key if not.
+ *
+ * @param messageKey
+ * the message key
+ * @return the message key
+ */
+ public static String getMessageKey(String messageKey) {
+ if (isJBDS()) {
+ return messageKey + JBDSConstants.JBDS_MESSAGEKEY_SUFFIX;
+ } else {
+ return messageKey;
+ }
+ }
+
+ public static boolean isJBDS() {
+ if (isJBDS == null) {
+ IProduct product = Platform.getProduct();
+ isJBDS = (product != null
+ && JBDSConstants.JBDS_PRODUCT_ID.equals(product.getId()));
+ }
+ return isJBDS;
+ }
+}
Property changes on:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSMessageKeysUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/messages.properties
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/messages.properties 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/messages.properties 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,3 +0,0 @@
-Tracker_Asynchronous=Tracking asynchronously focusPoint \"{0}\"
-Tracker_Error=Tracking failed, exception thrown\: "{0}"
-Tracker_Synchronous=Tracking synchronously focusPoint \"{0}\"
\ No newline at end of file
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageSettings.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageSettings.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageSettings.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -12,9 +12,13 @@
import java.util.Map;
+import org.eclipse.core.runtime.IProduct;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.jboss.tools.usage.http.HttpRemotePropertiesProvider;
import org.jboss.tools.usage.http.IPropertiesProvider;
+import org.jboss.tools.usage.internal.JBDSConstants;
+import org.jboss.tools.usage.internal.JBDSMessageKeysUtils;
/**
* A class that implements a global reporting enablement setting. The current
@@ -33,10 +37,10 @@
public static final String REMOTEPROPS_USAGE_REPORTING_ENABLED_KEY =
USAGE_REPORTING_ENABLED_KEY + "="; //$NON-NLS-1$
- /** the enablement default for the local instance */
+ /** the enablement default for the local instance */
private static final boolean INSTANCE_USAGE_REPORTING_ENABLED_DEFAULT = true;
- /** the enablement default for all instances */
+ /** the enablement default for all instances */
private static final boolean ALLINSTANCES_USAGE_REPORTING_ENABLED_DEFAULT = false;
/** the delimiter that delimits the key/value-pairs */
@@ -46,7 +50,7 @@
public GlobalUsageSettings(Plugin plugin) {
remoteMap = createRemoteMap(
- PreferencesMessages.GlobalUsageSettings_RemoteProps_URL
+ JBDSMessageKeysUtils.getMessageKey(PreferencesMessages.GlobalUsageSettings_RemoteProps_URL)
, VALUE_DELIMITER
, plugin
, REMOTEPROPS_USAGE_REPORTING_ENABLED_KEY);
@@ -63,7 +67,9 @@
/**
* Returns <code>true</code> if reporting is enabled for all instances. The
- * appropriate setting is queried in a remote properties file at {@link
#REMOTEPROPS_URL}. The key is {@link #REMOTEPROPS_ALLINSTANCES_ENABLED_DEFAULT}
+ * appropriate setting is queried in a remote properties file at
+ * {@link #REMOTEPROPS_URL}. The key is
+ * {@link #REMOTEPROPS_ALLINSTANCES_ENABLED_DEFAULT}
*
* @return <code>true, if the remote peer is set to enabled
*
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/PreferencesMessages.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/PreferencesMessages.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/PreferencesMessages.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -21,6 +21,12 @@
public static String GlobalUsageSettings_RemoteProps_URL;
+ public static String UsageReportPreferencePage_Description_JBDS;
+ public static String UsageReportPreferencePage_AllowReporting_JBDS;
+ public static String UsageReportPreferencePage_Error_Saving_JBDS;
+
+ public static String GlobalUsageSettings_RemoteProps_URL_JBDS;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, PreferencesMessages.class);
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/UsageReportPreferencePage.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/UsageReportPreferencePage.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/UsageReportPreferencePage.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -15,6 +15,7 @@
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.jboss.tools.usage.internal.JBDSMessageKeysUtils;
import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
import org.jboss.tools.usage.util.StatusUtils;
import org.osgi.service.prefs.BackingStoreException;
@@ -31,13 +32,13 @@
public void createFieldEditors() {
addField(new BooleanFieldEditor(
IUsageReportPreferenceConstants.USAGEREPORT_ENABLED_ID
- , PreferencesMessages.UsageReportPreferencePage_AllowReporting
+ ,
JBDSMessageKeysUtils.getMessageKey(PreferencesMessages.UsageReportPreferencePage_AllowReporting)
, getFieldEditorParent()));
}
public void init(IWorkbench workbench) {
setPreferenceStore(UsageReportPreferences.createPreferenceStore());
- setDescription(PreferencesMessages.UsageReportPreferencePage_Description);
+ setDescription(JBDSMessageKeysUtils.getMessageKey(PreferencesMessages.UsageReportPreferencePage_Description));
}
@Override
@@ -46,7 +47,7 @@
UsageReportPreferences.flush();
} catch (BackingStoreException e) {
IStatus status = StatusUtils.getErrorStatus(JBossToolsUsageActivator.PLUGIN_ID,
- PreferencesMessages.UsageReportPreferencePage_Error_Saving, e);
+ JBDSMessageKeysUtils.getMessageKey(PreferencesMessages.UsageReportPreferencePage_Error_Saving),
e);
JBossToolsUsageActivator.getDefault().getLog().log(status);
}
return super.performOk();
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/messages.properties
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/messages.properties 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/messages.properties 2010-09-22
16:12:17 UTC (rev 25098)
@@ -8,6 +8,4 @@
UsageReportPreferencePage_Description_JBDS=Preference page with options for anonymous
usage data reporting. Usage data is used for statistical matters only.
UsageReportPreferencePage_AllowReporting_JBDS=&Please allow the Red Hat Inc. to
receive anonymous usage statistics for this JBoss Developer Studio installation.
UsageReportPreferencePage_Error_Saving_JBDS=Could not save the preferences.
-GlobalUsageSettings_RemoteProps_URL_JBDS=
-
GlobalUsageSettings_RemoteProps_URL_JBDS=http://anonsvn.jboss.org/repos/j...
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingMessages.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingMessages.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingMessages.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -18,15 +18,21 @@
public static String UsageReport_Reporting_Usage;
public static String UsageReport_Querying_Enablement;
public static String UsageReport_Asking_User;
+ public static String UsageReport_DialogTitle;
+ public static String UsageReport_Error_SavePreferences;
+
public static String UsageReport_Checkbox_Text;
public static String UsageReport_DialogMessage;
- public static String UsageReport_DialogTitle;
-
- public static String UsageReport_Error_SavePreferences;
public static String UsageReport_GoogleAnalytics_Account;
public static String UsageReport_HostName;
- public static String UsageReport_WikiPage;
-
+ public static String UsageReport_ExplanationPage;
+
+ public static String UsageReport_Checkbox_Text_JBDS;
+ public static String UsageReport_DialogMessage_JBDS;
+ public static String UsageReport_GoogleAnalytics_Account_JBDS;
+ public static String UsageReport_HostName_JBDS;
+ public static String UsageReport_ExplanationPage_JBDS;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, ReportingMessages.class);
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/UsageReport.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/UsageReport.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/UsageReport.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -23,6 +23,7 @@
import org.jboss.tools.usage.googleanalytics.IGoogleAnalyticsParameters;
import org.jboss.tools.usage.http.HttpGetRequest;
import org.jboss.tools.usage.http.IHttpGetRequest;
+import org.jboss.tools.usage.internal.JBDSMessageKeysUtils;
import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
import org.jboss.tools.usage.preferences.GlobalUsageSettings;
import org.jboss.tools.usage.preferences.UsageReportPreferences;
@@ -90,8 +91,8 @@
private ITracker getTracker() {
IGoogleAnalyticsParameters eclipseEnvironment = new ReportingEclipseEnvironment(
- ReportingMessages.UsageReport_GoogleAnalytics_Account
- , ReportingMessages.UsageReport_HostName
+ JBDSMessageKeysUtils.getMessageKey(ReportingMessages.UsageReport_GoogleAnalytics_Account)
+ , JBDSMessageKeysUtils.getMessageKey(ReportingMessages.UsageReport_HostName)
, UsageReportPreferencesUtils.getPreferences());
ILoggingAdapter loggingAdapter = new
PluginLogger(JBossToolsUsageActivator.getDefault());
IURLBuildingStrategy urlStrategy = new GoogleAnalyticsUrlStrategy(eclipseEnvironment);
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/UsageReportEnablementDialog.java
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/UsageReportEnablementDialog.java 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/UsageReportEnablementDialog.java 2010-09-22
16:12:17 UTC (rev 25098)
@@ -22,6 +22,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.usage.internal.JBDSMessageKeysUtils;
import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
import org.jboss.tools.usage.util.BrowserUtil;
@@ -65,12 +66,12 @@
// message
Link link = new Link(composite, SWT.WRAP);
link.setFont(parent.getFont());
- link.setText(ReportingMessages.UsageReport_DialogMessage);
+ link.setText(JBDSMessageKeysUtils.getMessageKey(ReportingMessages.UsageReport_DialogMessage));
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
BrowserUtil.checkedCreateExternalBrowser(
- ReportingMessages.UsageReport_WikiPage,
+ JBDSMessageKeysUtils.getMessageKey(ReportingMessages.UsageReport_ExplanationPage),
JBossToolsUsageActivator.PLUGIN_ID,
JBossToolsUsageActivator.getDefault().getLog());
}
@@ -83,7 +84,7 @@
// checkbox
checkBox = new Button(composite, SWT.CHECK);
- checkBox.setText(ReportingMessages.UsageReport_Checkbox_Text);
+ checkBox.setText(JBDSMessageKeysUtils.getMessageKey(ReportingMessages.UsageReport_Checkbox_Text));
GridDataFactory.fillDefaults().grab(true, false).align(SWT.LEFT,
SWT.CENTER).applyTo(checkBox);
applyDialogFont(composite);
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/messages.properties
===================================================================
---
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/messages.properties 2010-09-22
15:56:26 UTC (rev 25097)
+++
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/messages.properties 2010-09-22
16:12:17 UTC (rev 25098)
@@ -1,17 +1,18 @@
UsageReport_Reporting_Usage=Reporting JBoss Developer Studio usage
UsageReport_Querying_Enablement=Querying whether reporting is globally enabled
UsageReport_Asking_User=Asking User to allow reporting
-UsageReport_Checkbox_Text=Report usage of JBoss Developer Studio to Red Hat Inc.
-UsageReport_DialogMessage=Please allow Red Hat Inc. to receive anonymous usage statistics
for this JBoss Developer Studio installation (<a>info</a>).
UsageReport_DialogTitle=JBoss Developer Studio Usage
UsageReport_Error_SavePreferences=Could not save preferences {0}
-# this shall be refactored when we switch away from IStartup
-UsageReport_GoogleAnalyticsAccount=UA-17645367-1
+
+UsageReport_DialogMessage=Please allow JBoss Tools team to receive anonymous usage
statistics for this Eclipse instance with JBoss Tools (<a>info</a>).
+UsageReport_Checkbox_Text=Report usage of JBoss Tools to JBoss Tools team.
+UsageReport_GoogleAnalytics_Account=UA-17645367-1
UsageReport_HostName=jboss.org
+UsageReport_ExplanationPage=http://jboss.org/tools/usage
-UsageReport_WikiPage=http://devstudio.jboss.com/usage
+UsageReport_DialogMessage_JBDS=Please allow Red Hat Inc. to receive anonymous usage
statistics for this JBoss Developer Studio installation (<a>info</a>).
+UsageReport_Checkbox_Text_JBDS=Report usage of JBoss Developer Studio to Red Hat Inc.
+UsageReport_GoogleAnalytics_Account=UA-18653195-1
+UsageReport_HostName=devstudio.jboss.com
+UsageReport_ExplanationPage_JBDS=http://devstudio.jboss.com/usage
-# this is a hack to get into the code freeze deadline. this stuff will be removed with a
proper implementatino
-UsageReport_GoogleAnalyticsAccount=UA-18653195-1
-UsageReport_HostName=devstudio.jboss.com
-UsageReport_ExplanationPage=http://devstudio.jboss.com/usage