mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
allow customizing the URL where statistics are submitted through ApplicationInfo.xml
This commit is contained in:
@@ -30,4 +30,6 @@
|
||||
|
||||
<plugins-page category="VCS Integration" title="Select VCS Integration Plugins"/>
|
||||
<plugins-page title="Select Other Plugins"/>
|
||||
|
||||
<statistics settings="http://jetbrains.com/idea/statistics/stat-assistant.xml" service="http://jetbrains.com/idea/statistics/index.jsp"/>
|
||||
</component>
|
||||
|
||||
+3
-5
@@ -16,6 +16,7 @@
|
||||
package com.intellij.internal.statistic.connect;
|
||||
|
||||
import com.intellij.facet.frameworks.SettingsConnectionService;
|
||||
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.Function;
|
||||
@@ -28,15 +29,12 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class StatisticsConnectionService extends SettingsConnectionService {
|
||||
|
||||
private static final String SETTINGS_URL = "http://jetbrains.com/idea/statistics/stat-assistant.xml";
|
||||
private static final String DEFAULT_SERVICE_URL = "http://jetbrains.com/idea/statistics/index.jsp";
|
||||
|
||||
private static final String PERMISSION_ATTR_NAME = "permitted";
|
||||
private static final String DISABLED = "disabled";
|
||||
|
||||
public StatisticsConnectionService() {
|
||||
this(SETTINGS_URL, DEFAULT_SERVICE_URL);
|
||||
this(((ApplicationInfoImpl)ApplicationInfoImpl.getShadowInstance()).getStatisticsSettingsUrl(),
|
||||
((ApplicationInfoImpl)ApplicationInfoImpl.getShadowInstance()).getStatisticsServiceUrl());
|
||||
}
|
||||
|
||||
public StatisticsConnectionService(@NotNull String settingsUrl, @Nullable String defaultServiceUrl) {
|
||||
|
||||
+25
@@ -89,6 +89,8 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern
|
||||
@NonNls private String myWebHelpUrl = "http://www.jetbrains.com/idea/webhelp/";
|
||||
private List<PluginChooserPage> myPluginChooserPages = new ArrayList<PluginChooserPage>();
|
||||
private String[] myEssentialPluginsIds;
|
||||
private String myStatisticsSettingsUrl;
|
||||
private String myStatisticsServiceUrl;
|
||||
|
||||
@NonNls private static final String IDEA_PATH = "/idea/";
|
||||
@NonNls private static final String ELEMENT_VERSION = "version";
|
||||
@@ -149,6 +151,11 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern
|
||||
@NonNls private static final String DEFAULT_PLUGINS_HOST = "http://plugins.intellij.net";
|
||||
@NonNls private static final String ESSENTIAL_PLUGIN = "essential-plugin";
|
||||
|
||||
@NonNls private static final String ELEMENT_STATISTICS = "statistics";
|
||||
@NonNls private static final String ATTRIBUTE_STATISTICS_SETTINGS = "settings";
|
||||
@NonNls private static final String ATTRIBUTE_STATISTICS_SERVICE = "service";
|
||||
|
||||
|
||||
public void initComponent() { }
|
||||
|
||||
public void disposeComponent() { }
|
||||
@@ -362,6 +369,14 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern
|
||||
return myShowLicensee;
|
||||
}
|
||||
|
||||
public String getStatisticsSettingsUrl() {
|
||||
return myStatisticsSettingsUrl;
|
||||
}
|
||||
|
||||
public String getStatisticsServiceUrl() {
|
||||
return myStatisticsServiceUrl;
|
||||
}
|
||||
|
||||
private static ApplicationInfoImpl ourShadowInstance;
|
||||
|
||||
public boolean isBetaOrRC() {
|
||||
@@ -584,6 +599,16 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern
|
||||
}
|
||||
});
|
||||
myEssentialPluginsIds = ArrayUtil.toStringArray(essentialPluginsIds);
|
||||
|
||||
Element statisticsElement = parentNode.getChild(ELEMENT_STATISTICS);
|
||||
if (statisticsElement != null) {
|
||||
myStatisticsSettingsUrl = statisticsElement.getAttributeValue(ATTRIBUTE_STATISTICS_SETTINGS);
|
||||
myStatisticsServiceUrl = statisticsElement.getAttributeValue(ATTRIBUTE_STATISTICS_SERVICE);
|
||||
}
|
||||
else {
|
||||
myStatisticsSettingsUrl = "http://jetbrains.com/idea/statistics/stat-assistant.xml";
|
||||
myStatisticsServiceUrl = "http://jetbrains.com/idea/statistics/index.jsp";
|
||||
}
|
||||
}
|
||||
|
||||
private static GregorianCalendar parseDate(final String dateString) {
|
||||
|
||||
Reference in New Issue
Block a user