Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 218350

Summary: Print web page output to Web Connector Query page
Product: z_Archived Reporter: Bee <bfrey>
Component: MylynAssignee: Eugene Kuleshov <ekuleshov>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Bee CLA 2008-02-08 12:44:38 EST
While creating generic web-query tasklists, it is very painful to attempt to figure out what is wrong with your regex. I've also found that the source code in "view source" in both IE and Firefox can be different than what mylar sees using the apache commons http classes. 

Could another textbox be added to the bottom of the query creator box that when you hit the preview button, it displays the source that it downloaded? My query should work perfectly fine, but for some reason it keeps getting rejected. My guess is the code that is downloaded through the http class is different from the code I am seeing.
Comment 1 Eugene Kuleshov CLA 2008-02-08 13:26:31 EST
Marking as duplicate of 195658

Please also see the following FAQ entry that suggests a workaround that allows to see the actually retrieved page.
http://wiki.eclipse.org/Mylyn_FAQ#Why_can.27t_I_connect_using_one_of_the_existing_templates.3F

*** This bug has been marked as a duplicate of bug 195658 ***
Comment 2 Bee CLA 2008-02-08 13:29:55 EST
Thank you for the quick response. I attempted to use the query pattern:
(.+?)(\n)

to see the fully resolved page, but then instead I get an error on the top of the edit repository query dialog that says:

 Parsing error: invalid handle for task, can not contain: -, was: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

The url doesn't have any wierd characters:

${serverUrl}/tmtrack.dll?ReportPage&Template=reports%2Flist&reportid=1634

any other ideas before I finally end up going the wget route?
Comment 3 Eugene Kuleshov CLA 2008-02-08 13:43:21 EST
(In reply to comment #2)
> Thank you for the quick response. I attempted to use the query pattern:
> (.+?)(\n)
> 
> to see the fully resolved page, but then instead I get an error on the top of
> the edit repository query dialog that says:
> 
>  Parsing error: invalid handle for task, can not contain: -, was: <!DOCTYPE
> HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
>
> any other ideas before I finally end up going the wget route?

Right. The trick with (.+?)(\n) pattern is basically telling connector that each string will be an id and there won't be any description (that is an old convention, that first matching group is id and second is description). However Mylyn core puts some restrictions on the task ids, so you are getting the error. You can try to trick it using named matching patterns:

({Description}.+?)({Id}\n)

If that won't work, it would be easier to use wget.
Comment 4 Bee CLA 2008-02-08 15:47:35 EST
Thank you very much. That second query worked perfectly. Turns out, if I open the page in the web browser component of Eclipse and log into the page, yet leave the repository as anonymous, it doesn't store the login info from the web browser session, as I thought it used to. So it wasn't authenticating me, and I was getting an error page. 

Thanks again for such a great tool!
Comment 5 Eugene Kuleshov CLA 2008-02-08 16:18:39 EST
(In reply to comment #4)
> ... Turns out, if I open the page in the web browser component of Eclipse 
> and log into the page, yet leave the repository as anonymous, it doesn't
> store the login info from the web browser session, as I thought it used to.
> So it wasn't authenticating me, and I was getting an error page. 

Right. You need to use "Advanced configuration" in the web connector repository properties to specify login config. There is also bug 163120 about propagating connector auth back to the web browser.