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 31935 Details for
Bug 106990
[connector] CollabNet IssueZilla/IssueTracker
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.
CollabNet support
patch-bugzilla.core.search.txt (text/plain), 8.91 KB, created by
Marco
on 2005-12-19 04:47:38 EST
(
hide
)
Description:
CollabNet support
Filename:
MIME Type:
Creator:
Marco
Created:
2005-12-19 04:47:38 EST
Size:
8.91 KB
patch
obsolete
>Index: src/org/eclipse/mylar/bugzilla/core/search/BugzillaSearchEngine.java >=================================================================== >RCS file: /home/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/bugzilla/core/search/BugzillaSearchEngine.java,v >retrieving revision 1.11 >diff -u -r1.11 BugzillaSearchEngine.java >--- src/org/eclipse/mylar/bugzilla/core/search/BugzillaSearchEngine.java 4 Nov 2005 22:48:12 -0000 1.11 >+++ src/org/eclipse/mylar/bugzilla/core/search/BugzillaSearchEngine.java 18 Dec 2005 17:44:41 -0000 >@@ -56,6 +56,21 @@ > /** regular expression matching Bugzilla query results format used in v2.12 */ > protected static final RegularExpression reOld = new RegularExpression("<a href=\"show_bug.cgi\\?id=(\\d+)\">\\d+</a>\\s*<td class=severity><nobr>([^>]+)</nobr><td class=priority><nobr>([^>]+)</nobr><td class=platform><nobr>([^>]*)</nobr><td class=owner><nobr>([^>]*)</nobr><td class=status><nobr>([^>]*)</nobr><td class=resolution><nobr>([^>]*)</nobr><td class=summary>(.*)$", "i"); > >+ /** regular expression matching CollabNET query result format */ >+ private static final RegularExpression reColVal1 = new RegularExpression("<span class=\"issue_type\">([^>]+)</span>", "i"); >+ >+ private static final RegularExpression reColVal2 = new RegularExpression("<span class=\"priority\">([^>]+)</span>", "i"); >+ >+ private static final RegularExpression reColVal3 = new RegularExpression("<span class=\"platform\">([^>]+)</span>", "i"); >+ >+ private static final RegularExpression reColVal4 = new RegularExpression("<span class=\"owner\">([^>]+)</span>", "i"); >+ >+ private static final RegularExpression reColVal5 = new RegularExpression("<span class=\"status\">([^>]+)</span>", "i"); >+ >+ private static final RegularExpression reColVal6 = new RegularExpression("<span class=\"resolution\">([^>]+)</span>", "i"); >+ >+ private static final RegularExpression reColVal7 = new RegularExpression("<span class=\"summary\">([^>]+)</span>", "i"); >+ > private String urlString; > > private boolean maxReached = false; >@@ -130,6 +145,29 @@ > * <pre> > * <A HREF="show_bug.cgi?id=8">8</A> <td class=severity><nobr>blo</nobr><td class=priority><nobr>P1</nobr><td class=platform><nobr>PC</nobr><td class=owner><nobr>cubranic@cs.ubc.ca</nobr><td class=status><nobr>CLOS</nobr><td class=resolution><nobr>DUPL</nobr><td class=summary>"Document root" missing when querying on files and revisions > * </pre> >+ * >+ * <p>Or CollabNET format : >+ * >+ * <pre> >+ * <td> >+ * <a href="show_bug.cgi?id=1">1</a> >+ * </td> >+ * <td class="red"><span class="issue_type">DEFECT</span> >+ * </td> >+ * <td class="red"><span class="priority">P2</span> >+ * </td> >+ * <td class="red"><span class="platform">All</span> >+ * </td> >+ * <td class="red"><span class="owner">euxx</span> >+ * </td> >+ * <td class="red"><span class="status">NEW</span> >+ * </td> >+ * <td class="red"><span class="resolution"></span> >+ * </td> >+ * <td class="red"><span class="summary">Security context is not getting propagated</span> >+ * </td> >+ * </pre> >+ * > * @param collector - The collector for the search results > * @param startMatches - The number of matches to start with for the progress monitor > * @param maxMatches - the maximum number of matches to return or -1 for unlimited >@@ -218,17 +256,52 @@ > numCollected++; > > } else if (re.matches(line, match)) { >- RegularExpression regularExpression; >- if (BugzillaPlugin.getDefault().isServerCompatability220()) { >- regularExpression = reValueBugzilla220; >- } else { >- regularExpression = reValue; >- } > > int id = Integer.parseInt(match.getCapturedText(1)); >- BugzillaSearchHit hit = createHit(regularExpression, monitor, in, match, id); >+ >+ Match m1 = new Match(); >+ Match m2 = new Match(); >+ Match m3 = new Match(); >+ >+ BugzillaSearchHit hit = null; >+ >+ do{ >+ >+ if (monitor.isCanceled()) { >+ throw new OperationCanceledException("Search cancelled"); >+ } >+ line = in.readLine(); >+ if (line == null) break; >+ line = line.trim(); >+ >+ reColVal1.matches(line,m1); >+ reValueBugzilla220.matches(line,m2); >+ reValue.matches(line,m3); >+ >+ }while((m1==null) && (m2==null) && (m2==null)); >+ >+ // RegularExpression regularExpression; >+ >+ if(m1!=null) { >+ >+ hit = createHit(monitor, in, m1, id); >+ >+ }else if (m2!=null) { >+ >+ // regularExpression = reValueBugzilla220; >+ hit = createHit(reValueBugzilla220, monitor, in, m2, id); >+ >+ } >+ if(m3!=null) { >+ >+ // regularExpression = reValue; >+ hit = createHit(reValue, monitor, in, m3, id); >+ >+ } >+ > collector.accept(hit); > numCollected++; >+ > } > if (monitor.isCanceled()) { > throw new OperationCanceledException("Search cancelled"); >@@ -281,16 +354,90 @@ > else > return status; > } >+ >+ // Create BugzillaSearchHit for CollabNET server >+ public static BugzillaSearchHit createHit(IProgressMonitor monitor, BufferedReader in, Match match, int id) throws IOException { >+ >+ String line; >+ >+ String severity = "none"; >+ >+ try{ >+ >+ severity = match.getCapturedText(1); >+ >+ }catch(Exception e){ >+ >+ } >+ >+ String priority = "none"; >+ String platform = "none"; >+ String owner = "none"; >+ String state = "none"; >+ String result = "none"; >+ String summary = "none"; >+ >+ do { >+ >+ if (monitor.isCanceled()) { >+ throw new OperationCanceledException("Search cancelled"); >+ } >+ line = in.readLine(); >+ if (line == null) break; >+ line = line.trim(); >+ >+ if(priority.equals("none")) priority = readPriority(line); >+ if(platform.equals("none")) platform = readPlatform(line); >+ if(owner.equals("none")) owner = readOwner(line); >+ if(state.equals("none")) state = readStatus(line); >+ if(result.equals("none")) result = readResolution(line); >+ if(summary.equals("none")) summary = readSummary(line); >+ >+ } while (summary.equals("none")); >+ >+ String description = "<activate to view description>"; >+ String server = "<unknown server>"; >+ String query = ""; >+ >+ try { >+ String recentQuery = BugzillaPlugin.getMostRecentQuery(); >+ if (recentQuery != null) query = recentQuery; >+ server = BugzillaPlugin.getDefault().getServerName(); >+ } catch (Exception e) { >+ // ignore, for testing >+ } >+ >+ return new BugzillaSearchHit(id, description, severity, priority, platform, state, result, owner, query, server); >+ >+ } > >+ // Create BugzillaSearchHit for Bugzilla server > public static BugzillaSearchHit createHit(RegularExpression regularExpression, IProgressMonitor monitor, BufferedReader in, Match match, int id) throws IOException { >+ >+ int start = 0; >+ > String line; >+ > String severity = null; >+ >+ try{ >+ >+ severity = match.getCapturedText(1); >+ start = 1; >+ >+ }catch(Exception e){ >+ >+ } >+ > String priority = null; > String platform = null; > String owner = null; > String state = null; > String result = null; >- for (int i = 0; i < 6; i++) { >+ >+ if(severity!=null) start = 1; >+ >+ for (int i = start; i < 6; i++) { > do { > if (monitor.isCanceled()) { > throw new OperationCanceledException("Search cancelled"); >@@ -341,8 +488,94 @@ > BugzillaSearchHit hit = new BugzillaSearchHit(id, description, severity, priority, platform, state, result, owner, query, server); > return hit; > } >- >+ > public boolean isMaxReached() { > return maxReached; > } >+ >+ // Read attributes from String >+ public static String readPriority(String line) { >+ >+ Match match = new Match(); >+ >+ if (reColVal2.matches(line, match)) { >+ >+ return match.getCapturedText(1); >+ >+ } >+ >+ return "none"; >+ >+ } >+ >+ public static String readPlatform(String line) { >+ >+ Match match = new Match(); >+ >+ if (reColVal3.matches(line, match)) { >+ >+ return match.getCapturedText(1); >+ >+ } >+ >+ return "none"; >+ >+ } >+ >+ public static String readOwner(String line) { >+ >+ Match match = new Match(); >+ >+ if (reColVal4.matches(line, match)) { >+ >+ return match.getCapturedText(1); >+ >+ } >+ >+ return "none"; >+ >+ } >+ >+ public static String readStatus(String line) { >+ >+ Match match = new Match(); >+ >+ if (reColVal5.matches(line, match)) { >+ >+ return match.getCapturedText(1); >+ >+ } >+ >+ return "none"; >+ >+ } >+ >+ public static String readResolution(String line) { >+ >+ Match match = new Match(); >+ >+ if (reColVal6.matches(line, match)) { >+ >+ return match.getCapturedText(1); >+ >+ } >+ >+ return "none"; >+ >+ } >+ >+ public static String readSummary(String line) { >+ >+ Match match = new Match(); >+ >+ if (reColVal7.matches(line, match)) { >+ >+ return match.getCapturedText(1); >+ >+ } >+ >+ return "none"; >+ >+ } >+ > }
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 Raw
Actions:
View
Attachments on
bug 106990
:
31935
|
33757
|
34145
|
34502
|
35718
|
36052
|
36551