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 33757 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.
[patch]
CollabNet support
patch-bugzilla.core.search.txt (text/plain), 10.56 KB, created by
Marco
on 2006-01-28 17:14:37 EST
(
hide
)
Description:
CollabNet support
Filename:
MIME Type:
Creator:
Marco
Created:
2006-01-28 17:14:37 EST
Size:
10.56 KB
patch
obsolete
>Index: BugzillaSearchEngine.java >=================================================================== >RCS file: /home/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/search/BugzillaSearchEngine.java,v >retrieving revision 1.2 >diff -u -r1.2 BugzillaSearchEngine.java >--- BugzillaSearchEngine.java 25 Jan 2006 20:53:01 -0000 1.2 >+++ BugzillaSearchEngine.java 28 Jan 2006 22:13:00 -0000 >@@ -59,6 +59,14 @@ > "<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"); > >+ 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 TaskRepository repository; >@@ -243,18 +251,41 @@ > 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)); >+ 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(); >+ >+ } while(!reColVal1.matches(line, m1) && !reValueBugzilla220.matches(line, m2) && !reValue.matches(line, m3)); >+ if(reColVal1.matches(line, m1)) >+ { >+ hit = createHit(monitor, in, m1, repository.getUrl().toExternalForm(), id); >+ } else >+ if(reValueBugzilla220.matches(line, m2)) >+ { >+ hit = createHit(reValueBugzilla220, monitor, in, m2, repository.getUrl().toExternalForm(), id); >+ } >+ if(reValue.matches(line, m3)) >+ { >+ hit = createHit(reValue, monitor, in, m3, repository.getUrl().toExternalForm(), id); >+ } >+ collector.accept(hit); >+ numCollected++; > >- int id = Integer.parseInt(match.getCapturedText(1)); >- BugzillaSearchHit hit = createHit(regularExpression, monitor, in, match, repository.getUrl() >- .toExternalForm(), id); >- collector.accept(hit); >- numCollected++; > } > if (monitor.isCanceled()) { > throw new OperationCanceledException("Search cancelled"); >@@ -307,46 +338,141 @@ > return status; > } > >+ public static BugzillaSearchHit createHit(IProgressMonitor monitor, BufferedReader in, Match match, String serverUrl, int id) >+ throws IOException >+{ >+ String severity = "none"; >+ try >+ { >+ severity = match.getCapturedText(1); >+ } >+ catch(Exception exception) { } >+ 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"); >+ } >+ String 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 exception1) { } >+ return new BugzillaSearchHit(serverUrl, id, description, severity, priority, platform, state, >+ result, owner, query); >+} >+ > public static BugzillaSearchHit createHit(RegularExpression regularExpression, IProgressMonitor monitor, > BufferedReader in, Match match, String serverUrl, int id) throws IOException { >- String line; >- String severity = null; >- String priority = null; >- String platform = null; >- String owner = null; >- String state = null; >- String result = null; >- for (int i = 0; i < 6; i++) { >- do { >- if (monitor.isCanceled()) { >- throw new OperationCanceledException("Search cancelled"); >- } >- line = in.readLine(); >- if (line == null) >- break; >- line = line.trim(); >- } while (!regularExpression.matches(line, match)); >- switch (i) { >- case 0: >- severity = match.getCapturedText(1); >- break; >- case 1: >- priority = match.getCapturedText(1); >- break; >- case 2: >- platform = match.getCapturedText(1); >- break; >- case 3: >- owner = match.getCapturedText(1); >- break; >- case 4: >- state = match.getCapturedText(1); >- break; >- case 5: >- result = match.getCapturedText(1); >- break; >- } >- } >+ >+ int start = 0; >+ String severity = null; >+ try >+ { >+ severity = match.getCapturedText(1); >+ start = 1; >+ } >+ catch(Exception exception) { } >+ String priority = null; >+ String platform = null; >+ String owner = null; >+ String state = null; >+ String result = null; >+ if(severity != null) >+ { >+ start = 1; >+ } >+ String line; >+ for(int i = start; i < 6; i++) >+ { >+ do >+ { >+ if(monitor.isCanceled()) >+ { >+ throw new OperationCanceledException("Search cancelled"); >+ } >+ line = in.readLine(); >+ if(line == null) >+ { >+ break; >+ } >+ line = line.trim(); >+ } while(!regularExpression.matches(line, match)); >+ switch(i) >+ { >+ case 0: // '\0' >+ severity = match.getCapturedText(1); >+ break; >+ >+ case 1: // '\001' >+ priority = match.getCapturedText(1); >+ break; >+ >+ case 2: // '\002' >+ platform = match.getCapturedText(1); >+ break; >+ >+ case 3: // '\003' >+ owner = match.getCapturedText(1); >+ break; >+ >+ case 4: // '\004' >+ state = match.getCapturedText(1); >+ break; >+ >+ case 5: // '\005' >+ result = match.getCapturedText(1); >+ break; >+ } >+ } > > // two more > line = in.readLine(); >@@ -372,7 +498,80 @@ > return hit; > } > >- public boolean isMaxReached() { >- return maxReached; >- } >+ public boolean isMaxReached() >+ { >+ return maxReached; >+ } >+ >+ public static String readPriority(String line) >+ { >+ Match match = new Match(); >+ if(reColVal2.matches(line, match)) >+ { >+ return match.getCapturedText(1); >+ } else >+ { >+ return "none"; >+ } >+ } >+ >+ public static String readPlatform(String line) >+ { >+ Match match = new Match(); >+ if(reColVal3.matches(line, match)) >+ { >+ return match.getCapturedText(1); >+ } else >+ { >+ return "none"; >+ } >+ } >+ >+ public static String readOwner(String line) >+ { >+ Match match = new Match(); >+ if(reColVal4.matches(line, match)) >+ { >+ return match.getCapturedText(1); >+ } else >+ { >+ return "none"; >+ } >+ } >+ >+ public static String readStatus(String line) >+ { >+ Match match = new Match(); >+ if(reColVal5.matches(line, match)) >+ { >+ return match.getCapturedText(1); >+ } else >+ { >+ return "none"; >+ } >+ } >+ >+ public static String readResolution(String line) >+ { >+ Match match = new Match(); >+ if(reColVal6.matches(line, match)) >+ { >+ return match.getCapturedText(1); >+ } else >+ { >+ return "none"; >+ } >+ } >+ >+ public static String readSummary(String line) >+ { >+ Match match = new Match(); >+ if(reColVal7.matches(line, match)) >+ { >+ return match.getCapturedText(1); >+ } else >+ { >+ 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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 106990
:
31935
|
33757
|
34145
|
34502
|
35718
|
36052
|
36551