summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Enoch2014-02-14 11:07:47 (EST)
committerEike Stepper2014-02-15 11:18:30 (EST)
commit29e5310534f227e4a55167bc4702cd361664b6dd (patch)
treeacb6b521e11843ae48ee6e3b569e1666e77eede7
parent7fc9c040a14b2749b7c94d5e5b14043af8dd1252 (diff)
downloadcdo-29e5310534f227e4a55167bc4702cd361664b6dd.zip
cdo-29e5310534f227e4a55167bc4702cd361664b6dd.tar.gz
cdo-29e5310534f227e4a55167bc4702cd361664b6dd.tar.bz2
[425815] [Oomph] Add authentication info for Mylyn task queries and Mylyn buildsrefs/changes/21/22021/3
https://bugs.eclipse.org/bugs/show_bug.cgi?id=425815 Change-Id: If05723a26f56c0e4144e25d983a627878a3c3509 Signed-off-by: Julian Enoch <julian.enoch@ericsson.com>
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties6
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/MylynBuildsTaskItemProvider.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/MylynQueriesTaskItemProvider.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup.editor/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/Configuration.setup4
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore4
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/model/setup.genmodel7
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/AbstractSetupTaskContext.java187
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java31
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/ui/PromptDialog.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/ui/PropertyField.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/MylynBuildsTask.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/MylynQueriesTask.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java120
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MylynBuildsTaskImpl.java147
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MylynQueriesTaskImpl.java130
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java59
18 files changed, 893 insertions, 34 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties b/plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties
index 846486b..3536f94 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.edit/plugin.properties
@@ -27,6 +27,7 @@ _UI_AutomaticSourceLocator_componentNamePattern_feature = Component Name Pattern
_UI_AutomaticSourceLocator_componentTypes_feature = Component Types
_UI_AutomaticSourceLocator_locateNestedProjects_feature = Locate Nested Projects
_UI_AutomaticSourceLocator_location_feature = Location
+_UI_AutomaticSourceLocator_predicates_feature = Predicates
_UI_AutomaticSourceLocator_rootFolder_feature = Root Folder
_UI_AutomaticSourceLocator_type = Automatic Source Locator
_UI_BasicMaterializationTask_bundlePool_feature = Bundle Pool
@@ -142,12 +143,16 @@ _UI_MetaIndex_indexes_feature = Indexes
_UI_MetaIndex_type = Meta Index
_UI_MylynBuildsTask_buildPlans_feature = Build Plans
_UI_MylynBuildsTask_connectorKind_feature = Connector Kind
+_UI_MylynBuildsTask_password_feature = Password
_UI_MylynBuildsTask_serverURL_feature = Server URL
_UI_MylynBuildsTask_type = Mylyn Builds
+_UI_MylynBuildsTask_userID_feature = User ID
_UI_MylynQueriesTask_connectorKind_feature = Connector Kind
+_UI_MylynQueriesTask_password_feature = Password
_UI_MylynQueriesTask_queries_feature = Queries
_UI_MylynQueriesTask_repositoryURL_feature = Repository URL
_UI_MylynQueriesTask_type = Mylyn Queries
+_UI_MylynQueriesTask_userID_feature = User ID
_UI_MylynQueryTask_connectorKind_feature = Connector Kind
_UI_MylynQueryTask_relativeURL_feature = Relative URL
_UI_MylynQueryTask_repositoryURL_feature = Repository URL
@@ -279,4 +284,3 @@ _UI_VariableType_URI_literal = URI
_UI_WorkingSetTask_type = Working Sets
_UI_WorkingSetTask_workingSetGroup_feature = Working Sets
_UI_WorkingSetTask_workingSets_feature = Working Sets
-_UI_AutomaticSourceLocator_predicates_feature = Predicates
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/MylynBuildsTaskItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/MylynBuildsTaskItemProvider.java
index 5d89074..ff8f4ac 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/MylynBuildsTaskItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/MylynBuildsTaskItemProvider.java
@@ -65,6 +65,8 @@ public class MylynBuildsTaskItemProvider extends SetupTaskItemProvider implement
addConnectorKindPropertyDescriptor(object);
addServerURLPropertyDescriptor(object);
+ addUserIDPropertyDescriptor(object);
+ addPasswordPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -104,6 +106,40 @@ public class MylynBuildsTaskItemProvider extends SetupTaskItemProvider implement
}
/**
+ * This adds a property descriptor for the User ID feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addUserIDPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_MylynBuildsTask_userID_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_MylynBuildsTask_userID_feature",
+ "_UI_MylynBuildsTask_type"), SetupPackage.Literals.MYLYN_BUILDS_TASK__USER_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Password feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addPasswordPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_MylynBuildsTask_password_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_MylynBuildsTask_password_feature",
+ "_UI_MylynBuildsTask_type"), SetupPackage.Literals.MYLYN_BUILDS_TASK__PASSWORD, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
@@ -190,6 +226,8 @@ public class MylynBuildsTaskItemProvider extends SetupTaskItemProvider implement
{
case SetupPackage.MYLYN_BUILDS_TASK__CONNECTOR_KIND:
case SetupPackage.MYLYN_BUILDS_TASK__SERVER_URL:
+ case SetupPackage.MYLYN_BUILDS_TASK__USER_ID:
+ case SetupPackage.MYLYN_BUILDS_TASK__PASSWORD:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case SetupPackage.MYLYN_BUILDS_TASK__BUILD_PLANS:
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/MylynQueriesTaskItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/MylynQueriesTaskItemProvider.java
index 965fef0..0cea5d6 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/MylynQueriesTaskItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.edit/src/org/eclipse/emf/cdo/releng/setup/provider/MylynQueriesTaskItemProvider.java
@@ -65,6 +65,8 @@ public class MylynQueriesTaskItemProvider extends SetupTaskItemProvider implemen
addConnectorKindPropertyDescriptor(object);
addRepositoryURLPropertyDescriptor(object);
+ addUserIDPropertyDescriptor(object);
+ addPasswordPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -104,6 +106,40 @@ public class MylynQueriesTaskItemProvider extends SetupTaskItemProvider implemen
}
/**
+ * This adds a property descriptor for the User ID feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addUserIDPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_MylynQueriesTask_userID_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_MylynQueriesTask_userID_feature",
+ "_UI_MylynQueriesTask_type"), SetupPackage.Literals.MYLYN_QUERIES_TASK__USER_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Password feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addPasswordPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_MylynQueriesTask_password_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_MylynQueriesTask_password_feature",
+ "_UI_MylynQueriesTask_type"), SetupPackage.Literals.MYLYN_QUERIES_TASK__PASSWORD, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
@@ -190,6 +226,8 @@ public class MylynQueriesTaskItemProvider extends SetupTaskItemProvider implemen
{
case SetupPackage.MYLYN_QUERIES_TASK__CONNECTOR_KIND:
case SetupPackage.MYLYN_QUERIES_TASK__REPOSITORY_URL:
+ case SetupPackage.MYLYN_QUERIES_TASK__USER_ID:
+ case SetupPackage.MYLYN_QUERIES_TASK__PASSWORD:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case SetupPackage.MYLYN_QUERIES_TASK__QUERIES:
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.editor/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.releng.setup.editor/META-INF/MANIFEST.MF
index c1abb01..4985d9b 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup.editor/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.releng.setup.editor/META-INF/MANIFEST.MF
@@ -27,5 +27,6 @@ Require-Bundle: org.eclipse.core.resources;visibility:=reexport;bundle-version="
org.eclipse.equinox.p2.metadata;bundle-version="[2.0.0,3.0.0)",
org.eclipse.jgit;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.ui.ide;visibility:=reexport;bundle-version="[3.5.0,4.0.0)"
+ org.eclipse.ui.ide;visibility:=reexport;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.equinox.security;bundle-version="[1.1.1,2.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/Configuration.setup b/plugins/org.eclipse.emf.cdo.releng.setup/Configuration.setup
index 740e932..76dcf04 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/Configuration.setup
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/Configuration.setup
@@ -7,6 +7,10 @@
<setupTasks xsi:type="setup:ContextVariableTask" documentation="The folder containing a 1.7 compatible JDK/JRE for architecture ${os.arch}." type="FOLDER" name="jre.1.7.location"/>
<setupTasks xsi:type="setup:ContextVariableTask" documentation="The folder containing a 1.8 compatible JDK/JRE for architecture ${os.arch}." type="FOLDER" name="jre.1.8.location"/>
<setupTasks xsi:type="setup:ContextVariableTask" documentation="The Eclipse user ID for Git/Gerrit commits. Use 'anonymous' if you have no Eclipse user ID." name="git.user.id" label="Eclipse user ID for Git/Gerrit"/>
+ <setupTasks xsi:type="setup:ContextVariableTask" documentation="The Eclipse author name for Git/Gerrit commits. Leave empty if you're not a registered Git author or don't plan to commit to Git." name="git.author.name" label="Eclipse author name for Git/Gerrit"/>
+ <setupTasks xsi:type="setup:ContextVariableTask" documentation="The Eclipse author email for Git/Gerrit commits. Leave empty if you're not a registered Git author or don't plan to commit to Git." name="git.author.email" label="Eclipse author email for Git/Gerrit"/>
+ <setupTasks xsi:type="setup:ContextVariableTask" documentation="The Eclipse user ID for Bugzilla/Hudson. Leave empty if you don't have an account or don't plan to submit bugs." name="eclipse.user.id" label="Eclipse user ID for Bugzilla/Hudson (typically an email address)"/>
+ <setupTasks xsi:type="setup:ContextVariableTask" documentation="The Eclipse password for Bugzilla/Hudson. Leave empty if you don't have an account or don't plan to submit bugs." type="PASSWORD" name="eclipse.user.password" label="Eclipse password for Bugzilla/Hudson"/>
</setupTasks>
<setupTasks xsi:type="setup:CompoundSetupTask" name="Eclipse Tasks">
<setupTasks xsi:type="setup:ContextVariableTask" name="train.name"/>
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.releng.setup/META-INF/MANIFEST.MF
index b7f9867..fe54065 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/META-INF/MANIFEST.MF
@@ -7,8 +7,8 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: javaewah;bundle-version="[0.0.0,1.0.0)";resolution:=optional,
- org.apache.httpcomponents.httpcore;bundle-version="[4.2.0,5.0.0)";resolution:=optional,
org.apache.httpcomponents.httpclient;bundle-version="[4.2.0,5.0.0)";resolution:=optional,
+ org.apache.httpcomponents.httpcore;bundle-version="[4.2.0,5.0.0)";resolution:=optional,
org.eclipse.buckminster.cmdline;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
org.eclipse.buckminster.core;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
org.eclipse.buckminster.download;bundle-version="[1.0.0,2.0.0)";resolution:=optional,
@@ -46,19 +46,21 @@ Require-Bundle: javaewah;bundle-version="[0.0.0,1.0.0)";resolution:=optional,
org.eclipse.equinox.p2.operations;bundle-version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.publisher.eclipse;bundle-version="[1.0.0,2.0.0)",
org.eclipse.equinox.p2.publisher;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.equinox.p2.repository;bundle-version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.repository.tools;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.equinox.p2.repository;bundle-version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.touchpoint.eclipse;bundle-version="[2.1.0,3.0.0)",
org.eclipse.equinox.p2.touchpoint.natives;bundle-version="[1.1.0,2.0.0)",
org.eclipse.equinox.p2.transport.ecf;bundle-version="[1.1.0,2.0.0)",
org.eclipse.equinox.p2.ui;bundle-version="[2.0.0,3.0.0)";resolution:=optional,
org.eclipse.equinox.p2.updatesite;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.equinox.security;bundle-version="[1.1.1,2.0.0)",
org.eclipse.jdt.launching;bundle-version="[3.7.0,4.0.0)";resolution:=optional,
org.eclipse.jface.text;bundle-version="[3.8.0,4.0.0)",
org.eclipse.jgit;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
- org.eclipse.mylyn.commons.repositories.core;bundle-version="[1.2.0,2.0.0)";resolution:=optional,
org.eclipse.mylyn.builds.core;bundle-version="[1.1.0,2.0.0)";resolution:=optional,
org.eclipse.mylyn.builds.ui;bundle-version="[1.1.0,2.0.0)";resolution:=optional,
+ org.eclipse.mylyn.commons.net;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
+ org.eclipse.mylyn.commons.repositories.core;bundle-version="[1.2.0,2.0.0)";resolution:=optional,
org.eclipse.mylyn.tasks.core;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
org.eclipse.mylyn.tasks.ui;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore b/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore
index 6b2382f..85b5193 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.ecore
@@ -381,6 +381,8 @@
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="bugzilla"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="repositoryURL" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="userID" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="password" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="queries" upperBound="-1"
eType="#//Query" containment="true" eOpposite="#//Query/task"/>
</eClassifiers>
@@ -412,6 +414,8 @@
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="org.eclipse.mylyn.hudson"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="serverURL" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="userID" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="password" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="buildPlans" lowerBound="1"
upperBound="-1" eType="#//BuildPlan" containment="true"/>
</eClassifiers>
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.genmodel b/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.genmodel
index af92aa6..9a4916e 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.genmodel
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/model/setup.genmodel
@@ -83,8 +83,6 @@
</genClasses>
<genClasses ecoreClass="setup.ecore#//Preferences">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//Preferences/installFolder"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//Preferences/bundlePoolFolder"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//Preferences/bundlePoolFolderTP"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//Preferences/acceptedLicenses"/>
</genClasses>
<genClasses ecoreClass="setup.ecore#//Setup">
@@ -160,6 +158,7 @@
<genClasses image="false" ecoreClass="setup.ecore#//BasicMaterializationTask"
labelFeature="#//setup/BasicMaterializationTask/targetPlatform">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//BasicMaterializationTask/targetPlatform"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//BasicMaterializationTask/bundlePool"/>
</genClasses>
<genClasses ecoreClass="setup.ecore#//BuckminsterImportTask" labelFeature="#//setup/BuckminsterImportTask/mspec">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//BuckminsterImportTask/mspec"/>
@@ -292,6 +291,8 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//MylynQueriesTask/connectorKind"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//MylynQueriesTask/repositoryURL"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference setup.ecore#//MylynQueriesTask/queries"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//MylynQueriesTask/userID"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//MylynQueriesTask/password"/>
</genClasses>
<genClasses ecoreClass="setup.ecore#//Query">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference setup.ecore#//Query/task"/>
@@ -307,6 +308,8 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//MylynBuildsTask/connectorKind"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//MylynBuildsTask/serverURL"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference setup.ecore#//MylynBuildsTask/buildPlans"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//MylynBuildsTask/userID"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//MylynBuildsTask/password"/>
</genClasses>
<genClasses ecoreClass="setup.ecore#//BuildPlan">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute setup.ecore#//BuildPlan/name"/>
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/AbstractSetupTaskContext.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/AbstractSetupTaskContext.java
index 94880a0..89d2ae6 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/AbstractSetupTaskContext.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/AbstractSetupTaskContext.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Julian Enoch - Add support for secure context variables
*/
package org.eclipse.emf.cdo.releng.internal.setup;
@@ -40,9 +41,13 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.equinox.security.storage.ISecurePreferences;
+import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
+import org.eclipse.equinox.security.storage.StorageException;
import org.eclipse.swt.widgets.Shell;
import java.io.File;
+import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -77,6 +82,8 @@ public abstract class AbstractSetupTaskContext extends HashMap<Object, Object> i
private static final File STATE_DIR = new File(SetupConstants.USER_HOME, ".eclipse/org.eclipse.emf.cdo.releng.setup");
+ protected static final String SECURE_STORAGE_NODE = "org.eclipse.emf.cdo.releng.setup";
+
private static final long serialVersionUID = 1L;
private Trigger trigger;
@@ -404,17 +411,148 @@ public abstract class AbstractSetupTaskContext extends HashMap<Object, Object> i
public static void main(String[] args) throws Exception
{
- final Map<Object, Object> secureMap = new HashMap<Object, Object>();
- secureMap.put("foo\\secure.id", "stepper");
+ class SecurePreferencesMock implements ISecurePreferences
+ {
+ private Map<String, SecurePreferencesMock> nodes = new HashMap<String, SecurePreferencesMock>();
+
+ private Map<String, String> values = new HashMap<String, String>();
+
+ public void removeNode()
+ {
+ }
+
+ public void remove(String key)
+ {
+ }
+
+ public void putLong(String key, long value, boolean encrypt) throws StorageException
+ {
+ }
+
+ public void putInt(String key, int value, boolean encrypt) throws StorageException
+ {
+ }
+
+ public void putFloat(String key, float value, boolean encrypt) throws StorageException
+ {
+ }
+
+ public void putDouble(String key, double value, boolean encrypt) throws StorageException
+ {
+ }
+
+ public void putByteArray(String key, byte[] value, boolean encrypt) throws StorageException
+ {
+ }
+
+ public void putBoolean(String key, boolean value, boolean encrypt) throws StorageException
+ {
+ }
+
+ public void put(String key, String value, boolean encrypt) throws StorageException
+ {
+ values.put(key, value);
+ }
+
+ public ISecurePreferences parent()
+ {
+ return null;
+ }
+
+ public boolean nodeExists(String pathName)
+ {
+ SecurePreferencesMock prefs = nodes.get(pathName);
+ return prefs != null;
+ }
+
+ public ISecurePreferences node(String pathName)
+ {
+ SecurePreferencesMock prefs = nodes.get(pathName);
+ if (prefs == null)
+ {
+ prefs = new SecurePreferencesMock();
+ nodes.put(pathName, prefs);
+ }
+ return prefs;
+ }
+
+ public String name()
+ {
+ return null;
+ }
+
+ public String[] keys()
+ {
+ return null;
+ }
+
+ public boolean isEncrypted(String key) throws StorageException
+ {
+ return false;
+ }
+
+ public long getLong(String key, long def) throws StorageException
+ {
+ return 0;
+ }
+
+ public int getInt(String key, int def) throws StorageException
+ {
+ return 0;
+ }
+
+ public float getFloat(String key, float def) throws StorageException
+ {
+ return 0;
+ }
+
+ public double getDouble(String key, double def) throws StorageException
+ {
+ return 0;
+ }
+
+ public byte[] getByteArray(String key, byte[] def) throws StorageException
+ {
+ return null;
+ }
+
+ public boolean getBoolean(String key, boolean def) throws StorageException
+ {
+ return false;
+ }
+
+ public String get(String key, String def) throws StorageException
+ {
+ return values.get(key);
+ }
+
+ public void flush() throws IOException
+ {
+ }
+
+ public void clear()
+ {
+ }
+
+ public String[] childrenNames()
+ {
+ return null;
+ }
+
+ public String absolutePath()
+ {
+ return null;
+ }
+ }
AbstractSetupTaskContext context = new AbstractSetupTaskContext(null)
{
private static final long serialVersionUID = 1L;
@Override
- protected String lookupSecurely(String key)
+ public ISecurePreferences getSecurePreferences()
{
- return (String)secureMap.get(key);
+ return new SecurePreferencesMock();
}
public boolean isCancelled()
@@ -440,6 +578,7 @@ public abstract class AbstractSetupTaskContext extends HashMap<Object, Object> i
};
context.put("user.id", "stepper");
+ context.saveSecurePreference("foo\\secure.id", "stepper");
Set<String> keys = new HashSet<String>();
System.out.println(context.expandString("${bogus.id}", keys, false) + " --> " + keys);
@@ -571,8 +710,44 @@ public abstract class AbstractSetupTaskContext extends HashMap<Object, Object> i
protected String lookupSecurely(String key)
{
- // TODO for Julian
- return null;
+ String newValue = null;
+
+ ISecurePreferences securePreferences = getSecurePreferences();
+ if (securePreferences.nodeExists(SECURE_STORAGE_NODE))
+ {
+ ISecurePreferences node = securePreferences.node(SECURE_STORAGE_NODE);
+
+ try
+ {
+ newValue = node.get(key, null);
+ }
+ catch (StorageException ex)
+ {
+ log(ex);
+ }
+ }
+
+ return newValue;
+ }
+
+ protected void saveSecurePreference(String name, String value)
+ {
+ ISecurePreferences securePreferences = getSecurePreferences();
+ ISecurePreferences node = securePreferences.node(SECURE_STORAGE_NODE);
+
+ try
+ {
+ node.put(name, value, true);
+ }
+ catch (StorageException ex)
+ {
+ log(ex);
+ }
+ }
+
+ protected ISecurePreferences getSecurePreferences()
+ {
+ return SecurePreferencesFactory.getDefault();
}
protected String filter(String value, String filterName)
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java
index fc2fa3f..5f1faf2 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Julian Enoch - Add support for secure context variables
*/
package org.eclipse.emf.cdo.releng.internal.setup;
@@ -33,6 +34,7 @@ import org.eclipse.emf.cdo.releng.setup.SetupPackage;
import org.eclipse.emf.cdo.releng.setup.SetupTask;
import org.eclipse.emf.cdo.releng.setup.SetupTaskContainer;
import org.eclipse.emf.cdo.releng.setup.Trigger;
+import org.eclipse.emf.cdo.releng.setup.VariableType;
import org.eclipse.emf.cdo.releng.setup.log.ProgressLog;
import org.eclipse.emf.cdo.releng.setup.log.ProgressLogFilter;
import org.eclipse.emf.cdo.releng.setup.log.ProgressLogRunnable;
@@ -624,21 +626,30 @@ public class SetupTaskPerformer extends AbstractSetupTaskContext
{
put(contextVariableTask.getName(), contextVariableTask.getValue());
- EList<SetupTask> targetSetupTasks = setupTasks;
- for (EObject container = contextVariableTask.eContainer(); container != null; container = container.eContainer())
+ // Save passwords to the secure storage
+ if (contextVariableTask.getType() == VariableType.PASSWORD)
{
- if (container instanceof ConfigurableItem)
+ saveSecurePreference(contextVariableTask.getName(), contextVariableTask.getValue());
+ }
+ else
+ {
+ EList<SetupTask> targetSetupTasks = setupTasks;
+ for (EObject container = contextVariableTask.eContainer(); container != null; container = container
+ .eContainer())
{
- targetSetupTasks = findOrCreate(itemDelegator, (ConfigurableItem)container, setupTasks).getSetupTasks();
- break;
+ if (container instanceof ConfigurableItem)
+ {
+ targetSetupTasks = findOrCreate(itemDelegator, (ConfigurableItem)container, setupTasks).getSetupTasks();
+ break;
+ }
}
- }
- ContextVariableTask userPreference = SetupFactory.eINSTANCE.createContextVariableTask();
- userPreference.setName(contextVariableTask.getName());
- userPreference.setValue(contextVariableTask.getValue());
+ ContextVariableTask userPreference = SetupFactory.eINSTANCE.createContextVariableTask();
+ userPreference.setName(contextVariableTask.getName());
+ userPreference.setValue(contextVariableTask.getValue());
- targetSetupTasks.add(userPreference);
+ targetSetupTasks.add(userPreference);
+ }
}
try
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/ui/PromptDialog.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/ui/PromptDialog.java
index 0bca8d3..6d0c50c 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/ui/PromptDialog.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/ui/PromptDialog.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Julian Enoch - Expand the functionality for PASSWORD variables
*/
package org.eclipse.emf.cdo.releng.internal.setup.ui;
@@ -183,6 +184,9 @@ public class PromptDialog extends AbstractSetupDialog
fileField.setDialogText("Folder Selection");
fileField.setDialogMessage("Select a folder.");
return fileField;
+
+ case PASSWORD:
+ return new PropertyField.TextField<Control>(true);
}
return new PropertyField.TextField<Control>();
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/ui/PropertyField.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/ui/PropertyField.java
index bd76904..156c708 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/ui/PropertyField.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/ui/PropertyField.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Julian Enoch - Expand the functionality for PASSWORD variables
*/
package org.eclipse.emf.cdo.releng.internal.setup.ui;
@@ -365,6 +366,8 @@ public abstract class PropertyField<CONTROL extends Control, HELPER extends Cont
*/
public static class TextField<H extends Control> extends PropertyField<Text, H>
{
+ private final boolean secret;
+
private PropertyField<?, ?> linkField;
private Composite mainControl;
@@ -375,11 +378,23 @@ public abstract class PropertyField<CONTROL extends Control, HELPER extends Cont
public TextField()
{
+ this(null, false);
+ }
+
+ public TextField(boolean secret)
+ {
+ this(null, secret);
}
public TextField(String labelText)
{
+ this(labelText, false);
+ }
+
+ public TextField(String labelText, boolean secret)
+ {
super(labelText);
+ this.secret = false;
}
public final PropertyField<?, ?> getLinkField()
@@ -527,7 +542,13 @@ public abstract class PropertyField<CONTROL extends Control, HELPER extends Cont
private Text createText(Composite parent)
{
- final Text text = new Text(parent, SWT.BORDER);
+ int style = SWT.BORDER;
+ if (secret)
+ {
+ style |= SWT.PASSWORD;
+ }
+
+ final Text text = new Text(parent, style);
String toolTip = getToolTip();
if (toolTip != null)
@@ -567,11 +588,21 @@ public abstract class PropertyField<CONTROL extends Control, HELPER extends Cont
{
}
+ public TextButtonField(boolean secret)
+ {
+ super(secret);
+ }
+
public TextButtonField(String labelText)
{
super(labelText);
}
+ public TextButtonField(String labelText, boolean secret)
+ {
+ super(labelText, secret);
+ }
+
public final String getButtonText()
{
return buttonText;
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/MylynBuildsTask.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/MylynBuildsTask.java
index 0a18ed0..4e2a25f 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/MylynBuildsTask.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/MylynBuildsTask.java
@@ -22,6 +22,8 @@ import org.eclipse.emf.common.util.EList;
* <ul>
* <li>{@link org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getConnectorKind <em>Connector Kind</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getServerURL <em>Server URL</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getUserID <em>User ID</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getPassword <em>Password</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getBuildPlans <em>Build Plans</em>}</li>
* </ul>
* </p>
@@ -101,4 +103,56 @@ public interface MylynBuildsTask extends SetupTask
*/
EList<BuildPlan> getBuildPlans();
+ /**
+ * Returns the value of the '<em><b>User ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>User ID</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>User ID</em>' attribute.
+ * @see #setUserID(String)
+ * @see org.eclipse.emf.cdo.releng.setup.SetupPackage#getMylynBuildsTask_UserID()
+ * @model
+ * @generated
+ */
+ String getUserID();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getUserID <em>User ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>User ID</em>' attribute.
+ * @see #getUserID()
+ * @generated
+ */
+ void setUserID(String value);
+
+ /**
+ * Returns the value of the '<em><b>Password</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Password</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Password</em>' attribute.
+ * @see #setPassword(String)
+ * @see org.eclipse.emf.cdo.releng.setup.SetupPackage#getMylynBuildsTask_Password()
+ * @model
+ * @generated
+ */
+ String getPassword();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getPassword <em>Password</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Password</em>' attribute.
+ * @see #getPassword()
+ * @generated
+ */
+ void setPassword(String value);
+
} // MylynBuildsTask
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/MylynQueriesTask.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/MylynQueriesTask.java
index 547b438..99666d9 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/MylynQueriesTask.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/MylynQueriesTask.java
@@ -22,6 +22,8 @@ import org.eclipse.emf.common.util.EList;
* <ul>
* <li>{@link org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getConnectorKind <em>Connector Kind</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getRepositoryURL <em>Repository URL</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getUserID <em>User ID</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getPassword <em>Password</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getQueries <em>Queries</em>}</li>
* </ul>
* </p>
@@ -103,4 +105,56 @@ public interface MylynQueriesTask extends SetupTask
*/
EList<Query> getQueries();
+ /**
+ * Returns the value of the '<em><b>User ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>User ID</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>User ID</em>' attribute.
+ * @see #setUserID(String)
+ * @see org.eclipse.emf.cdo.releng.setup.SetupPackage#getMylynQueriesTask_UserID()
+ * @model
+ * @generated
+ */
+ String getUserID();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getUserID <em>User ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>User ID</em>' attribute.
+ * @see #getUserID()
+ * @generated
+ */
+ void setUserID(String value);
+
+ /**
+ * Returns the value of the '<em><b>Password</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Password</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Password</em>' attribute.
+ * @see #setPassword(String)
+ * @see org.eclipse.emf.cdo.releng.setup.SetupPackage#getMylynQueriesTask_Password()
+ * @model
+ * @generated
+ */
+ String getPassword();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getPassword <em>Password</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Password</em>' attribute.
+ * @see #getPassword()
+ * @generated
+ */
+ void setPassword(String value);
+
} // MylynQueriesTask
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java
index 067d762..ab8a10c 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/SetupPackage.java
@@ -3761,13 +3761,31 @@ public interface SetupPackage extends EPackage
int MYLYN_QUERIES_TASK__REPOSITORY_URL = SETUP_TASK_FEATURE_COUNT + 1;
/**
+ * The feature id for the '<em><b>User ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MYLYN_QUERIES_TASK__USER_ID = SETUP_TASK_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Password</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MYLYN_QUERIES_TASK__PASSWORD = SETUP_TASK_FEATURE_COUNT + 3;
+
+ /**
* The feature id for the '<em><b>Queries</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int MYLYN_QUERIES_TASK__QUERIES = SETUP_TASK_FEATURE_COUNT + 2;
+ int MYLYN_QUERIES_TASK__QUERIES = SETUP_TASK_FEATURE_COUNT + 4;
/**
* The number of structural features of the '<em>Mylyn Queries Task</em>' class.
@@ -3776,7 +3794,7 @@ public interface SetupPackage extends EPackage
* @generated
* @ordered
*/
- int MYLYN_QUERIES_TASK_FEATURE_COUNT = SETUP_TASK_FEATURE_COUNT + 3;
+ int MYLYN_QUERIES_TASK_FEATURE_COUNT = SETUP_TASK_FEATURE_COUNT + 5;
/**
* The feature id for the '<em><b>Task</b></em>' container reference.
@@ -3923,13 +3941,31 @@ public interface SetupPackage extends EPackage
int MYLYN_BUILDS_TASK__SERVER_URL = SETUP_TASK_FEATURE_COUNT + 1;
/**
+ * The feature id for the '<em><b>User ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MYLYN_BUILDS_TASK__USER_ID = SETUP_TASK_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Password</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MYLYN_BUILDS_TASK__PASSWORD = SETUP_TASK_FEATURE_COUNT + 3;
+
+ /**
* The feature id for the '<em><b>Build Plans</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int MYLYN_BUILDS_TASK__BUILD_PLANS = SETUP_TASK_FEATURE_COUNT + 2;
+ int MYLYN_BUILDS_TASK__BUILD_PLANS = SETUP_TASK_FEATURE_COUNT + 4;
/**
* The number of structural features of the '<em>Mylyn Builds Task</em>' class.
@@ -3938,7 +3974,7 @@ public interface SetupPackage extends EPackage
* @generated
* @ordered
*/
- int MYLYN_BUILDS_TASK_FEATURE_COUNT = SETUP_TASK_FEATURE_COUNT + 3;
+ int MYLYN_BUILDS_TASK_FEATURE_COUNT = SETUP_TASK_FEATURE_COUNT + 5;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -5096,6 +5132,28 @@ public interface SetupPackage extends EPackage
EReference getMylynQueriesTask_Queries();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getUserID <em>User ID</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>User ID</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getUserID()
+ * @see #getMylynQueriesTask()
+ * @generated
+ */
+ EAttribute getMylynQueriesTask_UserID();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getPassword <em>Password</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Password</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.MylynQueriesTask#getPassword()
+ * @see #getMylynQueriesTask()
+ * @generated
+ */
+ EAttribute getMylynQueriesTask_Password();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.setup.Query <em>Query</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5227,6 +5285,28 @@ public interface SetupPackage extends EPackage
EReference getMylynBuildsTask_BuildPlans();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getUserID <em>User ID</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>User ID</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getUserID()
+ * @see #getMylynBuildsTask()
+ * @generated
+ */
+ EAttribute getMylynBuildsTask_UserID();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getPassword <em>Password</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Password</em>'.
+ * @see org.eclipse.emf.cdo.releng.setup.MylynBuildsTask#getPassword()
+ * @see #getMylynBuildsTask()
+ * @generated
+ */
+ EAttribute getMylynBuildsTask_Password();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.setup.BuildPlan <em>Build Plan</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7096,6 +7176,22 @@ public interface SetupPackage extends EPackage
EReference MYLYN_QUERIES_TASK__QUERIES = eINSTANCE.getMylynQueriesTask_Queries();
/**
+ * The meta object literal for the '<em><b>User ID</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MYLYN_QUERIES_TASK__USER_ID = eINSTANCE.getMylynQueriesTask_UserID();
+
+ /**
+ * The meta object literal for the '<em><b>Password</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MYLYN_QUERIES_TASK__PASSWORD = eINSTANCE.getMylynQueriesTask_Password();
+
+ /**
* The meta object literal for the '{@link org.eclipse.emf.cdo.releng.setup.impl.QueryImpl <em>Query</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7198,6 +7294,22 @@ public interface SetupPackage extends EPackage
EReference MYLYN_BUILDS_TASK__BUILD_PLANS = eINSTANCE.getMylynBuildsTask_BuildPlans();
/**
+ * The meta object literal for the '<em><b>User ID</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MYLYN_BUILDS_TASK__USER_ID = eINSTANCE.getMylynBuildsTask_UserID();
+
+ /**
+ * The meta object literal for the '<em><b>Password</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MYLYN_BUILDS_TASK__PASSWORD = eINSTANCE.getMylynBuildsTask_Password();
+
+ /**
* The meta object literal for the '{@link org.eclipse.emf.cdo.releng.setup.impl.BuildPlanImpl <em>Build Plan</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MylynBuildsTaskImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MylynBuildsTaskImpl.java
index 2dcac2b..3fdb943 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MylynBuildsTaskImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MylynBuildsTaskImpl.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Julian Enoch - Add authentication to the tasks repository
*/
package org.eclipse.emf.cdo.releng.setup.impl;
@@ -20,6 +21,7 @@ import org.eclipse.emf.cdo.releng.setup.Trigger;
import org.eclipse.emf.cdo.releng.setup.util.UIUtil;
import org.eclipse.net4j.util.ObjectUtil;
+import org.eclipse.net4j.util.StringUtil;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
@@ -36,6 +38,8 @@ import org.eclipse.mylyn.builds.core.IBuildServer;
import org.eclipse.mylyn.builds.internal.core.BuildFactory;
import org.eclipse.mylyn.builds.ui.BuildsUi;
import org.eclipse.mylyn.commons.repositories.core.RepositoryLocation;
+import org.eclipse.mylyn.commons.repositories.core.auth.AuthenticationType;
+import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
import org.eclipse.mylyn.internal.builds.ui.BuildsUiInternal;
import org.eclipse.mylyn.internal.builds.ui.BuildsUiPlugin;
@@ -55,6 +59,8 @@ import java.util.Set;
* <ul>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.MylynBuildsTaskImpl#getConnectorKind <em>Connector Kind</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.MylynBuildsTaskImpl#getServerURL <em>Server URL</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.impl.MylynBuildsTaskImpl#getUserID <em>User ID</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.impl.MylynBuildsTaskImpl#getPassword <em>Password</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.MylynBuildsTaskImpl#getBuildPlans <em>Build Plans</em>}</li>
* </ul>
* </p>
@@ -105,6 +111,46 @@ public class MylynBuildsTaskImpl extends SetupTaskImpl implements MylynBuildsTas
protected String serverURL = SERVER_URL_EDEFAULT;
/**
+ * The default value of the '{@link #getUserID() <em>User ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUserID()
+ * @generated
+ * @ordered
+ */
+ protected static final String USER_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUserID() <em>User ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUserID()
+ * @generated
+ * @ordered
+ */
+ protected String userID = USER_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getPassword() <em>Password</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPassword()
+ * @generated
+ * @ordered
+ */
+ protected static final String PASSWORD_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPassword() <em>Password</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPassword()
+ * @generated
+ * @ordered
+ */
+ protected String password = PASSWORD_EDEFAULT;
+
+ /**
* The cached value of the '{@link #getBuildPlans() <em>Build Plans</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -209,6 +255,57 @@ public class MylynBuildsTaskImpl extends SetupTaskImpl implements MylynBuildsTas
* <!-- end-user-doc -->
* @generated
*/
+ public String getUserID()
+ {
+ return userID;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setUserID(String newUserID)
+ {
+ String oldUserID = userID;
+ userID = newUserID;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.MYLYN_BUILDS_TASK__USER_ID, oldUserID, userID));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getPassword()
+ {
+ return password;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPassword(String newPassword)
+ {
+ String oldPassword = password;
+ password = newPassword;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.MYLYN_BUILDS_TASK__PASSWORD, oldPassword,
+ password));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
@@ -234,6 +331,10 @@ public class MylynBuildsTaskImpl extends SetupTaskImpl implements MylynBuildsTas
return getConnectorKind();
case SetupPackage.MYLYN_BUILDS_TASK__SERVER_URL:
return getServerURL();
+ case SetupPackage.MYLYN_BUILDS_TASK__USER_ID:
+ return getUserID();
+ case SetupPackage.MYLYN_BUILDS_TASK__PASSWORD:
+ return getPassword();
case SetupPackage.MYLYN_BUILDS_TASK__BUILD_PLANS:
return getBuildPlans();
}
@@ -257,6 +358,12 @@ public class MylynBuildsTaskImpl extends SetupTaskImpl implements MylynBuildsTas
case SetupPackage.MYLYN_BUILDS_TASK__SERVER_URL:
setServerURL((String)newValue);
return;
+ case SetupPackage.MYLYN_BUILDS_TASK__USER_ID:
+ setUserID((String)newValue);
+ return;
+ case SetupPackage.MYLYN_BUILDS_TASK__PASSWORD:
+ setPassword((String)newValue);
+ return;
case SetupPackage.MYLYN_BUILDS_TASK__BUILD_PLANS:
getBuildPlans().clear();
getBuildPlans().addAll((Collection<? extends BuildPlan>)newValue);
@@ -281,6 +388,12 @@ public class MylynBuildsTaskImpl extends SetupTaskImpl implements MylynBuildsTas
case SetupPackage.MYLYN_BUILDS_TASK__SERVER_URL:
setServerURL(SERVER_URL_EDEFAULT);
return;
+ case SetupPackage.MYLYN_BUILDS_TASK__USER_ID:
+ setUserID(USER_ID_EDEFAULT);
+ return;
+ case SetupPackage.MYLYN_BUILDS_TASK__PASSWORD:
+ setPassword(PASSWORD_EDEFAULT);
+ return;
case SetupPackage.MYLYN_BUILDS_TASK__BUILD_PLANS:
getBuildPlans().clear();
return;
@@ -302,6 +415,10 @@ public class MylynBuildsTaskImpl extends SetupTaskImpl implements MylynBuildsTas
return CONNECTOR_KIND_EDEFAULT == null ? connectorKind != null : !CONNECTOR_KIND_EDEFAULT.equals(connectorKind);
case SetupPackage.MYLYN_BUILDS_TASK__SERVER_URL:
return SERVER_URL_EDEFAULT == null ? serverURL != null : !SERVER_URL_EDEFAULT.equals(serverURL);
+ case SetupPackage.MYLYN_BUILDS_TASK__USER_ID:
+ return USER_ID_EDEFAULT == null ? userID != null : !USER_ID_EDEFAULT.equals(userID);
+ case SetupPackage.MYLYN_BUILDS_TASK__PASSWORD:
+ return PASSWORD_EDEFAULT == null ? password != null : !PASSWORD_EDEFAULT.equals(password);
case SetupPackage.MYLYN_BUILDS_TASK__BUILD_PLANS:
return buildPlans != null && !buildPlans.isEmpty();
}
@@ -326,6 +443,10 @@ public class MylynBuildsTaskImpl extends SetupTaskImpl implements MylynBuildsTas
result.append(connectorKind);
result.append(", serverURL: ");
result.append(serverURL);
+ result.append(", userID: ");
+ result.append(userID);
+ result.append(", password: ");
+ result.append(password);
result.append(')');
return result.toString();
}
@@ -420,19 +541,37 @@ public class MylynBuildsTaskImpl extends SetupTaskImpl implements MylynBuildsTas
public void run()
{
String connectorKind = task.getConnectorKind();
- String serverURL = task.getServerURL();
if (server == null)
{
+ String serverURL = task.getServerURL();
+ String userID = task.getUserID();
+ String password = context.expandString(task.getPassword(), true);
+
context.log("Adding " + connectorKind + " server: " + serverURL);
server = BuildsUi.createServer(connectorKind);
- server.setLocation(new RepositoryLocation(serverURL));
server.setUrl(serverURL);
- server.setName(serverURL);
server.getAttributes().put("id", serverURL);
server.getAttributes().put("url", serverURL);
- server.getAttributes().put("label", serverURL);
+
+ boolean authenticate = !StringUtil.isEmpty(userID) && !StringUtil.isEmpty(password);
+ if (authenticate)
+ {
+ server.getAttributes().put("org.eclipse.mylyn.tasklist.repositories.enabled", "true");
+ server.getAttributes().put("org.eclipse.mylyn.repositories.username", userID);
+ }
+
+ // Add credentials to the repository
+ RepositoryLocation repositoryLocation = new RepositoryLocation(server.getAttributes());
+ repositoryLocation.setUrl(serverURL);
+ if (authenticate)
+ {
+ UserCredentials credentials = new UserCredentials(userID, password, true);
+ repositoryLocation.setCredentials(AuthenticationType.REPOSITORY, credentials);
+ }
+
+ server.setLocation(repositoryLocation);
BuildsUiInternal.getModel().getServers().add(server);
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MylynQueriesTaskImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MylynQueriesTaskImpl.java
index 3f09dd9..16d5b2a 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MylynQueriesTaskImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/MylynQueriesTaskImpl.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Julian Enoch - Add authentication to build server
*/
package org.eclipse.emf.cdo.releng.setup.impl;
@@ -19,6 +20,7 @@ import org.eclipse.emf.cdo.releng.setup.SetupTaskContext;
import org.eclipse.emf.cdo.releng.setup.Trigger;
import org.eclipse.net4j.util.ObjectUtil;
+import org.eclipse.net4j.util.StringUtil;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
@@ -30,6 +32,8 @@ import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
+import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
@@ -55,6 +59,8 @@ import java.util.Set;
* <ul>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.MylynQueriesTaskImpl#getConnectorKind <em>Connector Kind</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.MylynQueriesTaskImpl#getRepositoryURL <em>Repository URL</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.impl.MylynQueriesTaskImpl#getUserID <em>User ID</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.setup.impl.MylynQueriesTaskImpl#getPassword <em>Password</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.setup.impl.MylynQueriesTaskImpl#getQueries <em>Queries</em>}</li>
* </ul>
* </p>
@@ -105,6 +111,46 @@ public class MylynQueriesTaskImpl extends SetupTaskImpl implements MylynQueriesT
protected String repositoryURL = REPOSITORY_URL_EDEFAULT;
/**
+ * The default value of the '{@link #getUserID() <em>User ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUserID()
+ * @generated
+ * @ordered
+ */
+ protected static final String USER_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUserID() <em>User ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUserID()
+ * @generated
+ * @ordered
+ */
+ protected String userID = USER_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getPassword() <em>Password</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPassword()
+ * @generated
+ * @ordered
+ */
+ protected static final String PASSWORD_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPassword() <em>Password</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPassword()
+ * @generated
+ * @ordered
+ */
+ protected String password = PASSWORD_EDEFAULT;
+
+ /**
* The cached value of the '{@link #getQueries() <em>Queries</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -209,6 +255,57 @@ public class MylynQueriesTaskImpl extends SetupTaskImpl implements MylynQueriesT
* <!-- end-user-doc -->
* @generated
*/
+ public String getUserID()
+ {
+ return userID;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setUserID(String newUserID)
+ {
+ String oldUserID = userID;
+ userID = newUserID;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.MYLYN_QUERIES_TASK__USER_ID, oldUserID, userID));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getPassword()
+ {
+ return password;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPassword(String newPassword)
+ {
+ String oldPassword = password;
+ password = newPassword;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.MYLYN_QUERIES_TASK__PASSWORD, oldPassword,
+ password));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs)
@@ -251,6 +348,10 @@ public class MylynQueriesTaskImpl extends SetupTaskImpl implements MylynQueriesT
return getConnectorKind();
case SetupPackage.MYLYN_QUERIES_TASK__REPOSITORY_URL:
return getRepositoryURL();
+ case SetupPackage.MYLYN_QUERIES_TASK__USER_ID:
+ return getUserID();
+ case SetupPackage.MYLYN_QUERIES_TASK__PASSWORD:
+ return getPassword();
case SetupPackage.MYLYN_QUERIES_TASK__QUERIES:
return getQueries();
}
@@ -274,6 +375,12 @@ public class MylynQueriesTaskImpl extends SetupTaskImpl implements MylynQueriesT
case SetupPackage.MYLYN_QUERIES_TASK__REPOSITORY_URL:
setRepositoryURL((String)newValue);
return;
+ case SetupPackage.MYLYN_QUERIES_TASK__USER_ID:
+ setUserID((String)newValue);
+ return;
+ case SetupPackage.MYLYN_QUERIES_TASK__PASSWORD:
+ setPassword((String)newValue);
+ return;
case SetupPackage.MYLYN_QUERIES_TASK__QUERIES:
getQueries().clear();
getQueries().addAll((Collection<? extends Query>)newValue);
@@ -298,6 +405,12 @@ public class MylynQueriesTaskImpl extends SetupTaskImpl implements MylynQueriesT
case SetupPackage.MYLYN_QUERIES_TASK__REPOSITORY_URL:
setRepositoryURL(REPOSITORY_URL_EDEFAULT);
return;
+ case SetupPackage.MYLYN_QUERIES_TASK__USER_ID:
+ setUserID(USER_ID_EDEFAULT);
+ return;
+ case SetupPackage.MYLYN_QUERIES_TASK__PASSWORD:
+ setPassword(PASSWORD_EDEFAULT);
+ return;
case SetupPackage.MYLYN_QUERIES_TASK__QUERIES:
getQueries().clear();
return;
@@ -319,6 +432,10 @@ public class MylynQueriesTaskImpl extends SetupTaskImpl implements MylynQueriesT
return CONNECTOR_KIND_EDEFAULT == null ? connectorKind != null : !CONNECTOR_KIND_EDEFAULT.equals(connectorKind);
case SetupPackage.MYLYN_QUERIES_TASK__REPOSITORY_URL:
return REPOSITORY_URL_EDEFAULT == null ? repositoryURL != null : !REPOSITORY_URL_EDEFAULT.equals(repositoryURL);
+ case SetupPackage.MYLYN_QUERIES_TASK__USER_ID:
+ return USER_ID_EDEFAULT == null ? userID != null : !USER_ID_EDEFAULT.equals(userID);
+ case SetupPackage.MYLYN_QUERIES_TASK__PASSWORD:
+ return PASSWORD_EDEFAULT == null ? password != null : !PASSWORD_EDEFAULT.equals(password);
case SetupPackage.MYLYN_QUERIES_TASK__QUERIES:
return queries != null && !queries.isEmpty();
}
@@ -343,6 +460,10 @@ public class MylynQueriesTaskImpl extends SetupTaskImpl implements MylynQueriesT
result.append(connectorKind);
result.append(", repositoryURL: ");
result.append(repositoryURL);
+ result.append(", userID: ");
+ result.append(userID);
+ result.append(", password: ");
+ result.append(password);
result.append(')');
return result.toString();
}
@@ -438,6 +559,15 @@ public class MylynQueriesTaskImpl extends SetupTaskImpl implements MylynQueriesT
{
context.log("Adding " + connectorKind + " repository: " + repositoryURL);
repository = new TaskRepository(connectorKind, repositoryURL);
+
+ String userID = task.getUserID();
+ String password = context.expandString(task.getPassword(), true);
+ if (!StringUtil.isEmpty(userID) && !StringUtil.isEmpty(password))
+ {
+ AuthenticationCredentials credentials = new AuthenticationCredentials(userID, password);
+ repository.setCredentials(AuthenticationType.REPOSITORY, credentials, true);
+ }
+
TasksUi.getRepositoryManager().addRepository(repository);
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java
index 1b13bd5..7a986b3 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/SetupPackageImpl.java
@@ -1525,7 +1525,27 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
*/
public EReference getMylynQueriesTask_Queries()
{
- return (EReference)mylynQueriesTaskEClass.getEStructuralFeatures().get(2);
+ return (EReference)mylynQueriesTaskEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMylynQueriesTask_UserID()
+ {
+ return (EAttribute)mylynQueriesTaskEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMylynQueriesTask_Password()
+ {
+ return (EAttribute)mylynQueriesTaskEClass.getEStructuralFeatures().get(3);
}
/**
@@ -1645,7 +1665,27 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
*/
public EReference getMylynBuildsTask_BuildPlans()
{
- return (EReference)mylynBuildsTaskEClass.getEStructuralFeatures().get(2);
+ return (EReference)mylynBuildsTaskEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMylynBuildsTask_UserID()
+ {
+ return (EAttribute)mylynBuildsTaskEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMylynBuildsTask_Password()
+ {
+ return (EAttribute)mylynBuildsTaskEClass.getEStructuralFeatures().get(3);
}
/**
@@ -2927,6 +2967,8 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
mylynQueriesTaskEClass = createEClass(MYLYN_QUERIES_TASK);
createEAttribute(mylynQueriesTaskEClass, MYLYN_QUERIES_TASK__CONNECTOR_KIND);
createEAttribute(mylynQueriesTaskEClass, MYLYN_QUERIES_TASK__REPOSITORY_URL);
+ createEAttribute(mylynQueriesTaskEClass, MYLYN_QUERIES_TASK__USER_ID);
+ createEAttribute(mylynQueriesTaskEClass, MYLYN_QUERIES_TASK__PASSWORD);
createEReference(mylynQueriesTaskEClass, MYLYN_QUERIES_TASK__QUERIES);
queryEClass = createEClass(QUERY);
@@ -2942,6 +2984,8 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
mylynBuildsTaskEClass = createEClass(MYLYN_BUILDS_TASK);
createEAttribute(mylynBuildsTaskEClass, MYLYN_BUILDS_TASK__CONNECTOR_KIND);
createEAttribute(mylynBuildsTaskEClass, MYLYN_BUILDS_TASK__SERVER_URL);
+ createEAttribute(mylynBuildsTaskEClass, MYLYN_BUILDS_TASK__USER_ID);
+ createEAttribute(mylynBuildsTaskEClass, MYLYN_BUILDS_TASK__PASSWORD);
createEReference(mylynBuildsTaskEClass, MYLYN_BUILDS_TASK__BUILD_PLANS);
buildPlanEClass = createEClass(BUILD_PLAN);
@@ -3539,6 +3583,12 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
initEAttribute(getMylynQueriesTask_RepositoryURL(), ecorePackage.getEString(), "repositoryURL", null, 1, 1,
MylynQueriesTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMylynQueriesTask_UserID(), ecorePackage.getEString(), "userID", null, 0, 1,
+ MylynQueriesTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMylynQueriesTask_Password(), ecorePackage.getEString(), "password", null, 0, 1,
+ MylynQueriesTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
initEReference(getMylynQueriesTask_Queries(), getQuery(), getQuery_Task(), "queries", null, 0, -1,
MylynQueriesTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -3570,6 +3620,11 @@ public class SetupPackageImpl extends EPackageImpl implements SetupPackage
initEAttribute(getMylynBuildsTask_ServerURL(), ecorePackage.getEString(), "serverURL", null, 1, 1,
MylynBuildsTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMylynBuildsTask_UserID(), ecorePackage.getEString(), "userID", null, 0, 1, MylynBuildsTask.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMylynBuildsTask_Password(), ecorePackage.getEString(), "password", null, 0, 1,
+ MylynBuildsTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
initEReference(getMylynBuildsTask_BuildPlans(), getBuildPlan(), null, "buildPlans", null, 1, -1,
MylynBuildsTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);