Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 72505 Details for
Bug 130240
[connector] XPlanner
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch for latest api and Mylar to Mylyn changes
patch-v20070623-1130.txt (text/plain), 333.68 KB, created by
Helen
on 2007-06-26 14:03:10 EDT
(
hide
)
Description:
patch for latest api and Mylar to Mylyn changes
Filename:
MIME Type:
Creator:
Helen
Created:
2007-06-26 14:03:10 EDT
Size:
333.68 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.xplanner-feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner-feature/feature.xml,v >retrieving revision 1.1 >diff -u -r1.1 feature.xml >--- feature.xml 31 May 2007 07:37:10 -0000 1.1 >+++ feature.xml 26 Jun 2007 17:41:13 -0000 >@@ -1,10 +1,10 @@ > <?xml version="1.0" encoding="UTF-8"?> > <feature >- id="org.eclipse.mylar.xplanner_feature" >+ id="org.eclipse.mylyn.xplanner_feature" > label="%featureLabel" > version="2.0.0.qualifier" > provider-name="Eclipse.org" >- plugin="org.eclipse.mylar.xplanner.ui"> >+ plugin="org.eclipse.mylyn.xplanner.ui"> > > <description> > %featureDescription >@@ -214,31 +214,24 @@ > </license> > > <url> >- <update label="Mylar for Eclipse 3.2" url="http://download.eclipse.org/technology/mylar/update-site/e3.2"/> >+ <update label="Mylyn for Eclipse 3.3" url="http://download.eclipse.org/tools/mylyn/update/e3.3"/> > </url> > > <requires> >- <import plugin="org.eclipse.ui"/> >- <import plugin="org.eclipse.ui.forms"/> >- <import plugin="org.eclipse.core.runtime"/> >- <import plugin="org.eclipse.mylar.context.core"/> >- <import plugin="org.eclipse.mylar.tasks.ui"/> >- <import plugin="org.eclipse.mylar.tasks.core"/> >- <import plugin="org.eclipse.search"/> >- <import plugin="org.eclipse.mylar.monitor.core"/> >- <import plugin="org.eclipse.mylar" version="2.0.0.v20070216" match="greaterOrEqual"/> >- <import feature="org.eclipse.mylar_feature" version="2.0.0.v20070216" match="greaterOrEqual"/> >+ <import feature="org.eclipse.mylyn_feature" version="2.0.0.v20070514" match="equivalent"/> >+ <import feature="org.eclipse.rcp" version="3.2.2.r322_v20070104-8pcviKVqd8J7C1U" match="compatible"/> >+ <import feature="org.eclipse.platform" version="3.2.2.r322_v20070119-RQghndJN8IM0MsK" match="compatible"/> > </requires> > > <plugin >- id="org.eclipse.mylar.xplanner.ui" >+ id="org.eclipse.mylyn.xplanner.core" > download-size="0" > install-size="0" > version="0.0.0" > unpack="false"/> > > <plugin >- id="org.eclipse.mylar.xplanner.core" >+ id="org.eclipse.mylyn.xplanner.ui" > download-size="0" > install-size="0" > version="0.0.0" >Index: feature.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner-feature/feature.properties,v >retrieving revision 1.1 >diff -u -r1.1 feature.properties >--- feature.properties 31 May 2007 07:37:10 -0000 1.1 >+++ feature.properties 26 Jun 2007 17:41:13 -0000 >@@ -1,2 +1,2 @@ >-featureLabel=Mylar Connector for XPlanner >-featureDescription=XPlanner client integrated with Eclipse and Mylar, can be used standalone. >+featureLabel=Mylyn Connector: XPlanner >+featureDescription=XPlanner client integrated with Eclipse and Mylyn, can be used standalone. >#P org.eclipse.mylyn.xplanner.core >Index: src/org/eclipse/mylyn/xplanner/core/service/exceptions/InsufficientPermissionException.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/service/exceptions/InsufficientPermissionException.java,v >retrieving revision 1.1 >diff -u -r1.1 InsufficientPermissionException.java >--- src/org/eclipse/mylyn/xplanner/core/service/exceptions/InsufficientPermissionException.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/service/exceptions/InsufficientPermissionException.java 26 Jun 2007 17:41:15 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service.exceptions; >+package org.eclipse.mylyn.xplanner.core.service.exceptions; > > /** > * @author Ravi Kumar >Index: src/org/eclipse/mylyn/xplanner/core/service/exceptions/AuthenticationException.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/service/exceptions/AuthenticationException.java,v >retrieving revision 1.1 >diff -u -r1.1 AuthenticationException.java >--- src/org/eclipse/mylyn/xplanner/core/service/exceptions/AuthenticationException.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/service/exceptions/AuthenticationException.java 26 Jun 2007 17:41:15 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service.exceptions; >+package org.eclipse.mylyn.xplanner.core.service.exceptions; > > /** > * @author Ravi Kumar >Index: src/org/eclipse/mylyn/xplanner/core/service/exceptions/ServiceUnavailableException.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/service/exceptions/ServiceUnavailableException.java,v >retrieving revision 1.1 >diff -u -r1.1 ServiceUnavailableException.java >--- src/org/eclipse/mylyn/xplanner/core/service/exceptions/ServiceUnavailableException.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/service/exceptions/ServiceUnavailableException.java 26 Jun 2007 17:41:15 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service.exceptions; >+package org.eclipse.mylyn.xplanner.core.service.exceptions; > > /** > * @author Ravi Kumar >Index: src/org/eclipse/mylyn/xplanner/core/service/soap/SoapXPlannerService.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/service/soap/SoapXPlannerService.java,v >retrieving revision 1.1 >diff -u -r1.1 SoapXPlannerService.java >--- src/org/eclipse/mylyn/xplanner/core/service/soap/SoapXPlannerService.java 31 May 2007 07:37:14 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/service/soap/SoapXPlannerService.java 26 Jun 2007 17:41:15 -0000 >@@ -5,27 +5,22 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service.soap; >+package org.eclipse.mylyn.xplanner.core.service.soap; > > import java.net.URL; > import java.rmi.RemoteException; > import java.util.HashMap; > >-import org.xplanner.soap.IterationData; >-import org.xplanner.soap.NoteData; >-import org.xplanner.soap.PersonData; >-import org.xplanner.soap.ProjectData; >-import org.xplanner.soap.TaskData; >-import org.xplanner.soap.TimeEntryData; >-import org.xplanner.soap.UserStoryData; >+import org.apache.axis.client.Stub; >+import org.apache.axis.configuration.FileProvider; >+import org.eclipse.mylyn.xplanner.core.service.exceptions.AuthenticationException; >+import org.eclipse.mylyn.xplanner.core.service.exceptions.ServiceUnavailableException; >+import org.eclipse.mylyn.xplanner.wsdl.db.QueryException; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerService; >+import org.xplanner.soap.*; > import org.xplanner.soap.XPlanner.XPlanner; > import org.xplanner.soap.XPlanner.XPlannerServiceLocator; >-import org.apache.axis.client.Stub; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.core.service.XPlannerService; >-import org.eclipse.mylar.xplanner.core.service.exceptions.AuthenticationException; >-import org.eclipse.mylar.xplanner.core.service.exceptions.ServiceUnavailableException; >-import org.eclipse.mylar.xplanner.wsdl.db.QueryException; > > > // This class does not represent the data in a XPlanner installation. It is merely >@@ -43,17 +38,22 @@ > public class SoapXPlannerService extends XPlannerService { > > private static final String SOAP_URL_PREFIX = "/soap/XPlanner"; //$NON-NLS-1$ >- private XPlannerServer server; >+ private XPlannerClient client; > private XPlanner service; > boolean loginActive; > >- public SoapXPlannerService(XPlannerServer aServer) { >- this.server = aServer; >+ public SoapXPlannerService(XPlannerClient aClient) { >+ this.client = aClient; > > try { >- XPlannerServiceLocator s = new XPlannerServiceLocator(); >- service = s.getXPlanner(new URL(server.getBaseURL() + SOAP_URL_PREFIX)); >- login(server.getCurrentUserName(), server.getCurrentUserPassword()); >+ XPlannerServiceLocator s = new XPlannerServiceLocator(new FileProvider(this >+ .getClass().getClassLoader().getResourceAsStream("client-config.wsdd"))); //$NON-NLS-1$ >+ s.setHttpUser(client.getHttpUser()); >+ s.setHttpPassword(client.getHttpPassword()); >+ s.setProxy(client.getProxy()); >+ s.setCompression(client.useCompression()); >+ service = s.getXPlanner(new URL(client.getBaseURL() + SOAP_URL_PREFIX)); >+ login(client.getCurrentUserName(), client.getCurrentUserPassword()); > } > catch (Throwable e) { > e.printStackTrace(); >Index: src/org/eclipse/mylyn/xplanner/core/service/soap/SoapXPlannerServiceFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/service/soap/SoapXPlannerServiceFactory.java,v >retrieving revision 1.1 >diff -u -r1.1 SoapXPlannerServiceFactory.java >--- src/org/eclipse/mylyn/xplanner/core/service/soap/SoapXPlannerServiceFactory.java 31 May 2007 07:37:14 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/service/soap/SoapXPlannerServiceFactory.java 26 Jun 2007 17:41:15 -0000 >@@ -5,11 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service.soap; >+package org.eclipse.mylyn.xplanner.core.service.soap; > >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.core.service.XPlannerService; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServiceFactory; >+import org.eclipse.mylyn.xplanner.core.service.soap.SoapXPlannerService; >+import org.eclipse.mylyn.xplanner.core.service.*; > > /** > * @author Ravi Kumar >@@ -17,9 +16,9 @@ > */ > public class SoapXPlannerServiceFactory implements XPlannerServiceFactory { > >- public XPlannerService createService(XPlannerServer server) { >+ public XPlannerService createService(XPlannerClient client) { > // TODO Auto-generated method stub >- return new SoapXPlannerService(server); >+ return new SoapXPlannerService(client); > } > > } >Index: src/org/eclipse/mylyn/xplanner/core/XPlannerServerListener.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/XPlannerServerListener.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerServerListener.java >--- src/org/eclipse/mylyn/xplanner/core/XPlannerServerListener.java 31 May 2007 07:37:13 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/XPlannerServerListener.java 26 Jun 2007 17:41:15 -0000 >@@ -5,13 +5,13 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core; >+package org.eclipse.mylyn.xplanner.core; > > /** > * @author Ravi Kumar > * @author Helen Bershadskaya > */ >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerServer; > > > public interface XPlannerServerListener { >Index: src/org/eclipse/mylyn/xplanner/core/IXPlannerCoreExtensionConstants.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/IXPlannerCoreExtensionConstants.java,v >retrieving revision 1.1 >diff -u -r1.1 IXPlannerCoreExtensionConstants.java >--- src/org/eclipse/mylyn/xplanner/core/IXPlannerCoreExtensionConstants.java 31 May 2007 07:37:13 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/IXPlannerCoreExtensionConstants.java 26 Jun 2007 17:41:15 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core; >+package org.eclipse.mylyn.xplanner.core; > > /** > * @author Ravi Kumar >Index: src/org/eclipse/mylyn/xplanner/core/XPlannerCorePlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/XPlannerCorePlugin.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerCorePlugin.java >--- src/org/eclipse/mylyn/xplanner/core/XPlannerCorePlugin.java 31 May 2007 07:37:13 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/XPlannerCorePlugin.java 26 Jun 2007 17:41:15 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core; >+package org.eclipse.mylyn.xplanner.core; > > import java.io.File; > import java.text.MessageFormat; >@@ -14,10 +14,8 @@ > import java.util.logging.Level; > import java.util.logging.Logger; > >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Plugin; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.mylar.xplanner.core.service.exceptions.AuthenticationException; >+import org.eclipse.core.runtime.*; >+import org.eclipse.mylyn.xplanner.core.service.exceptions.AuthenticationException; > import org.osgi.framework.BundleContext; > > /** >@@ -27,13 +25,13 @@ > * @author Ravi Kumar > */ > public class XPlannerCorePlugin extends Plugin { >- public static final String ID = "org.eclipse.mylar.xplanner.core"; //$NON-NLS-1$ >+ public static final String ID = "org.eclipse.mylyn.xplanner.core"; //$NON-NLS-1$ > > //The shared instance. > private static XPlannerCorePlugin plugin; > //Resource bundle. > private ResourceBundle resourceBundle; >- private ServerManager serverManager; >+ private XPlannerClientManager clientManager; > > /** > * The constructor. >@@ -48,14 +46,14 @@ > */ > public void start(BundleContext context) throws Exception { > super.start(context); >- File serverCache = getStateLocation().append("serverCache").toFile(); //$NON-NLS-1$ >+ File clientCache = getStateLocation().append("serverCache").toFile(); //$NON-NLS-1$ > > // Turn off logging for the Attachment check. We don't want or need soap with attachments > Logger logger = Logger.getLogger("org.apache.axis.utils.JavaUtils"); //$NON-NLS-1$ > logger.setLevel(Level.SEVERE); > >- serverManager = new ServerManager(serverCache); >- serverManager.start(); >+ clientManager = new XPlannerClientManager(clientCache); >+ clientManager.start(); > } > > /** >@@ -69,8 +67,8 @@ > > public String getPassword(URL baseURL, String username) { > Map authenticationInfo = Platform.getAuthorizationInfo(baseURL, "XPlanner", ""); //$NON-NLS-1$ //$NON-NLS-2$ >-// String username = (String) authenticationInfo.get("org.eclipse.mylar.xplanner.core.username"); //$NON-NLS-1$ >- String password = (String) authenticationInfo.get("org.eclipse.mylar.xplanner.core.password"); //$NON-NLS-1$ >+// String username = (String) authenticationInfo.get("org.eclipse.mylyn.xplanner.core.username"); //$NON-NLS-1$ >+ String password = (String) authenticationInfo.get("org.eclipse.mylyn.xplanner.core.password"); //$NON-NLS-1$ > return password; > } > >@@ -83,12 +81,12 @@ > public void stop(BundleContext context) throws Exception { > super.stop(context); > >- if (serverManager != null) { >- serverManager.stop(); >+ if (clientManager != null) { >+ clientManager.stop(); > } > plugin = null; > resourceBundle = null; >- serverManager = null; >+ clientManager = null; > } > > /** >@@ -98,8 +96,8 @@ > return plugin; > } > >- public ServerManager getServerManager() { >- return serverManager; >+ public XPlannerClientManager getClientManager() { >+ return clientManager; > } > > /** >@@ -121,7 +119,7 @@ > public ResourceBundle getResourceBundle() { > try { > if (resourceBundle == null) >- resourceBundle = ResourceBundle.getBundle("org.eclipse.mylar.xplanner.core.XPlannerCorePluginResources"); //$NON-NLS-1$ >+ resourceBundle = ResourceBundle.getBundle("org.eclipse.mylyn.xplanner.core.XPlannerCorePluginResources"); //$NON-NLS-1$ > } catch (MissingResourceException x) { > resourceBundle = null; > } >Index: src/org/eclipse/mylyn/xplanner/core/Messages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/Messages.java,v >retrieving revision 1.1 >diff -u -r1.1 Messages.java >--- src/org/eclipse/mylyn/xplanner/core/Messages.java 31 May 2007 07:37:13 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/Messages.java 26 Jun 2007 17:41:15 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core; >+package org.eclipse.mylyn.xplanner.core; > > import org.eclipse.osgi.util.NLS; > >@@ -14,7 +14,7 @@ > * @author Helen Bershadskaya > */ > public class Messages extends NLS { >- private static final String BUNDLE_NAME = "org.eclipse.mylar.xplanner.core.messages"; //$NON-NLS-1$ >+ private static final String BUNDLE_NAME = "org.eclipse.mylyn.xplanner.core.messages"; //$NON-NLS-1$ > > public static String XPlannerCorePlugin_UNEXPECTED_ERROR; > >@@ -22,9 +22,9 @@ > > public static String XPlannerValidator_CONNECTION_ERROR; > >- public static String ServerManager_SERVER_URL_CANNOT_BE_EMPTY; >+ public static String ClientManager_CLIENT_URL_CANNOT_BE_EMPTY; > >- public static String ServerManager_INVALID_USERNAME_PASSWORD; >+ public static String ClientManager_INVALID_USERNAME_PASSWORD; > > static { > // initialize resource bundle >Index: src/org/eclipse/mylyn/xplanner/core/DebugManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/DebugManager.java,v >retrieving revision 1.1 >diff -u -r1.1 DebugManager.java >--- src/org/eclipse/mylyn/xplanner/core/DebugManager.java 31 May 2007 07:37:13 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/DebugManager.java 26 Jun 2007 17:41:15 -0000 >@@ -6,7 +6,7 @@ > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ > >-package org.eclipse.mylar.xplanner.core; >+package org.eclipse.mylyn.xplanner.core; > > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Platform; >Index: src/org/eclipse/mylyn/xplanner/core/messages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/messages.properties,v >retrieving revision 1.1 >diff -u -r1.1 messages.properties >--- src/org/eclipse/mylyn/xplanner/core/messages.properties 31 May 2007 07:37:13 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/messages.properties 26 Jun 2007 17:41:15 -0000 >@@ -1,5 +1,5 @@ >-ServerManager_SERVER_URL_CANNOT_BE_EMPTY=Server url cannot be empty >-ServerManager_INVALID_USERNAME_PASSWORD=Invalid user name or password. >-XPlannerValidator_INVALID_CREDENTIALS_ERROR=The supplied credentials are invalid.\n\n{0} >-XPlannerValidator_CONNECTION_ERROR=Connection error:\n\n{0} >+ClientManager_CLIENT_URL_CANNOT_BE_EMPTY=Server url cannot be empty >+ClientManager_INVALID_USERNAME_PASSWORD=Invalid user name or password. >+XPlannerValidator_INVALID_CREDENTIALS_ERROR=The supplied credentials are invalid: {0} >+XPlannerValidator_CONNECTION_ERROR=Connection error: {0} > XPlannerCorePlugin_UNEXPECTED_ERROR=Unexpected error >Index: src/org/eclipse/mylyn/xplanner/core/ServerManager.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/core/ServerManager.java >diff -N src/org/eclipse/mylyn/xplanner/core/ServerManager.java >--- src/org/eclipse/mylyn/xplanner/core/ServerManager.java 31 May 2007 07:37:13 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,260 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 - 2007 CodeGear 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 >- *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core; >- >-/** >- * @author Ravi Kumar >- * @author Helen Bershadskaya >- */ >-import java.io.BufferedInputStream; >-import java.io.BufferedOutputStream; >-import java.io.File; >-import java.io.FileInputStream; >-import java.io.FileOutputStream; >-import java.io.IOException; >-import java.io.ObjectInputStream; >-import java.io.ObjectOutputStream; >-import java.net.URL; >-import java.rmi.RemoteException; >-import java.util.ArrayList; >-import java.util.HashMap; >-import java.util.Iterator; >-import java.util.List; >-import java.util.Map; >- >-import org.apache.axis.AxisFault; >-import org.eclipse.mylar.xplanner.core.service.CachedXPlannerServer; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.core.service.exceptions.AuthenticationException; >-import org.eclipse.mylar.xplanner.core.service.exceptions.ServiceUnavailableException; >-import org.xml.sax.SAXException; >- >- >-/** >- * @author Helen Bershadskaya >- * @author Ravi Kumar >- */ >-public class ServerManager { >- >- private final File cacheLocation; >- >- private Map<String, XPlannerServer> serverByName = new HashMap<String, XPlannerServer>(); >- >- // TODO Use a decent listener list >- private List<XPlannerServerListener> listeners = new ArrayList<XPlannerServerListener>(); >- >- public ServerManager(File cacheLocation) { >- this.cacheLocation = cacheLocation; >- } >- >- protected void start() { >- // On first load the cache may not exist >- cacheLocation.mkdirs(); >- >- File[] servers = this.cacheLocation.listFiles(); >- for (int i = 0; i < servers.length; i++) { >- File serverCache = servers[i]; >- File serverFile = new File(serverCache, "server.ser"); //$NON-NLS-1$ >- >- ObjectInputStream ois = null; >- try { >- ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(serverFile))); >- XPlannerServer server = (XPlannerServer) ois.readObject(); >- // TODO reconnect the services depending on user preferences >- >- serverByName.put(serverCache.getName(), server); >- ois.close(); >- } catch (IOException e) { >- e.printStackTrace(); >- } catch (ClassNotFoundException e) { >- e.printStackTrace(); >- } finally { >- if (ois != null) { >- try { >- ois.close(); >- } catch (IOException e) { >- } >- } >- } >- } >- } >- >- protected void stop() { >- for (Iterator<XPlannerServer> iServers = serverByName.values().iterator(); iServers.hasNext();) { >- XPlannerServer server = iServers.next(); >- >- ObjectOutputStream oos = null; >- try { >- File cacheDir = new File(cacheLocation, server.getName()); >- cacheDir.mkdirs(); >- >- oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(new File(cacheDir, "server.ser")))); //$NON-NLS-1$ >- oos.writeObject(server); >- } catch (IOException e) { >- e.printStackTrace(); >- } finally { >- if (oos != null) { >- try { >- oos.close(); >- } catch (IOException e) { >- } >- } >- } >- } >- } >- >- /** >- * Tests the connection to a server. If the URL is invalid ot the username >- * and password are invalid this method will return with a exceptions carrying >- * the failure reason. >- * @param baseUrl Base URL of the XPlanner installation >- * @param username username to connect with >- * @param password Password to connect with >- * @return Short string describing the server information >- * @throws AuthenticationException URL was valid but username and password were incorrect >- * @throws ServiceUnavailableException URL was not valid >- */ >- public String testConnection(String baseUrl, String username, String password) throws AuthenticationException, ServiceUnavailableException { >- if (baseUrl == null || baseUrl.length() == 0) { >- throw new AuthenticationException(Messages.ServerManager_SERVER_URL_CANNOT_BE_EMPTY); >- } >- >- XPlannerServer server = null; >- >- try { >- new URL(baseUrl).openConnection(); // tests url validity >- >- server = createServer("Connection Test", baseUrl, false, username, password); //$NON-NLS-1$ >- >- server.getTask(-1); >- } >- catch (RemoteException re) { >- if (re instanceof AxisFault) { >- String message = re.getMessage().trim(); >- if (message.startsWith("(401)")) { //$NON-NLS-1$ >- message = Messages.ServerManager_INVALID_USERNAME_PASSWORD; >- } >- else if (re.getCause() instanceof SAXException) { >- message = ""; //$NON-NLS-1$ >- } >- else { >- message = message.startsWith(";") ? message.substring(1).trim() : message; //$NON-NLS-1$ >- } >- throw new AuthenticationException(message); >- } >- else { >- throw new ServiceUnavailableException(re.getMessage()); >- } >- } >- catch (Exception e) { >- throw new ServiceUnavailableException(e.getMessage()); >- } >- finally { >- if (server != null) { >- removeServer(server); >- } >- } >- >- return "XPlanner"; //$NON-NLS-1$ >- } >- >- public XPlannerServer getServer(String name) { >- return (XPlannerServer) serverByName.get(name); >- } >- >- public XPlannerServer[] getAllServers() { >- return (XPlannerServer[]) serverByName.values().toArray(new XPlannerServer[serverByName.size()]); >- } >- >- public XPlannerServer createServer(String name, String baseUrl, boolean hasSlowConnection, String username, String password) { >- if (baseUrl.charAt(baseUrl.length() - 1) == '/') { >- baseUrl = baseUrl.substring(0, baseUrl.length() - 1); >- } >- >- XPlannerServer server = new CachedXPlannerServer(name, baseUrl, hasSlowConnection, username, password); >- return server; >- } >- >- public void addServer(XPlannerServer server) { >- if (serverByName.containsKey(server.getName())) { >-// TODO: add this check back once the listeners for server property change are hooked up >-// Also handle the case when serviceDelegate in the cachedServer is null >-// throw new RuntimeException("A server with that name already exists"); >- removeServer(server); >- } >- serverByName.put(server.getName(), server); >- fireServerAddded(server); >- } >- >- public void removeServer(XPlannerServer server) { >- serverByName.remove(server.getName()); >- >- File serverCache = new File(this.cacheLocation, server.getName()); >- if (serverCache.exists()) { >- recursiveDelete(serverCache); >- } >- fireServerRemoved(server); >- } >- >- /** >- * TODO need to make this a bit smarter. Perhaps have an object to hold connectino info >- * @param name >- * @param baseURL >- * @param username >- * @param password >- */ >- public void updateServerDetails(String name, String baseURL, boolean hasSlowConnection, String username, String password) { >- CachedXPlannerServer server = (CachedXPlannerServer) serverByName.get(name); >- // TODO we should really have a modify event >- >- fireServerRemoved(server); >- >- // TODO need to flush the server cache since we are possibly a different person >- server.setBaseURL(baseURL); >- server.setSlowConnection(hasSlowConnection); >- server.setCurrentUserName(username); >- server.setCurrentPassword(password); >- >- fireServerAddded(server); >- } >- >- public void addServerListener(XPlannerServerListener listener) { >- listeners.add(listener); >- } >- >- public void removeServerListener(XPlannerServerListener listener) { >- listeners.remove(listener); >- } >- >- private void fireServerRemoved(XPlannerServer server) { >- for (Iterator<XPlannerServerListener> iListeners = listeners.iterator(); iListeners.hasNext();) { >- XPlannerServerListener listener = (XPlannerServerListener)iListeners.next(); >- listener.serverRemoved(server); >- } >- } >- >- private void fireServerAddded(XPlannerServer server) { >- for (Iterator<XPlannerServerListener> iListeners = listeners.iterator(); iListeners.hasNext();) { >- XPlannerServerListener listener = (XPlannerServerListener)iListeners.next(); >- listener.serverAdded(server); >- } >- } >- >- private void recursiveDelete(File baseFile) { >- if (baseFile.isFile()) { >- baseFile.delete(); >- } else { >- File[] children = baseFile.listFiles(); >- for (int i = 0; i < children.length; i++) { >- File file = children[i]; >- recursiveDelete(file); >- } >- baseFile.delete(); >- } >- } >-} >Index: .settings/org.eclipse.core.resources.prefs >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/.settings/org.eclipse.core.resources.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.core.resources.prefs >--- .settings/org.eclipse.core.resources.prefs 31 May 2007 07:37:14 -0000 1.1 >+++ .settings/org.eclipse.core.resources.prefs 26 Jun 2007 17:41:14 -0000 >@@ -1,3 +1,3 @@ > #Fri Mar 09 11:38:32 PST 2007 > eclipse.preferences.version=1 >-encoding//src/org/eclipse/mylar/xplanner/core/messages.properties=8859_1 >+encoding//src/org/eclipse/mylyn/xplanner/core/messages.properties=8859_1 >Index: src/org/xplanner/soap/NoteData.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/NoteData.java,v >retrieving revision 1.1 >diff -u -r1.1 NoteData.java >--- src/org/xplanner/soap/NoteData.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/NoteData.java 26 Jun 2007 17:41:15 -0000 >@@ -8,7 +8,7 @@ > package org.xplanner.soap; > > @SuppressWarnings("unchecked") >-public class NoteData extends org.eclipse.mylar.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { >+public class NoteData extends org.eclipse.mylyn.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { > private int attachedToId; > > private int attachmentId; >Index: src/org/xplanner/soap/ProjectData.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/ProjectData.java,v >retrieving revision 1.1 >diff -u -r1.1 ProjectData.java >--- src/org/xplanner/soap/ProjectData.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/ProjectData.java 26 Jun 2007 17:41:15 -0000 >@@ -8,7 +8,7 @@ > package org.xplanner.soap; > > @SuppressWarnings("unchecked") >-public class ProjectData extends org.eclipse.mylar.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { >+public class ProjectData extends org.eclipse.mylyn.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { > private java.lang.String description; > > private java.lang.String name; >Index: src/org/xplanner/soap/UserStoryData.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/UserStoryData.java,v >retrieving revision 1.1 >diff -u -r1.1 UserStoryData.java >--- src/org/xplanner/soap/UserStoryData.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/UserStoryData.java 26 Jun 2007 17:41:15 -0000 >@@ -8,7 +8,7 @@ > package org.xplanner.soap; > > @SuppressWarnings("unchecked") >-public class UserStoryData extends org.eclipse.mylar.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { >+public class UserStoryData extends org.eclipse.mylyn.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { > private double actualHours; > > private double adjustedEstimatedHours; >Index: src/org/xplanner/soap/PersonData.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/PersonData.java,v >retrieving revision 1.1 >diff -u -r1.1 PersonData.java >--- src/org/xplanner/soap/PersonData.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/PersonData.java 26 Jun 2007 17:41:15 -0000 >@@ -8,7 +8,7 @@ > package org.xplanner.soap; > > @SuppressWarnings("unchecked") >-public class PersonData extends org.eclipse.mylar.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { >+public class PersonData extends org.eclipse.mylyn.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { > private java.lang.String email; > > private java.lang.String initials; >Index: src/org/xplanner/soap/TimeEntryData.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/TimeEntryData.java,v >retrieving revision 1.1 >diff -u -r1.1 TimeEntryData.java >--- src/org/xplanner/soap/TimeEntryData.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/TimeEntryData.java 26 Jun 2007 17:41:15 -0000 >@@ -8,7 +8,7 @@ > package org.xplanner.soap; > > @SuppressWarnings("unchecked") >-public class TimeEntryData extends org.eclipse.mylar.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { >+public class TimeEntryData extends org.eclipse.mylyn.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { > private java.lang.String description; > > private double duration; >Index: src/org/xplanner/soap/TaskData.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/TaskData.java,v >retrieving revision 1.1 >diff -u -r1.1 TaskData.java >--- src/org/xplanner/soap/TaskData.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/TaskData.java 26 Jun 2007 17:41:15 -0000 >@@ -8,7 +8,7 @@ > package org.xplanner.soap; > > @SuppressWarnings("unchecked") >-public class TaskData extends org.eclipse.mylar.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { >+public class TaskData extends org.eclipse.mylyn.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { > private int acceptorId; > > private double actualHours; >Index: src/org/xplanner/soap/IterationData.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/IterationData.java,v >retrieving revision 1.1 >diff -u -r1.1 IterationData.java >--- src/org/xplanner/soap/IterationData.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/IterationData.java 26 Jun 2007 17:41:15 -0000 >@@ -8,7 +8,7 @@ > package org.xplanner.soap; > > @SuppressWarnings("unchecked") >-public class IterationData extends org.eclipse.mylar.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { >+public class IterationData extends org.eclipse.mylyn.xplanner.wsdl.soap.domain.DomainData implements java.io.Serializable { > private double actualHours; > > private double addedHours; >Index: src-gen/org/eclipse/mylyn/xplanner/wsdl/soap/domain/DomainData.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src-gen/org/eclipse/mylyn/xplanner/wsdl/soap/domain/DomainData.java,v >retrieving revision 1.1 >diff -u -r1.1 DomainData.java >--- src-gen/org/eclipse/mylyn/xplanner/wsdl/soap/domain/DomainData.java 31 May 2007 07:37:10 -0000 1.1 >+++ src-gen/org/eclipse/mylyn/xplanner/wsdl/soap/domain/DomainData.java 26 Jun 2007 17:41:15 -0000 >@@ -5,7 +5,7 @@ > * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter. > */ > >-package org.eclipse.mylar.xplanner.wsdl.soap.domain; >+package org.eclipse.mylyn.xplanner.wsdl.soap.domain; > > @SuppressWarnings("unchecked") > public abstract class DomainData implements java.io.Serializable { >Index: src/org/eclipse/mylyn/xplanner/core/service/ServiceManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/service/ServiceManager.java,v >retrieving revision 1.1 >diff -u -r1.1 ServiceManager.java >--- src/org/eclipse/mylyn/xplanner/core/service/ServiceManager.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/service/ServiceManager.java 26 Jun 2007 17:41:15 -0000 >@@ -5,20 +5,15 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service; >+package org.eclipse.mylyn.xplanner.core.service; > >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IConfigurationElement; >-import org.eclipse.core.runtime.IExtension; >-import org.eclipse.core.runtime.IExtensionPoint; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Platform; >-import org.eclipse.mylar.xplanner.core.IXPlannerCoreExtensionConstants; >-import org.eclipse.mylar.xplanner.core.XPlannerCorePlugin; >+import org.eclipse.core.runtime.*; >+import org.eclipse.mylyn.xplanner.core.IXPlannerCoreExtensionConstants; >+import org.eclipse.mylyn.xplanner.core.XPlannerCorePlugin; > > > /** >- * TODO This is eclispe specific at the moment. Need to find a way to load a >+ * TODO This is eclipse specific at the moment. Need to find a way to load a > * XPlannerService instance based off some use preference. > * TODO mention that this should really only be used by internal classes and tests > * >@@ -29,11 +24,11 @@ > > private static XPlannerServiceFactory factory; > >- public static synchronized XPlannerService getXPlannerService(XPlannerServer server) { >+ public static synchronized XPlannerService getXPlannerService(XPlannerClient client) { > if (factory == null) { > factory = loadServiceProviderFactories(); > } >- return factory.createService(server); >+ return factory.createService(client); > } > > public static XPlannerServiceFactory loadServiceProviderFactories() { >@@ -47,9 +42,11 @@ > for (int j = 0; j < configElements.length; j++) { > try { > return (XPlannerServiceFactory) configElements[j].createExecutableExtension("class"); //$NON-NLS-1$ >- } catch (CoreException e) { >+ } >+ catch (CoreException e) { > plugin.getLog().log(e.getStatus()); >- } catch (ClassCastException e) { >+ } >+ catch (ClassCastException e) { > XPlannerCorePlugin.log(IStatus.ERROR, "Must implement the correct class", e); //$NON-NLS-1$ > XPlannerCorePlugin.log(IStatus.ERROR, "Must implement the correct class", e); //$NON-NLS-1$ > } >Index: src/org/eclipse/mylyn/xplanner/core/service/CachedXPlannerServer.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/core/service/CachedXPlannerServer.java >diff -N src/org/eclipse/mylyn/xplanner/core/service/CachedXPlannerServer.java >--- src/org/eclipse/mylyn/xplanner/core/service/CachedXPlannerServer.java 31 May 2007 07:37:11 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,492 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 - 2007 CodeGear 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 >- *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service; >- >-import java.io.Serializable; >-import java.rmi.RemoteException; >-import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.HashMap; >-import java.util.List; >- >-import org.eclipse.mylar.xplanner.wsdl.db.QueryException; >-import org.xplanner.soap.IterationData; >-import org.xplanner.soap.NoteData; >-import org.xplanner.soap.PersonData; >-import org.xplanner.soap.ProjectData; >-import org.xplanner.soap.TaskData; >-import org.xplanner.soap.TimeEntryData; >-import org.xplanner.soap.UserStoryData; >- >- >-/** >- * XPlanner server implementation that caches information that is unlikey to change >- * during the session. This server could be persisted to disk and re-loaded. >- * It has lifecycle methods to allow data in the cache to be reloaded. >- * >- * TODO it is assumed that it will be backed by a standad XPlanner service layer >- * >- * @author Ravi Kumar >- * @author Helen Bershadskaya >- */ >-public class CachedXPlannerServer extends XPlannerServer implements Serializable { >- public static final int INVALID_ID = -1; >- >- /** >- * >- */ >- private static final long serialVersionUID = 1L; >- private String name; >- private String baseURL; >- private boolean hasSlowConnection; >- private String userName; >- private String password; >- private transient XPlannerService serviceDelegate; >- >- public CachedXPlannerServer(String name, String baseURL, boolean hasSlowConnection, String userName, String password) { >- this.name = name; >- this.baseURL = baseURL; >- this.hasSlowConnection = hasSlowConnection; >- this.userName = userName; >- this.password = password; >- >- this.serviceDelegate = ServiceManager.getXPlannerService(this); >- serviceDelegate.login(userName, password); >- } >- >- public String getBaseURL() { >- return baseURL; >- } >- >- public String getCurrentUserName() { >- return userName; >- } >- >- public String getCurrentUserPassword() { >- return password; >- } >- >- public int getMaximumNumberOfMatches() { >- return 0; >- } >- >- public String getName() { >- return name; >- } >- >- public boolean hasSlowConnection() { >- return hasSlowConnection; >- } >- >- >- public void setSlowConnection(boolean hasSlowConnection) { >- this.hasSlowConnection = hasSlowConnection; >- } >- >- public void setBaseURL(String baseURL) { >- this.baseURL = baseURL; >- } >- >- public void setCurrentPassword(String password) { >- this.password = password; >- } >- >- public void setCurrentUserName(String userName) { >- this.userName = userName; >- } >- >- public String login(String username, String password) { >- return serviceDelegate.login(username, password); >- } >- >- public boolean logout() { >- boolean ok = true; >- >- //TODO -- shouldn't have a null service delegate, but definitely get into this condition if "finish" >- // repository definition with an invalid server >- >- if (serviceDelegate != null) { >- ok = serviceDelegate.logout(); >- } >- >- return ok; >- } >- >- public IterationData addIteration(IterationData iteration) throws RemoteException { >- return serviceDelegate.addIteration(iteration); >- } >- >- public NoteData addNote(NoteData note) throws RemoteException { >- return serviceDelegate.addNote(note); >- } >- >- public PersonData addPerson(PersonData object) throws RemoteException { >- return serviceDelegate.addPerson(object); >- } >- >- public ProjectData addProject(ProjectData project) throws RemoteException { >- return serviceDelegate.addProject(project); >- } >- >- public TaskData addTask(TaskData task) throws RemoteException { >- return serviceDelegate.addTask(task); >- } >- >- public TimeEntryData addTimeEntry(TimeEntryData timeEntry) throws RemoteException { >- return serviceDelegate.addTimeEntry(timeEntry); >- } >- >- public UserStoryData addUserStory(UserStoryData story) throws RemoteException { >- return serviceDelegate.addUserStory(story); >- } >- >- public void deleteAttribute(int objectId, String key) throws RemoteException { >- serviceDelegate.deleteAttribute(objectId, key); >- } >- >- public boolean equals(Object obj) { >- return this == obj || serviceDelegate.equals(obj) || >- (obj instanceof CachedXPlannerServer && ((CachedXPlannerServer)obj).serviceDelegate.equals(serviceDelegate)); >- } >- >- public String getAttribute(int objectId, String key) throws RemoteException { >- return serviceDelegate.getAttribute(objectId, key); >- } >- >- @SuppressWarnings("unchecked") >- public HashMap getAttributes(int objectId) throws RemoteException { >- return serviceDelegate.getAttributes(objectId); >- } >- >- @SuppressWarnings("unchecked") >- public HashMap getAttributesWithPrefix(int objectId, String prefix) throws RemoteException { >- return serviceDelegate.getAttributesWithPrefix(objectId, prefix); >- } >- >- public IterationData getCurrentIteration(int projectId) throws RemoteException { >- return serviceDelegate.getCurrentIteration(projectId); >- } >- >- public TaskData[] getCurrentTasksForPerson(int personId) throws RemoteException, QueryException { >- return serviceDelegate.getCurrentTasksForPerson(personId); >- } >- >- public IterationData getIteration(int id) throws RemoteException { >- return serviceDelegate.getIteration(id); >- } >- >- public IterationData[] getIterations(int projectId) throws RemoteException { >- return serviceDelegate.getIterations(projectId); >- } >- >- public NoteData getNote(int id) throws RemoteException { >- return serviceDelegate.getNote(id); >- } >- >- public NoteData[] getNotesForObject(int attachedToId) throws RemoteException { >- return serviceDelegate.getNotesForObject(attachedToId); >- } >- >- public PersonData[] getPeople() throws RemoteException { >- return serviceDelegate.getPeople(); >- } >- >- public PersonData getPerson(int id) throws RemoteException { >- return serviceDelegate.getPerson(id); >- } >- >- public TaskData[] getPlannedTasksForPerson(int personId) throws RemoteException, QueryException { >- return serviceDelegate.getPlannedTasksForPerson(personId); >- } >- >- public ProjectData getProject(int id) throws RemoteException { >- return serviceDelegate.getProject(id); >- } >- >- public ProjectData[] getProjects() throws RemoteException { >- return serviceDelegate.getProjects(); >- } >- >- public TaskData getTask(int id) throws RemoteException { >- if (serviceDelegate == null) { >- System.out.println(" why is serivce Delegate null???"); //$NON-NLS-1$ >- } >- return serviceDelegate.getTask(id); >- } >- >- public TaskData[] getTasks(int containerId) throws RemoteException { >- return serviceDelegate.getTasks(containerId); >- } >- >- public TimeEntryData[] getTimeEntries(int containerId) throws RemoteException { >- return serviceDelegate.getTimeEntries(containerId); >- } >- >- public TimeEntryData getTimeEntry(int id) throws RemoteException { >- return serviceDelegate.getTimeEntry(id); >- } >- >- public UserStoryData[] getUserStories(int containerId) throws RemoteException { >- return serviceDelegate.getUserStories(containerId); >- } >- >- public UserStoryData getUserStory(int id) throws RemoteException { >- return serviceDelegate.getUserStory(id); >- } >- >- public int hashCode() { >- return serviceDelegate.hashCode(); >- } >- >- public void removeIteration(int id) throws RemoteException { >- serviceDelegate.removeIteration(id); >- } >- >- public void removeNote(int id) throws RemoteException { >- serviceDelegate.removeNote(id); >- } >- >- public void removePerson(int id) throws RemoteException { >- serviceDelegate.removePerson(id); >- } >- >- public void removeProject(int id) throws RemoteException { >- serviceDelegate.removeProject(id); >- } >- >- public void removeTask(int id) throws RemoteException { >- serviceDelegate.removeTask(id); >- } >- >- public void removeTimeEntry(int id) throws RemoteException { >- serviceDelegate.removeTimeEntry(id); >- } >- >- public void removeUserStory(int id) throws RemoteException { >- serviceDelegate.removeUserStory(id); >- } >- >- public void setAttribute(int objectId, String key, String value) throws RemoteException { >- serviceDelegate.setAttribute(objectId, key, value); >- } >- >- public void update(IterationData object) throws RemoteException { >- serviceDelegate.update(object); >- } >- >- public void update(NoteData note) throws RemoteException { >- serviceDelegate.update(note); >- } >- >- public void update(PersonData object) throws RemoteException { >- serviceDelegate.update(object); >- } >- >- public void update(ProjectData object) throws RemoteException { >- serviceDelegate.update(object); >- } >- >- public void update(TaskData object) throws RemoteException { >- serviceDelegate.update(object); >- } >- >- public void update(TimeEntryData object) throws RemoteException { >- serviceDelegate.update(object); >- } >- >- public void update(UserStoryData object) throws RemoteException { >- serviceDelegate.update(object); >- } >- >- public TaskData[] getUserStoryTasksForPerson(int personId, int userStoryId) { >- if (personId < 0 || userStoryId < 0) { >- return new TaskData[0]; >- } >- >- List<TaskData> userStoryTasksForPerson = new ArrayList<TaskData>(); >- try { >- TaskData[] iterationTasks = getTasks(userStoryId); >- // get all tasks for specified user storyserv >- for (int i = 0; i < iterationTasks.length; i++) { >- TaskData taskData = iterationTasks[i]; >- if (taskData.getAcceptorId() == personId) { >- userStoryTasksForPerson.add(taskData); >- } >- } >- >- } >- catch (RemoteException e) { >- e.printStackTrace(); >- } >- >- return userStoryTasksForPerson.toArray(new TaskData[userStoryTasksForPerson.size()]); >- } >- >- public UserStoryData[] getIterationUserStoriesForTracker(int trackerId, int iterationId) { >- if (trackerId < 0 || iterationId < 0) { >- return new UserStoryData[0]; >- } >- >- List<UserStoryData> userStoriesForTracker = new ArrayList<UserStoryData>(); >- UserStoryData[] userStories; >- try { >- userStories = getUserStories(iterationId); >- // get all tasks for specified user story >- for (int i = 0; i < userStories.length; i++) { >- UserStoryData userStory = userStories[i]; >- if (userStory.getTrackerId() == trackerId) { >- userStoriesForTracker.add(userStory); >- } >- } >- } >- catch (RemoteException e) { >- e.printStackTrace(); >- } >- >- return userStoriesForTracker.toArray(new UserStoryData[userStoriesForTracker.size()]); >- } >- >- public int getCurrentPersonId() { >- int currentPersonId = INVALID_ID; >- >- String userName = getCurrentUserName(); >- if (userName != null) { >- try { >- PersonData[] people = getPeople(); >- if (people != null) { >- for (int i = 0; i < people.length && currentPersonId == INVALID_ID; i++) { >- PersonData person = people[i]; >- if (person.getUserId().equals(userName)) { >- currentPersonId = person.getId(); >- } >- } >- } >- } >- catch (RemoteException e) { >- e.printStackTrace(); >- } >- } >- >- return currentPersonId; >- } >- >- public UserStoryData[] getUserStoriesForProject(int projectId) { >- if (projectId == INVALID_ID) { >- return new UserStoryData[0]; >- } >- >- ArrayList<UserStoryData> projectUserStories = new ArrayList<UserStoryData>(); >- try { >- IterationData[] projectIterations = getIterations(projectId); >- for (IterationData iteration : projectIterations) { >- UserStoryData[] iterationUserStories = getUserStories(iteration.getId()); >- if (iterationUserStories.length > 0) { >- projectUserStories.addAll(Arrays.asList(iterationUserStories)); >- } >- } >- } >- catch (RemoteException e) { >- e.printStackTrace(); >- } >- >- return (UserStoryData[]) projectUserStories.toArray(new UserStoryData[projectUserStories.size()]); >- } >- >- public UserStoryData[] getUserStoriesForProject(int projectId, int trackerId) { >- if (projectId == INVALID_ID) { >- return new UserStoryData[0]; >- } >- >- ArrayList<UserStoryData> projectTrackerUserStories = new ArrayList<UserStoryData>(); >- UserStoryData[] projectUserStories = getUserStoriesForProject(projectId); >- for (UserStoryData userStory : projectUserStories) { >- if (userStory.getTrackerId() == trackerId) { >- projectTrackerUserStories.add(userStory); >- } >- } >- >- return (UserStoryData[]) projectTrackerUserStories.toArray(new UserStoryData[projectTrackerUserStories.size()]); >- >- } >- >- public TaskData[] getTasksForProject(int projectId) { >- if (projectId == -1) { >- return new TaskData[0]; >- } >- >- ArrayList<TaskData> projectTasks = new ArrayList<TaskData>(); >- try { >- UserStoryData[] userStories = getUserStoriesForProject(projectId); >- for (UserStoryData userStory : userStories) { >- TaskData[] userStoryTasks = getTasks(userStory.getId()); >- if (userStoryTasks.length > 0) { >- projectTasks.addAll(Arrays.asList(userStoryTasks)); >- } >- } >- } >- catch (RemoteException e) { >- e.printStackTrace(); >- } >- >- return (TaskData[]) projectTasks.toArray(new TaskData[projectTasks.size()]); >- } >- >- public TaskData[] getTasksForProject(int projectId, int personId) { >- if (projectId == INVALID_ID || personId == INVALID_ID) { >- return new TaskData[0]; >- } >- >- ArrayList<TaskData> projectPersonTasks = new ArrayList<TaskData>(); >- TaskData[] allProjectTasks = getTasksForProject(projectId); >- for (TaskData task : allProjectTasks) { >- if (task.getAcceptorId() == personId) { >- projectPersonTasks.add(task); >- } >- } >- >- return (TaskData[]) projectPersonTasks.toArray(new TaskData[projectPersonTasks.size()]); >- } >- >- public TaskData[] getTasksForIteration(int iterationId) { >- if (iterationId == INVALID_ID) { >- return new TaskData[0]; >- } >- >- ArrayList<TaskData> iterationTasks = new ArrayList<TaskData>(); >- try { >- UserStoryData[] userStories = getUserStories(iterationId); >- for (UserStoryData userStory : userStories) { >- TaskData[] userStoryTasks = getTasks(userStory.getId()); >- if (userStoryTasks.length > 0) { >- iterationTasks.addAll(Arrays.asList(userStoryTasks)); >- } >- } >- } >- catch (RemoteException e) { >- e.printStackTrace(); >- } >- >- return (TaskData[]) iterationTasks.toArray(new TaskData[iterationTasks.size()]); >- } >- >- public TaskData[] getTasksForIteration(int iterationId, int personId) { >- if (iterationId == INVALID_ID || personId == INVALID_ID) { >- return new TaskData[0]; >- } >- >- ArrayList<TaskData> iterationPersonTasks = new ArrayList<TaskData>(); >- TaskData[] allIterationTasks = getTasksForIteration(iterationId); >- for (TaskData task : allIterationTasks) { >- if (task.getAcceptorId() == personId) { >- iterationPersonTasks.add(task); >- } >- } >- >- return (TaskData[]) iterationPersonTasks.toArray(new TaskData[iterationPersonTasks.size()]); >- } >-} >Index: src/org/eclipse/mylyn/xplanner/core/service/PasswordPrompter.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/service/PasswordPrompter.java,v >retrieving revision 1.1 >diff -u -r1.1 PasswordPrompter.java >--- src/org/eclipse/mylyn/xplanner/core/service/PasswordPrompter.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/service/PasswordPrompter.java 26 Jun 2007 17:41:15 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service; >+package org.eclipse.mylyn.xplanner.core.service; > > import java.net.URL; > >Index: src/org/eclipse/mylyn/xplanner/core/service/XPlannerServiceFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/service/XPlannerServiceFactory.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerServiceFactory.java >--- src/org/eclipse/mylyn/xplanner/core/service/XPlannerServiceFactory.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/service/XPlannerServiceFactory.java 26 Jun 2007 17:41:15 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service; >+package org.eclipse.mylyn.xplanner.core.service; > > /** > * Factory class for creating ta XPlanner Service imlementation. >@@ -16,10 +16,10 @@ > */ > public interface XPlannerServiceFactory { > /** >- * Create a new service that will communicate to the supplied <code>server</code>. >- * How the service talks to the server is up to the implementation. >- * @param server XPlanner Server instance to communicate with >+ * Create a new service that will communicate to the supplied <code>client</code>. >+ * How the service talks to the client is up to the implementation. >+ * @param client XPlannerClient instance to communicate with > * @return Configured XPlanner Service > */ >- public abstract XPlannerService createService(XPlannerServer server); >+ public abstract XPlannerService createService(XPlannerClient client); > } >Index: src/org/eclipse/mylyn/xplanner/core/service/XPlannerService.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/service/XPlannerService.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerService.java >--- src/org/eclipse/mylyn/xplanner/core/service/XPlannerService.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/service/XPlannerService.java 26 Jun 2007 17:41:15 -0000 >@@ -5,10 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service; >+package org.eclipse.mylyn.xplanner.core.service; > >-import org.eclipse.mylar.xplanner.core.service.exceptions.AuthenticationException; >-import org.eclipse.mylar.xplanner.core.service.exceptions.ServiceUnavailableException; >+import org.eclipse.mylyn.xplanner.core.service.exceptions.AuthenticationException; >+import org.eclipse.mylyn.xplanner.core.service.exceptions.ServiceUnavailableException; > import org.xplanner.soap.XPlanner.XPlanner; > > >@@ -27,7 +27,7 @@ > } > > /** >- * Refresh any cached information with the latest values from the remote server. >+ * Refresh any cached information with the latest values from the remote client. > * This operation may take a long time to complete and should not be called > * from a UI thread. > */ >Index: src/org/eclipse/mylyn/xplanner/core/service/XPlannerServer.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/eclipse/mylyn/xplanner/core/service/XPlannerServer.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerServer.java >--- src/org/eclipse/mylyn/xplanner/core/service/XPlannerServer.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/core/service/XPlannerServer.java 26 Jun 2007 17:41:15 -0000 >@@ -5,7 +5,9 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.core.service; >+package org.eclipse.mylyn.xplanner.core.service; >+ >+import java.net.Proxy; > > import org.xplanner.soap.TaskData; > import org.xplanner.soap.UserStoryData; >@@ -68,12 +70,16 @@ > public abstract TaskData[] getTasksForProject(int projectId, int personId); > public abstract TaskData[] getTasksForIteration(int iterationId); > public abstract TaskData[] getTasksForIteration(int iterationId, int personId); >+ public abstract boolean useCompression(); >+ public abstract Proxy getProxy(); >+ public abstract String getHttpUser(); >+ public abstract String getHttpPassword(); > > // /** > // * Force a login to the remote repository. > // * @deprecated There is no need to call this method as all services should automatically > // * login when the session is about to expire. If you need to check if the credentials >-// * are valid, call {@link org.eclipse.mylar.xplanner.core.ServerManager#testConnection(String, String, String)} >+// * are valid, call {@link org.eclipse.mylyn.xplanner.core.ServerManager#testConnection(String, String, String)} > // */ > // public abstract void login(); > // >Index: .project >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/.project,v >retrieving revision 1.2 >diff -u -r1.2 .project >--- .project 12 Jun 2007 14:25:34 -0000 1.2 >+++ .project 26 Jun 2007 17:41:14 -0000 >@@ -22,6 +22,7 @@ > </buildCommand> > </buildSpec> > <natures> >+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> > <nature>org.eclipse.pde.PluginNature</nature> > <nature>org.eclipse.jdt.core.javanature</nature> > </natures> >Index: XPlanner WSDL2Java.launch >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/XPlanner WSDL2Java.launch,v >retrieving revision 1.1 >diff -u -r1.1 XPlanner WSDL2Java.launch >--- XPlanner WSDL2Java.launch 31 May 2007 07:37:14 -0000 1.1 >+++ XPlanner WSDL2Java.launch 26 Jun 2007 17:41:14 -0000 >@@ -4,10 +4,10 @@ > <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> > <listEntry value="4"/> > </listAttribute> >-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-o "${project_loc:org.eclipse.mylar.core.soap}/src" ./wsdl/XPlanner.wsdl"/> >-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.mylar.core.soap"/> >+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-o "${project_loc:org.eclipse.mylyn.core.soap}/src" ./wsdl/XPlanner.wsdl"/> >+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.mylyn.core.soap"/> > <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> >-<listEntry value="/org.eclipse.mylar.core.soap"/> >+<listEntry value="/org.eclipse.mylyn.core.soap"/> > </listAttribute> > <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> > </launchConfiguration> >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/plugin.xml,v >retrieving revision 1.1 >diff -u -r1.1 plugin.xml >--- plugin.xml 31 May 2007 07:37:14 -0000 1.1 >+++ plugin.xml 26 Jun 2007 17:41:14 -0000 >@@ -7,9 +7,9 @@ > schema="schema/serviceProviderFactory.exsd"/> > > <extension >- point="org.eclipse.mylar.xplanner.core.serviceProviderFactory"> >+ point="org.eclipse.mylyn.xplanner.core.serviceProviderFactory"> > <serviceProviderFactory >- class="org.eclipse.mylar.xplanner.core.service.soap.SoapXPlannerServiceFactory" >+ class="org.eclipse.mylyn.xplanner.core.service.soap.SoapXPlannerServiceFactory" > name="%serviceProviderFactoryNameSoap"/> > </extension> > </plugin> >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/plugin.properties,v >retrieving revision 1.1 >diff -u -r1.1 plugin.properties >--- plugin.properties 31 May 2007 07:37:14 -0000 1.1 >+++ plugin.properties 26 Jun 2007 17:41:14 -0000 >@@ -1,4 +1,4 @@ >-bundleName=Mylar Connector for XPlanner: Core >+bundleName=Mylyn XPlanner Core Plug-in > bundleVendor=Eclipse.org >-extensionPointNameServiceProviderFactory=Mylar XPlanner Service Provider Factory >+extensionPointNameServiceProviderFactory=Mylyn XPlanner Service Provider Factory > serviceProviderFactoryNameSoap=SOAP Service Provider >Index: build.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/build.properties,v >retrieving revision 1.1 >diff -u -r1.1 build.properties >--- build.properties 31 May 2007 07:37:14 -0000 1.1 >+++ build.properties 26 Jun 2007 17:41:14 -0000 >@@ -1,13 +1,9 @@ > source.. = src/, src-gen/ > output.. = bin/ >-source.plugin.jar = src/,\ >- src-gen/ >-output.plugin.jar = bin/ > bin.includes = .,\ >- lib/,\ >+ lib/,\ > META-INF/,\ > schema/,\ >- plugin.jar,\ > plugin.properties,\ > plugin.xml,\ > about.html >@@ -15,7 +11,6 @@ > lib/,\ > META-INF/,\ > schema/,\ >- plugin.jar,\ > plugin.properties,\ > plugin.xml,\ > about.html,\ >Index: src-gen/org/eclipse/mylyn/xplanner/wsdl/db/QueryException.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src-gen/org/eclipse/mylyn/xplanner/wsdl/db/QueryException.java,v >retrieving revision 1.1 >diff -u -r1.1 QueryException.java >--- src-gen/org/eclipse/mylyn/xplanner/wsdl/db/QueryException.java 31 May 2007 07:37:14 -0000 1.1 >+++ src-gen/org/eclipse/mylyn/xplanner/wsdl/db/QueryException.java 26 Jun 2007 17:41:14 -0000 >@@ -5,7 +5,7 @@ > * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter. > */ > >-package org.eclipse.mylar.xplanner.wsdl.db; >+package org.eclipse.mylyn.xplanner.wsdl.db; > > @SuppressWarnings("unchecked") > public class QueryException extends org.apache.axis.AxisFault implements java.io.Serializable { >Index: schema/serviceProviderFactory.exsd >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/schema/serviceProviderFactory.exsd,v >retrieving revision 1.1 >diff -u -r1.1 serviceProviderFactory.exsd >--- schema/serviceProviderFactory.exsd 31 May 2007 07:37:14 -0000 1.1 >+++ schema/serviceProviderFactory.exsd 26 Jun 2007 17:41:14 -0000 >@@ -1,9 +1,9 @@ > <?xml version='1.0' encoding='UTF-8'?> > <!-- Schema file written by PDE --> >-<schema targetNamespace="org.eclipse.mylar.xplanner.core"> >+<schema targetNamespace="org.eclipse.mylyn.xplanner.core"> > <annotation> > <appInfo> >- <meta.schema plugin="org.eclipse.mylar.xplanner.core" id="serviceProviderFactory" name="Service provider factory"/> >+ <meta.schema plugin="org.eclipse.mylyn.xplanner.core" id="serviceProviderFactory" name="Service provider factory"/> > </appInfo> > <documentation> > [Enter description of this extension point.] >@@ -65,7 +65,7 @@ > Class that implements the XPlanner Core service interface > </documentation> > <appInfo> >- <meta.attribute kind="java" basedOn=":org.eclipse.mylar.xplanner.core.service.XPlannerServiceFactory"/> >+ <meta.attribute kind="java" basedOn=":org.eclipse.mylyn.xplanner.core.service.XPlannerServiceFactory"/> > </appInfo> > </annotation> > </attribute> >Index: src/org/xplanner/soap/XPlanner/XPlannerProxy.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/XPlanner/XPlannerProxy.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerProxy.java >--- src/org/xplanner/soap/XPlanner/XPlannerProxy.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/XPlanner/XPlannerProxy.java 26 Jun 2007 17:41:15 -0000 >@@ -226,13 +226,13 @@ > xPlanner.removeUserStory(id); > } > >- public org.xplanner.soap.TaskData[] getCurrentTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylar.xplanner.wsdl.db.QueryException{ >+ public org.xplanner.soap.TaskData[] getCurrentTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylyn.xplanner.wsdl.db.QueryException{ > if (xPlanner == null) > _initXPlannerProxy(); > return xPlanner.getCurrentTasksForPerson(personId); > } > >- public org.xplanner.soap.TaskData[] getPlannedTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylar.xplanner.wsdl.db.QueryException{ >+ public org.xplanner.soap.TaskData[] getPlannedTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylyn.xplanner.wsdl.db.QueryException{ > if (xPlanner == null) > _initXPlannerProxy(); > return xPlanner.getPlannedTasksForPerson(personId); >Index: src/org/xplanner/soap/XPlanner/XPlanner.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/XPlanner/XPlanner.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlanner.java >--- src/org/xplanner/soap/XPlanner/XPlanner.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/XPlanner/XPlanner.java 26 Jun 2007 17:41:15 -0000 >@@ -40,8 +40,8 @@ > public void removeIteration(int id) throws java.rmi.RemoteException; > public org.xplanner.soap.UserStoryData addUserStory(org.xplanner.soap.UserStoryData story) throws java.rmi.RemoteException; > public void removeUserStory(int id) throws java.rmi.RemoteException; >- public org.xplanner.soap.TaskData[] getCurrentTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylar.xplanner.wsdl.db.QueryException; >- public org.xplanner.soap.TaskData[] getPlannedTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylar.xplanner.wsdl.db.QueryException; >+ public org.xplanner.soap.TaskData[] getCurrentTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylyn.xplanner.wsdl.db.QueryException; >+ public org.xplanner.soap.TaskData[] getPlannedTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylyn.xplanner.wsdl.db.QueryException; > public void removeTask(int id) throws java.rmi.RemoteException; > public org.xplanner.soap.TimeEntryData getTimeEntry(int id) throws java.rmi.RemoteException; > public org.xplanner.soap.TimeEntryData addTimeEntry(org.xplanner.soap.TimeEntryData timeEntry) throws java.rmi.RemoteException; >Index: src/org/xplanner/soap/XPlanner/XPlannerSoapBindingStub.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/XPlanner/XPlannerSoapBindingStub.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerSoapBindingStub.java >--- src/org/xplanner/soap/XPlanner/XPlannerSoapBindingStub.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/XPlanner/XPlannerSoapBindingStub.java 26 Jun 2007 17:41:16 -0000 >@@ -373,7 +373,7 @@ > oper.setUse(org.apache.axis.constants.Use.ENCODED); > oper.addFault(new org.apache.axis.description.FaultDesc( > new javax.xml.namespace.QName("http://xplanner.org:8080/soap/XPlanner", "fault"), //$NON-NLS-1$ //$NON-NLS-2$ >- "org.eclipse.mylar.xplanner.wsdl.db.QueryException", //$NON-NLS-1$ >+ "org.eclipse.mylyn.xplanner.wsdl.db.QueryException", //$NON-NLS-1$ > new javax.xml.namespace.QName("http://db.xplanner.technoetic.com", "QueryException"), //$NON-NLS-1$ //$NON-NLS-2$ > true > )); >@@ -390,7 +390,7 @@ > oper.setUse(org.apache.axis.constants.Use.ENCODED); > oper.addFault(new org.apache.axis.description.FaultDesc( > new javax.xml.namespace.QName("http://xplanner.org:8080/soap/XPlanner", "fault"), //$NON-NLS-1$ //$NON-NLS-2$ >- "org.eclipse.mylar.xplanner.wsdl.db.QueryException", //$NON-NLS-1$ >+ "org.eclipse.mylyn.xplanner.wsdl.db.QueryException", //$NON-NLS-1$ > new javax.xml.namespace.QName("http://db.xplanner.technoetic.com", "QueryException"), //$NON-NLS-1$ //$NON-NLS-2$ > true > )); >@@ -540,14 +540,14 @@ > java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; > qName = new javax.xml.namespace.QName("http://db.xplanner.technoetic.com", "QueryException"); //$NON-NLS-1$ //$NON-NLS-2$ > cachedSerQNames.add(qName); >- cls = org.eclipse.mylar.xplanner.wsdl.db.QueryException.class; >+ cls = org.eclipse.mylyn.xplanner.wsdl.db.QueryException.class; > cachedSerClasses.add(cls); > cachedSerFactories.add(beansf); > cachedDeserFactories.add(beandf); > > qName = new javax.xml.namespace.QName("http://domain.soap.xplanner.technoetic.com", "DomainData"); //$NON-NLS-1$ //$NON-NLS-2$ > cachedSerQNames.add(qName); >- cls = org.eclipse.mylar.xplanner.wsdl.soap.domain.DomainData.class; >+ cls = org.eclipse.mylyn.xplanner.wsdl.soap.domain.DomainData.class; > cachedSerClasses.add(cls); > cachedSerFactories.add(beansf); > cachedDeserFactories.add(beandf); >@@ -1391,7 +1391,8 @@ > _call.setSOAPActionURI(""); //$NON-NLS-1$ > _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); > _call.setOperationName(new javax.xml.namespace.QName("http://soap.xplanner.technoetic.com", "getTask")); //$NON-NLS-1$ //$NON-NLS-2$ >- >+ _call.setTimeout(new Integer(30000)); >+ > setRequestHeaders(_call); > setAttachments(_call); > try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Integer(id)}); >@@ -1608,7 +1609,7 @@ > } > } > >- public org.xplanner.soap.TaskData[] getCurrentTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylar.xplanner.wsdl.db.QueryException { >+ public org.xplanner.soap.TaskData[] getCurrentTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylyn.xplanner.wsdl.db.QueryException { > if (super.cachedEndpoint == null) { > throw new org.apache.axis.NoEndPointException(); > } >@@ -1639,15 +1640,15 @@ > if (axisFaultException.detail instanceof java.rmi.RemoteException) { > throw (java.rmi.RemoteException) axisFaultException.detail; > } >- if (axisFaultException.detail instanceof org.eclipse.mylar.xplanner.wsdl.db.QueryException) { >- throw (org.eclipse.mylar.xplanner.wsdl.db.QueryException) axisFaultException.detail; >+ if (axisFaultException.detail instanceof org.eclipse.mylyn.xplanner.wsdl.db.QueryException) { >+ throw (org.eclipse.mylyn.xplanner.wsdl.db.QueryException) axisFaultException.detail; > } > } > throw axisFaultException; > } > } > >- public org.xplanner.soap.TaskData[] getPlannedTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylar.xplanner.wsdl.db.QueryException { >+ public org.xplanner.soap.TaskData[] getPlannedTasksForPerson(int personId) throws java.rmi.RemoteException, org.eclipse.mylyn.xplanner.wsdl.db.QueryException { > if (super.cachedEndpoint == null) { > throw new org.apache.axis.NoEndPointException(); > } >@@ -1678,8 +1679,8 @@ > if (axisFaultException.detail instanceof java.rmi.RemoteException) { > throw (java.rmi.RemoteException) axisFaultException.detail; > } >- if (axisFaultException.detail instanceof org.eclipse.mylar.xplanner.wsdl.db.QueryException) { >- throw (org.eclipse.mylar.xplanner.wsdl.db.QueryException) axisFaultException.detail; >+ if (axisFaultException.detail instanceof org.eclipse.mylyn.xplanner.wsdl.db.QueryException) { >+ throw (org.eclipse.mylyn.xplanner.wsdl.db.QueryException) axisFaultException.detail; > } > } > throw axisFaultException; >Index: src/org/xplanner/soap/XPlanner/XPlannerServiceLocator.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/src/org/xplanner/soap/XPlanner/XPlannerServiceLocator.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerServiceLocator.java >--- src/org/xplanner/soap/XPlanner/XPlannerServiceLocator.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/xplanner/soap/XPlanner/XPlannerServiceLocator.java 26 Jun 2007 17:41:15 -0000 >@@ -7,9 +7,23 @@ > > package org.xplanner.soap.XPlanner; > >+import java.net.Proxy; >+import java.util.Hashtable; >+import java.util.Map; >+ >+import javax.xml.rpc.Call; >+import javax.xml.rpc.ServiceException; >+ >+import org.apache.axis.transport.http.HTTPConstants; >+ > @SuppressWarnings("unchecked") > public class XPlannerServiceLocator extends org.apache.axis.client.Service implements org.xplanner.soap.XPlanner.XPlannerService { > >+ private Proxy proxy; >+ private String httpUser; >+ private String httpPassword; >+ private boolean compression; >+ > public XPlannerServiceLocator() { > } > >@@ -140,4 +154,64 @@ > setEndpointAddress(portName.getLocalPart(), address); > } > >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.apache.axis.client.Service#createCall() >+ */ >+ public Call createCall() throws ServiceException { >+ Call call = super.createCall(); >+ // JIRA does not accept compressed SOAP messages: see bug 175915 >+ //call.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE); >+ if (compression) { >+ call.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE); >+ } >+ if (httpUser != null && httpPassword != null) { >+ call.setProperty(XPlannerHttpSender.HTTP_USER, httpUser); >+ call.setProperty(XPlannerHttpSender.HTTP_PASSWORD, httpPassword); >+ } >+ if (proxy != null) { >+ call.setProperty(XPlannerHttpSender.PROXY, proxy); >+ } >+ >+ // Some clients break with a 411 Length Required when chunked encoding >+ // is used >+ Map<String, Boolean> headers = new Hashtable<String, Boolean>(); >+ headers.put(HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED, Boolean.FALSE); >+ call.setProperty(HTTPConstants.REQUEST_HEADERS, headers); >+ return call; >+ } >+ >+ public Proxy getProxy() { >+ return proxy; >+ } >+ >+ public void setProxy(Proxy proxy) { >+ this.proxy = proxy; >+ } >+ >+ public String getHttpUser() { >+ return httpUser; >+ } >+ >+ public void setHttpUser(String httpUser) { >+ this.httpUser = httpUser; >+ } >+ >+ public String getHttpPassword() { >+ return httpPassword; >+ } >+ >+ public void setHttpPassword(String httpPassword) { >+ this.httpPassword = httpPassword; >+ } >+ >+ public boolean isCompression() { >+ return compression; >+ } >+ >+ public void setCompression(boolean compression) { >+ this.compression = compression; >+ } >+ > } >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.core/META-INF/MANIFEST.MF,v >retrieving revision 1.1 >diff -u -r1.1 MANIFEST.MF >--- META-INF/MANIFEST.MF 31 May 2007 07:37:15 -0000 1.1 >+++ META-INF/MANIFEST.MF 26 Jun 2007 17:41:14 -0000 >@@ -1,18 +1,16 @@ > Manifest-Version: 1.0 > Bundle-ManifestVersion: 2 > Bundle-Name: %bundleName >-Bundle-SymbolicName: org.eclipse.mylar.xplanner.core;singleton:=true >+Bundle-SymbolicName: org.eclipse.mylyn.xplanner.core;singleton:=true > Bundle-Version: 2.0.0.qualifier >-Bundle-Activator: org.eclipse.mylar.xplanner.core.XPlannerCorePlugin >+Bundle-Activator: org.eclipse.mylyn.xplanner.core.XPlannerCorePlugin > Bundle-Vendor: %bundleVendor > Bundle-Localization: plugin >-Require-Bundle: org.eclipse.core.runtime >+Require-Bundle: org.eclipse.core.runtime, >+ org.eclipse.mylyn, >+ org.eclipse.mylyn.web.core > Eclipse-LazyStart: true >-Export-Package: org.eclipse.mylar.xplanner.core, >- org.eclipse.mylar.xplanner.core.service, >- org.eclipse.mylar.xplanner.core.service.exceptions,org.eclipse.mylar.xplanner.wsdl.db, >- org.eclipse.mylar.xplanner.wsdl.soap.domain, >- org.apache.axis, >+Export-Package: org.apache.axis, > org.apache.axis.attachments, > org.apache.axis.client, > org.apache.axis.client.async, >@@ -67,9 +65,14 @@ > org.apache.axis.wsdl.gen, > org.apache.axis.wsdl.symbolTable, > org.apache.axis.wsdl.toJava, >+ org.eclipse.mylyn.xplanner.wsdl.db, >+ org.eclipse.mylyn.xplanner.wsdl.soap.domain, >+ org.eclipse.mylyn.xplanner.core, >+ org.eclipse.mylyn.xplanner.core.service, >+ org.eclipse.mylyn.xplanner.core.service.exceptions, > org.xplanner.soap, > org.xplanner.soap.XPlanner >-Bundle-ClassPath: plugin.jar, >+Bundle-ClassPath: ., > lib/axis.jar, > lib/commons-codec-1.3.jar, > lib/commons-discovery-0.2.jar, >Index: src/org/eclipse/mylyn/xplanner/core/XPlannerClientListener.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/core/XPlannerClientListener.java >diff -N src/org/eclipse/mylyn/xplanner/core/XPlannerClientListener.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/xplanner/core/XPlannerClientListener.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,22 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 - 2007 CodeGear 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 >+ *******************************************************************************/ >+package org.eclipse.mylyn.xplanner.core; >+ >+/** >+ * @author Ravi Kumar >+ * @author Helen Bershadskaya >+ */ >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+ >+ >+public interface XPlannerClientListener { >+ >+ public abstract void clientAdded(XPlannerClient client); >+ >+ public abstract void clientRemoved(XPlannerClient client); >+} >Index: src/org/eclipse/mylyn/xplanner/core/service/XPlannerClient.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/core/service/XPlannerClient.java >diff -N src/org/eclipse/mylyn/xplanner/core/service/XPlannerClient.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/xplanner/core/service/XPlannerClient.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,93 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 - 2007 CodeGear 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 >+ *******************************************************************************/ >+package org.eclipse.mylyn.xplanner.core.service; >+ >+import java.net.Proxy; >+ >+import org.xplanner.soap.TaskData; >+import org.xplanner.soap.UserStoryData; >+ >+/** >+ * TODO this class needs to be populated using the SOAP or JAX-RPC interfaces. >+ * Once this is done it should be cached on disk somewhere so we don't have to >+ * query the server each time a client loads. It should be possible to reload >+ * and restore the cache information. We also need to store the images in a >+ * cache somewhere since we will use them a lot. >+ * >+ * TODO explain this is an attempt to enrich the XPlanner service layer >+ * >+ * TODO move all of the assignee stuff somewhere else. >+ * >+ * @author Ravi Kumar >+ * @author Helen Bershadskaya >+ */ >+ >+public abstract class XPlannerClient extends XPlannerService { >+ public static final int NO_LIMIT = -1; >+ >+ >+ /** >+ * Assign to the default user >+ */ >+ public static final int ASSIGNEE_DEFAULT = 1; >+ >+ /** >+ * Leave the assignee field as is (this does not apply when performing an assign to action) >+ */ >+ public static final int ASSIGNEE_CURRENT = 2; >+ >+ /** >+ * Assign to nobody >+ */ >+ public static final int ASSIGNEE_NONE = 3; >+ >+ /** >+ * Assign to a specific user. To get the name of the assignee call {@link #getAssignee()} >+ */ >+ public static final int ASSIGNEE_USER = 4; >+ >+ /** >+ * Assign to the current user >+ */ >+ public static final int ASSIGNEE_SELF = 5; >+ >+ public abstract boolean hasSlowConnection(); >+ public abstract String getName(); >+ public abstract String getBaseURL(); >+ public abstract String getCurrentUserName(); >+ public abstract String getCurrentUserPassword(); >+ public abstract int getCurrentPersonId(); >+ public abstract TaskData[] getUserStoryTasksForPerson(int personId, int userStoryId); >+ public abstract UserStoryData[] getIterationUserStoriesForTracker(int trackerId, int iterationId); >+ public abstract UserStoryData[] getUserStoriesForProject(int projectId); >+ public abstract UserStoryData[] getUserStoriesForProject(int projectId, int trackerId); >+ public abstract TaskData[] getTasksForProject(int projectId); >+ public abstract TaskData[] getTasksForProject(int projectId, int personId); >+ public abstract TaskData[] getTasksForIteration(int iterationId); >+ public abstract TaskData[] getTasksForIteration(int iterationId, int personId); >+ public abstract boolean useCompression(); >+ public abstract Proxy getProxy(); >+ public abstract String getHttpUser(); >+ public abstract String getHttpPassword(); >+ >+// /** >+// * Force a login to the remote repository. >+// * @deprecated There is no need to call this method as all services should automatically >+// * login when the session is about to expire. If you need to check if the credentials >+// * are valid, call {@link org.eclipse.mylyn.xplanner.core.ClientManager#testConnection(String, String, String)} >+// */ >+// public abstract void login(); >+// >+// /** >+// * Force the current session to be closed. This method should only be called during >+// * application shutdown and then only out of courtesy to the server. XPlanner will >+// * automatically expire sessions after a set amount of time. >+// */ >+// public abstract void logout(); >+// >+} >Index: src/org/xplanner/soap/XPlanner/XPlannerHttpSender.java >=================================================================== >RCS file: src/org/xplanner/soap/XPlanner/XPlannerHttpSender.java >diff -N src/org/xplanner/soap/XPlanner/XPlannerHttpSender.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/xplanner/soap/XPlanner/XPlannerHttpSender.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,26 @@ >+package org.xplanner.soap.XPlanner; >+ >+import java.net.Proxy; >+import java.net.URL; >+ >+import org.apache.axis.MessageContext; >+import org.apache.axis.transport.http.CommonsHTTPSender; >+import org.apache.commons.httpclient.HostConfiguration; >+import org.apache.commons.httpclient.HttpClient; >+import org.eclipse.mylyn.web.core.WebClientUtil; >+ >+public class XPlannerHttpSender extends CommonsHTTPSender { >+ >+ public static final String PROXY = "org.eclipse.mylyn.xplanner.proxy"; //$NON-NLS-1$ >+ public static final String HTTP_USER = "org.eclipse.mylyn.xplanner.httpUser"; //$NON-NLS-1$ >+ public static final String HTTP_PASSWORD = "org.eclipse.mylyn.xplanner.httpPassword"; //$NON-NLS-1$ >+ >+ @Override >+ protected HostConfiguration getHostConfiguration(HttpClient client, MessageContext context, URL url) { >+ Proxy proxy = (Proxy) context.getProperty(PROXY); >+ String httpUser = (String) context.getProperty(HTTP_USER); >+ String httpPassword = (String) context.getProperty(HTTP_PASSWORD); >+ WebClientUtil.setupHttpClient(client, proxy, url.toString(), httpUser, httpPassword); >+ return client.getHostConfiguration(); >+ } >+} >Index: src/org/eclipse/mylyn/xplanner/core/service/soap/client-config.wsdd >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/core/service/soap/client-config.wsdd >diff -N src/org/eclipse/mylyn/xplanner/core/service/soap/client-config.wsdd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/xplanner/core/service/soap/client-config.wsdd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,14 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<deployment name="defaultClientConfig" >+ xmlns="http://xml.apache.org/axis/wsdd/" >+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> >+<!-- >+ <transport name="http" pivot="java:org.apache.axis.transport.http.CommonsHTTPSender" /> >+ <transport name="https" pivot="java:org.apache.axis.transport.http.CommonsHTTPSender"/> >+--> >+ <transport name="http" pivot="java:org.xplanner.soap.XPlannerHttpSender" /> >+ <transport name="https" pivot="java:org.xplanner.soap.XPlannerHttpSender"/> >+ >+ <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/> >+ >+</deployment> >Index: src/org/eclipse/mylyn/xplanner/core/XPlannerClientManager.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/core/XPlannerClientManager.java >diff -N src/org/eclipse/mylyn/xplanner/core/XPlannerClientManager.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/xplanner/core/XPlannerClientManager.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,257 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 - 2007 CodeGear 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 >+ *******************************************************************************/ >+package org.eclipse.mylyn.xplanner.core; >+ >+/** >+ * @author Ravi Kumar >+ * @author Helen Bershadskaya >+ */ >+import java.io.*; >+import java.net.Proxy; >+import java.net.URL; >+import java.rmi.RemoteException; >+import java.util.*; >+ >+import org.apache.axis.AxisFault; >+import org.eclipse.mylyn.xplanner.core.service.CachedXPlannerClient; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.core.service.exceptions.AuthenticationException; >+import org.eclipse.mylyn.xplanner.core.service.exceptions.ServiceUnavailableException; >+import org.xml.sax.SAXException; >+ >+ >+/** >+ * @author Helen Bershadskaya >+ * @author Ravi Kumar >+ */ >+public class XPlannerClientManager { >+ >+ private final File cacheLocation; >+ >+ private Map<String, XPlannerClient> clientByName = new HashMap<String, XPlannerClient>(); >+ >+ // TODO Use a decent listener list >+ private List<XPlannerClientListener> listeners = new ArrayList<XPlannerClientListener>(); >+ >+ public XPlannerClientManager(File cacheLocation) { >+ this.cacheLocation = cacheLocation; >+ } >+ >+ protected void start() { >+ // On first load the cache may not exist >+ cacheLocation.mkdirs(); >+ >+ File[] clients = this.cacheLocation.listFiles(); >+ for (int i = 0; i < clients.length; i++) { >+ File clientCache = clients[i]; >+ File clientFile = new File(clientCache, "server.ser"); //$NON-NLS-1$ >+ >+ ObjectInputStream ois = null; >+ try { >+ ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(clientFile))); >+ XPlannerClient client = (XPlannerClient) ois.readObject(); >+ // TODO reconnect the services depending on user preferences >+ >+ clientByName.put(clientCache.getName(), client); >+ ois.close(); >+ } catch (IOException e) { >+ e.printStackTrace(); >+ } catch (ClassNotFoundException e) { >+ e.printStackTrace(); >+ } finally { >+ if (ois != null) { >+ try { >+ ois.close(); >+ } catch (IOException e) { >+ } >+ } >+ } >+ } >+ } >+ >+ protected void stop() { >+ for (Iterator<XPlannerClient> iClients = clientByName.values().iterator(); iClients.hasNext();) { >+ XPlannerClient client = iClients.next(); >+ >+ ObjectOutputStream oos = null; >+ try { >+ File cacheDir = new File(cacheLocation, client.getName()); >+ cacheDir.mkdirs(); >+ >+ oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(new File(cacheDir, "server.ser")))); //$NON-NLS-1$ >+ oos.writeObject(client); >+ } catch (IOException e) { >+ e.printStackTrace(); >+ } finally { >+ if (oos != null) { >+ try { >+ oos.close(); >+ } catch (IOException e) { >+ } >+ } >+ } >+ } >+ } >+ >+ /** >+ * Tests the connection to a client. If the URL is invalid ot the username >+ * and password are invalid this method will return with a exceptions carrying >+ * the failure reason. >+ * @param baseUrl Base URL of the XPlanner installation >+ * @param username username to connect with >+ * @param password Password to connect with >+ * @return Short string describing the client information >+ * @throws AuthenticationException URL was valid but username and password were incorrect >+ * @throws ServiceUnavailableException URL was not valid >+ */ >+ public String testConnection(String baseUrl, String username, String password, >+ Proxy proxy, String httpUser, String httpPassword) throws AuthenticationException, ServiceUnavailableException { >+ if (baseUrl == null || baseUrl.length() == 0) { >+ throw new AuthenticationException(Messages.ClientManager_CLIENT_URL_CANNOT_BE_EMPTY); >+ } >+ >+ XPlannerClient client = null; >+ >+ try { >+ new URL(baseUrl).openConnection(); // tests url validity >+ >+ client = createClient("Connection Test", baseUrl, false, username, password, //$NON-NLS-1$ >+ false, proxy, httpUser, httpPassword); >+ >+ client.getTask(-1); >+ } >+ catch (RemoteException re) { >+ if (re instanceof AxisFault) { >+ String message = re.getMessage().trim(); >+ if (message.startsWith("(401)")) { //$NON-NLS-1$ >+ message = Messages.ClientManager_INVALID_USERNAME_PASSWORD; >+ } >+ else if (re.getCause() instanceof SAXException) { >+ message = ""; //$NON-NLS-1$ >+ } >+ else { >+ if (re.getCause() != null) { >+ message = re.getCause().getMessage(); >+ } >+ message = message.startsWith(";") ? message.substring(1).trim() : message; //$NON-NLS-1$ >+ } >+ throw new AuthenticationException(message); >+ } >+ else { >+ throw new ServiceUnavailableException(re.getMessage()); >+ } >+ } >+ catch (Exception e) { >+ throw new ServiceUnavailableException(e.getMessage()); >+ } >+ finally { >+ if (client != null) { >+ removeClient(client); >+ } >+ } >+ >+ return "XPlanner"; //$NON-NLS-1$ >+ } >+ >+ public XPlannerClient getClient(String name) { >+ return (XPlannerClient) clientByName.get(name); >+ } >+ >+ public XPlannerClient[] getAllClients() { >+ return (XPlannerClient[]) clientByName.values().toArray(new XPlannerClient[clientByName.size()]); >+ } >+ >+ public XPlannerClient createClient(String name, String baseUrl, boolean hasSlowConnection, >+ String username, String password, boolean useCompression, Proxy proxy, String httpUser, String httpPassword) { >+ if (baseUrl.charAt(baseUrl.length() - 1) == '/') { >+ baseUrl = baseUrl.substring(0, baseUrl.length() - 1); >+ } >+ >+ XPlannerClient client = new CachedXPlannerClient(name, baseUrl, hasSlowConnection, username, password, useCompression, >+ proxy, httpUser, httpPassword); >+ return client; >+ } >+ >+ public void addClient(XPlannerClient client) { >+ if (clientByName.containsKey(client.getName())) { >+// TODO: add this check back once the listeners for client property change are hooked up >+// Also handle the case when serviceDelegate in the cachedServer is null >+// throw new RuntimeException("A server with that name already exists"); >+ removeClient(client); >+ } >+ clientByName.put(client.getName(), client); >+ fireClientAddded(client); >+ } >+ >+ public void removeClient(XPlannerClient client) { >+ clientByName.remove(client.getName()); >+ >+ File clientCache = new File(this.cacheLocation, client.getName()); >+ if (clientCache.exists()) { >+ recursiveDelete(clientCache); >+ } >+ fireClientRemoved(client); >+ } >+ >+ /** >+ * TODO need to make this a bit smarter. Perhaps have an object to hold connectino info >+ * @param name >+ * @param baseURL >+ * @param username >+ * @param password >+ */ >+ public void updateClientDetails(String name, String baseURL, boolean hasSlowConnection, String username, String password) { >+ CachedXPlannerClient client = (CachedXPlannerClient) clientByName.get(name); >+ // TODO we should really have a modify event >+ >+ fireClientRemoved(client); >+ >+ // TODO need to flush the client cache since we are possibly a different person >+ client.setBaseURL(baseURL); >+ client.setSlowConnection(hasSlowConnection); >+ client.setCurrentUserName(username); >+ client.setCurrentPassword(password); >+ >+ fireClientAddded(client); >+ } >+ >+ public void addClientListener(XPlannerClientListener listener) { >+ listeners.add(listener); >+ } >+ >+ public void removeClientListener(XPlannerClientListener listener) { >+ listeners.remove(listener); >+ } >+ >+ private void fireClientRemoved(XPlannerClient client) { >+ for (Iterator<XPlannerClientListener> iListeners = listeners.iterator(); iListeners.hasNext();) { >+ XPlannerClientListener listener = (XPlannerClientListener)iListeners.next(); >+ listener.clientRemoved(client); >+ } >+ } >+ >+ private void fireClientAddded(XPlannerClient client) { >+ for (Iterator<XPlannerClientListener> iListeners = listeners.iterator(); iListeners.hasNext();) { >+ XPlannerClientListener listener = (XPlannerClientListener)iListeners.next(); >+ listener.clientAdded(client); >+ } >+ } >+ >+ private void recursiveDelete(File baseFile) { >+ if (baseFile.isFile()) { >+ baseFile.delete(); >+ } else { >+ File[] children = baseFile.listFiles(); >+ for (int i = 0; i < children.length; i++) { >+ File file = children[i]; >+ recursiveDelete(file); >+ } >+ baseFile.delete(); >+ } >+ } >+} >Index: src/org/eclipse/mylyn/xplanner/core/service/CachedXPlannerClient.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/core/service/CachedXPlannerClient.java >diff -N src/org/eclipse/mylyn/xplanner/core/service/CachedXPlannerClient.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/xplanner/core/service/CachedXPlannerClient.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,514 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 - 2007 CodeGear 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 >+ *******************************************************************************/ >+package org.eclipse.mylyn.xplanner.core.service; >+ >+import java.io.Serializable; >+import java.net.Proxy; >+import java.rmi.RemoteException; >+import java.util.*; >+ >+import org.eclipse.mylyn.xplanner.wsdl.db.QueryException; >+import org.xplanner.soap.*; >+ >+ >+/** >+ * XPlanner client implementation that caches information that is unlikely to change >+ * during the session. This client could be persisted to disk and re-loaded. >+ * It has lifecycle methods to allow data in the cache to be reloaded. >+ * >+ * TODO it is assumed that it will be backed by a standard XPlanner service layer >+ * >+ * @author Ravi Kumar >+ * @author Helen Bershadskaya >+ */ >+public class CachedXPlannerClient extends XPlannerClient >+ implements Serializable { >+ >+ public static final int INVALID_ID = -1; >+ >+ /** >+ * >+ */ >+ private static final long serialVersionUID = 1L; >+ private String name; >+ private String baseURL; >+ private boolean hasSlowConnection; >+ private String userName; >+ private String password; >+ private final boolean useCompression; >+ private final transient Proxy proxy; >+ private final String httpUser; >+ private final String httpPassword; >+ private transient XPlannerService serviceDelegate; >+ >+ public CachedXPlannerClient(String name, String baseURL, boolean hasSlowConnection, String userName, String password, >+ boolean useCompression, Proxy proxy, String httpUser, String httpPassword) { >+ this.name = name; >+ this.baseURL = baseURL; >+ this.hasSlowConnection = hasSlowConnection; >+ this.userName = userName; >+ this.password = password; >+ this.useCompression = useCompression; >+ this.proxy = proxy; >+ this.httpUser = httpUser; >+ this.httpPassword = httpPassword; >+ >+ >+ this.serviceDelegate = ServiceManager.getXPlannerService(this); >+ serviceDelegate.login(userName, password); >+ } >+ >+ public String getBaseURL() { >+ return baseURL; >+ } >+ >+ public String getCurrentUserName() { >+ return userName; >+ } >+ >+ public String getCurrentUserPassword() { >+ return password; >+ } >+ >+ public int getMaximumNumberOfMatches() { >+ return 0; >+ } >+ >+ public String getName() { >+ return name; >+ } >+ >+ public boolean hasSlowConnection() { >+ return hasSlowConnection; >+ } >+ >+ >+ public void setSlowConnection(boolean hasSlowConnection) { >+ this.hasSlowConnection = hasSlowConnection; >+ } >+ >+ public void setBaseURL(String baseURL) { >+ this.baseURL = baseURL; >+ } >+ >+ public void setCurrentPassword(String password) { >+ this.password = password; >+ } >+ >+ public void setCurrentUserName(String userName) { >+ this.userName = userName; >+ } >+ >+ public String login(String username, String password) { >+ return serviceDelegate.login(username, password); >+ } >+ >+ public boolean logout() { >+ boolean ok = true; >+ >+ //TODO -- shouldn't have a null service delegate, but definitely get into this condition if "finish" >+ // repository definition with an invalid client >+ >+ if (serviceDelegate != null) { >+ ok = serviceDelegate.logout(); >+ } >+ >+ return ok; >+ } >+ >+ public IterationData addIteration(IterationData iteration) throws RemoteException { >+ return serviceDelegate.addIteration(iteration); >+ } >+ >+ public NoteData addNote(NoteData note) throws RemoteException { >+ return serviceDelegate.addNote(note); >+ } >+ >+ public PersonData addPerson(PersonData object) throws RemoteException { >+ return serviceDelegate.addPerson(object); >+ } >+ >+ public ProjectData addProject(ProjectData project) throws RemoteException { >+ return serviceDelegate.addProject(project); >+ } >+ >+ public TaskData addTask(TaskData task) throws RemoteException { >+ return serviceDelegate.addTask(task); >+ } >+ >+ public TimeEntryData addTimeEntry(TimeEntryData timeEntry) throws RemoteException { >+ return serviceDelegate.addTimeEntry(timeEntry); >+ } >+ >+ public UserStoryData addUserStory(UserStoryData story) throws RemoteException { >+ return serviceDelegate.addUserStory(story); >+ } >+ >+ public void deleteAttribute(int objectId, String key) throws RemoteException { >+ serviceDelegate.deleteAttribute(objectId, key); >+ } >+ >+ public boolean equals(Object obj) { >+ return this == obj || serviceDelegate.equals(obj) || >+ (obj instanceof CachedXPlannerClient && ((CachedXPlannerClient)obj).serviceDelegate.equals(serviceDelegate)); >+ } >+ >+ public String getAttribute(int objectId, String key) throws RemoteException { >+ return serviceDelegate.getAttribute(objectId, key); >+ } >+ >+ @SuppressWarnings("unchecked") >+ public HashMap getAttributes(int objectId) throws RemoteException { >+ return serviceDelegate.getAttributes(objectId); >+ } >+ >+ @SuppressWarnings("unchecked") >+ public HashMap getAttributesWithPrefix(int objectId, String prefix) throws RemoteException { >+ return serviceDelegate.getAttributesWithPrefix(objectId, prefix); >+ } >+ >+ public IterationData getCurrentIteration(int projectId) throws RemoteException { >+ return serviceDelegate.getCurrentIteration(projectId); >+ } >+ >+ public TaskData[] getCurrentTasksForPerson(int personId) throws RemoteException, QueryException { >+ return serviceDelegate.getCurrentTasksForPerson(personId); >+ } >+ >+ public IterationData getIteration(int id) throws RemoteException { >+ return serviceDelegate.getIteration(id); >+ } >+ >+ public IterationData[] getIterations(int projectId) throws RemoteException { >+ return serviceDelegate.getIterations(projectId); >+ } >+ >+ public NoteData getNote(int id) throws RemoteException { >+ return serviceDelegate.getNote(id); >+ } >+ >+ public NoteData[] getNotesForObject(int attachedToId) throws RemoteException { >+ return serviceDelegate.getNotesForObject(attachedToId); >+ } >+ >+ public PersonData[] getPeople() throws RemoteException { >+ return serviceDelegate.getPeople(); >+ } >+ >+ public PersonData getPerson(int id) throws RemoteException { >+ return serviceDelegate.getPerson(id); >+ } >+ >+ public TaskData[] getPlannedTasksForPerson(int personId) throws RemoteException, QueryException { >+ return serviceDelegate.getPlannedTasksForPerson(personId); >+ } >+ >+ public ProjectData getProject(int id) throws RemoteException { >+ return serviceDelegate.getProject(id); >+ } >+ >+ public ProjectData[] getProjects() throws RemoteException { >+ return serviceDelegate.getProjects(); >+ } >+ >+ public TaskData getTask(int id) throws RemoteException { >+ if (serviceDelegate == null) { >+ System.out.println(" why is serivce Delegate null???"); //$NON-NLS-1$ >+ } >+ return serviceDelegate.getTask(id); >+ } >+ >+ public TaskData[] getTasks(int containerId) throws RemoteException { >+ return serviceDelegate.getTasks(containerId); >+ } >+ >+ public TimeEntryData[] getTimeEntries(int containerId) throws RemoteException { >+ return serviceDelegate.getTimeEntries(containerId); >+ } >+ >+ public TimeEntryData getTimeEntry(int id) throws RemoteException { >+ return serviceDelegate.getTimeEntry(id); >+ } >+ >+ public UserStoryData[] getUserStories(int containerId) throws RemoteException { >+ return serviceDelegate.getUserStories(containerId); >+ } >+ >+ public UserStoryData getUserStory(int id) throws RemoteException { >+ return serviceDelegate.getUserStory(id); >+ } >+ >+ public int hashCode() { >+ return serviceDelegate.hashCode(); >+ } >+ >+ public void removeIteration(int id) throws RemoteException { >+ serviceDelegate.removeIteration(id); >+ } >+ >+ public void removeNote(int id) throws RemoteException { >+ serviceDelegate.removeNote(id); >+ } >+ >+ public void removePerson(int id) throws RemoteException { >+ serviceDelegate.removePerson(id); >+ } >+ >+ public void removeProject(int id) throws RemoteException { >+ serviceDelegate.removeProject(id); >+ } >+ >+ public void removeTask(int id) throws RemoteException { >+ serviceDelegate.removeTask(id); >+ } >+ >+ public void removeTimeEntry(int id) throws RemoteException { >+ serviceDelegate.removeTimeEntry(id); >+ } >+ >+ public void removeUserStory(int id) throws RemoteException { >+ serviceDelegate.removeUserStory(id); >+ } >+ >+ public void setAttribute(int objectId, String key, String value) throws RemoteException { >+ serviceDelegate.setAttribute(objectId, key, value); >+ } >+ >+ public void update(IterationData object) throws RemoteException { >+ serviceDelegate.update(object); >+ } >+ >+ public void update(NoteData note) throws RemoteException { >+ serviceDelegate.update(note); >+ } >+ >+ public void update(PersonData object) throws RemoteException { >+ serviceDelegate.update(object); >+ } >+ >+ public void update(ProjectData object) throws RemoteException { >+ serviceDelegate.update(object); >+ } >+ >+ public void update(TaskData object) throws RemoteException { >+ serviceDelegate.update(object); >+ } >+ >+ public void update(TimeEntryData object) throws RemoteException { >+ serviceDelegate.update(object); >+ } >+ >+ public void update(UserStoryData object) throws RemoteException { >+ serviceDelegate.update(object); >+ } >+ >+ public TaskData[] getUserStoryTasksForPerson(int personId, int userStoryId) { >+ if (personId < 0 || userStoryId < 0) { >+ return new TaskData[0]; >+ } >+ >+ List<TaskData> userStoryTasksForPerson = new ArrayList<TaskData>(); >+ try { >+ TaskData[] iterationTasks = getTasks(userStoryId); >+ // get all tasks for specified user storyserv >+ for (int i = 0; i < iterationTasks.length; i++) { >+ TaskData taskData = iterationTasks[i]; >+ if (taskData.getAcceptorId() == personId) { >+ userStoryTasksForPerson.add(taskData); >+ } >+ } >+ >+ } >+ catch (RemoteException e) { >+ e.printStackTrace(); >+ } >+ >+ return userStoryTasksForPerson.toArray(new TaskData[userStoryTasksForPerson.size()]); >+ } >+ >+ public UserStoryData[] getIterationUserStoriesForTracker(int trackerId, int iterationId) { >+ if (trackerId < 0 || iterationId < 0) { >+ return new UserStoryData[0]; >+ } >+ >+ List<UserStoryData> userStoriesForTracker = new ArrayList<UserStoryData>(); >+ UserStoryData[] userStories; >+ try { >+ userStories = getUserStories(iterationId); >+ // get all tasks for specified user story >+ for (int i = 0; i < userStories.length; i++) { >+ UserStoryData userStory = userStories[i]; >+ if (userStory.getTrackerId() == trackerId) { >+ userStoriesForTracker.add(userStory); >+ } >+ } >+ } >+ catch (RemoteException e) { >+ e.printStackTrace(); >+ } >+ >+ return userStoriesForTracker.toArray(new UserStoryData[userStoriesForTracker.size()]); >+ } >+ >+ public int getCurrentPersonId() { >+ int currentPersonId = INVALID_ID; >+ >+ String userName = getCurrentUserName(); >+ if (userName != null) { >+ try { >+ PersonData[] people = getPeople(); >+ if (people != null) { >+ for (int i = 0; i < people.length && currentPersonId == INVALID_ID; i++) { >+ PersonData person = people[i]; >+ if (person.getUserId().equals(userName)) { >+ currentPersonId = person.getId(); >+ } >+ } >+ } >+ } >+ catch (RemoteException e) { >+ e.printStackTrace(); >+ } >+ } >+ >+ return currentPersonId; >+ } >+ >+ public UserStoryData[] getUserStoriesForProject(int projectId) { >+ if (projectId == INVALID_ID) { >+ return new UserStoryData[0]; >+ } >+ >+ ArrayList<UserStoryData> projectUserStories = new ArrayList<UserStoryData>(); >+ try { >+ IterationData[] projectIterations = getIterations(projectId); >+ for (IterationData iteration : projectIterations) { >+ UserStoryData[] iterationUserStories = getUserStories(iteration.getId()); >+ if (iterationUserStories.length > 0) { >+ projectUserStories.addAll(Arrays.asList(iterationUserStories)); >+ } >+ } >+ } >+ catch (RemoteException e) { >+ e.printStackTrace(); >+ } >+ >+ return (UserStoryData[]) projectUserStories.toArray(new UserStoryData[projectUserStories.size()]); >+ } >+ >+ public UserStoryData[] getUserStoriesForProject(int projectId, int trackerId) { >+ if (projectId == INVALID_ID) { >+ return new UserStoryData[0]; >+ } >+ >+ ArrayList<UserStoryData> projectTrackerUserStories = new ArrayList<UserStoryData>(); >+ UserStoryData[] projectUserStories = getUserStoriesForProject(projectId); >+ for (UserStoryData userStory : projectUserStories) { >+ if (userStory.getTrackerId() == trackerId) { >+ projectTrackerUserStories.add(userStory); >+ } >+ } >+ >+ return (UserStoryData[]) projectTrackerUserStories.toArray(new UserStoryData[projectTrackerUserStories.size()]); >+ >+ } >+ >+ public TaskData[] getTasksForProject(int projectId) { >+ if (projectId == -1) { >+ return new TaskData[0]; >+ } >+ >+ ArrayList<TaskData> projectTasks = new ArrayList<TaskData>(); >+ try { >+ UserStoryData[] userStories = getUserStoriesForProject(projectId); >+ for (UserStoryData userStory : userStories) { >+ TaskData[] userStoryTasks = getTasks(userStory.getId()); >+ if (userStoryTasks.length > 0) { >+ projectTasks.addAll(Arrays.asList(userStoryTasks)); >+ } >+ } >+ } >+ catch (RemoteException e) { >+ e.printStackTrace(); >+ } >+ >+ return (TaskData[]) projectTasks.toArray(new TaskData[projectTasks.size()]); >+ } >+ >+ public TaskData[] getTasksForProject(int projectId, int personId) { >+ if (projectId == INVALID_ID || personId == INVALID_ID) { >+ return new TaskData[0]; >+ } >+ >+ ArrayList<TaskData> projectPersonTasks = new ArrayList<TaskData>(); >+ TaskData[] allProjectTasks = getTasksForProject(projectId); >+ for (TaskData task : allProjectTasks) { >+ if (task.getAcceptorId() == personId) { >+ projectPersonTasks.add(task); >+ } >+ } >+ >+ return (TaskData[]) projectPersonTasks.toArray(new TaskData[projectPersonTasks.size()]); >+ } >+ >+ public TaskData[] getTasksForIteration(int iterationId) { >+ if (iterationId == INVALID_ID) { >+ return new TaskData[0]; >+ } >+ >+ ArrayList<TaskData> iterationTasks = new ArrayList<TaskData>(); >+ try { >+ UserStoryData[] userStories = getUserStories(iterationId); >+ for (UserStoryData userStory : userStories) { >+ TaskData[] userStoryTasks = getTasks(userStory.getId()); >+ if (userStoryTasks.length > 0) { >+ iterationTasks.addAll(Arrays.asList(userStoryTasks)); >+ } >+ } >+ } >+ catch (RemoteException e) { >+ e.printStackTrace(); >+ } >+ >+ return (TaskData[]) iterationTasks.toArray(new TaskData[iterationTasks.size()]); >+ } >+ >+ public TaskData[] getTasksForIteration(int iterationId, int personId) { >+ if (iterationId == INVALID_ID || personId == INVALID_ID) { >+ return new TaskData[0]; >+ } >+ >+ ArrayList<TaskData> iterationPersonTasks = new ArrayList<TaskData>(); >+ TaskData[] allIterationTasks = getTasksForIteration(iterationId); >+ for (TaskData task : allIterationTasks) { >+ if (task.getAcceptorId() == personId) { >+ iterationPersonTasks.add(task); >+ } >+ } >+ >+ return (TaskData[]) iterationPersonTasks.toArray(new TaskData[iterationPersonTasks.size()]); >+ } >+ >+ >+ public String getHttpPassword() { >+ return httpPassword; >+ } >+ >+ public String getHttpUser() { >+ return httpUser; >+ } >+ >+ public Proxy getProxy() { >+ return proxy; >+ } >+ >+ public boolean useCompression() { >+ return useCompression; >+ } >+ >+} >#P org.eclipse.mylyn.xplanner.ui >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerAttributeFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/XPlannerAttributeFactory.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerAttributeFactory.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerAttributeFactory.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerAttributeFactory.java 26 Jun 2007 17:41:18 -0000 >@@ -5,14 +5,14 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >+package org.eclipse.mylyn.xplanner.ui; > > import java.text.DateFormat; > import java.text.SimpleDateFormat; >-import java.util.Date; >+import java.util.*; > >-import org.eclipse.mylar.tasks.core.AbstractAttributeFactory; >-import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute; >+import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory; >+import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; > > > /** >@@ -37,14 +37,66 @@ > public static final String ATTRIBUTE_USER_STORY_NAME = "userStoryName"; //$NON-NLS-1$ > public static final String ATTRIBUTE_TASK_COMPLETED = "completed"; //$NON-NLS-1$ > >- @Override >- public boolean getIsHidden(String key) { >- return false; >+ public static final String ATTRIBUTE_SUBTASK_IDS = "attribute.xplanner.subtask_ids"; >+ public static final String ATTRIBUTE_SUBTASK_KEYS = "attribute.xplanner.subtask_keys"; >+ >+ private static Map<String, Attribute> commonKeyToAttributesMap = new HashMap<String, Attribute>(); >+ >+ public enum Attribute { >+ DESCRIPTION("Description:", RepositoryTaskAttribute.DESCRIPTION, false), //$NON-NLS-1$ >+ OWNER("Acceptor:", RepositoryTaskAttribute.USER_ASSIGNED, true), //$NON-NLS-1$ >+ PRIORITY("Priority:", RepositoryTaskAttribute.PRIORITY, true), //$NON-NLS-1$ >+ STATUS("Status:", RepositoryTaskAttribute.STATUS, true), //$NON-NLS-1$ >+ NAME("Name:", RepositoryTaskAttribute.SUMMARY, false), //$NON-NLS-1$ >+ CREATED_ON("Created:", RepositoryTaskAttribute.DATE_CREATION, true), //$NON-NLS-1$ >+ MODIFIED_TIME("Last Update:", RepositoryTaskAttribute.DATE_MODIFIED, true), //$NON-NLS-1$ >+ SUBTASK_IDS("Subtask ids:", XPlannerAttributeFactory.ATTRIBUTE_SUBTASK_IDS, true), >+ SUBTASK_KEYS("Sub-Tasks:", XPlannerAttributeFactory.ATTRIBUTE_SUBTASK_KEYS, true), >+ >+ ; >+ >+ private final boolean isReadOnly; >+ >+ private final String displayName; >+ >+ private final String commonAttributeKey; >+ >+ Attribute(String displayName, String commonAttributeKey, boolean readonly) { >+ this.displayName = displayName; >+ this.commonAttributeKey = commonAttributeKey; >+ this.isReadOnly = readonly; >+ >+ commonKeyToAttributesMap.put(commonAttributeKey, this); >+ } >+ >+ public String getCommonAttributeKey() { >+ return commonAttributeKey; >+ } >+ >+ public String getDisplayName() { >+ return displayName; >+ } >+ >+ public boolean isReadOnly() { >+ return isReadOnly; >+ } >+ >+ @Override >+ public String toString() { >+ return getDisplayName(); >+ } >+ } >+ >+ >+ static { >+ // make sure hash maps get initialized when class is loaded >+ Attribute.values(); > } > > @Override > public String getName(String key) { >- return key; >+ Attribute attribute = commonKeyToAttributesMap.get(key); >+ return (attribute != null) ? attribute.getDisplayName() : key; > } > > @Override >@@ -53,9 +105,15 @@ > } > > @Override >- public boolean isReadOnly(String key) { >+ public boolean isHidden(String key) { > return false; > } >+ >+ @Override >+ public boolean isReadOnly(String key) { >+ Attribute attribute = commonKeyToAttributesMap.get(key); >+ return (attribute != null) ? attribute.isReadOnly() : false; >+ } > > public Date getDateForAttributeType(String attributeKey, String dateString) { > if(dateString == null || dateString.equals("")) { //$NON-NLS-1$ >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerServerFacade.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/XPlannerServerFacade.java >diff -N src/org/eclipse/mylyn/xplanner/ui/XPlannerServerFacade.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerServerFacade.java 31 May 2007 07:37:10 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,187 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 - 2007 CodeGear 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 >- *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >- >-import java.net.MalformedURLException; >-import java.net.URL; >- >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.mylar.core.MylarStatusHandler; >-import org.eclipse.mylar.tasks.core.ITaskRepositoryListener; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.xplanner.core.ServerManager; >-import org.eclipse.mylar.xplanner.core.XPlannerCorePlugin; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.core.service.exceptions.AuthenticationException; >-import org.eclipse.mylar.xplanner.core.service.exceptions.ServiceUnavailableException; >- >-/** >- * This class acts as a layer of indirection between clients in this project and >- * the server API implemented by the XPlanner Dashboard, and also abstracts some >- * Mylar implementation details. It initializes a xPlannerServer object and serves >- * as the central location to get a reference to it. >- * >- * @author Ravi Kumar >- * @author Helen Bershadskaya >- * >- */ >-public class XPlannerServerFacade implements ITaskRepositoryListener { >- >- private ServerManager serverManager = null; >- >- private static XPlannerServerFacade instance = null; >- >- public XPlannerServerFacade() { >- TasksUiPlugin.getRepositoryManager().addListener(this); >- serverManager = XPlannerCorePlugin.getDefault().getServerManager(); >- } >- >- /** >- * Lazily creates server. >- */ >- public XPlannerServer getXPlannerServer(TaskRepository repository) throws CoreException { >- try { >- XPlannerRepositoryUtils.checkRepositoryValidated(repository.getUrl()); >- String serverHostname = getServerHost(repository); >- XPlannerServer server = serverManager.getServer(serverHostname); >-//TODO: add this check back once the listeners for server property change are hooked up >-// Also handle the case when serviceDelegate in the cachedServer is null >- >-// if (server == null) { >- server = serverManager.createServer(serverHostname, repository.getUrl(), false, >- repository.getUserName(), repository.getPassword()); >- serverManager.addServer(server); >-// } >- if (server == null) { >- throw new ServiceUnavailableException(serverHostname + " " + repository.getUrl()); //$NON-NLS-1$ >- } >- return server; >- } >- catch (CoreException ce) { >- MylarStatusHandler.log(Messages.XPlannerServerFacade_SERVER_CONNECTION_ERROR, this); >- throw ce; >- } >- catch (ServiceUnavailableException sue) { >- throw sue; >- } >- catch (RuntimeException e) { >- MylarStatusHandler.log(Messages.XPlannerServerFacade_SERVER_CONNECTION_ERROR, this); >- throw e; >- } >- } >- >- public static XPlannerServerFacade getDefault() { >- if (instance == null) { >- instance = new XPlannerServerFacade(); >- } >- return instance; >- } >- >- public void logOutFromAll() { >- try { >- XPlannerServer[] allServers = serverManager.getAllServers(); >- for (int i = 0; i < allServers.length; i++) { >- allServers[i].logout(); >- } >- } catch (Exception e) { >- // ignore >- } >- } >- >- public void repositoriesRead() { >- // ignore >- } >- >- public void repositoryAdded(TaskRepository repository) { >- if (repository.getKind().equals(XPlannerMylarUIPlugin.REPOSITORY_KIND)) { >- try { >- getXPlannerServer(repository); >- } >- catch (CoreException e) { >- MylarStatusHandler.log(e.getMessage(), this); >- } >- } >- } >- >- public void repositoryRemoved(TaskRepository repository) { >- if (repository.getKind().equals(XPlannerMylarUIPlugin.REPOSITORY_KIND)) { >- String serverHostname = getServerHost(repository); >- XPlannerServer server = serverManager.getServer(serverHostname); >- removeServer(server); >- XPlannerRepositoryUtils.removeValidatedRepositoryUrl(repository.getUrl()); >- } >- } >- >- public void repositorySettingsChanged(TaskRepository repository) { >- repositoryRemoved(repository); >- repositoryAdded(repository); >- } >- >- public void refreshServerSettings(TaskRepository repository) { >- String serverHostname = getServerHost(repository); >- XPlannerServer server = serverManager.getServer(serverHostname); >- if (server != null) { >- server.refreshDetails(); >- } >- } >- >- >- private void removeServer(XPlannerServer server) { >- if (server != null) { >- server.logout(); >- serverManager.removeServer(server); >- } >- } >- >- /** >- * Validate the server URL and user credentials >- * @param serverUrl Location of the XPlanner Server >- * @param user Username >- * @param password Password >- * @return String describing validation failure or null if the details are valid >- */ >- public void validateServerAndCredentials(String serverUrl, String user, >- String password) throws Exception { >- >- XPlannerRepositoryUtils.removeValidatedRepositoryUrl(serverUrl); >- serverManager.testConnection(serverUrl, user, password); >- XPlannerRepositoryUtils.addValidatedRepositoryUrl(serverUrl); >- } >- >- private static String getServerHost(TaskRepository repository) { >- try { >- return new URL(repository.getUrl()).getHost(); >- } catch (MalformedURLException ex) { >- throw new RuntimeException(Messages.XPlannerServerFacade_INVALID_URL_EXCEPTION+repository.getUrl(), ex); >- } >- } >- >- /** >- * TODO: refactor >- */ >- public static void handleConnectionException(Exception e) { >- if (e instanceof ServiceUnavailableException) { >- MylarStatusHandler.fail(e, Messages.XPlannerServerFacade_CONNECTION_FAILURE_ERROR >- + Messages.XPlannerServerFacade_NETWORK_CONNECTION_FAILURE, >- true); >- } >- else if (e instanceof AuthenticationException) { >- MylarStatusHandler.fail(e, Messages.XPlannerServerFacade_AUTHENTICATION_FAILED >- + Messages.XPlannerServerFacade_USERNAME_PASSWORD_ERROR, true); >- } >- else if (e instanceof RuntimeException) { >- MylarStatusHandler.fail(e, Messages.XPlannerServerFacade_NO_REPOSITORY_FOUND >- + Messages.XPlannerServerFacade_VERIFY_VALID_REPOSITORY, true); >- } >- else { >- MylarStatusHandler.fail(e, Messages.XPlannerServerFacade_COULD_NOT_CONNECT_TO_REPOSITORY >- + Messages.XPlannerServerFacade_CHECK_CREDENTIALS, true); >- } >- } >-} >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskExternalizer.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskExternalizer.java >diff -N src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskExternalizer.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskExternalizer.java 31 May 2007 07:37:10 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,285 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 - 2007 CodeGear 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 >- *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >- >-import java.util.ArrayList; >-import java.util.Iterator; >-import java.util.List; >-import java.util.StringTokenizer; >- >-import org.eclipse.mylar.core.MylarStatusHandler; >-import org.eclipse.mylar.internal.tasks.core.RepositoryTaskHandleUtil; >-import org.eclipse.mylar.tasks.core.AbstractQueryHit; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.AbstractTaskContainer; >-import org.eclipse.mylar.tasks.core.DelegatingTaskExternalizer; >-import org.eclipse.mylar.tasks.core.ITask; >-import org.eclipse.mylar.tasks.core.ITaskListExternalizer; >-import org.eclipse.mylar.tasks.core.TaskExternalizationException; >-import org.eclipse.mylar.tasks.core.TaskList; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.w3c.dom.Document; >-import org.w3c.dom.Element; >-import org.w3c.dom.Node; >- >-/** >- * @author Ravi Kumar >- * @author Helen Bershadskaya >- */ >-public class XPlannerTaskExternalizer extends DelegatingTaskExternalizer { >- >- private static final String TOKEN_SEPARATOR = ";"; //$NON-NLS-1$ >- >- private static final String KEY_XPLANNER = "XPlanner"; //$NON-NLS-1$ >- >- private static final String KEY_CUSTOM = "XPlannerCustom"; //$NON-NLS-1$ >- >- private static final String KEY_XPLANNER_CATEGORY = "XPlannerQuery" + KEY_CATEGORY; //$NON-NLS-1$ >- >- private static final String KEY_XPLANNER_QUERY_HIT = KEY_XPLANNER + KEY_QUERY_HIT; >- >- private static final String KEY_XPLANNER_QUERY = KEY_XPLANNER + KEY_QUERY; >- >- private static final String KEY_XPLANNER_CUSTOM = KEY_XPLANNER + KEY_CUSTOM + KEY_QUERY; >- >- private static final String KEY_XPLANNER_ITEM = "XPlannerItem"; //$NON-NLS-1$ >- >- private static final String KEY_QUERY_NAME = "QueryName"; //$NON-NLS-1$ >- >- private static final String KEY_QUERY_CONTENT_ID_TYPE = "QueryContentIdType"; //$NON-NLS-1$ >- >- private static final String KEY_QUERY_IS_TASKS = "QueryIsTasks"; //$NON-NLS-1$ >- >- private static final String KEY_QUERY_CONTENT_ID = "QueryConentId"; //$NON-NLS-1$ >- >- private static final String KEY_QUERY_PERSON_ID = "QueryPersonId"; //$NON-NLS-1$ >- >- private static final String KEY_QUERY_MY_CURRENT_TASKS = "QueryMyCurrentTasks"; //$NON-NLS-1$ >- >- private static final String KEY_KEY = "Key"; //$NON-NLS-1$ >- >- public boolean canReadQuery(Node node) { >- return node.getNodeName().equals(KEY_XPLANNER_QUERY) || node.getNodeName().equals(KEY_XPLANNER_CUSTOM); >- } >- >- public boolean canCreateElementFor(AbstractRepositoryQuery category) { >- return category instanceof XPlannerCustomQuery; >- } >- >- public boolean canCreateElementFor(ITask task) { >- return task instanceof XPlannerTask; >- } >- >- public AbstractRepositoryQuery readQuery(Node node, TaskList taskList) throws TaskExternalizationException { >- Element element = (Element) node; >- >- AbstractRepositoryQuery query = null; >- String custom = element.getAttribute(KEY_QUERY_NAME); >- if (custom != null && custom.length() > 0) { >- query = new XPlannerCustomQuery(element.getAttribute(KEY_REPOSITORY_URL), custom, TasksUiPlugin >- .getTaskListManager().getTaskList()); >- initializeQuery((XPlannerCustomQuery)query, element); >- } >- >- return query; >- } >- >- public Element createTaskElement(ITask task, Document doc, Element parent) { >- Element node = super.createTaskElement(task, doc, parent); >- node.setAttribute(KEY_KEY, ((XPlannerTask) task).getKey()); >- return node; >- } >- >- private void initializeQuery(XPlannerCustomQuery query, Element element) { >- String myCurrentTasks = element.getAttribute(KEY_QUERY_MY_CURRENT_TASKS); >- if (myCurrentTasks != null && Boolean.valueOf(myCurrentTasks)) { >- query.setMyCurrentTasks(true); >- } >- else { >- // selected content type >- String contentIdType = element.getAttribute(KEY_QUERY_CONTENT_ID_TYPE); >- if (contentIdType != null) { >- query.setContentIdType((XPlannerCustomQuery.ContentIdType.valueOf(contentIdType))); >- } >- >- // use tasks? >- String useTasks = element.getAttribute(KEY_QUERY_IS_TASKS); >- if (useTasks != null) { >- query.setUseTasks(Boolean.valueOf(useTasks)); >- } >- >- // use all? >- String personId = element.getAttribute(KEY_QUERY_PERSON_ID); >- if (personId != null) { >- query.setPersonId(Integer.valueOf(personId)); >- } >- >- // content id >- String contentIds = element.getAttribute(KEY_QUERY_CONTENT_ID); >- if (contentIds != null) { >- query.setContentIds(decodeIds(contentIds)); >- } >- } >- } >- >- private String encodeIds(List<Integer> contentIds) { >- StringBuilder result = new StringBuilder(); >- for (Iterator<Integer> iter = contentIds.iterator(); iter.hasNext();) { >- Integer id = iter.next(); >- result.append(id); >- if (iter.hasNext()) { >- result.append(TOKEN_SEPARATOR); >- } >- } >- >- return result.toString(); >- } >- >- private List<Integer> decodeIds(String encoded) { >- if (encoded == null) { >- return XPlannerCustomQuery.INVALID_IDS; >- } >- >- StringTokenizer tokens = new StringTokenizer(encoded, TOKEN_SEPARATOR); >- ArrayList<Integer> ids = new ArrayList<Integer>(); >- while (tokens.hasMoreTokens()) { >- ids.add(Integer.valueOf(tokens.nextToken())); >- } >- >- return ids; >- } >- >- >- public Element createQueryElement(AbstractRepositoryQuery query, Document doc, Element parent) { >- String queryTagName = getQueryTagNameForElement(query); >- Element node = doc.createElement(queryTagName); >- >- node.setAttribute(KEY_NAME, query.getSummary()); >- node.setAttribute(KEY_QUERY_STRING, query.getUrl()); >- node.setAttribute(KEY_REPOSITORY_URL, query.getRepositoryUrl()); >- >- XPlannerCustomQuery xplannerCustomQuery = (XPlannerCustomQuery) query; >- >- // name >- String queryName = xplannerCustomQuery.getQueryName(); >- node.setAttribute(KEY_QUERY_NAME, queryName); >- >- boolean isMyCurrentTasks = xplannerCustomQuery.isMyCurrentTasks(); >- if (isMyCurrentTasks) { >- // show only my current tasks >- node.setAttribute(KEY_QUERY_MY_CURRENT_TASKS, Boolean.toString(true)); >- } >- else { >- // don't show only my current tasks >- node.setAttribute(KEY_QUERY_MY_CURRENT_TASKS, Boolean.toString(false)); >- >- // selected content type >- String contentIdType = xplannerCustomQuery.getContentIdType().name(); >- node.setAttribute(KEY_QUERY_CONTENT_ID_TYPE, contentIdType); >- >- // is tasks >- boolean isUseTasks = xplannerCustomQuery.isUseTasks(); >- node.setAttribute(KEY_QUERY_IS_TASKS, Boolean.toString(isUseTasks)); >- >- // content id >- List<Integer> contentIds = xplannerCustomQuery.getContentIds(); >- node.setAttribute(KEY_QUERY_CONTENT_ID, encodeIds(contentIds)); >- >- // person id >- int personId = xplannerCustomQuery.getPersonId(); >- node.setAttribute(KEY_QUERY_PERSON_ID, Integer.toString(personId)); >- } >- >- for (AbstractQueryHit hit : query.getHits()) { >- try { >- Element element = null; >- for (ITaskListExternalizer externalizer : super.getDelegateExternalizers()) { >- if (externalizer.canCreateElementFor(hit)) { >- element = externalizer.createQueryHitElement(hit, doc, node); >- } >- } >- if (element == null) { >- createQueryHitElement(hit, doc, node); >- } >- } >- catch (Exception e) { >- MylarStatusHandler.log(e, e.getMessage()); >- } >- } >- parent.appendChild(node); >- return node; >- } >- >- @Override >- public String getTaskTagName() { >- return KEY_XPLANNER_ITEM; >- } >- >- @Override >- public ITask createTask(String repositoryUrl, String taskId, String summary, Element element, TaskList taskList, AbstractTaskContainer category, ITask parent) >- throws TaskExternalizationException { >- >- String key; >- XPlannerTask task = new XPlannerTask(repositoryUrl, taskId, summary, false); >- if (element.hasAttribute(KEY_KEY)) { >- key = element.getAttribute(KEY_KEY); >- task.setKey(key); >- } >- else { >- // ignore if key not found >- } >- return task; >- } >- >- public boolean canReadQueryHit(Node node) { >- return node.getNodeName().equals(getQueryHitTagName()); >- } >- >- @Override >- public AbstractQueryHit createQueryHit(String repositoryUrl, String taskId, String summary, Element element, TaskList taskList, AbstractRepositoryQuery query) >- throws TaskExternalizationException { >- >- String handle; >- if (element.hasAttribute(KEY_HANDLE)) { >- handle = element.getAttribute(KEY_HANDLE); >- } >- else { >- throw new TaskExternalizationException(Messages.XPlannerTaskExternalizer_HANDLE_NOT_STORED_EXCEPTION); >- } >- >- XPlannerQueryHit hit = null; >- ITask correspondingTask = taskList.getTask(handle); >- if (correspondingTask instanceof XPlannerTask) { >- String id = RepositoryTaskHandleUtil.getTaskId(handle); >- hit = new XPlannerQueryHit(taskList, >- correspondingTask.getSummary(), correspondingTask.getPriority(), >- query.getRepositoryUrl(), id, (XPlannerTask)correspondingTask); >- hit.setHandleIdentifier(handle); >- } >- >- return hit; >- } >- >- public String getQueryTagNameForElement(AbstractRepositoryQuery query) { >- if (query instanceof XPlannerCustomQuery) { >- return KEY_XPLANNER_CUSTOM; >- } >- return ""; //$NON-NLS-1$ >- } >- >- @Override >- public String getCategoryTagName() { >- return KEY_XPLANNER_CATEGORY; >- } >- >- @Override >- public String getQueryHitTagName() { >- return KEY_XPLANNER_QUERY_HIT; >- } >- >-} >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryUtils.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryUtils.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerRepositoryUtils.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryUtils.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryUtils.java 26 Jun 2007 17:41:18 -0000 >@@ -5,10 +5,11 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >+package org.eclipse.mylyn.xplanner.ui; > > import java.io.IOException; > import java.net.MalformedURLException; >+import java.net.Proxy; > import java.rmi.RemoteException; > import java.security.GeneralSecurityException; > import java.text.MessageFormat; >@@ -18,21 +19,13 @@ > > import javax.security.auth.login.LoginException; > >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.mylar.internal.tasks.core.RepositoryTaskHandleUtil; >-import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute; >-import org.eclipse.mylar.tasks.core.RepositoryTaskData; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.xplanner.core.XPlannerCorePlugin; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.xplanner.soap.IterationData; >-import org.xplanner.soap.PersonData; >-import org.xplanner.soap.ProjectData; >-import org.xplanner.soap.TaskData; >-import org.xplanner.soap.UserStoryData; >+import org.eclipse.core.runtime.*; >+import org.eclipse.mylyn.internal.tasks.core.RepositoryTaskHandleUtil; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.xplanner.core.XPlannerCorePlugin; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.xplanner.soap.*; > > /** > * @author Ravi Kumar >@@ -43,25 +36,25 @@ > > } > >- public static RepositoryTaskData createRepositoryTaskData(TaskRepository repository, XPlannerTask xplannerTask, XPlannerServer server) throws CoreException { >+ public static RepositoryTaskData createRepositoryTaskData(TaskRepository repository, XPlannerTask xplannerTask, XPlannerClient client) throws CoreException { > RepositoryTaskData repositoryTaskData = null; > > try { > if (XPlannerTask.Kind.TASK.toString().equals(xplannerTask.getTaskKind())) { >- TaskData taskData = server.getTask(Integer.valueOf(xplannerTask.getKey()).intValue()); >+ TaskData taskData = client.getTask(Integer.valueOf(xplannerTask.getTaskId()).intValue()); > repositoryTaskData = XPlannerRepositoryUtils.getXPlannerRepositoryTaskData( > repository.getUrl(), taskData, RepositoryTaskHandleUtil.getTaskId(xplannerTask.getHandleIdentifier())); > xplannerTask.setCompleted(taskData.isCompleted()); > } > else if (XPlannerTask.Kind.USER_STORY.toString().equals(xplannerTask.getTaskKind())) { >- UserStoryData userStory = server.getUserStory(Integer.valueOf(xplannerTask.getKey()).intValue()); >+ UserStoryData userStory = client.getUserStory(Integer.valueOf(xplannerTask.getTaskId()).intValue()); > repositoryTaskData = XPlannerRepositoryUtils.getXPlannerRepositoryTaskData( > repository.getUrl(), userStory, RepositoryTaskHandleUtil.getTaskId(xplannerTask.getHandleIdentifier())); > xplannerTask.setCompleted(userStory.isCompleted()); > } > } > catch (final Exception e) { >- throw new CoreException(new Status(IStatus.ERROR, XPlannerMylarUIPlugin.PLUGIN_ID, 0, >+ throw new CoreException(new Status(IStatus.ERROR, XPlannerMylynUIPlugin.PLUGIN_ID, 0, > MessageFormat.format(Messages.XPlannerRepositoryUtils_TASK_DOWNLOAD_FAILED, > xplannerTask.getRepositoryUrl(), TasksUiPlugin.LABEL_VIEW_REPOSITORIES), e)); > } >@@ -69,12 +62,42 @@ > return repositoryTaskData; > } > >+ public static RepositoryTaskData createRepositoryTaskData(TaskRepository repository, >+ String taskId) throws CoreException { >+ >+ RepositoryTaskData repositoryTaskData = null; >+ >+ XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); >+ >+ try { >+ TaskData taskData = client.getTask(Integer.valueOf(taskId).intValue()); >+ if (taskData != null) { >+ repositoryTaskData = XPlannerRepositoryUtils.getXPlannerRepositoryTaskData( >+ repository.getUrl(), taskData, taskId); >+ } >+ else { >+ UserStoryData userStory = client.getUserStory(Integer.valueOf(taskId).intValue()); >+ if (userStory != null) { >+ repositoryTaskData = XPlannerRepositoryUtils.getXPlannerRepositoryTaskData( >+ repository.getUrl(), userStory, taskId); >+ } >+ } >+ } >+ catch (final Exception e) { >+ throw new CoreException(new Status(IStatus.ERROR, XPlannerMylynUIPlugin.PLUGIN_ID, 0, >+ MessageFormat.format(Messages.XPlannerRepositoryUtils_TASK_DOWNLOAD_FAILED, >+ repository.getUrl(), TasksUiPlugin.LABEL_VIEW_REPOSITORIES), e)); >+ } >+ >+ return repositoryTaskData; >+ } >+ > public static RepositoryTaskData getXPlannerRepositoryTaskData(String repositoryUrl, TaskData taskData, String id) > throws IOException, MalformedURLException, LoginException, GeneralSecurityException, CoreException { > > RepositoryTaskData repositoryTaskData = new RepositoryTaskData( > new XPlannerAttributeFactory(), >- XPlannerMylarUIPlugin.REPOSITORY_KIND, repositoryUrl, id, XPlannerTask.Kind.TASK.toString()); >+ XPlannerMylynUIPlugin.REPOSITORY_KIND, repositoryUrl, id, XPlannerTask.Kind.TASK.toString()); > > setupTaskAttributes(taskData, repositoryTaskData); > >@@ -85,7 +108,7 @@ > throws IOException, MalformedURLException, LoginException, GeneralSecurityException, CoreException { > > RepositoryTaskData repositoryTaskData = new RepositoryTaskData(new XPlannerAttributeFactory(), >- XPlannerMylarUIPlugin.REPOSITORY_KIND, repositoryUrl, id, XPlannerTask.Kind.USER_STORY.toString()); >+ XPlannerMylynUIPlugin.REPOSITORY_KIND, repositoryUrl, id, XPlannerTask.Kind.USER_STORY.toString()); > setupUserStoryAttributes(userStory, repositoryTaskData); > > return repositoryTaskData; >@@ -95,15 +118,15 @@ > throws CoreException { > > TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository( >- XPlannerMylarUIPlugin.REPOSITORY_KIND, repositoryTaskData.getRepositoryUrl()); >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >+ XPlannerMylynUIPlugin.REPOSITORY_KIND, repositoryTaskData.getRepositoryUrl()); >+ XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); > > // description > repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.DESCRIPTION, taskData.getDescription()); > > // priority > repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.PRIORITY, >- getPriorityFromXPlannerObject(taskData, server)); >+ getPriorityFromXPlannerObject(taskData, client)); > > // status > repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.STATUS, taskData.getDispositionName()); >@@ -113,7 +136,7 @@ > > // assigned to > repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.USER_ASSIGNED, getPersonName( >- taskData.getAcceptorId(), server)); >+ taskData.getAcceptorId(), client)); > > // createdDate > Date createdDate = taskData.getCreatedDate().getTime(); >@@ -143,14 +166,14 @@ > repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_ADJUSTED_ESTIMATED_HOURS_NAME, "" + taskData.getAdjustedEstimatedHours()); //$NON-NLS-1$ > > // project name >- repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_PROJECT_NAME, getProjectName(taskData, server)); >+ repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_PROJECT_NAME, getProjectName(taskData, client)); > > // iteration name >- repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_ITERATION_NAME, getIterationName(taskData, server)); >+ repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_ITERATION_NAME, getIterationName(taskData, client)); > > // user story name > repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_USER_STORY_NAME, >- getUserStoryName(taskData, server)); >+ getUserStoryName(taskData, client)); > > // completed > repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_TASK_COMPLETED, >@@ -161,15 +184,15 @@ > throws CoreException { > > TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository( >- XPlannerMylarUIPlugin.REPOSITORY_KIND, repositoryTaskData.getRepositoryUrl()); >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >+ XPlannerMylynUIPlugin.REPOSITORY_KIND, repositoryTaskData.getRepositoryUrl()); >+ XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); > > // description > repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.DESCRIPTION, userStory.getDescription()); > > // priority > repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.PRIORITY, >- getPriorityFromXPlannerObject(userStory, server)); >+ getPriorityFromXPlannerObject(userStory, client)); > > // summary > repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.SUMMARY, userStory.getName()); >@@ -179,7 +202,7 @@ > > // assigned to > repositoryTaskData.setAttributeValue(RepositoryTaskAttribute.USER_ASSIGNED, getPersonName( >- userStory.getTrackerId(), server)); >+ userStory.getTrackerId(), client)); > > // createdDate -- user story doesn't have created date > >@@ -206,10 +229,10 @@ > repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_ADJUSTED_ESTIMATED_HOURS_NAME, "" + userStory.getAdjustedEstimatedHours()); //$NON-NLS-1$ > > // project name >- repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_PROJECT_NAME, getProjectName(userStory, server)); >+ repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_PROJECT_NAME, getProjectName(userStory, client)); > > // iteration name >- repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_ITERATION_NAME, getIterationName(userStory, server)); >+ repositoryTaskData.setAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_ITERATION_NAME, getIterationName(userStory, client)); > } > > public static String getProjectName(RepositoryTaskData repositoryTaskData) { >@@ -224,11 +247,11 @@ > return repositoryTaskData.getAttributeValue(XPlannerAttributeFactory.ATTRIBUTE_USER_STORY_NAME); > } > >- public static String getPersonName(int personId, XPlannerServer server) { >+ public static String getPersonName(int personId, XPlannerClient client) { > String personName = Messages.XPlannerRepositoryUtils_NO_PERSON_NAME; > > try { >- PersonData personData = server.getPerson(personId); >+ PersonData personData = client.getPerson(personId); > if (personData != null) { > personName = personData.getName(); > } >@@ -273,19 +296,19 @@ > createdDate = XPlannerAttributeFactory.DATE_FORMAT.parse(dateString); > } > catch (ParseException e) { >- XPlannerMylarUIPlugin.log(e.getCause(), "", false); >+ XPlannerMylynUIPlugin.log(e.getCause(), "", false); //$NON-NLS-1$ > } > > return createdDate; > } > >- public static String getProjectName(TaskData taskData, XPlannerServer server) { >+ public static String getProjectName(TaskData taskData, XPlannerClient client) { > String projectName = Messages.XPlannerRepositoryUtils_NO_PROJECT_NAME; > > UserStoryData userStory; > try { >- userStory = server.getUserStory(taskData.getStoryId()); >- projectName = getProjectName(userStory, server); >+ userStory = client.getUserStory(taskData.getStoryId()); >+ projectName = getProjectName(userStory, client); > } > catch (RemoteException e) { > // TODO Auto-generated catch block >@@ -295,14 +318,14 @@ > return projectName; > } > >- public static String getProjectName(UserStoryData userStory, XPlannerServer server) { >+ public static String getProjectName(UserStoryData userStory, XPlannerClient client) { > String projectName = Messages.XPlannerRepositoryUtils_NO_PROJECT_NAME; > > try { > if (userStory != null) { >- IterationData iteration = server.getIteration(userStory.getIterationId()); >+ IterationData iteration = client.getIteration(userStory.getIterationId()); > if (iteration != null) { >- ProjectData project = server.getProject(iteration.getProjectId()); >+ ProjectData project = client.getProject(iteration.getProjectId()); > if (project != null) { > projectName = project.getName(); > } >@@ -316,12 +339,12 @@ > return projectName; > } > >- public static String getIterationName(TaskData taskData, XPlannerServer server) { >+ public static String getIterationName(TaskData taskData, XPlannerClient client) { > String iterationName = Messages.XPlannerRepositoryUtils_NO_ITERATION_NAME; > > try { >- UserStoryData userStory = server.getUserStory(taskData.getStoryId()); >- iterationName = getIterationName(userStory, server); >+ UserStoryData userStory = client.getUserStory(taskData.getStoryId()); >+ iterationName = getIterationName(userStory, client); > } > catch (RemoteException e) { > // TODO Auto-generated catch block >@@ -331,11 +354,11 @@ > return iterationName; > } > >- public static String getIterationName(UserStoryData userStory, XPlannerServer server) { >+ public static String getIterationName(UserStoryData userStory, XPlannerClient client) { > String iterationName = Messages.XPlannerRepositoryUtils_NO_ITERATION_NAME; > > try { >- IterationData iteration = server.getIteration(userStory.getIterationId()); >+ IterationData iteration = client.getIteration(userStory.getIterationId()); > if (iteration != null) { > iterationName = iteration.getName(); > } >@@ -347,11 +370,11 @@ > return iterationName; > } > >- public static String getUserStoryName(TaskData taskData, XPlannerServer server) { >+ public static String getUserStoryName(TaskData taskData, XPlannerClient client) { > String userStoryName = Messages.XPlannerRepositoryUtils_NO_USER_STORY_NAME; > > try { >- UserStoryData userStory = server.getUserStory(taskData.getStoryId()); >+ UserStoryData userStory = client.getUserStory(taskData.getStoryId()); > if (userStory != null) { > userStoryName = userStory.getName(); > } >@@ -376,13 +399,13 @@ > return repositoryTaskData.getAttributeValue(RepositoryTaskAttribute.SUMMARY); > } > >- public static String getPriorityFromXPlannerObject(Object xplannerObject, XPlannerServer server) { >+ public static String getPriorityFromXPlannerObject(Object xplannerObject, XPlannerClient client) { > int priority = -1; > UserStoryData userStory = null; > > try { > if (xplannerObject instanceof TaskData) { >- userStory = server.getUserStory(((TaskData)xplannerObject).getStoryId()); >+ userStory = client.getUserStory(((TaskData)xplannerObject).getStoryId()); > } > else if (xplannerObject instanceof UserStoryData) { > userStory = (UserStoryData)xplannerObject; >@@ -418,22 +441,34 @@ > } > > TaskRepository taskRepository = TasksUiPlugin.getRepositoryManager().getRepository( >- XPlannerMylarUIPlugin.REPOSITORY_KIND, repositoryUrl); >+ XPlannerMylynUIPlugin.REPOSITORY_KIND, repositoryUrl); > if (taskRepository != null && !isRepositoryUrlValidated(taskRepository.getUrl())) { > validateRepository(taskRepository); > } > } > > public static void validateRepository(TaskRepository taskRepository) throws CoreException { >+ validateRepository(taskRepository.getUrl(), >+ taskRepository.getUserName(), taskRepository.getPassword(), taskRepository.getProxy(), >+ taskRepository.getHttpUser(), taskRepository.getHttpPassword()); >+ } >+ >+ public static void validateRepository(String url, String userName, String password) throws CoreException { >+ validateRepository(url, userName, password, Proxy.NO_PROXY, null, null); >+ } >+ >+ public static void validateRepository(String url, String userName, String password, >+ Proxy proxy, String httpUser, String httpPassword) throws CoreException { >+ > try { >- XPlannerServerFacade.getDefault().validateServerAndCredentials( >- taskRepository.getUrl(), >- taskRepository.getUserName(), taskRepository.getPassword()); >+ XPlannerClientFacade.getDefault().validateServerAndCredentials(url, userName, password, >+ proxy, httpUser, httpPassword); > } > catch (Exception e) { > throw new CoreException(XPlannerCorePlugin.toStatus(e)); > } > > } >+ > } > >\ No newline at end of file >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryConnector.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryConnector.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerRepositoryConnector.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryConnector.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryConnector.java 26 Jun 2007 17:41:18 -0000 >@@ -5,76 +5,59 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >+package org.eclipse.mylyn.xplanner.ui; > > import java.rmi.RemoteException; > import java.text.MessageFormat; >-import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.Collections; >-import java.util.Date; >-import java.util.HashSet; >-import java.util.List; >-import java.util.Set; >- >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.mylar.internal.tasks.core.RepositoryTaskHandleUtil; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryTask; >-import org.eclipse.mylar.tasks.core.IAttachmentHandler; >-import org.eclipse.mylar.tasks.core.ITask; >-import org.eclipse.mylar.tasks.core.ITaskDataHandler; >-import org.eclipse.mylar.tasks.core.QueryHitCollector; >-import org.eclipse.mylar.tasks.core.RepositoryTaskData; >-import org.eclipse.mylar.tasks.core.TaskList; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >+import java.text.ParseException; >+import java.util.*; >+ >+import org.eclipse.core.runtime.*; >+import org.eclipse.mylyn.internal.tasks.core.RepositoryTaskHandleUtil; >+import org.eclipse.mylyn.monitor.core.StatusHandler; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.wsdl.soap.domain.DomainData; > import org.xplanner.soap.TaskData; > import org.xplanner.soap.UserStoryData; > >-import org.eclipse.mylar.xplanner.wsdl.soap.domain.DomainData; >- > /** > * @author Ravi Kumar > * @author Helen Bershadskaya > */ > public class XPlannerRepositoryConnector extends AbstractRepositoryConnector { > >- private static final String VERSION_SUPPORT = Messages.XPlannerRepositoryConnector_VERSION_SUPPORT; >+ //private static final String VERSION_SUPPORT = Messages.XPlannerRepositoryConnector_VERSION_SUPPORT; > >- private XPlannerOfflineTaskHandler offlineHandler; >+ private XPlannerTaskDataHandler offlineHandler; > >- private List<String> supportedVersions; >+ //private List<String> supportedVersions; > > /** Name initially given to new tasks. Public for testing */ > public static final String NEW_TASK_DESC = Messages.XPlannerRepositoryConnector_NEW_TASK_DESCRIPTION; > > public void init(TaskList taskList) { > super.init(taskList); >- this.offlineHandler = new XPlannerOfflineTaskHandler(taskList); >+ this.offlineHandler = new XPlannerTaskDataHandler(taskList); > } > > public String getLabel() { >- return XPlannerMylarUIPlugin.XPLANNER_CLIENT_LABEL; >+ return XPlannerMylynUIPlugin.XPLANNER_CLIENT_LABEL; > } > >- public String getRepositoryType() { >- return XPlannerMylarUIPlugin.REPOSITORY_KIND; >+ public String getConnectorKind() { >+ return XPlannerMylynUIPlugin.REPOSITORY_KIND; > } > > @Override >- public IAttachmentHandler getAttachmentHandler() { >- // not implemented >+ public AbstractAttachmentHandler getAttachmentHandler() { >+ // not implemented yet > return null; > } > > @Override >- public ITaskDataHandler getTaskDataHandler() { >+ public AbstractTaskDataHandler getTaskDataHandler() { > return offlineHandler; > } > >@@ -83,46 +66,65 @@ > return true; > } > >- @Override >- public AbstractRepositoryTask createTaskFromExistingKey(TaskRepository repository, String key) >- throws CoreException { >+ protected AbstractTask makeTask(String repositoryUrl, String id, String summary) { >+ return new XPlannerTask(repositoryUrl, id, summary); >+ } >+ >+ public AbstractTask createTask(String repositoryUrl, String id, String summary) { >+ AbstractTask task = null; > >+ TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository( >+ XPlannerMylynUIPlugin.REPOSITORY_KIND, repositoryUrl); >+ String handleIdentifier = RepositoryTaskHandleUtil.getHandle(repository.getUrl(), id); >+ AbstractTask existingTask = TasksUiPlugin.getTaskListManager().getTaskList().getTask( >+ handleIdentifier); >+ >+ if (existingTask instanceof XPlannerTask) { >+ task = (XPlannerTask) existingTask; >+ } >+ else { >+ try { >+ task = createTask(repository, id); >+ } >+ catch (CoreException e) { >+ XPlannerMylynUIPlugin.log(e, "", false); //$NON-NLS-1$ >+ } >+ } >+ >+ return task; >+ } >+ >+ private AbstractTask createTask(TaskRepository repository, String key) throws CoreException { >+ XPlannerTask task = null; >+ > XPlannerRepositoryUtils.checkRepositoryValidated(repository.getUrl()); >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >- if (server != null) { >- XPlannerTask task = null; >+ XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); >+ if (client != null) { > try { > // first check if taskdata exists >- TaskData taskData = server.getTask(Integer.valueOf(key).intValue()); >+ TaskData taskData = client.getTask(Integer.valueOf(key).intValue()); > if (taskData != null) { > task = createTask(taskData, taskData.getName(), String.valueOf(taskData.getId()), repository); >- updateTaskDetails(repository.getUrl(), task, taskData, true); > } > else { > // otherwise check if a user story exists >- UserStoryData userStory = server.getUserStory(Integer.valueOf(key).intValue()); >+ UserStoryData userStory = client.getUserStory(Integer.valueOf(key).intValue()); > if (userStory != null) { > task = createTask(userStory, userStory.getName(), String.valueOf(userStory.getId()), repository); >- updateTaskDetails(repository.getUrl(), task, userStory, true); > } > } > } > catch (Exception e) { > e.printStackTrace(); > } >- >- if (task != null) { >- TasksUiPlugin.getTaskListManager().getTaskList().addTask(task); >- return task; >- } >- > } >- return null; >+ >+ return task; > } > > @Override > public IStatus performQuery(AbstractRepositoryQuery repositoryQuery, TaskRepository repository, >- IProgressMonitor monitor, QueryHitCollector resultCollector) { >+ IProgressMonitor monitor, ITaskCollector resultCollector) { > > if (!(repositoryQuery instanceof XPlannerCustomQuery)) { > return Status.OK_STATUS; >@@ -132,13 +134,14 @@ > > > try { >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >+ monitor.beginTask("Running query", IProgressMonitor.UNKNOWN); >+ XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); > > if (xplannerCustomQuery.isMyCurrentTasks()) { >- return queryMyCurrentTasks(xplannerCustomQuery, server, repository, resultCollector); >+ return queryMyCurrentTasks(xplannerCustomQuery, client, repository, resultCollector); > } > else { >- return queryTasks(xplannerCustomQuery, server, repository, resultCollector); >+ return queryTasks(xplannerCustomQuery, client, repository, resultCollector); > } > > } >@@ -147,9 +150,12 @@ > if ((reason == null) || (reason.length() == 0)) { > reason = e.getClass().getName(); > } >- return new Status(IStatus.OK, TasksUiPlugin.PLUGIN_ID, IStatus.ERROR, >+ return new Status(IStatus.OK, TasksUiPlugin.ID_PLUGIN, IStatus.ERROR, > MessageFormat.format(Messages.XPlannerRepositoryConnector_PerformQueryFailure, reason), e ); > } >+ finally { >+ monitor.done(); >+ } > > //return Status.OK_STATUS; > } >@@ -161,7 +167,7 @@ > > //TODO -- no longer used -- remove if really unnecessary > // private IStatus queryUserStories(XPlannerCustomQuery xplannerCustomQuery, >-// XPlannerServer server, TaskRepository repository, QueryHitCollector resultCollector) throws RemoteException { >+// XPlannerClient client, TaskRepository repository, QueryHitCollector resultCollector) throws RemoteException { > // > // int iterationId = xplannerCustomQuery.getContentId(); > // UserStoryData[] userStories; >@@ -169,36 +175,36 @@ > // // check if want all or person's stories > // if (xplannerCustomQuery.getPersonId() != XPlannerCustomQuery.INVALID_ID) { > // int trackerId = xplannerCustomQuery.getPersonId(); >-// userStories = server.getIterationUserStoriesForTracker(trackerId, iterationId); >+// userStories = client.getIterationUserStoriesForTracker(trackerId, iterationId); > // } > // else { >-// userStories = server.getUserStories(iterationId); >+// userStories = client.getUserStories(iterationId); > // } > // > // return getUserStoryQueryHits(Arrays.asList(userStories), repository, xplannerCustomQuery, resultCollector); > // } > > private IStatus queryMyCurrentTasks(XPlannerCustomQuery xplannerCustomQuery, >- XPlannerServer server, TaskRepository repository, QueryHitCollector resultCollector) throws RemoteException { >+ XPlannerClient client, TaskRepository repository, ITaskCollector resultCollector) throws RemoteException { > > ArrayList<TaskData> xplannerTasks = new ArrayList<TaskData>(); >- int currentPersonId = server.getCurrentPersonId(); >+ int currentPersonId = client.getCurrentPersonId(); > >- xplannerTasks.addAll(Arrays.asList(server.getCurrentTasksForPerson(currentPersonId))); >- xplannerTasks.addAll(Arrays.asList(server.getPlannedTasksForPerson(currentPersonId))); >+ xplannerTasks.addAll(Arrays.asList(client.getCurrentTasksForPerson(currentPersonId))); >+ xplannerTasks.addAll(Arrays.asList(client.getPlannedTasksForPerson(currentPersonId))); > > return getTaskQueryHits(xplannerTasks, repository, xplannerCustomQuery, resultCollector); > } > > private IStatus queryTasks(XPlannerCustomQuery xplannerCustomQuery, >- XPlannerServer server, TaskRepository repository, QueryHitCollector resultCollector) throws RemoteException { >+ XPlannerClient client, TaskRepository repository, ITaskCollector resultCollector) throws RemoteException { > > List<Integer> contentIds = xplannerCustomQuery.getContentIds(); > ArrayList<TaskData> xplannerTasks = new ArrayList<TaskData>(); > XPlannerCustomQuery.ContentIdType contentIdType = xplannerCustomQuery.getContentIdType(); > > for (Integer contentId : contentIds) { >- addTasks(contentId, contentIdType, xplannerTasks, xplannerCustomQuery, server); >+ addTasks(contentId, contentIdType, xplannerTasks, xplannerCustomQuery, client); > } > > return getTaskQueryHits(xplannerTasks, repository, xplannerCustomQuery, resultCollector); >@@ -206,39 +212,39 @@ > > private void addTasks(int contentId, > XPlannerCustomQuery.ContentIdType contentIdType, List<TaskData> xplannerTasks, >- XPlannerCustomQuery xplannerCustomQuery, XPlannerServer server) throws RemoteException { >+ XPlannerCustomQuery xplannerCustomQuery, XPlannerClient client) throws RemoteException { > > if (contentId == XPlannerCustomQuery.INVALID_ID) { > return; > } > > if (contentIdType == XPlannerCustomQuery.ContentIdType.PROJECT) { >- UserStoryData[] userStories = server.getUserStoriesForProject(contentId); >+ UserStoryData[] userStories = client.getUserStoriesForProject(contentId); > for (UserStoryData userStory : userStories) { >- addUserStoryTasks(xplannerCustomQuery, userStory.getId(), xplannerTasks, server); >+ addUserStoryTasks(xplannerCustomQuery, userStory.getId(), xplannerTasks, client); > } > } > else if (contentIdType == XPlannerCustomQuery.ContentIdType.ITERATION) { >- UserStoryData[] userStories = server.getUserStories(contentId); >+ UserStoryData[] userStories = client.getUserStories(contentId); > for (UserStoryData userStory : userStories) { >- addUserStoryTasks(xplannerCustomQuery, userStory.getId(), xplannerTasks, server); >+ addUserStoryTasks(xplannerCustomQuery, userStory.getId(), xplannerTasks, client); > } > } > else if (contentIdType == XPlannerCustomQuery.ContentIdType.USER_STORY) { >- addUserStoryTasks(xplannerCustomQuery, contentId, xplannerTasks, server); >+ addUserStoryTasks(xplannerCustomQuery, contentId, xplannerTasks, client); > } > } > > private void addUserStoryTasks(XPlannerCustomQuery query, int userStoryId, >- List<TaskData> xplannerTasks, XPlannerServer server) { >+ List<TaskData> xplannerTasks, XPlannerClient client) { > // check if want all or person's tasks > if (query.getPersonId() != XPlannerCustomQuery.INVALID_ID) { > int personId = query.getPersonId(); >- xplannerTasks.addAll(Arrays.asList(server.getUserStoryTasksForPerson(personId, userStoryId))); >+ xplannerTasks.addAll(Arrays.asList(client.getUserStoryTasksForPerson(personId, userStoryId))); > } > else { > try { >- xplannerTasks.addAll(Arrays.asList(server.getTasks(userStoryId))); >+ xplannerTasks.addAll(Arrays.asList(client.getTasks(userStoryId))); > } > catch (RemoteException e) { > e.printStackTrace(); >@@ -247,82 +253,124 @@ > } > > private IStatus getTaskQueryHits(List<TaskData> tasks, >- TaskRepository repository, XPlannerCustomQuery query, QueryHitCollector resultCollector) { >+ TaskRepository repository, XPlannerCustomQuery query, ITaskCollector resultCollector) { > > for (TaskData data : tasks) { > String id = String.valueOf(data.getId()); >- ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), id); >- if (!(task instanceof XPlannerTask)) { >- task = createTask(data, data.getName(), id, repository); >- } >- updateTaskDetails(repository.getUrl(), (XPlannerTask) task, data, false); >- >- XPlannerQueryHit hit = new XPlannerQueryHit( >- taskList, task.getSummary(), task.getPriority(), query.getRepositoryUrl(), >- id, (XPlannerTask) task); >- try { >- resultCollector.accept(hit); >- } catch (CoreException e) { >- return new Status(IStatus.OK, TasksUiPlugin.PLUGIN_ID, IStatus.ERROR, >- MessageFormat.format(Messages.XPlannerRepositoryConnector_ERROR_RETRIEVING_RESULTS, query.getRepositoryUrl()), e ); >+ AbstractTask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), id); >+ if (task != null) { >+ updateTaskDetails(repository.getUrl(), (XPlannerTask) task, data, false); > } >- } >- return Status.OK_STATUS; >- } >- >- private IStatus getUserStoryQueryHits(List<UserStoryData> userStories, >- TaskRepository repository, XPlannerCustomQuery query, QueryHitCollector resultCollector) { >- >- for (UserStoryData data : userStories) { >- String id = String.valueOf(data.getId()); >- ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), id); >- if (!(task instanceof XPlannerTask)) { >- task = createTask(data, data.getName(), id, repository); >- } >- updateTaskDetails(repository.getUrl(), (XPlannerTask) task, data, false); >- >- XPlannerQueryHit hit = new XPlannerQueryHit(taskList, >- task.getSummary(), task.getPriority(), query.getRepositoryUrl(), >- id, (XPlannerTask) task); >- try { >- resultCollector.accept(hit); >- } >- catch (CoreException e) { >- return new Status(IStatus.OK, TasksUiPlugin.PLUGIN_ID, IStatus.ERROR, >- MessageFormat.format(Messages.XPlannerRepositoryConnector_ERROR_RETRIEVING_RESULTS, query.getRepositoryUrl()), e ); >+ >+// try { >+// HeB -- priority already set in task >+// XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); >+// UserStoryData userStory = client.getUserStory(data.getStoryId()); >+// String priority = userStory == null ? AbstractTask.PriorityLevel.getDefault().toString() : >+// "" + userStory.getPriority(); //$NON-NLS-1$ >+// task.setPriority(priority); >+ else { >+ task = createTask(data, data.getName(), String.valueOf(data.getId()), repository); > } >+ >+ resultCollector.accept(task); >+// } >+// catch (Exception e) { >+// return new Status(IStatus.OK, TasksUiPlugin.PLUGIN_ID, IStatus.ERROR, >+// MessageFormat.format(Messages.XPlannerRepositoryConnector_ERROR_RETRIEVING_RESULTS, query.getRepositoryUrl()), e ); >+// } > } >- > return Status.OK_STATUS; > } >+ >+// no longer called -- calling routine commented out >+// private IStatus getUserStoryQueryHits(List<UserStoryData> userStories, >+// TaskRepository repository, XPlannerCustomQuery query, QueryHitCollector resultCollector) { >+// >+// for (UserStoryData data : userStories) { >+// String id = String.valueOf(data.getId()); >+// ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), id); >+// if (task != null) { >+// updateTaskDetails(repository.getUrl(), (XPlannerTask) task, data, false); >+// } >+// >+// XPlannerQueryHit hit = new XPlannerQueryHit(taskList, >+// data.getDescription(), "" + data.getPriority(), query.getRepositoryUrl(), //$NON-NLS-1$ >+// id); >+// resultCollector.accept(hit); >+// } >+// >+// return Status.OK_STATUS; >+// } > > @Override >- public void updateTask(TaskRepository repository, AbstractRepositoryTask repositoryTask) throws CoreException { >+ public void updateTaskFromRepository(TaskRepository repository, AbstractTask repositoryTask, >+ IProgressMonitor monitor) throws CoreException { >+ > if (repository != null && repositoryTask instanceof XPlannerTask) { > XPlannerTask xPlannerTask = (XPlannerTask) repositoryTask; >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >- if (server != null) { >+ XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); >+ if (client != null) { > TaskData xplannerTaskData; > try { >- xplannerTaskData = server.getTask(Integer.valueOf(xPlannerTask.getKey()).intValue()); >+ xplannerTaskData = client.getTask(Integer.valueOf(xPlannerTask.getTaskId()).intValue()); > if (xplannerTaskData != null) { > updateTaskDetails(repository.getUrl(), xPlannerTask, xplannerTaskData, true); > } >+ else { >+ UserStoryData userStoryData; >+ userStoryData = client.getUserStory(Integer.valueOf(xPlannerTask.getTaskId()).intValue()); >+ if (userStoryData != null) { >+ updateTaskDetails(repository.getUrl(), xPlannerTask, userStoryData, true); >+ } >+ } > } > catch (Exception e) { > throw new CoreException(new Status(IStatus.ERROR, >- XPlannerMylarUIPlugin.PLUGIN_ID, IStatus.ERROR, Messages.XPlannerRepositoryConnector_ERROR_UPDATING_TASK, e)); >+ XPlannerMylynUIPlugin.PLUGIN_ID, IStatus.ERROR, Messages.XPlannerRepositoryConnector_ERROR_UPDATING_TASK, e)); > } > } > } > } > > @Override >+ public void updateTaskFromTaskData(TaskRepository repository, AbstractTask repositoryTask, >+ RepositoryTaskData taskData) { >+ >+ if (taskData != null) { >+ XPlannerTask xplannerTask = (XPlannerTask) repositoryTask; >+ String url = repository.getUrl() + XPlannerMylynUIPlugin.TASK_URL_PREFIX + taskData.getId(); >+ xplannerTask.setUrl(url); >+ xplannerTask.setSummary(taskData.getSummary()); >+ xplannerTask.setOwner(taskData.getAssignedTo()); >+ xplannerTask.setPriority(taskData.getAttributeValue(RepositoryTaskAttribute.PRIORITY)); >+ xplannerTask.setTaskKind(taskData.getTaskKind()); >+ >+ >+ if (XPlannerRepositoryUtils.isCompleted(taskData)) { >+ xplannerTask.setCompleted(true); >+ try { >+ xplannerTask.setCompletionDate( // guess that completed when last modified >+ XPlannerAttributeFactory.TIME_DATE_FORMAT.parse( >+ taskData.getAttribute(RepositoryTaskAttribute.DATE_MODIFIED).getValue())); >+ } >+ catch (ParseException e) { >+ StatusHandler.log(e, Messages.XPlannerRepositoryConnector_COULD_NOT_CONVERT_TASK_DATE); >+ } >+ } >+ else { >+ xplannerTask.setCompleted(false); >+ xplannerTask.setCompletionDate(null); >+ } >+ } >+ } >+ >+ @Override > public String getRepositoryUrlFromTaskUrl(String url) { > if (url == null) { > return null; > } >- int index = url.indexOf(XPlannerMylarUIPlugin.DELIM_URL_PREFIX); >+ int index = url.indexOf(XPlannerMylynUIPlugin.DELIM_URL_PREFIX); > if (index != -1) { > return url.substring(0, index); > } >@@ -331,11 +379,10 @@ > > public void updateTaskDetails(String repositoryUrl, XPlannerTask task, TaskData taskData, boolean notifyOfChange) { > if (taskData.getId() > 0) { >- String url = repositoryUrl + XPlannerMylarUIPlugin.TASK_URL_PREFIX + taskData.getId(); >- task.setTaskUrl(url); >+ String url = repositoryUrl + XPlannerMylynUIPlugin.TASK_URL_PREFIX + taskData.getId(); >+ task.setUrl(url); > if (taskData.getName() != null) { >- task.setDescription(taskData.getName()); >- task.setKey(String.valueOf(taskData.getId())); >+ task.setSummary(taskData.getName()); > } > } > if (taskData.isCompleted()) { >@@ -348,7 +395,7 @@ > } > > if (notifyOfChange) { >- TasksUiPlugin.getTaskListManager().getTaskList().notifyLocalInfoChanged(task); >+ TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(task, true); > } > } > >@@ -356,10 +403,10 @@ > UserStoryData userStory, boolean notifyOfChange) { > > if (userStory.getId() > 0) { >- String url = repositoryUrl + XPlannerMylarUIPlugin.USER_STORY_URL_PREFIX + userStory.getId(); >- task.setTaskUrl(url); >+ String url = repositoryUrl + XPlannerMylynUIPlugin.USER_STORY_URL_PREFIX + userStory.getId(); >+ task.setUrl(url); > if (userStory.getName() != null) { >- task.setDescription(userStory.getName()); >+ task.setSummary(userStory.getName()); > task.setKey(String.valueOf(userStory.getId())); > } > } >@@ -372,10 +419,10 @@ > } > > task.setPriority("" + userStory.getPriority()); //$NON-NLS-1$ >- task.setKind(XPlannerTask.Kind.USER_STORY.toString()); >+ task.setTaskKind(XPlannerTask.Kind.USER_STORY.toString()); > > if (notifyOfChange) { >- TasksUiPlugin.getTaskListManager().getTaskList().notifyLocalInfoChanged(task); >+ TasksUiPlugin.getTaskListManager().getTaskList().notifyTaskChanged(task, true); > } > } > >@@ -384,29 +431,16 @@ > > XPlannerTask task; > >- String handleIdentifier = RepositoryTaskHandleUtil.getHandle(repository.getUrl(), id); >- ITask existingTask = TasksUiPlugin.getTaskListManager().getTaskList().getTask( >- handleIdentifier); >+ AbstractTask existingTask = TasksUiPlugin.getTaskListManager().getTaskList().getTask( >+ repository.getUrl(), id); > if (existingTask instanceof XPlannerTask) { > task = (XPlannerTask) existingTask; > } > else { >- task = new XPlannerTask(repository.getUrl(), id, name, true); >- task.setKey(String.valueOf(data.getId())); >+ task = new XPlannerTask(repository.getUrl(), id, name); > task.setKind(data); >- TasksUiPlugin.getTaskListManager().getTaskList().addTask(task); >- } >- >- RepositoryTaskData taskData = null; >- try { >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >- taskData = XPlannerRepositoryUtils.createRepositoryTaskData(repository, task, server); >- } >- catch (Throwable e) { >- e.printStackTrace(); >- } >- if (taskData != null) { >- task.setTaskData(taskData); >+//HeB -- testing >+// TasksUiPlugin.getTaskListManager().getTaskList().addTask(task); > } > > return task; >@@ -419,31 +453,31 @@ > > @Override > public void updateAttributes(TaskRepository repository, IProgressMonitor monitor) throws CoreException { >- XPlannerServerFacade.getDefault().refreshServerSettings(repository); >+ XPlannerClientFacade.getDefault().refreshClientSettings(repository); > } > >- public String getTaskWebUrl(String repositoryUrl, String taskId) { >+ public String getTaskUrl(String repositoryUrl, String taskId) { > String taskUrl = null; > > TaskRepository repository = TasksUiPlugin.getRepositoryManager() >- .getRepository(XPlannerMylarUIPlugin.REPOSITORY_KIND, repositoryUrl); >+ .getRepository(XPlannerMylynUIPlugin.REPOSITORY_KIND, repositoryUrl); > try { >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >- if (server != null) { >- TaskData taskData = server.getTask(Integer.valueOf(taskId).intValue()); >+ XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); >+ if (client != null) { >+ TaskData taskData = client.getTask(Integer.valueOf(taskId).intValue()); > // first check if taskdata exists > if (taskData != null) { > if (taskData.getId() > 0) { >- taskUrl = repositoryUrl + XPlannerMylarUIPlugin.TASK_URL_PREFIX >+ taskUrl = repositoryUrl + XPlannerMylynUIPlugin.TASK_URL_PREFIX > + taskData.getId(); > } > } > else { > // otherwise check if a user story exists >- UserStoryData userStory = server.getUserStory(Integer.valueOf(taskId) >+ UserStoryData userStory = client.getUserStory(Integer.valueOf(taskId) > .intValue()); > if (userStory != null) { >- taskUrl = repositoryUrl + XPlannerMylarUIPlugin.USER_STORY_URL_PREFIX + userStory.getId(); >+ taskUrl = repositoryUrl + XPlannerMylynUIPlugin.USER_STORY_URL_PREFIX + userStory.getId(); > } > } > } >@@ -462,32 +496,32 @@ > return null; > } > >- int index = url.indexOf(XPlannerMylarUIPlugin.DELIM_URL_SUFFIX); >+ int index = url.indexOf(XPlannerMylynUIPlugin.DELIM_URL_SUFFIX); > if (index != -1) { >- taskId = url.substring(index + XPlannerMylarUIPlugin.DELIM_URL_SUFFIX.length()); >+ taskId = url.substring(index + XPlannerMylynUIPlugin.DELIM_URL_SUFFIX.length()); > } > > return taskId; > } > >- public Set<AbstractRepositoryTask> getChangedSinceLastSync(TaskRepository repository, >- Set<AbstractRepositoryTask> tasks) throws CoreException { >+ public Set<AbstractTask> getChangedSinceLastSync(TaskRepository repository, >+ Set<AbstractTask> tasks) throws CoreException { > >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >- if (server == null) { >+ XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); >+ if (client == null) { > return Collections.emptySet(); > } > else { >- Set<AbstractRepositoryTask> changedTasks = new HashSet<AbstractRepositoryTask>(); >- for (AbstractRepositoryTask task : tasks) { >+ Set<AbstractTask> changedTasks = new HashSet<AbstractTask>(); >+ for (AbstractTask task : tasks) { > if (task instanceof XPlannerTask) { > XPlannerTask xplannerTask = (XPlannerTask) task; > TaskData taskData; > try { >- taskData = server.getTask(Integer.valueOf(xplannerTask.getKey()).intValue()); >+ taskData = client.getTask(Integer.valueOf(xplannerTask.getTaskId()).intValue()); > if (taskData != null) { > Date lastUpdateTime = taskData.getLastUpdateTime().getTime(); >- String lastSynchStamp = xplannerTask.getLastSyncDateStamp(); >+ String lastSynchStamp = xplannerTask.getLastReadTimeStamp(); > Date lastSynchTime = null; > if (lastSynchStamp != null && lastSynchStamp.length() > 0) { > lastSynchTime = XPlannerAttributeFactory.TIME_DATE_FORMAT.parse(lastSynchStamp); >@@ -507,4 +541,35 @@ > } > } > >+ @Override >+ public boolean markStaleTasks(TaskRepository repository, >+ Set<AbstractTask> tasks, IProgressMonitor monitor) throws CoreException { >+ >+ boolean changed = false; >+ >+ try { >+ monitor.beginTask("Getting changed tasks", IProgressMonitor.UNKNOWN); >+ >+ if (repository.getSynchronizationTimeStamp() == null) { >+ for (AbstractTask task : tasks) { >+ task.setStale(true); >+ } >+ changed = true; >+ } >+ else { >+ Set<AbstractTask> changedTasks = getChangedSinceLastSync(repository, tasks); >+ for (AbstractTask changedTask : changedTasks) { >+ changedTask.setStale(true); >+ } >+ >+ changed = true; >+ } >+ } >+ finally { >+ monitor.done(); >+ } >+ >+ return changed; >+ } >+ > } >Index: src/org/eclipse/mylyn/xplanner/ui/messages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/messages.properties,v >retrieving revision 1.1 >diff -u -r1.1 messages.properties >--- src/org/eclipse/mylyn/xplanner/ui/messages.properties 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/messages.properties 26 Jun 2007 17:41:18 -0000 >@@ -1,19 +1,20 @@ >-MylarXPlannerPlugin_CLIENT_LABEL=XPlanner (supports 0.7 and later) >-MylarXPlannerPlugin_CLIENT_DIALOG_TITLE=Mylar XPlanner Client >-MylarXPlannerPlugin_NOT_AVAILABLE_IN_SKU=Mylar XPlanner plugin features are not available in this SKU >-MylarXPlannerPlugin_MYLAR_XPLANNER_ERROR_TITLE=Mylar XPlanner Error >-XPlannerServerFacade_SERVER_CONNECTION_ERROR=Error connecting to XPlanner Server >-XPlannerServerFacade_CONNECTION_FAILURE_ERROR=XPlanner Connection Failure.\n\n >-XPlannerServerFacade_INVALID_URL_EXCEPTION=Invalid url >-XPlannerServerFacade_NETWORK_CONNECTION_FAILURE=Please check your network connection and XPlanner server settings in the Task Repositories view. >+MylynXPlannerPlugin_CLIENT_LABEL=XPlanner (supports 0.7 and later) >+MylynXPlannerPlugin_CLIENT_DIALOG_TITLE=Mylyn XPlanner Client >+MylynXPlannerPlugin_NOT_AVAILABLE_IN_SKU=Mylyn XPlanner plugin features are not available in this SKU >+MylynXPlannerPlugin_XPLANNER_ERROR_TITLE=Mylyn XPlanner Error >+XPlannerClientFacade_SERVER_CONNECTION_ERROR=Error connecting to XPlanner Server >+XPlannerClientFacade_CONNECTION_FAILURE_ERROR=XPlanner Connection Failure.\n\n >+XPlannerClientFacade_INVALID_URL_EXCEPTION=Invalid url >+XPlannerClientFacade_NETWORK_CONNECTION_FAILURE=Please check your network connection and XPlanner server settings in the Task Repositories view. > XPlannerRepositoryConnector_NEW_TASK_DESCRIPTION=New Task >-XPlannerRepositoryConnector_PerformQueryFailure=Mylar XPlanner query failure: {0} >+XPlannerRepositoryConnector_PerformQueryFailure=Mylyn XPlanner query failure: {0} > XPlannerRepositoryConnector_ERROR_RETRIEVING_RESULTS=Error while retrieving results from: {0} >+XPlannerRepositoryConnector_COULD_NOT_CONVERT_TASK_DATE=Could not convert task date using format > XPlannerRepositoryConnector_ERROR_UPDATING_TASK=Error updating task >-XPlannerServerFacade_AUTHENTICATION_FAILED=XPlanner Authentication Failed.\n\n >-XPlannerServerFacade_USERNAME_PASSWORD_ERROR=Please check your XPlanner username and password in the Task Repositories view >-XPlannerServerFacade_NO_REPOSITORY_FOUND=No XPlanner repository found.\n\n >-XPlannerServerFacade_VERIFY_VALID_REPOSITORY=Please verify that a vaild XPlanner repository exists in the Task Repositories view >+XPlannerClientFacade_AUTHENTICATION_FAILED=XPlanner Authentication Failed.\n\n >+XPlannerClientFacade_USERNAME_PASSWORD_ERROR=Please check your XPlanner username and password in the Task Repositories view >+XPlannerClientFacade_NO_REPOSITORY_FOUND=No XPlanner repository found.\n\n >+XPlannerClientFacade_VERIFY_VALID_REPOSITORY=Please verify that a vaild XPlanner repository exists in the Task Repositories view > XPlannerRepositoryConnector_VERSION_SUPPORT=0.7 and higher > XPlannerRepositoryConnector_ErrorDialogTitle=XPlanner Query Error > XPlannerRepositoryUtils_TASK_DOWNLOAD_FAILED=Task download failed. Ensure proper repository configuration of {0} in {1}. >@@ -21,8 +22,9 @@ > XPlannerRepositoryUtils_NO_PROJECT_NAME=<no project name> > XPlannerRepositoryUtils_NO_ITERATION_NAME=<no iteration name> > XPlannerRepositoryUtils_NO_USER_STORY_NAME=<no user story name> >-XPlannerServerFacade_COULD_NOT_CONNECT_TO_REPOSITORY=Could not connect to XPlanner repository.\n\n >+XPlannerClientFacade_COULD_NOT_CONNECT_TO_REPOSITORY=Could not connect to XPlanner repository.\n\n > XPlannerTaskExternalizer_FAILED_TO_LOAD_HITS_EXCEPTION=Failed to load all hits > XPlannerTaskExternalizer_HANDLE_NOT_STORED_EXCEPTION=Handle not stored for task >+XPlannerOfflineTaskHandler_CANNOT_POST_DATA_TO_SERVER=Cannot post XPlanner task data to XPlanner server > XPlannerTaskExternalizer_DESCRIPTION_NOT_STORED_EXCEPTION=Description not stored for task >-XPlannerServerFacade_CHECK_CREDENTIALS=Please check your credentials in the Task Repositories view >+XPlannerClientFacade_CHECK_CREDENTIALS=Please check your credentials in the Task Repositories view >Index: src/org/eclipse/mylyn/xplanner/ui/MylarXPlannerUtils.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/MylarXPlannerUtils.java >diff -N src/org/eclipse/mylyn/xplanner/ui/MylarXPlannerUtils.java >--- src/org/eclipse/mylyn/xplanner/ui/MylarXPlannerUtils.java 31 May 2007 07:37:10 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,34 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 - 2007 CodeGear 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 >- *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >- >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.xplanner.ui.wizard.NewXPlannerQueryWizard; >- >-/** >- * @author Ravi Kumar >- * @author Helen Bershadskaya >- */ >-public class MylarXPlannerUtils { >- private MylarXPlannerUtils() { >- >- } >- >- public static void addNewMyTasksQuery(TaskRepository repository, >- String name) { >- >- XPlannerCustomQuery myTasksQuery = >- new XPlannerCustomQuery(repository.getUrl(), name, >- TasksUiPlugin.getTaskListManager().getTaskList()); >- >- myTasksQuery.setMyCurrentTasks(true); >- NewXPlannerQueryWizard.addQuery(myTasksQuery, repository); >- } >- >-} >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerImages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/XPlannerImages.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerImages.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerImages.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerImages.java 26 Jun 2007 17:41:18 -0000 >@@ -5,14 +5,14 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >+package org.eclipse.mylyn.xplanner.ui; > > import java.net.MalformedURLException; > import java.net.URL; > > import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.jface.resource.ImageRegistry; >-import org.eclipse.mylar.internal.tasks.ui.TaskListImageDescriptor; >+import org.eclipse.mylyn.internal.tasks.ui.TaskListImageDescriptor; > import org.eclipse.swt.graphics.Image; > > >@@ -26,8 +26,8 @@ > > private static final String T_VIEW = "eview16"; //$NON-NLS-1$ > >- private static final URL baseURL = XPlannerMylarUIPlugin.getDefault() == null ? null : >- XPlannerMylarUIPlugin.getDefault().getBundle().getEntry("/icons/"); //$NON-NLS-1$ >+ private static final URL baseURL = XPlannerMylynUIPlugin.getDefault() == null ? null : >+ XPlannerMylynUIPlugin.getDefault().getBundle().getEntry("/icons/"); //$NON-NLS-1$ > > public static final ImageDescriptor OVERLAY_XPLANNER = create(T_VIEW, "overlay-xplanner.gif"); //$NON-NLS-1$ > >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerQueryHit.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/XPlannerQueryHit.java >diff -N src/org/eclipse/mylyn/xplanner/ui/XPlannerQueryHit.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerQueryHit.java 31 May 2007 07:37:10 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,69 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 - 2007 CodeGear 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 >- *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >- >-import org.eclipse.mylar.tasks.core.AbstractQueryHit; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryTask; >-import org.eclipse.mylar.tasks.core.TaskList; >- >-/** >- * Represents an XPlanner task returned as the result of a XPlanner query >- * >- * @author Ravi Kumar >- * @author Helen Bershadskaya >- */ >-public class XPlannerQueryHit extends AbstractQueryHit { >- >- private XPlannerTask task = null; >- >- public XPlannerQueryHit(TaskList taskList, String description, String priority, >- String repositoryUrl, String id, XPlannerTask task) { >- >- super(taskList, repositoryUrl, description, id); >- super.priority = priority; >- this.task = task; >- } >- >- @Override >- protected AbstractRepositoryTask createTask() { >- return task; //TODO -- not sure if this is right, but corresponds to what we did before >- } >- >- /** >- * @return null if there is no corresponding report >- */ >- public AbstractRepositoryTask getCorrespondingTask() { >- return task; >- } >- >- public void setCorrespondingTask(AbstractRepositoryTask task) { >- if (task instanceof XPlannerTask) { >- this.task = (XPlannerTask)task; >- } >- } >- >- public boolean isCompleted() { >- return task.isCompleted(); >- } >- >- public String getPriority() { >- return task.getPriority(); >- } >- >- public String getSummary() { >- return task.getSummary(); >- } >- >- public void setDescription(String description) { >- task.setDescription(description); >- } >- >- public boolean isLocal() { >- return false; >- } >-} >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerCustomQuery.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/XPlannerCustomQuery.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerCustomQuery.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerCustomQuery.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerCustomQuery.java 26 Jun 2007 17:41:18 -0000 >@@ -5,27 +5,26 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >+package org.eclipse.mylyn.xplanner.ui; > > import java.util.Arrays; > import java.util.List; > >-import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.TaskList; >+import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; > > > > /** > * An XPlannerCustomQuery represents a query for tasks or user stories from a XPlanner repository. > * >- * @author Ravi Kumar >+ * @author Ravi Kumar > * @author Helen Bershadskaya > */ > public class XPlannerCustomQuery extends AbstractRepositoryQuery { > > public static final int INVALID_ID = -1; > public static final List<Integer> INVALID_IDS = Arrays.asList(new Integer[] {INVALID_ID}); >- private static final int MAX_HITS = 75; >+ //private static final int MAX_HITS = 75; > public static enum ContentIdType {PROJECT, ITERATION, USER_STORY}; > > private String queryName = null; >@@ -35,14 +34,14 @@ > private boolean myCurrentTasks = false; > private ContentIdType contentIdType = ContentIdType.USER_STORY; > >- public XPlannerCustomQuery(String repositoryUrl, String queryName, TaskList taskList) { >- super(queryName, taskList); >+ public XPlannerCustomQuery(String repositoryUrl, String queryName) { >+ super(queryName); > this.queryName = queryName; > super.repositoryUrl = repositoryUrl; > } > > public String getRepositoryKind() { >- return XPlannerMylarUIPlugin.REPOSITORY_KIND; >+ return XPlannerMylynUIPlugin.REPOSITORY_KIND; > } > > public String getQueryName() { >Index: src/org/eclipse/mylyn/xplanner/ui/Messages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/Messages.java,v >retrieving revision 1.1 >diff -u -r1.1 Messages.java >--- src/org/eclipse/mylyn/xplanner/ui/Messages.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/Messages.java 26 Jun 2007 17:41:18 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >+package org.eclipse.mylyn.xplanner.ui; > > import org.eclipse.osgi.util.NLS; > >@@ -14,15 +14,19 @@ > * @author Helen Bershadskaya > */ > public class Messages extends NLS { >- private static final String BUNDLE_NAME = "org.eclipse.mylar.xplanner.ui.messages"; //$NON-NLS-1$ >+ private static final String BUNDLE_NAME = "org.eclipse.mylyn.xplanner.ui.messages"; //$NON-NLS-1$ > >- public static String MylarXPlannerPlugin_CLIENT_DIALOG_TITLE; >+ public static String MylynXPlannerPlugin_CLIENT_DIALOG_TITLE; > >- public static String MylarXPlannerPlugin_CLIENT_LABEL; >+ public static String MylynXPlannerPlugin_CLIENT_LABEL; > >- public static String MylarXPlannerPlugin_MYLAR_XPLANNER_ERROR_TITLE; >+ public static String MylynXPlannerPlugin_XPLANNER_ERROR_TITLE; > >- public static String MylarXPlannerPlugin_NOT_AVAILABLE_IN_SKU; >+ public static String MylynXPlannerPlugin_NOT_AVAILABLE_IN_SKU; >+ >+ public static String XPlannerOfflineTaskHandler_CANNOT_POST_DATA_TO_SERVER; >+ >+ public static String XPlannerRepositoryConnector_COULD_NOT_CONVERT_TASK_DATE; > > public static String XPlannerRepositoryConnector_ERROR_RETRIEVING_RESULTS; > >@@ -46,25 +50,25 @@ > > public static String XPlannerRepositoryUtils_TASK_DOWNLOAD_FAILED; > >- public static String XPlannerServerFacade_AUTHENTICATION_FAILED; >+ public static String XPlannerClientFacade_AUTHENTICATION_FAILED; > >- public static String XPlannerServerFacade_CHECK_CREDENTIALS; >+ public static String XPlannerClientFacade_CHECK_CREDENTIALS; > >- public static String XPlannerServerFacade_CONNECTION_FAILURE_ERROR; >+ public static String XPlannerClientFacade_CONNECTION_FAILURE_ERROR; > >- public static String XPlannerServerFacade_COULD_NOT_CONNECT_TO_REPOSITORY; >+ public static String XPlannerClientFacade_COULD_NOT_CONNECT_TO_REPOSITORY; > >- public static String XPlannerServerFacade_INVALID_URL_EXCEPTION; >+ public static String XPlannerClientFacade_INVALID_URL_EXCEPTION; > >- public static String XPlannerServerFacade_NETWORK_CONNECTION_FAILURE; >+ public static String XPlannerClientFacade_NETWORK_CONNECTION_FAILURE; > >- public static String XPlannerServerFacade_NO_REPOSITORY_FOUND; >+ public static String XPlannerClientFacade_NO_REPOSITORY_FOUND; > >- public static String XPlannerServerFacade_SERVER_CONNECTION_ERROR; >+ public static String XPlannerClientFacade_SERVER_CONNECTION_ERROR; > >- public static String XPlannerServerFacade_USERNAME_PASSWORD_ERROR; >+ public static String XPlannerClientFacade_USERNAME_PASSWORD_ERROR; > >- public static String XPlannerServerFacade_VERIFY_VALID_REPOSITORY; >+ public static String XPlannerClientFacade_VERIFY_VALID_REPOSITORY; > > public static String XPlannerTaskExternalizer_DESCRIPTION_NOT_STORED_EXCEPTION; > >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerTask.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/XPlannerTask.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerTask.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerTask.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerTask.java 26 Jun 2007 17:41:18 -0000 >@@ -5,20 +5,18 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >+package org.eclipse.mylyn.xplanner.ui; > >-import org.eclipse.mylar.tasks.core.AbstractRepositoryTask; >-import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute; >+import org.eclipse.mylyn.tasks.core.AbstractTask; >+import org.eclipse.mylyn.xplanner.wsdl.soap.domain.DomainData; > import org.xplanner.soap.IterationData; > import org.xplanner.soap.UserStoryData; > >-import org.eclipse.mylar.xplanner.wsdl.soap.domain.DomainData; >- > /** > * @author Ravi Kumar > * @author Helen Bershadskaya > */ >-public class XPlannerTask extends AbstractRepositoryTask { >+public class XPlannerTask extends AbstractTask { > > private String key = null; > >@@ -38,6 +36,26 @@ > return ""; //$NON-NLS-1$ > } > } >+ >+ public static Kind fromString(String kindValue) { >+ Kind kind = null; >+ >+ if (kindValue == null) { >+ kind = null; >+ } >+ else if (kindValue.equals(TASK.toString())) { >+ kind = TASK; >+ } >+ else if (kindValue.equals(USER_STORY.toString())) { >+ kind = USER_STORY; >+ } >+ else if (kindValue.equals(ITERATION.toString())) { >+ kind = ITERATION; >+ } >+ >+ return kind; >+ } >+ > } > > public void setKind(DomainData data) { >@@ -50,20 +68,24 @@ > tempKind = Kind.USER_STORY.toString(); > } > >- setKind(tempKind); >+ setTaskKind(tempKind); > } > > /** > * The handle is also the task's XPlanner url > */ >- public XPlannerTask(String repositoryUrl, String id, String label, boolean newTask) { >- super(repositoryUrl, id, label, newTask); >+ public XPlannerTask(String repositoryUrl, String id, String label) { >+ super(repositoryUrl, id, label); > } > >- public String getRepositoryKind() { >- return XPlannerMylarUIPlugin.REPOSITORY_KIND; >+ public String getConnectorKind() { >+ return XPlannerMylynUIPlugin.REPOSITORY_KIND; > } > >+ public boolean isLocal() { >+ return false; >+ } >+ > public String getKey() { > return key; > } >@@ -71,19 +93,4 @@ > public void setKey(String key) { > this.key = key; > } >- >- @Override >- public String getPriority() { >- String priority; >- >- if (taskData != null && taskData.getAttribute(RepositoryTaskAttribute.PRIORITY) != null) { >- priority = taskData.getAttributeValue(RepositoryTaskAttribute.PRIORITY); >- } >- else { >- priority = super.getPriority(); >- } >- >- return priority; >- } >- > } >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskDecorator.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskDecorator.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerTaskDecorator.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskDecorator.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskDecorator.java 26 Jun 2007 17:41:18 -0000 >@@ -5,34 +5,28 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >+package org.eclipse.mylyn.xplanner.ui; > > import org.eclipse.jface.viewers.IDecoration; > import org.eclipse.jface.viewers.ILabelProviderListener; >-import org.eclipse.jface.viewers.ILightweightLabelDecorator; > > > /** > * @author Ravi Kumar > * @author Helen Bershadskaya > */ >-public class XPlannerTaskDecorator implements ILightweightLabelDecorator { >+//HeB -- testing >+public class XPlannerTaskDecorator { > > public void decorate(Object element, IDecoration decoration) { >- if (element instanceof XPlannerQueryHit) { >- XPlannerQueryHit hit = (XPlannerQueryHit) element; >- if (hit.getCorrespondingTask() != null) { >- decorate(hit.getCorrespondingTask(), decoration); >- } >- } > if (element instanceof XPlannerTask) { > XPlannerTask task = (XPlannerTask) element; > if (XPlannerTask.Kind.ITERATION.toString().equals(task.getTaskKind())) { >- decoration.addOverlay(XPlannerImages.OVERLAY_ITERATION, IDecoration.BOTTOM_RIGHT); >+ decoration.addOverlay(XPlannerImages.OVERLAY_ITERATION); > } else if (XPlannerTask.Kind.USER_STORY.toString().equals(task.getTaskKind())) { >- decoration.addOverlay(XPlannerImages.OVERLAY_USER_STORY, IDecoration.BOTTOM_RIGHT); >+ decoration.addOverlay(XPlannerImages.OVERLAY_USER_STORY); > } else if (XPlannerTask.Kind.TASK.toString().equals(task.getTaskKind())) { >- decoration.addOverlay(XPlannerImages.OVERLAY_TASK, IDecoration.BOTTOM_RIGHT); >+ decoration.addOverlay(XPlannerImages.OVERLAY_TASK); > } > } > } >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryUi.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryUi.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerRepositoryUi.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryUi.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerRepositoryUi.java 26 Jun 2007 17:41:18 -0000 >@@ -5,20 +5,20 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >+package org.eclipse.mylyn.xplanner.ui; > >+import java.util.ArrayList; >+import java.util.List; >+ >+import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.wizard.IWizard; > import org.eclipse.jface.wizard.WizardPage; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi; >-import org.eclipse.mylar.tasks.ui.wizards.AbstractRepositorySettingsPage; >-import org.eclipse.mylar.tasks.ui.wizards.NewWebTaskWizard; >-import org.eclipse.mylar.xplanner.ui.wizard.EditXPlannerQueryWizard; >-import org.eclipse.mylar.xplanner.ui.wizard.NewXPlannerQueryWizard; >-import org.eclipse.mylar.xplanner.ui.wizard.XPlannerCustomQueryPage; >-import org.eclipse.mylar.xplanner.ui.wizard.XPlannerRepositorySettingsPage; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi; >+import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage; >+import org.eclipse.mylyn.tasks.ui.wizards.NewWebTaskWizard; >+import org.eclipse.mylyn.xplanner.ui.wizard.*; > > /** > * @author Ravi Kumar >@@ -31,6 +31,27 @@ > } > > @Override >+ public ImageDescriptor getTaskKindOverlay(AbstractTask task) { >+ ImageDescriptor overlayImage; >+ >+ XPlannerTask.Kind kind = XPlannerTask.Kind.fromString(task.getTaskKind()); >+ if (kind.equals(XPlannerTask.Kind.TASK)) { >+ overlayImage = XPlannerImages.OVERLAY_TASK; >+ } >+ else if (kind.equals(XPlannerTask.Kind.USER_STORY)) { >+ overlayImage = XPlannerImages.OVERLAY_USER_STORY; >+ } >+ else if (kind.equals(XPlannerTask.Kind.ITERATION)) { >+ overlayImage = XPlannerImages.OVERLAY_ITERATION; >+ } >+ else { >+ overlayImage = super.getTaskKindOverlay(task); >+ } >+ >+ return overlayImage; >+ } >+ >+ @Override > public WizardPage getSearchPage(TaskRepository repository, IStructuredSelection selection) { > return new XPlannerCustomQueryPage(repository, null); > } >@@ -66,7 +87,7 @@ > // } > // } > // } catch (Exception e) { >-// MylarStatusHandler.fail(e, e.getMessage(), true); >+// MylynStatusHandler.fail(e, e.getMessage(), true); > // } > // > // } >@@ -78,13 +99,8 @@ > } > > @Override >- public boolean hasRichEditor() { >- return true; >- } >- >- @Override >- public String getRepositoryType() { >- return XPlannerMylarUIPlugin.REPOSITORY_KIND; >+ public String getConnectorKind() { >+ return XPlannerMylynUIPlugin.REPOSITORY_KIND; > } > > @Override >@@ -92,4 +108,29 @@ > return true; > } > >+ @Override >+ public String getTaskKindLabel(AbstractTask repositoryTask) { >+ return repositoryTask == null ? super.getTaskKindLabel(repositoryTask) : >+ repositoryTask.getTaskKind(); >+ } >+ >+ @Override >+ public List<AbstractTaskContainer> getLegendItems() { >+ List<AbstractTaskContainer> legendItems = new ArrayList<AbstractTaskContainer>(); >+ >+ XPlannerTask task = new XPlannerTask("", XPlannerTask.Kind.TASK.name(), XPlannerTask.Kind.TASK.toString()); >+ task.setTaskKind(XPlannerTask.Kind.TASK.toString()); >+ legendItems.add(task); >+ >+ XPlannerTask userStory = new XPlannerTask("", XPlannerTask.Kind.USER_STORY.name(), XPlannerTask.Kind.USER_STORY.toString()); >+ userStory.setTaskKind(XPlannerTask.Kind.USER_STORY.toString()); >+ legendItems.add(userStory); >+ >+ XPlannerTask iteration = new XPlannerTask("", XPlannerTask.Kind.ITERATION.name(), XPlannerTask.Kind.ITERATION.toString()); >+ iteration.setTaskKind(XPlannerTask.Kind.ITERATION.toString()); >+ legendItems.add(iteration); >+ >+ return legendItems; >+ } >+ > } >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerMylarUIPlugin.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/XPlannerMylarUIPlugin.java >diff -N src/org/eclipse/mylyn/xplanner/ui/XPlannerMylarUIPlugin.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerMylarUIPlugin.java 31 May 2007 07:37:10 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,99 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 - 2007 CodeGear 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 >- *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >- >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Platform; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.jface.dialogs.MessageDialog; >-import org.eclipse.jface.resource.ImageDescriptor; >-import org.eclipse.mylar.core.MylarStatusHandler; >-import org.eclipse.swt.widgets.Shell; >-import org.eclipse.ui.PlatformUI; >-import org.eclipse.ui.plugin.AbstractUIPlugin; >-import org.osgi.framework.BundleContext; >- >-/** >- * @author Ravi Kumar >- * @author Helen Bershadskaya >- */ >-public class XPlannerMylarUIPlugin extends AbstractUIPlugin { >- >- private static XPlannerMylarUIPlugin INSTANCE; >- >- public static final String PLUGIN_ID = "org.eclipse.mylar.xplanner.ui"; //$NON-NLS-1$ >- >- public final static String REPOSITORY_KIND = "xplanner"; //$NON-NLS-1$ >- >- public final static String XPLANNER_CLIENT_LABEL = Messages.MylarXPlannerPlugin_CLIENT_LABEL; >- >- public final static String TITLE_MESSAGE_DIALOG = Messages.MylarXPlannerPlugin_CLIENT_DIALOG_TITLE; >- >- public static final String DELIM_URL_PREFIX = "/do/view/"; //$NON-NLS-1$ >- >- public final static String DELIM_URL_SUFFIX = "?oid="; //$NON-NLS-1$ >- >- public final static String TASK_URL_PREFIX = DELIM_URL_PREFIX + "task" + DELIM_URL_SUFFIX; //$NON-NLS-1$ >- >- public final static String USER_STORY_URL_PREFIX = DELIM_URL_PREFIX + "userstory" + DELIM_URL_SUFFIX; //$NON-NLS-1$ >- >- public final static String ITERATION_URL_PREFIX = DELIM_URL_PREFIX + "iteration" + DELIM_URL_SUFFIX; //$NON-NLS-1$ >- >- public final static IStatus NO_LICENSE_STATUS = new Status(IStatus.INFO, XPlannerMylarUIPlugin.PLUGIN_ID, >- 0, Messages.MylarXPlannerPlugin_NOT_AVAILABLE_IN_SKU, null); >- >- public XPlannerMylarUIPlugin() { >- INSTANCE = this; >- } >- >- public void stop(BundleContext context) throws Exception { >- super.stop(context); >- INSTANCE = null; >- XPlannerServerFacade.getDefault().logOutFromAll(); >- } >- >- public static void log(final Throwable e, final String message, boolean informUser) { >- if (Platform.isRunning() && informUser) { >- try { >- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { >- public void run() { >- Shell shell = null; >- if (PlatformUI.getWorkbench() != null >- && PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) { >- shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); >- } >- String displayMessage = message == null ? e.getMessage() : message + "\n" + e.getMessage(); //$NON-NLS-1$ >- MessageDialog.openError(shell, Messages.MylarXPlannerPlugin_MYLAR_XPLANNER_ERROR_TITLE, displayMessage); >- } >- }); >- } >- catch (Throwable t) { >- t.printStackTrace(); >- } >- } >- else { >- MylarStatusHandler.log(e, message == null ? Messages.MylarXPlannerPlugin_MYLAR_XPLANNER_ERROR_TITLE : message); >- } >- } >- >- public static XPlannerMylarUIPlugin getDefault() { >- return INSTANCE; >- } >- >- /** >- * Returns an image descriptor for the image file at the given plug-in >- * relative path. >- * >- * @param path >- * the path >- * @return the image descriptor >- */ >- public static ImageDescriptor getImageDescriptor(String path) { >- return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); >- } >-} >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerOfflineTaskHandler.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/XPlannerOfflineTaskHandler.java >diff -N src/org/eclipse/mylyn/xplanner/ui/XPlannerOfflineTaskHandler.java >--- src/org/eclipse/mylyn/xplanner/ui/XPlannerOfflineTaskHandler.java 31 May 2007 07:37:10 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,147 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 - 2007 CodeGear 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 >- *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui; >- >-import java.net.Proxy; >-import java.rmi.RemoteException; >- >-import javax.security.auth.login.LoginException; >- >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.mylar.tasks.core.AbstractAttributeFactory; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryTask; >-import org.eclipse.mylar.tasks.core.ITask; >-import org.eclipse.mylar.tasks.core.ITaskDataHandler; >-import org.eclipse.mylar.tasks.core.RepositoryTaskData; >-import org.eclipse.mylar.tasks.core.TaskList; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.xplanner.core.XPlannerCorePlugin; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.xplanner.soap.TaskData; >-import org.xplanner.soap.UserStoryData; >- >-/** >- * @author Ravi Kumar >- * @author Helen Bershadskaya >- */ >-public class XPlannerOfflineTaskHandler implements ITaskDataHandler { >- private AbstractAttributeFactory attributeFactory = new XPlannerAttributeFactory(); >- >- public XPlannerOfflineTaskHandler(TaskList taskList) { >- //TODO -- tasklist? >- } >- >- public RepositoryTaskData downloadTaskData(AbstractRepositoryTask repositoryTask, TaskRepository repository, Proxy proxySettings) >- throws CoreException, LoginException { >- >- if (!(repositoryTask instanceof XPlannerTask)) { >- return null; >- } >- >- RepositoryTaskData repositoryTaskData = null; >- XPlannerTask xplannerTask = (XPlannerTask)repositoryTask; >- >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >- repositoryTaskData = XPlannerRepositoryUtils.createRepositoryTaskData(repository, xplannerTask, server); >- >- return repositoryTaskData; >- } >- >- public boolean initializeTaskData(TaskRepository repository, RepositoryTaskData data, IProgressMonitor monitor) >- throws CoreException { >- >- // currently don't create new tasks >- return false; >- } >- >- public AbstractAttributeFactory getAttributeFactory(String repositoryUrl, String repositoryKind, String taskKind) { >- return attributeFactory; >- } >- >- public String postTaskData(TaskRepository repository, final RepositoryTaskData repositoryTaskData) throws CoreException { >- String resultId = null; >- >- try { >- resultId = postChangesToRepository(repositoryTaskData); >- } >- catch (Exception e) { >- throw new CoreException(new Status(Status.ERROR, >- XPlannerCorePlugin.ID, Status.ERROR, "Cannot post XPlanner task data to XPlanner server", null)); >- } >- >- return resultId; >- } >- >- private String postChangesToRepository(RepositoryTaskData repositoryTaskData) throws CoreException { >- String error = null; >- >- TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository( >- repositoryTaskData.getRepositoryKind(), repositoryTaskData.getRepositoryUrl()); >- >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >- if (server != null) { >- try { >- // first check if taskdata exists >- TaskData taskData = server.getTask(Integer.valueOf(repositoryTaskData.getId()).intValue()); >- if (taskData != null) { >- taskData.setName(repositoryTaskData.getSummary()); >- taskData.setDescription(XPlannerRepositoryUtils.getDescription(repositoryTaskData)); >- taskData.setEstimatedHours(Double.valueOf( >- repositoryTaskData.getAttribute(XPlannerAttributeFactory.ATTRIBUTE_EST_HOURS_NAME).getValue())); >- taskData.setCompleted(XPlannerRepositoryUtils.isCompleted(repositoryTaskData)); >- server.update(taskData); >- } >- else { >- // otherwise check if a user story exists >- UserStoryData userStory = server.getUserStory(Integer.valueOf(repositoryTaskData.getId()).intValue()); >- if (userStory != null) { >- userStory.setName(repositoryTaskData.getSummary()); >- userStory.setDescription(XPlannerRepositoryUtils.getDescription(repositoryTaskData)); >- userStory.setActualHours(Double.valueOf( >- repositoryTaskData.getAttribute(XPlannerAttributeFactory.ATTRIBUTE_ACT_HOURS_NAME).getValue())); >- server.update(userStory); >- } >- } >- } >- catch (NumberFormatException e) { >- XPlannerMylarUIPlugin.log(e.getCause(), "", false); >- error = e.getMessage(); >- } >- catch (RemoteException e) { >- XPlannerMylarUIPlugin.log(e.getCause(), "", false); >- error = e.getMessage(); >- } >- } >- >- return error; >- } >- >- public RepositoryTaskData getTaskData(TaskRepository repository, String taskId) throws CoreException { >- RepositoryTaskData repositoryTaskData = null; >- >- XPlannerServer server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >- ITask existingTask = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskId); >- if (existingTask instanceof XPlannerTask) { >- repositoryTaskData = XPlannerRepositoryUtils.createRepositoryTaskData(repository, >- (XPlannerTask)existingTask, server); >- } >- else { >- AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( >- repository.getKind()); >- ITask newTask = connector.createTaskFromExistingKey(repository, taskId); >- repositoryTaskData = XPlannerRepositoryUtils.createRepositoryTaskData(repository, >- (XPlannerTask)newTask, server); >- } >- return repositoryTaskData; >- } >- >-} >Index: src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerUserStoryEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerUserStoryEditor.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerUserStoryEditor.java >--- src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerUserStoryEditor.java 31 May 2007 07:37:12 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerUserStoryEditor.java 26 Jun 2007 17:41:18 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.editor; >+package org.eclipse.mylyn.xplanner.ui.editor; > > import java.rmi.RemoteException; > import java.text.MessageFormat; >@@ -15,36 +15,23 @@ > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.jface.layout.GridDataFactory; > import org.eclipse.jface.resource.JFaceResources; >-import org.eclipse.mylar.core.MylarStatusHandler; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.tasks.ui.editors.RepositoryTaskEditorInput; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.ui.XPlannerAttributeFactory; >-import org.eclipse.mylar.xplanner.ui.XPlannerMylarUIPlugin; >-import org.eclipse.mylar.xplanner.ui.XPlannerServerFacade; >-import org.eclipse.mylar.xplanner.ui.XPlannerTask; >+import org.eclipse.mylyn.monitor.core.StatusHandler; >+import org.eclipse.mylyn.tasks.core.RepositoryTaskData; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.tasks.ui.editors.RepositoryTaskEditorInput; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.ui.*; > import org.eclipse.swt.SWT; > import org.eclipse.swt.layout.GridLayout; >-import org.eclipse.swt.widgets.Button; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Label; >-import org.eclipse.swt.widgets.Text; >-import org.eclipse.swt.widgets.Tree; >-import org.eclipse.swt.widgets.TreeItem; >+import org.eclipse.swt.widgets.*; > import org.eclipse.ui.IEditorInput; > import org.eclipse.ui.IEditorSite; > import org.eclipse.ui.forms.IManagedForm; > import org.eclipse.ui.forms.editor.FormEditor; > import org.eclipse.ui.forms.editor.FormPage; >-import org.eclipse.ui.forms.widgets.ExpandableComposite; >-import org.eclipse.ui.forms.widgets.FormToolkit; >-import org.eclipse.ui.forms.widgets.ScrolledForm; >-import org.eclipse.ui.forms.widgets.Section; >-import org.xplanner.soap.IterationData; >-import org.xplanner.soap.PersonData; >-import org.xplanner.soap.ProjectData; >-import org.xplanner.soap.UserStoryData; >+import org.eclipse.ui.forms.widgets.*; >+import org.xplanner.soap.*; > > /** > * @author Ravi Kumar >@@ -60,7 +47,7 @@ > > private boolean isDirty = false; > >- private XPlannerServer server; >+ private XPlannerClient client; > > private UserStoryData userStoryData; > >@@ -86,7 +73,7 @@ > } > > RepositoryTaskEditorInput repositoryInput = (RepositoryTaskEditorInput) input; >- if (!XPlannerMylarUIPlugin.REPOSITORY_KIND.equals(repositoryInput.getRepository().getKind())) { >+ if (!XPlannerMylynUIPlugin.REPOSITORY_KIND.equals(repositoryInput.getRepository().getConnectorKind())) { > return; > } > >@@ -94,28 +81,28 @@ > setSite(site); > setInput(input); > setPartName(this.input.getName()); >- XPlannerTask task = (XPlannerTask) repositoryInput.getRepositoryTask(); >- TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(task.getRepositoryKind(), >- task.getRepositoryUrl()); >+ RepositoryTaskData taskData = repositoryInput.getTaskData(); >+ TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(taskData.getRepositoryKind(), >+ taskData.getRepositoryUrl()); > try { >- server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >- String key = task.getKey(); >- if (key == null || key.trim().equals("")) { //$NON-NLS-1$ >- MylarStatusHandler.log(Messages.XPlannerTaskEditor_NO_TASK_KEY_EXCEPTION, >+ client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); >+ String id = taskData.getId(); >+ if (id == null || id.trim().equals("")) { //$NON-NLS-1$ >+ StatusHandler.log(Messages.XPlannerTaskEditor_NO_TASK_KEY_EXCEPTION, > null); > } > else { >- setUserStoryData(key); >+ setUserStoryData(id); > } > } > catch (CoreException e) { >- MylarStatusHandler.log(e, null); >+ StatusHandler.log(e, null); > } > } > > public void setUserStoryData(String key) { > try { >- this.userStoryData = server.getUserStory(Integer.valueOf(key).intValue()); >+ this.userStoryData = client.getUserStory(Integer.valueOf(key).intValue()); > } > catch (NumberFormatException e) { > e.printStackTrace(); >@@ -129,20 +116,6 @@ > return this.userStoryData; > } > >- public UserStoryData getUserStoryData(XPlannerTask task) throws Exception { >- UserStoryData userStoryDataFromTask = null; >- >- String key = task.getKey(); >- if (key == null || key.trim().equals("")) { //$NON-NLS-1$ >- throw new Exception(Messages.XPlannerTaskEditor_NO_TASK_KEY_EXCEPTION); >- } >- else { >- userStoryDataFromTask = server.getUserStory(Integer.valueOf(key).intValue()); >- } >- >- return userStoryDataFromTask; >- } >- > public boolean isDirty() { > return isDirty; > } >@@ -316,9 +289,9 @@ > String projectName = NO_PROJECT_NAME; > > try { >- IterationData iteration = server.getIteration(userStoryData.getIterationId()); >+ IterationData iteration = client.getIteration(userStoryData.getIterationId()); > if (iteration != null) { >- ProjectData project = server.getProject(iteration.getProjectId()); >+ ProjectData project = client.getProject(iteration.getProjectId()); > if (project != null) { > projectName = project.getName(); > } >@@ -335,7 +308,7 @@ > String iterationName = NO_ITERATION_NAME; > > try { >- IterationData iteration = server.getIteration(userStoryData.getIterationId()); >+ IterationData iteration = client.getIteration(userStoryData.getIterationId()); > if (iteration != null) { > iterationName = iteration.getName(); > } >@@ -364,7 +337,7 @@ > String acceptorName = NO_TRACKER_NAME; > > try { >- PersonData personData = server.getPerson(getUserStoryData().getTrackerId()); >+ PersonData personData = client.getPerson(getUserStoryData().getTrackerId()); > if (personData != null) { > acceptorName = personData.getName(); > } >Index: src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerTaskEditorFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerTaskEditorFactory.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerTaskEditorFactory.java >--- src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerTaskEditorFactory.java 31 May 2007 07:37:12 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerTaskEditorFactory.java 26 Jun 2007 17:41:18 -0000 >@@ -5,18 +5,14 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.editor; >+package org.eclipse.mylyn.xplanner.ui.editor; > >-import org.eclipse.mylar.core.MylarStatusHandler; >-import org.eclipse.mylar.tasks.core.ITask; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.tasks.ui.editors.ITaskEditorFactory; >-import org.eclipse.mylar.tasks.ui.editors.RepositoryTaskEditorInput; >-import org.eclipse.mylar.tasks.ui.editors.TaskEditor; >-import org.eclipse.mylar.tasks.ui.editors.TaskEditorInput; >-import org.eclipse.mylar.xplanner.ui.XPlannerMylarUIPlugin; >-import org.eclipse.mylar.xplanner.ui.XPlannerTask; >+import org.eclipse.mylyn.monitor.core.StatusHandler; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.tasks.ui.editors.*; >+import org.eclipse.mylyn.xplanner.ui.XPlannerMylynUIPlugin; >+import org.eclipse.mylyn.xplanner.ui.XPlannerTask; > import org.eclipse.ui.IEditorInput; > import org.eclipse.ui.IEditorPart; > >@@ -24,55 +20,52 @@ > * @author Ravi Kumar > * @author Helen Bershadskaya > */ >-public class XPlannerTaskEditorFactory implements ITaskEditorFactory { >+public class XPlannerTaskEditorFactory extends AbstractTaskEditorFactory { > >- /* (non-Javadoc) >- * @see org.eclipse.mylar.internal.tasklist.ui.ITaskEditorFactory#canCreateEditorFor(org.eclipse.mylar.provisional.tasklist.ITask) >- */ >- public boolean canCreateEditorFor(ITask task) { >+ public boolean canCreateEditorFor(AbstractTask task) { > return task instanceof XPlannerTask; > } > >- /* (non-Javadoc) >- * @see org.eclipse.mylar.internal.tasklist.ui.ITaskEditorFactory#createEditor(org.eclipse.mylar.internal.tasklist.ui.editors.MylarTaskEditor) >- */ > public IEditorPart createEditor(TaskEditor parentEditor, IEditorInput editorInput) { > IEditorPart editor = null; >+ >+ String kind = null; >+ if (editorInput instanceof RepositoryTaskEditorInput) { >+ RepositoryTaskData taskData = ((RepositoryTaskEditorInput)editorInput).getTaskData(); >+ kind = taskData.getTaskKind(); >+ } >+ else if (editorInput instanceof TaskEditorInput) { >+ AbstractTask task = ((TaskEditorInput)editorInput).getTask(); >+ kind = task.getTaskKind(); >+ } > >- if (editorInput instanceof TaskEditorInput) { >- ITask task = ((TaskEditorInput)editorInput).getTask(); >- if (XPlannerTask.Kind.TASK.toString().equals(task.getTaskKind())) { >- editor = new XPlannerTaskEditor(parentEditor); >- if (editor != null) { >- ((XPlannerTaskEditor)editor).setParentEditor(parentEditor); >- } >- } >- else if (XPlannerTask.Kind.USER_STORY.toString().equals(task.getTaskKind())) { >- editor = new XPlannerUserStoryEditor(parentEditor); >+ if (XPlannerTask.Kind.TASK.toString().equals(kind)) { >+ editor = new XPlannerTaskEditor(parentEditor); >+ if (editor != null) { >+ ((XPlannerTaskEditor)editor).setParentEditor(parentEditor); > } >- } >+ } >+ else if (XPlannerTask.Kind.USER_STORY.toString().equals(kind)) { >+ editor = new XPlannerUserStoryEditor(parentEditor); >+ } > > return editor; > } > >- /* (non-Javadoc) >- * @see org.eclipse.mylar.internal.tasklist.ui.ITaskEditorFactory#createEditorInput(org.eclipse.mylar.provisional.tasklist.ITask) >- */ >- public IEditorInput createEditorInput(ITask task) { >+ public IEditorInput createEditorInput(AbstractTask task) { > IEditorInput input = null; > > if (task instanceof XPlannerTask) { > XPlannerTask xplannerTask = (XPlannerTask) task; > > final TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository( >- xplannerTask.getRepositoryKind(), xplannerTask.getRepositoryUrl()); >+ xplannerTask.getConnectorKind(), xplannerTask.getRepositoryUrl()); > try { > input = new RepositoryTaskEditorInput(repository, >- xplannerTask.getHandleIdentifier(), xplannerTask.getTaskUrl(), >- xplannerTask.getTaskId()); >+ xplannerTask.getTaskId(), xplannerTask.getUrl()); > } > catch (Exception e) { >- MylarStatusHandler.fail(e, Messages.XPlannerTaskEditorFactory_COULD_NOT_CREATE_EDITOR_INPUT, true); >+ StatusHandler.fail(e, Messages.XPlannerTaskEditorFactory_COULD_NOT_CREATE_EDITOR_INPUT, true); > } > > } >@@ -80,22 +73,10 @@ > return input; > } > >- /* (non-Javadoc) >- * @see org.eclipse.mylar.internal.tasklist.ui.ITaskEditorFactory#getTitle() >- */ > public String getTitle() { > return Messages.XPlannerTaskEditorFactory_TITLE; > } > >- /* (non-Javadoc) >- * @see org.eclipse.mylar.internal.tasklist.ui.ITaskEditorFactory#notifyEditorActivationChange(org.eclipse.ui.IEditorPart) >- */ >- public void notifyEditorActivationChange(IEditorPart editor) { >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.mylar.internal.tasklist.ui.ITaskEditorFactory#providesOutline() >- */ > public boolean providesOutline() { > return true; > } >@@ -104,7 +85,7 @@ > if (input instanceof RepositoryTaskEditorInput) { > RepositoryTaskEditorInput existingInput = (RepositoryTaskEditorInput) input; > return existingInput.getTaskData() != null >- && XPlannerMylarUIPlugin.REPOSITORY_KIND.equals(existingInput.getRepository().getKind()); >+ && XPlannerMylynUIPlugin.REPOSITORY_KIND.equals(existingInput.getRepository().getConnectorKind()); > } > return false; > } >Index: src/org/eclipse/mylyn/xplanner/ui/editor/messages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/editor/messages.properties,v >retrieving revision 1.1 >diff -u -r1.1 messages.properties >--- src/org/eclipse/mylyn/xplanner/ui/editor/messages.properties 31 May 2007 07:37:12 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/editor/messages.properties 26 Jun 2007 17:41:18 -0000 >@@ -9,7 +9,7 @@ > XPlannerUserStoryEditor_TRACKER_LABEL=Tracker: > XPlannerTaskEditor_ACCEPTOR_TEXT=Acceptor : > XPlannerTaskEditor_ESTIMATED_HOURS_TEXT=Estimated Hours : >-XPlannerTaskEditor_HelpSearchExpression=Mylar or XPlanner >+XPlannerTaskEditor_HelpSearchExpression=Mylyn or XPlanner > XPlannerUserStoryEditor_NO_TRACKER_NAME=<no tracker name> > XPlannerUserStoryEditor_PRIORITY_LABEL=Priority: > XPlannerTaskEditorFactory_TITLE=XPlanner >Index: src/org/eclipse/mylyn/xplanner/ui/editor/Messages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/editor/Messages.java,v >retrieving revision 1.1 >diff -u -r1.1 Messages.java >--- src/org/eclipse/mylyn/xplanner/ui/editor/Messages.java 31 May 2007 07:37:12 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/editor/Messages.java 26 Jun 2007 17:41:18 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.editor; >+package org.eclipse.mylyn.xplanner.ui.editor; > > import org.eclipse.osgi.util.NLS; > >@@ -14,7 +14,7 @@ > * @author Helen Bershadskaya > */ > public class Messages extends NLS { >- private static final String BUNDLE_NAME = "org.eclipse.mylar.xplanner.ui.editor.messages"; //$NON-NLS-1$ >+ private static final String BUNDLE_NAME = "org.eclipse.mylyn.xplanner.ui.editor.messages"; //$NON-NLS-1$ > > public static String XPlannerTaskEditor_ACCEPTOR_TEXT; > >Index: src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerTaskEditor.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerTaskEditor.java >--- src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerTaskEditor.java 31 May 2007 07:37:12 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/editor/XPlannerTaskEditor.java 26 Jun 2007 17:41:18 -0000 >@@ -5,38 +5,23 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.editor; >+package org.eclipse.mylyn.xplanner.ui.editor; > > import java.text.MessageFormat; > > import org.eclipse.jface.layout.GridDataFactory; > import org.eclipse.jface.resource.JFaceResources; >-import org.eclipse.mylar.tasks.core.ITask; >-import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute; >-import org.eclipse.mylar.tasks.core.RepositoryTaskData; >-import org.eclipse.mylar.tasks.ui.editors.AbstractRepositoryTaskEditor; >-import org.eclipse.mylar.xplanner.ui.XPlannerMylarUIPlugin; >-import org.eclipse.mylar.xplanner.ui.XPlannerAttributeFactory; >-import org.eclipse.mylar.xplanner.ui.XPlannerRepositoryUtils; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractRepositoryTaskEditor; >+import org.eclipse.mylyn.xplanner.ui.*; > import org.eclipse.swt.SWT; >-import org.eclipse.swt.events.ModifyEvent; >-import org.eclipse.swt.events.ModifyListener; >-import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.events.SelectionListener; >-import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.events.*; > import org.eclipse.swt.layout.GridLayout; >-import org.eclipse.swt.widgets.Button; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Label; >-import org.eclipse.swt.widgets.Text; >-import org.eclipse.swt.widgets.Tree; >-import org.eclipse.swt.widgets.TreeItem; >+import org.eclipse.swt.widgets.*; > import org.eclipse.ui.IEditorInput; > import org.eclipse.ui.IEditorSite; > import org.eclipse.ui.forms.editor.FormEditor; >-import org.eclipse.ui.forms.widgets.ExpandableComposite; >-import org.eclipse.ui.forms.widgets.FormToolkit; >-import org.eclipse.ui.forms.widgets.Section; >+import org.eclipse.ui.forms.widgets.*; > > /** > * @author Ravi Kumar >@@ -77,25 +62,25 @@ > submitButton.setEnabled(isValid); > } > >- protected Composite createAttributeLayout(Composite composite) { >- FormToolkit toolkit = new FormToolkit(composite.getDisplay()); >- Section section = createSection(composite, Messages.XPlannerTaskEditor_ATTRIBUTES_TITLE); >- section.setExpanded(true); >- // Attributes Composite- this holds all the combo fields and text fields >- Composite attributesComposite = toolkit.createComposite(section); >- GridLayout attributesLayout = new GridLayout(); >- attributesComposite.setLayout(attributesLayout); >- GridData attributesData = new GridData(GridData.FILL_BOTH); >- attributesData.horizontalSpan = 1; >- attributesData.grabExcessVerticalSpace = false; >- attributesComposite.setLayoutData(attributesData); >- section.setClient(attributesComposite); >- >- return attributesComposite; >+//HeB -- testing >+ protected void createAttributeLayout(Composite composite) { >+// super.createAttributeLayout(composite); >+// FormToolkit toolkit = new FormToolkit(composite.getDisplay()); >+// Section section = createSection(composite, Messages.XPlannerTaskEditor_ATTRIBUTES_TITLE); >+// section.setExpanded(true); >+// // Attributes Composite- this holds all the combo fields and text fields >+// Composite attributesComposite = toolkit.createComposite(section); >+// GridLayout attributesLayout = new GridLayout(); >+// attributesComposite.setLayout(attributesLayout); >+// GridData attributesData = new GridData(GridData.FILL_BOTH); >+// attributesData.horizontalSpan = 1; >+// attributesData.grabExcessVerticalSpace = false; >+// attributesComposite.setLayoutData(attributesData); >+// section.setClient(attributesComposite); > } > > @Override >- protected void addAttachContextButton(Composite buttonComposite, ITask task) { >+ protected void addAttachContextButton(Composite buttonComposite, AbstractTask task) { > // disabled, see bug 155151 > } > >@@ -116,15 +101,18 @@ > > @Override > protected void createCustomAttributeLayout(Composite composite) { >+ // make sure we only use one column >+ if (composite.getLayout() instanceof GridLayout) { >+ GridLayout layout = (GridLayout)composite.getLayout(); >+ layout.numColumns = 1; >+ } >+ > createPartControlCustom(composite); > } > >+ // just in case, leave in method -- before had to get from editorInput > public RepositoryTaskData getRepositoryTaskData() { >- return editorInput.getTaskData(); >- } >- >- protected void updateBug() { >- getRepositoryTaskData().setHasLocalChanges(true); >+ return taskData; > } > > public boolean isDirty() { >@@ -289,6 +277,6 @@ > } > > public String getPluginId() { >- return XPlannerMylarUIPlugin.PLUGIN_ID; >+ return XPlannerMylynUIPlugin.PLUGIN_ID; > } > } >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/ProjectsViewerLabelProvider.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/ProjectsViewerLabelProvider.java,v >retrieving revision 1.1 >diff -u -r1.1 ProjectsViewerLabelProvider.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/ProjectsViewerLabelProvider.java 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/ProjectsViewerLabelProvider.java 26 Jun 2007 17:41:19 -0000 >@@ -5,14 +5,12 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import org.eclipse.jface.viewers.LabelProvider; >-import org.eclipse.mylar.xplanner.ui.XPlannerImages; >+import org.eclipse.mylyn.xplanner.ui.XPlannerImages; > import org.eclipse.swt.graphics.Image; >-import org.xplanner.soap.IterationData; >-import org.xplanner.soap.ProjectData; >-import org.xplanner.soap.UserStoryData; >+import org.xplanner.soap.*; > > > /** >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerRepositorySettingsPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerRepositorySettingsPage.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerRepositorySettingsPage.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerRepositorySettingsPage.java 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerRepositorySettingsPage.java 26 Jun 2007 17:41:19 -0000 >@@ -5,20 +5,17 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import java.net.MalformedURLException; > import java.net.URL; > >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi; >-import org.eclipse.mylar.tasks.ui.wizards.AbstractRepositorySettingsPage; >-import org.eclipse.mylar.xplanner.ui.XPlannerMylarUIPlugin; >-import org.eclipse.mylar.xplanner.ui.XPlannerRepositoryUtils; >+import org.eclipse.core.runtime.*; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi; >+import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage; >+import org.eclipse.mylyn.xplanner.ui.XPlannerMylynUIPlugin; >+import org.eclipse.mylyn.xplanner.ui.XPlannerRepositoryUtils; > import org.eclipse.swt.widgets.Composite; > > >@@ -39,7 +36,8 @@ > > public XPlannerRepositorySettingsPage(AbstractRepositoryConnectorUi connectorUi) { > super(TITLE, DESCRIPTION, connectorUi); >- setNeedsProxy(false); >+ setNeedsProxy(true); >+ setNeedsHttpAuth(true); > } > > protected void createAdditionalControls(Composite parent) { >@@ -76,7 +74,7 @@ > public void run(IProgressMonitor monitor) throws CoreException { > XPlannerRepositoryUtils.validateRepository(repository); > >- setStatus(new Status(IStatus.OK, XPlannerMylarUIPlugin.PLUGIN_ID, IStatus.OK, >+ setStatus(new Status(IStatus.OK, XPlannerMylynUIPlugin.PLUGIN_ID, IStatus.OK, > Messages.XPlannerRepositorySettingsPage_VALID_SETTINGS_FOUND, null)); > } > } >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/MultipleQueryPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/MultipleQueryPage.java,v >retrieving revision 1.1 >diff -u -r1.1 MultipleQueryPage.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/MultipleQueryPage.java 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/MultipleQueryPage.java 26 Jun 2007 17:41:18 -0000 >@@ -5,11 +5,11 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import java.util.List; > >-import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >+import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; > > /** > * @author Ravi Kumar >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/ExistingXPlannerTaskWizardPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/ExistingXPlannerTaskWizardPage.java,v >retrieving revision 1.1 >diff -u -r1.1 ExistingXPlannerTaskWizardPage.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/ExistingXPlannerTaskWizardPage.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/ExistingXPlannerTaskWizardPage.java 26 Jun 2007 17:41:18 -0000 >@@ -5,9 +5,9 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > >-import org.eclipse.mylar.internal.tasks.ui.wizards.ExistingTaskWizardPage; >+import org.eclipse.mylyn.internal.tasks.ui.wizards.ExistingTaskWizardPage; > > /** > * @author Ravi Kumar >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/EditXPlannerQueryWizard.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/EditXPlannerQueryWizard.java,v >retrieving revision 1.1 >diff -u -r1.1 EditXPlannerQueryWizard.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/EditXPlannerQueryWizard.java 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/EditXPlannerQueryWizard.java 26 Jun 2007 17:41:18 -0000 >@@ -5,17 +5,15 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import java.util.ArrayList; > import java.util.List; > >-import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.tasks.ui.wizards.AbstractEditQueryWizard; >-import org.eclipse.mylar.xplanner.ui.XPlannerCustomQuery; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.tasks.ui.wizards.AbstractEditQueryWizard; >+import org.eclipse.mylyn.xplanner.ui.XPlannerCustomQuery; > > > /** >@@ -74,9 +72,10 @@ > } > TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query); > >- AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >+ AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getConnectorKind()); > if (connector != null) { >- TasksUiPlugin.getSynchronizationManager().synchronize(connector, query, null); >+ TasksUiPlugin.getSynchronizationManager().synchronize( >+ connector, query, null, true); > } > } > >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/ProjectsViewerContentProvider.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/ProjectsViewerContentProvider.java,v >retrieving revision 1.1 >diff -u -r1.1 ProjectsViewerContentProvider.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/ProjectsViewerContentProvider.java 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/ProjectsViewerContentProvider.java 26 Jun 2007 17:41:18 -0000 >@@ -5,18 +5,16 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import java.rmi.RemoteException; > import java.util.HashMap; > > import org.eclipse.jface.viewers.ITreeContentProvider; > import org.eclipse.jface.viewers.Viewer; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.ui.XPlannerMylarUIPlugin; >-import org.xplanner.soap.IterationData; >-import org.xplanner.soap.ProjectData; >-import org.xplanner.soap.UserStoryData; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.ui.XPlannerMylynUIPlugin; >+import org.xplanner.soap.*; > > /** > * @author Ravi Kumar >@@ -42,11 +40,11 @@ > try { > if (element instanceof IterationData) { > IterationData iteration = (IterationData) element; >- parent = customQueryPage.getServer().getProject(iteration.getProjectId()); >+ parent = customQueryPage.getClient().getProject(iteration.getProjectId()); > } > else if (element instanceof UserStoryData) { > UserStoryData userStory = (UserStoryData) element; >- parent = customQueryPage.getServer().getIteration(userStory.getIterationId()); >+ parent = customQueryPage.getClient().getIteration(userStory.getIterationId()); > } > } > catch (RemoteException e) { >@@ -86,7 +84,7 @@ > private ProjectData[] getProjects() { > if (projects == null) { > try { >- projects = customQueryPage.getServer().getProjects(); >+ projects = customQueryPage.getClient().getProjects(); > } > catch (RemoteException e) { > e.printStackTrace(); >@@ -101,7 +99,7 @@ > > if (iterations == null) { > try { >- iterations = customQueryPage.getServer().getIterations(project.getId()); >+ iterations = customQueryPage.getClient().getIterations(project.getId()); > projectsToIterationsMap.put(project, iterations); > } > catch (RemoteException e) { >@@ -119,7 +117,7 @@ > userStories = iterationsToUserStoriesMap.get(iteration); > if (userStories == null) { > try { >- userStories = customQueryPage.getServer().getUserStories(iteration.getId()); >+ userStories = customQueryPage.getClient().getUserStories(iteration.getId()); > iterationsToUserStoriesMap.put(iteration, userStories); > } > catch (RemoteException e) { >@@ -150,10 +148,10 @@ > customQueryPage.getProjectsViewer().replace(parent, index, element); > customQueryPage.getProjectsViewer().setChildCount(parent, getChildCount(parent)); > try { >- customQueryPage.getProjectsViewer().setChildCount(element, getChildCount(element)); >+ customQueryPage.getProjectsViewer().setChildCount(element, getChildCount(element)); > } > catch (Exception e) { >- XPlannerMylarUIPlugin.log(e.getCause(), "Could not update project element child count", true); >+ XPlannerMylynUIPlugin.log(e.getCause(), Messages.ProjectsViewerContentProvider_COULD_NOT_UPDATE_PROJECT_ELEMENT_CHILD_COUNT, true); > } > } > } >@@ -172,7 +170,7 @@ > private Object[] getXPlannerChildren(Object element) { > Object[] children = new Object[0]; > >- if (element == null || element instanceof XPlannerServer) { >+ if (element == null || element instanceof XPlannerClient) { > children = getProjects(); > } > else if (element instanceof ProjectData) { >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/messages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/messages.properties,v >retrieving revision 1.1 >diff -u -r1.1 messages.properties >--- src/org/eclipse/mylyn/xplanner/ui/wizard/messages.properties 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/messages.properties 26 Jun 2007 17:41:19 -0000 >@@ -30,3 +30,4 @@ > ExistingXPlannerTaskWizardPage_ENTER_XPLANNER_IDENTIFIER=Enter the XPlanner identifier for the iteration, user story or task. > ProjectsViewerLabelProvider_NO_NAME=<no name> > AbstractXPlannerQueryWizardPage_NEW_XPLANNER_QUERY=New XPlanner Query >+ProjectsViewerContentProvider_COULD_NOT_UPDATE_PROJECT_ELEMENT_CHILD_COUNT=Could not update project element child count >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/NewXPlannerQueryWizard.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/NewXPlannerQueryWizard.java,v >retrieving revision 1.1 >diff -u -r1.1 NewXPlannerQueryWizard.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/NewXPlannerQueryWizard.java 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/NewXPlannerQueryWizard.java 26 Jun 2007 17:41:18 -0000 >@@ -5,22 +5,19 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import java.util.HashSet; > import java.util.List; > > import org.eclipse.core.runtime.jobs.Job; > import org.eclipse.jface.wizard.Wizard; >-import org.eclipse.mylar.internal.tasks.ui.TasksUiImages; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; > > /** >- * Wizard that allows the user to select one of their named XPlanner filters on the >- * server >+ * Wizard that allows the user to create an XPlanner query for tasks > * > * @author Ravi Kumar > * @author Helen Bershadskaya >@@ -54,10 +51,11 @@ > } > > // need to synchronize multiple queries with single call, otherwise get ConcurrencyModificationException >- AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >+ AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getConnectorKind()); > if (connector != null) { >- TasksUiPlugin.getSynchronizationManager().synchronize(connector, >- new HashSet<AbstractRepositoryQuery>(queries), null, Job.SHORT, 0, true); >+ TasksUiPlugin.getSynchronizationManager().synchronize( >+ connector, repository, >+ new HashSet<AbstractRepositoryQuery>(queries), null, Job.LONG, 0, true); > } > } > else { >@@ -71,9 +69,9 @@ > public static void addQuery(AbstractRepositoryQuery query, TaskRepository repository) { > if (query != null) { > TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query); >- AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >+ AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getConnectorKind()); > if (connector != null) { >- TasksUiPlugin.getSynchronizationManager().synchronize(connector, query, null); >+ TasksUiPlugin.getSynchronizationManager().synchronize(connector, query, null, true); > } > } > } >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerQuerySelectionWizardPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerQuerySelectionWizardPage.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerQuerySelectionWizardPage.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerQuerySelectionWizardPage.java 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerQuerySelectionWizardPage.java 26 Jun 2007 17:41:19 -0000 >@@ -5,12 +5,12 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import org.eclipse.jface.wizard.IWizardPage; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.xplanner.ui.XPlannerCustomQuery; >+import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.xplanner.ui.XPlannerCustomQuery; > import org.eclipse.swt.SWT; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; >@@ -19,8 +19,7 @@ > > > /** >- * Wizard page that allows the user to select a named XPlanner filter they have >- * defined on the server. >+ * Wizard page that allows the user to select a query of tasks from the XPlanner server. > * > * @author Ravi Kumar > * @author Helen Bershadskaya >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerQueryWizardUtils.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerQueryWizardUtils.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerQueryWizardUtils.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerQueryWizardUtils.java 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerQueryWizardUtils.java 26 Jun 2007 17:41:19 -0000 >@@ -5,13 +5,13 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.jface.wizard.Wizard; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.xplanner.ui.XPlannerMylarUIPlugin; >-import org.eclipse.mylar.xplanner.ui.XPlannerCustomQuery; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.xplanner.ui.XPlannerCustomQuery; >+import org.eclipse.mylyn.xplanner.ui.XPlannerMylynUIPlugin; > > > /** >@@ -46,7 +46,7 @@ > } > catch (RuntimeException e) { > if (e.getCause() instanceof CoreException) { >- XPlannerMylarUIPlugin.log(e.getCause(), Messages.XPlannerQueryWizardUtils_COULD_NOT_CREATE_QUERY_PAGE_MESSAGE, true); >+ XPlannerMylynUIPlugin.log(e.getCause(), Messages.XPlannerQueryWizardUtils_COULD_NOT_CREATE_QUERY_PAGE_MESSAGE, true); > } > else { > throw e; >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/AbstractXPlannerQueryWizardPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/AbstractXPlannerQueryWizardPage.java,v >retrieving revision 1.1 >diff -u -r1.1 AbstractXPlannerQueryWizardPage.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/AbstractXPlannerQueryWizardPage.java 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/AbstractXPlannerQueryWizardPage.java 26 Jun 2007 17:41:18 -0000 >@@ -5,12 +5,12 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > >-import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.search.AbstractRepositoryQueryPage; >-import org.eclipse.mylar.xplanner.ui.XPlannerCustomQuery; >+import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.ui.search.AbstractRepositoryQueryPage; >+import org.eclipse.mylyn.xplanner.ui.XPlannerCustomQuery; > import org.eclipse.ui.PlatformUI; > > >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/Messages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/Messages.java,v >retrieving revision 1.1 >diff -u -r1.1 Messages.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/Messages.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/Messages.java 26 Jun 2007 17:41:18 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import org.eclipse.osgi.util.NLS; > >@@ -14,7 +14,7 @@ > * @author Helen Bershadskaya > */ > public class Messages extends NLS { >- private static final String BUNDLE_NAME = "org.eclipse.mylar.xplanner.ui.wizard.messages"; //$NON-NLS-1$ >+ private static final String BUNDLE_NAME = "org.eclipse.mylyn.xplanner.ui.wizard.messages"; //$NON-NLS-1$ > > public static String AbstractXPlannerQueryWizardPage_NEW_XPLANNER_QUERY; > >@@ -34,6 +34,8 @@ > > public static String NewXPlannerTaskPage_ONCE_SUBMITTED_SYNCHRONIZE_QUERIES; > >+ public static String ProjectsViewerContentProvider_COULD_NOT_UPDATE_PROJECT_ELEMENT_CHILD_COUNT; >+ > public static String ProjectsViewerLabelProvider_NO_NAME; > > public static String XPlannerCustomQueryPage_ALL_BUTTON; >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/NewXPlannerTaskPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/NewXPlannerTaskPage.java,v >retrieving revision 1.1 >diff -u -r1.1 NewXPlannerTaskPage.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/NewXPlannerTaskPage.java 31 May 2007 07:37:09 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/NewXPlannerTaskPage.java 26 Jun 2007 17:41:18 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import org.eclipse.jface.wizard.WizardPage; > import org.eclipse.swt.SWT; >Index: src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerCustomQueryPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerCustomQueryPage.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerCustomQueryPage.java >--- src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerCustomQueryPage.java 31 May 2007 07:37:10 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/ui/wizard/XPlannerCustomQueryPage.java 26 Jun 2007 17:41:19 -0000 >@@ -5,43 +5,26 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.ui.wizard; >+package org.eclipse.mylyn.xplanner.ui.wizard; > > import java.rmi.RemoteException; >-import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.Iterator; >+import java.util.*; > import java.util.List; > > import org.eclipse.core.runtime.CoreException; >-import org.eclipse.jface.viewers.ISelectionChangedListener; >-import org.eclipse.jface.viewers.SelectionChangedEvent; >-import org.eclipse.jface.viewers.StructuredSelection; >-import org.eclipse.jface.viewers.TreeViewer; >+import org.eclipse.jface.viewers.*; > import org.eclipse.jface.wizard.IWizardPage; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.ui.XPlannerCustomQuery; >-import org.eclipse.mylar.xplanner.ui.XPlannerServerFacade; >+import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.ui.XPlannerCustomQuery; >+import org.eclipse.mylyn.xplanner.ui.XPlannerClientFacade; > import org.eclipse.swt.SWT; >-import org.eclipse.swt.events.FocusAdapter; >-import org.eclipse.swt.events.FocusEvent; >-import org.eclipse.swt.events.ModifyEvent; >-import org.eclipse.swt.events.ModifyListener; >-import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.events.*; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; >-import org.eclipse.swt.widgets.Button; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Label; >-import org.eclipse.swt.widgets.Text; >-import org.xplanner.soap.IterationData; >-import org.xplanner.soap.ProjectData; >-import org.xplanner.soap.TaskData; >-import org.xplanner.soap.UserStoryData; >+import org.eclipse.swt.widgets.*; >+import org.xplanner.soap.*; > > /** > * @author Ravi Kumar >@@ -54,7 +37,7 @@ > > private static final boolean DEFAULT_SELECT_MY_CURRENT_TASKS = true; > >- private final XPlannerServer server; >+ private final XPlannerClient client; > > private Text nameText; > >@@ -83,12 +66,12 @@ > /** > * @param pageName > * @param title >- * @param titleImage >+ * @param titleImage > */ > public XPlannerCustomQueryPage(TaskRepository repository, XPlannerCustomQuery existingQuery) { > super(repository, existingQuery); > try { >- this.server = XPlannerServerFacade.getDefault().getXPlannerServer(repository); >+ this.client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); > setPageComplete(false); > } > catch (CoreException e) { >@@ -131,8 +114,8 @@ > setControl(dataComposite); > } > >- protected XPlannerServer getServer() { >- return this.server; >+ protected XPlannerClient getClient() { >+ return this.client; > } > > protected boolean isContentTypeTask() { >@@ -254,7 +237,7 @@ > projectsViewerGridData.widthHint = 200; > > projectsViewer.getTree().setLayoutData(projectsViewerGridData); >- projectsViewer.setInput(server); >+ projectsViewer.setInput(client); > projectsViewer.refresh(); > projectsViewer.addSelectionChangedListener(new ISelectionChangedListener() { > public void selectionChanged(SelectionChangedEvent e) { >@@ -484,13 +467,13 @@ > for (int contentId : contentIds) { > try { > if (contentIdType == XPlannerCustomQuery.ContentIdType.PROJECT) { >- selection.add(server.getProject(contentId)); >+ selection.add(client.getProject(contentId)); > } > else if (contentIdType == XPlannerCustomQuery.ContentIdType.ITERATION) { >- selection.add(server.getIteration(contentId)); >+ selection.add(client.getIteration(contentId)); > } > else if (contentIdType == XPlannerCustomQuery.ContentIdType.USER_STORY) { >- selection.add(server.getUserStory(contentId)); >+ selection.add(client.getUserStory(contentId)); > } > } > catch (RemoteException e) { >@@ -501,7 +484,7 @@ > return selection; > } > >- //TODO -- should be in server interface >+ //TODO -- should be in client interface > private boolean isUseAll() { > return allTasksOrStoriesButton.getSelection(); > } >@@ -525,7 +508,7 @@ > > // use all? > if (!isUseAll()) { >- query.setPersonId(server.getCurrentPersonId()); >+ query.setPersonId(client.getCurrentPersonId()); > } > else { > query.setPersonId(XPlannerCustomQuery.INVALID_ID); >@@ -596,7 +579,7 @@ > // int userStoryId = ((UserStoryData)selectedElement).getId(); > // if (userStoryId != XPlannerCustomQuery.INVALID_ID) { > // try { >-// userStory = server.getUserStory(userStoryId); >+// userStory = client.getUserStory(userStoryId); > // } > // catch (RemoteException e) { > // e.printStackTrace(); >@@ -613,8 +596,7 @@ > > public AbstractRepositoryQuery getQuery() { > if (getExistingQuery() == null) { >- setExistingQuery(new XPlannerCustomQuery(getRepository().getUrl(), getNameText(), >- TasksUiPlugin.getTaskListManager().getTaskList())); >+ setExistingQuery(new XPlannerCustomQuery(getRepository().getUrl(), getNameText())); > } > > applyChanges(getExistingQuery()); >@@ -631,8 +613,7 @@ > if (isContentTypeTask()) { > // if don't have existing query, create one > if (getExistingQuery() == null) { >- setExistingQuery(new XPlannerCustomQuery(getRepository().getUrl(), getNameText(), >- TasksUiPlugin.getTaskListManager().getTaskList())); >+ setExistingQuery(new XPlannerCustomQuery(getRepository().getUrl(), getNameText())); > } > > applyChanges(getExistingQuery()); >@@ -654,14 +635,14 @@ > > try { > if (selectedElement instanceof ProjectData) { >- IterationData[] iterations = server.getIterations( >+ IterationData[] iterations = client.getIterations( > ((ProjectData)selectedElement).getId()); > for (IterationData iteration : iterations) { >- userStories.addAll(Arrays.asList(server.getUserStories(iteration.getId()))); >+ userStories.addAll(Arrays.asList(client.getUserStories(iteration.getId()))); > } > } > else if (selectedElement instanceof IterationData) { >- userStories.addAll(Arrays.asList(server.getUserStories( >+ userStories.addAll(Arrays.asList(client.getUserStories( > ((IterationData)selectedElement).getId()))); > } > else if (selectedElement instanceof UserStoryData) { >@@ -684,13 +665,13 @@ > } > > ArrayList<AbstractRepositoryQuery> queries = new ArrayList<AbstractRepositoryQuery>(); >- int personId = server.getCurrentPersonId(); >+ int personId = client.getCurrentPersonId(); > for (UserStoryData userStory : userStories) { > boolean createQuery = true; > // if want user specific tasks, only create queries for stories with tasks for > // that person > if (!isUseAll()) { >- TaskData[] personUserStoryTasks = server.getUserStoryTasksForPerson(personId, userStory.getId()); >+ TaskData[] personUserStoryTasks = client.getUserStoryTasksForPerson(personId, userStory.getId()); > if (personUserStoryTasks == null || personUserStoryTasks.length == 0) { > createQuery = false; > } >@@ -704,8 +685,7 @@ > } > > XPlannerCustomQuery query = new XPlannerCustomQuery( >- getRepository().getUrl(), queryName, >- TasksUiPlugin.getTaskListManager().getTaskList()); >+ getRepository().getUrl(), queryName); > > applyChanges(query); > query.setQueryName(queryName); >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/plugin.xml,v >retrieving revision 1.1 >diff -u -r1.1 plugin.xml >--- plugin.xml 31 May 2007 07:37:09 -0000 1.1 >+++ plugin.xml 26 Jun 2007 17:41:18 -0000 >@@ -3,54 +3,41 @@ > <plugin> > > <extension >- id="org.eclipse.mylar.xplanner.repository" >+ id="org.eclipse.mylyn.xplanner.repository" > name="%repositoryName" >- point="org.eclipse.mylar.tasks.ui.repositories"> >+ point="org.eclipse.mylyn.tasks.ui.repositories"> > > <connectorCore >- class="org.eclipse.mylar.xplanner.ui.XPlannerRepositoryConnector" >- id="org.eclipse.mylar.xplanner.tasklist.repositories" >+ class="org.eclipse.mylyn.xplanner.ui.XPlannerRepositoryConnector" >+ id="org.eclipse.mylyn.xplanner.tasklist.repositories" > name="%connectorName" > type="xPlanner"/> > <connectorUi > brandingIcon="icons/eview16/xplanner-logo.gif" >- class="org.eclipse.mylar.xplanner.ui.XPlannerRepositoryUi" >+ class="org.eclipse.mylyn.xplanner.ui.XPlannerRepositoryUi" > name="%connectorUiName" > overlayIcon="icons/eview16/overlay-xplanner.gif"/> > >- <externalizer >- class="org.eclipse.mylar.xplanner.ui.XPlannerTaskExternalizer" >- id="org.eclipse.mylar.xplanner.tasklist.externalizer"/> >+ <taskListFactory >+ class="org.eclipse.mylyn.xplanner.ui.XPlannerTaskListFactory" >+ id="org.eclipse.mylyn.xplanner.tasklist.taskListFactory"/> > </extension> > >- <extension point="org.eclipse.ui.decorators"> >- <decorator >- class="org.eclipse.mylar.xplanner.ui.XPlannerTaskDecorator" >- id="org.eclipse.mylar.xplanner.ui.decorator.task" >- label="%decoratorLabelTask" >- lightweight="true" >- state="true"> >- <description>%decoratorDescriptionTask</description> >- <enablement> >- <objectClass name="org.eclipse.mylar.tasks.core.ITaskListElement"/> >- </enablement> >- </decorator> >- </extension> > <!-- > <extension > point="org.eclipse.ui.editors"> > <editor >- class="org.eclipse.mylar.xplanner.ui.XPlannerTaskEditor" >+ class="org.eclipse.mylyn.xplanner.ui.XPlannerTaskEditor" > default="false" >- id="org.eclipse.mylar.xplanner.task.editor" >+ id="org.eclipse.mylyn.xplanner.task.editor" > name="%editorNameTask"/> > </extension> > --> > <extension >- point="org.eclipse.mylar.tasks.ui.editors"> >+ point="org.eclipse.mylyn.tasks.ui.editors"> > <editorFactory >- class="org.eclipse.mylar.xplanner.ui.editor.XPlannerTaskEditorFactory" >- id="org.eclipse.mylar.xplanner.ui.XPlannerTaskEditorFactory"/> >+ class="org.eclipse.mylyn.xplanner.ui.editor.XPlannerTaskEditorFactory" >+ id="org.eclipse.mylyn.xplanner.ui.XPlannerTaskEditorFactory"/> > </extension> > > </plugin> >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/plugin.properties,v >retrieving revision 1.1 >diff -u -r1.1 plugin.properties >--- plugin.properties 31 May 2007 07:37:09 -0000 1.1 >+++ plugin.properties 26 Jun 2007 17:41:18 -0000 >@@ -1,8 +1,8 @@ >-bundleName=Mylar Connector for XPlanner >+bundleName=Mylyn XPlanner UI Plug-in > bundleVendor=Eclipse.org > repositoryName=XPlanner Repository > connectorName=XPlanner Repository Connector > connectorUiName=XPlanner Repository UI >-decoratorLabelTask=Mylar XPlanner Task Decorator >-decoratorDescriptionTask=Mylar XPlanner Task Decorator >+decoratorLabelTask=Mylyn XPlanner Task Decorator >+decoratorDescriptionTask=Mylyn XPlanner Task Decorator > editorNameTask=XPlanner Task Editor >Index: .project >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/.project,v >retrieving revision 1.2 >diff -u -r1.2 .project >--- .project 12 Jun 2007 14:26:38 -0000 1.2 >+++ .project 26 Jun 2007 17:41:18 -0000 >@@ -22,7 +22,9 @@ > </buildCommand> > </buildSpec> > <natures> >+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> > <nature>org.eclipse.pde.PluginNature</nature> > <nature>org.eclipse.jdt.core.javanature</nature> >+ <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> > </natures> > </projectDescription> >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.1 >diff -u -r1.1 MANIFEST.MF >--- META-INF/MANIFEST.MF 31 May 2007 07:37:14 -0000 1.1 >+++ META-INF/MANIFEST.MF 26 Jun 2007 17:41:18 -0000 >@@ -1,9 +1,9 @@ > Manifest-Version: 1.0 > Bundle-ManifestVersion: 2 > Bundle-Name: %bundleName >-Bundle-SymbolicName: org.eclipse.mylar.xplanner.ui;singleton:=true >+Bundle-SymbolicName: org.eclipse.mylyn.xplanner.ui;singleton:=true > Bundle-Version: 2.0.0.qualifier >-Bundle-Activator: org.eclipse.mylar.xplanner.ui.XPlannerMylarUIPlugin >+Bundle-Activator: org.eclipse.mylyn.xplanner.ui.XPlannerMylynUIPlugin > Bundle-Vendor: %bundleVendor > Bundle-Localization: plugin > Require-Bundle: org.eclipse.ui, >@@ -13,11 +13,12 @@ > org.eclipse.search, > org.eclipse.ui.forms, > org.eclipse.help, >- org.eclipse.mylar.xplanner.core, >- org.eclipse.mylar.tasks.ui, >- org.eclipse.mylar.context.core, >- org.eclipse.mylar.tasks.core, >- org.eclipse.mylar >+ org.eclipse.mylyn.xplanner.core, >+ org.eclipse.mylyn.tasks.ui, >+ org.eclipse.mylyn.context.core, >+ org.eclipse.mylyn.tasks.core, >+ org.eclipse.mylyn, >+ org.eclipse.mylyn.monitor.core > Eclipse-LazyStart: true >-Export-Package: org.eclipse.mylar.xplanner.ui, >- org.eclipse.mylar.xplanner.ui.wizard >+Export-Package: org.eclipse.mylyn.xplanner.ui, >+ org.eclipse.mylyn.xplanner.ui.wizard >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskListFactory.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskListFactory.java >diff -N src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskListFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskListFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,278 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 - 2007 CodeGear 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 >+ *******************************************************************************/ >+package org.eclipse.mylyn.xplanner.ui; >+ >+import java.util.*; >+ >+import org.eclipse.mylyn.tasks.core.*; >+import org.w3c.dom.Element; >+import org.w3c.dom.Node; >+ >+/** >+ * @author Ravi Kumar >+ * @author Helen Bershadskaya >+ */ >+public class XPlannerTaskListFactory extends AbstractTaskListFactory { >+ >+ private static final String TOKEN_SEPARATOR = ";"; //$NON-NLS-1$ >+ >+ private static final String KEY_XPLANNER = "XPlanner"; //$NON-NLS-1$ >+ >+ private static final String KEY_CUSTOM = "XPlannerCustom"; //$NON-NLS-1$ >+ >+ private static final String KEY_XPLANNER_QUERY = KEY_XPLANNER + KEY_QUERY; >+ >+ private static final String KEY_XPLANNER_CUSTOM = KEY_XPLANNER + KEY_CUSTOM + KEY_QUERY; >+ >+ private static final String KEY_XPLANNER_ITEM = "XPlannerItem"; //$NON-NLS-1$ >+ >+ private static final String KEY_QUERY_CONTENT_ID_TYPE = "QueryContentIdType"; //$NON-NLS-1$ >+ >+ private static final String KEY_QUERY_IS_TASKS = "QueryIsTasks"; //$NON-NLS-1$ >+ >+ private static final String KEY_QUERY_CONTENT_ID = "QueryConentId"; //$NON-NLS-1$ >+ >+ private static final String KEY_QUERY_PERSON_ID = "QueryPersonId"; //$NON-NLS-1$ >+ >+ private static final String KEY_QUERY_MY_CURRENT_TASKS = "QueryMyCurrentTasks"; //$NON-NLS-1$ >+ >+ public boolean canReadQuery(Node node) { >+ return node.getNodeName().equals(KEY_XPLANNER_QUERY) || node.getNodeName().equals(KEY_XPLANNER_CUSTOM); >+ } >+ >+ public boolean canCreateElementFor(AbstractRepositoryQuery category) { >+ return category instanceof XPlannerCustomQuery; >+ } >+ >+ public boolean canCreateElementFor(AbstractTask task) { >+ return task instanceof XPlannerTask; >+ } >+ >+ @Override >+ public AbstractRepositoryQuery createQuery(String repositoryUrl, String queryString, String label, Element element) { >+ AbstractRepositoryQuery query = null; >+ query = new XPlannerCustomQuery(repositoryUrl, label); >+ initializeQuery((XPlannerCustomQuery)query, element); >+ >+ return query; >+ } >+ >+ private void initializeQuery(XPlannerCustomQuery query, Element element) { >+ String myCurrentTasks = element.getAttribute(KEY_QUERY_MY_CURRENT_TASKS); >+ if (myCurrentTasks != null && Boolean.valueOf(myCurrentTasks)) { >+ query.setMyCurrentTasks(true); >+ } >+ else { >+ // selected content type >+ String contentIdType = element.getAttribute(KEY_QUERY_CONTENT_ID_TYPE); >+ if (contentIdType != null) { >+ query.setContentIdType((XPlannerCustomQuery.ContentIdType.valueOf(contentIdType))); >+ } >+ >+ // use tasks? >+ String useTasks = element.getAttribute(KEY_QUERY_IS_TASKS); >+ if (useTasks != null) { >+ query.setUseTasks(Boolean.valueOf(useTasks)); >+ } >+ >+ // use all? >+ String personId = element.getAttribute(KEY_QUERY_PERSON_ID); >+ if (personId != null) { >+ query.setPersonId(Integer.valueOf(personId)); >+ } >+ >+ // content id >+ String contentIds = element.getAttribute(KEY_QUERY_CONTENT_ID); >+ if (contentIds != null) { >+ query.setContentIds(decodeIds(contentIds)); >+ } >+ } >+ } >+ >+ private String encodeIds(List<Integer> contentIds) { >+ StringBuilder result = new StringBuilder(); >+ for (Iterator<Integer> iter = contentIds.iterator(); iter.hasNext();) { >+ Integer id = iter.next(); >+ result.append(id); >+ if (iter.hasNext()) { >+ result.append(TOKEN_SEPARATOR); >+ } >+ } >+ >+ return result.toString(); >+ } >+ >+ private List<Integer> decodeIds(String encoded) { >+ if (encoded == null) { >+ return XPlannerCustomQuery.INVALID_IDS; >+ } >+ >+ StringTokenizer tokens = new StringTokenizer(encoded, TOKEN_SEPARATOR); >+ ArrayList<Integer> ids = new ArrayList<Integer>(); >+ while (tokens.hasMoreTokens()) { >+ ids.add(Integer.valueOf(tokens.nextToken())); >+ } >+ >+ return ids; >+ } >+ >+ >+ public Set<String> getQueryElementNames() { >+ Set<String> names = new HashSet<String>(); >+ names.add(KEY_XPLANNER_CUSTOM); >+ return names; >+ } >+ >+ public void setAdditionalAttributes(AbstractRepositoryQuery query, Element node) { >+// String queryTagName = getQueryTagNameForElement(query); >+ >+// node.setAttribute(KEY_NAME, query.getSummary()); >+// node.setAttribute(KEY_QUERY_STRING, query.getUrl()); >+// node.setAttribute(KEY_REPOSITORY_URL, query.getRepositoryUrl()); >+ >+ XPlannerCustomQuery xplannerCustomQuery = (XPlannerCustomQuery) query; >+ >+ // name >+// String queryName = xplannerCustomQuery.getQueryName(); >+// node.setAttribute(KEY_QUERY_NAME, queryName); >+ >+ boolean isMyCurrentTasks = xplannerCustomQuery.isMyCurrentTasks(); >+ if (isMyCurrentTasks) { >+ // show only my current tasks >+ node.setAttribute(KEY_QUERY_MY_CURRENT_TASKS, Boolean.toString(true)); >+ } >+ else { >+ // don't show only my current tasks >+ node.setAttribute(KEY_QUERY_MY_CURRENT_TASKS, Boolean.toString(false)); >+ >+ // selected content type >+ String contentIdType = xplannerCustomQuery.getContentIdType().name(); >+ node.setAttribute(KEY_QUERY_CONTENT_ID_TYPE, contentIdType); >+ >+ // is tasks >+ boolean isUseTasks = xplannerCustomQuery.isUseTasks(); >+ node.setAttribute(KEY_QUERY_IS_TASKS, Boolean.toString(isUseTasks)); >+ >+ // content id >+ List<Integer> contentIds = xplannerCustomQuery.getContentIds(); >+ node.setAttribute(KEY_QUERY_CONTENT_ID, encodeIds(contentIds)); >+ >+ // person id >+ int personId = xplannerCustomQuery.getPersonId(); >+ node.setAttribute(KEY_QUERY_PERSON_ID, Integer.toString(personId)); >+ } >+// >+// for (AbstractTask hit : query.getHits()) { >+// try { >+// Element element = null; >+// for (ITaskListExternalizer externalizer : super.getDelegateExternalizers()) { >+// if (externalizer.canCreateElementFor(hit)) { >+// element = createQueryHitElement(hit, doc, node); >+// } >+// } >+// if (element == null) { >+// createQueryHitElement(hit, doc, node); >+// } >+// } >+// catch (Exception e) { >+// StatusManager.log(e, e.getMessage()); >+// } >+// } >+// parent.appendChild(node); >+// return node; >+ } >+ >+// public Element createQueryElement(AbstractRepositoryQuery query, Document doc, Element parent) { >+// String queryTagName = getQueryTagNameForElement(query); >+// Element node = doc.createElement(queryTagName); >+// >+// node.setAttribute(KEY_NAME, query.getSummary()); >+// node.setAttribute(KEY_QUERY_STRING, query.getUrl()); >+// node.setAttribute(KEY_REPOSITORY_URL, query.getRepositoryUrl()); >+// >+// XPlannerCustomQuery xplannerCustomQuery = (XPlannerCustomQuery) query; >+// >+// // name >+// String queryName = xplannerCustomQuery.getQueryName(); >+// node.setAttribute(KEY_QUERY_NAME, queryName); >+// >+// boolean isMyCurrentTasks = xplannerCustomQuery.isMyCurrentTasks(); >+// if (isMyCurrentTasks) { >+// // show only my current tasks >+// node.setAttribute(KEY_QUERY_MY_CURRENT_TASKS, Boolean.toString(true)); >+// } >+// else { >+// // don't show only my current tasks >+// node.setAttribute(KEY_QUERY_MY_CURRENT_TASKS, Boolean.toString(false)); >+// >+// // selected content type >+// String contentIdType = xplannerCustomQuery.getContentIdType().name(); >+// node.setAttribute(KEY_QUERY_CONTENT_ID_TYPE, contentIdType); >+// >+// // is tasks >+// boolean isUseTasks = xplannerCustomQuery.isUseTasks(); >+// node.setAttribute(KEY_QUERY_IS_TASKS, Boolean.toString(isUseTasks)); >+// >+// // content id >+// List<Integer> contentIds = xplannerCustomQuery.getContentIds(); >+// node.setAttribute(KEY_QUERY_CONTENT_ID, encodeIds(contentIds)); >+// >+// // person id >+// int personId = xplannerCustomQuery.getPersonId(); >+// node.setAttribute(KEY_QUERY_PERSON_ID, Integer.toString(personId)); >+// } >+// >+// for (AbstractTask hit : query.getHits()) { >+// try { >+// Element element = null; >+// for (ITaskListExternalizer externalizer : super.getDelegateExternalizers()) { >+// if (externalizer.canCreateElementFor(hit)) { >+// element = createQueryHitElement(hit, doc, node); >+// } >+// } >+// if (element == null) { >+// createQueryHitElement(hit, doc, node); >+// } >+// } >+// catch (Exception e) { >+// StatusManager.log(e, e.getMessage()); >+// } >+// } >+// parent.appendChild(node); >+// return node; >+// } >+ >+ @Override >+ public String getTaskElementName() { >+ return KEY_XPLANNER_ITEM; >+ } >+ >+ @Override >+ public AbstractTask createTask(String repositoryUrl, String taskId, String summary, Element element) { >+ return new XPlannerTask(repositoryUrl, taskId, summary); >+ } >+ >+ @Override >+ public String getQueryElementName(AbstractRepositoryQuery query) { >+ if (query instanceof XPlannerCustomQuery) { >+ return KEY_XPLANNER_CUSTOM; >+ } >+ return ""; //$NON-NLS-1$ >+ } >+ >+ @Override >+ public boolean canCreate(AbstractRepositoryQuery category) { >+ return category instanceof XPlannerCustomQuery; >+ } >+ >+ @Override >+ public boolean canCreate(AbstractTask task) { >+ return task instanceof XPlannerTask; >+ } >+ >+} >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerClientFacade.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/XPlannerClientFacade.java >diff -N src/org/eclipse/mylyn/xplanner/ui/XPlannerClientFacade.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerClientFacade.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,190 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 - 2007 CodeGear 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 >+ *******************************************************************************/ >+package org.eclipse.mylyn.xplanner.ui; >+ >+import java.net.*; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.mylyn.monitor.core.StatusHandler; >+import org.eclipse.mylyn.tasks.core.ITaskRepositoryListener; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.xplanner.core.XPlannerClientManager; >+import org.eclipse.mylyn.xplanner.core.XPlannerCorePlugin; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.core.service.exceptions.AuthenticationException; >+import org.eclipse.mylyn.xplanner.core.service.exceptions.ServiceUnavailableException; >+ >+/** >+ * This class acts as a layer of indirection between clients in this project and >+ * the server API implemented by the XPlanner Dashboard, and also abstracts some >+ * Mylyn implementation details. It initializes an XPlannerClient object and serves >+ * as the central location to get a reference to it. >+ * >+ * @author Ravi Kumar >+ * @author Helen Bershadskaya >+ * >+ */ >+public class XPlannerClientFacade implements ITaskRepositoryListener { >+ >+ private XPlannerClientManager clientManager = null; >+ >+ private static XPlannerClientFacade instance = null; >+ >+ public XPlannerClientFacade() { >+ TasksUiPlugin.getRepositoryManager().addListener(this); >+ clientManager = XPlannerCorePlugin.getDefault().getClientManager(); >+ } >+ >+ /** >+ * Lazily creates client. >+ */ >+ public XPlannerClient getXPlannerClient(TaskRepository repository) throws CoreException { >+ try { >+ XPlannerRepositoryUtils.checkRepositoryValidated(repository.getUrl()); >+ String serverHostname = getServerHost(repository); >+ XPlannerClient client = clientManager.getClient(serverHostname); >+//TODO: add this check back once the listeners for client property change are hooked up >+// Also handle the case when serviceDelegate in the cachedClient is null >+ >+// if (client == null) { >+ client = clientManager.createClient(serverHostname, repository.getUrl(), false, >+ repository.getUserName(), repository.getPassword(), false, repository.getProxy(), >+ repository.getHttpUser(), repository.getHttpPassword()); >+ clientManager.addClient(client); >+// } >+ if (client == null) { >+ throw new ServiceUnavailableException(serverHostname + " " + repository.getUrl()); //$NON-NLS-1$ >+ } >+ return client; >+ } >+ catch (CoreException ce) { >+ StatusHandler.log(Messages.XPlannerClientFacade_SERVER_CONNECTION_ERROR, this); >+ throw ce; >+ } >+ catch (ServiceUnavailableException sue) { >+ throw sue; >+ } >+ catch (RuntimeException e) { >+ StatusHandler.log(Messages.XPlannerClientFacade_SERVER_CONNECTION_ERROR, this); >+ throw e; >+ } >+ } >+ >+ public static XPlannerClientFacade getDefault() { >+ if (instance == null) { >+ instance = new XPlannerClientFacade(); >+ } >+ return instance; >+ } >+ >+ public void logOutFromAll() { >+ try { >+ XPlannerClient[] allClients = clientManager.getAllClients(); >+ for (int i = 0; i < allClients.length; i++) { >+ allClients[i].logout(); >+ } >+ } catch (Exception e) { >+ // ignore >+ } >+ } >+ >+ public void repositoriesRead() { >+ // ignore >+ } >+ >+ public void repositoryAdded(TaskRepository repository) { >+ if (repository.getConnectorKind().equals(XPlannerMylynUIPlugin.REPOSITORY_KIND)) { >+ try { >+ getXPlannerClient(repository); >+ } >+ catch (CoreException e) { >+ StatusHandler.log(e.getMessage(), this); >+ } >+ } >+ } >+ >+ public void repositoryRemoved(TaskRepository repository) { >+ if (repository.getConnectorKind().equals(XPlannerMylynUIPlugin.REPOSITORY_KIND)) { >+ String serverHostname = getServerHost(repository); >+ XPlannerClient client = clientManager.getClient(serverHostname); >+ removeClient(client); >+ XPlannerRepositoryUtils.removeValidatedRepositoryUrl(repository.getUrl()); >+ } >+ } >+ >+ public void repositorySettingsChanged(TaskRepository repository) { >+ repositoryRemoved(repository); >+ repositoryAdded(repository); >+ } >+ >+ public void refreshClientSettings(TaskRepository repository) { >+ String serverHostname = getServerHost(repository); >+ XPlannerClient client = clientManager.getClient(serverHostname); >+ if (client != null) { >+ client.refreshDetails(); >+ } >+ } >+ >+ >+ private void removeClient(XPlannerClient client) { >+ if (client != null) { >+ client.logout(); >+ clientManager.removeClient(client); >+ } >+ } >+ >+ /** >+ * Validate the server URL and user credentials >+ * @param serverUrl Location of the XPlanner Server >+ * @param user Username >+ * @param password Password >+ * @param proxy Proxy >+ * @param httpUser http user name >+ * @param httpPassword http password >+ * @return String describing validation failure or null if the details are valid >+ */ >+ public void validateServerAndCredentials(String serverUrl, String user, >+ String password, Proxy proxy, String httpUser, String httpPassword) throws Exception { >+ >+ XPlannerRepositoryUtils.removeValidatedRepositoryUrl(serverUrl); >+ clientManager.testConnection(serverUrl, user, password, proxy, httpUser, httpPassword); >+ XPlannerRepositoryUtils.addValidatedRepositoryUrl(serverUrl); >+ } >+ >+ private static String getServerHost(TaskRepository repository) { >+ try { >+ return new URL(repository.getUrl()).getHost(); >+ } catch (MalformedURLException ex) { >+ throw new RuntimeException(Messages.XPlannerClientFacade_INVALID_URL_EXCEPTION+repository.getUrl(), ex); >+ } >+ } >+ >+ /** >+ * TODO: refactor >+ */ >+ public static void handleConnectionException(Exception e) { >+ if (e instanceof ServiceUnavailableException) { >+ StatusHandler.fail(e, Messages.XPlannerClientFacade_CONNECTION_FAILURE_ERROR >+ + Messages.XPlannerClientFacade_NETWORK_CONNECTION_FAILURE, >+ true); >+ } >+ else if (e instanceof AuthenticationException) { >+ StatusHandler.fail(e, Messages.XPlannerClientFacade_AUTHENTICATION_FAILED >+ + Messages.XPlannerClientFacade_USERNAME_PASSWORD_ERROR, true); >+ } >+ else if (e instanceof RuntimeException) { >+ StatusHandler.fail(e, Messages.XPlannerClientFacade_NO_REPOSITORY_FOUND >+ + Messages.XPlannerClientFacade_VERIFY_VALID_REPOSITORY, true); >+ } >+ else { >+ StatusHandler.fail(e, Messages.XPlannerClientFacade_COULD_NOT_CONNECT_TO_REPOSITORY >+ + Messages.XPlannerClientFacade_CHECK_CREDENTIALS, true); >+ } >+ } >+} >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskDataHandler.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskDataHandler.java >diff -N src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskDataHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerTaskDataHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,140 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 - 2007 CodeGear 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 >+ *******************************************************************************/ >+package org.eclipse.mylyn.xplanner.ui; >+ >+import java.net.Proxy; >+import java.rmi.RemoteException; >+import java.util.HashSet; >+import java.util.Set; >+ >+import javax.security.auth.login.LoginException; >+ >+import org.eclipse.core.runtime.*; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.xplanner.core.XPlannerCorePlugin; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.xplanner.soap.TaskData; >+import org.xplanner.soap.UserStoryData; >+ >+/** >+ * @author Ravi Kumar >+ * @author Helen Bershadskaya >+ */ >+public class XPlannerTaskDataHandler extends AbstractTaskDataHandler { >+ private AbstractAttributeFactory attributeFactory = new XPlannerAttributeFactory(); >+ >+ public XPlannerTaskDataHandler(TaskList taskList) { >+ //TODO -- tasklist? >+ } >+ >+ public RepositoryTaskData downloadTaskData(AbstractTask repositoryTask, TaskRepository repository, Proxy proxySettings) >+ throws CoreException, LoginException { >+ >+ if (!(repositoryTask instanceof XPlannerTask)) { >+ return null; >+ } >+ >+ RepositoryTaskData repositoryTaskData = null; >+ XPlannerTask xplannerTask = (XPlannerTask)repositoryTask; >+ >+ XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); >+ repositoryTaskData = XPlannerRepositoryUtils.createRepositoryTaskData(repository, xplannerTask, client); >+ >+ return repositoryTaskData; >+ } >+ >+ public boolean initializeTaskData(TaskRepository repository, RepositoryTaskData data, IProgressMonitor monitor) >+ throws CoreException { >+ >+ // currently don't create new tasks >+ return false; >+ } >+ >+ public AbstractAttributeFactory getAttributeFactory(String repositoryUrl, String repositoryKind, String taskKind) { >+ return attributeFactory; >+ } >+ >+ public AbstractAttributeFactory getAttributeFactory(RepositoryTaskData taskData) { >+ return getAttributeFactory(taskData.getRepositoryUrl(), taskData.getRepositoryKind(), taskData.getTaskKind()); >+ } >+ >+ public String postTaskData(TaskRepository repository, RepositoryTaskData taskData, IProgressMonitor monitor) >+ throws CoreException { >+ String resultId = null; >+ >+ try { >+ resultId = postChangesToRepository(taskData); >+ } >+ catch (Exception e) { >+ throw new CoreException(new Status(Status.ERROR, >+ XPlannerCorePlugin.ID, Status.ERROR, Messages.XPlannerOfflineTaskHandler_CANNOT_POST_DATA_TO_SERVER, null)); >+ } >+ >+ return resultId; >+ } >+ >+ private String postChangesToRepository(RepositoryTaskData repositoryTaskData) throws CoreException { >+ String error = null; >+ >+ TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository( >+ repositoryTaskData.getRepositoryKind(), repositoryTaskData.getRepositoryUrl()); >+ >+ XPlannerClient client = XPlannerClientFacade.getDefault().getXPlannerClient(repository); >+ if (client != null) { >+ try { >+ // first check if taskdata exists >+ TaskData taskData = client.getTask(Integer.valueOf(repositoryTaskData.getId()).intValue()); >+ if (taskData != null) { >+ taskData.setName(repositoryTaskData.getSummary()); >+ taskData.setDescription(XPlannerRepositoryUtils.getDescription(repositoryTaskData)); >+ taskData.setEstimatedHours(Double.valueOf( >+ repositoryTaskData.getAttribute(XPlannerAttributeFactory.ATTRIBUTE_EST_HOURS_NAME).getValue())); >+ taskData.setCompleted(XPlannerRepositoryUtils.isCompleted(repositoryTaskData)); >+ client.update(taskData); >+ } >+ else { >+ // otherwise check if a user story exists >+ UserStoryData userStory = client.getUserStory(Integer.valueOf(repositoryTaskData.getId()).intValue()); >+ if (userStory != null) { >+ userStory.setName(repositoryTaskData.getSummary()); >+ userStory.setDescription(XPlannerRepositoryUtils.getDescription(repositoryTaskData)); >+ userStory.setActualHours(Double.valueOf( >+ repositoryTaskData.getAttribute(XPlannerAttributeFactory.ATTRIBUTE_ACT_HOURS_NAME).getValue())); >+ client.update(userStory); >+ } >+ } >+ } >+ catch (NumberFormatException e) { >+ XPlannerMylynUIPlugin.log(e.getCause(), "", false); //$NON-NLS-1$ >+ error = e.getMessage(); >+ } >+ catch (RemoteException e) { >+ XPlannerMylynUIPlugin.log(e.getCause(), "", false); //$NON-NLS-1$ >+ error = e.getMessage(); >+ } >+ } >+ >+ return error; >+ } >+ >+ public RepositoryTaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) >+ throws CoreException { >+ >+ return XPlannerRepositoryUtils.createRepositoryTaskData(repository, taskId); >+ } >+ >+ public Set<String> getSubTaskIds(RepositoryTaskData taskData) { >+ Set<String> subIds = new HashSet<String>(); >+ RepositoryTaskAttribute attribute = taskData.getAttribute(XPlannerAttributeFactory.Attribute.SUBTASK_IDS.getCommonAttributeKey()); >+ if (attribute != null) { >+ subIds.addAll(attribute.getValues()); >+ } >+ return subIds; >+ } >+} >Index: src/org/eclipse/mylyn/xplanner/ui/XPlannerMylynUIPlugin.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/XPlannerMylynUIPlugin.java >diff -N src/org/eclipse/mylyn/xplanner/ui/XPlannerMylynUIPlugin.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/xplanner/ui/XPlannerMylynUIPlugin.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,97 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 - 2007 CodeGear 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 >+ *******************************************************************************/ >+package org.eclipse.mylyn.xplanner.ui; >+ >+import org.eclipse.core.runtime.*; >+import org.eclipse.jface.dialogs.MessageDialog; >+import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.mylyn.monitor.core.StatusHandler; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.plugin.AbstractUIPlugin; >+import org.osgi.framework.BundleContext; >+ >+/** >+ * @author Ravi Kumar >+ * @author Helen Bershadskaya >+ */ >+public class XPlannerMylynUIPlugin extends AbstractUIPlugin { >+ >+ private static XPlannerMylynUIPlugin INSTANCE; >+ >+ public static final String PLUGIN_ID = "org.eclipse.mylyn.xplanner.ui"; //$NON-NLS-1$ >+ >+ public final static String REPOSITORY_KIND = "xplanner"; //$NON-NLS-1$ >+ >+ public final static String XPLANNER_CLIENT_LABEL = Messages.MylynXPlannerPlugin_CLIENT_LABEL; >+ >+ public final static String TITLE_MESSAGE_DIALOG = Messages.MylynXPlannerPlugin_CLIENT_DIALOG_TITLE; >+ >+ public static final String DELIM_URL_PREFIX = "/do/view/"; //$NON-NLS-1$ >+ >+ public final static String DELIM_URL_SUFFIX = "?oid="; //$NON-NLS-1$ >+ >+ public final static String TASK_URL_PREFIX = DELIM_URL_PREFIX + "task" + DELIM_URL_SUFFIX; //$NON-NLS-1$ >+ >+ public final static String USER_STORY_URL_PREFIX = DELIM_URL_PREFIX + "userstory" + DELIM_URL_SUFFIX; //$NON-NLS-1$ >+ >+ public final static String ITERATION_URL_PREFIX = DELIM_URL_PREFIX + "iteration" + DELIM_URL_SUFFIX; //$NON-NLS-1$ >+ >+ public final static IStatus NO_LICENSE_STATUS = new Status(IStatus.INFO, XPlannerMylynUIPlugin.PLUGIN_ID, >+ 0, Messages.MylynXPlannerPlugin_NOT_AVAILABLE_IN_SKU, null); >+ >+ public XPlannerMylynUIPlugin() { >+ INSTANCE = this; >+ } >+ >+ public void stop(BundleContext context) throws Exception { >+ super.stop(context); >+ INSTANCE = null; >+ XPlannerClientFacade.getDefault().logOutFromAll(); >+ } >+ >+ public static void log(final Throwable e, final String message, boolean informUser) { >+ if (Platform.isRunning() && informUser) { >+ try { >+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { >+ public void run() { >+ Shell shell = null; >+ if (PlatformUI.getWorkbench() != null >+ && PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) { >+ shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); >+ } >+ String displayMessage = message == null ? e.getMessage() : message + "\n" + e.getMessage(); //$NON-NLS-1$ >+ MessageDialog.openError(shell, Messages.MylynXPlannerPlugin_XPLANNER_ERROR_TITLE, displayMessage); >+ } >+ }); >+ } >+ catch (Throwable t) { >+ t.printStackTrace(); >+ } >+ } >+ else { >+ StatusHandler.log(e, message == null ? Messages.MylynXPlannerPlugin_XPLANNER_ERROR_TITLE : message); >+ } >+ } >+ >+ public static XPlannerMylynUIPlugin getDefault() { >+ return INSTANCE; >+ } >+ >+ /** >+ * Returns an image descriptor for the image file at the given plug-in >+ * relative path. >+ * >+ * @param path >+ * the path >+ * @return the image descriptor >+ */ >+ public static ImageDescriptor getImageDescriptor(String path) { >+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); >+ } >+} >Index: src/org/eclipse/mylyn/xplanner/ui/MylynXPlannerUtils.java >=================================================================== >RCS file: src/org/eclipse/mylyn/xplanner/ui/MylynXPlannerUtils.java >diff -N src/org/eclipse/mylyn/xplanner/ui/MylynXPlannerUtils.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/xplanner/ui/MylynXPlannerUtils.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,32 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 - 2007 CodeGear 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 >+ *******************************************************************************/ >+package org.eclipse.mylyn.xplanner.ui; >+ >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.xplanner.ui.wizard.NewXPlannerQueryWizard; >+ >+/** >+ * @author Ravi Kumar >+ * @author Helen Bershadskaya >+ */ >+public class MylynXPlannerUtils { >+ private MylynXPlannerUtils() { >+ >+ } >+ >+ public static void addNewMyTasksQuery(TaskRepository repository, >+ String name) { >+ >+ XPlannerCustomQuery myTasksQuery = >+ new XPlannerCustomQuery(repository.getUrl(), name); >+ >+ myTasksQuery.setMyCurrentTasks(true); >+ NewXPlannerQueryWizard.addQuery(myTasksQuery, repository); >+ } >+ >+} >#P org.eclipse.mylyn.xplanner.tests >Index: src/org/eclipse/mylyn/xplanner/tests/XPlannerRepositoryConnectorTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.tests/src/org/eclipse/mylyn/xplanner/tests/XPlannerRepositoryConnectorTest.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerRepositoryConnectorTest.java >--- src/org/eclipse/mylyn/xplanner/tests/XPlannerRepositoryConnectorTest.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/tests/XPlannerRepositoryConnectorTest.java 26 Jun 2007 17:41:22 -0000 >@@ -5,29 +5,28 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.tests; >+package org.eclipse.mylyn.xplanner.tests; > > import junit.framework.TestCase; > >-import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryTask; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.ui.XPlannerRepositoryConnector; >-import org.eclipse.mylar.xplanner.ui.XPlannerTask; >+import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.ui.XPlannerRepositoryConnector; >+import org.eclipse.mylyn.xplanner.ui.XPlannerTask; > import org.xplanner.soap.TaskData; > import org.xplanner.soap.UserStoryData; > > public class XPlannerRepositoryConnectorTest extends TestCase { >- private static XPlannerServer server; >+ private static XPlannerClient client; > > protected void setUp() throws Exception { > super.setUp(); >- if (server == null) { // only create data once per run >- server = XPlannerTestUtils.getXPlannerServer(); >- XPlannerTestUtils.clearTestData(server); >- XPlannerTestUtils.setUpTestData(server); >+ if (client == null) { // only create data once per run >+ client = XPlannerTestUtils.getXPlannerClient(); >+ XPlannerTestUtils.clearTestData(client); >+ XPlannerTestUtils.setUpTestData(client); > } > } > >@@ -38,13 +37,13 @@ > public void testCreateTaskFromExistingKeyForUserStory() throws Exception { > TaskRepository repository = XPlannerTestUtils.getRepository(); > AbstractRepositoryConnector connector = >- TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >- UserStoryData testUserStory = XPlannerTestUtils.findTestUserStory(server); >+ TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getConnectorKind()); >+ UserStoryData testUserStory = XPlannerTestUtils.findTestUserStory(client); > > assertTrue(testUserStory != null); > >- AbstractRepositoryTask repositoryTask = >- connector.createTaskFromExistingKey(repository, "" + testUserStory.getId()); >+ AbstractTask repositoryTask = >+ connector.createTaskFromExistingId(repository, "" + testUserStory.getId(), new NullProgressMonitor()); > > assertTrue(repositoryTask instanceof XPlannerTask); > assertTrue(((XPlannerTask)repositoryTask).getSummary().equals(testUserStory.getName())); >@@ -53,13 +52,13 @@ > public void testCreateTaskFromExistingKeyForTask() throws Exception { > TaskRepository repository = XPlannerTestUtils.getRepository(); > AbstractRepositoryConnector connector = >- TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >- TaskData testTask = XPlannerTestUtils.findTestTask(server); >+ TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getConnectorKind()); >+ TaskData testTask = XPlannerTestUtils.findTestTask(client); > > assertTrue(testTask != null); > >- AbstractRepositoryTask repositoryTask = >- connector.createTaskFromExistingKey(repository, "" + testTask.getId()); >+ AbstractTask repositoryTask = >+ connector.createTaskFromExistingId(repository, "" + testTask.getId(), new NullProgressMonitor()); > > assertTrue(repositoryTask instanceof XPlannerTask); > assertTrue(((XPlannerTask)repositoryTask).getSummary().equals(testTask.getName())); >@@ -68,12 +67,12 @@ > public void testUpdateTaskDetailsCompleted() throws Exception { > TaskRepository repository = XPlannerTestUtils.getRepository(); > AbstractRepositoryConnector connector = >- TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >+ TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getConnectorKind()); > > assertTrue(connector instanceof XPlannerRepositoryConnector); > XPlannerRepositoryConnector xplannerConnector = (XPlannerRepositoryConnector) connector; >- TaskData testTask = XPlannerTestUtils.findTestTask(server); >- XPlannerTask repositoryTask = XPlannerTestUtils.getTestXPlannerTask(server); >+ TaskData testTask = XPlannerTestUtils.findTestTask(client); >+ XPlannerTask repositoryTask = XPlannerTestUtils.getTestXPlannerTask(client); > > assertTrue(testTask != null); > assertTrue(repositoryTask != null); >@@ -84,14 +83,14 @@ > > // mark testTask as completed > testTask.setCompleted(true); >- server.update(testTask); >+ client.update(testTask); > > xplannerConnector.updateTaskDetails(repository.getUrl(), repositoryTask, testTask, false); > assertTrue(repositoryTask.isCompleted()); > > //restore testTask's completion state > testTask.setCompleted(originalCompleted); >- server.update(testTask); >+ client.update(testTask); > } > > } >Index: src/org/eclipse/mylyn/xplanner/tests/XPlannerCustomQueryTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.tests/src/org/eclipse/mylyn/xplanner/tests/XPlannerCustomQueryTest.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerCustomQueryTest.java >--- src/org/eclipse/mylyn/xplanner/tests/XPlannerCustomQueryTest.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/tests/XPlannerCustomQueryTest.java 26 Jun 2007 17:41:21 -0000 >@@ -5,33 +5,31 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.tests; >+package org.eclipse.mylyn.xplanner.tests; > > import java.rmi.RemoteException; >-import java.util.List; >+import java.util.Set; > > import junit.framework.TestCase; > > import org.eclipse.core.runtime.NullProgressMonitor; >-import org.eclipse.mylar.tasks.core.AbstractQueryHit; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; >-import org.eclipse.mylar.tasks.core.QueryHitCollector; >-import org.eclipse.mylar.tasks.core.TaskList; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.ui.XPlannerCustomQuery; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.TaskFactory; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.tasks.ui.search.SearchHitCollector; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.ui.XPlannerCustomQuery; > > public class XPlannerCustomQueryTest extends TestCase { > >- private static XPlannerServer server; >+ private static XPlannerClient client; > > protected void setUp() throws Exception { > super.setUp(); >- if (server == null) { // only create data once per run >- server = XPlannerTestUtils.getXPlannerServer(); >- XPlannerTestUtils.clearTestData(server); >- XPlannerTestUtils.setUpTestData(server); >+ if (client == null) { // only create data once per run >+ client = XPlannerTestUtils.getXPlannerClient(); >+ XPlannerTestUtils.clearTestData(client); >+ XPlannerTestUtils.setUpTestData(client); > } > } > >@@ -42,20 +40,20 @@ > public void testNoItemsQuery() { > TaskList taskList = XPlannerTestUtils.getTaskList(); > XPlannerCustomQuery query = new XPlannerCustomQuery(XPlannerTestUtils.SERVER_URL, >- "no items", taskList); >+ "no items"); > query.setPersonId(-1); >- >- List<AbstractQueryHit> hits = performTestQuery(taskList, query); >+ >+ Set<AbstractTask> hits = performTestQuery(taskList, query); > assert(hits.size() == 0); > } > > public void testAdminItemsQuery() { > TaskList taskList = XPlannerTestUtils.getTaskList(); >- XPlannerCustomQuery query = new XPlannerCustomQuery(XPlannerTestUtils.SERVER_URL, >- "admin items", taskList); >+ XPlannerCustomQuery query = new XPlannerCustomQuery( >+ XPlannerTestUtils.SERVER_URL, "admin items"); > try { >- query.setPersonId(XPlannerTestUtils.getAdminId(server)); >- List<AbstractQueryHit> hits = performTestQuery(taskList, query); >+ query.setPersonId(XPlannerTestUtils.getAdminId(client)); >+ Set<AbstractTask> hits = performTestQuery(taskList, query); > assert(hits.size() == 1); > } > catch (RemoteException e) { >@@ -64,15 +62,16 @@ > > } > >- private List<AbstractQueryHit> performTestQuery(TaskList taskList, XPlannerCustomQuery query) { >+ private Set<AbstractTask> performTestQuery(TaskList taskList, XPlannerCustomQuery query) { > TaskRepository repository = XPlannerTestUtils.getRepository(); > AbstractRepositoryConnector connector = >- TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >+ TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getConnectorKind()); > >- QueryHitCollector collector = new QueryHitCollector(taskList); >+ TaskFactory taskFactory = new TaskFactory(repository, false, false); >+ SearchHitCollector collector = new SearchHitCollector(taskList, repository, query, taskFactory); > connector.performQuery(query, repository, new NullProgressMonitor(), collector); > >- List<AbstractQueryHit> hits = collector.getHits(); >+ Set<AbstractTask> hits = collector.getTasks(); > return hits; > } > >Index: src/org/eclipse/mylyn/xplanner/tests/XPlannerRepositoryUtilsTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.tests/src/org/eclipse/mylyn/xplanner/tests/XPlannerRepositoryUtilsTest.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerRepositoryUtilsTest.java >--- src/org/eclipse/mylyn/xplanner/tests/XPlannerRepositoryUtilsTest.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/tests/XPlannerRepositoryUtilsTest.java 26 Jun 2007 17:41:22 -0000 >@@ -5,31 +5,28 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.tests; >+package org.eclipse.mylyn.xplanner.tests; > > import junit.framework.TestCase; > > import org.eclipse.core.runtime.CoreException; >-import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute; >-import org.eclipse.mylar.tasks.core.RepositoryTaskData; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.ui.XPlannerAttributeFactory; >-import org.eclipse.mylar.xplanner.ui.XPlannerRepositoryUtils; >-import org.eclipse.mylar.xplanner.ui.XPlannerTask; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.ui.*; > import org.xplanner.soap.TaskData; > import org.xplanner.soap.UserStoryData; > > public class XPlannerRepositoryUtilsTest extends TestCase { > >- private static XPlannerServer server; >+ private static XPlannerClient client; > > protected void setUp() throws Exception { > super.setUp(); >- if (server == null) { // only create data once per run >- server = XPlannerTestUtils.getXPlannerServer(); >- XPlannerTestUtils.clearTestData(server); >- XPlannerTestUtils.setUpTestData(server); >+ if (client == null) { // only create data once per run >+ client = XPlannerTestUtils.getXPlannerClient(); >+ XPlannerTestUtils.clearTestData(client); >+ XPlannerTestUtils.setUpTestData(client); > } > } > >@@ -39,9 +36,11 @@ > > public void testSetupTaskAttributes() { > try { >- TaskData taskData = XPlannerTestUtils.findTestTask(server); >- XPlannerTask task = XPlannerTestUtils.getTestXPlannerTask(server); >- RepositoryTaskData repositoryTaskData = task.getTaskData(); >+ TaskData taskData = XPlannerTestUtils.findTestTask(client); >+ XPlannerTask task = XPlannerTestUtils.getTestXPlannerTask(client); >+ RepositoryTaskData repositoryTaskData = >+ TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), >+ task.getTaskId()); > XPlannerRepositoryUtils.setupTaskAttributes(taskData, repositoryTaskData); > > assert(taskData.getDescription().equals( >@@ -54,9 +53,11 @@ > > public void testSetupUserStoryAttributes() { > try { >- UserStoryData userStory = XPlannerTestUtils.findTestUserStory(server); >- XPlannerTask task = XPlannerTestUtils.getTestXPlannerUserStoryTask(server); >- RepositoryTaskData repositoryTaskData = task.getTaskData(); >+ UserStoryData userStory = XPlannerTestUtils.findTestUserStory(client); >+ XPlannerTask task = XPlannerTestUtils.getTestXPlannerUserStoryTask(client); >+ RepositoryTaskData repositoryTaskData = >+ TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), >+ task.getTaskId()); > XPlannerRepositoryUtils.setupUserStoryAttributes(userStory, repositoryTaskData); > > assert(userStory.getName().equals( >@@ -68,10 +69,11 @@ > } > > public void testIsCompleted() { >- XPlannerTask xplannerTask; > try { >- xplannerTask = XPlannerTestUtils.getTestXPlannerTask(server); >- RepositoryTaskData repositoryTaskData = xplannerTask.getTaskData(); >+ XPlannerTask task = XPlannerTestUtils.getTestXPlannerTask(client); >+ RepositoryTaskData repositoryTaskData = >+ TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), >+ task.getTaskId()); > assert(!XPlannerRepositoryUtils.isCompleted(repositoryTaskData)); > } > catch (Exception e) { >Index: src/org/eclipse/mylyn/xplanner/tests/AllXPlannerTests.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.tests/src/org/eclipse/mylyn/xplanner/tests/AllXPlannerTests.java,v >retrieving revision 1.1 >diff -u -r1.1 AllXPlannerTests.java >--- src/org/eclipse/mylyn/xplanner/tests/AllXPlannerTests.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/tests/AllXPlannerTests.java 26 Jun 2007 17:41:21 -0000 >@@ -5,7 +5,7 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.tests; >+package org.eclipse.mylyn.xplanner.tests; > > import junit.framework.Test; > import junit.framework.TestSuite; >@@ -17,7 +17,7 @@ > public class AllXPlannerTests { > > public static Test suite() { >- TestSuite suite = new TestSuite("Test for mylar.xplanner.tests"); >+ TestSuite suite = new TestSuite("Test for mylyn.xplanner.tests"); > > // $JUnit-BEGIN$ > suite.addTestSuite(XPlannerRepositoryUtilsTest.class); >Index: src/org/eclipse/mylyn/xplanner/tests/XPlannerTestUtils.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.tests/src/org/eclipse/mylyn/xplanner/tests/XPlannerTestUtils.java,v >retrieving revision 1.1 >diff -u -r1.1 XPlannerTestUtils.java >--- src/org/eclipse/mylyn/xplanner/tests/XPlannerTestUtils.java 31 May 2007 07:37:11 -0000 1.1 >+++ src/org/eclipse/mylyn/xplanner/tests/XPlannerTestUtils.java 26 Jun 2007 17:41:22 -0000 >@@ -5,27 +5,19 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > *******************************************************************************/ >-package org.eclipse.mylar.xplanner.tests; >+package org.eclipse.mylyn.xplanner.tests; > > import java.rmi.RemoteException; > import java.util.Calendar; > import java.util.Date; > > import org.eclipse.core.runtime.CoreException; >-import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; >-import org.eclipse.mylar.tasks.core.Task; >-import org.eclipse.mylar.tasks.core.TaskList; >-import org.eclipse.mylar.tasks.core.TaskRepository; >-import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >-import org.eclipse.mylar.xplanner.core.service.XPlannerServer; >-import org.eclipse.mylar.xplanner.ui.XPlannerMylarUIPlugin; >-import org.eclipse.mylar.xplanner.ui.XPlannerServerFacade; >-import org.eclipse.mylar.xplanner.ui.XPlannerTask; >-import org.xplanner.soap.IterationData; >-import org.xplanner.soap.PersonData; >-import org.xplanner.soap.ProjectData; >-import org.xplanner.soap.TaskData; >-import org.xplanner.soap.UserStoryData; >+import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.mylyn.tasks.core.*; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.xplanner.core.service.XPlannerClient; >+import org.eclipse.mylyn.xplanner.ui.*; >+import org.xplanner.soap.*; > > /** > * Requirements for tests: >@@ -52,7 +44,7 @@ > > repository = TasksUiPlugin.getRepositoryManager().getRepository(SERVER_URL); > if (repository == null) { >- repository = new TaskRepository(XPlannerMylarUIPlugin.REPOSITORY_KIND, SERVER_URL); >+ repository = new TaskRepository(XPlannerMylynUIPlugin.REPOSITORY_KIND, SERVER_URL); > repository.setAuthenticationCredentials(USER, PASSWORD); > TasksUiPlugin.getRepositoryManager().addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); > TasksUiPlugin.getTaskListManager().resetTaskList(); >@@ -66,34 +58,34 @@ > repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); > } > >- public static XPlannerServer getXPlannerServer() throws CoreException { >+ public static XPlannerClient getXPlannerClient() throws CoreException { > TaskRepository repository = getRepository(); > >- return XPlannerServerFacade.getDefault().getXPlannerServer(repository); >+ return XPlannerClientFacade.getDefault().getXPlannerClient(repository); > } > >- public static void clearTestData(XPlannerServer server) throws Exception { >- if (server != null) { >- ProjectData testProject = findTestProject(server); >+ public static void clearTestData(XPlannerClient client) throws Exception { >+ if (client != null) { >+ ProjectData testProject = findTestProject(client); > if (testProject != null) { >- server.removeProject(testProject.getId()); >+ client.removeProject(testProject.getId()); > } > } > } > >- public static void setUpTestData(XPlannerServer server) throws Exception { >- if (server != null) { >- ProjectData testProject = getTestProject(server); >- IterationData testIteration = getTestIteration(server, testProject); >- UserStoryData testUserStory = getTestUserStory(server, testIteration); >- getTestTask(server, testUserStory); >+ public static void setUpTestData(XPlannerClient client) throws Exception { >+ if (client != null) { >+ ProjectData testProject = getTestProject(client); >+ IterationData testIteration = getTestIteration(client, testProject); >+ UserStoryData testUserStory = getTestUserStory(client, testIteration); >+ getTestTask(client, testUserStory); > } > } > >- public static ProjectData findTestProject(XPlannerServer server) throws RemoteException { >+ public static ProjectData findTestProject(XPlannerClient client) throws RemoteException { > ProjectData testProject = null; > >- ProjectData[] projects = server.getProjects(); >+ ProjectData[] projects = client.getProjects(); > for (int i = 0; i < projects.length && testProject == null; i++) { > if (TEST_PROJECT_NAME.equals(projects[i].getName())) { > testProject = projects[i]; >@@ -103,23 +95,23 @@ > return testProject; > } > >- private static ProjectData getTestProject(XPlannerServer server) throws RemoteException { >- ProjectData testProject = findTestProject(server); >+ private static ProjectData getTestProject(XPlannerClient client) throws RemoteException { >+ ProjectData testProject = findTestProject(client); > > if (testProject == null) { > testProject = new ProjectData(); > testProject.setName(TEST_PROJECT_NAME); > testProject.setDescription(TEST_PROJECT_NAME); >- testProject = server.addProject(testProject); >+ testProject = client.addProject(testProject); > } > > return testProject; > } > >- public static IterationData findTestIteration(XPlannerServer server, ProjectData testProject) throws RemoteException { >+ public static IterationData findTestIteration(XPlannerClient client, ProjectData testProject) throws RemoteException { > IterationData testIteration = null; > >- IterationData[] iterations = server.getIterations(testProject.getId()); >+ IterationData[] iterations = client.getIterations(testProject.getId()); > if (iterations != null) { > for (int i = 0; i < iterations.length && testIteration == null; i++) { > if (TEST_ITERATION_NAME.equals(iterations[i].getName())) { >@@ -131,8 +123,8 @@ > return testIteration; > } > >- private static IterationData getTestIteration(XPlannerServer server, ProjectData project) throws RemoteException { >- IterationData testIteration = findTestIteration(server, project); >+ private static IterationData getTestIteration(XPlannerClient client, ProjectData project) throws RemoteException { >+ IterationData testIteration = findTestIteration(client, project); > > if (testIteration == null) { > testIteration = new IterationData(); >@@ -157,18 +149,18 @@ > testIteration.setEndDate(endDate); > testIteration.setName(TEST_ITERATION_NAME); > testIteration.setDescription(TEST_ITERATION_NAME); >- testIteration = server.addIteration(testIteration); >+ testIteration = client.addIteration(testIteration); > >- server.refreshDetails(); >+ client.refreshDetails(); > } > > return testIteration; > } > >- public static UserStoryData findTestUserStory(XPlannerServer server, IterationData testIteration) throws RemoteException { >+ public static UserStoryData findTestUserStory(XPlannerClient client, IterationData testIteration) throws RemoteException { > UserStoryData testUserStory = null; > >- UserStoryData[] userStories = server.getUserStories(testIteration.getId()); >+ UserStoryData[] userStories = client.getUserStories(testIteration.getId()); > if (userStories != null) { > for (int i = 0; i < userStories.length && testUserStory == null; i++) { > if (TEST_USER_STORY_NAME.equals(userStories[i].getName())) { >@@ -180,8 +172,8 @@ > return testUserStory; > } > >- private static UserStoryData getTestUserStory(XPlannerServer server, IterationData iteration) throws RemoteException { >- UserStoryData testUserStory = findTestUserStory(server, iteration); >+ private static UserStoryData getTestUserStory(XPlannerClient client, IterationData iteration) throws RemoteException { >+ UserStoryData testUserStory = findTestUserStory(client, iteration); > > if (testUserStory == null) { > testUserStory = new UserStoryData(); >@@ -194,18 +186,18 @@ > testUserStory.setRemainingHours(0); > testUserStory.setPriority(5); > >- testUserStory = server.addUserStory(testUserStory); >+ testUserStory = client.addUserStory(testUserStory); > >- server.refreshDetails(); >+ client.refreshDetails(); > } > > return testUserStory; > } > >- public static TaskData findTestTask(XPlannerServer server, UserStoryData testUserStory) throws RemoteException { >+ public static TaskData findTestTask(XPlannerClient client, UserStoryData testUserStory) throws RemoteException { > TaskData testTask = null; > >- TaskData[] tasks = server.getTasks(testUserStory.getId()); >+ TaskData[] tasks = client.getTasks(testUserStory.getId()); > for (int i = 0; i < tasks.length && testTask == null; i++) { > if (TEST_TASK_NAME.equals(tasks[i].getName())) { > testTask = tasks[i]; >@@ -215,10 +207,10 @@ > return testTask; > } > >- public static int getAdminId(XPlannerServer server) throws RemoteException { >+ public static int getAdminId(XPlannerClient client) throws RemoteException { > int adminId = -1; > >- PersonData[] people = server.getPeople(); >+ PersonData[] people = client.getPeople(); > for (int i = 0; i < people.length && adminId == -1; i++) { > if (USER.equals(people[i].getUserId())) { > adminId = people[i].getId(); >@@ -228,8 +220,8 @@ > return adminId; > } > >- private static TaskData getTestTask(XPlannerServer server, UserStoryData userStory) throws RemoteException { >- TaskData testTask = findTestTask(server, userStory); >+ private static TaskData getTestTask(XPlannerClient client, UserStoryData userStory) throws RemoteException { >+ TaskData testTask = findTestTask(client, userStory); > > if (testTask == null) { > testTask = new TaskData(); >@@ -240,15 +232,15 @@ > testTask.setEstimatedHours(24.0); > testTask.setActualHours(7.0); > testTask.setDispositionName("planned"); //$NON-NLS-1$ >- testTask.setAcceptorId(getAdminId(server)); >+ testTask.setAcceptorId(getAdminId(client)); > > Calendar taskCreate = Calendar.getInstance(); > taskCreate.setTime(new Date()); > testTask.setCreatedDate(taskCreate); > >- testTask = server.addTask(testTask); >+ testTask = client.addTask(testTask); > >- server.refreshDetails(); >+ client.refreshDetails(); > } > > return testTask; >@@ -261,26 +253,26 @@ > return taskList; > } > >- public static UserStoryData findTestUserStory(XPlannerServer server) throws RemoteException { >+ public static UserStoryData findTestUserStory(XPlannerClient client) throws RemoteException { > UserStoryData testUserStory = null; > >- ProjectData testProject = findTestProject(server); >+ ProjectData testProject = findTestProject(client); > if (testProject != null) { >- IterationData testIteration = findTestIteration(server, testProject); >+ IterationData testIteration = findTestIteration(client, testProject); > if (testIteration != null) { >- testUserStory = findTestUserStory(server, testIteration); >+ testUserStory = findTestUserStory(client, testIteration); > } > } > > return testUserStory; > } > >- public static TaskData findTestTask(XPlannerServer server) throws RemoteException { >+ public static TaskData findTestTask(XPlannerClient client) throws RemoteException { > TaskData testTask = null; > >- UserStoryData testUserStory = findTestUserStory(server); >+ UserStoryData testUserStory = findTestUserStory(client); > if (testUserStory != null) { >- testTask = findTestTask(server, testUserStory); >+ testTask = findTestTask(client, testUserStory); > } > > return testTask; >@@ -289,26 +281,26 @@ > /** > * setUpTestData() needs to be called before this method > */ >- public static XPlannerTask getTestXPlannerTask(XPlannerServer server) throws Exception { >+ public static XPlannerTask getTestXPlannerTask(XPlannerClient client) throws Exception { > TaskRepository repository = getRepository(); > AbstractRepositoryConnector connector = >- TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >+ TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getConnectorKind()); > >- TaskData testTask = findTestTask(server); >- Task task = connector.createTaskFromExistingKey(repository, "" + testTask.getId()); >+ TaskData testTask = findTestTask(client); >+ AbstractTask task = connector.createTaskFromExistingId(repository, "" + testTask.getId(), new NullProgressMonitor()); > return (XPlannerTask) task; > } > > /** > * setUpTestData() needs to be called before this method > */ >- public static XPlannerTask getTestXPlannerUserStoryTask(XPlannerServer server) throws Exception { >+ public static XPlannerTask getTestXPlannerUserStoryTask(XPlannerClient client) throws Exception { > TaskRepository repository = getRepository(); > AbstractRepositoryConnector connector = >- TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >+ TasksUiPlugin.getRepositoryManager().getRepositoryConnector(repository.getConnectorKind()); > >- UserStoryData testUserStory = findTestUserStory(server); >- Task task = connector.createTaskFromExistingKey(repository, "" + testUserStory.getId()); >+ UserStoryData testUserStory = findTestUserStory(client); >+ AbstractTask task = connector.createTaskFromExistingId(repository, "" + testUserStory.getId(), new NullProgressMonitor()); > return (XPlannerTask) task; > } > >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/sandbox/org.eclipse.mylyn.xplanner.tests/META-INF/MANIFEST.MF,v >retrieving revision 1.1 >diff -u -r1.1 MANIFEST.MF >--- META-INF/MANIFEST.MF 31 May 2007 07:37:16 -0000 1.1 >+++ META-INF/MANIFEST.MF 26 Jun 2007 17:41:21 -0000 >@@ -1,13 +1,14 @@ > Manifest-Version: 1.0 > Bundle-ManifestVersion: 2 > Bundle-Name: @bundleName >-Bundle-SymbolicName: org.eclipse.mylar.xplanner.tests >-Bundle-Version: 1.0.0 >+Bundle-SymbolicName: org.eclipse.mylyn.xplanner.tests >+Bundle-Version: 1.1.0.qualifer > Bundle-Localization: plugin > Require-Bundle: org.junit, > org.eclipse.core.runtime, > org.eclipse.ui, >- org.eclipse.mylar.tasks.core, >- org.eclipse.mylar.tasks.ui, >- org.eclipse.mylar.xplanner.core, >- org.eclipse.mylar.xplanner.ui >+ org.eclipse.mylyn.tasks.core, >+ org.eclipse.mylyn.tasks.ui, >+ org.eclipse.mylyn.xplanner.core, >+ org.eclipse.mylyn.xplanner.ui, >+ org.eclipse.search
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 130240
:
68621
| 72505 |
72506
|
72508
|
73739