Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-06-14 01:11:50 +0000
committerspingel2009-06-14 01:11:50 +0000
commit44c2a5df795179f2750fa3f84cc4b9f58a92c113 (patch)
treec8dcc4aa669d0134e7ba285487580752e9450e98 /org.eclipse.mylyn.trac.ui
parent1fbda3496447ed471f5e929fab036be0168a403e (diff)
downloadorg.eclipse.mylyn.tasks-44c2a5df795179f2750fa3f84cc4b9f58a92c113.tar.gz
org.eclipse.mylyn.tasks-44c2a5df795179f2750fa3f84cc4b9f58a92c113.tar.xz
org.eclipse.mylyn.tasks-44c2a5df795179f2750fa3f84cc4b9f58a92c113.zip
NEW - bug 175211: Support Trac 0.11
https://bugs.eclipse.org/bugs/show_bug.cgi?id=175211
Diffstat (limited to 'org.eclipse.mylyn.trac.ui')
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorPageFactory.java6
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/Messages.java2
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracRepositorySettingsPage.java35
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/messages.properties1
4 files changed, 35 insertions, 9 deletions
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorPageFactory.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorPageFactory.java
index 80ea25b65..11921d212 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorPageFactory.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorPageFactory.java
@@ -53,7 +53,11 @@ public class TracTaskEditorPageFactory extends AbstractTaskEditorPageFactory {
@Override
public String[] getConflictingIds(TaskEditorInput input) {
- return new String[] { ITasksUiConstants.ID_PAGE_PLANNING };
+ if (TracRepositoryConnector.hasRichEditor(input.getTaskRepository())) {
+ return new String[] { ITasksUiConstants.ID_PAGE_PLANNING };
+ } else {
+ return super.getConflictingIds(input);
+ }
}
@Override
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/Messages.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/Messages.java
index 3df17dd34..0d40bbbc3 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/Messages.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/Messages.java
@@ -101,6 +101,8 @@ public class Messages extends NLS {
public static String TracRepositorySettingsPage_Authentication_credentials_are_valid;
+ public static String TracRepositorySettingsPage_Authentication_credentials_valid_Update_to_latest_XmlRpcPlugin_Warning;
+
public static String TracRepositorySettingsPage_Automatic__Use_Validate_Settings_;
public static String TracRepositorySettingsPage_EXAMPLE_HTTP_TRAC_EDGEWALL_ORG;
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracRepositorySettingsPage.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracRepositorySettingsPage.java
index 5952282d4..79366bbc9 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracRepositorySettingsPage.java
@@ -17,6 +17,9 @@ 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.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
import org.eclipse.mylyn.internal.trac.core.TracClientFactory;
import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
@@ -25,12 +28,14 @@ import org.eclipse.mylyn.internal.trac.core.client.TracException;
import org.eclipse.mylyn.internal.trac.core.client.TracLoginException;
import org.eclipse.mylyn.internal.trac.core.client.TracPermissionDeniedException;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
+import org.eclipse.mylyn.internal.trac.core.model.TracRepositoryInfo;
import org.eclipse.mylyn.internal.trac.ui.TracUiPlugin;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.RepositoryTemplate;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.TaskRepositoryLocationFactory;
import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -162,7 +167,7 @@ public class TracRepositorySettingsPage extends AbstractRepositorySettingsPage {
private final TaskRepository taskRepository;
- private final Version version;
+ private Version version;
private Version result;
@@ -199,21 +204,22 @@ public class TracRepositorySettingsPage extends AbstractRepositorySettingsPage {
public void validate(IProgressMonitor monitor) throws MalformedURLException, TracException {
AbstractWebLocation location = new TaskRepositoryLocationFactory().createWebLocation(taskRepository);
+ TracRepositoryInfo info;
if (version != null) {
ITracClient client = TracClientFactory.createClient(location, version);
- client.validate(monitor);
+ info = client.validate(monitor);
} else {
// probe version: XML-RPC access first, then web
// access
try {
- ITracClient client = TracClientFactory.createClient(location, Version.XML_RPC);
- client.validate(monitor);
- result = Version.XML_RPC;
+ version = Version.XML_RPC;
+ ITracClient client = TracClientFactory.createClient(location, version);
+ info = client.validate(monitor);
} catch (TracException e) {
try {
- ITracClient client = TracClientFactory.createClient(location, Version.TRAC_0_9);
- client.validate(monitor);
- result = Version.TRAC_0_9;
+ version = Version.TRAC_0_9;
+ ITracClient client = TracClientFactory.createClient(location, version);
+ info = client.validate(monitor);
if (e instanceof TracPermissionDeniedException) {
setStatus(RepositoryStatus.createStatus(repositoryUrl, IStatus.INFO,
@@ -226,7 +232,20 @@ public class TracRepositorySettingsPage extends AbstractRepositorySettingsPage {
throw new TracException();
}
}
+ result = version;
}
+
+ if (version == Version.XML_RPC && info.isApiVersion(1, 0, 0)) {
+ setStatus(RepositoryStatus.createStatus(repositoryUrl, IStatus.INFO, TracUiPlugin.ID_PLUGIN,
+ Messages.TracRepositorySettingsPage_Authentication_credentials_valid_Update_to_latest_XmlRpcPlugin_Warning));
+ }
+
+ MultiStatus status = new MultiStatus(TracUiPlugin.ID_PLUGIN, 0, NLS.bind("Validation results for {0}", //$NON-NLS-1$
+ taskRepository.getRepositoryLabel()), null);
+ status.add(new Status(IStatus.INFO, TracUiPlugin.ID_PLUGIN, NLS.bind("Version: {0}", info.toString()))); //$NON-NLS-1$
+ status.add(new Status(IStatus.INFO, TracUiPlugin.ID_PLUGIN,
+ NLS.bind("Access Type: {0}", version.toString()))); //$NON-NLS-1$
+ StatusHandler.log(status);
}
public Version getResult() {
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/messages.properties b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/messages.properties
index 5d39ba92d..b2edab1b3 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/messages.properties
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/messages.properties
@@ -38,6 +38,7 @@ TracQueryPage_Version=Version
TracRepositorySettingsPage_Access_Type_=Access Type:
TracRepositorySettingsPage_Authentication_credentials_are_valid=Authentication credentials are valid. Note: Insufficient permissions for XML-RPC access, falling back to web access.
+TracRepositorySettingsPage_Authentication_credentials_valid_Update_to_latest_XmlRpcPlugin_Warning=Authentication credentials are valid. Note: An update to the latest version of Trac's XmlRpcPlugin is recommended.
TracRepositorySettingsPage_Automatic__Use_Validate_Settings_=Automatic (Use Validate Settings)
TracRepositorySettingsPage_EXAMPLE_HTTP_TRAC_EDGEWALL_ORG=Example: http://trac.edgewall.org
TracRepositorySettingsPage_No_Trac_repository_found_at_url=No Trac repository found at url

Back to the top