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 139095 Details for
Bug 223173
Action list not correct when using custom workflow with trac 0.11
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]
updated patch
clipboard.txt (text/plain), 9.55 KB, created by
Steffen Pingel
on 2009-06-13 06:08:45 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Steffen Pingel
Created:
2009-06-13 06:08:45 EDT
Size:
9.55 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.trac.core >Index: src/org/eclipse/mylyn/internal/trac/core/model/TracTicket.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracTicket.java,v >retrieving revision 1.16 >diff -u -r1.16 TracTicket.java >--- src/org/eclipse/mylyn/internal/trac/core/model/TracTicket.java 13 Jan 2009 07:05:20 -0000 1.16 >+++ src/org/eclipse/mylyn/internal/trac/core/model/TracTicket.java 13 Jun 2009 10:10:14 -0000 >@@ -84,7 +84,7 @@ > > private List<TracAttachment> attachments; > >- private String[] actions; >+ private TracAction[] actions; > > private String[] resolutions; > >@@ -206,11 +206,11 @@ > return (attachments != null) ? attachments.toArray(new TracAttachment[0]) : null; > } > >- public void setActions(String[] actions) { >+ public void setActions(TracAction[] actions) { > this.actions = actions; > } > >- public String[] getActions() { >+ public TracAction[] getActions() { > return actions; > } > >Index: src/org/eclipse/mylyn/internal/trac/core/TracTaskDataHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskDataHandler.java,v >retrieving revision 1.67 >diff -u -r1.67 TracTaskDataHandler.java >--- src/org/eclipse/mylyn/internal/trac/core/TracTaskDataHandler.java 13 Jun 2009 07:06:24 -0000 1.67 >+++ src/org/eclipse/mylyn/internal/trac/core/TracTaskDataHandler.java 13 Jun 2009 10:10:14 -0000 >@@ -12,7 +12,6 @@ > package org.eclipse.mylyn.internal.trac.core; > > import java.util.ArrayList; >-import java.util.Arrays; > import java.util.Collection; > import java.util.Date; > import java.util.HashSet; >@@ -28,6 +27,7 @@ > import org.eclipse.mylyn.commons.net.Policy; > import org.eclipse.mylyn.internal.trac.core.client.ITracClient; > import org.eclipse.mylyn.internal.trac.core.client.InvalidTicketException; >+import org.eclipse.mylyn.internal.trac.core.model.TracAction; > import org.eclipse.mylyn.internal.trac.core.model.TracAttachment; > import org.eclipse.mylyn.internal.trac.core.model.TracComment; > import org.eclipse.mylyn.internal.trac.core.model.TracTicket; >@@ -208,41 +208,35 @@ > } > } > >- String[] actions = ticket.getActions(); >+ TracAction[] actions = ticket.getActions(); > if (actions != null) { >- // add operations in a defined order >- List<String> actionList = new ArrayList<String>(Arrays.asList(actions)); >- addOperation(repository, data, ticket, actionList, "leave"); //$NON-NLS-1$ >- addOperation(repository, data, ticket, actionList, "accept"); //$NON-NLS-1$ >- addOperation(repository, data, ticket, actionList, "resolve"); //$NON-NLS-1$ >- addOperation(repository, data, ticket, actionList, "reopen"); //$NON-NLS-1$ >+ for (TracAction action : actions) { >+ addOperation(repository, data, ticket, action); >+ } > } > > return changedAttributes; > } > >- private static void addOperation(TaskRepository repository, TaskData data, TracTicket ticket, List<String> actions, >- String action) { >- if (!actions.remove(action)) { >- return; >- } >- >- String label = null; >- if ("leave".equals(action)) { //$NON-NLS-1$ >- // TODO provide better label for Leave action >- //label = "Leave as " + data.getStatus() + " " + data.getResolution(); >- label = "Leave"; //$NON-NLS-1$ >- } else if ("accept".equals(action)) { //$NON-NLS-1$ >- label = "Accept"; //$NON-NLS-1$ >- } else if ("resolve".equals(action)) { //$NON-NLS-1$ >- label = "Resolve as"; //$NON-NLS-1$ >- } else if ("reopen".equals(action)) { //$NON-NLS-1$ >- label = "Reopen"; //$NON-NLS-1$ >+ private static void addOperation(TaskRepository repository, TaskData data, TracTicket ticket, TracAction action) { >+ String label = action.getName(); >+ if (label == null) { >+ if ("leave".equals(action.getId())) { //$NON-NLS-1$ >+ // TODO provide better label for Leave action >+ //label = "Leave as " + data.getStatus() + " " + data.getResolution(); >+ label = "Leave"; >+ } else if ("accept".equals(action.getId())) { //$NON-NLS-1$ >+ label = "Accept"; >+ } else if ("resolve".equals(action.getId())) { //$NON-NLS-1$ >+ label = "Resolve as"; >+ } else if ("reopen".equals(action.getId())) { //$NON-NLS-1$ >+ label = "Reopen"; >+ } > } > > if (label != null) { > TaskAttribute attribute = data.getRoot().createAttribute(TaskAttribute.PREFIX_OPERATION + action); >- TaskOperation.applyTo(attribute, action, label); >+ TaskOperation.applyTo(attribute, action.getId(), label); > if ("resolve".equals(action)) { //$NON-NLS-1$ > attribute.getMetaData().putValue(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID, > TracAttribute.RESOLUTION.getTracKey()); >@@ -551,6 +545,7 @@ > ticket.putValue("status", TracRepositoryConnector.TaskStatus.NEW.toStatusString()); //$NON-NLS-1$ > } > } >+ ticket.putValue("action", action); //$NON-NLS-1$ > } > > return ticket; >Index: src/org/eclipse/mylyn/internal/trac/core/client/TracXmlRpcClient.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracXmlRpcClient.java,v >retrieving revision 1.17 >diff -u -r1.17 TracXmlRpcClient.java >--- src/org/eclipse/mylyn/internal/trac/core/client/TracXmlRpcClient.java 13 Jun 2009 07:04:31 -0000 1.17 >+++ src/org/eclipse/mylyn/internal/trac/core/client/TracXmlRpcClient.java 13 Jun 2009 10:10:14 -0000 >@@ -55,6 +55,7 @@ > import org.eclipse.mylyn.commons.net.UnsupportedRequestException; > import org.eclipse.mylyn.commons.net.WebUtil; > import org.eclipse.mylyn.internal.trac.core.TracCorePlugin; >+import org.eclipse.mylyn.internal.trac.core.model.TracAction; > import org.eclipse.mylyn.internal.trac.core.model.TracAttachment; > import org.eclipse.mylyn.internal.trac.core.model.TracComment; > import org.eclipse.mylyn.internal.trac.core.model.TracComponent; >@@ -461,7 +462,7 @@ > ticket.addAttachment(parseAttachment((Object[]) item)); > } > >- String[] actions = getActions(id, monitor); >+ TracAction[] actions = getActions(id, monitor); > ticket.setActions(actions); > > updateAttributes(new NullProgressMonitor(), false); >@@ -860,13 +861,34 @@ > return result; > } > >- public String[] getActions(int id, IProgressMonitor monitor) throws TracException { >- Object[] actions = (Object[]) call(monitor, "ticket.getAvailableActions", id); //$NON-NLS-1$ >- String[] result = new String[actions.length]; >- for (int i = 0; i < result.length; i++) { >- result[i] = (String) actions[i]; >+ public TracAction[] getActions(int id, IProgressMonitor monitor) throws TracException { >+ if (supportsWorkFlow(monitor)) { >+ Object[] actions = (Object[]) call(monitor, "ticket.getActions", id); //$NON-NLS-1$ >+ TracAction[] result = new TracAction[actions.length]; >+ for (int i = 0; i < result.length; i++) { >+ Object[] entry = (Object[]) actions[i]; >+ TracAction action = new TracAction((String) entry[0]); >+ action.setName((String) entry[0]); // FIXME pretty name >+ //action.setHint((String) entry[3]); >+ Object[] inputs = (Object[]) entry[1]; >+ for (Object input2 : inputs) { >+ Object[] input = (Object[]) input2; >+ //String defaultValue = input[1]; >+ Object[] options = (Object[]) input[2]; >+ for (Object option : options) { >+ } >+ } >+ result[i] = action; >+ } >+ return result; >+ } else { >+ Object[] actions = (Object[]) call(monitor, "ticket.getAvailableActions", id); //$NON-NLS-1$ >+ TracAction[] result = new TracAction[actions.length]; >+ for (int i = 0; i < result.length; i++) { >+ result[i] = new TracAction((String) actions[i]); >+ } >+ return result; > } >- return result; > } > > public Date getTicketLastChanged(Integer id, IProgressMonitor monitor) throws TracException { >Index: src/org/eclipse/mylyn/internal/trac/core/model/TracAction.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/trac/core/model/TracAction.java >diff -N src/org/eclipse/mylyn/internal/trac/core/model/TracAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/trac/core/model/TracAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,72 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers 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.internal.trac.core.model; >+ >+import java.util.Map; >+ >+/** >+ * @author Steffen Pingel >+ */ >+public class TracAction { >+ >+ private Map<String, String> fields; >+ >+ private String hint; >+ >+ private String id; >+ >+ private String name; >+ >+ private String value; >+ >+ public TracAction(String id) { >+ this.id = id; >+ } >+ >+ public Map<String, String> getFields() { >+ return fields; >+ } >+ >+ public String getHint() { >+ return hint; >+ } >+ >+ public String getId() { >+ return id; >+ } >+ >+ public String getName() { >+ return name; >+ } >+ >+ public String getValue() { >+ return value; >+ } >+ >+ public void setFields(Map<String, String> fields) { >+ this.fields = fields; >+ } >+ >+ public void setHint(String hint) { >+ this.hint = hint; >+ } >+ >+ public void setId(String id) { >+ this.id = id; >+ } >+ >+ public void setName(String name) { >+ this.name = name; >+ } >+ >+ public void setValue(String value) { >+ this.value = value; >+ } >+ >+}
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 223173
:
106544
|
106546
| 139095 |
139103