Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-10-05 22:56:23 -0400
committerSteffen Pingel2013-09-26 15:45:58 -0400
commitb25ac21444f9250945fa89c2a9bb20cb8c8d67b6 (patch)
tree83ddfbc36c084485080e714b5f22838aa25edbbd
parentd4245c3b3223e8fbae7927a5acc0cc8401690448 (diff)
downloadorg.eclipse.mylyn.tasks-b25ac21444f9250945fa89c2a9bb20cb8c8d67b6.tar.gz
org.eclipse.mylyn.tasks-b25ac21444f9250945fa89c2a9bb20cb8c8d67b6.tar.xz
org.eclipse.mylyn.tasks-b25ac21444f9250945fa89c2a9bb20cb8c8d67b6.zip
386117: [api] declare repository connector extensions in tasks.core
Change-Id: I9eafa88b5731e9aaf1d46bd0f91e1b3c51f4f129 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=386117
-rw-r--r--org.eclipse.mylyn.bugzilla.core/plugin.properties3
-rw-r--r--org.eclipse.mylyn.bugzilla.core/plugin.xml28
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryMigrator.java (renamed from org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryMigrator.java)11
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskListMigrator.java (renamed from org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListMigrator.java)6
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/plugin.properties1
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/plugin.xml12
-rw-r--r--org.eclipse.mylyn.tasks.core/plugin.xml1
-rw-r--r--org.eclipse.mylyn.tasks.core/schema/repositories.exsd160
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/ContributorBlackList.java46
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/RepositoryConnectorExtensionReader.java34
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/RepositoryTemplateExtensionReader.java134
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/TasksCoreExtensionReader.java32
-rw-r--r--org.eclipse.mylyn.tasks.ui/schema/repositories.exsd2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/RepositoryConnectorUiExtensionReader.java15
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java112
-rw-r--r--org.eclipse.mylyn.trac.core/build.properties3
-rw-r--r--org.eclipse.mylyn.trac.core/plugin.properties3
-rw-r--r--org.eclipse.mylyn.trac.core/plugin.xml29
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryMigrator.java (renamed from org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryMigrator.java)3
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskListMigrator.java (renamed from org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListMigrator.java)4
-rw-r--r--org.eclipse.mylyn.trac.ui/plugin.properties1
-rw-r--r--org.eclipse.mylyn.trac.ui/plugin.xml28
23 files changed, 486 insertions, 185 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/plugin.properties b/org.eclipse.mylyn.bugzilla.core/plugin.properties
index c5952f978..89e3bca72 100644
--- a/org.eclipse.mylyn.bugzilla.core/plugin.properties
+++ b/org.eclipse.mylyn.bugzilla.core/plugin.properties
@@ -11,3 +11,6 @@
#Properties file for org.eclipse.mylyn.bugzilla.core
Bundle-Vendor = Eclipse Mylyn
Bundle-Name = Mylyn Bugzilla Connector Core
+
+bugzilla.repository.name=Bugzilla Repository
+BugzillaRepositoryConnector.name=Bugzilla Repository Connector
diff --git a/org.eclipse.mylyn.bugzilla.core/plugin.xml b/org.eclipse.mylyn.bugzilla.core/plugin.xml
index 4e1d101ca..3f62193f6 100644
--- a/org.eclipse.mylyn.bugzilla.core/plugin.xml
+++ b/org.eclipse.mylyn.bugzilla.core/plugin.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?><!--
+<?eclipse version="3.0"?>
+<!--
Copyright (c) 2009 Tasktop Technologies and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
@@ -9,15 +10,22 @@
Contributors:
Tasktop Technologies - initial API and implementation
-->
-
<plugin>
<extension-point id="languages" name="languages" schema="schema/languages.exsd"/>
-<!--<extension
- point="org.eclipse.mylyn.tasks.ui.duplicateDetectors">
- <detector
- class="org.eclipse.mylyn.internal.bugzilla.core.BugzillaStackTraceDuplicateDetector"
- kind="bugzilla"
- name="Stack Trace">
- </detector>
- </extension>-->
+
+ <extension
+ id="org.eclipse.mylyn.bugzilla.repository"
+ name="%bugzilla.repository.name"
+ point="org.eclipse.mylyn.tasks.core.repositories">
+
+ <connectorCore
+ id="bugzilla"
+ class="org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector"
+ name="%BugzillaRepositoryConnector.name"/>
+
+ <taskListMigrator
+ class="org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskListMigrator"/>
+ <repositoryMigrator
+ class="org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryMigrator"/>
+ </extension>
</plugin>
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryMigrator.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryMigrator.java
index 1f3189877..47864ee96 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryMigrator.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryMigrator.java
@@ -9,19 +9,18 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.internal.bugzilla.ui.tasklist;
+package org.eclipse.mylyn.internal.bugzilla.core;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorExtensions;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryMigrator;
import org.eclipse.mylyn.tasks.core.TaskRepository;
/**
* @author Robert Elves
- * @since 3.4
*/
public class BugzillaRepositoryMigrator extends AbstractRepositoryMigrator {
+ public static final String REPOSITORY_PROPERTY_AVATAR_SUPPORT = "avatarSupport"; //$NON-NLS-1$
+
@Override
public String getConnectorKind() {
return BugzillaCorePlugin.CONNECTOR_KIND;
@@ -35,9 +34,9 @@ public class BugzillaRepositoryMigrator extends AbstractRepositoryMigrator {
migrated = true;
}
// FIXME the Eclipse.org Bugzilla URL should not be hard coded here
- if (repository.getProperty(TaskEditorExtensions.REPOSITORY_PROPERTY_AVATAR_SUPPORT) == null
+ if (repository.getProperty(REPOSITORY_PROPERTY_AVATAR_SUPPORT) == null
&& "https://bugs.eclipse.org/bugs".equals(repository.getRepositoryUrl())) { //$NON-NLS-1$
- repository.setProperty(TaskEditorExtensions.REPOSITORY_PROPERTY_AVATAR_SUPPORT, Boolean.TRUE.toString());
+ repository.setProperty(REPOSITORY_PROPERTY_AVATAR_SUPPORT, Boolean.TRUE.toString());
migrated = true;
}
return migrated;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListMigrator.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskListMigrator.java
index 906634829..a5c386030 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListMigrator.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskListMigrator.java
@@ -9,14 +9,11 @@
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.internal.bugzilla.ui.tasklist;
+package org.eclipse.mylyn.internal.bugzilla.core;
import java.util.HashSet;
import java.util.Set;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
@@ -24,7 +21,6 @@ import org.w3c.dom.Element;
/**
* @author Rob Elves
- * @since 3.0
*/
public class BugzillaTaskListMigrator extends AbstractTaskListMigrator {
diff --git a/org.eclipse.mylyn.bugzilla.ui/plugin.properties b/org.eclipse.mylyn.bugzilla.ui/plugin.properties
index b85d0c50d..9817e67ce 100644
--- a/org.eclipse.mylyn.bugzilla.ui/plugin.properties
+++ b/org.eclipse.mylyn.bugzilla.ui/plugin.properties
@@ -13,7 +13,6 @@ Bundle-Vendor = Eclipse Mylyn
Bundle-Name = Mylyn Bugzilla Connector UI
bugzilla.repository.name=Bugzilla Repository
-BugzillaRepositoryConnector.name=Bugzilla Repository Connector
tasklist.BugzillaConnectorUi.name=Bugzilla Repository UI
Mark_not_obsolete_Action_Label = Mark not obsolete
diff --git a/org.eclipse.mylyn.bugzilla.ui/plugin.xml b/org.eclipse.mylyn.bugzilla.ui/plugin.xml
index d7cdb8c80..d3a2d512c 100644
--- a/org.eclipse.mylyn.bugzilla.ui/plugin.xml
+++ b/org.eclipse.mylyn.bugzilla.ui/plugin.xml
@@ -16,23 +16,11 @@
id="org.eclipse.mylyn.bugzilla.repository"
name="%bugzilla.repository.name"
point="org.eclipse.mylyn.tasks.ui.repositories">
-
- <connectorCore
- id="bugzilla"
- class="org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector"
- name="%BugzillaRepositoryConnector.name"/>
-
<connectorUi
brandingIcon="icons/eview16/bugzilla-logo.gif"
class="org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaConnectorUi"
name="%tasklist.BugzillaConnectorUi.name"
overlayIcon="icons/eview16/overlay-bugzilla.gif"/>
-
- <taskListMigrator
- class="org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaTaskListMigrator"/>
- <repositoryMigrator
- class="org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaRepositoryMigrator">
- </repositoryMigrator>
</extension>
<extension
point="org.eclipse.mylyn.bugzilla.core.languages">
diff --git a/org.eclipse.mylyn.tasks.core/plugin.xml b/org.eclipse.mylyn.tasks.core/plugin.xml
index cb398f106..5661bb737 100644
--- a/org.eclipse.mylyn.tasks.core/plugin.xml
+++ b/org.eclipse.mylyn.tasks.core/plugin.xml
@@ -18,4 +18,5 @@
<extension-point id="activityMonitor" name="Task Activity Monitor" schema="schema/activityMonitor.exsd"/>
<extension-point id="contextStore" name="Task Context Store" schema="schema/contextStore.exsd"/>
<extension-point id="repositoryConnectorContributor" name="Repository Connector Contributor" schema="schema/repositoryConnectorContributor.exsd"/>
+ <extension-point id="repositories" name="Task Repositories" schema="schema/repositories.exsd"/>
</plugin>
diff --git a/org.eclipse.mylyn.tasks.core/schema/repositories.exsd b/org.eclipse.mylyn.tasks.core/schema/repositories.exsd
new file mode 100644
index 000000000..68d567078
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.core/schema/repositories.exsd
@@ -0,0 +1,160 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.mylyn.tasks.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.mylyn.tasks.core" id="repositories" name="Repositories"/>
+ </appInfo>
+ <documentation>
+ Connectors provide integrations with task repositories. For more information please see: http://wiki.eclipse.org/index.php/Mylyn_Integrator_Reference.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ <documentation>
+ (no description available)
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="connectorCore" minOccurs="1" maxOccurs="1"/>
+ <element ref="taskListMigrator" minOccurs="0" maxOccurs="1"/>
+ <element ref="repositoryMigrator" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="taskListMigrator">
+ <annotation>
+ <appInfo>
+ <meta.element labelAttribute="name"/>
+ </appInfo>
+ <documentation>
+ (no description available)
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator:"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="connectorCore">
+ <annotation>
+ <documentation>
+ (no description available)
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="repositoryMigrator">
+ <annotation>
+ <documentation>
+ (no description available)
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.mylyn.tasks.core.AbstractRepositoryMigrator:"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 2.0
+ </documentation>
+ </annotation>
+
+
+
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2013 Tasktop Technologies and others.
+All rights reserved. This program and the accompanying materials
+are 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
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/ContributorBlackList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/ContributorBlackList.java
new file mode 100644
index 000000000..599d47149
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/ContributorBlackList.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.core.util;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+
+/**
+ * Manages a list of plug-in IDs that have been black listed for contributions.
+ */
+public class ContributorBlackList {
+
+ /**
+ * Plug-in ids of connector extensions that are black listed.
+ */
+ private final Set<String> disabledContributors = new HashSet<String>();
+
+ public boolean isDisabled(IConfigurationElement element) {
+ return disabledContributors.contains(element.getContributor().getName());
+ }
+
+ public Set<String> getDisabledContributors() {
+ return Collections.unmodifiableSet(new HashSet<String>(disabledContributors));
+ }
+
+ public void disableContributor(String pluginId) {
+ disabledContributors.add(pluginId);
+ }
+
+ public void merge(ContributorBlackList blackList) {
+ disabledContributors.addAll(blackList.getDisabledContributors());
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/RepositoryConnectorExtensionReader.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/RepositoryConnectorExtensionReader.java
index 3523a502a..8f6c78c79 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/RepositoryConnectorExtensionReader.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/RepositoryConnectorExtensionReader.java
@@ -13,11 +13,9 @@ package org.eclipse.mylyn.internal.tasks.core.util;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
@@ -56,6 +54,8 @@ public class RepositoryConnectorExtensionReader {
private static final String EXTENSION_CONTRIBUTORS = ITasksCoreConstants.ID_PLUGIN
+ ".repositoryConnectorContributor"; //$NON-NLS-1$
+ private static final String EXTENSION_REPOSITORIES = ITasksCoreConstants.ID_PLUGIN + ".repositories"; //$NON-NLS-1$
+
private static class ConnectorFactory {
private AbstractRepositoryConnector connector;
@@ -197,10 +197,7 @@ public class RepositoryConnectorExtensionReader {
}
- /**
- * Plug-in ids of connector extensions that failed to load.
- */
- private final Set<String> disabledContributors = new HashSet<String>();
+ private final ContributorBlackList blackList = new ContributorBlackList();
private final TaskListExternalizer taskListExternalizer;
@@ -210,26 +207,29 @@ public class RepositoryConnectorExtensionReader {
private final List<RepositoryConnectorDescriptor> descriptors = new ArrayList<RepositoryConnectorDescriptor>();
- private MultiStatus result;
+ private final MultiStatus result;
public RepositoryConnectorExtensionReader(TaskListExternalizer taskListExternalizer,
TaskRepositoryManager repositoryManager) {
this.taskListExternalizer = taskListExternalizer;
this.repositoryManager = repositoryManager;
+ this.result = new MultiStatus(ITasksCoreConstants.ID_PLUGIN, 0, "Repository connectors failed to load.", null); //$NON-NLS-1$
}
- public void registerConnectors(IExtensionPoint repositoriesExtensionPoint) {
- if (result != null) {
- throw new IllegalStateException("registerConnectors may only be invoked once"); //$NON-NLS-1$
- }
-
- result = new MultiStatus(ITasksCoreConstants.ID_PLUGIN, 0, "Repository connectors failed to load.", null); //$NON-NLS-1$
-
+ public void loadConnectors(IExtensionPoint repositoriesExtensionPoint) {
Map<String, List<ConnectorFactory>> factoryById = readFromRepositoriesExtensionPoint(repositoriesExtensionPoint);
checkForConflicts(factoryById);
+ }
+
+ public void loadConnectorsFromRepositoriesExtension() {
+ loadConnectors(Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_REPOSITORIES));
+ }
+ public void loadConnectorsFromContributors() {
readFromContributorsExtensionPoint();
+ }
+ public void registerConnectors() {
Map<String, List<ConnectorFactory>> factoryByConnectorKind = createConnectorInstances();
checkForConflicts(factoryByConnectorKind);
@@ -366,7 +366,7 @@ public class RepositoryConnectorExtensionReader {
for (ConnectorFactory factory : entry.getValue()) {
status.add(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, NLS.bind(
"All extensions contributed by ''{0}'' have been disabled.", factory.getPluginId()), null)); //$NON-NLS-1$
- disabledContributors.add(factory.getPluginId());
+ blackList.disableContributor(factory.getPluginId());
factories.remove(factory);
}
result.add(status);
@@ -387,8 +387,8 @@ public class RepositoryConnectorExtensionReader {
return new ArrayList<RepositoryConnectorDescriptor>(descriptors);
}
- public Set<String> getDisabledContributors() {
- return new HashSet<String>(disabledContributors);
+ public ContributorBlackList getBlackList() {
+ return blackList;
}
public IStatus getResult() {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/RepositoryTemplateExtensionReader.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/RepositoryTemplateExtensionReader.java
new file mode 100644
index 000000000..b1ee232b7
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/RepositoryTemplateExtensionReader.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.core.util;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.mylyn.commons.core.StatusHandler;
+import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
+import org.eclipse.mylyn.internal.tasks.core.RepositoryTemplateManager;
+import org.eclipse.mylyn.tasks.core.IRepositoryManager;
+import org.eclipse.mylyn.tasks.core.RepositoryTemplate;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Mik Kersten
+ * @author Shawn Minto
+ * @author Rob Elves
+ */
+public class RepositoryTemplateExtensionReader {
+
+ public static final String EXTENSION_TEMPLATES = "org.eclipse.mylyn.tasks.core.templates"; //$NON-NLS-1$
+
+ public static final String EXTENSION_TMPL_REPOSITORY = "repository"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_LABEL = "label"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_URLREPOSITORY = "urlRepository"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_REPOSITORYKIND = "repositoryKind"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_CHARACTERENCODING = "characterEncoding"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_ANONYMOUS = "anonymous"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_VERSION = "version"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_URLNEWTASK = "urlNewTask"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_URLTASK = "urlTask"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_URLTASKQUERY = "urlTaskQuery"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_NEWACCOUNTURL = "urlNewAccount"; //$NON-NLS-1$
+
+ public static final String ELMNT_TMPL_ADDAUTO = "addAutomatically"; //$NON-NLS-1$
+
+ private final IRepositoryManager repositoryManager;
+
+ private final RepositoryTemplateManager templateManager;
+
+ public RepositoryTemplateExtensionReader(IRepositoryManager repositoryManager,
+ RepositoryTemplateManager templateManager) {
+ this.repositoryManager = repositoryManager;
+ this.templateManager = templateManager;
+
+ }
+
+ public void loadExtensions(ContributorBlackList blackList) {
+ MultiStatus result = new MultiStatus(ITasksCoreConstants.ID_PLUGIN, 0,
+ "Unexpected error while loading repository template extensions", null); //$NON-NLS-1$
+
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint templatesExtensionPoint = registry.getExtensionPoint(EXTENSION_TEMPLATES);
+ IExtension[] templateExtensions = templatesExtensionPoint.getExtensions();
+ for (IExtension templateExtension : templateExtensions) {
+ IConfigurationElement[] elements = templateExtension.getConfigurationElements();
+ for (IConfigurationElement element : elements) {
+ if (!blackList.isDisabled(element)) {
+ if (element.getName().equals(EXTENSION_TMPL_REPOSITORY)) {
+ IStatus status = readRepositoryTemplate(element);
+ if (!status.isOK()) {
+ result.add(status);
+ }
+ }
+ }
+ }
+ }
+
+ if (!result.isOK()) {
+ StatusHandler.log(result);
+ }
+ }
+
+ private IStatus readRepositoryTemplate(IConfigurationElement element) {
+ String label = element.getAttribute(ELMNT_TMPL_LABEL);
+ String serverUrl = element.getAttribute(ELMNT_TMPL_URLREPOSITORY);
+ String repKind = element.getAttribute(ELMNT_TMPL_REPOSITORYKIND);
+ String version = element.getAttribute(ELMNT_TMPL_VERSION);
+ String newTaskUrl = element.getAttribute(ELMNT_TMPL_URLNEWTASK);
+ String taskPrefix = element.getAttribute(ELMNT_TMPL_URLTASK);
+ String taskQueryUrl = element.getAttribute(ELMNT_TMPL_URLTASKQUERY);
+ String newAccountUrl = element.getAttribute(ELMNT_TMPL_NEWACCOUNTURL);
+ String encoding = element.getAttribute(ELMNT_TMPL_CHARACTERENCODING);
+ boolean addAuto = Boolean.parseBoolean(element.getAttribute(ELMNT_TMPL_ADDAUTO));
+ boolean anonymous = Boolean.parseBoolean(element.getAttribute(ELMNT_TMPL_ANONYMOUS));
+
+ if (serverUrl != null && label != null && repKind != null
+ && repositoryManager.getRepositoryConnector(repKind) != null) {
+ RepositoryTemplate template = new RepositoryTemplate(label, serverUrl, encoding, version, newTaskUrl,
+ taskPrefix, taskQueryUrl, newAccountUrl, anonymous, addAuto);
+ for (IConfigurationElement configElement : element.getChildren()) {
+ String name = configElement.getAttribute("name"); //$NON-NLS-1$
+ String value = configElement.getAttribute("value"); //$NON-NLS-1$
+ if (name != null && name.length() > 0 && value != null) {
+ template.addAttribute(name, value);
+ }
+ }
+ templateManager.addTemplate(repKind, template);
+ return Status.OK_STATUS;
+ } else {
+ return new Status(
+ IStatus.ERROR,
+ ITasksCoreConstants.ID_PLUGIN,
+ NLS.bind(
+ "Could not load repository template extension contributed by ''{0}'' with connectorKind ''{1}''", element.getNamespaceIdentifier(), repKind)); //$NON-NLS-1$
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/TasksCoreExtensionReader.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/TasksCoreExtensionReader.java
new file mode 100644
index 000000000..164109059
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/TasksCoreExtensionReader.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.core.util;
+
+import org.eclipse.mylyn.commons.core.ExtensionPointReader;
+import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
+import org.eclipse.mylyn.internal.tasks.core.context.DefaultTaskContextStore;
+import org.eclipse.mylyn.tasks.core.context.AbstractTaskContextStore;
+
+public class TasksCoreExtensionReader {
+
+ public static AbstractTaskContextStore loadTaskContextStore() {
+ ExtensionPointReader<AbstractTaskContextStore> reader = new ExtensionPointReader<AbstractTaskContextStore>(
+ ITasksCoreConstants.ID_PLUGIN, "contextStore", "contextStore", AbstractTaskContextStore.class); //$NON-NLS-1$ //$NON-NLS-2$
+ reader.read();
+ AbstractTaskContextStore contextStore = reader.getItem();
+ if (contextStore != null) {
+ return contextStore;
+ }
+ return new DefaultTaskContextStore();
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/schema/repositories.exsd b/org.eclipse.mylyn.tasks.ui/schema/repositories.exsd
index 3b6fd1f41..8acdaf825 100644
--- a/org.eclipse.mylyn.tasks.ui/schema/repositories.exsd
+++ b/org.eclipse.mylyn.tasks.ui/schema/repositories.exsd
@@ -21,7 +21,7 @@
</annotation>
<complexType>
<sequence>
- <element ref="connectorCore"/>
+ <element ref="connectorCore" minOccurs="0" maxOccurs="1"/>
<element ref="connectorUi" minOccurs="0" maxOccurs="1"/>
<element ref="taskListMigrator" minOccurs="0" maxOccurs="1"/>
<element ref="repositoryMigrator" minOccurs="0" maxOccurs="1"/>
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
index 1993562d5..1855dabdf 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
@@ -85,6 +85,7 @@ import org.eclipse.mylyn.internal.tasks.core.externalization.ExternalizationMana
import org.eclipse.mylyn.internal.tasks.core.externalization.IExternalizationParticipant;
import org.eclipse.mylyn.internal.tasks.core.externalization.TaskListExternalizationParticipant;
import org.eclipse.mylyn.internal.tasks.core.externalization.TaskListExternalizer;
+import org.eclipse.mylyn.internal.tasks.core.util.TasksCoreExtensionReader;
import org.eclipse.mylyn.internal.tasks.ui.actions.ActivateTaskDialogAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.NewTaskAction;
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotificationReminder;
@@ -1443,7 +1444,7 @@ public class TasksUiPlugin extends AbstractUIPlugin {
public static synchronized AbstractTaskContextStore getContextStore() {
if (contextStore == null) {
- contextStore = TasksUiExtensionReader.loadTaskContextStore();
+ contextStore = TasksCoreExtensionReader.loadTaskContextStore();
}
return contextStore;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/RepositoryConnectorUiExtensionReader.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/RepositoryConnectorUiExtensionReader.java
index 392e2b320..21b21a447 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/RepositoryConnectorUiExtensionReader.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/RepositoryConnectorUiExtensionReader.java
@@ -28,6 +28,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.ui.CommonImages;
+import org.eclipse.mylyn.internal.tasks.core.util.ContributorBlackList;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.spi.RepositoryConnectorBranding;
@@ -55,17 +56,13 @@ public class RepositoryConnectorUiExtensionReader {
/**
* Plug-in ids of connector extensions that failed to load.
*/
- private final Set<String> disabledContributors;
+ private final ContributorBlackList blackList;
- public RepositoryConnectorUiExtensionReader(IExtensionRegistry registry, Set<String> disabledContributors) {
+ public RepositoryConnectorUiExtensionReader(IExtensionRegistry registry, ContributorBlackList blackList) {
Assert.isNotNull(registry);
- Assert.isNotNull(disabledContributors);
+ Assert.isNotNull(blackList);
this.registry = registry;
- this.disabledContributors = disabledContributors;
- }
-
- private boolean isDisabled(IConfigurationElement element) {
- return disabledContributors.contains(element.getContributor().getName());
+ this.blackList = blackList;
}
public void registerConnectorUis() {
@@ -139,7 +136,7 @@ public class RepositoryConnectorUiExtensionReader {
for (IExtension repositoryExtension : repositoryExtensions) {
IConfigurationElement[] elements = repositoryExtension.getConfigurationElements();
for (IConfigurationElement element : elements) {
- if (!isDisabled(element)) {
+ if (!blackList.isDisabled(element)) {
if (element.getName().equals(ELMNT_REPOSITORY_UI)) {
registerRepositoryConnectorUi(element);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java
index ed07f17e1..b362e513e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java
@@ -28,13 +28,14 @@ import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.internal.tasks.core.activity.DefaultTaskActivityMonitor;
import org.eclipse.mylyn.internal.tasks.core.context.DefaultTaskContextStore;
import org.eclipse.mylyn.internal.tasks.core.externalization.TaskListExternalizer;
+import org.eclipse.mylyn.internal.tasks.core.util.ContributorBlackList;
import org.eclipse.mylyn.internal.tasks.core.util.RepositoryConnectorExtensionReader;
+import org.eclipse.mylyn.internal.tasks.core.util.RepositoryTemplateExtensionReader;
import org.eclipse.mylyn.internal.tasks.ui.IDynamicSubMenuContributor;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.views.AbstractTaskListPresentation;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.AbstractDuplicateDetector;
-import org.eclipse.mylyn.tasks.core.RepositoryTemplate;
import org.eclipse.mylyn.tasks.core.activity.AbstractTaskActivityMonitor;
import org.eclipse.mylyn.tasks.core.context.AbstractTaskContextStore;
import org.eclipse.mylyn.tasks.core.spi.RepositoryConnectorDescriptor;
@@ -56,32 +57,6 @@ public class TasksUiExtensionReader {
public static final String EXTENSION_REPOSITORY_LINKS_PROVIDERS = "org.eclipse.mylyn.tasks.ui.projectLinkProviders"; //$NON-NLS-1$
- public static final String EXTENSION_TEMPLATES = "org.eclipse.mylyn.tasks.core.templates"; //$NON-NLS-1$
-
- public static final String EXTENSION_TMPL_REPOSITORY = "repository"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_LABEL = "label"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_URLREPOSITORY = "urlRepository"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_REPOSITORYKIND = "repositoryKind"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_CHARACTERENCODING = "characterEncoding"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_ANONYMOUS = "anonymous"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_VERSION = "version"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_URLNEWTASK = "urlNewTask"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_URLTASK = "urlTask"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_URLTASKQUERY = "urlTaskQuery"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_NEWACCOUNTURL = "urlNewAccount"; //$NON-NLS-1$
-
- public static final String ELMNT_TMPL_ADDAUTO = "addAutomatically"; //$NON-NLS-1$
-
public static final String ELMNT_REPOSITORY_LINK_PROVIDER = "linkProvider"; //$NON-NLS-1$
public static final String ELMNT_REPOSITORY_UI = "connectorUi"; //$NON-NLS-1$
@@ -129,7 +104,7 @@ public class TasksUiExtensionReader {
/**
* Plug-in ids of connector extensions that failed to load.
*/
- private static Set<String> disabledContributors = new HashSet<String>();
+ private static ContributorBlackList blackList = new ContributorBlackList();
private static Set<RepositoryConnectorDescriptor> descriptors = new HashSet<RepositoryConnectorDescriptor>();
@@ -139,32 +114,28 @@ public class TasksUiExtensionReader {
IExtensionRegistry registry = Platform.getExtensionRegistry();
// NOTE: has to be read first, consider improving
- IExtensionPoint repositoriesExtensionPoint = registry.getExtensionPoint(EXTENSION_REPOSITORIES);
RepositoryConnectorExtensionReader reader = new RepositoryConnectorExtensionReader(taskListExternalizer,
repositoryManager);
- reader.registerConnectors(repositoriesExtensionPoint);
+ // load core extension point
+ reader.loadConnectorsFromRepositoriesExtension();
+ // load legacy ui extension point
+ reader.loadConnectors(registry.getExtensionPoint(EXTENSION_REPOSITORIES));
+ // load connectors contributed at runtime
+ reader.loadConnectorsFromContributors();
+ reader.registerConnectors();
descriptors.addAll(reader.getDescriptors());
- disabledContributors.addAll(reader.getDisabledContributors());
+ blackList.merge(reader.getBlackList());
- IExtensionPoint templatesExtensionPoint = registry.getExtensionPoint(EXTENSION_TEMPLATES);
- IExtension[] templateExtensions = templatesExtensionPoint.getExtensions();
- for (IExtension templateExtension : templateExtensions) {
- IConfigurationElement[] elements = templateExtension.getConfigurationElements();
- for (IConfigurationElement element : elements) {
- if (!isDisabled(element)) {
- if (element.getName().equals(EXTENSION_TMPL_REPOSITORY)) {
- readRepositoryTemplate(element);
- }
- }
- }
- }
+ RepositoryTemplateExtensionReader templateExtensionReader = new RepositoryTemplateExtensionReader(
+ TasksUi.getRepositoryManager(), TasksUiPlugin.getRepositoryTemplateManager());
+ templateExtensionReader.loadExtensions(blackList);
IExtensionPoint presentationsExtensionPoint = registry.getExtensionPoint(EXTENSION_PRESENTATIONS);
IExtension[] presentations = presentationsExtensionPoint.getExtensions();
for (IExtension presentation : presentations) {
IConfigurationElement[] elements = presentation.getConfigurationElements();
for (IConfigurationElement element : elements) {
- if (!isDisabled(element)) {
+ if (!blackList.isDisabled(element)) {
readPresentation(element);
}
}
@@ -176,7 +147,7 @@ public class TasksUiExtensionReader {
for (IExtension editor : editors) {
IConfigurationElement[] elements = editor.getConfigurationElements();
for (IConfigurationElement element : elements) {
- if (!isDisabled(element)) {
+ if (!blackList.isDisabled(element)) {
if (element.getName().equals(ELMNT_TASK_EDITOR_PAGE_FACTORY)) {
readTaskEditorPageFactory(element);
}
@@ -191,8 +162,7 @@ public class TasksUiExtensionReader {
public static void initWorkbenchUiExtensions() {
IExtensionRegistry registry = Platform.getExtensionRegistry();
- RepositoryConnectorUiExtensionReader reader = new RepositoryConnectorUiExtensionReader(registry,
- disabledContributors);
+ RepositoryConnectorUiExtensionReader reader = new RepositoryConnectorUiExtensionReader(registry, blackList);
reader.registerConnectorUis();
IExtensionPoint linkProvidersExtensionPoint = registry.getExtensionPoint(EXTENSION_REPOSITORY_LINKS_PROVIDERS);
@@ -200,7 +170,7 @@ public class TasksUiExtensionReader {
for (IExtension linkProvidersExtension : linkProvidersExtensions) {
IConfigurationElement[] elements = linkProvidersExtension.getConfigurationElements();
for (IConfigurationElement element : elements) {
- if (!isDisabled(element)) {
+ if (!blackList.isDisabled(element)) {
if (element.getName().equals(ELMNT_REPOSITORY_LINK_PROVIDER)) {
readLinkProvider(element);
}
@@ -213,7 +183,7 @@ public class TasksUiExtensionReader {
for (IExtension dulicateDetectorsExtension : dulicateDetectorsExtensions) {
IConfigurationElement[] elements = dulicateDetectorsExtension.getConfigurationElements();
for (IConfigurationElement element : elements) {
- if (!isDisabled(element)) {
+ if (!blackList.isDisabled(element)) {
if (element.getName().equals(ELMNT_DUPLICATE_DETECTOR)) {
readDuplicateDetector(element);
}
@@ -226,7 +196,7 @@ public class TasksUiExtensionReader {
for (IExtension extension : extensions) {
IConfigurationElement[] elements = extension.getConfigurationElements();
for (IConfigurationElement element : elements) {
- if (!isDisabled(element)) {
+ if (!blackList.isDisabled(element)) {
if (element.getName().equals(DYNAMIC_POPUP_ELEMENT)) {
readDynamicPopupContributor(element);
}
@@ -318,44 +288,6 @@ public class TasksUiExtensionReader {
}
}
- private static void readRepositoryTemplate(IConfigurationElement element) {
- boolean anonymous = false;
- boolean addAuto = false;
-
- String label = element.getAttribute(ELMNT_TMPL_LABEL);
- String serverUrl = element.getAttribute(ELMNT_TMPL_URLREPOSITORY);
- String repKind = element.getAttribute(ELMNT_TMPL_REPOSITORYKIND);
- String version = element.getAttribute(ELMNT_TMPL_VERSION);
- String newTaskUrl = element.getAttribute(ELMNT_TMPL_URLNEWTASK);
- String taskPrefix = element.getAttribute(ELMNT_TMPL_URLTASK);
- String taskQueryUrl = element.getAttribute(ELMNT_TMPL_URLTASKQUERY);
- String newAccountUrl = element.getAttribute(ELMNT_TMPL_NEWACCOUNTURL);
- String encoding = element.getAttribute(ELMNT_TMPL_CHARACTERENCODING);
- addAuto = Boolean.parseBoolean(element.getAttribute(ELMNT_TMPL_ADDAUTO));
- anonymous = Boolean.parseBoolean(element.getAttribute(ELMNT_TMPL_ANONYMOUS));
-
- if (serverUrl != null && label != null && repKind != null
- && TasksUi.getRepositoryManager().getRepositoryConnector(repKind) != null) {
- RepositoryTemplate template = new RepositoryTemplate(label, serverUrl, encoding, version, newTaskUrl,
- taskPrefix, taskQueryUrl, newAccountUrl, anonymous, addAuto);
- TasksUiPlugin.getRepositoryTemplateManager().addTemplate(repKind, template);
-
- for (IConfigurationElement configElement : element.getChildren()) {
- String name = configElement.getAttribute("name"); //$NON-NLS-1$
- String value = configElement.getAttribute("value"); //$NON-NLS-1$
- if (name != null && !name.equals("") && value != null) { //$NON-NLS-1$
- template.addAttribute(name, value);
- }
- }
- } else {
- // TODO change error message to include hints about the cause of the error
- StatusHandler.log(new Status(
- IStatus.ERROR,
- TasksUiPlugin.ID_PLUGIN,
- "Could not load repository template extension contributed by " + element.getNamespaceIdentifier() + " with connectorKind " + repKind)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
private static void readDynamicPopupContributor(IConfigurationElement element) {
try {
Object dynamicPopupContributor = element.createExecutableExtension(ATTR_CLASS);
@@ -442,8 +374,4 @@ public class TasksUiExtensionReader {
return new DefaultTaskContextStore();
}
- private static boolean isDisabled(IConfigurationElement element) {
- return disabledContributors.contains(element.getContributor().getName());
- }
-
}
diff --git a/org.eclipse.mylyn.trac.core/build.properties b/org.eclipse.mylyn.trac.core/build.properties
index bc40384f7..5c5874d11 100644
--- a/org.eclipse.mylyn.trac.core/build.properties
+++ b/org.eclipse.mylyn.trac.core/build.properties
@@ -11,5 +11,6 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
about.html,\
- plugin.properties
+ plugin.properties,\
+ plugin.xml
src.includes = about.html
diff --git a/org.eclipse.mylyn.trac.core/plugin.properties b/org.eclipse.mylyn.trac.core/plugin.properties
index c4229eb75..f50d53281 100644
--- a/org.eclipse.mylyn.trac.core/plugin.properties
+++ b/org.eclipse.mylyn.trac.core/plugin.properties
@@ -11,3 +11,6 @@
#Properties file for org.eclipse.mylyn.trac.core
Bundle-Vendor = Eclipse Mylyn
Bundle-Name = Mylyn Trac Connector Core
+
+repository.name = Trac Repository
+TracRepositoryConnector.name = Trac Connector Core
diff --git a/org.eclipse.mylyn.trac.core/plugin.xml b/org.eclipse.mylyn.trac.core/plugin.xml
new file mode 100644
index 000000000..d3790e5fe
--- /dev/null
+++ b/org.eclipse.mylyn.trac.core/plugin.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ id="org.eclipse.mylyn.trac.repository"
+ name="%repository.name"
+ point="org.eclipse.mylyn.tasks.ui.repositories">
+ <connectorCore
+ class="org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector"
+ id="trac"
+ name="%TracRepositoryConnector.name"/>
+ <taskListMigrator
+ class="org.eclipse.mylyn.internal.trac.core.TracTaskListMigrator">
+ </taskListMigrator>
+ <repositoryMigrator
+ class="org.eclipse.mylyn.internal.trac.core.TracRepositoryMigrator">
+ </repositoryMigrator>
+ </extension>
+ <extension
+ point="org.eclipse.mylyn.tasks.core.templates">
+ <repository
+ addAutomatically="false"
+ anonymous="true"
+ label="Edgewall"
+ repositoryKind="trac"
+ urlRepository="http://trac.edgewall.org"
+ version="TRAC_0_9"/>
+ </extension>
+</plugin>
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryMigrator.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryMigrator.java
index 091f58319..ff8c9d0a1 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryMigrator.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryMigrator.java
@@ -9,9 +9,8 @@
* Steffen Pingel - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.internal.trac.ui;
+package org.eclipse.mylyn.internal.trac.core;
-import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryMigrator;
import org.eclipse.mylyn.tasks.core.TaskRepository;
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListMigrator.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskListMigrator.java
index d7a82b3c8..4e85d0166 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListMigrator.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskListMigrator.java
@@ -9,13 +9,11 @@
* Steffen Pingel - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.internal.trac.ui;
+package org.eclipse.mylyn.internal.trac.core;
import java.util.HashSet;
import java.util.Set;
-import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
import org.eclipse.mylyn.internal.trac.core.util.TracUtil;
import org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
diff --git a/org.eclipse.mylyn.trac.ui/plugin.properties b/org.eclipse.mylyn.trac.ui/plugin.properties
index fe46bb238..46e510440 100644
--- a/org.eclipse.mylyn.trac.ui/plugin.properties
+++ b/org.eclipse.mylyn.trac.ui/plugin.properties
@@ -13,7 +13,6 @@ Bundle-Vendor = Eclipse Mylyn
Bundle-Name = Mylyn Trac Connector UI
repository.name = Trac Repository
-TracRepositoryConnector.name = Trac Connector Core
TracConnectorUi.name = Trac Connector UI
TracHyperlinkDetector.name = Trac Links
diff --git a/org.eclipse.mylyn.trac.ui/plugin.xml b/org.eclipse.mylyn.trac.ui/plugin.xml
index 77f9b1e66..49525a05a 100644
--- a/org.eclipse.mylyn.trac.ui/plugin.xml
+++ b/org.eclipse.mylyn.trac.ui/plugin.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?><!--
- Copyright (c) 2009 Tasktop Technologies and others.
+<?eclipse version="3.0"?>
+<!--
+ Copyright (c) 2009 Steffen Pingel and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -8,41 +9,21 @@
Contributors:
Steffen Pingel - initial API and implementation
+ Tasktop Technologies - improvements
-->
-
<plugin>
<extension
id="org.eclipse.mylyn.trac.repository"
name="%repository.name"
point="org.eclipse.mylyn.tasks.ui.repositories">
- <connectorCore
- class="org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector"
- id="trac"
- name="%TracRepositoryConnector.name"/>
<connectorUi
brandingIcon="icons/eview16/trac-icon.gif"
class="org.eclipse.mylyn.internal.trac.ui.TracConnectorUi"
id="trac"
name="%TracConnectorUi.name"
overlayIcon="icons/eview16/overlay-trac.gif"/>
- <taskListMigrator
- class="org.eclipse.mylyn.internal.trac.ui.TracTaskListMigrator">
- </taskListMigrator>
- <repositoryMigrator
- class="org.eclipse.mylyn.internal.trac.ui.TracRepositoryMigrator">
- </repositoryMigrator>
</extension>
<extension
- point="org.eclipse.mylyn.tasks.core.templates">
- <repository
- addAutomatically="false"
- anonymous="true"
- label="Edgewall"
- repositoryKind="trac"
- urlRepository="http://trac.edgewall.org"
- version="TRAC_0_9"/>
- </extension>
- <extension
point="org.eclipse.mylyn.tasks.ui.editors">
<pageFactory
class="org.eclipse.mylyn.internal.trac.ui.editor.TracTaskEditorPageFactory"
@@ -58,5 +39,4 @@
targetId="org.eclipse.mylyn.tasks.ui.TaskEditor">
</hyperlinkDetector>
</extension>
-
</plugin>

Back to the top