private string character encoding public abstract report factory input stream in stream string encoding this in stream in stream this character encoding encoding characterencoding abstractreportfactory inputstream instream instream instream characterencoding expects rdf returned from repository ctype rdf in url throws general security exception protected void collect results default handler content handler boolean clean throws io exception if in stream null return final buffered input stream is new buffered input stream in stream 1024 input stream iis new input stream override public int read throws io exception int c while c is read 1 if xml util is valid char c return c return 1 reader in if character encoding null in new input stream reader iis character encoding else in new input stream reader iis if clean string buffer result xml cleaner clean in string reader str reader new string reader result to string in new buffered reader str reader try final xml reader reader xml reader factory createxml reader reader set content handler content handler entity resolver resolver new entity resolver public input source resolve entity string public id string system id throws sax exception io exception the default resolver will try to resolve the dtd via url connection since we don t have need of entity resolving currently we just supply a dummy empty resource for each request input source source new input source source set character stream new string reader return source reader set entity resolver resolver reader set error handler new error handler public void error sax parse exception exception throws sax exception throw exception public void fatal error sax parse exception exception throws sax exception throw exception public void warning sax parse exception exception throws sax exception throw exception reader parse new input source in catch sax exception e if e get message equals i bugzilla constants error invalid username or password throw new login exception e get message else throw new io exception e get message generalsecurityexception collectresults defaulthandler contenthandler ioexception instream bufferedinputstream bufferedinputstream instream inputstream inputstream ioexception xmlutil isvalid characterencoding inputstreamreader characterencoding inputstreamreader stringbuffer xmlcleaner stringreader strreader stringreader tostring bufferedreader strreader xmlreader xmlreaderfactory createxmlreader setcontenthandler contenthandler entityresolver entityresolver inputsource resolveentity publicid systemid saxexception ioexception urlconnection inputsource inputsource setcharacterstream stringreader setentityresolver seterrorhandler errorhandler saxparseexception saxexception fatalerror saxparseexception saxexception saxparseexception saxexception inputsource saxexception getmessage ibugzillaconstants error_invalid_username_or_password loginexception getmessage ioexception getmessage reader set error handler new error handler public void error sax parse exception exception throws sax exception throw exception seterrorhandler errorhandler saxparseexception saxexception public void fatal error sax parse exception exception throws sax exception throw exception fatalerror saxparseexception saxexception input stream iis new input stream override public int read throws io exception int c while c is read 1 if xml util is valid char c return c return 1 inputstream inputstream ioexception xmlutil isvalid public input source resolve entity string public id string system id throws sax exception io exception the default resolver will try to resolve the dtd via url connection since we don t have need of entity resolving currently we just supply a dummy empty resource for each request input source source new input source source set character stream new string reader return source inputsource resolveentity publicid systemid saxexception ioexception urlconnection inputsource inputsource setcharacterstream stringreader public void warning sax parse exception exception throws sax exception throw exception saxparseexception saxexception private i task attachment attachment public attachment part source i task attachment attachment this attachment attachment itaskattachment attachmentpartsource itaskattachment public input stream create input stream throws io exception return attachment create input stream inputstream createinputstream ioexception createinputstream public string get file name return attachment get filename getfilename getfilename public long get length return attachment get length getlength getlength private bugzilla repository connector connector public bugzilla attachment handler bugzilla repository connector connector this connector connector bugzillarepositoryconnector bugzillaattachmenthandler bugzillarepositoryconnector override public boolean can deprecate task repository repository repository attachment attachment return false candeprecate taskrepository repositoryattachment override public boolean can download attachment task repository repository abstract task task return true candownloadattachment taskrepository abstracttask override public boolean can upload attachment task repository repository abstract task task return true canuploadattachment taskrepository abstracttask override public input stream get attachment as stream task repository repository repository attachment attachment i progress monitor monitor throws core exception try bugzilla client client connector get client manager get client repository return client get attachment data attachment get id catch io exception e throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error io repository get url e inputstream getattachmentasstream taskrepository repositoryattachment iprogressmonitor coreexception bugzillaclient getclientmanager getclient getattachmentdata getid ioexception coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_io geturl override public void update attachment task repository repository repository attachment attachment throws core exception implement updateattachment taskrepository repositoryattachment coreexception override public void upload attachment task repository repository abstract task task i task attachment attachment string comment i progress monitor monitor throws core exception try string bug id task get task id bugzilla client client connector get client manager get client repository client post attachment bug id comment attachment catch io exception e throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error io repository get url e uploadattachment taskrepository abstracttask itaskattachment iprogressmonitor coreexception bugid gettaskid bugzillaclient getclientmanager getclient postattachment bugid ioexception coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_io geturl override public date get date for attribute type string attribute key string date string if date string null date string equals return null try string mapped key map common attribute key attribute key date parsed date null if mapped key equals bugzilla report element delta ts get key string parsed date new simple date format delta ts format parse date string else if mapped key equals bugzilla report element creation ts get key string parsed date new simple date format creation ts format parse date string else if mapped key equals bugzilla report element bug when get key string parsed date new simple date format comment creation ts format parse date string else if mapped key equals bugzilla report element date get key string parsed date new simple date format attachment creation ts format parse date string return parsed date catch exception e return null throw new core exception new status i status error bugzilla plugin plugin id 0 error parsing date string date string e getdateforattributetype attributekey datestring datestring datestring mappedkey mapcommonattributekey attributekey parseddate mappedkey bugzillareportelement delta_ts getkeystring parseddate simpledateformat delta_ts_format datestring mappedkey bugzillareportelement creation_ts getkeystring parseddate simpledateformat creation_ts_format datestring mappedkey bugzillareportelement bug_when getkeystring parseddate simpledateformat comment_creation_ts_format datestring mappedkey bugzillareportelement getkeystring parseddate simpledateformat attachment_creation_ts_format datestring parseddate coreexception istatus bugzillaplugin plugin_id datestring override public string get name string key try return bugzilla report element value of key trim to upper case locale english to string catch illegal argument exception e return unknown getname bugzillareportelement valueof touppercase tostring illegalargumentexception override public boolean is hidden string key try return bugzilla report element value of key trim to upper case locale english is hidden catch illegal argument exception e return false ishidden bugzillareportelement valueof touppercase ishidden illegalargumentexception override public boolean is read only string key try return bugzilla report element value of key trim to upper case locale english is read only catch illegal argument exception e return true isreadonly bugzillareportelement valueof touppercase isreadonly illegalargumentexception override public string map common attribute key string key if key equals repository task attribute new cc return bugzilla report element newcc get key string else if key equals repository task attribute comment date return bugzilla report element bug when get key string else if key equals repository task attribute comment author was user owner return bugzilla report element who get key string else if key equals repository task attribute user cc return bugzilla report element cc get key string else if key equals repository task attribute comment text return bugzilla report element thetext get key string else if key equals repository task attribute date creation return bugzilla report element creation ts get key string else if key equals repository task attribute description return bugzilla report element desc get key string else if key equals repository task attribute attachment id return bugzilla report element attachid get key string else if key equals repository task attribute attachment type return bugzilla report element type get key string else if key equals repository task attribute attachment ctype return bugzilla report element ctype get key string else if key equals repository task attribute user assigned return bugzilla report element assigned to get key string else if key equals repository task attribute resolution return bugzilla report element resolution get key string else if key equals repository task attribute status return bugzilla report element bug status get key string else if key equals repository task attribute date modified return bugzilla report element delta ts get key string else if key equals repository task attribute user reporter return bugzilla report element reporter get key string else if key equals repository task attribute summary return bugzilla report element short desc get key string else if key equals repository task attribute product return bugzilla report element product get key string else if key equals repository task attribute date creation return bugzilla report element creation ts get key string else if key equals repository task attribute keywords return bugzilla report element keywords get key string else if key equals repository task attribute attachment date return bugzilla report element date get key string else if key equals repository task attribute add self cc return bugzilla report element addselfcc get key string else if key equals repository task attribute priority return bugzilla report element priority get key string else if key equals repository task attribute comment new return bugzilla report element new comment get key string else return key mapcommonattributekey repositorytaskattribute new_cc bugzillareportelement getkeystring repositorytaskattribute comment_date bugzillareportelement bug_when getkeystring repositorytaskattribute comment_author user_owner bugzillareportelement getkeystring repositorytaskattribute user_cc bugzillareportelement getkeystring repositorytaskattribute comment_text bugzillareportelement getkeystring repositorytaskattribute date_creation bugzillareportelement creation_ts getkeystring repositorytaskattribute bugzillareportelement getkeystring repositorytaskattribute attachment_id bugzillareportelement getkeystring repositorytaskattribute attachment_type bugzillareportelement getkeystring repositorytaskattribute attachment_ctype bugzillareportelement getkeystring repositorytaskattribute user_assigned bugzillareportelement assigned_to getkeystring repositorytaskattribute bugzillareportelement getkeystring repositorytaskattribute bugzillareportelement bug_status getkeystring repositorytaskattribute date_modified bugzillareportelement delta_ts getkeystring repositorytaskattribute user_reporter bugzillareportelement getkeystring repositorytaskattribute bugzillareportelement short_desc getkeystring repositorytaskattribute bugzillareportelement getkeystring repositorytaskattribute date_creation bugzillareportelement creation_ts getkeystring repositorytaskattribute bugzillareportelement getkeystring repositorytaskattribute attachment_date bugzillareportelement getkeystring repositorytaskattribute add_self_cc bugzillareportelement getkeystring repositorytaskattribute bugzillareportelement getkeystring repositorytaskattribute comment_new bugzillareportelement new_comment getkeystring public static bugzilla client create client string host url string username string password string ht auth user string ht auth pass proxy proxy string encoding map string string config parameters throws malformedurl exception url url new url host url bugzilla client client new bugzilla client url username password ht auth user ht auth pass encoding config parameters client set proxy proxy return client bugzillaclient createclient hosturl htauthuser htauthpass configparameters malformedurlexception hosturl bugzillaclient bugzillaclient htauthuser htauthpass configparameters setproxy public static bugzilla client create client string host url string username string password string ht auth user string ht auth pass proxy proxy string encoding throws malformedurl exception return create client host url username password ht auth user ht auth pass proxy encoding new hash map string string bugzillaclient createclient hosturl htauthuser htauthpass malformedurlexception createclient hosturl htauthuser htauthpass hashmap public void authenticate throws core exception if has authentication credentials authenticated false throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error repository login repository url to string authentication credentials missing post method post method null try web client util setup http client http client proxy repository url to string ht auth user ht auth pass name value pair form data new name value pair 2 form data 0 new name value pair i bugzilla constants post input bugzilla login username form data 1 new name value pair i bugzilla constants post input bugzilla password password post method new post method web client util get request path repository url to string i bugzilla constants url post login post method set request header content type application x www form urlencoded charset character encoding post method set request body form data post method set do authentication true post method get params set parameter http method params retry handler new bugzilla retry handler http client get http connection manager get params set connection timeout web client util connnect timeout post method set follow redirects false http client get params set authentication preemptive true int code http client execute method post method if code httpurl connection http unauthorized code httpurl connection http forbidden authenticated false post method get response body post method release connection throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error repository login repository url to string http authentication failed else if code httpurl connection http proxy auth authenticated false post method get response body post method release connection throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error repository login repository url to string proxy authentication required else if code httpurl connection http ok authenticated false post method get response body post method release connection throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error network http error http status get status text code if has authentication credentials buffered reader response reader new buffered reader new input stream reader post method get response body as stream character encoding html stream tokenizer tokenizer new html stream tokenizer response reader null for token token tokenizer next token token get type token eof token tokenizer next token if token get type token tag html tag tag html tag token get value if tag get tag type html tag type a string id tag get attribute href if id null id to lower case locale english contains login required throw new login exception i bugzilla constants invalid credentials response reader close authenticated false throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error repository login repository url to string i bugzilla constants invalid credentials authenticated true catch parse exception e authenticated false throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error internal unable to parse response from repository url to string catch io exception e throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error io repository url to string e finally if post method null post method release connection http client get params set authentication preemptive false coreexception hasauthenticationcredentials coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_repository_login repositoryurl tostring postmethod postmethod webclientutil setuphttpclient httpclient repositoryurl tostring htauthuser htauthpass namevaluepair formdata namevaluepair formdata namevaluepair ibugzillaconstants post_input_bugzilla_login formdata namevaluepair ibugzillaconstants post_input_bugzilla_password postmethod postmethod webclientutil getrequestpath repositoryurl tostring ibugzillaconstants url_post_login postmethod setrequestheader characterencoding postmethod setrequestbody formdata postmethod setdoauthentication postmethod getparams setparameter httpmethodparams retry_handler bugzillaretryhandler httpclient gethttpconnectionmanager getparams setconnectiontimeout webclientutil connnect_timeout postmethod setfollowredirects httpclient getparams setauthenticationpreemptive httpclient executemethod postmethod httpurlconnection http_unauthorized httpurlconnection http_forbidden postmethod getresponsebody postmethod releaseconnection coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_repository_login repositoryurl tostring httpurlconnection http_proxy_auth postmethod getresponsebody postmethod releaseconnection coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_repository_login repositoryurl tostring httpurlconnection http_ok postmethod getresponsebody postmethod releaseconnection coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_network httpstatus getstatustext hasauthenticationcredentials bufferedreader responsereader bufferedreader inputstreamreader postmethod getresponsebodyasstream characterencoding htmlstreamtokenizer htmlstreamtokenizer responsereader nexttoken gettype nexttoken gettype htmltag htmltag getvalue gettagtype htmltag getattribute tolowercase login_required loginexception ibugzillaconstants invalid_credentials responsereader coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_repository_login repositoryurl tostring ibugzillaconstants invalid_credentials parseexception coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_internal repositoryurl tostring ioexception coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_io repositoryurl tostring postmethod postmethod releaseconnection httpclient getparams setauthenticationpreemptive public bugzilla client url url string username string password string ht auth user string ht auth pass string character encoding this url username password ht auth user ht auth pass character encoding new hash map string string bugzillaclient htauthuser htauthpass characterencoding htauthuser htauthpass characterencoding hashmap public bugzilla client url url string username string password string ht auth user string ht auth pass string character encoding map string string config parameters this username username this password password this repository url url this ht auth user ht auth user this ht auth pass ht auth pass this character encoding character encoding this config parameters config parameters bugzillaclient htauthuser htauthpass characterencoding configparameters repositoryurl htauthuser htauthuser htauthpass htauthpass characterencoding characterencoding configparameters configparameters private class bugzilla retry handler extends default http method retry handler public bugzilla retry handler super max retry false bugzillaretryhandler defaulthttpmethodretryhandler bugzillaretryhandler max_retry private void cleanqa contact repository task attribute a if a get id equals bugzilla report element qa contact get key string if true equals config parameters get i bugzilla constants repository setting short login if a get value null a get value length 0 int at index a get value index of if at index 1 string new value a get value substring 0 at index a set value new value cleanqacontact repositorytaskattribute getid bugzillareportelement qa_contact getkeystring configparameters ibugzillaconstants repository_setting_short_login getvalue getvalue atindex getvalue indexof atindex newvalue getvalue atindex setvalue newvalue private head method connect head string requesturl throws io exception core exception web client util setup http client http client proxy requesturl ht auth user ht auth pass for int attempt 0 attempt 2 attempt force authentication if authenticated has authentication credentials authenticate head method head method new head method web client util get request path requesturl if requesturl contains query delimiter head method set query string requesturl substring requesturl index of query delimiter head method set request header content type application x www form urlencoded charset character encoding warning setting browser compatability breaks bugzilla authentication get method get params set cookie policy cookie policy browser compatibility head method get params set parameter http method params retry handler new bugzilla retry handler head method set do authentication true int code try code http client execute method head method catch io exception e head method get response body head method release connection throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error io repository url to string e if code httpurl connection http ok return head method else if code httpurl connection http unauthorized code httpurl connection http forbidden head method get response body login or reauthenticate due to an expired session head method release connection authenticated false authenticate else if code httpurl connection http proxy auth authenticated false head method get response body head method release connection throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error repository login repository url to string proxy authentication required else head method get response body head method release connection throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error network http error http status get status text code throw new io exception http client connection error response code code throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error internal all connection attempts to repository url to string failed please verify connection and authentication information headmethod connecthead ioexception coreexception webclientutil setuphttpclient httpclient htauthuser htauthpass hasauthenticationcredentials headmethod headmethod headmethod webclientutil getrequestpath query_delimiter headmethod setquerystring indexof query_delimiter headmethod setrequestheader characterencoding getmethod getparams setcookiepolicy cookiepolicy browser_compatibility headmethod getparams setparameter httpmethodparams retry_handler bugzillaretryhandler headmethod setdoauthentication httpclient executemethod headmethod ioexception headmethod getresponsebody headmethod releaseconnection coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_io repositoryurl tostring httpurlconnection http_ok headmethod httpurlconnection http_unauthorized httpurlconnection http_forbidden headmethod getresponsebody headmethod releaseconnection httpurlconnection http_proxy_auth headmethod getresponsebody headmethod releaseconnection coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_repository_login repositoryurl tostring headmethod getresponsebody headmethod releaseconnection coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_network httpstatus getstatustext ioexception httpclient coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_internal repositoryurl tostring private get method connect internal string requesturl throws io exception core exception web client util setup http client http client proxy requesturl ht auth user ht auth pass for int attempt 0 attempt 2 attempt force authentication if authenticated has authentication credentials authenticate get method get method new get method web client util get request path requesturl if requesturl contains query delimiter get method set query string requesturl substring requesturl index of query delimiter get method set request header content type application x www form urlencoded charset character encoding warning setting browser compatability breaks bugzilla authentication get method get params set cookie policy cookie policy browser compatibility get method get params set parameter http method params retry handler new bugzilla retry handler get method set do authentication true int code try code http client execute method get method catch io exception e get method get response body get method release connection throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error io repository url to string e if code httpurl connection http ok return get method else if code httpurl connection http unauthorized code httpurl connection http forbidden get method get response body login or reauthenticate due to an expired session get method release connection authenticated false authenticate else if code httpurl connection http proxy auth throw new login exception proxy authentication required authenticated false get method get response body get method release connection throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error repository login repository url to string proxy authentication required else get method get response body get method release connection throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error network http error http status get status text code throw new io exception http client connection error response code code throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error internal all connection attempts to repository url to string failed please verify connection and authentication information getmethod connectinternal ioexception coreexception webclientutil setuphttpclient httpclient htauthuser htauthpass hasauthenticationcredentials getmethod getmethod getmethod webclientutil getrequestpath query_delimiter getmethod setquerystring indexof query_delimiter getmethod setrequestheader characterencoding getmethod getparams setcookiepolicy cookiepolicy browser_compatibility getmethod getparams setparameter httpmethodparams retry_handler bugzillaretryhandler getmethod setdoauthentication httpclient executemethod getmethod ioexception getmethod getresponsebody getmethod releaseconnection coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_io repositoryurl tostring httpurlconnection http_ok getmethod httpurlconnection http_unauthorized httpurlconnection http_forbidden getmethod getresponsebody getmethod releaseconnection httpurlconnection http_proxy_auth loginexception getmethod getresponsebody getmethod releaseconnection coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_repository_login repositoryurl tostring getmethod getresponsebody getmethod releaseconnection coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_network httpstatus getstatustext ioexception httpclient coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_internal repositoryurl tostring public input stream get attachment data string attachment id throws io exception core exception string url repository url i bugzilla constants url get attachment download attachment id get method method get connect url try return method get response body as stream catch io exception e method release connection throw e inputstream getattachmentdata attachmentid ioexception coreexception repositoryurl ibugzillaconstants url_get_attachment_download attachmentid getmethod getconnect getresponsebodyasstream ioexception releaseconnection public static string get bug url without login string repository url string id string url repository url i bugzilla constants url get show bug id return url getbugurlwithoutlogin repositoryurl repositoryurl ibugzillaconstants url_get_show_bug public static string get charset from string string string int charset start index string index of attr charset if charset start index 1 int charset end index string index of charset start index todo could be space after if charset end index 1 charset end index string length string charset string string substring charset start index 8 charset end index if charset available charsets contains key charset string return charset string return null getcharsetfromstring charsetstartindex indexof attr_charset charsetstartindex charsetendindex indexof charsetstartindex charsetendindex charsetendindex charsetstring charsetstartindex charsetendindex availablecharsets containskey charsetstring charsetstring public string get configuration timestamp throws io exception core exception string last modified null head method method null try method connect head repository url config cgi ctype rdf header last modified header method get response header last modified if last modified header null last modified last modified header get value catch exception e ignore finally if method null method release connection return last modified getconfigurationtimestamp ioexception coreexception lastmodified headmethod connecthead repositoryurl lastmodifiedheader getresponseheader lastmodifiedheader lastmodified lastmodifiedheader getvalue releaseconnection lastmodified private get method get connect string serverurl throws io exception core exception return connect internal serverurl getmethod getconnect ioexception coreexception connectinternal public task history get history string task id throws io exception core exception web client util setup http client http client proxy repository url to string ht auth user ht auth pass if authenticated has authentication credentials authenticate get method method null try string url repository url i bugzilla constants show activity task id method get connect url if method null bugzilla task history parser parser new bugzilla task history parser method get response body as stream character encoding try return parser retrieve history catch login exception e authenticated false throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error repository login repository url to string i bugzilla constants invalid credentials catch parse exception e authenticated false throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error internal unable to parse response from repository url to string finally if method null method release connection return null taskhistory gethistory taskid ioexception coreexception webclientutil setuphttpclient httpclient repositoryurl tostring htauthuser htauthpass hasauthenticationcredentials getmethod repositoryurl ibugzillaconstants show_activity taskid getconnect bugzillataskhistoryparser bugzillataskhistoryparser getresponsebodyasstream characterencoding retrievehistory loginexception coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_repository_login repositoryurl tostring ibugzillaconstants invalid_credentials parseexception coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_internal repositoryurl tostring releaseconnection private name value pair get pairs for existing repository task data model map string name value pair fields new hash map string name value pair fields put key form name new name value pair key form name val process bug go through all of the attributes and add them to the bug post for iterator repository task attribute it model get attributes iterator it has next repository task attribute a it next if a null continue else if a get id equals bugzilla report element cc get key string a get id equals repository task attribute remove cc a get id equals bugzilla report element reporter get key string a get id equals bugzilla report element assigned to get key string a get id equals bugzilla report element creation ts get key string continue else if a get id null a get id compare to 0 cleanqa contact a string value a get value if a get id equals bugzilla report element delta ts get key string value strip time zone value fields put a get id new name value pair a get id value null value when posting the bug id is encoded in a hidden field named id fields put key id new name value pair key id model get attribute value bugzilla report element bug id get key string add the operation to the bug post repository operation o model get selected operation if o null fields put key knob new name value pair key knob val none else fields put key knob new name value pair key knob o get knob name if o has options string sel o get option value o get option selection fields put o get option name new name value pair o get option name sel else if o is input string sel o get input value fields put o get input name new name value pair o get input name sel if model get attribute bugzilla report element short desc get key string null fields put key short desc new name value pair key short desc model get attribute bugzilla report element short desc get key string get value if model get new comment length 0 fields put key comment new name value pair key comment model get new comment list string removecc model get attribute values repository task attribute remove cc if removecc null removecc size 0 string s new string removecc size fields put key cc new name value pair key cc to comma separated list removecc to array s fields put key removecc new name value pair key removecc val true return fields values to array new name value pair fields size namevaluepair getpairsforexisting repositorytaskdata namevaluepair hashmap namevaluepair key_form_name namevaluepair key_form_name val_process_bug repositorytaskattribute getattributes hasnext repositorytaskattribute getid bugzillareportelement getkeystring getid repositorytaskattribute remove_cc getid bugzillareportelement getkeystring getid bugzillareportelement assigned_to getkeystring getid bugzillareportelement creation_ts getkeystring getid getid compareto cleanqacontact getvalue getid bugzillareportelement delta_ts getkeystring striptimezone getid namevaluepair getid key_id namevaluepair key_id getattributevalue bugzillareportelement bug_id getkeystring repositoryoperation getselectedoperation key_knob namevaluepair key_knob val_none key_knob namevaluepair key_knob getknobname hasoptions getoptionvalue getoptionselection getoptionname namevaluepair getoptionname isinput getinputvalue getinputname namevaluepair getinputname getattribute bugzillareportelement short_desc getkeystring key_short_desc namevaluepair key_short_desc getattribute bugzillareportelement short_desc getkeystring getvalue getnewcomment key_comment namevaluepair key_comment getnewcomment getattributevalues repositorytaskattribute remove_cc key_cc namevaluepair key_cc tocommaseparatedlist toarray key_removecc namevaluepair key_removecc val_true toarray namevaluepair private name value pair get pairs for new repository task data task data map string name value pair fields new hash map string name value pair go through all of the attributes and add them to the bug post iterator repository task attribute itr task data get attributes iterator while itr has next repository task attribute a itr next if a null a get id null a get id compare to 0 string value null value a get value if value null continue cleanqa contact a fields put a get id new name value pair a get id value if task data get description length 0 fields put key comment new name value pair key comment task data get description return fields values to array new name value pair fields size namevaluepair getpairsfornew repositorytaskdata taskdata namevaluepair hashmap namevaluepair repositorytaskattribute taskdata getattributes hasnext repositorytaskattribute getid getid compareto getvalue cleanqacontact getid namevaluepair getid taskdata getdescription key_comment namevaluepair key_comment taskdata getdescription toarray namevaluepair public proxy get proxy return proxy getproxy public repository configuration get repository configuration throws io exception core exception get method method null try method get connect repository url i bugzilla constants url get config rdf repository configuration factory config factory new repository configuration factory method get response body as stream character encoding repository configuration configuration config factory get configuration if configuration null configuration set repository url repository url to string return configuration return null finally if method null method release connection repositoryconfiguration getrepositoryconfiguration ioexception coreexception getmethod getconnect repositoryurl ibugzillaconstants url_get_config_rdf repositoryconfigurationfactory configfactory repositoryconfigurationfactory getresponsebodyasstream characterencoding repositoryconfiguration configfactory getconfiguration setrepositoryurl repositoryurl tostring releaseconnection public boolean get search hits abstract repository query query i task collector collector throws io exception core exception get method method null try string query url query get url test that we don t specify content type twice should only be specified here not in passed in url if possible if query url contains ctype rdf query url query url concat i bugzilla constants content type rdf method get connect query url if method get response header content type null header response type header method get response header content type for string type valid config content types if response type header get value to lower case locale english contains type repository query results factory query factory new repository query results factory method get response body as stream character encoding query factory perform query repository url to string collector query hit collector max hits return collector get tasks is empty parse html error new buffered reader new input stream reader method get response body as stream character encoding finally if method null method release connection return false getsearchhits abstractrepositoryquery itaskcollector ioexception coreexception getmethod queryurl geturl queryurl queryurl queryurl ibugzillaconstants content_type_rdf getconnect queryurl getresponseheader responsetypeheader getresponseheader valid_config_content_types responsetypeheader getvalue tolowercase repositoryqueryresultsfactory queryfactory repositoryqueryresultsfactory getresponsebodyasstream characterencoding queryfactory performquery repositoryurl tostring queryhitcollector max_hits gettasks isempty parsehtmlerror bufferedreader inputstreamreader getresponsebodyasstream characterencoding releaseconnection public repository task data get task data int id throws io exception core exception get method method null try method get connect repository url i bugzilla constants url get show bug xml id repository task data task data null if method get response header content type null header response type header method get response header content type for string type valid config content types if response type header get value to lower case locale english contains type task data new repository task data new bugzilla attribute factory bugzilla core plugin repository kind repository url to string id i bugzilla constants bugzilla task kind setup existing bug attributes repository url to string task data repository report factory report factory new repository report factory method get response body as stream character encoding report factory populate report task data return task data parse html error new buffered reader new input stream reader method get response body as stream character encoding return null finally if method null method release connection repositorytaskdata gettaskdata ioexception coreexception getmethod getconnect repositoryurl ibugzillaconstants url_get_show_bug_xml repositorytaskdata taskdata getresponseheader responsetypeheader getresponseheader valid_config_content_types responsetypeheader getvalue tolowercase taskdata repositorytaskdata bugzillaattributefactory bugzillacoreplugin repository_kind repositoryurl tostring ibugzillaconstants bugzilla_task_kind setupexistingbugattributes repositoryurl tostring taskdata repositoryreportfactory reportfactory repositoryreportfactory getresponsebodyasstream characterencoding reportfactory populatereport taskdata taskdata parsehtmlerror bufferedreader inputstreamreader getresponsebodyasstream characterencoding releaseconnection public map string repository task data get task data set string task ids throws io exception core exception post method method null hash map string repository task data task data map new hash map string repository task data while task ids size 0 try set string ids to retrieve new hash set string iterator string itr task ids iterator for int x 0 itr has next x max retrieved per query x ids to retrieve add itr next name value pair form data new name value pair ids to retrieve size 2 if ids to retrieve size 0 return task data map itr ids to retrieve iterator int x 0 for itr has next x string task id itr next form data x new name value pair id task id repository task data task data new repository task data new bugzilla attribute factory bugzilla core plugin repository kind repository url to string task id setup existing bug attributes repository url to string task data task data map put task id task data form data x new name value pair ctype xml form data x new name value pair excludefield attachmentdata method post form data i bugzilla constants url post show bug form data if method null throw new io exception could not post form client returned null method if method get response header content type null header response type header method get response header content type for string type valid config content types if response type header get value to lower case locale english contains type multi bug report factory factory new multi bug report factory method get response body as stream character encoding factory populate report task data map task ids remove all ids to retrieve else parse html error new buffered reader new input stream reader method get response body as stream character encoding finally if method null method release connection return task data map repositorytaskdata gettaskdata taskids ioexception coreexception postmethod hashmap repositorytaskdata taskdatamap hashmap repositorytaskdata taskids idstoretrieve hashset taskids hasnext max_retrieved_per_query idstoretrieve namevaluepair formdata namevaluepair idstoretrieve idstoretrieve taskdatamap idstoretrieve hasnext taskid formdata namevaluepair taskid repositorytaskdata taskdata repositorytaskdata bugzillaattributefactory bugzillacoreplugin repository_kind repositoryurl tostring taskid setupexistingbugattributes repositoryurl tostring taskdata taskdatamap taskid taskdata formdata namevaluepair formdata namevaluepair postformdata ibugzillaconstants url_post_show_bug formdata ioexception getresponseheader responsetypeheader getresponseheader valid_config_content_types responsetypeheader getvalue tolowercase multibugreportfactory multibugreportfactory getresponsebodyasstream characterencoding populatereport taskdatamap taskids removeall idstoretrieve parsehtmlerror bufferedreader inputstreamreader getresponsebodyasstream characterencoding releaseconnection taskdatamap protected boolean has authentication credentials return username null username length 0 hasauthenticationcredentials public void logout throws io exception core exception authenticated true string login url repository url relogin cgi get method method null try method get connect login url buffered reader response reader new buffered reader new input stream reader method get response body as stream character encoding html stream tokenizer tokenizer new html stream tokenizer response reader null for token token tokenizer next token token get type token eof token tokenizer next token if token get type token tag html tag tag html tag token get value if tag get tag type html tag type a if tag has attribute href string id tag get attribute href if id null id to lower case locale english contains login required authenticated false return throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error network repository url to string logout unsuccessful catch parse exception e authenticated false throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error internal unable to parse response from repository url to string finally if method null method release connection ioexception coreexception loginurl repositoryurl getmethod getconnect loginurl bufferedreader responsereader bufferedreader inputstreamreader getresponsebodyasstream characterencoding htmlstreamtokenizer htmlstreamtokenizer responsereader nexttoken gettype nexttoken gettype htmltag htmltag getvalue gettagtype htmltag hasattribute getattribute tolowercase login_required coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_network repositoryurl tostring parseexception coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_internal repositoryurl tostring releaseconnection protected static repository task attribute make new attribute org eclipse mylyn internal bugzilla core bugzilla report element tag return attribute factory create attribute tag get key string repositorytaskattribute makenewattribute bugzillareportelement attributefactory createattribute getkeystring utility method for determining what potential error has occurred from a bugzilla html reponse page public void parse html error buffered reader in throws io exception core exception html stream tokenizer tokenizer new html stream tokenizer in null boolean is title false string title string body try for token token tokenizer next token token get type token eof token tokenizer next token body token to string if token get type token tag html tag token get value get tag type html tag type title html tag token get value is end tag is title true continue if is title get all of the data in the title tag if token get type token tag title string buffer token get value to string to lower case locale english continue else if token get type token tag html tag token get value get tag type html tag type title html tag token get value is end tag if title index of login 1 title index of log in 1 title index of invalid 1 title index of password 1 title index of check e mail 1 authenticated false throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error repository login repository url to string title else if title index of i bugzilla constants error midair collision 1 throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status repository collision repository url to string else if title index of i bugzilla constants error comment required 1 throw new core exception new bugzilla status status info bugzilla core plugin plugin id repository status repository comment required else if title index of i bugzilla constants logged out 1 authenticated false throw new bugzilla exception i bugzilla constants logged out throw new core exception new bugzilla status status info bugzilla core plugin plugin id repository status repository logged out you have been logged out please retry operation else if title index of i bugzilla constants changes submitted 1 return throw new core exception repository status create html status repository url to string i status info bugzilla core plugin plugin id repository status error repository a repository error has occurred body catch parse exception e authenticated false throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error internal unable to parse response from repository url to string finally in close parsehtmlerror bufferedreader ioexception coreexception htmlstreamtokenizer htmlstreamtokenizer istitle nexttoken gettype nexttoken tostring gettype htmltag getvalue gettagtype htmltag htmltag getvalue isendtag istitle istitle gettype stringbuffer getvalue tostring tolowercase gettype htmltag getvalue gettagtype htmltag htmltag getvalue isendtag indexof indexof indexof indexof indexof coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_repository_login repositoryurl tostring indexof ibugzillaconstants error_midair_collision coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus repository_collision repositoryurl tostring indexof ibugzillaconstants error_comment_required coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus repository_comment_required indexof ibugzillaconstants logged_out bugzillaexception ibugzillaconstants logged_out coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus repository_logged_out indexof ibugzillaconstants changes_submitted coreexception repositorystatus createhtmlstatus repositoryurl tostring istatus bugzillacoreplugin plugin_id repositorystatus error_repository parseexception coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_internal repositoryurl tostring public void post attachment string bug reportid string comment i task attachment attachment throws http exception io exception core exception todo throw illegal argument exception if passed null parameter web client util setup http client http client proxy repository url to string ht auth user ht auth pass if authenticated has authentication credentials authenticate post method post method null try post method new post method web client util get request path repository url i bugzilla constants url post attachment upload this option causes the client to first check with the server to see if it will in fact receive the post before actually sending the contents post method get params set boolean parameter http method params use expect continue true list part base parts new array list part base parts add new string part i bugzilla constants post input action value action insert character encoding if username null password null parts add new string part i bugzilla constants post input bugzilla login username character encoding parts add new string part i bugzilla constants post input bugzilla password password character encoding parts add new string part i bugzilla constants post input bugid bug reportid character encoding if attachment get description null parts add new string part i bugzilla constants post input description attachment get description character encoding if comment null parts add new string part i bugzilla constants post input comment comment character encoding parts add new file part i bugzilla constants post input data new attachment part source attachment if attachment is patch parts add new string part attribute ispatch value ispatch else parts add new string part attribute contenttypemethod value contenttypemethod manual parts add new string part attribute contenttypeentry attachment get content type post method set request entity new multipart request entity parts to array new part 1 post method get params post method set do authentication true http client get http connection manager get params set connection timeout connect timeout int status http client execute method post method if status http status sc ok input stream reader reader new input stream reader post method get response body as stream post method get response char set buffered reader buffered reader new buffered reader reader parse html error buffered reader else post method get response body throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error network repository url to string http error http status get status text status throw new io exception communication error occurred during upload n n http status get status text status finally if post method null post method release connection postattachment bugreportid itaskattachment httpexception ioexception coreexception illegalargumentexception webclientutil setuphttpclient httpclient repositoryurl tostring htauthuser htauthpass hasauthenticationcredentials postmethod postmethod postmethod postmethod webclientutil getrequestpath repositoryurl ibugzillaconstants url_post_attachment_upload postmethod getparams setbooleanparameter httpmethodparams use_expect_continue partbase arraylist partbase stringpart ibugzillaconstants post_input_action value_action_insert characterencoding stringpart ibugzillaconstants post_input_bugzilla_login characterencoding stringpart ibugzillaconstants post_input_bugzilla_password characterencoding stringpart ibugzillaconstants post_input_bugid bugreportid characterencoding getdescription stringpart ibugzillaconstants post_input_description getdescription characterencoding stringpart ibugzillaconstants post_input_comment characterencoding filepart ibugzillaconstants post_input_data attachmentpartsource ispatch stringpart attribute_ispatch value_ispatch stringpart attribute_contenttypemethod value_contenttypemethod_manual stringpart attribute_contenttypeentry getcontenttype postmethod setrequestentity multipartrequestentity toarray postmethod getparams postmethod setdoauthentication httpclient gethttpconnectionmanager getparams setconnectiontimeout connect_timeout httpclient executemethod postmethod httpstatus sc_ok inputstreamreader inputstreamreader postmethod getresponsebodyasstream postmethod getresponsecharset bufferedreader bufferedreader bufferedreader parsehtmlerror bufferedreader postmethod getresponsebody coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_network repositoryurl tostring httpstatus getstatustext ioexception httpstatus getstatustext postmethod postmethod releaseconnection calling method must release the connection on the returned post method once finished todo refactor throws core exception private post method post form data string form url name value pair form data throws io exception core exception post method post method null web client util setup http client http client proxy repository url to string ht auth user ht auth pass if authenticated has authentication credentials authenticate post method new post method web client util get request path repository url to string form url post method set request header content type application x www form urlencoded charset character encoding up the timout on sockets for posts bug 175054 http client get http connection manager get params set so timeout web client util connnect timeout post method get params set parameter http method params retry handler new bugzilla retry handler post method set request body form data post method set do authentication true http client get http connection manager get params set connection timeout connect timeout int status http client execute method post method if status http status sc ok return post method else post method get response body post method release connection status manager log post failed http status get status text status this throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error io repository url to string new io exception communication error occurred during upload n n http status get status text status throw new io exception communication error occurred during upload n n http status get status text status postmethod coreexception postmethod postformdata formurl namevaluepair formdata ioexception coreexception postmethod postmethod webclientutil setuphttpclient httpclient repositoryurl tostring htauthuser htauthpass hasauthenticationcredentials postmethod postmethod webclientutil getrequestpath repositoryurl tostring formurl postmethod setrequestheader characterencoding httpclient gethttpconnectionmanager getparams setsotimeout webclientutil connnect_timeout postmethod getparams setparameter httpmethodparams retry_handler bugzillaretryhandler postmethod setrequestbody formdata postmethod setdoauthentication httpclient gethttpconnectionmanager getparams setconnectiontimeout connect_timeout httpclient executemethod postmethod httpstatus sc_ok postmethod postmethod getresponsebody postmethod releaseconnection statusmanager httpstatus getstatustext coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_io repositoryurl tostring ioexception httpstatus getstatustext ioexception httpstatus getstatustext public string post task data repository task data task data throws io exception core exception name value pair form data null string prefix null string prefix2 null string postfix null string postfix2 null if task data null return null else if task data is new form data get pairs for new task data prefix i bugzilla constants form prefix bug 218 prefix2 i bugzilla constants form prefix bug 220 postfix i bugzilla constants form postfix 216 postfix2 i bugzilla constants form postfix 218 else form data get pairs for existing task data string result null post method method null try if task data is new method post form data post bug cgi form data else method post form data process bug cgi form data if method null throw new io exception could not post form client returned null method buffered reader in new buffered reader new input stream reader method get response body as stream method get request char set in mark 10 html stream tokenizer tokenizer new html stream tokenizer in null boolean existing bug posted false boolean is title false string title for token token tokenizer next token token get type token eof token tokenizer next token if token get type token tag html tag token get value get tag type html tag type title html tag token get value is end tag is title true continue if is title get all of the data in the title tag if token get type token tag title string buffer token get value to string to lower case locale english continue else if token get type token tag html tag token get value get tag type html tag type title html tag token get value is end tag if task data is new title to lower case locale english index of processed 1 existing bug posted true else if task data is new prefix null prefix2 null postfix null postfix2 null int start index 1 int start index prefix title to lower case locale english index of prefix to lower case locale english int start index prefix2 title to lower case locale english index of prefix2 to lower case locale english if start index prefix 1 start index prefix2 1 if start index prefix 1 start index start index prefix prefix length else start index start index prefix2 prefix2 length int stop index title to lower case locale english index of postfix to lower case locale english start index if stop index 1 stop index title to lower case locale english index of postfix2 to lower case locale english start index if stop index 1 result title substring start index stop index trim break if task data is new existing bug posted true task data is new result null in reset parse html error in return result catch parse exception e authenticated false throw new core exception new bugzilla status status error bugzilla core plugin plugin id repository status error internal unable to parse response from repository url to string finally if method null method release connection posttaskdata repositorytaskdata taskdata ioexception coreexception namevaluepair formdata taskdata taskdata isnew formdata getpairsfornew taskdata ibugzillaconstants form_prefix_bug_218 ibugzillaconstants form_prefix_bug_220 ibugzillaconstants form_postfix_216 ibugzillaconstants form_postfix_218 formdata getpairsforexisting taskdata postmethod taskdata isnew postformdata post_bug_cgi formdata postformdata process_bug_cgi formdata ioexception bufferedreader bufferedreader inputstreamreader getresponsebodyasstream getrequestcharset htmlstreamtokenizer htmlstreamtokenizer existingbugposted istitle nexttoken gettype nexttoken gettype htmltag getvalue gettagtype htmltag htmltag getvalue isendtag istitle istitle gettype stringbuffer getvalue tostring tolowercase gettype htmltag getvalue gettagtype htmltag htmltag getvalue isendtag taskdata isnew tolowercase indexof existingbugposted taskdata isnew startindex startindexprefix tolowercase indexof tolowercase startindexprefix2 tolowercase indexof tolowercase startindexprefix startindexprefix2 startindexprefix startindex startindexprefix startindex startindexprefix2 stopindex tolowercase indexof tolowercase startindex stopindex stopindex tolowercase indexof tolowercase startindex stopindex startindex stopindex taskdata isnew existingbugposted taskdata isnew parsehtmlerror parseexception coreexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_internal repositoryurl tostring releaseconnection override public boolean retry method http method method io exception exception int execution count if super retry method method exception execution count int so timeout http client get http connection manager get params get so timeout http client get http connection manager get params set so timeout so timeout 2 int connect timeout http client get http connection manager get params get connection timeout http client get http connection manager get params set connection timeout connect timeout 2 return true return false retrymethod httpmethod ioexception executioncount retrymethod executioncount sotimeout httpclient gethttpconnectionmanager getparams getsotimeout httpclient gethttpconnectionmanager getparams setsotimeout sotimeout connecttimeout httpclient gethttpconnectionmanager getparams getconnectiontimeout httpclient gethttpconnectionmanager getparams setconnectiontimeout connecttimeout public void set proxy proxy proxy this proxy proxy setproxy public static void setup existing bug attributes string server url repository task data existing report ordered list of elements as they appear in ui and additional elements that may not appear in the incoming xml stream but need to be present for bug submission not always dirty state handling bugzilla report element report elements bugzilla report element short desc bugzilla report element bug status bugzilla report element resolution bugzilla report element bug id bugzilla report element rep platform bugzilla report element product bugzilla report element op sys bugzilla report element component bugzilla report element version bugzilla report element priority bugzilla report element bug severity bugzilla report element assigned to bugzilla report element target milestone bugzilla report element reporter bugzilla report element dependson bugzilla report element blocked bugzilla report element bug file loc bugzilla report element newcc bugzilla report element keywords bugzilla report element cc bugzilla report element new comment bugzilla report element qa contact bugzilla report element status whiteboard bugzilla report element deadline for bugzilla report element element report elements repository task attribute report attribute bugzilla client make new attribute element existing report add attribute element get key string report attribute setupexistingbugattributes serverurl repositorytaskdata existingreport bugzillareportelement reportelements bugzillareportelement short_desc bugzillareportelement bug_status bugzillareportelement bugzillareportelement bug_id bugzillareportelement rep_platform bugzillareportelement bugzillareportelement op_sys bugzillareportelement bugzillareportelement bugzillareportelement bugzillareportelement bug_severity bugzillareportelement assigned_to bugzillareportelement target_milestone bugzillareportelement bugzillareportelement bugzillareportelement bugzillareportelement bug_file_loc bugzillareportelement bugzillareportelement bugzillareportelement bugzillareportelement new_comment bugzillareportelement qa_contact bugzillareportelement status_whiteboard bugzillareportelement bugzillareportelement reportelements repositorytaskattribute reportattribute bugzillaclient makenewattribute existingreport addattribute getkeystring reportattribute public static string strip time zone string long time string result long time if long time null string values long time split if values null values length 2 result values 0 values 1 return result striptimezone longtime longtime longtime longtime private static string to comma separated list string strings string buffer buffer new string buffer for int i 0 i strings length i buffer append strings i if i strings length 1 buffer append return buffer to string tocommaseparatedlist stringbuffer stringbuffer tostring public void validate throws io exception core exception get method method null try logout method get connect repository url finally if method null method release connection ioexception coreexception getmethod getconnect repositoryurl releaseconnection private map string bugzilla client client by url new hash map string bugzilla client public bugzilla client manager bugzillaclient clientbyurl hashmap bugzillaclient bugzillaclientmanager public synchronized bugzilla client get client task repository task repository throws malformedurl exception bugzilla client client client by url get task repository get url if client null string ht user task repository get http user null task repository get http user string ht pass task repository get http password null task repository get http password client bugzilla client factory create client task repository get url task repository get user name task repository get password ht user ht pass task repository get proxy task repository get character encoding task repository get properties client by url put task repository get url client return client bugzillaclient getclient taskrepository taskrepository malformedurlexception bugzillaclient clientbyurl taskrepository geturl htuser taskrepository gethttpuser taskrepository gethttpuser htpass taskrepository gethttppassword taskrepository gethttppassword bugzillaclientfactory createclient taskrepository geturl taskrepository getusername taskrepository getpassword htuser htpass taskrepository getproxy taskrepository getcharacterencoding taskrepository getproperties clientbyurl taskrepository geturl public void repositories read ignore repositoriesread public synchronized void repository added task repository repository make sure there is no stale client still in the cache bug 149939 client by url remove repository get url repositoryadded taskrepository clientbyurl geturl public synchronized void repository removed task repository repository client by url remove repository get url repositoryremoved taskrepository clientbyurl geturl public synchronized void repository settings changed task repository repository client by url remove repository get url repositorysettingschanged taskrepository clientbyurl geturl public for testing public static void add repository configuration repository configuration config repository configurations remove config get repository url repository configurations put config get repository url config addrepositoryconfiguration repositoryconfiguration repositoryconfigurations getrepositoryurl repositoryconfigurations getrepositoryurl public bugzilla core plugin super java2buzilla platform map put x86 pc java2buzilla platform map put x86 64 pc java2buzilla platform map put ia64 pc java2buzilla platform map put ia64 32 pc java2buzilla platform map put sparc sun java2buzilla platform map put ppc power bugzillacoreplugin java2buzillaplatformmap java2buzillaplatformmap x86_64 java2buzillaplatformmap java2buzillaplatformmap ia64_32 java2buzillaplatformmap java2buzillaplatformmap returns the path to the file caching bug reports created while offline protected i path get cached bug report path i path state location platform get state location bugzilla core plugin get default get bundle i path bug file state location append bug reports return bug file ipath getcachedbugreportpath ipath statelocation getstatelocation bugzillacoreplugin getdefault getbundle ipath bugfile statelocation bugreports bugfile public static map string repository configuration get configurations if cache file read read repository configuration file cache file read true return repository configurations repositoryconfiguration getconfigurations cachefileread readrepositoryconfigurationfile cachefileread repositoryconfigurations public static bugzilla core plugin get default return instance bugzillacoreplugin getdefault for testing purposes public static repository configuration get repository configuration string repository url return repository configurations get repository url repositoryconfiguration getrepositoryconfiguration repositoryurl repositoryconfigurations repositoryurl retrieves the latest repository configuration from the server public static repository configuration get repository configuration task repository repository boolean force refresh throws core exception try if cache file read read repository configuration file cache file read true if repository configurations get repository get url null force refresh bugzilla client client connector get client manager get client repository repository configuration config client get repository configuration if config null add repository configuration config return repository configurations get repository get url catch exception e throw new core exception new status status error bugzilla core plugin plugin id 1 error updating attributes n n e get message e repositoryconfiguration getrepositoryconfiguration taskrepository forcerefresh coreexception cachefileread readrepositoryconfigurationfile cachefileread repositoryconfigurations geturl forcerefresh bugzillaclient getclientmanager getclient repositoryconfiguration getrepositoryconfiguration addrepositoryconfiguration repositoryconfigurations geturl coreexception bugzillacoreplugin plugin_id getmessage convenience method for logging statuses to the plugin log param status the status to log public static void log i status status get default get log log status istatus getdefault getlog convenience method for logging exceptions to the plugin log param e the exception to log public static void log exception e string message e get message if e get message null message e get class to string log new status status error bugzilla core plugin plugin id 0 message e getmessage getmessage getclass tostring bugzillacoreplugin plugin_id public for testing public static void read repository configuration file i path config file get product configuration cache path if repository configuration file null repository configuration file exists return object input stream in null try in new object input stream new file input stream repository configuration file int size in read int for int nx 0 nx size nx repository configuration item repository configuration in read object if item null repository configurations put item get repository url item catch exception e log e try if in null in close if repository configuration file null repository configuration file exists if repository configuration file delete successfully deleted else log new status status error bugzilla core plugin plugin id 0 error deleting configuration e catch exception ex log new status status error bugzilla core plugin plugin id 0 error deleting configuration e finally if in null try in close catch io exception e ignore readrepositoryconfigurationfile ipath configfile getproductconfigurationcachepath repositoryconfigurationfile repositoryconfigurationfile objectinputstream objectinputstream fileinputstream repositoryconfigurationfile readint repositoryconfiguration repositoryconfiguration readobject repositoryconfigurations getrepositoryurl repositoryconfigurationfile repositoryconfigurationfile repositoryconfigurationfile bugzillacoreplugin plugin_id error_deleting_configuration bugzillacoreplugin plugin_id error_deleting_configuration ioexception public for testing public static void remove configuration repository configuration config repository configurations remove config get repository url removeconfiguration repositoryconfiguration repositoryconfigurations getrepositoryurl public static void set configuration cache file file file repository configuration file file setconfigurationcachefile repositoryconfigurationfile static void set connector bugzilla repository connector the connector connector the connector setconnector bugzillarepositoryconnector theconnector theconnector public void set platform options repository task data new bug model try get os lookup map check that the result is in values if it is not set it to other repository task attribute op sys attribute new bug model get attribute bugzilla report element op sys get key string repository task attribute platform attribute new bug model get attribute bugzilla report element rep platform get key string string os platform getos string platform platform getos arch string bugzillaos null bugzilla string for os string bugzilla platform null bugzilla string for platform bugzillaos system get property os name system get property os version we start with the most specific value as the search string if we didn t find it we remove the last part of the version string or the os name from the search string and continue with the test until we found it or the search string is empty the search in casesensitive if op sys attribute null while bugzillaos null op sys attribute get option parameter bugzillaos null int dotindex bugzillaos last index of if dotindex 0 bugzillaos bugzillaos substring 0 dotindex else int spaceindex bugzillaos last index of if spaceindex 0 bugzillaos bugzillaos substring 0 spaceindex else bugzillaos null else bugzillaos null if platform null java2buzilla platform map contains key platform bugzilla platform java2buzilla platform map get platform bugzilla knows the following platforms all pc macintosh other platform getos arch returns x86 on intel mac s and ppc on power mac s so bugzilla platform is power or pc if the os is macosx we change the platform to macintosh if bugzilla platform null bugzilla platform compare to power 0 bugzilla platform compare to pc 0 os null os compare to macosx 0 bugzilla platform macintosh else if platform attribute null platform attribute get option parameter bugzilla platform null if the platform we found is not int the list of available optinos set the bugzilla platform to null and juse use other bugzilla platform null set the os and the platform in the task data if bugzillaos null op sys attribute null op sys attribute set value bugzillaos else if op sys attribute null op sys attribute get option parameter option all null op sys attribute set value option all if bugzilla platform null platform attribute null platform attribute set value bugzilla platform else if op sys attribute null platform attribute null platform attribute get option parameter option all null op sys attribute set value option all catch exception e status handler fail e could not set platform options false setplatformoptions repositorytaskdata newbugmodel repositorytaskattribute opsysattribute newbugmodel getattribute bugzillareportelement op_sys getkeystring repositorytaskattribute platformattribute newbugmodel getattribute bugzillareportelement rep_platform getkeystring getosarch bugzillaplatform getproperty getproperty opsysattribute opsysattribute getoptionparameter lastindexof lastindexof java2buzillaplatformmap containskey bugzillaplatform java2buzillaplatformmap getosarch bugzillaplatform bugzillaplatform bugzillaplatform compareto bugzillaplatform compareto compareto bugzillaplatform platformattribute platformattribute getoptionparameter bugzillaplatform bugzillaplatform taskdata opsysattribute opsysattribute setvalue opsysattribute opsysattribute getoptionparameter option_all opsysattribute setvalue option_all bugzillaplatform platformattribute platformattribute setvalue bugzillaplatform opsysattribute platformattribute platformattribute getoptionparameter option_all opsysattribute setvalue option_all statushandler override public void start bundle context context throws exception super start context instance this bundlecontext override public void stop bundle context context throws exception if repository configurations is empty write repository config file instance null super stop context bundlecontext repositoryconfigurations isempty writerepositoryconfigfile public for testing public static void write repository config file i path config file get product configuration cache path if repository configuration file null object output stream out null try out new object output stream new file output stream repository configuration file out write int repository configurations size for string key repository configurations key set repository configuration item repository configurations get key if item null out write object item catch io exception e log e finally if out null try out close catch io exception e ignore writerepositoryconfigfile ipath configfile getproductconfigurationcachepath repositoryconfigurationfile objectoutputstream objectoutputstream fileoutputstream repositoryconfigurationfile writeint repositoryconfigurations repositoryconfigurations keyset repositoryconfiguration repositoryconfigurations writeobject ioexception ioexception private bugzilla messages do not instantiate bugzillamessages override public boolean can create new task task repository repository return true cancreatenewtask taskrepository override public boolean can create task from key task repository repository return true cancreatetaskfromkey taskrepository query hit collector collector new query hit collector new i task factory public abstract task create task repository task data task data i progress monitor monitor do not construct actual task objects here as query shouldn t result in new tasks return task list get task task data get repository url task data get id queryhitcollector queryhitcollector itaskfactory abstracttask createtask repositorytaskdata taskdata iprogressmonitor tasklist gettask taskdata getrepositoryurl taskdata getid override public abstract task create task string repository url string id string summary bugzilla task task new bugzilla task repository url id summary task set creation date new date return task abstracttask createtask repositoryurl bugzillatask bugzillatask repositoryurl setcreationdate override public abstract attachment handler get attachment handler return attachment handler abstractattachmenthandler getattachmenthandler attachmenthandler public static int get bug id string task id throws core exception try return integer parse int task id catch number format exception e throw new core exception new status i status error bugzilla core plugin plugin id 0 invalid bug id task id e getbugid taskid coreexception parseint taskid numberformatexception coreexception istatus bugzillacoreplugin plugin_id taskid public bugzilla client manager get client manager if client manager null client manager new bugzilla client manager return client manager bugzillaclientmanager getclientmanager clientmanager clientmanager bugzillaclientmanager clientmanager override public string get connector kind return bugzilla core plugin repository kind getconnectorkind bugzillacoreplugin repository_kind override public string get label return client label getlabel client_label override public string get repository url from task url string url if url null return null int index url index of i bugzilla constants url get show bug return index 1 null url substring 0 index getrepositoryurlfromtaskurl indexof ibugzillaconstants url_get_show_bug override public abstract task data handler get task data handler return task data handler abstracttaskdatahandler gettaskdatahandler taskdatahandler override public string get task id from task url string url if url null return null int index url index of i bugzilla constants url get show bug return index 1 null url substring index i bugzilla constants url get show bug length gettaskidfromtaskurl indexof ibugzillaconstants url_get_show_bug ibugzillaconstants url_get_show_bug override public string get task id prefix return bug gettaskidprefix override public string get task url string repository url string task id try return bugzilla client get bug url without login repository url task id catch exception ex status handler fail ex error constructing task url for repository url id task id false return null gettaskurl repositoryurl taskid bugzillaclient getbugurlwithoutlogin repositoryurl taskid statushandler repositoryurl taskid override public void init task list task list super init task list this task data handler new bugzilla task data handler this this attachment handler new bugzilla attachment handler this bugzilla core plugin set connector this tasklist tasklist tasklist taskdatahandler bugzillataskdatahandler attachmenthandler bugzillaattachmenthandler bugzillacoreplugin setconnector public boolean is repository configuration stale task repository repository throws core exception boolean result true try string old timestamp repository get property i bugzilla constants property configtimestamp if old timestamp null old timestamp equals i bugzilla constants timestamp not available result true else bugzilla client client get client manager get client repository if client null string timestamp client get configuration timestamp if timestamp null repository set property i bugzilla constants property configtimestamp i bugzilla constants timestamp not available result true else result timestamp equals old timestamp repository set property i bugzilla constants property configtimestamp timestamp catch exception e if an error occurs default to true return result isrepositoryconfigurationstale taskrepository coreexception oldtimestamp getproperty ibugzillaconstants property_configtimestamp oldtimestamp oldtimestamp ibugzillaconstants timestamp_not_available bugzillaclient getclientmanager getclient getconfigurationtimestamp setproperty ibugzillaconstants property_configtimestamp ibugzillaconstants timestamp_not_available oldtimestamp setproperty ibugzillaconstants property_configtimestamp override public boolean mark stale tasks task repository repository set abstract task tasks i progress monitor monitor throws core exception try monitor begin task checking for changed tasks i progress monitor unknown if repository get synchronization time stamp null for abstract task task tasks task set stale true return true string date string repository get synchronization time stamp if date string null date string string url query base repository get url changed bugs cgi query url encoder encode date string repository get character encoding changed bugs cgi enddate string url query string url query base bug id need to replace this with query that would return list of tasks since last sync the trouble is that bugzilla only have 1 hour granularity for changed since query so we can t say that no tasks has changed in repository set abstract task changed tasks new hash set abstract task int query counter 1 iterator abstract task itr tasks iterator while itr has next query counter abstract task task itr next string newurl query string url encoder encode task get task id repository get character encoding if url query string length newurl query string length i bugzilla constants content type rdf length i bugzilla constants max url length query for changed repository changed tasks url query string query counter 0 url query string url query base bug id url query string newurl query string if itr has next query for changed repository changed tasks url query string for abstract task task tasks if changed tasks contains task task set stale true for abstract task task changed tasks task set stale true fixme check if new tasks were added return changed tasks is empty return true catch unsupported encoding exception e xxx throw core exception instead status handler fail e repository configured with unsupported encoding repository get character encoding n n unable to determine changed tasks true return false finally monitor done markstaletasks taskrepository abstracttask iprogressmonitor coreexception begintask iprogressmonitor getsynchronizationtimestamp abstracttask setstale datestring getsynchronizationtimestamp datestring datestring urlquerybase geturl changed_bugs_cgi_query urlencoder datestring getcharacterencoding changed_bugs_cgi_enddate urlquerystring urlquerybase bug_id abstracttask changedtasks hashset abstracttask querycounter abstracttask hasnext querycounter abstracttask newurlquerystring urlencoder gettaskid getcharacterencoding urlquerystring newurlquerystring ibugzillaconstants content_type_rdf ibugzillaconstants max_url_length queryforchanged changedtasks urlquerystring querycounter urlquerystring urlquerybase bug_id urlquerystring newurlquerystring hasnext queryforchanged changedtasks urlquerystring abstracttask changedtasks setstale abstracttask changedtasks setstale changedtasks isempty unsupportedencodingexception coreexception statushandler getcharacterencoding override public i status perform query final abstract repository query query task repository repository i progress monitor monitor i task collector result collector try monitor begin task running query i progress monitor unknown bugzilla client client get client manager get client repository boolean hits received client get search hits query result collector if hits received xxx hack in case of ip change bugzilla can return 0 hits due to invalid authorization token forcing relogin fixes client logout client get search hits query result collector return status ok status catch unrecognized reponse exception e return new status i status error bugzilla core plugin plugin id status info unrecognized response from server e catch io exception e return new status i status error bugzilla core plugin plugin id status error check repository configuration e get message e catch core exception e return e get status finally monitor done istatus performquery abstractrepositoryquery taskrepository iprogressmonitor itaskcollector resultcollector begintask iprogressmonitor bugzillaclient getclientmanager getclient hitsreceived getsearchhits resultcollector hitsreceived getsearchhits resultcollector ok_status unrecognizedreponseexception istatus bugzillacoreplugin plugin_id ioexception istatus bugzillacoreplugin plugin_id getmessage coreexception getstatus private void query for changed final task repository repository set abstract task changed tasks string url query string throws unsupported encoding exception core exception query hit collector collector new query hit collector new i task factory public abstract task create task repository task data task data i progress monitor monitor do not construct actual task objects here as query shouldn t result in new tasks return task list get task task data get repository url task data get id bugzilla repository query query new bugzilla repository query repository get url url query string perform query query repository new null progress monitor collector changed tasks add all collector get tasks for abstract task task hit collector get task hits string handle abstract task get handle repository get url hit get id if task hit null task hit instanceof abstract task abstract task repository task abstract task task hit hack to avoid re syncing last task from previous synchronization this can be removed once we are getting a query timestamp from the repository rather than using the last modified stamp of the last task modified in the return hits or the changeddate field in the hit rdf becomes consistent currently it doesn t return a proper modified date string if repository task get task data null repository task get task data get last modified equals repository get sync time stamp string task id repository task handle util get task id repository task get handle identifier repository task data task data get task data handler get task data repository repository task get task id if task data null task data get last modified equals repository get sync time stamp continue changed tasks add repository task queryforchanged taskrepository abstracttask changedtasks urlquerystring unsupportedencodingexception coreexception queryhitcollector queryhitcollector itaskfactory abstracttask createtask repositorytaskdata taskdata iprogressmonitor tasklist gettask taskdata getrepositoryurl taskdata getid bugzillarepositoryquery bugzillarepositoryquery geturl urlquerystring performquery nullprogressmonitor changedtasks addall gettasks abstracttask taskhit gettaskhits abstracttask gethandle geturl getid taskhit taskhit abstracttask abstracttask repositorytask abstracttask taskhit repositorytask gettaskdata repositorytask gettaskdata getlastmodified getsynctimestamp taskid repositorytaskhandleutil gettaskid repositorytask gethandleidentifier repositorytaskdata taskdata gettaskdatahandler gettaskdata repositorytask gettaskid taskdata taskdata getlastmodified getsynctimestamp changedtasks repositorytask adds bug attributes to new bug model and sets defaults param proxy settings todo param character encoding todo public static void setup new bug attributes task repository task repository repository task data new task data throws core exception string product new task data get product new task data remove all attributes repository configuration repository configuration bugzilla core plugin get repository configuration task repository false repository task attribute a bugzilla client make new attribute bugzilla report element product list string option values repository configuration get products collections sort option values for string option option values a add option value option option a set value product a set read only true new task data add attribute bugzilla report element product get key string a attributes put a get name a a bugzilla client make new attribute bugzilla report element bug status option values repository configuration get status values for string option option values a add option option option a set value i bugzilla constants value status new new task data add attribute bugzilla report element bug status get key string a a bugzilla client make new attribute bugzilla report element short desc new task data add attribute bugzilla report element short desc get key string a a bugzilla client make new attribute bugzilla report element version option values repository configuration get versions new task data get product collections sort option values for string option option values a add option option option if option values size 0 a set value option values get option values size 1 new task data add attribute bugzilla report element version get key string a attributes put a get name a a bugzilla client make new attribute bugzilla report element component option values repository configuration get components new task data get product collections sort option values for string option option values a add option option option if option values size 0 a set value option values get 0 new task data add attribute bugzilla report element component get key string a a bugzilla client make new attribute bugzilla report element rep platform option values repository configuration get platforms collections sort option values for string option option values a add option option option if option values size 0 a set value option values get 0 new task data add attribute bugzilla report element rep platform get key string a attributes put a get name a a bugzilla client make new attribute bugzilla report element op sys option values repository configuration geto ss for string option option values a add option option option if option values size 0 a set value option values get option values size 1 new task data add attribute bugzilla report element op sys get key string a attributes put a get name a a bugzilla client make new attribute bugzilla report element priority option values repository configuration get priorities for string option option values a add option option option a set value option values get option values size 2 new task data add attribute bugzilla report element priority get key string a attributes put a get name a a bugzilla client make new attribute bugzilla report element bug severity option values repository configuration get severities for string option option values a add option option option a set value option values get option values size 2 new task data add attribute bugzilla report element bug severity get key string a attributes put a get name a a new repository task attribute bugzilla report element target milestone option values bugzilla core plugin get default getget product configuration server url get target milestones new report get product for string option option values a add option value option option if option values size 0 new bug posts will fail if target milestone element is included and there are no milestones on the server new report add attribute bugzilla report element target milestone a a bugzilla client make new attribute bugzilla report element assigned to a set value a set read only false new task data add attribute bugzilla report element assigned to get key string a attributes put a get name a a bugzilla client make new attribute bugzilla report element bug file loc a set value http a set hidden false new task data add attribute bugzilla report element bug file loc get key string a attributes put a get name a new report attributes attributes proxysettings characterencoding setupnewbugattributes taskrepository taskrepository repositorytaskdata newtaskdata coreexception newtaskdata getproduct newtaskdata removeallattributes repositoryconfiguration repositoryconfiguration bugzillacoreplugin getrepositoryconfiguration taskrepository repositorytaskattribute bugzillaclient makenewattribute bugzillareportelement optionvalues repositoryconfiguration getproducts optionvalues optionvalues addoptionvalue setvalue setreadonly newtaskdata addattribute bugzillareportelement getkeystring getname bugzillaclient makenewattribute bugzillareportelement bug_status optionvalues repositoryconfiguration getstatusvalues optionvalues addoption setvalue ibugzillaconstants value_status_new newtaskdata addattribute bugzillareportelement bug_status getkeystring bugzillaclient makenewattribute bugzillareportelement short_desc newtaskdata addattribute bugzillareportelement short_desc getkeystring bugzillaclient makenewattribute bugzillareportelement optionvalues repositoryconfiguration getversions newtaskdata getproduct optionvalues optionvalues addoption optionvalues setvalue optionvalues optionvalues newtaskdata addattribute bugzillareportelement getkeystring getname bugzillaclient makenewattribute bugzillareportelement optionvalues repositoryconfiguration getcomponents newtaskdata getproduct optionvalues optionvalues addoption optionvalues setvalue optionvalues newtaskdata addattribute bugzillareportelement getkeystring bugzillaclient makenewattribute bugzillareportelement rep_platform optionvalues repositoryconfiguration getplatforms optionvalues optionvalues addoption optionvalues setvalue optionvalues newtaskdata addattribute bugzillareportelement rep_platform getkeystring getname bugzillaclient makenewattribute bugzillareportelement op_sys optionvalues repositoryconfiguration getoss optionvalues addoption optionvalues setvalue optionvalues optionvalues newtaskdata addattribute bugzillareportelement op_sys getkeystring getname bugzillaclient makenewattribute bugzillareportelement optionvalues repositoryconfiguration getpriorities optionvalues addoption setvalue optionvalues optionvalues newtaskdata addattribute bugzillareportelement getkeystring getname bugzillaclient makenewattribute bugzillareportelement bug_severity optionvalues repositoryconfiguration getseverities optionvalues addoption setvalue optionvalues optionvalues newtaskdata addattribute bugzillareportelement bug_severity getkeystring getname repositorytaskattribute bugzillareportelement target_milestone optionvalues bugzillacoreplugin getdefault getgetproductconfiguration serverurl gettargetmilestones newreport getproduct optionvalues addoptionvalue optionvalues target_milestone newreport addattribute bugzillareportelement target_milestone bugzillaclient makenewattribute bugzillareportelement assigned_to setvalue setreadonly newtaskdata addattribute bugzillareportelement assigned_to getkeystring getname bugzillaclient makenewattribute bugzillareportelement bug_file_loc setvalue sethidden newtaskdata addattribute bugzillareportelement bug_file_loc getkeystring getname newreport public void update attribute options task repository task repository repository task data existing report throws core exception string product existing report get attribute value bugzilla report element product get key string for repository task attribute attribute existing report get attributes bugzilla report element element bugzilla report element value of attribute get id trim to upper case locale english attribute clear options list string option values bugzilla core plugin get repository configuration task repository false get option values element product if element bugzilla report element op sys element bugzilla report element bug severity element bugzilla report element priority element bugzilla report element bug status collections sort option values if element bugzilla report element target milestone option values is empty existing report remove attribute bugzilla report element target milestone continue attribute clear options for string option option values attribute add option option option todo bug 162428 bug 150680 something along the lines of but must think about the case of multiple values selected etc if attribute has options if attribute get option values contains key attribute get value update attributes updateattributeoptions taskrepository taskrepository repositorytaskdata existingreport coreexception existingreport getattributevalue bugzillareportelement getkeystring repositorytaskattribute existingreport getattributes bugzillareportelement bugzillareportelement valueof getid touppercase clearoptions optionvalues bugzillacoreplugin getrepositoryconfiguration taskrepository getoptionvalues bugzillareportelement op_sys bugzillareportelement bug_severity bugzillareportelement bugzillareportelement bug_status optionvalues bugzillareportelement target_milestone optionvalues isempty existingreport removeattribute bugzillareportelement target_milestone clearoptions optionvalues addoption hasoptions getoptionvalues containskey getvalue updateattributes override public void update attributes task repository repository i progress monitor monitor throws core exception if repository null bugzilla core plugin get repository configuration repository true updateattributes taskrepository iprogressmonitor coreexception bugzillacoreplugin getrepositoryconfiguration override public boolean update task from query hit task repository repository abstract task existing task abstract task new task these properties are not provided by bugzilla queries new task set completed existing task is completed new task set completion date existing task get completion date boolean changed super update task from query hit repository existing task new task if existing task instanceof bugzilla task new task instanceof bugzilla task bugzilla task existing bugzilla task bugzilla task existing task bugzilla task new bugzilla task bugzilla task new task if has task property changed existing bugzilla task get severity new bugzilla task get severity existing bugzilla task set severity new bugzilla task get severity changed true if has task property changed existing bugzilla task get product new bugzilla task get product existing bugzilla task set product new bugzilla task get product changed true return changed updatetaskfromqueryhit taskrepository abstracttask existingtask abstracttask newtask newtask setcompleted existingtask iscompleted newtask setcompletiondate existingtask getcompletiondate updatetaskfromqueryhit existingtask newtask existingtask bugzillatask newtask bugzillatask bugzillatask existingbugzillatask bugzillatask existingtask bugzillatask newbugzillatask bugzillatask newtask hastaskpropertychanged existingbugzillatask getseverity newbugzillatask getseverity existingbugzillatask setseverity newbugzillatask getseverity hastaskpropertychanged existingbugzillatask getproduct newbugzillatask getproduct existingbugzillatask setproduct newbugzillatask getproduct override public void update task from repository task repository repository abstract task repository task i progress monitor monitor ignore updatetaskfromrepository taskrepository abstracttask repositorytask iprogressmonitor override public void update task from task data task repository repository abstract task repository task repository task data task data bugzilla task bugzilla task bugzilla task repository task if task data null subtasks repository task drop sub tasks set string sub task ids task data handler get sub task ids task data if sub task ids null sub task ids is empty for string sub id sub task ids i task sub task task list get task repository get url sub id if sub task null retrieve sub tasks if sub id trim equals task data get id sub id equals try sub task create task from existing id repository sub id false new null progress monitor catch core exception e ignore if sub task null bugzilla task add sub task sub task summary string summary task data get summary bugzilla task set summary summary owner string owner task data get assigned to if owner null owner equals bugzilla task set owner owner completed boolean is complete false todo use repository configuration to determine what completed states are if task data get status null is complete task data get status equals i bugzilla constants value status resolved task data get status equals i bugzilla constants value status closed task data get status equals i bugzilla constants value status verified bugzilla task set completed is complete completion date if is complete date completion date null try list task comment task comments task data get comments if task comments null task comments is empty todo fix not to be based on comment completion date new simple date format comment format parse task comments get task comments size 1 get created catch exception e if bugzilla task get completion date null completion date null if changed todo get task list manger set due date i task task date due date bugzilla task set completion date completion date priority string priority priority level get default to string if task data get attribute repository task attribute priority null priority task data get attribute repository task attribute priority get value bugzilla task set priority priority task web url string url get task url repository get url task data get id if url null bugzilla task set url url bugzilla specific attributes product if task data get product null bugzilla task set product task data get product severity string severity task data get attribute value bugzilla report element bug severity get key string if severity null severity equals bugzilla task set severity severity due date if task data get attribute bugzilla report element estimated time get key string null date due date null hack if estimated time field exists time tracking is enabled try string due str task data get attribute value bugzilla report element deadline get key string if due str null due date new simple date format deadline format parse due str catch exception e ignore bugzilla task set due date due date updatetaskfromtaskdata taskrepository abstracttask repositorytask repositorytaskdata taskdata bugzillatask bugzillatask bugzillatask repositorytask taskdata repositorytask dropsubtasks subtaskids taskdatahandler getsubtaskids taskdata subtaskids subtaskids isempty subid subtaskids itask subtask tasklist gettask geturl subid subtask retrievesubtasks subid taskdata getid subid subtask createtaskfromexistingid subid nullprogressmonitor coreexception subtask bugzillatask addsubtask subtask taskdata getsummary bugzillatask setsummary taskdata getassignedto bugzillatask setowner iscomplete taskdata getstatus iscomplete taskdata getstatus ibugzillaconstants value_status_resolved taskdata getstatus ibugzillaconstants value_status_closed taskdata getstatus ibugzillaconstants value_status_verified bugzillatask setcompleted iscomplete iscomplete completiondate taskcomment taskcomments taskdata getcomments taskcomments taskcomments isempty completiondate simpledateformat comment_format taskcomments taskcomments getcreated bugzillatask getcompletiondate completiondate tasklistmanger setduedate itask duedate bugzillatask setcompletiondate completiondate prioritylevel getdefault tostring taskdata getattribute repositorytaskattribute taskdata getattribute repositorytaskattribute getvalue bugzillatask setpriority gettaskurl geturl taskdata getid bugzillatask seturl taskdata getproduct bugzillatask setproduct taskdata getproduct taskdata getattributevalue bugzillareportelement bug_severity getkeystring bugzillatask setseverity taskdata getattribute bugzillareportelement estimated_time getkeystring duedate estimated_time duestr taskdata getattributevalue bugzillareportelement getkeystring duestr duedate simpledateformat deadline_format duestr bugzillatask setduedate duedate public bugzilla repository query string repository url string query url string description super description this url query url this repository url repository url try this max hits integer parse int max hits catch exception e this max hits 1 bugzillarepositoryquery repositoryurl queryurl queryurl repositoryurl repositoryurl maxhits parseint maxhits maxhits override public string get repository kind return bugzilla core plugin repository kind getrepositorykind bugzillacoreplugin repository_kind public boolean is custom query return custom query iscustomquery customquery public void set custom query boolean custom query this custom query custom query setcustomquery customquery customquery customquery public bugzilla status int severity string plugin id int code string repository url throwable e super severity plugin id code mylyn status e this repository url repository url this error message e get message bugzillastatus pluginid repositoryurl pluginid mylynstatus repositoryurl repositoryurl errormessage getmessage public bugzilla status int severity string plugin id int code string repository url string error message super severity plugin id code mylyn status null this error message error message this repository url repository url bugzillastatus pluginid repositoryurl errormessage pluginid mylynstatus errormessage errormessage repositoryurl repositoryurl public bugzilla status int severity string plugin id int code string repository url string error message throwable e super severity plugin id code mylyn status e this error message error message this repository url repository url bugzillastatus pluginid repositoryurl errormessage pluginid mylynstatus errormessage errormessage repositoryurl repositoryurl private string repository url public bugzilla status int severity string plugin id int code super severity plugin id code mylyn status null this error message null repositoryurl bugzillastatus pluginid pluginid mylynstatus errormessage public bugzilla status int severity string plugin id int code string error message super severity plugin id code mylyn status null this error message error message bugzillastatus pluginid errormessage pluginid mylynstatus errormessage errormessage returns the message that is relevant to the code of this status override public string get message switch get code case repository status error repository login return bugzilla messages bind bugzilla messages repository login failure this get repository url this error message case repository status error repository not found return bugzilla messages bind bugzilla messages repository not found this error message case repository status error repository return bugzilla messages bind bugzilla messages error repository this get repository url this error message case repository status error io string string1 unknown io error occurred string string2 no message provided if get exception null string1 get exception get class get simple name string2 get exception get message object strings get repository url string1 string2 return bugzilla messages bind bugzilla messages error io strings case repository status error internal return bugzilla messages bind bugzilla messages error internal this error message case repository status operation cancelled return bugzilla messages bind bugzilla messages operation cancelled this error message case repository status repository collision return bugzilla messages bind bugzilla messages repository collision this error message case repository status repository comment required if error message null return bugzilla messages repository comment required else return error message if error message null return error message else if get exception null string message get exception get message if message null return message else return get exception to string return unknown getmessage getcode repositorystatus error_repository_login bugzillamessages bugzillamessages repositoryloginfailure getrepositoryurl errormessage repositorystatus error_repository_not_found bugzillamessages bugzillamessages repositorynotfound errormessage repositorystatus error_repository bugzillamessages bugzillamessages errorrepository getrepositoryurl errormessage repositorystatus error_io getexception getexception getclass getsimplename getexception getmessage getrepositoryurl bugzillamessages bugzillamessages errorio repositorystatus error_internal bugzillamessages bugzillamessages errorinternal errormessage repositorystatus operation_cancelled bugzillamessages bugzillamessages operationcancelled errormessage repositorystatus repository_collision bugzillamessages bugzillamessages repositorycollision errormessage repositorystatus repository_comment_required errormessage bugzillamessages repositorycommentrequired errormessage errormessage errormessage getexception getexception getmessage getexception tostring public string get repository url return repository url getrepositoryurl repositoryurl public void set repository url string repository url this repository url repository url setrepositoryurl repositoryurl repositoryurl repositoryurl private void add operation repository task data bug report bugzilla operation opcode string user name repository operation new operation null switch opcode case none new operation new repository operation opcode to string leave as bug report get status bug report get resolution new operation set checked true break case accept new operation new repository operation opcode to string operation label accept break case resolve new operation new repository operation opcode to string operation label resolve new operation set up options operation option resolution for bugzilla resolution resolution bugzilla resolution values new operation add option resolution to string resolution to string break case duplicate new operation new repository operation opcode to string operation label duplicate new operation set input name operation input dup id new operation set input value break case reassign string local user user name new operation new repository operation opcode to string operation label reassign new operation set input name operation input assigned to new operation set input value local user break case reassignbycomponent new operation new repository operation opcode to string operation label reassign default break case reopen new operation new repository operation opcode to string operation label reopen break case verify new operation new repository operation opcode to string operation label verify break case close new operation new repository operation opcode to string operation label close break default break if new operation null bug report add operation new operation addoperation repositorytaskdata bugreport bugzilla_operation username repositoryoperation newoperation newoperation repositoryoperation tostring bugreport getstatus bugreport getresolution newoperation setchecked newoperation repositoryoperation tostring operation_label_accept newoperation repositoryoperation tostring operation_label_resolve newoperation setupoptions operation_option_resolution bugzilla_resolution bugzilla_resolution newoperation addoption tostring tostring newoperation repositoryoperation tostring operation_label_duplicate newoperation setinputname operation_input_dup_id newoperation setinputvalue localuser username newoperation repositoryoperation tostring operation_label_reassign newoperation setinputname operation_input_assigned_to newoperation setinputvalue localuser newoperation repositoryoperation tostring operation_label_reassign_default newoperation repositoryoperation tostring operation_label_reopen newoperation repositoryoperation tostring operation_label_verify newoperation repositoryoperation tostring operation_label_close newoperation bugreport addoperation newoperation private void add valid operations repository task data bug report string user name throws core exception bugzilla report status status try status bugzilla report status value of bug report get status catch runtime exception e status handler log e unrecognized status bug report get status status bugzilla report status new switch status case unconfirmed case reopened case new add operation bug report bugzilla operation none user name add operation bug report bugzilla operation accept user name add operation bug report bugzilla operation resolve user name add operation bug report bugzilla operation duplicate user name add operation bug report bugzilla operation reassign user name add operation bug report bugzilla operation reassignbycomponent user name break case assigned add operation bug report bugzilla operation none user name add operation bug report bugzilla operation resolve user name add operation bug report bugzilla operation duplicate user name add operation bug report bugzilla operation reassign user name add operation bug report bugzilla operation reassignbycomponent user name break case resolved add operation bug report bugzilla operation none user name add operation bug report bugzilla operation reopen user name add operation bug report bugzilla operation verify user name add operation bug report bugzilla operation close user name break case closed add operation bug report bugzilla operation none user name add operation bug report bugzilla operation reopen user name break case verified add operation bug report bugzilla operation none user name add operation bug report bugzilla operation reopen user name add operation bug report bugzilla operation close user name addvalidoperations repositorytaskdata bugreport username coreexception bugzilla_report_status bugzilla_report_status valueof bugreport getstatus runtimeexception statushandler bugreport getstatus bugzilla_report_status addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username addoperation bugreport bugzilla_operation username private bugzilla repository connector connector public bugzilla task data handler bugzilla repository connector connector this connector connector bugzillarepositoryconnector bugzillataskdatahandler bugzillarepositoryconnector override public boolean can get multi task data return true cangetmultitaskdata public void configure task data task repository repository repository task data task data throws core exception connector update attribute options repository task data add valid operations task data repository get user name configuretaskdata taskrepository repositorytaskdata taskdata coreexception updateattributeoptions taskdata addvalidoperations taskdata getusername override public abstract attribute factory get attribute factory string repository url string repository kind string task kind we don t care about the repository information right now return attribute factory abstractattributefactory getattributefactory repositoryurl repositorykind taskkind attributefactory override public abstract attribute factory get attribute factory repository task data task data return get attribute factory task data get repository url task data get repository kind task data get task kind abstractattributefactory getattributefactory repositorytaskdata taskdata getattributefactory taskdata getrepositoryurl taskdata getrepositorykind taskdata gettaskkind override public set repository task data get multi task data task repository repository set string task ids i progress monitor monitor throws core exception try set repository task data result new hash set repository task data bugzilla client client connector get client manager get client repository try map string repository task data data returned client get task data task ids for repository task data repository task data data returned values result add repository task data catch core exception e todo move retry handling into client if e get status get code repository status error repository login map string repository task data data returned client get task data task ids for repository task data repository task data data returned values result add repository task data else throw e for repository task data repository task data result try configure task data repository repository task data catch core exception ce retry since data retrieved may be corrupt task data client get task data bug id if task data null configure task data repository repository task data return result catch io exception e throw new core exception new bugzilla status i status error bugzilla core plugin plugin id repository status error io repository get url e repositorytaskdata getmultitaskdata taskrepository taskids iprogressmonitor coreexception repositorytaskdata hashset repositorytaskdata bugzillaclient getclientmanager getclient repositorytaskdata datareturned gettaskdata taskids repositorytaskdata repositorytaskdata datareturned repositorytaskdata coreexception getstatus getcode repositorystatus error_repository_login repositorytaskdata datareturned gettaskdata taskids repositorytaskdata repositorytaskdata datareturned repositorytaskdata repositorytaskdata repositorytaskdata configuretaskdata repositorytaskdata coreexception taskdata gettaskdata bugid taskdata configuretaskdata repositorytaskdata ioexception coreexception bugzillastatus istatus bugzillacoreplugin plugin_id repositorystatus error_io geturl todo move to abstract task data handler override public set string get sub task ids repository task data task data set string result new hash set string repository task attribute attribute task data get attribute bugzilla report element dependson get key string if attribute null string ids attribute get value split for string id ids id id trim if id length 0 continue result add id return result abstracttaskdatahandler getsubtaskids repositorytaskdata taskdata hashset repositorytaskattribute taskdata getattribute bugzillareportelement getkeystring getvalue override public repository task data get task data task repository repository string task id i progress monitor monitor throws core exception try bugzilla client client connector get client manager get client repository int bug id bugzilla repository connector get bug id task id repository task data task data try task data client get task data bug id catch core exception e todo move retry handling into client if e get status get code repository status error repository login task data client get task data bug id else throw e if task data null try configure task data repository task data catch core exception ce retry since data retrieved may be corrupt task data client get task data bug id if task data null configure task data repository task data return task data return null catch io exception e throw new core exception new bugzilla status i status error bugzilla core plugin plugin id repository status error io repository get url e repositorytaskdata gettaskdata taskrepository taskid iprogressmonitor coreexception bugzillaclient getclientmanager getclient bugid bugzillarepositoryconnector getbugid taskid repositorytaskdata taskdata taskdata gettaskdata bugid coreexception getstatus getcode repositorystatus error_repository_login taskdata gettaskdata bugid taskdata configuretaskdata taskdata coreexception taskdata gettaskdata bugid taskdata configuretaskdata taskdata taskdata ioexception coreexception bugzillastatus istatus bugzillacoreplugin plugin_id repositorystatus error_io geturl override public boolean initialize task data task repository repository repository task data data i progress monitor monitor throws core exception bugzilla needs a product to create task data return false initializetaskdata taskrepository repositorytaskdata iprogressmonitor coreexception override public string post task data task repository repository repository task data task data i progress monitor monitor throws core exception try bugzilla client client connector get client manager get client repository try return client post task data task data catch core exception e todo move retry handling into client if e get status get code repository status error repository login return client post task data task data else throw e catch io exception e throw new core exception new bugzilla status i status error bugzilla core plugin plugin id repository status error io repository get url e posttaskdata taskrepository repositorytaskdata taskdata iprogressmonitor coreexception bugzillaclient getclientmanager getclient posttaskdata taskdata coreexception getstatus getcode repositorystatus error_repository_login posttaskdata taskdata ioexception coreexception bugzillastatus istatus bugzillacoreplugin plugin_id repositorystatus error_io geturl private string product public bugzilla task string repository url string id string label super repository url id label set url bugzilla client get bug url without login repository url id bugzillatask repositoryurl repositoryurl seturl bugzillaclient getbugurlwithoutlogin repositoryurl override public string get connector kind return bugzilla core plugin repository kind getconnectorkind bugzillacoreplugin repository_kind public string get product return product getproduct public string get severity return severity getseverity override public string get task kind return i bugzilla constants bugzilla task kind gettaskkind ibugzillaconstants bugzilla_task_kind override public boolean is local ignore return false islocal public void set product string product this product product setproduct public void set severity string severity this severity severity setseverity override public string to string return bugzilla task get handle identifier tostring gethandleidentifier public assignment event string change this what task revision assignment this assigned change this added change assignmentevent taskrevision public string get assigned return this assigned getassigned override public string to string return this get name this get date this get what this get removed this get assigned tostring getname getdate getwhat getremoved getassigned public attachment event int id list attachment flag flags this what task revision attachment this attachment id id this flags flags attachmentevent attachmentflag taskrevision attachmentid public int get attachment id return this attachment id getattachmentid attachmentid public list attachment flag get flags return this flags attachmentflag getflags public string get flags string string flag string for attachment flag flag this flags flag string flag return flag string getflagsstring flagstring attachmentflag flagstring flagstring public static list attachment flag parse flags string attachment flags list attachment flag flags new array list attachment flag attachment flag status flag status attachment flag status unknown attachment flag state flag state attachment flag state unknown string flag token attachment flags split for int i 0 i flag token length i string token flag token i if token index of 1 int end token index of string substr token substring 0 end token substr handle the case of the obsolete status needs work if token starts with needs work since we don t know if needs work applies to review or superreview deny both flags add new attachment flag attachment flag status review attachment flag state denied flags add new attachment flag attachment flag status superreview attachment flag state denied else boolean starts with review token to lower case starts with attachment flag status review name to lower case boolean first or second review token to lower case contains attachment flag status review name to lower case token to lower case starts with first token to lower case starts with second if first or second review system err println first second activated if starts with review first or second review flag status attachment flag status review else if token to lower case starts with attachment flag status superreview name to lower case flag status attachment flag status superreview else if token to lower case starts with attachment flag status approval name to lower case flag status attachment flag status approval else if token to lower case starts with attachment flag status ui name to lower case flag status attachment flag status ui else if token to lower case starts with attachment flag status branch name to lower case flag status attachment flag status branch else if token to lower case starts with attachment flag status committed name to lower case flag status attachment flag status committed else if token to lower case starts with attachment flag status accepted name to lower case flag status attachment flag status accepted else if token to lower case starts with attachment flag status commented name to lower case flag status attachment flag status commented else if token to lower case starts with attachment flag status none name to lower case flag status attachment flag status none else if token to lower case starts with attachment flag status rejected name to lower case flag status attachment flag status rejected else if token equals 1 token to lower case starts with attachment flag status obsolete name to lower case flag status attachment flag status obsolete assure that flag was set to something meaningful if flag status equals attachment flag status unknown token equals false system err println warning attachment flag status unknown token if token length 0 if token char at token length 1 flag state attachment flag state requested else if token char at token length 1 flag state attachment flag state granted else if token char at token length 1 flag state attachment flag state denied else if flag status equals attachment flag status obsolete flag status equals attachment flag status committed flag status equals attachment flag status accepted flag status equals attachment flag status commented flag status equals attachment flag status none flag status equals attachment flag status rejected flag status equals attachment flag status review flag state attachment flag state off assure that flag state was set to something meaningful if flag state equals attachment flag state unknown token equals false system err println warning attachment flag state unknown token flags add new attachment flag flag status flag state return flags attachmentflag parseflags attachmentflags attachmentflag arraylist attachmentflag attachmentflagstatus flagstatus attachmentflagstatus attachmentflagstate flagstate attachmentflagstate flagtoken attachmentflags flagtoken flagtoken indexof indexof startswith attachmentflag attachmentflagstatus attachmentflagstate attachmentflag attachmentflagstatus attachmentflagstate startswithreview tolowercase startswith attachmentflagstatus tolowercase firstorsecondreview tolowercase attachmentflagstatus tolowercase tolowercase startswith tolowercase startswith firstorsecondreview startswithreview firstorsecondreview flagstatus attachmentflagstatus tolowercase startswith attachmentflagstatus tolowercase flagstatus attachmentflagstatus tolowercase startswith attachmentflagstatus tolowercase flagstatus attachmentflagstatus tolowercase startswith attachmentflagstatus tolowercase flagstatus attachmentflagstatus tolowercase startswith attachmentflagstatus tolowercase flagstatus attachmentflagstatus tolowercase startswith attachmentflagstatus tolowercase flagstatus attachmentflagstatus tolowercase startswith attachmentflagstatus tolowercase flagstatus attachmentflagstatus tolowercase startswith attachmentflagstatus tolowercase flagstatus attachmentflagstatus tolowercase startswith attachmentflagstatus tolowercase flagstatus attachmentflagstatus tolowercase startswith attachmentflagstatus tolowercase flagstatus attachmentflagstatus tolowercase startswith attachmentflagstatus tolowercase flagstatus attachmentflagstatus flagstatus attachmentflagstatus charat flagstate attachmentflagstate charat flagstate attachmentflagstate charat flagstate attachmentflagstate flagstatus attachmentflagstatus flagstatus attachmentflagstatus flagstatus attachmentflagstatus flagstatus attachmentflagstatus flagstatus attachmentflagstatus flagstatus attachmentflagstatus flagstatus attachmentflagstatus flagstate attachmentflagstate flagstate attachmentflagstate attachmentflag flagstatus flagstate public static int parse id string attachment matcher matcher attachment event id matcher attachment if matcher find return integer parse int matcher group error situation system err println warning cannot find attachment id in attachment return 1 parseid attachmentevent parseint override public string to string return this get name this get date this get what this attachment id this get flags string tostring getname getdate getwhat attachmentid getflagsstring private final attachment flag state state public attachment flag attachment flag status status attachment flag state state this status status this state state attachmentflagstate attachmentflag attachmentflagstatus attachmentflagstate public attachment flag state get state return this state attachmentflagstate getstate public attachment flag status get status return this status attachmentflagstatus getstatus override public string to string return this status name this state equals attachment flag state unknown this state name tostring attachmentflagstate private string character encoding public bugzilla task history parser input stream in stream string character encoding this in stream in stream this character encoding character encoding characterencoding bugzillataskhistoryparser inputstream instream characterencoding instream instream characterencoding characterencoding private string get data html stream tokenizer tokenizer token token html tag tag string buffer sb new string buffer try for token tokenizer next token token get type token eof token tokenizer next token if token get type token tag tag html tag token get value if tag get tag type html tag type td tag is end tag string data html stream tokenizer unescape sb to string if data starts with n data contains attachment false data empty field return data if token get type token text sb append token to string catch io exception e e print stack trace catch parse exception e e print stack trace catch exception e e print stack trace return null getdata htmlstreamtokenizer htmltag stringbuffer stringbuffer nexttoken gettype nexttoken gettype htmltag getvalue gettagtype htmltag isendtag htmlstreamtokenizer tostring startswith gettype tostring ioexception printstacktrace parseexception printstacktrace printstacktrace parse the events that have happened to the bug param tokenizer the token stream param activity the activity object to store the events in return private void parse activity html stream tokenizer tokenizer task history activity throws io exception parse exception html tag tag for token token tokenizer next token token get type token eof token tokenizer next token if token get type token tag tag html tag token get value end of events if tag get tag type html tag type table tag is end tag break get event entry this parse event tokenizer activity parseactivity htmlstreamtokenizer taskhistory ioexception parseexception htmltag nexttoken gettype nexttoken gettype htmltag getvalue gettagtype htmltag isendtag parseevent parse an activity entry param tokenizer the stream of tokens param activity the activity object to store events in private void parse event html stream tokenizer tokenizer task history activity html tag tag int num changes 0 try discover how many changes for this entry for token token tokenizer next token token get type token eof token tokenizer next token if token get type token tag tag html tag token get value if tag get tag type html tag type td tag has attribute rowspan num changes tag get int attribute rowspan break catch number format exception e e print stack trace catch io exception e e print stack trace catch parse exception e e print stack trace string name get data tokenizer string date get data tokenizer string what removed added task revision event for int change 0 change num changes change what get data tokenizer removed get data tokenizer added get data tokenizer event task revision create event what added event set name name event set date date event set removed removed activity add event event parseevent htmlstreamtokenizer taskhistory htmltag numchanges nexttoken gettype nexttoken gettype htmltag getvalue gettagtype htmltag hasattribute numchanges getintattribute numberformatexception printstacktrace ioexception printstacktrace parseexception printstacktrace getdata getdata taskrevision numchanges getdata getdata getdata taskrevision createevent setname setdate setremoved addevent parse the activity page for events return a bug activity object containing the activity history public task history retrieve history throws io exception parse exception login exception task history activity new task history html stream tokenizer tokenizer new html stream tokenizer new buffered reader new input stream reader in stream character encoding null boolean is title false boolean possible bad login false string title for token token tokenizer next token token get type token eof token tokenizer next token make sure that bugzilla doesn t want us to login if token get type token tag html tag token get value get tag type html tag type title html tag token get value is end tag is title true continue if is title get all of the data from inside of the title tag if token get type token tag title string buffer token get value to string to lower case continue else if token get type token tag html tag token get value get tag type html tag type title html tag token get value is end tag check if we may have a problem with login by looking at the title of the page if title index of login 1 title index of invalid 1 title index of password 1 title index of check e mail 1 title index of error 1 possible bad login true is title false title continue if token get type token tag html tag tag html tag token get value skip till find br there can be only one if tag get tag type html tag type br tag is end tag skip tags until start of real data while true token tokenizer next token if token get type token tag tag html tag token get value if tag is end tag tag get tag type html tag type tr tag get tag type html tag type p break parse activity tokenizer activity if we don t have any keywords and suspect that there was a login problem assume we had a login problem if activity size 0 possible bad login throw new login exception bugzilla login information incorrect return activity bugactivity taskhistory retrievehistory ioexception parseexception loginexception taskhistory taskhistory htmlstreamtokenizer htmlstreamtokenizer bufferedreader inputstreamreader instream characterencoding istitle possiblebadlogin nexttoken gettype nexttoken gettype htmltag getvalue gettagtype htmltag htmltag getvalue isendtag istitle istitle gettype stringbuffer getvalue tostring tolowercase gettype htmltag getvalue gettagtype htmltag htmltag getvalue isendtag indexof indexof indexof indexof indexof possiblebadlogin istitle gettype htmltag htmltag getvalue gettagtype htmltag isendtag nexttoken gettype htmltag getvalue isendtag gettagtype htmltag gettagtype htmltag parseactivity possiblebadlogin loginexception public string get resolved by return this get name getresolvedby getname public resolution type get type return this type resolutiontype gettype private final resolution type type public resolution event resolution type type this what task revision resolution this type type resolutiontype resolutionevent resolutiontype taskrevision override public string to string return this get name this get date this get what this get removed this get type equals resolution type unknown this get type tostring getname getdate getwhat getremoved gettype resolutiontype gettype public status type get type return this type statustype gettype private final status type type public status event status type type this what task revision status this type type statustype statusevent statustype taskrevision override public string to string return this get name this get date this get what this get removed this get type tostring getname getdate getwhat getremoved gettype public void add event task revision event if event instanceof status event this status events add status event event return if event instanceof resolution event this resolution events add resolution event event return if event instanceof assignment event this assignment events add assignment event event return if event instanceof attachment event this attachment events add attachment event event return this other events add event addevent taskrevision statusevent statusevents statusevent resolutionevent resolutionevents resolutionevent assignmentevent assignmentevents assignmentevent attachmentevent attachmentevents attachmentevent otherevents public list assignment event get assignment events return assignment events assignmentevent getassignmentevents assignmentevents public list attachment event get attachment events return attachment events attachmentevent getattachmentevents attachmentevents private list task revision get events list task revision events new array list task revision events add all this status events events add all this resolution events events add all this assignment events events add all this attachment events events add all this other events collections sort events return events taskrevision getevents taskrevision arraylist taskrevision addall statusevents addall resolutionevents addall assignmentevents addall attachmentevents addall otherevents public list task revision get other events return other events taskrevision getotherevents otherevents public list resolution event get resolution events return resolution events resolutionevent getresolutionevents resolutionevents public list status event get status events return status events statusevent getstatusevents statusevents public iterator task revision iterator return get events iterator taskrevision getevents public int size return this other events size this status events size this resolution events size this assignment events size otherevents statusevents resolutionevents assignmentevents public task history this status events new array list status event this resolution events new array list resolution event this assignment events new array list assignment event this attachment events new array list attachment event this other events new array list task revision taskhistory statusevents arraylist statusevent resolutionevents arraylist resolutionevent assignmentevents arraylist assignmentevent attachmentevents arraylist attachmentevent otherevents arraylist taskrevision override public string to string string buffer sb new string buffer for object event this sb append event sb append n return sb to string tostring stringbuffer stringbuffer tostring public int compare to task revision o return this date compare to o get date compareto taskrevision compareto getdate public static task revision create event string type string change task revision event new task revision event set what type if status equals type event new status event status type convert change if resolution equals type event new resolution event resolution type convert change if assignment equals type event new assignment event change if type contains attachment type contains flag event new attachment event attachment event parse id type attachment event parse flags change event set added change return event taskrevision createevent taskrevision taskrevision setwhat statusevent statustype resolutionevent resolutiontype assignmentevent attachmentevent attachmentevent parseid attachmentevent parseflags setadded public string get added return this added getadded public string get date return this date getdate public string get name return this name getname public string get removed return this removed getremoved public string get what return this what getwhat private void set added string added this added added setadded public void set date string date this date date setdate public void set name string name this name name setname public void set removed string removed this removed removed setremoved private void set what string what this what what setwhat protected string added protected task revision this added taskrevision override public string to string return this name this date this what this removed this added tostring returns null if version string unknown static public bugzilla server version from string string version if version equals server 30 to string return server 30 if version equals server 222 to string return server 222 if version equals server 220 to string return server 220 if version equals server 218 to string return server 218 return null bugzillaserverversion fromstring server_30 tostring server_30 server_222 tostring server_222 server_220 tostring server_220 server_218 tostring server_218 override public string to string switch this case server 30 return 3 0 case server 222 return 2 22 case server 220 return 2 20 case server 218 return 2 18 default return null tostring server_30 server_222 server_220 server_218 public class multi bug report factory extends abstract report factory public multi bug report factory input stream in stream string encoding super in stream encoding multibugreportfactory abstractreportfactory multibugreportfactory inputstream instream instream public void populate report map string repository task data bug map throws io exception core exception sax multi bug report content handler content handler new sax multi bug report content handler bugzilla attribute factory bug map collect results content handler false if content handler error occurred string error response content handler get error message to lower case locale english if error response equals i bugzilla constants xml error notfound error response equals i bugzilla constants xml error invalidbugid throw new core exception new bugzilla status i status warning bugzilla core plugin plugin id repository status error repository i bugzilla constants error msg invalid bug id if error response equals i bugzilla constants xml error notpermitted throw new core exception new bugzilla status i status warning bugzilla core plugin plugin id repository status error repository i bugzilla constants error msg op not permitted populatereport repositorytaskdata bugmap ioexception coreexception saxmultibugreportcontenthandler contenthandler saxmultibugreportcontenthandler bugzillaattributefactory bugmap collectresults contenthandler contenthandler erroroccurred errorresponse contenthandler geterrormessage tolowercase errorresponse ibugzillaconstants xml_error_notfound errorresponse ibugzillaconstants xml_error_invalidbugid coreexception bugzillastatus istatus bugzillacoreplugin plugin_id repositorystatus error_repository ibugzillaconstants error_msg_invalid_bug_id errorresponse ibugzillaconstants xml_error_notpermitted coreexception bugzillastatus istatus bugzillacoreplugin plugin_id repositorystatus error_repository ibugzillaconstants error_msg_op_not_permitted class sax error handler implements error handler public void error sax parse exception exception throws sax exception throw exception saxerrorhandler errorhandler saxparseexception saxexception public void fatal error sax parse exception exception throws sax exception throw exception fatalerror saxparseexception saxexception public repository configuration get configuration throws io exception core exception sax configuration content handler content handler new sax configuration content handler collect results content handler true repository configuration config content handler get configuration return config repositoryconfiguration getconfiguration ioexception coreexception saxconfigurationcontenthandler contenthandler saxconfigurationcontenthandler collectresults contenthandler repositoryconfiguration contenthandler getconfiguration public class repository configuration factory extends abstract report factory public repository configuration factory input stream in stream string encoding super in stream encoding repositoryconfigurationfactory abstractreportfactory repositoryconfigurationfactory inputstream instream instream public void warning sax parse exception exception throws sax exception ignore saxparseexception saxexception adds a component to the given product public void add component string product string component if components contains component components add component product entry entry products get product if entry null entry new product entry product products put product entry entry add component component addcomponent productentry productentry addcomponent void add component string component name if components contains component name components add component name addcomponent componentname componentname componentname public void add keyword string keyword keywords add keyword addkeyword public void add open status value string value open status values add value addopenstatusvalue openstatusvalues public void addos string os operating systems add os operatingsystems public void add platform string platform platforms add platform addplatform public void add priority string priority priorities add priority addpriority adds a product to the configuration public void add product string name if products contains key name product entry product new product entry name products put name product addproduct containskey productentry productentry public void add resolution string res resolution values add res addresolution resolutionvalues public void add severity string severity severities add severity addseverity public void add status string status bug status add status addstatus bugstatus public void add target milestone string product string target if milestones contains target milestones add target product entry entry products get product if entry null entry new product entry product products put product entry entry add target milestone target addtargetmilestone productentry productentry addtargetmilestone void add target milestone string target milestones add target addtargetmilestone public void add version string product string version if versions contains version versions add version product entry entry products get product if entry null entry new product entry product products put product entry entry add version version addversion productentry productentry addversion void add version string name if versions contains name versions add name addversion returns an array of names of component that exist for a given product or code null code if the product does not exist public list string get components string product product entry entry products get product if entry null return entry get components else return collections empty list getcomponents productentry getcomponents emptylist list string get components return components getcomponents public list string get components return components getcomponents public string get install version return version getinstallversion public list string get keywords return keywords getkeywords public list string get open status values return open status values getopenstatusvalues openstatusvalues public list string get option values bugzilla report element element string product switch element case product return get products case target milestone return get target milestones return get target milestones product case bug status return get status values case version return get versions return get versions product case component return get components return get components product case rep platform return get platforms case op sys return geto ss case priority return get priorities case bug severity return get severities case keywords return get keywords case resolution return get resolutions default return new array list string getoptionvalues bugzillareportelement getproducts target_milestone gettargetmilestones gettargetmilestones bug_status getstatusvalues getversions getversions getcomponents getcomponents rep_platform getplatforms op_sys getoss getpriorities bug_severity getseverities getkeywords getresolutions arraylist returns an array of names of valid os values public list string geto ss return operating systems getoss operatingsystems returns an array of names of valid platform values public list string get platforms return platforms getplatforms returns an array of names of valid platform values public list string get priorities return priorities getpriorities returns an array of names of current products public list string get products array list string product list new array list string products key set collections sort product list return product list getproducts arraylist productlist arraylist keyset productlist productlist public string get repository url return repository url getrepositoryurl repositoryurl public list string get resolutions return resolution values getresolutions resolutionvalues returns an array of names of valid severity values public list string get severities return severities getseverities public list string get status values return bug status getstatusvalues bugstatus public list string get target milestones string product product entry entry products get product if entry null return entry get target milestones else return collections empty list gettargetmilestones productentry gettargetmilestones emptylist list string get target milestones return milestones gettargetmilestones public list string get target milestones return milestones gettargetmilestones returns an array of names of versions that exist for a given product or code null code if the product does not exist public list string get versions string product product entry entry products get product if entry null return entry get versions else return collections empty list getversions productentry getversions emptylist list string get versions return versions getversions public list string get versions return versions getversions list string milestones new array list string product entry string name this product name name arraylist productentry productname private string version version unknown public repository configuration super ignore version_unknown repositoryconfiguration public void set install version string version this version version setinstallversion public void set repository url string repository url this repository url repository url setrepositoryurl repositoryurl repositoryurl repositoryurl expects rdf returned from repository ctype rdf in url throws general security exception public void perform query string repository url i task collector collector int max hits throws io exception sax bugzilla query content handler content handler new sax bugzilla query content handler repository url collector collect results content handler false generalsecurityexception performquery repositoryurl itaskcollector maxhits ioexception saxbugzillaquerycontenthandler contenthandler saxbugzillaquerycontenthandler repositoryurl collectresults contenthandler public class repository query results factory extends abstract report factory public repository query results factory input stream in stream string encoding super in stream encoding repositoryqueryresultsfactory abstractreportfactory repositoryqueryresultsfactory inputstream instream instream public void populate report repository task data bug report throws io exception core exception sax bug report content handler content handler new sax bug report content handler bugzilla attribute factory bug report collect results content handler false if content handler error occurred string error response content handler get error message to lower case locale english if error response equals i bugzilla constants xml error notfound error response equals i bugzilla constants xml error invalidbugid throw new core exception new bugzilla status i status warning bugzilla core plugin plugin id repository status error repository bug report get repository url i bugzilla constants error msg invalid bug id if error response equals i bugzilla constants xml error notpermitted throw new core exception new bugzilla status i status warning bugzilla core plugin plugin id repository status error repository bug report get repository url i bugzilla constants error msg op not permitted populatereport repositorytaskdata bugreport ioexception coreexception saxbugreportcontenthandler contenthandler saxbugreportcontenthandler bugzillaattributefactory bugreport collectresults contenthandler contenthandler erroroccurred errorresponse contenthandler geterrormessage tolowercase errorresponse ibugzillaconstants xml_error_notfound errorresponse ibugzillaconstants xml_error_invalidbugid coreexception bugzillastatus istatus bugzillacoreplugin plugin_id repositorystatus error_repository bugreport getrepositoryurl ibugzillaconstants error_msg_invalid_bug_id errorresponse ibugzillaconstants xml_error_notpermitted coreexception bugzillastatus istatus bugzillacoreplugin plugin_id repositorystatus error_repository bugreport getrepositoryurl ibugzillaconstants error_msg_op_not_permitted public class repository report factory extends abstract report factory public repository report factory input stream in stream string encoding super in stream encoding repositoryreportfactory abstractreportfactory repositoryreportfactory inputstream instream instream override public void characters char ch int start int length throws sax exception characters append ch start length if monitor is canceled throw new operation canceled exception search cancelled saxexception iscanceled operationcanceledexception override public void end element string uri string local name string q name throws sax exception string parsed text html stream tokenizer unescape characters to string bugzilla report element tag bugzilla report element unknown try tag bugzilla report element value of local name trim to upper case locale english catch runtime exception e if e instanceof illegal argument exception ignore unrecognized tags return throw e switch tag case bug id try if repository task data get id equals parsed text error message requested report number does not match returned report number catch exception e error message bug id from server did not match requested id repository task attribute attr repository task data get attribute tag get key string if attr null attr attribute factory create attribute tag get key string repository task data add attribute tag get key string attr attr set value parsed text break comment attributes case who case bug when if task comment null repository task attribute attr attribute factory create attribute tag get key string attr set value parsed text task comment add attribute tag get key string attr break case thetext if task comment null repository task attribute attr attribute factory create attribute tag get key string attr set value parsed text task comment add attribute tag get key string attr check for attachment parse attachment task comment parsed text break case long desc if task comment null if task comment get number 0 repository task data set attribute value repository task attribute description task comment get text break repository task data add comment task comment break attachment attributes case attachid case date case desc case filename case ctype case type if attachment null repository task attribute attr attribute factory create attribute tag get key string attr set value parsed text attachment add attribute tag get key string attr break case data todo need to figure out under what circumstanceswhen attachments are inline and what to do with them jpound if data gets stored here the attachment actions in the task editor should be updated to use this data instead of retrieving from server break case attachment if attachment null repository task data add attachment attachment break ignored elements case reporter accessible case classification id case classification case cclist accessible case everconfirmed case bugzilla break case bug reached end of bug need to set longdesclength to number of comments repository task attribute num comments attribute repository task data get attribute bugzilla report element longdesclength get key string if num comments attribute null num comments attribute attribute factory create attribute bugzilla report element longdesclength get key string num comments attribute set value repository task data get comments size repository task data add attribute bugzilla report element longdesclength get key string num comments attribute else num comments attribute set value repository task data get comments size set the creator name on all attachments for repository attachment attachment repository task data get attachments task comment task comment attach id to comment get attachment get id if task comment null attachment set creator task comment get author attachment set attribute value repository task attribute attachment url repository task data get repository url i bugzilla constants url get attachment suffix attachment get id attachment set repository kind repository task data get repository kind attachment set repository url repository task data get repository url attachment set task id repository task data get id break case blocked case dependson repository task attribute dependancy attribute repository task data get attribute tag get key string if dependancy attribute null dependancy attribute attribute factory create attribute tag get key string dependancy attribute set value parsed text repository task data add attribute tag get key string dependancy attribute else if dependancy attribute get value equals dependancy attribute set value parsed text else dependancy attribute set value dependancy attribute get value parsed text break all others added as report attribute default repository task attribute attribute repository task data get attribute tag get key string if attribute null attribute attribute factory create attribute tag get key string attribute set value parsed text repository task data add attribute tag get key string attribute else attribute add value parsed text break endelement localname qname saxexception parsedtext htmlstreamtokenizer tostring bugzillareportelement bugzillareportelement bugzillareportelement valueof localname touppercase runtimeexception illegalargumentexception bug_id repositorytaskdata getid parsedtext errormessage errormessage repositorytaskattribute repositorytaskdata getattribute getkeystring attributefactory createattribute getkeystring repositorytaskdata addattribute getkeystring setvalue parsedtext bug_when taskcomment repositorytaskattribute attributefactory createattribute getkeystring setvalue parsedtext taskcomment addattribute getkeystring taskcomment repositorytaskattribute attributefactory createattribute getkeystring setvalue parsedtext taskcomment addattribute getkeystring parseattachment taskcomment parsedtext long_desc taskcomment taskcomment getnumber repositorytaskdata setattributevalue repositorytaskattribute taskcomment gettext repositorytaskdata addcomment taskcomment repositorytaskattribute attributefactory createattribute getkeystring setvalue parsedtext addattribute getkeystring repositorytaskdata addattachment reporter_accessible classification_id cclist_accessible repositorytaskattribute numcommentsattribute repositorytaskdata getattribute bugzillareportelement getkeystring numcommentsattribute numcommentsattribute attributefactory createattribute bugzillareportelement getkeystring numcommentsattribute setvalue repositorytaskdata getcomments repositorytaskdata addattribute bugzillareportelement getkeystring numcommentsattribute numcommentsattribute setvalue repositorytaskdata getcomments repositoryattachment repositorytaskdata getattachments taskcomment taskcomment attachidtocomment getid taskcomment setcreator taskcomment getauthor setattributevalue repositorytaskattribute attachment_url repositorytaskdata getrepositoryurl ibugzillaconstants url_get_attachment_suffix getid setrepositorykind repositorytaskdata getrepositorykind setrepositoryurl repositorytaskdata getrepositoryurl settaskid repositorytaskdata getid repositorytaskattribute dependancyattribute repositorytaskdata getattribute getkeystring dependancyattribute dependancyattribute attributefactory createattribute getkeystring dependancyattribute setvalue parsedtext repositorytaskdata addattribute getkeystring dependancyattribute dependancyattribute getvalue dependancyattribute setvalue parsedtext dependancyattribute setvalue dependancyattribute getvalue parsedtext repositorytaskattribute repositorytaskdata getattribute getkeystring attributefactory createattribute getkeystring setvalue parsedtext repositorytaskdata addattribute getkeystring addvalue parsedtext public boolean error occurred return error message null erroroccurred errormessage public string get error message return error message geterrormessage errormessage public repository task data get report return repository task data repositorytaskdata getreport repositorytaskdata determines attachment id from comment private void parse attachment task comment task comment string comment text string attachmentid if comment text starts with comment attachment string int end index comment text index of if end index 0 end index comment text length attachmentid comment text substring comment attachment string length end index if attachmentid equals task comment set has attachment true task comment set attachment id attachmentid attach id to comment put attachmentid task comment parseattachment taskcomment taskcomment commenttext commenttext startswith comment_attachment_string endindex commenttext indexof endindex endindex commenttext commenttext comment_attachment_string endindex taskcomment sethasattachment taskcomment setattachmentid attachidtocomment taskcomment private abstract attribute factory attribute factory public sax bug report content handler abstract attribute factory factory repository task data task data this attribute factory factory this repository task data task data abstractattributefactory attributefactory saxbugreportcontenthandler abstractattributefactory repositorytaskdata taskdata attributefactory repositorytaskdata taskdata override public void start element string uri string local name string q name attributes attributes throws sax exception characters new string buffer bugzilla report element tag bugzilla report element unknown try tag bugzilla report element value of local name trim to upper case locale english catch runtime exception e if e instanceof illegal argument exception ignore unrecognized tags return throw e switch tag case bugzilla note here we can get the bugzilla version if necessary break case bug if attributes null attributes get value error null error message attributes get value error break case long desc task comment new task comment attribute factory comment num break case attachment attachment new repository attachment attribute factory if attributes null if 1 equals attributes get value bugzilla report element is obsolete get key string attachment add attribute bugzilla report element is obsolete get key string attribute factory create attribute bugzilla report element is obsolete get key string attachment set obsolete true if 1 equals attributes get value bugzilla report element is patch get key string attachment set patch true break startelement localname qname saxexception stringbuffer bugzillareportelement bugzillareportelement bugzillareportelement valueof localname touppercase runtimeexception illegalargumentexception getvalue errormessage getvalue long_desc taskcomment taskcomment attributefactory commentnum repositoryattachment attributefactory getvalue bugzillareportelement is_obsolete getkeystring addattribute bugzillareportelement is_obsolete getkeystring attributefactory createattribute bugzillareportelement is_obsolete getkeystring setobsolete getvalue bugzillareportelement is_patch getkeystring setpatch override public void characters char ch int start int length throws sax exception characters append ch start length saxexception override public void end element string uri string local name string q name throws sax exception string parsed text html stream tokenizer unescape characters to string bugzilla report element tag bugzilla report element unknown try tag bugzilla report element value of local name trim to upper case locale english switch tag case id id parsed text break case bug severity severity parsed text break case priority priority parsed text break case rep platform platform parsed text break case assigned to hit set owner parsed text break case bug status state parsed text break case resolution resolution parsed text break case short desc description parsed text break case short short desc description parsed text break case li bugzilla task task new bugzilla task repository url id description task set priority priority todo set state collector accept task catch runtime exception e if e instanceof illegal argument exception ignore unrecognized tags return throw e endelement localname qname saxexception parsedtext htmlstreamtokenizer tostring bugzillareportelement bugzillareportelement bugzillareportelement valueof localname touppercase parsedtext bug_severity parsedtext parsedtext rep_platform parsedtext assigned_to setowner parsedtext bug_status parsedtext parsedtext short_desc parsedtext short_short_desc parsedtext bugzillatask bugzillatask repositoryurl setpriority runtimeexception illegalargumentexception private string repository url public sax bugzilla query content handler string repository url i task collector collector this repository url repository url this collector collector repositoryurl saxbugzillaquerycontenthandler repositoryurl itaskcollector repositoryurl repositoryurl override public void start element string uri string local name string q name attributes attributes throws sax exception characters new string buffer bugzilla report element tag bugzilla report element unknown try tag bugzilla report element value of local name trim to upper case locale english switch tag case li hit new bugzilla query hit hit set repository repository url break catch runtime exception e if e instanceof illegal argument exception ignore unrecognized tags return throw e startelement localname qname saxexception stringbuffer bugzillareportelement bugzillareportelement bugzillareportelement valueof localname touppercase bugzillaqueryhit setrepository repositoryurl runtimeexception illegalargumentexception override public void characters char ch int start int length throws sax exception characters append ch start length saxexception override public void end document throws sax exception for string product components key set list string componentur is components get product for string uri componentur is string real name component names get uri if real name null configuration add component product real name for string product versions key set list string versionur is versions get product for string uri versionur is string real name version names get uri if real name null configuration add version product real name for string product milestones key set list string milestoneur is milestones get product for string uri milestoneur is string real name milestone names get uri if real name null configuration add target milestone product real name super end document enddocument saxexception keyset componenturis componenturis realname componentnames realname addcomponent realname keyset versionuris versionuris realname versionnames realname addversion realname keyset milestoneuris milestoneuris realname milestonenames realname addtargetmilestone realname enddocument override public void end element string uri string local name string q name throws sax exception keep state in li in li if local name equals element status state state in status else if local name equals element li state in li li in li li state state in li li else if local name equals element li state in li li in li li state state in li if characters length 0 return if state in status configuration add status characters to string else if state in status open configuration add open status value characters to string else if state in status closed todo add closed status values to configuration else if state in resolution configuration add resolution characters to string else if state in keyword configuration add keyword characters to string else if state in platform configuration add platform characters to string else if state in op sys configuration addos characters to string else if state in priority configuration add priority characters to string else if state in severity configuration add severity characters to string else if local name equals element platform state state in platform else if local name equals element op sys state state in op sys else if local name equals element priority state state in priority else if local name equals element severity state state in severity else if local name equals element products state state in products else if local name equals element op sys state state in op sys else if local name equals element name state state in name if state in products in li product name current product characters to string configuration add product current product else if state in versions in li in version version name if about null version names contains value about if characters length 0 version names put about characters to string else if state in components in li in component component name if about null component names contains value about if characters length 0 component names put about characters to string else if state in target milestones in li in target milestone milestone name if about null milestone names contains value about if characters length 0 milestone names put about characters to string else if local name equals element components state state in components else if local name equals element component state state in component else if local name equals element version state state in version else if local name equals element versions state state in versions else if local name equals element install version state state in install version configuration set install version characters to string else if local name equals element target milestone state state in target milestone else if local name equals element target milestones state state in target milestones else if local name equals element status open state state in status open else if local name equals element resolution state state in resolution else if local name equals element keyword state state in keyword endelement localname qname saxexception in_li in_li localname element_status in_status localname element_li in_li_li in_li_li in_li_li localname element_li in_li_li in_li_li in_li in_status addstatus tostring in_status_open addopenstatusvalue tostring in_status_closed in_resolution addresolution tostring in_keyword addkeyword tostring in_platform addplatform tostring in_op_sys tostring in_priority addpriority tostring in_severity addseverity tostring localname element_platform in_platform localname element_op_sys in_op_sys localname element_priority in_priority localname element_severity in_severity localname element_products in_products localname element_op_sys in_op_sys localname element_name in_name in_products in_li currentproduct tostring addproduct currentproduct in_versions in_li in_version versionnames containsvalue versionnames tostring in_components in_li in_component componentnames containsvalue componentnames tostring in_target_milestones in_li in_target_milestone milestonenames containsvalue milestonenames tostring localname element_components in_components localname element_component in_component localname element_version in_version localname element_versions in_versions localname element_install_version in_install_version setinstallversion tostring localname element_target_milestone in_target_milestone localname element_target_milestones in_target_milestones localname element_status_open in_status_open localname element_resolution in_resolution localname element_keyword in_keyword private map string string milestone names new hash map string string public repository configuration get configuration return configuration milestonenames hashmap repositoryconfiguration getconfiguration private void parse resource attributes attributes switch state case in products in li in components in li li if attributes null string compuri attributes get value attribute resource if compuri null current product length 0 list string compur is components get current product if compur is null compur is new array list string components put current product compur is compur is add compuri break case in products in li in versions in li li if attributes null string resourceuri attributes get value attribute resource if resourceuri null current product length 0 list string version uris versions get current product if version uris null version uris new array list string versions put current product version uris version uris add resourceuri break case in products in li in target milestones in li li if attributes null string resourceuri attributes get value attribute resource if resourceuri null list string milestone uris milestones get current product if milestone uris null milestone uris new array list string milestones put current product milestone uris milestone uris add resourceuri break case in components in li in component if attributes null about attributes get value attribute rdf about break case in versions in li in version if attributes null about attributes get value attribute rdf about break case in target milestones in li in target milestone if attributes null about attributes get value attribute rdf about break parseresource in_products in_li in_components in_li_li getvalue attribute_resource currentproduct compuris currentproduct compuris compuris arraylist currentproduct compuris compuris in_products in_li in_versions in_li_li getvalue attribute_resource currentproduct versionuris currentproduct versionuris versionuris arraylist currentproduct versionuris versionuris in_products in_li in_target_milestones in_li_li getvalue attribute_resource milestoneuris currentproduct milestoneuris milestoneuris arraylist currentproduct milestoneuris milestoneuris in_components in_li in_component getvalue attribute_rdf_about in_versions in_li in_version getvalue attribute_rdf_about in_target_milestones in_li in_target_milestone getvalue attribute_rdf_about override public void start element string uri string local name string q name attributes attributes throws sax exception characters new string buffer if local name equals element status state state in status else if local name equals element li state in li in li state state in li li parse resource attributes else if local name equals element li state in li in li state state in li else if local name equals element platform state state in platform else if local name equals element op sys state state in op sys else if local name equals element priority state state in priority else if local name equals element severity state state in severity else if local name equals element products state state in products else if local name equals element op sys state state in op sys else if local name equals element name state state in name else if local name equals element components state state in components else if local name equals element component state state in component parse resource attributes else if local name equals element versions state state in versions else if local name equals element version state state in version parse resource attributes else if local name equals element install version state state in install version else if local name equals element target milestones state state in target milestones else if local name equals element target milestone state state in target milestone parse resource attributes else if local name equals element status open state state in status open else if local name equals element resolution state state in resolution else if local name equals element keyword state state in keyword startelement localname qname saxexception stringbuffer localname element_status in_status localname element_li in_li in_li in_li_li parseresource localname element_li in_li in_li in_li localname element_platform in_platform localname element_op_sys in_op_sys localname element_priority in_priority localname element_severity in_severity localname element_products in_products localname element_op_sys in_op_sys localname element_name in_name localname element_components in_components localname element_component in_component parseresource localname element_versions in_versions localname element_version in_version parseresource localname element_install_version in_install_version localname element_target_milestones in_target_milestones localname element_target_milestone in_target_milestone parseresource localname element_status_open in_status_open localname element_resolution in_resolution localname element_keyword in_keyword override public void characters char ch int start int length throws sax exception characters append ch start length if monitor is canceled throw new operation canceled exception search cancelled saxexception iscanceled operationcanceledexception override public void end element string uri string local name string q name throws sax exception string parsed text html stream tokenizer unescape characters to string bugzilla report element tag bugzilla report element unknown try tag bugzilla report element value of local name trim to upper case locale english catch runtime exception e if e instanceof illegal argument exception ignore unrecognized tags return throw e switch tag case bug id try repository task data task data map get parsed text trim if repository task data null error message parsed text id not found catch exception e error message bug id from server did not match requested id repository task attribute attr repository task data get attribute tag get key string if attr null attr attribute factory create attribute tag get key string repository task data add attribute tag get key string attr attr set value parsed text break comment attributes case who case bug when if task comment null repository task attribute attr attribute factory create attribute tag get key string attr set value parsed text task comment add attribute tag get key string attr break case thetext if task comment null repository task attribute attr attribute factory create attribute tag get key string attr set value parsed text task comment add attribute tag get key string attr check for attachment parse attachment task comment parsed text break case long desc if task comment null if task comment get number 0 repository task data set attribute value repository task attribute description task comment get text break repository task data add comment task comment break attachment attributes case attachid case date case desc case filename case ctype case type if attachment null repository task attribute attr attribute factory create attribute tag get key string attr set value parsed text attachment add attribute tag get key string attr break case data todo need to figure out under what circumstanceswhen attachments are inline and what to do with them jpound if data gets stored here the attachment actions in the task editor should be updated to use this data instead of retrieving from server break case attachment if attachment null repository task data add attachment attachment break ignored elements case reporter accessible case classification id case classification case cclist accessible case everconfirmed case bugzilla break case bug reached end of bug need to set longdesclength to number of comments repository task attribute num comments attribute repository task data get attribute bugzilla report element longdesclength get key string if num comments attribute null num comments attribute attribute factory create attribute bugzilla report element longdesclength get key string num comments attribute set value repository task data get comments size repository task data add attribute bugzilla report element longdesclength get key string num comments attribute else num comments attribute set value repository task data get comments size set the creator name on all attachments for repository attachment attachment repository task data get attachments task comment task comment attach id to comment get attachment get id if task comment null attachment set creator task comment get author attachment set attribute value repository task attribute attachment url repository task data get repository url i bugzilla constants url get attachment suffix attachment get id attachment set repository kind repository task data get repository kind attachment set repository url repository task data get repository url attachment set task id repository task data get id break case blocked case dependson repository task attribute dependancy attribute repository task data get attribute tag get key string if dependancy attribute null dependancy attribute attribute factory create attribute tag get key string dependancy attribute set value parsed text repository task data add attribute tag get key string dependancy attribute else if dependancy attribute get value equals dependancy attribute set value parsed text else dependancy attribute set value dependancy attribute get value parsed text break all others added as report attribute default repository task attribute attribute repository task data get attribute tag get key string if attribute null attribute attribute factory create attribute tag get key string attribute set value parsed text repository task data add attribute tag get key string attribute else attribute add value parsed text break endelement localname qname saxexception parsedtext htmlstreamtokenizer tostring bugzillareportelement bugzillareportelement bugzillareportelement valueof localname touppercase runtimeexception illegalargumentexception bug_id repositorytaskdata taskdatamap parsedtext repositorytaskdata errormessage parsedtext errormessage repositorytaskattribute repositorytaskdata getattribute getkeystring attributefactory createattribute getkeystring repositorytaskdata addattribute getkeystring setvalue parsedtext bug_when taskcomment repositorytaskattribute attributefactory createattribute getkeystring setvalue parsedtext taskcomment addattribute getkeystring taskcomment repositorytaskattribute attributefactory createattribute getkeystring setvalue parsedtext taskcomment addattribute getkeystring parseattachment taskcomment parsedtext long_desc taskcomment taskcomment getnumber repositorytaskdata setattributevalue repositorytaskattribute taskcomment gettext repositorytaskdata addcomment taskcomment repositorytaskattribute attributefactory createattribute getkeystring setvalue parsedtext addattribute getkeystring repositorytaskdata addattachment reporter_accessible classification_id cclist_accessible repositorytaskattribute numcommentsattribute repositorytaskdata getattribute bugzillareportelement getkeystring numcommentsattribute numcommentsattribute attributefactory createattribute bugzillareportelement getkeystring numcommentsattribute setvalue repositorytaskdata getcomments repositorytaskdata addattribute bugzillareportelement getkeystring numcommentsattribute numcommentsattribute setvalue repositorytaskdata getcomments repositoryattachment repositorytaskdata getattachments taskcomment taskcomment attachidtocomment getid taskcomment setcreator taskcomment getauthor setattributevalue repositorytaskattribute attachment_url repositorytaskdata getrepositoryurl ibugzillaconstants url_get_attachment_suffix getid setrepositorykind repositorytaskdata getrepositorykind setrepositoryurl repositorytaskdata getrepositoryurl settaskid repositorytaskdata getid repositorytaskattribute dependancyattribute repositorytaskdata getattribute getkeystring dependancyattribute dependancyattribute attributefactory createattribute getkeystring dependancyattribute setvalue parsedtext repositorytaskdata addattribute getkeystring dependancyattribute dependancyattribute getvalue dependancyattribute setvalue parsedtext dependancyattribute setvalue dependancyattribute getvalue parsedtext repositorytaskattribute repositorytaskdata getattribute getkeystring attributefactory createattribute getkeystring setvalue parsedtext repositorytaskdata addattribute getkeystring addvalue parsedtext public boolean error occurred return error message null erroroccurred errormessage public string get error message return error message geterrormessage errormessage determines attachment id from comment private void parse attachment task comment task comment string comment text string attachmentid if comment text starts with comment attachment string int end index comment text index of if end index 0 end index comment text length attachmentid comment text substring comment attachment string length end index if attachmentid equals task comment set has attachment true task comment set attachment id attachmentid attach id to comment put attachmentid task comment parseattachment taskcomment taskcomment commenttext commenttext startswith comment_attachment_string endindex commenttext indexof endindex endindex commenttext commenttext comment_attachment_string endindex taskcomment sethasattachment taskcomment setattachmentid attachidtocomment taskcomment private int retrieved 1 public sax multi bug report content handler abstract attribute factory factory map string repository task data task data map this attribute factory factory this task data map task data map saxmultibugreportcontenthandler abstractattributefactory repositorytaskdata taskdatamap attributefactory taskdatamap taskdatamap override public void start element string uri string local name string q name attributes attributes throws sax exception characters new string buffer bugzilla report element tag bugzilla report element unknown try tag bugzilla report element value of local name trim to upper case locale english catch runtime exception e if e instanceof illegal argument exception ignore unrecognized tags return throw e switch tag case bugzilla note here we can get the bugzilla version if necessary break case bug if attributes null attributes get value error null error message attributes get value error attach id to comment new hash map string task comment comment num 0 task comment null break case long desc task comment new task comment attribute factory comment num break case attachment attachment new repository attachment attribute factory if attributes null if 1 equals attributes get value bugzilla report element is obsolete get key string attachment add attribute bugzilla report element is obsolete get key string attribute factory create attribute bugzilla report element is obsolete get key string attachment set obsolete true if 1 equals attributes get value bugzilla report element is patch get key string attachment set patch true break startelement localname qname saxexception stringbuffer bugzillareportelement bugzillareportelement bugzillareportelement valueof localname touppercase runtimeexception illegalargumentexception getvalue errormessage getvalue attachidtocomment hashmap taskcomment commentnum taskcomment long_desc taskcomment taskcomment attributefactory commentnum repositoryattachment attributefactory getvalue bugzillareportelement is_obsolete getkeystring addattribute bugzillareportelement is_obsolete getkeystring attributefactory createattribute bugzillareportelement is_obsolete getkeystring setobsolete getvalue bugzillareportelement is_patch getkeystring setpatch private static final long serial versionuid 3937060773477757464l public unrecognized reponse exception string message super message serialversionuid unrecognizedreponseexception public static string buffer clean reader in html stream tokenizer tokenizer new html stream tokenizer in null string buffer content new string buffer hack since html stream tokenizer not familiar with xml tag content append xml version 1 0 encoding utf 8 try for token token tokenizer next token token get type token eof token tokenizer next token if token get type token tag html tag tag html tag token get value if tag get attribute resource null string resourceid tag get attribute resource tag set attribute resource resourceid replace amp if tag get attribute rdf about null string resourceid tag get attribute rdf about tag set attribute rdf about resourceid replace amp if token to string starts with xml content append token to string catch io exception e catch parse exception e return content stringbuffer htmlstreamtokenizer htmlstreamtokenizer stringbuffer stringbuffer htmlstreamtokenizer nexttoken gettype nexttoken gettype htmltag htmltag getvalue getattribute getattribute setattribute getattribute getattribute setattribute tostring startswith tostring ioexception parseexception override protected password authentication get password authentication string protocol get requesting protocol string host get requesting host can be null inet address address get requesting site can be null int port get requesting port string prompt get requesting prompt realm or message not documented that can be null string scheme get requesting scheme not documented that can be null string host string host if host string null address null address get host name if host string null host string non nls 1 string prompt string prompt if prompt null prompt string non nls 1 authentication auth user validation dialog get authentication host string prompt string if auth null return new password authentication auth get user auth get password to char array else return null passwordauthentication getpasswordauthentication getrequestingprotocol getrequestinghost inetaddress getrequestingsite getrequestingport getrequestingprompt getrequestingscheme hoststring hoststring gethostname hoststring hoststring promptstring promptstring uservalidationdialog getauthentication hoststring promptstring passwordauthentication getuser getpassword tochararray constructor param configuration the compare configuration used in this compare input see compare configuration public bugzilla compare input compare configuration configuration super configuration compareconfiguration bugzillacompareinput compareconfiguration return the original object that s to be compared appears on the top of the compare view public i structure comparator get ancestor return ancestor istructurecomparator getancestor return the local object that s to be compared appears on the left side of the compare view public i structure comparator get left return left istructurecomparator getleft return the online object that s to be compared appears on the right side of the compare view public i structure comparator get right return right istructurecomparator getright return code true code if a three way comparison is to be done public boolean is three way return three way isthreeway threeway override protected object prepare input i progress monitor monitor if left null right null return null differencer d new differencer root d find differences three way monitor null ancestor left right return root prepareinput iprogressmonitor finddifferences threeway sets the original object that s to be compared appears on the top of the compare view param new ancestor the new original object public void set ancestor repository task data new ancestor three way new ancestor null bugzilla compare structure creator structure creator new bugzilla compare structure creator ancestor structure creator get structure new ancestor newancestor setancestor repositorytaskdata newancestor threeway newancestor bugzillacomparestructurecreator structurecreator bugzillacomparestructurecreator structurecreator getstructure newancestor sets the local object that s to be compared appears on the left side of the compare view param new left the new local object public void set left repository task data new left bugzilla compare structure creator structure creator new bugzilla compare structure creator left structure creator get structure new left newleft setleft repositorytaskdata newleft bugzillacomparestructurecreator structurecreator bugzillacomparestructurecreator structurecreator getstructure newleft sets the online object that s to be compared appears on the right side of the compare view param new right the new online object public void set right repository task data new right bugzilla compare structure creator structure creator new bugzilla compare structure creator right structure creator get structure new right newright setright repositorytaskdata newright bugzillacomparestructurecreator structurecreator bugzillacomparestructurecreator structurecreator getstructure newright adds a node to this node s list of children param bug node the new child public void add child bugzilla compare node bug node if node children null node children new array list bugzilla compare node node children add bug node bugnode addchild bugzillacomparenode bugnode nodechildren nodechildren arraylist bugzillacomparenode nodechildren bugnode constructor the image for this node is set to code null code param key the label for this node param value the data for this node public bugzilla compare node string key string value this key value null bugzillacomparenode constructor param key the label for this node param value the data for this node param image the image for this node public bugzilla compare node string key string value image image super this key key this value check text value this node children null this image image bugzillacomparenode checktext nodechildren this function checks to make sure the given string is not code null code if it is the empty string is returned instead param new value the string to be checked return if the text is code null code then return the null string code code otherwise return the text private string check text string new value return new value null new value newvalue checktext newvalue newvalue newvalue override public boolean equals object arg0 if arg0 instanceof bugzilla compare node bugzilla compare node bug node bugzilla compare node arg0 return get key equals bug node get key return super equals arg0 bugzillacomparenode bugzillacomparenode bugnode bugzillacomparenode getkey bugnode getkey public object get children return node children null new object 0 node children to array getchildren nodechildren nodechildren toarray public input stream get contents throws core exception return new byte array input stream get value get bytes inputstream getcontents coreexception bytearrayinputstream getvalue getbytes public image get image return image getimage return the label for this node public string get key return key getkey public string get name return get key getname getkey public string get type return bug report gettype return the data for this node public string get value return value getvalue override public int hash code return get key hash code hashcode getkey hashcode parses the given code bug report code into a tree of code bugzilla compare node code s suitable for use in a compare viewer param bug the code bug report code that needs parsing return the tree of code bugzilla compare node code s public static bugzilla compare node parse bug report repository task data bug image default image platformui get workbench get shared images get image i shared images img def view bugzilla compare node top node new bugzilla compare node bug bug get id null default image image attribute image platformui get workbench get shared images get image i shared images img obj element bugzilla compare node attributes new bugzilla compare node attributes null attribute image for repository task attribute attribute bug get attributes bugzilla compare node child new bugzilla compare node attribute to string attribute get value default image attributes add child child bugzilla compare node comments new bugzilla compare node comments null default image for iterator task comment iter bug get comments iterator iter has next task comment task comment iter next string body string comment from task comment get author name n n task comment get text comments add child new bugzilla compare node task comment get attribute value bugzilla report element bug when get key string body string default image top node add child comments top node add child new bugzilla compare node new comment bug get new comment default image bugzilla compare node cc list new bugzilla compare node cc list null default image for iterator string iter bug get cc iterator iter has next string cc iter next cc list add child new bugzilla compare node cc cc default image top node add child cc list bugzilla compare node title node new bugzilla compare node bug report object null default image title node add child top node return title node bugreport bugzillacomparenode bugreport bugzillacomparenode bugzillacomparenode parsebugreport repositorytaskdata defaultimage getworkbench getsharedimages getimage isharedimages img_def_view bugzillacomparenode topnode bugzillacomparenode getid defaultimage attributeimage getworkbench getsharedimages getimage isharedimages img_obj_element bugzillacomparenode bugzillacomparenode attributeimage repositorytaskattribute getattributes bugzillacomparenode bugzillacomparenode tostring getvalue defaultimage addchild bugzillacomparenode bugzillacomparenode defaultimage taskcomment getcomments hasnext taskcomment taskcomment bodystring taskcomment getauthorname taskcomment gettext addchild bugzillacomparenode taskcomment getattributevalue bugzillareportelement bug_when getkeystring bodystring defaultimage topnode addchild topnode addchild bugzillacomparenode getnewcomment defaultimage bugzillacomparenode cclist bugzillacomparenode defaultimage getcc hasnext cclist addchild bugzillacomparenode defaultimage topnode addchild cclist bugzillacomparenode titlenode bugzillacomparenode bugreport defaultimage titlenode addchild topnode titlenode sets the image for this object this image is used when displaying this object in the ui param new image the new image public void set image image new image this image new image newimage setimage newimage newimage set the label for this node param key the new label public void set key string key this key key setkey set the data for this node param value the new data public void set value string value this value check text value setvalue checktext create a new bugzilla structure creator public bugzilla compare structure creator super bugzillastructurecreator bugzillacomparestructurecreator public string get contents object node boolean ignore whitespace if node instanceof bugzilla compare node string s bugzilla compare node node get value if ignore whitespace s s trim return s return null getcontents ignorewhitespace bugzillacomparenode bugzillacomparenode getvalue ignorewhitespace public string get name return bugzilla structure creator getname public i structure comparator get structure object input if input instanceof repository task data repository task data bug report repository task data input return bugzilla compare node parse bug report bug report else return null istructurecomparator getstructure repositorytaskdata repositorytaskdata bugreport repositorytaskdata bugzillacomparenode parsebugreport bugreport public i structure comparator locate object path object input return null istructurecomparator called whenever a copy operation has been performed on a tree node this implementation throws an code assertion failed exception code since we cannot update a bug report object param structure the node for which to save the new content param input the object from which the structure tree was created in code get structure code public void save i structure comparator node object input ignore assertionfailedexception getstructure istructurecomparator private static image descriptor create string prefix string name try return image descriptor create fromurl make icon fileurl prefix name catch malformedurl exception e return image descriptor get missing image descriptor imagedescriptor imagedescriptor createfromurl makeiconfileurl malformedurlexception imagedescriptor getmissingimagedescriptor lazily initializes image map public static image get image image descriptor image descriptor image registry image registry get image registry image image image registry get image descriptor hash code if image null image image descriptor create image image registry put image descriptor hash code image return image getimage imagedescriptor imagedescriptor imageregistry imageregistry getimageregistry imageregistry imagedescriptor hashcode imagedescriptor createimage imageregistry imagedescriptor hashcode private static image registry get image registry if image registry null image registry new image registry return image registry imageregistry getimageregistry imageregistry imageregistry imageregistry imageregistry private static url make icon fileurl string prefix string name throws malformedurl exception if baseurl null throw new malformedurl exception string buffer buffer new string buffer prefix if prefix buffer append buffer append name return new url baseurl buffer to string makeiconfileurl malformedurlexception malformedurlexception stringbuffer stringbuffer tostring public static final char pref delim repository public bugzilla ui plugin plugin this pref_delim_repository bugzillauiplugin private static string convert query options to array string values create a new string buffer and array list string buffer buffer new string buffer list string options new array list string char chars values to char array for int i 0 i chars length i if chars i options add buffer to string buffer new string buffer else buffer append chars i create a new string array with the same size as the array list string array new string options size put each element from the list into the array for int j 0 j options size j array j options get j return array convertqueryoptionstoarray stringbuffer stringbuffer arraylist tochararray tostring stringbuffer returns the shared instance public static bugzilla ui plugin get default return plugin bugzillauiplugin getdefault returns an image descriptor for the image file at the given plug in relative path param path the path return the image descriptor public static image descriptor get image descriptor string path return abstractui plugin image descriptor from plugin plugin id path imagedescriptor getimagedescriptor abstractuiplugin imagedescriptorfromplugin plugin_id public int get max results return get preference store get int i bugzilla constants max results getmaxresults getpreferencestore getint ibugzillaconstants max_results public static string get most recent query return plugin get preference store get string i bugzilla constants most recent query getmostrecentquery getpreferencestore getstring ibugzillaconstants most_recent_query returns the path to the file cacheing the product configuration private static i path get product configuration cache path i path state location platform get state location bugzilla core plugin get default get bundle i path config file state location append repository configurations return config file ipath getproductconfigurationcachepath ipath statelocation getstatelocation bugzillacoreplugin getdefault getbundle ipath configfile statelocation repositoryconfigurations configfile public static string get query options string pref id string selected products string repository url i preference store prefs bugzilla ui plugin get default get preference store if pref id equals i bugzilla constants values component pref id equals i bugzilla constants values version pref id equals i bugzilla constants values target selected products null list string options new array list string for string product selected products for string option convert query options to array prefs get string pref id pref delim repository repository url pref delim repository product if options contains option options add option return options to array new string options size else return convert query options to array prefs get string pref id pref delim repository repository url getqueryoptions prefid selectedproducts repositoryurl ipreferencestore bugzillauiplugin getdefault getpreferencestore prefid ibugzillaconstants values_component prefid ibugzillaconstants values_version prefid ibugzillaconstants values_target selectedproducts arraylist selectedproducts convertqueryoptionstoarray getstring prefid pref_delim_repository repositoryurl pref_delim_repository toarray convertqueryoptionstoarray getstring prefid pref_delim_repository repositoryurl private static string query options to string list string array string buffer buffer new string buffer for string string array buffer append string buffer append return buffer to string queryoptionstostring stringbuffer stringbuffer tostring override public void start bundle context context throws exception super start context get preference store set default i bugzilla constants max results 100 i path rep config cache file get product configuration cache path if rep config cache file null bugzilla core plugin set configuration cache file rep config cache file to file bugzilla repository connector bugzilla connector bugzilla repository connector tasks ui plugin get repository manager get repository connector bugzilla core plugin repository kind tasks ui plugin get repository manager add listener bugzilla connector get client manager bundlecontext getpreferencestore setdefault ibugzillaconstants max_results ipath repconfigcachefile getproductconfigurationcachepath repconfigcachefile bugzillacoreplugin setconfigurationcachefile repconfigcachefile tofile bugzillarepositoryconnector bugzillaconnector bugzillarepositoryconnector tasksuiplugin getrepositorymanager getrepositoryconnector bugzillacoreplugin repository_kind tasksuiplugin getrepositorymanager addlistener bugzillaconnector getclientmanager this method is called when the plug in is stopped override public void stop bundle context context throws exception bugzilla repository connector bugzilla connector bugzilla repository connector tasks ui plugin get repository manager get repository connector bugzilla core plugin repository kind tasks ui plugin get repository manager remove listener bugzilla connector get client manager super stop context plugin null bundlecontext bugzillarepositoryconnector bugzillaconnector bugzillarepositoryconnector tasksuiplugin getrepositorymanager getrepositoryconnector bugzillacoreplugin repository_kind tasksuiplugin getrepositorymanager removelistener bugzillaconnector getclientmanager update all of the query options for the bugzilla search page todo unify update of search options with update of bug attributes bugzilla server facade update bug attribute options public static void update query options task repository repository i progress monitor monitor string repository url repository get url if monitor is canceled throw new operation canceled exception todo pass monitor along since it is this call that does the work and can hang due to network io repository configuration config null try config bugzilla core plugin get repository configuration repository false catch exception e status handler fail e could not retrieve repository configuration for repository true return if monitor is canceled throw new operation canceled exception get the preferences store so that we can change the data in it i preference store prefs bugzilla ui plugin get default get preference store prefs set value i bugzilla constants values status pref delim repository repository url query options to string config get status values monitor worked 1 prefs set value i bugzilla constants valuse status preselected pref delim repository repository url query options to string config get open status values monitor worked 1 prefs set value i bugzilla constants values resolution pref delim repository repository url query options to string config get resolutions monitor worked 1 prefs set value i bugzilla constants values severity pref delim repository repository url query options to string config get severities monitor worked 1 prefs set value i bugzilla constants values priority pref delim repository repository url query options to string config get priorities monitor worked 1 prefs set value i bugzilla constants values hardware pref delim repository repository url query options to string config get platforms monitor worked 1 prefs set value i bugzilla constants values os pref delim repository repository url query options to string config geto ss monitor worked 1 prefs set value i bugzilla constants values product pref delim repository repository url query options to string config get products monitor worked 1 prefs set value i bugzilla constants values component pref delim repository repository url query options to string config get components monitor worked 1 prefs set value i bugzilla constants values version pref delim repository repository url query options to string config get versions monitor worked 1 prefs set value i bugzilla constants values target pref delim repository repository url query options to string config get target milestones monitor worked 1 for string product config get products prefs set value i bugzilla constants values component pref delim repository repository url pref delim repository product query options to string config get components product monitor worked 1 prefs set value i bugzilla constants values version pref delim repository repository url pref delim repository product query options to string config get versions product monitor worked 1 prefs set value i bugzilla constants values target pref delim repository repository url pref delim repository product query options to string config get target milestones product monitor worked 1 bugzillaserverfacade updatebugattributeoptions updatequeryoptions taskrepository iprogressmonitor repositoryurl geturl iscanceled operationcanceledexception repositoryconfiguration bugzillacoreplugin getrepositoryconfiguration statushandler iscanceled operationcanceledexception ipreferencestore bugzillauiplugin getdefault getpreferencestore setvalue ibugzillaconstants values_status pref_delim_repository repositoryurl queryoptionstostring getstatusvalues setvalue ibugzillaconstants valuse_status_preselected pref_delim_repository repositoryurl queryoptionstostring getopenstatusvalues setvalue ibugzillaconstants values_resolution pref_delim_repository repositoryurl queryoptionstostring getresolutions setvalue ibugzillaconstants values_severity pref_delim_repository repositoryurl queryoptionstostring getseverities setvalue ibugzillaconstants values_priority pref_delim_repository repositoryurl queryoptionstostring getpriorities setvalue ibugzillaconstants values_hardware pref_delim_repository repositoryurl queryoptionstostring getplatforms setvalue ibugzillaconstants values_os pref_delim_repository repositoryurl queryoptionstostring getoss setvalue ibugzillaconstants values_product pref_delim_repository repositoryurl queryoptionstostring getproducts setvalue ibugzillaconstants values_component pref_delim_repository repositoryurl queryoptionstostring getcomponents setvalue ibugzillaconstants values_version pref_delim_repository repositoryurl queryoptionstostring getversions setvalue ibugzillaconstants values_target pref_delim_repository repositoryurl queryoptionstostring gettargetmilestones getproducts setvalue ibugzillaconstants values_component pref_delim_repository repositoryurl pref_delim_repository queryoptionstostring getcomponents setvalue ibugzillaconstants values_version pref_delim_repository repositoryurl pref_delim_repository queryoptionstostring getversions setvalue ibugzillaconstants values_target pref_delim_repository repositoryurl pref_delim_repository queryoptionstostring gettargetmilestones private void add bug hyperlinks composite composite string key composite hyperlinks composite get managed form get toolkit create composite composite row layout row layout new row layout row layout margin bottom 0 row layout margin left 0 row layout margin right 0 row layout margin top 0 row layout spacing 0 hyperlinks composite set layout new row layout string values task data get attribute value key if values null values length 0 for string bug number values split final string bug id bug number trim hyperlink hyperlink get managed form get toolkit create hyperlink hyperlinks composite bug id swt none final abstract task task tasks ui plugin get task list manager get task list get task repository get url bug id if task null hyperlink set tool tip text task get summary hyperlink add hyperlink listener new hyperlink adapter override public void link activated hyperlink event e if task null tasks ui util refresh and open task list element task else tasks ui util open repository task repository get url bug id repository get url i bugzilla constants url get show bug bug id addbughyperlinks hyperlinkscomposite getmanagedform gettoolkit createcomposite rowlayout rowlayout rowlayout rowlayout marginbottom rowlayout marginleft rowlayout marginright rowlayout margintop rowlayout hyperlinkscomposite setlayout rowlayout taskdata getattributevalue bugnumber bugid bugnumber getmanagedform gettoolkit createhyperlink hyperlinkscomposite bugid abstracttask tasksuiplugin gettasklistmanager gettasklist gettask geturl bugid settooltiptext getsummary addhyperlinklistener hyperlinkadapter linkactivated hyperlinkevent tasksuiutil refreshandopentasklistelement tasksuiutil openrepositorytask geturl bugid geturl ibugzillaconstants url_get_show_bug bugid protected void add bugzilla time tracker form toolkit toolkit composite parent section time section toolkit create section parent expandable composite short title bar time section set text label time tracking grid layout gl new grid layout grid data gd new grid data swt fill swt none false false gd horizontal span 4 time section set layout gl time section set layout data gd composite time composite toolkit create composite time section gl new grid layout 4 false time composite set layout gl gd new grid data gd horizontal span 5 time composite set layout data gd repository task attribute attribute this task data get attribute bugzilla report element estimated time get key string if attribute null attribute is read only create label time composite attribute estimate text create text field time composite attribute swt flat estimate text set layout data new grid data grid data horizontal align fill label label toolkit create label time composite current estimate label set foreground toolkit get colors get color i form colors title text current estimate toolkit create text time composite float parse float task data get attribute value bugzilla report element actual time get key string float parse float task data get attribute value bugzilla report element remaining time get key string current estimate set font text font current estimate set layout data new grid data grid data horizontal align fill current estimate set editable false attribute this task data get attribute bugzilla report element actual time get key string if attribute null create label time composite attribute text actual text create text field time composite attribute swt flat actual text set layout data new grid data grid data horizontal align fill actual text set editable false add time task data set attribute value bugzilla report element work time get key string 0 final repository task attribute add time attribute this task data get attribute bugzilla report element work time get key string if add time attribute null create label time composite add time attribute add time text toolkit create text time composite task data get attribute value bugzilla report element work time get key string swt border add time text set font text font add time text set layout data new grid data grid data horizontal align fill add time text add modify listener new modify listener public void modify text modify event e add time attribute set value add time text get text attribute changed add time attribute attribute this task data get attribute bugzilla report element remaining time get key string if attribute null create label time composite attribute create text field time composite attribute swt flat attribute this task data get attribute bugzilla report element deadline get key string if attribute null create label time composite attribute composite date with clear toolkit create composite time composite grid layout layout new grid layout 2 false layout margin width 1 date with clear set layout layout deadline picker new date picker date with clear swt none swt border task data get attribute value bugzilla report element deadline get key string deadline picker set font text font deadline picker set date pattern yyyy mm dd if has changed attribute deadline picker set background get color incoming deadline picker add picker selection listener new selection listener public void widget default selected selection event e ignore public void widget selected selection event e calendar cal deadline picker get date if cal null date d cal get time simple date format f simple date format simple date format get date instance f apply pattern yyyy mm dd task data set attribute value bugzilla report element deadline get key string f format d attribute changed task data get attribute bugzilla report element deadline get key string todo goes dirty even if user presses cancel mark dirty true else task data set attribute value bugzilla report element deadline get key string attribute changed task data get attribute bugzilla report element deadline get key string deadline picker set date null image hyperlink clear deadline date toolkit create image hyperlink date with clear swt none clear deadline date set image tasks ui images get image tasks ui images remove clear deadline date set tool tip text clear clear deadline date add hyperlink listener new hyperlink adapter override public void link activated hyperlink event e task data set attribute value bugzilla report element deadline get key string attribute changed task data get attribute bugzilla report element deadline get key string deadline picker set date null time section set client time composite addbugzillatimetracker formtoolkit timesection createsection expandablecomposite short_title_bar timesection settext label_time_tracking gridlayout gridlayout griddata griddata horizontalspan timesection setlayout timesection setlayoutdata timecomposite createcomposite timesection gridlayout timecomposite setlayout griddata horizontalspan timecomposite setlayoutdata repositorytaskattribute taskdata getattribute bugzillareportelement estimated_time getkeystring isreadonly createlabel timecomposite estimatetext createtextfield timecomposite estimatetext setlayoutdata griddata griddata horizontal_align_fill createlabel timecomposite setforeground getcolors getcolor iformcolors currentestimate createtext timecomposite parsefloat taskdata getattributevalue bugzillareportelement actual_time getkeystring parsefloat taskdata getattributevalue bugzillareportelement remaining_time getkeystring currentestimate setfont text_font currentestimate setlayoutdata griddata griddata horizontal_align_fill currentestimate seteditable taskdata getattribute bugzillareportelement actual_time getkeystring createlabel timecomposite actualtext createtextfield timecomposite actualtext setlayoutdata griddata griddata horizontal_align_fill actualtext seteditable taskdata setattributevalue bugzillareportelement work_time getkeystring repositorytaskattribute addtimeattribute taskdata getattribute bugzillareportelement work_time getkeystring addtimeattribute createlabel timecomposite addtimeattribute addtimetext createtext timecomposite taskdata getattributevalue bugzillareportelement work_time getkeystring addtimetext setfont text_font addtimetext setlayoutdata griddata griddata horizontal_align_fill addtimetext addmodifylistener modifylistener modifytext modifyevent addtimeattribute setvalue addtimetext gettext attributechanged addtimeattribute taskdata getattribute bugzillareportelement remaining_time getkeystring createlabel timecomposite createtextfield timecomposite taskdata getattribute bugzillareportelement getkeystring createlabel timecomposite datewithclear createcomposite timecomposite gridlayout gridlayout marginwidth datewithclear setlayout deadlinepicker datepicker datewithclear taskdata getattributevalue bugzillareportelement getkeystring deadlinepicker setfont text_font deadlinepicker setdatepattern haschanged deadlinepicker setbackground getcolorincoming deadlinepicker addpickerselectionlistener selectionlistener widgetdefaultselected selectionevent widgetselected selectionevent deadlinepicker getdate gettime simpledateformat simpledateformat simpledateformat getdateinstance applypattern taskdata setattributevalue bugzillareportelement getkeystring attributechanged taskdata getattribute bugzillareportelement getkeystring markdirty taskdata setattributevalue bugzillareportelement getkeystring attributechanged taskdata getattribute bugzillareportelement getkeystring deadlinepicker setdate imagehyperlink cleardeadlinedate createimagehyperlink datewithclear cleardeadlinedate setimage tasksuiimages getimage tasksuiimages cleardeadlinedate settooltiptext cleardeadlinedate addhyperlinklistener hyperlinkadapter linkactivated hyperlinkevent taskdata setattributevalue bugzillareportelement getkeystring attributechanged taskdata getattribute bugzillareportelement getkeystring deadlinepicker setdate timesection setclient timecomposite private button add button field composite roles composite repository task attribute attribute int style if attribute null return null string name attribute get name if has outgoing change attribute name final button button get managed form get toolkit create button roles composite name style if attribute is read only button set data attribute button set selection attribute get value equals 1 button set layout data new grid data grid data horizontal align fill button add selection listener new selection adapter override public void widget selected selection event e string sel 1 if button get selection sel 0 repository task attribute a repository task attribute button get data a set value sel attribute changed a return button addbuttonfield rolescomposite repositorytaskattribute getname hasoutgoingchange getmanagedform gettoolkit createbutton rolescomposite isreadonly setdata setselection getvalue setlayoutdata griddata griddata horizontal_align_fill addselectionlistener selectionadapter widgetselected selectionevent getselection repositorytaskattribute repositorytaskattribute getdata setvalue attributechanged protected void add keywords list composite attributes composite throws io exception new layout attributes composite 1 keywords property final repository task attribute attribute task data get attribute repository task attribute keywords if attribute null return label label create label attributes composite attribute grid data factory fill defaults align swt right swt center apply to label toolkit create text attributes composite keywords keywords text create text field attributes composite attribute swt flat keywords text set font text font grid data keywords data new grid data grid data horizontal align fill keywords data horizontal span 2 keywords data width hint 200 keywords text set layout data keywords data button change keywords button get managed form get toolkit create button attributes composite edit swt flat grid data key words button data new grid data change keywords button set layout data key words button data change keywords button add selection listener new selection listener public void widget default selected selection event e public void widget selected selection event e string keywords attribute get value shell shell null if platformui get workbench get active workbench window null shell platformui get workbench get active workbench window get shell else shell new shell platformui get workbench get display list string valid keywords new array list string try valid keywords bugzilla core plugin get repository configuration repository false get keywords catch exception ex ignore keywords dialog keywords dialog new keywords dialog shell keywords valid keywords int response code keywords dialog open string new keywords keywords dialog get selected keywords string if response code dialog ok keywords null keywords text set text new keywords attribute set value new keywords attribute changed attribute else return addkeywordslist attributescomposite ioexception newlayout attributescomposite repositorytaskattribute taskdata getattribute repositorytaskattribute createlabel attributescomposite griddatafactory filldefaults applyto createtext attributescomposite keywordstext createtextfield attributescomposite keywordstext setfont text_font griddata keywordsdata griddata griddata horizontal_align_fill keywordsdata horizontalspan keywordsdata widthhint keywordstext setlayoutdata keywordsdata changekeywordsbutton getmanagedform gettoolkit createbutton attributescomposite griddata keywordsbuttondata griddata changekeywordsbutton setlayoutdata keywordsbuttondata changekeywordsbutton addselectionlistener selectionlistener widgetdefaultselected selectionevent widgetselected selectionevent getvalue getworkbench getactiveworkbenchwindow getworkbench getactiveworkbenchwindow getshell getworkbench getdisplay validkeywords arraylist validkeywords bugzillacoreplugin getrepositoryconfiguration getkeywords keywordsdialog keywordsdialog keywordsdialog validkeywords responsecode keywordsdialog newkeywords keywordsdialog getselectedkeywordsstring responsecode keywordstext settext newkeywords setvalue newkeywords attributechanged protected void add roles composite parent section roles section get managed form get toolkit create section parent expandable composite short title bar roles section set text users in the roles selected below can always view this bug roles section set description the assignee can always see a bug and this section does not take effect unless the bug is restricted to at least one group grid layout gl new grid layout grid data gd new grid data swt fill swt none false false gd horizontal span 4 roles section set layout gl roles section set layout data gd composite roles composite get managed form get toolkit create composite roles section grid layout attributes layout new grid layout attributes layout num columns 4 attributes layout horizontal spacing 5 attributes layout vertical spacing 4 roles composite set layout attributes layout grid data attributes data new grid data grid data fill both attributes data horizontal span 1 attributes data grab excess vertical space false roles composite set layout data attributes data roles section set client roles composite repository task attribute attribute task data get attribute bugzilla report element reporter accessible get key string if attribute null task data set attribute value bugzilla report element reporter accessible get key string 0 attribute task data get attribute bugzilla report element reporter accessible get key string button button add button field roles composite attribute swt check if has changed attribute button set background get color incoming attribute null attribute task data get attribute bugzilla report element cclist accessible get key string if attribute null task data set attribute value bugzilla report element cclist accessible get key string 0 attribute task data get attribute bugzilla report element cclist accessible get key string button add button field roles composite attribute swt check if has changed attribute button set background get color incoming addroles rolessection getmanagedform gettoolkit createsection expandablecomposite short_title_bar rolessection settext rolessection setdescription gridlayout gridlayout griddata griddata horizontalspan rolessection setlayout rolessection setlayoutdata rolescomposite getmanagedform gettoolkit createcomposite rolessection gridlayout attributeslayout gridlayout attributeslayout numcolumns attributeslayout horizontalspacing attributeslayout verticalspacing rolescomposite setlayout attributeslayout griddata attributesdata griddata griddata fill_both attributesdata horizontalspan attributesdata grabexcessverticalspace rolescomposite setlayoutdata attributesdata rolessection setclient rolescomposite repositorytaskattribute taskdata getattribute bugzillareportelement reporter_accessible getkeystring taskdata setattributevalue bugzillareportelement reporter_accessible getkeystring taskdata getattribute bugzillareportelement reporter_accessible getkeystring addbuttonfield rolescomposite haschanged setbackground getcolorincoming taskdata getattribute bugzillareportelement cclist_accessible getkeystring taskdata setattributevalue bugzillareportelement cclist_accessible getkeystring taskdata getattribute bugzillareportelement cclist_accessible getkeystring addbuttonfield rolescomposite haschanged setbackground getcolorincoming protected void add voting composite attributes composite label label get managed form get toolkit create label attributes composite votes label set foreground get managed form get toolkit get colors get color i form colors title grid data factory fill defaults align swt right swt center apply to label composite voting composite get managed form get toolkit create composite attributes composite grid layout layout new grid layout 3 false layout margin height 0 layout margin width 0 voting composite set layout layout repository task attribute votes attribute task data get attribute bugzilla report element votes get key string votes text create text field voting composite votes attribute swt flat swt read only votes text set font text font grid data factory fill defaults min size 30 swt default hint 30 swt default apply to votes text if votes attribute null has changed votes attribute votes text set background get color incoming votes text set editable false hyperlink show votes hyperlink get managed form get toolkit create hyperlink voting composite show votes swt none show votes hyperlink add hyperlink listener new hyperlink adapter override public void link activated hyperlink event e if bugzilla task editor this get editor instanceof task editor tasks ui util open url repository get url i bugzilla constants url show votes task data get id false hyperlink vote hyperlink get managed form get toolkit create hyperlink voting composite vote swt none vote hyperlink add hyperlink listener new hyperlink adapter override public void link activated hyperlink event e if bugzilla task editor this get editor instanceof task editor tasks ui util open url repository get url i bugzilla constants url vote task data get id false addvoting attributescomposite getmanagedform gettoolkit createlabel attributescomposite setforeground getmanagedform gettoolkit getcolors getcolor iformcolors griddatafactory filldefaults applyto votingcomposite getmanagedform gettoolkit createcomposite attributescomposite gridlayout gridlayout marginheight marginwidth votingcomposite setlayout repositorytaskattribute votesattribute taskdata getattribute bugzillareportelement getkeystring votestext createtextfield votingcomposite votesattribute read_only votestext setfont text_font griddatafactory filldefaults minsize applyto votestext votesattribute haschanged votesattribute votestext setbackground getcolorincoming votestext seteditable showvoteshyperlink getmanagedform gettoolkit createhyperlink votingcomposite showvoteshyperlink addhyperlinklistener hyperlinkadapter linkactivated hyperlinkevent bugzillataskeditor geteditor taskeditor tasksuiutil openurl geturl ibugzillaconstants url_show_votes taskdata getid votehyperlink getmanagedform gettoolkit createhyperlink votingcomposite votehyperlink addhyperlinklistener hyperlinkadapter linkactivated hyperlinkevent bugzillataskeditor geteditor taskeditor tasksuiutil openurl geturl ibugzillaconstants url_vote taskdata getid creates a new code existing bug editor code public bugzilla task editor form editor editor super editor set up the input for comparing the bug report to the server compare configuration config new compare configuration config set left editable false config set right editable false config set left label local bug report config set right label remote bug report config set left image platformui get workbench get shared images get image i shared images img obj element config set right image platformui get workbench get shared images get image i shared images img obj element compare input new bugzilla compare input config existingbugeditor bugzillataskeditor formeditor compareconfiguration compareconfiguration setlefteditable setrighteditable setleftlabel setrightlabel setleftimage getworkbench getsharedimages getimage isharedimages img_obj_element setrightimage getworkbench getsharedimages getimage isharedimages img_obj_element compareinput bugzillacompareinput override protected void create custom attribute layout composite composite repository task attribute attribute this task data get attribute bugzilla report element dependson get key string if attribute null attribute is read only label label create label composite attribute grid data factory fill defaults align swt right swt center apply to label composite text field composite get managed form get toolkit create composite composite grid layout text layout new grid layout text layout margin width 1 text layout margin height 3 text layout vertical spacing 3 text field composite set layout text layout grid data text data new grid data grid data horizontal align fill text data horizontal span 1 text data width hint 135 final text text create text field text field composite attribute swt flat text set layout data text data get managed form get toolkit paint borders for text field composite attribute this task data get attribute bugzilla report element blocked get key string if attribute null attribute is read only label label create label composite attribute grid data factory fill defaults align swt right swt center apply to label composite text field composite get managed form get toolkit create composite composite grid layout text layout new grid layout text layout margin width 1 text layout margin height 3 text layout vertical spacing 3 text field composite set layout text layout grid data text data new grid data grid data horizontal align fill text data horizontal span 1 text data width hint 135 final text text create text field text field composite attribute swt flat text set layout data text data get managed form get toolkit paint borders for text field composite string dependson task data get attribute value bugzilla report element dependson get key string string blocked task data get attribute value bugzilla report element blocked get key string boolean add hyperlinks dependson null dependson length 0 blocked null blocked length 0 if add hyperlinks get managed form get toolkit create label composite add bug hyperlinks composite bugzilla report element dependson get key string if add hyperlinks get managed form get toolkit create label composite add bug hyperlinks composite bugzilla report element blocked get key string attribute this task data get attribute bugzilla report element bug file loc get key string if attribute null attribute is read only label label create label composite attribute grid data factory fill defaults align swt right swt center apply to label text url field create text field composite attribute swt flat grid data factory fill defaults hint 135 swt default apply to url field attribute this task data get attribute bugzilla report element status whiteboard get key string if attribute null this task data set attribute value bugzilla report element status whiteboard get key string attribute this task data get attribute bugzilla report element status whiteboard get key string if attribute null attribute is read only label label create label composite attribute grid data factory fill defaults align swt right swt center apply to label text whiteboard field create text field composite attribute swt flat grid data factory fill defaults hint 135 swt default apply to whiteboard field try add keywords list composite catch io exception e message dialog open information null attribute display error could not retrieve keyword list ensure proper configuration in tasks ui plugin label view repositories n n error reported e get message add voting composite if groups is available add roles if task data get attribute bugzilla report element group get key string null add roles composite if task data get attribute bugzilla report element estimated time get key string null add bugzilla time tracker get managed form get toolkit composite createcustomattributelayout repositorytaskattribute taskdata getattribute bugzillareportelement getkeystring isreadonly createlabel griddatafactory filldefaults applyto textfieldcomposite getmanagedform gettoolkit createcomposite gridlayout textlayout gridlayout textlayout marginwidth textlayout marginheight textlayout verticalspacing textfieldcomposite setlayout textlayout griddata textdata griddata griddata horizontal_align_fill textdata horizontalspan textdata widthhint createtextfield textfieldcomposite setlayoutdata textdata getmanagedform gettoolkit paintbordersfor textfieldcomposite taskdata getattribute bugzillareportelement getkeystring isreadonly createlabel griddatafactory filldefaults applyto textfieldcomposite getmanagedform gettoolkit createcomposite gridlayout textlayout gridlayout textlayout marginwidth textlayout marginheight textlayout verticalspacing textfieldcomposite setlayout textlayout griddata textdata griddata griddata horizontal_align_fill textdata horizontalspan textdata widthhint createtextfield textfieldcomposite setlayoutdata textdata getmanagedform gettoolkit paintbordersfor textfieldcomposite taskdata getattributevalue bugzillareportelement getkeystring taskdata getattributevalue bugzillareportelement getkeystring addhyperlinks addhyperlinks getmanagedform gettoolkit createlabel addbughyperlinks bugzillareportelement getkeystring addhyperlinks getmanagedform gettoolkit createlabel addbughyperlinks bugzillareportelement getkeystring taskdata getattribute bugzillareportelement bug_file_loc getkeystring isreadonly createlabel griddatafactory filldefaults applyto urlfield createtextfield griddatafactory filldefaults applyto urlfield taskdata getattribute bugzillareportelement status_whiteboard getkeystring taskdata setattributevalue bugzillareportelement status_whiteboard getkeystring taskdata getattribute bugzillareportelement status_whiteboard getkeystring isreadonly createlabel griddatafactory filldefaults applyto whiteboardfield createtextfield griddatafactory filldefaults applyto whiteboardfield addkeywordslist ioexception messagedialog openinformation tasksuiplugin label_view_repositories nerror getmessage addvoting taskdata getattribute bugzillareportelement getkeystring addroles taskdata getattribute bugzillareportelement estimated_time getkeystring addbugzillatimetracker getmanagedform gettoolkit override this method is duplicated in new bugzilla task editor for now public search hit collector get duplicate search collector string name string duplicate detector name name equals default stack trace name set abstract duplicate detector all detectors get duplicate search collectors list for abstract duplicate detector detector all detectors if detector get name equals duplicate detector name return detector get search hit collector repository task data didn t find it return null newbugzillataskeditor searchhitcollector getduplicatesearchcollector duplicatedetectorname abstractduplicatedetector alldetectors getduplicatesearchcollectorslist abstractduplicatedetector alldetectors getname duplicatedetectorname getsearchhitcollector taskdata override this method is duplicated in new bugzilla task editor for now protected set abstract duplicate detector get duplicate search collectors list return tasks ui plugin get default get duplicate search collectors list newbugzillataskeditor abstractduplicatedetector getduplicatesearchcollectorslist tasksuiplugin getdefault getduplicatesearchcollectorslist override protected string get history url if repository null task data null return repository get url i bugzilla constants url bug activity task data get id else return null gethistoryurl taskdata geturl ibugzillaconstants url_bug_activity taskdata getid override protected boolean has content assist repository task attribute attribute return bugzilla report element newcc get key string equals attribute get id hascontentassist repositorytaskattribute bugzillareportelement getkeystring getid override protected boolean has content assist repository operation repository operation bugzilla operation operation try operation bugzilla operation value of repository operation get knob name catch runtime exception e status handler log e unrecognized operation repository operation get knob name operation null if operation null operation bugzilla operation reassign return true else return false hascontentassist repositoryoperation repositoryoperation bugzilla_operation bugzilla_operation valueof repositoryoperation getknobname runtimeexception statushandler repositoryoperation getknobname bugzilla_operation private boolean has custom attribute changes if task data null return false string custom attribute keys bugzilla report element bug file loc get key string bugzilla report element dependson get key string bugzilla report element blocked get key string bugzilla report element keywords get key string bugzilla report element votes get key string bugzilla report element reporter accessible get key string bugzilla report element cclist accessible get key string bugzilla report element estimated time get key string bugzilla report element remaining time get key string bugzilla report element actual time get key string bugzilla report element deadline get key string bugzilla report element status whiteboard get key string for string key custom attribute keys repository task attribute attribute task data get attribute key if has changed attribute return true return false hascustomattributechanges taskdata customattributekeys bugzillareportelement bug_file_loc getkeystring bugzillareportelement getkeystring bugzillareportelement getkeystring bugzillareportelement getkeystring bugzillareportelement getkeystring bugzillareportelement reporter_accessible getkeystring bugzillareportelement cclist_accessible getkeystring bugzillareportelement estimated_time getkeystring bugzillareportelement remaining_time getkeystring bugzillareportelement actual_time getkeystring bugzillareportelement getkeystring bugzillareportelement status_whiteboard getkeystring customattributekeys repositorytaskattribute taskdata getattribute haschanged override protected boolean has visible attribute changes return super has visible attribute changes this has custom attribute changes hasvisibleattributechanges hasvisibleattributechanges hascustomattributechanges hyperlink add hyperlink listener new hyperlink adapter override public void link activated hyperlink event e if task null tasks ui util refresh and open task list element task else tasks ui util open repository task repository get url bug id repository get url i bugzilla constants url get show bug bug id addhyperlinklistener hyperlinkadapter linkactivated hyperlinkevent tasksuiutil refreshandopentasklistelement tasksuiutil openrepositorytask geturl bugid geturl ibugzillaconstants url_get_show_bug bugid override public void link activated hyperlink event e task data set attribute value bugzilla report element deadline get key string attribute changed task data get attribute bugzilla report element deadline get key string deadline picker set date null linkactivated hyperlinkevent taskdata setattributevalue bugzillareportelement getkeystring attributechanged taskdata getattribute bugzillareportelement getkeystring deadlinepicker setdate show votes hyperlink add hyperlink listener new hyperlink adapter override public void link activated hyperlink event e if bugzilla task editor this get editor instanceof task editor tasks ui util open url repository get url i bugzilla constants url show votes task data get id false showvoteshyperlink addhyperlinklistener hyperlinkadapter linkactivated hyperlinkevent bugzillataskeditor geteditor taskeditor tasksuiutil openurl geturl ibugzillaconstants url_show_votes taskdata getid vote hyperlink add hyperlink listener new hyperlink adapter override public void link activated hyperlink event e if bugzilla task editor this get editor instanceof task editor tasks ui util open url repository get url i bugzilla constants url vote task data get id false votehyperlink addhyperlinklistener hyperlinkadapter linkactivated hyperlinkevent bugzillataskeditor geteditor taskeditor tasksuiutil openurl geturl ibugzillaconstants url_vote taskdata getid add time text set layout data new grid data grid data horizontal align fill add time text add modify listener new modify listener public void modify text modify event e add time attribute set value add time text get text attribute changed add time attribute addtimetext setlayoutdata griddata griddata horizontal_align_fill addtimetext addmodifylistener modifylistener modifytext modifyevent addtimeattribute setvalue addtimetext gettext attributechanged addtimeattribute override protected void validate input validateinput deadline picker add picker selection listener new selection listener public void widget default selected selection event e ignore deadlinepicker addpickerselectionlistener selectionlistener widgetdefaultselected selectionevent change keywords button add selection listener new selection listener public void widget default selected selection event e changekeywordsbutton addselectionlistener selectionlistener widgetdefaultselected selectionevent override public void widget selected selection event e string sel 1 if button get selection sel 0 repository task attribute a repository task attribute button get data a set value sel attribute changed a widgetselected selectionevent getselection repositorytaskattribute repositorytaskattribute getdata setvalue attributechanged public void widget selected selection event e calendar cal deadline picker get date if cal null date d cal get time simple date format f simple date format simple date format get date instance f apply pattern yyyy mm dd task data set attribute value bugzilla report element deadline get key string f format d attribute changed task data get attribute bugzilla report element deadline get key string todo goes dirty even if user presses cancel mark dirty true else task data set attribute value bugzilla report element deadline get key string attribute changed task data get attribute bugzilla report element deadline get key string deadline picker set date null widgetselected selectionevent deadlinepicker getdate gettime simpledateformat simpledateformat simpledateformat getdateinstance applypattern taskdata setattributevalue bugzillareportelement getkeystring attributechanged taskdata getattribute bugzillareportelement getkeystring markdirty taskdata setattributevalue bugzillareportelement getkeystring attributechanged taskdata getattribute bugzillareportelement getkeystring deadlinepicker setdate public void widget selected selection event e string keywords attribute get value shell shell null if platformui get workbench get active workbench window null shell platformui get workbench get active workbench window get shell else shell new shell platformui get workbench get display list string valid keywords new array list string try valid keywords bugzilla core plugin get repository configuration repository false get keywords catch exception ex ignore keywords dialog keywords dialog new keywords dialog shell keywords valid keywords int response code keywords dialog open string new keywords keywords dialog get selected keywords string if response code dialog ok keywords null keywords text set text new keywords attribute set value new keywords attribute changed attribute else return widgetselected selectionevent getvalue getworkbench getactiveworkbenchwindow getworkbench getactiveworkbenchwindow getshell getworkbench getdisplay validkeywords arraylist validkeywords bugzillacoreplugin getrepositoryconfiguration getkeywords keywordsdialog keywordsdialog keywordsdialog validkeywords responsecode keywordsdialog newkeywords keywordsdialog getselectedkeywordsstring responsecode keywordstext settext newkeywords setvalue newkeywords attributechanged super new i task factory public abstract task create task repository task data task data i progress monitor monitor throws core exception return null itaskfactory abstracttask createtask repositorytaskdata taskdata iprogressmonitor coreexception public dummy search hit provider task list tasklist super new i task factory public abstract task create task repository task data task data i progress monitor monitor throws core exception return null ignore dummysearchhitprovider tasklist itaskfactory abstracttask createtask repositorytaskdata taskdata iprogressmonitor coreexception public void check state changed check state changed event event if event get checked selected keywords add string event get element else selected keywords remove event get element checkstatechanged checkstatechangedevent getchecked selectedkeywords getelement selectedkeywords getelement override protected control create dialog area composite parent get shell set text select keywords composite composite new composite parent swt none composite set layout new grid layout grid data gd new grid data grid data grab horizontal grid data grab vertical grid data fill both composite set layout data gd key words list checkbox table viewer new check list composite swt multi swt v scroll swt border grid data key words text data new grid data grid data grab horizontal grid data grab vertical grid data fill both key words text data height hint 175 key words text data width hint 160 key words list get table set layout data key words text data if valid keywords null key words list set content provider new i tree content provider public object get children object parent element if parent element instanceof collection return collection parent element to array return null public object get parent object element todo auto generated method stub return null public boolean has children object element todo auto generated method stub return false public object get elements object input element return get children input element public void dispose todo auto generated method stub public void input changed viewer viewer object old input object new input todo auto generated method stub set string invalid keywords new hash set string key words list set input valid keywords for string keyword selected keywords if key words list set checked keyword true invalid keywords add keyword selected keywords remove all invalid keywords key words list add check state listener new keyword listener parent pack return composite createdialogarea getshell settext setlayout gridlayout griddata griddata griddata grab_horizontal griddata grab_vertical griddata fill_both setlayoutdata keywordslist checkboxtableviewer newchecklist v_scroll griddata keywordstextdata griddata griddata grab_horizontal griddata grab_vertical griddata fill_both keywordstextdata heighthint keywordstextdata widthhint keywordslist gettable setlayoutdata keywordstextdata validkeywords keywordslist setcontentprovider itreecontentprovider getchildren parentelement parentelement parentelement toarray getparent haschildren getelements inputelement getchildren inputelement inputchanged oldinput newinput invalidkeywords hashset keywordslist setinput validkeywords selectedkeywords keywordslist setchecked invalidkeywords selectedkeywords removeall invalidkeywords keywordslist addcheckstatelistener keywordlistener public void dispose todo auto generated method stub public object get children object parent element if parent element instanceof collection return collection parent element to array return null getchildren parentelement parentelement parentelement toarray public object get elements object input element return get children input element getelements inputelement getchildren inputelement public object get parent object element todo auto generated method stub return null getparent public list string get selected keywords return selected keywords getselectedkeywords selectedkeywords public string get selected keywords string string buffer keywords new string buffer for string sel selected keywords keywords append sel keywords append string keywords string keywords to string if keywords string ends with keywords string keywords string substring 0 keywords string length 1 return keywords string getselectedkeywordsstring stringbuffer stringbuffer selectedkeywords keywordsstring tostring keywordsstring endswith keywordsstring keywordsstring keywordsstring keywordsstring public boolean has children object element todo auto generated method stub return false haschildren public void input changed viewer viewer object old input object new input todo auto generated method stub inputchanged oldinput newinput public keywords dialog shell shell string selected keywords java util list string valid keywords super shell set shell style get shell style swt resize string tokenizer st new string tokenizer selected keywords false this selected keywords new array list string while st has more tokens string s st next token trim this selected keywords add s this valid keywords valid keywords keywordsdialog selectedkeywords validkeywords setshellstyle getshellstyle stringtokenizer stringtokenizer selectedkeywords selectedkeywords arraylist hasmoretokens nexttoken selectedkeywords validkeywords validkeywords override protected void create people layout composite composite form toolkit toolkit get managed form get toolkit section people section create section composite get section label section name people section grid data factory fill defaults align swt fill swt fill grab true true apply to people section composite people composite toolkit create composite people section grid layout layout new grid layout 2 false layout margin right 5 people composite set layout layout grid data factory fill defaults align swt fill swt fill grab true true apply to people composite label label toolkit create label people composite assign to grid data factory fill defaults align swt right swt center apply to label composite text field composite toolkit create composite people composite grid layout text layout new grid layout text field composite set layout text layout repository task attribute attribute task data get attribute repository task attribute user assigned text text field create text field text field composite attribute swt flat toolkit paint borders for text field composite grid data factory fill defaults hint 150 swt default apply to text field people section set client people composite content assist command adapter adapter apply content assist text field create content proposal provider attribute i label provider propsal label provider create proposal label provider attribute if propsal label provider null adapter set label provider propsal label provider adapter set proposal acceptance style content proposal adapter proposal replace toolkit paint borders for people composite createpeoplelayout formtoolkit getmanagedform gettoolkit peoplesection createsection getsectionlabel section_name people_section griddatafactory filldefaults applyto peoplesection peoplecomposite createcomposite peoplesection gridlayout gridlayout marginright peoplecomposite setlayout griddatafactory filldefaults applyto peoplecomposite createlabel peoplecomposite griddatafactory filldefaults applyto textfieldcomposite createcomposite peoplecomposite gridlayout textlayout gridlayout textfieldcomposite setlayout textlayout repositorytaskattribute taskdata getattribute repositorytaskattribute user_assigned textfield createtextfield textfieldcomposite paintbordersfor textfieldcomposite griddatafactory filldefaults applyto textfield peoplesection setclient peoplecomposite contentassistcommandadapter applycontentassist textfield createcontentproposalprovider ilabelprovider propsallabelprovider createproposallabelprovider propsallabelprovider setlabelprovider propsallabelprovider setproposalacceptancestyle contentproposaladapter proposal_replace paintbordersfor peoplecomposite break text up into lines so that it is displayed properly in bugzilla private static string format text to line wrap string orig text boolean hard wrap bugzilla server version bugzilla server version i bugzilla constants bugzilla server version from string repository get version if bugzilla server version null bugzilla server version compare to bugzilla server version server 220 0 return orig text if hard wrap return orig text else string text array new string orig text length wrap length 1 2 for int i 0 i text array length i text array i null int j 0 while true int space index orig text index of wrap length 5 if space index orig text length space index 1 text array j orig text break text array j orig text substring 0 space index orig text orig text substring space index 1 orig text length j string new text for int i 0 i text array length i if text array i null break new text text array i n return new text formattexttolinewrap origtext hardwrap bugzillaserverversion bugzillaserverversion ibugzillaconstants bugzillaserverversion fromstring getversion bugzillaserverversion bugzillaserverversion compareto bugzillaserverversion server_220 origtext hardwrap origtext textarray origtext wrap_length textarray textarray spaceindex origtext indexof wrap_length spaceindex origtext spaceindex textarray origtext textarray origtext spaceindex origtext origtext spaceindex origtext newtext textarray textarray newtext textarray newtext override this method is duplicated in bugzilla task editor for now public search hit collector get duplicate search collector string name string duplicate detector name name equals default stack trace name set abstract duplicate detector all detectors get duplicate search collectors list for abstract duplicate detector detector all detectors if detector get name equals duplicate detector name return detector get search hit collector repository task data didn t find it return null bugzillataskeditor searchhitcollector getduplicatesearchcollector duplicatedetectorname abstractduplicatedetector alldetectors getduplicatesearchcollectorslist abstractduplicatedetector alldetectors getname duplicatedetectorname getsearchhitcollector taskdata override this method is duplicated in bugzilla task editor for now protected set abstract duplicate detector get duplicate search collectors list return tasks ui plugin get default get duplicate search collectors list bugzillataskeditor abstractduplicatedetector getduplicatesearchcollectorslist tasksuiplugin getdefault getduplicatesearchcollectorslist override public void init i editor site site i editor input input super init site input set expand attribute section true ieditorsite ieditorinput setexpandattributesection private static final int wrap length 90 public new bugzilla task editor form editor editor super editor wrap_length newbugzillataskeditor formeditor override protected void save task offline i progress monitor progress monitor string text description text viewer get text widget get text if repository get version starts with 2 18 text format text to line wrap text true description text viewer get text widget set text text super save task offline progress monitor savetaskoffline iprogressmonitor progressmonitor descriptiontextviewer gettextwidget gettext getversion startswith formattexttolinewrap descriptiontextviewer gettextwidget settext savetaskoffline progressmonitor override public void submit to repository if summary text get text equals message dialog open information this get site get shell submit error please provide a brief summary with new reports summary text set focus return else if description text viewer get text widget get text equals message dialog open information this get site get shell submit error please proved a detailed summary with new reports description text viewer get text widget set focus return super submit to repository submittorepository summarytext gettext messagedialog openinformation getsite getshell summarytext setfocus descriptiontextviewer gettextwidget gettext messagedialog openinformation getsite getshell descriptiontextviewer gettextwidget setfocus submittorepository int operation bugzilla search data string pattern int operation this pattern pattern this operation operation bugzillasearchdata public bugzilla search page super title bugzilla query set title title set description description set page complete false bugzillasearchpage title_bugzilla_query settitle setdescription setpagecomplete public bugzilla search page task repository repository super title bugzilla query this repository repository set title title set description description set image descriptor task list images banner repository set page complete false bugzillasearchpage taskrepository title_bugzilla_query settitle setdescription setimagedescriptor tasklistimages banner_repository setpagecomplete public bugzilla search page task repository repository bugzilla repository query orig query super title bugzilla query orig query get summary original query orig query this repository repository set description select the bugzilla query parameters use the update attributes button to retrieve updated values from the repository set title title set description description set page complete false bugzillasearchpage taskrepository bugzillarepositoryquery origquery title_bugzilla_query origquery getsummary originalquery origquery setdescription settitle setdescription setpagecomplete public boolean can flip to next page if get error message null return false return true return false canfliptonextpage geterrormessage returns code true code if at least some parameter is given to query on private boolean can query return product get selection count 0 component get selection count 0 version get selection count 0 target get selection count 0 status get selection count 0 resolution get selection count 0 severity get selection count 0 priority get selection count 0 hardware get selection count 0 os get selection count 0 summary pattern get text length 0 comment pattern get text length 0 email pattern get text length 0 canquery getselectioncount getselectioncount getselectioncount getselectioncount getselectioncount getselectioncount getselectioncount getselectioncount getselectioncount getselectioncount summarypattern gettext commentpattern gettext emailpattern gettext private control create comment composite control grid data gd label label composite group new composite control swt none grid layout layout new grid layout 3 false group set layout layout group set layout data new grid data grid data fill horizontal gd new grid data grid data beginning grid data fill horizontal grid data grab horizontal gd horizontal span 2 group set layout data gd info text label new label group swt left label set text comment gd new grid data grid data beginning label set layout data gd comment pattern combo comment pattern new combo group swt single swt border comment pattern add modify listener new modify listener public void modify text modify event e if scontainer null scontainer set perform action enabled can query comment pattern add selection listener new selection adapter override public void widget selected selection event e handle widget selected comment pattern comment operation previous comment patterns gd new grid data grid data fill horizontal grid data grab horizontal comment pattern set layout data gd comment operation new combo group swt single swt read only swt border comment operation set items pattern operation text comment operation set text pattern operation text 0 comment operation select 0 return group createcomment griddata gridlayout gridlayout setlayout setlayoutdata griddata griddata fill_horizontal griddata griddata griddata fill_horizontal griddata grab_horizontal horizontalspan setlayoutdata settext griddata griddata setlayoutdata commentpattern commentpattern addmodifylistener modifylistener modifytext modifyevent setperformactionenabled canquery commentpattern addselectionlistener selectionadapter widgetselected selectionevent handlewidgetselected commentpattern commentoperation previouscommentpatterns griddata griddata fill_horizontal griddata grab_horizontal commentpattern setlayoutdata commentoperation read_only commentoperation setitems patternoperationtext commentoperation settext patternoperationtext commentoperation public void create control composite parent read configuration composite control new composite parent swt none grid layout layout new grid layout 2 false layout margin height 0 layout margin width 0 control set layout layout grid data gd new grid data grid data fill both grid data grab horizontal control set layout data gd if scontainer null not presenting in search pane so want query title super create control control else if repository null search pane so add repository selection create repository group control create search group control create options group control create email control create last days control create save query control create max hits control input new saved query file bugzilla plugin get default get state location to string queries create update control if original query null try update defaults original query get query url string value of original query get max hits catch unsupported encoding exception e ignore set control control workbench help system get instance set help control bugzilla ui plugin search page context createcontrol readconfiguration gridlayout gridlayout marginheight marginwidth setlayout griddata griddata griddata fill_both griddata grab_horizontal setlayoutdata createcontrol createrepositorygroup createsearchgroup createoptionsgroup createemail createlastdays createsavequery createmaxhits savedqueryfile bugzillaplugin getdefault getstatelocation tostring createupdate originalquery updatedefaults originalquery getqueryurl valueof originalquery getmaxhits unsupportedencodingexception setcontrol workbenchhelpsystem getinstance sethelp bugzillauiplugin search_page_context protected control create email composite control grid layout layout grid data gd group group new group control swt none layout new grid layout 7 false group set layout layout group set layout data new grid data grid data fill horizontal gd new grid data grid data beginning grid data fill horizontal grid data grab horizontal gd horizontal span 2 group set layout data gd label label new label group swt left label set text email pattern combo email pattern new combo group swt single swt border email pattern add modify listener new modify listener public void modify text modify event e if scontainer null scontainer set perform action enabled can query email pattern add selection listener new selection adapter override public void widget selected selection event e handle widget selected email pattern email operation previous email patterns gd new grid data grid data fill horizontal grid data grab horizontal gd width hint 110 email pattern set layout data gd operation combo email operation new combo group swt single swt read only swt border email operation set items email operation text email operation set text email operation text 0 email operation select 0 composite buttons new composite group swt none layout new grid layout 4 false buttons set layout layout buttons set layout data new grid data grid data fill horizontal gd new grid data grid data beginning gd horizontal span 3 buttons set layout data gd email buttons new button email text length for int i 0 i email buttons length i button button new button group swt check button set text email text i email buttons i button return group createemail gridlayout griddata gridlayout setlayout setlayoutdata griddata griddata fill_horizontal griddata griddata griddata fill_horizontal griddata grab_horizontal horizontalspan setlayoutdata settext emailpattern emailpattern addmodifylistener modifylistener modifytext modifyevent setperformactionenabled canquery emailpattern addselectionlistener selectionadapter widgetselected selectionevent handlewidgetselected emailpattern emailoperation previousemailpatterns griddata griddata fill_horizontal griddata grab_horizontal widthhint emailpattern setlayoutdata emailoperation read_only emailoperation setitems emailoperationtext emailoperation settext emailoperationtext emailoperation gridlayout setlayout setlayoutdata griddata griddata fill_horizontal griddata griddata horizontalspan setlayoutdata emailbuttons emailtext emailbuttons settext emailtext emailbuttons protected control create last days composite control grid layout layout grid data gd group group new group control swt none layout new grid layout 6 false group set layout layout group set layout data new grid data grid data fill horizontal gd new grid data grid data beginning grid data fill horizontal grid data grab horizontal gd horizontal span 2 group set layout data gd label label new label group swt left label set text only bugs changed in the last operation combo days text new text group swt border days text set text limit 5 grid data days layout data new grid data days layout data width hint 30 days text set layout data days layout data days text add listener swt modify this label new label group swt left label set text days return group createlastdays gridlayout griddata gridlayout setlayout setlayoutdata griddata griddata fill_horizontal griddata griddata griddata fill_horizontal griddata grab_horizontal horizontalspan setlayoutdata settext daystext daystext settextlimit griddata dayslayoutdata griddata dayslayoutdata widthhint daystext setlayoutdata dayslayoutdata daystext addlistener settext creates the area for selection of bug attributes status etc protected control create lists composite control grid data gd grid layout layout search expression composite group new composite control swt none layout new grid layout layout num columns 6 group set layout layout gd new grid data swt fill swt fill true true gd horizontal span 5 group set layout data gd labels label label new label group swt left label set text status label new label group swt left label set text resolution label new label group swt left label set text severity label new label group swt left label set text priority label new label group swt left label set text hardware label new label group swt left label set text os lists status new list group swt multi swt v scroll swt border gd new grid data swt fill swt fill true true gd height hint 40 status set layout data gd status add selection listener update action selection adapter resolution new list group swt multi swt v scroll swt border gd new grid data swt fill swt fill true true gd height hint 40 resolution set layout data gd resolution add selection listener update action selection adapter severity new list group swt multi swt v scroll swt border gd new grid data swt fill swt fill true true gd height hint 40 severity set layout data gd severity add selection listener update action selection adapter priority new list group swt multi swt v scroll swt border gd new grid data swt fill swt fill true true gd height hint 40 priority set layout data gd priority add selection listener update action selection adapter hardware new list group swt multi swt v scroll swt border gd new grid data swt fill swt fill true true gd height hint 40 hardware set layout data gd hardware add selection listener update action selection adapter os new list group swt multi swt v scroll swt border gd new grid data swt fill swt fill true true gd height hint 40 os set layout data gd os add selection listener update action selection adapter return group createlists griddata gridlayout gridlayout numcolumns setlayout griddata horizontalspan setlayoutdata settext settext settext settext settext settext v_scroll griddata heighthint setlayoutdata addselectionlistener updateactionselectionadapter v_scroll griddata heighthint setlayoutdata addselectionlistener updateactionselectionadapter v_scroll griddata heighthint setlayoutdata addselectionlistener updateactionselectionadapter v_scroll griddata heighthint setlayoutdata addselectionlistener updateactionselectionadapter v_scroll griddata heighthint setlayoutdata addselectionlistener updateactionselectionadapter v_scroll griddata heighthint setlayoutdata addselectionlistener updateactionselectionadapter protected control create options group composite control group group new group control swt none group set text bug attributes grid layout layout new grid layout layout num columns 1 group set layout layout grid data gd new grid data swt fill swt fill true true gd horizontal span 5 group set layout data gd create product attributes group create lists group create update group return group createoptionsgroup settext gridlayout gridlayout numcolumns setlayout griddata griddata horizontalspan setlayoutdata createproductattributes createlists createupdate creates the area for selection on product component version protected control create product attributes composite control grid data gd grid layout layout search expression composite group new composite control swt none layout new grid layout layout num columns 4 group set layout layout gd new grid data swt fill swt fill true true gd horizontal span 5 group set layout data gd labels label label new label group swt left label set text product label new label group swt left label set text component label new label group swt left label set text version label new label group swt left label set text milestone lists product new list group swt multi swt v scroll swt border gd new grid data swt fill swt fill true true gd height hint height attribute combo product set layout data gd product add selection listener new selection adapter override public void widget selected selection event e if product get selection index 1 string selected products product get selection update attributes from repository repository get url selected products false else update attributes from repository repository get url null false if restoring restoring false restore widget values if scontainer null scontainer set perform action enabled can query component new list group swt multi swt v scroll swt border gd new grid data swt fill swt fill true true gd height hint height attribute combo component set layout data gd component add selection listener update action selection adapter version new list group swt multi swt v scroll swt border gd new grid data swt fill swt fill true true gd height hint height attribute combo version set layout data gd version add selection listener update action selection adapter target new list group swt multi swt v scroll swt border gd new grid data swt fill swt fill true true gd height hint height attribute combo target set layout data gd target add selection listener update action selection adapter return group createproductattributes griddata gridlayout gridlayout numcolumns setlayout griddata horizontalspan setlayoutdata settext settext settext settext v_scroll griddata heighthint height_attribute_combo setlayoutdata addselectionlistener selectionadapter widgetselected selectionevent getselectionindex selectedproducts getselection updateattributesfromrepository geturl selectedproducts updateattributesfromrepository geturl restorewidgetvalues setperformactionenabled canquery v_scroll griddata heighthint height_attribute_combo setlayoutdata addselectionlistener updateactionselectionadapter v_scroll griddata heighthint height_attribute_combo setlayoutdata addselectionlistener updateactionselectionadapter v_scroll griddata heighthint height_attribute_combo setlayoutdata addselectionlistener updateactionselectionadapter creates the buttons for remembering a query and accessing previously saved queries protected control create save query composite control grid layout layout grid data gd group group new group control swt none layout new grid layout 3 false group set layout layout group set layout data new grid data grid data fill horizontal gd new grid data grid data beginning grid data fill horizontal grid data grab horizontal gd horizontal span 2 group set layout data gd load button new button group swt push swt left load button set text saved queries final bugzilla search page bsp this load button add selection listener new selection adapter override public void widget selected selection event event get query dialog qd new get query dialog get shell saved queries input if qd open input dialog ok sel index qd get selected if sel index 1 remembered query true perform action bsp get shell close load button set enabled true load button set layout data new grid data grid data horizontal align beginning save button new button group swt push swt left save button set text remember save button add selection listener new selection adapter override public void widget selected selection event event save query dialog qd new save query dialog get shell remember query if qd open input dialog ok string q name qd get text if q name null q name compare to 0 try input add get query parameters to string q name summary pattern get text catch unsupported encoding exception e do nothing every implementation of the java platform is required to support the standard charset utf 8 save button set enabled true save button set layout data new grid data grid data horizontal align beginning return group createsavequery gridlayout griddata gridlayout setlayout setlayoutdata griddata griddata fill_horizontal griddata griddata griddata fill_horizontal griddata grab_horizontal horizontalspan setlayoutdata loadbutton loadbutton settext bugzillasearchpage loadbutton addselectionlistener selectionadapter widgetselected selectionevent getquerydialog getquerydialog getshell inputdialog selindex getselected selindex rememberedquery performaction getshell loadbutton setenabled loadbutton setlayoutdata griddata griddata horizontal_align_beginning savebutton savebutton settext savebutton addselectionlistener selectionadapter widgetselected selectionevent savequerydialog savequerydialog getshell inputdialog qname gettext qname qname compareto getqueryparameters tostring qname summarypattern gettext unsupportedencodingexception savebutton setenabled savebutton setlayoutdata griddata griddata horizontal_align_beginning private void create search group composite control group group new group control swt none grid layout layout new grid layout layout num columns 1 group set layout layout grid data gd new grid data grid data fill horizontal gd horizontal span 5 group set layout data gd create text search composite group create comment group createsearchgroup gridlayout gridlayout numcolumns setlayout griddata griddata griddata fill_horizontal horizontalspan setlayoutdata createtextsearchcomposite createcomment protected control create text search composite composite control grid data gd label label composite group new composite control swt none grid layout layout new grid layout 3 false group set layout layout group set layout data new grid data grid data fill horizontal gd new grid data grid data beginning grid data fill horizontal grid data grab horizontal gd horizontal span 2 group set layout data gd info text label new label group swt left label set text summary gd new grid data grid data beginning gd horizontal span 1 label set layout data gd pattern combo summary pattern new combo group swt single swt border summary pattern add modify listener new modify listener public void modify text modify event e if scontainer null scontainer set perform action enabled can query summary pattern add selection listener new selection adapter override public void widget selected selection event e handle widget selected summary pattern summary operation previous summary patterns gd new grid data grid data fill horizontal grid data grab horizontal summary pattern set layout data gd summary operation new combo group swt single swt read only swt border summary operation set items pattern operation text summary operation set text pattern operation text 0 summary operation select 0 return group createtextsearchcomposite griddata gridlayout gridlayout setlayout setlayoutdata griddata griddata fill_horizontal griddata griddata griddata fill_horizontal griddata grab_horizontal horizontalspan setlayoutdata settext griddata griddata horizontalspan setlayoutdata summarypattern summarypattern addmodifylistener modifylistener modifytext modifyevent setperformactionenabled canquery summarypattern addselectionlistener selectionadapter widgetselected selectionevent handlewidgetselected summarypattern summaryoperation previoussummarypatterns griddata griddata fill_horizontal griddata grab_horizontal summarypattern setlayoutdata summaryoperation read_only summaryoperation setitems patternoperationtext summaryoperation settext patternoperationtext summaryoperation protected control create update final composite control grid data gd label label composite group new composite control swt none grid layout layout new grid layout 2 false group set layout layout group set layout data new grid data grid data fill horizontal gd new grid data grid data beginning gd horizontal span 2 group set layout data gd info text label new label group swt left label set text update search options from server gd new grid data grid data beginning label set layout data gd update button new button group swt push update button set text update attributes from repository update button set layout data new grid data update button add selection listener new selection adapter override public void widget selected selection event e if repository null update attributes from repository repository get url null true else message dialog open information display get current get active shell i bugzilla constants title message dialog task repository manager message no repository return group createupdate griddata gridlayout gridlayout setlayout setlayoutdata griddata griddata fill_horizontal griddata griddata horizontalspan setlayoutdata settext griddata griddata setlayoutdata updatebutton updatebutton settext updatebutton setlayoutdata griddata updatebutton addselectionlistener selectionadapter widgetselected selectionevent updateattributesfromrepository geturl messagedialog openinformation getcurrent getactiveshell ibugzillaconstants title_message_dialog taskrepositorymanager message_no_repository public i dialog settings get dialog settings i dialog settings settings bugzilla ui plugin get default get dialog settings f dialog settings settings get section page name if f dialog settings null f dialog settings settings add new section page name return f dialog settings idialogsettings getdialogsettings idialogsettings bugzillauiplugin getdefault getdialogsettings fdialogsettings getsection page_name fdialogsettings fdialogsettings addnewsection page_name fdialogsettings return search pattern data and update search history list an existing entry will be updated or a new one created private bugzilla search data get pattern data combo widget combo operation array list bugzilla search data previous search query data string pattern widget get text if pattern null pattern trim equals return null bugzilla search data match null int i previous search query data size 1 while i 0 match previous search query data get i if pattern equals match pattern break i if i 0 match null match operation operation get selection index remove will be added last see below previous search query data remove match else match new bugzilla search data widget get text operation get selection index previous search query data add match return match bugzillasearchdata getpatterndata arraylist bugzillasearchdata previoussearchquerydata gettext bugzillasearchdata previoussearchquerydata previoussearchquerydata getselectionindex previoussearchquerydata bugzillasearchdata gettext getselectionindex previoussearchquerydata returns an array of previous summary patterns private string get previous patterns array list bugzilla search data pattern history int size pattern history size string patterns new string size for int i 0 i size i patterns i pattern history get size 1 i pattern return patterns getpreviouspatterns arraylist bugzillasearchdata patternhistory patternhistory patternhistory testing hook to see if any products are present public int get product count throws exception return product get item count getproductcount getitemcount override public bugzilla repository query get query if original query null try original query new bugzilla repository query repository get url get queryurl repository get query parameters get query title catch unsupported encoding exception e return null else try original query set url get queryurl repository get query parameters original query set max hits integer parse int get max hits original query set handle identifier get query title catch unsupported encoding exception e return null return original query bugzillarepositoryquery getquery originalquery originalquery bugzillarepositoryquery geturl getqueryurl getqueryparameters getquerytitle unsupportedencodingexception originalquery seturl getqueryurl getqueryparameters originalquery setmaxhits parseint getmaxhits originalquery sethandleidentifier getquerytitle unsupportedencodingexception originalquery goes through the query form and builds up the query parameters example short desc type substring amp short desc bla amp todo the encoding here should match task repository get character encoding throws unsupported encoding exception protected string buffer get query parameters throws unsupported encoding exception string buffer sb new string buffer sb append short desc type sb append pattern operation values summary operation get selection index sb append short desc sb append url encoder encode summary pattern get text repository get character encoding int selected product get selection indices for int i 0 i selected length i sb append product sb append url encoder encode product get item selected i repository get character encoding selected component get selection indices for int i 0 i selected length i sb append component sb append url encoder encode component get item selected i repository get character encoding selected version get selection indices for int i 0 i selected length i sb append version sb append url encoder encode version get item selected i repository get character encoding selected target get selection indices for int i 0 i selected length i sb append target milestone sb append url encoder encode target get item selected i repository get character encoding sb append long desc type sb append pattern operation values comment operation get selection index sb append long desc sb append url encoder encode comment pattern get text repository get character encoding selected status get selection indices for int i 0 i selected length i sb append bug status sb append url encoder encode status get item selected i repository get character encoding selected resolution get selection indices for int i 0 i selected length i sb append resolution sb append url encoder encode resolution get item selected i repository get character encoding selected severity get selection indices for int i 0 i selected length i sb append bug severity sb append url encoder encode severity get item selected i repository get character encoding selected priority get selection indices for int i 0 i selected length i sb append priority sb append url encoder encode priority get item selected i repository get character encoding selected hardware get selection indices for int i 0 i selected length i sb append ref platform sb append url encoder encode hardware get item selected i repository get character encoding selected os get selection indices for int i 0 i selected length i sb append op sys sb append url encoder encode os get item selected i repository get character encoding if email pattern get text null email pattern get text trim equals boolean selection made false for button button email buttons if button get selection selection made true break if selection made for int i 0 i email buttons length i if email buttons i get selection sb append sb append email role values i sb append 1 sb append emailtype1 sb append email operation values email operation get selection index sb append email1 sb append url encoder encode email pattern get text repository get character encoding if days text get text null days text get text equals try integer parse int days text get text sb append changedin sb append url encoder encode days text get text repository get character encoding catch number format exception ignored this means that the days is not a number so don t worry return sb short_desc_type short_desc taskrepository getcharacterencoding unsupportedencodingexception stringbuffer getqueryparameters unsupportedencodingexception stringbuffer stringbuffer short_desc_type patternoperationvalues summaryoperation getselectionindex short_desc urlencoder summarypattern gettext getcharacterencoding getselectionindices urlencoder getitem getcharacterencoding getselectionindices urlencoder getitem getcharacterencoding getselectionindices urlencoder getitem getcharacterencoding getselectionindices target_milestone urlencoder getitem getcharacterencoding long_desc_type patternoperationvalues commentoperation getselectionindex long_desc urlencoder commentpattern gettext getcharacterencoding getselectionindices bug_status urlencoder getitem getcharacterencoding getselectionindices urlencoder getitem getcharacterencoding getselectionindices bug_severity urlencoder getitem getcharacterencoding getselectionindices urlencoder getitem getcharacterencoding getselectionindices ref_platform urlencoder getitem getcharacterencoding getselectionindices op_sys urlencoder getitem getcharacterencoding emailpattern gettext emailpattern gettext selectionmade emailbuttons getselection selectionmade selectionmade emailbuttons emailbuttons getselection emailrolevalues emailoperationvalues emailoperation getselectionindex urlencoder emailpattern gettext getcharacterencoding daystext gettext daystext gettext parseint daystext gettext urlencoder daystext gettext getcharacterencoding numberformatexception protected string get queryurl task repository repository string buffer params string buffer url new string buffer get queryurl start repository to string url append params hack make sure that the searches come back sorted by priority this should be a search option though url append order importance url append bugzilla repository util content typerdf return url to string getqueryurl taskrepository stringbuffer stringbuffer stringbuffer getqueryurlstart tostring bugzillarepositoryutil contenttyperdf tostring creates the bugzilla query url start example https bugs eclipse org bugs buglist cgi private string buffer get queryurl start task repository repository string buffer sb new string buffer repository get url if sb char at sb length 1 sb append sb append buglist cgi return sb stringbuffer getqueryurlstart taskrepository stringbuffer stringbuffer geturl charat public task repository get repository return repository taskrepository getrepository public string get searchurl task repository repository try if remembered query return get queryurl repository new string buffer input get query parameters sel index else return get queryurl repository get query parameters catch unsupported encoding exception e ignore return getsearchurl taskrepository rememberedquery getqueryurl stringbuffer getqueryparameters selindex getqueryurl getqueryparameters unsupportedencodingexception public void handle event event event string message null if event widget days text string days days text get text if days length 0 try if integer parse int days 0 message num days positive days is invalid catch number format exception ex message num days positive days is invalid set page complete message null set error message message if get wizard null get wizard get container update buttons handleevent daystext daystext gettext parseint num_days_positive numberformatexception num_days_positive setpagecomplete seterrormessage getwizard getwizard getcontainer updatebuttons private void handle widget selected combo widget combo operation array list bugzilla search data history if widget get selection index 0 return int index history size 1 widget get selection index bugzilla search data pattern data history get index if pattern data null widget get text equals pattern data pattern return widget set text pattern data pattern operation set text operation get item pattern data operation handlewidgetselected arraylist bugzillasearchdata getselectionindex getselectionindex bugzillasearchdata patterndata patterndata gettext patterndata settext patterndata settext getitem patterndata public boolean is restore query options return restore query options isrestorequeryoptions restorequeryoptions email pattern add modify listener new modify listener public void modify text modify event e if scontainer null scontainer set perform action enabled can query emailpattern addmodifylistener modifylistener modifytext modifyevent setperformactionenabled canquery summary pattern add modify listener new modify listener public void modify text modify event e if scontainer null scontainer set perform action enabled can query summarypattern addmodifylistener modifylistener modifytext modifyevent setperformactionenabled canquery comment pattern add modify listener new modify listener public void modify text modify event e if scontainer null scontainer set perform action enabled can query commentpattern addmodifylistener modifylistener modifytext modifyevent setperformactionenabled canquery private string non null array i dialog settings settings string id string value settings get array id if value null return new string return value nonnullarray idialogsettings getarray todo avoid overriding public boolean perform action if restore query options save state get pattern data summary pattern summary operation previous summary patterns get pattern data comment pattern comment operation previous comment patterns get pattern data this email pattern email operation previous email patterns string summary text summary pattern get text bugzilla ui plugin get default get preference store set value i bugzilla constants most recent query summary text return super perform action performaction restorequeryoptions savestate getpatterndata summarypattern summaryoperation previoussummarypatterns getpatterndata commentpattern commentoperation previouscommentpatterns getpatterndata emailpattern emailoperation previousemailpatterns summarytext summarypattern gettext bugzillauiplugin getdefault getpreferencestore setvalue ibugzillaconstants most_recent_query summarytext performaction initializes itself from the stored page settings private void read configuration get dialog settings readconfiguration getdialogsettings private void restore widget values i dialog settings settings get dialog settings string repo id repository get url if restore query options settings get array store product id repo id null product null return set widgets to stored values product set selection non null array settings store product id repo id component set selection non null array settings store component id repo id version set selection non null array settings store version id repo id target set selection non null array settings store mstone id repo id status set selection non null array settings store status id repo id resolution set selection non null array settings store resolution id repo id severity set selection non null array settings store severity id repo id priority set selection non null array settings store priority id repo id hardware set selection non null array settings store hardware id repo id os set selection non null array settings store os id repo id summary operation select settings get int store summarymatch id repo id comment operation select settings get int store commentmatch id repo id email operation select settings get int store emailmatch id repo id for int i 0 i email buttons length i email buttons i set selection settings get boolean store emailbutton id i repo id summary pattern set text settings get store summarytext id repo id comment pattern set text settings get store commenttext id repo id email pattern set text settings get store emailaddress id repo id restorewidgetvalues idialogsettings getdialogsettings repoid geturl restorequeryoptions getarray store_product_id repoid setselection nonnullarray store_product_id repoid setselection nonnullarray store_component_id repoid setselection nonnullarray store_version_id repoid setselection nonnullarray store_mstone_id repoid setselection nonnullarray store_status_id repoid setselection nonnullarray store_resolution_id repoid setselection nonnullarray store_severity_id repoid setselection nonnullarray store_priority_id repoid setselection nonnullarray store_hardware_id repoid setselection nonnullarray store_os_id repoid summaryoperation getint store_summarymatch_id repoid commentoperation getint store_commentmatch_id repoid emailoperation getint store_emailmatch_id repoid emailbuttons emailbuttons setselection getboolean store_emailbutton_id repoid summarypattern settext store_summarytext_id repoid commentpattern settext store_commenttext_id repoid emailpattern settext store_emailaddress_id repoid i runnable with progress update runnable new i runnable with progress public void run i progress monitor monitor throws invocation target exception interrupted exception if monitor null monitor new null progress monitor try monitor begin task updating search options i progress monitor unknown connector update attributes repository monitor bugzilla ui plugin update query options repository monitor catch final core exception ce status handler display status update failed ce get status finally monitor done irunnablewithprogress updaterunnable irunnablewithprogress iprogressmonitor invocationtargetexception interruptedexception nullprogressmonitor begintask iprogressmonitor updateattributes bugzillauiplugin updatequeryoptions coreexception statushandler displaystatus getstatus public void save state string repo id repository get url i dialog settings settings get dialog settings settings put store product id repo id product get selection settings put store component id repo id component get selection settings put store version id repo id version get selection settings put store mstone id repo id target get selection settings put store status id repo id status get selection settings put store resolution id repo id resolution get selection settings put store severity id repo id severity get selection settings put store priority id repo id priority get selection settings put store hardware id repo id hardware get selection settings put store os id repo id os get selection settings put store summarymatch id repo id summary operation get selection index settings put store commentmatch id repo id comment operation get selection index settings put store emailmatch id repo id email operation get selection index for int i 0 i email buttons length i settings put store emailbutton id i repo id email buttons i get selection settings put store summarytext id repo id summary pattern get text settings put store commenttext id repo id comment pattern get text settings put store emailaddress id repo id email pattern get text settings put store repo id repository combo get text savestate repoid geturl idialogsettings getdialogsettings store_product_id repoid getselection store_component_id repoid getselection store_version_id repoid getselection store_mstone_id repoid getselection store_status_id repoid getselection store_resolution_id repoid getselection store_severity_id repoid getselection store_priority_id repoid getselection store_hardware_id repoid getselection store_os_id repoid getselection store_summarymatch_id repoid summaryoperation getselectionindex store_commentmatch_id repoid commentoperation getselectionindex store_emailmatch_id repoid emailoperation getselectionindex emailbuttons store_emailbutton_id repoid emailbuttons getselection store_summarytext_id repoid summarypattern gettext store_commenttext_id repoid commentpattern gettext store_emailaddress_id repoid emailpattern gettext store_repo_id repositorycombo gettext public void set repository task repository repository this repository repository setrepository taskrepository public void set restore query options boolean restore query options this restore query options restore query options setrestorequeryoptions restorequeryoptions restorequeryoptions restorequeryoptions override public void set visible boolean visible if visible summary pattern null if first time if repository null repository tasks ui plugin get repository manager get default repository bugzilla core plugin repository kind set task repository repositories tasks ui plugin get repository manager get repositories bugzilla core plugin repository kind string repository urls new string repositories size int i 0 int index to select 0 for iterator task repository iter repositories iterator iter has next task repository curr repsitory iter next if i 0 repository null repository curr repsitory index to select 0 if repository null repository equals curr repsitory index to select i repository urls i curr repsitory get url i i dialog settings settings get dialog settings if repository combo null repository combo set items repository urls if repository urls length 0 message dialog open information display get current get active shell i bugzilla constants title message dialog task repository manager message no repository else string select repo settings get store repo id if select repo null repository combo index of select repo 1 repository combo set text select repo repository tasks ui plugin get repository manager get repository bugzilla core plugin repository kind repository combo get text if repository null repository tasks ui plugin get repository manager get default repository bugzilla core plugin repository kind else repository combo select index to select update attributes from repository repository combo get text null false first time false set item and text here to prevent page from resizing for string search pattern get previous patterns previous summary patterns summary pattern add search pattern summary pattern set items get previous patterns previous summary patterns for string comment get previous patterns previous comment patterns comment pattern add comment comment pattern set items get previous patterns previous comment patterns for string email get previous patterns previous email patterns email pattern add email email pattern set items get previous patterns previous email patterns todo update status resolution severity etc if possible if repository null update attributes from repository repository get url null false if product get item count 0 update attributes from repository repository get url null true if original query null try update defaults original query get url catch unsupported encoding exception e ignore hack we have to select the correct product then update the attributes so the component version milestone lists have the proper values then we can restore all the widget selections if repository null i dialog settings settings get dialog settings string repo id repository get url if get wizard null restore query options settings get array store product id repo id null product null product set selection non null array settings store product id repo id if product get selection length 0 update attributes from repository repository get url product get selection false restore widget values if scontainer null scontainer set perform action enabled can query if get wizard null todo wierd check summary pattern set focus super set visible visible setvisible summarypattern firsttime tasksuiplugin getrepositorymanager getdefaultrepository bugzillacoreplugin repository_kind taskrepository tasksuiplugin getrepositorymanager getrepositories bugzillacoreplugin repository_kind repositoryurls indextoselect taskrepository hasnext taskrepository currrepsitory currrepsitory indextoselect currrepsitory indextoselect repositoryurls currrepsitory geturl idialogsettings getdialogsettings repositorycombo repositorycombo setitems repositoryurls repositoryurls messagedialog openinformation getcurrent getactiveshell ibugzillaconstants title_message_dialog taskrepositorymanager message_no_repository selectrepo store_repo_id selectrepo repositorycombo indexof selectrepo repositorycombo settext selectrepo tasksuiplugin getrepositorymanager getrepository bugzillacoreplugin repository_kind repositorycombo gettext tasksuiplugin getrepositorymanager getdefaultrepository bugzillacoreplugin repository_kind repositorycombo indextoselect updateattributesfromrepository repositorycombo gettext firsttime searchpattern getpreviouspatterns previoussummarypatterns summarypattern searchpattern summarypattern setitems getpreviouspatterns previoussummarypatterns getpreviouspatterns previouscommentpatterns commentpattern commentpattern setitems getpreviouspatterns previouscommentpatterns getpreviouspatterns previousemailpatterns emailpattern emailpattern setitems getpreviouspatterns previousemailpatterns updateattributesfromrepository geturl getitemcount updateattributesfromrepository geturl originalquery updatedefaults originalquery geturl unsupportedencodingexception idialogsettings getdialogsettings repoid geturl getwizard restorequeryoptions getarray store_product_id repoid setselection nonnullarray store_product_id repoid getselection updateattributesfromrepository geturl getselection restorewidgetvalues setperformactionenabled canquery getwizard summarypattern setfocus setvisible private void update attributes from repository string repository url string selected products boolean connect if connect final abstract repository connector connector tasks ui plugin get repository manager get repository connector repository get connector kind i runnable with progress update runnable new i runnable with progress public void run i progress monitor monitor throws invocation target exception interrupted exception if monitor null monitor new null progress monitor try monitor begin task updating search options i progress monitor unknown connector update attributes repository monitor bugzilla ui plugin update query options repository monitor catch final core exception ce status handler display status update failed ce get status finally monitor done try todo make cancelable bug 143011 if get container null get container run true false update runnable else i progress service service platformui get workbench get progress service service run true false update runnable catch invocation target exception e message dialog open error null error updating search options error was e get cause get message catch interrupted exception e was cancelled if selected products null string products list bugzilla ui plugin get query options i bugzilla constants values product null repository url arrays sort products list string case insensitive order product set items products list string components list bugzilla ui plugin get query options i bugzilla constants values component selected products repository url arrays sort components list string case insensitive order component set items components list version set items bugzilla ui plugin get query options i bugzilla constants values version selected products repository url target set items bugzilla ui plugin get query options i bugzilla constants values target selected products repository url if selected products null status set items bugzilla ui plugin get query options i bugzilla constants values status selected products repository url status set selection bugzilla repository util get query options i bugzilla constants valuse status preselected repository url resolution set items bugzilla ui plugin get query options i bugzilla constants values resolution selected products repository url severity set items bugzilla ui plugin get query options i bugzilla constants values severity selected products repository url priority set items bugzilla ui plugin get query options i bugzilla constants values priority selected products repository url hardware set items bugzilla ui plugin get query options i bugzilla constants values hardware selected products repository url os set items bugzilla ui plugin get query options i bugzilla constants values os selected products repository url updateattributesfromrepository repositoryurl selectedproducts abstractrepositoryconnector tasksuiplugin getrepositorymanager getrepositoryconnector getconnectorkind irunnablewithprogress updaterunnable irunnablewithprogress iprogressmonitor invocationtargetexception interruptedexception nullprogressmonitor begintask iprogressmonitor updateattributes bugzillauiplugin updatequeryoptions coreexception statushandler displaystatus getstatus getcontainer getcontainer updaterunnable iprogressservice getworkbench getprogressservice updaterunnable invocationtargetexception messagedialog openerror getcause getmessage interruptedexception selectedproducts productslist bugzillauiplugin getqueryoptions ibugzillaconstants values_product repositoryurl productslist case_insensitive_order setitems productslist componentslist bugzillauiplugin getqueryoptions ibugzillaconstants values_component selectedproducts repositoryurl componentslist case_insensitive_order setitems componentslist setitems bugzillauiplugin getqueryoptions ibugzillaconstants values_version selectedproducts repositoryurl setitems bugzillauiplugin getqueryoptions ibugzillaconstants values_target selectedproducts repositoryurl selectedproducts setitems bugzillauiplugin getqueryoptions ibugzillaconstants values_status selectedproducts repositoryurl setselection bugzillarepositoryutil getqueryoptions ibugzillaconstants valuse_status_preselected repositoryurl setitems bugzillauiplugin getqueryoptions ibugzillaconstants values_resolution selectedproducts repositoryurl setitems bugzillauiplugin getqueryoptions ibugzillaconstants values_severity selectedproducts repositoryurl setitems bugzillauiplugin getqueryoptions ibugzillaconstants values_priority selectedproducts repositoryurl setitems bugzillauiplugin getqueryoptions ibugzillaconstants values_hardware selectedproducts repositoryurl setitems bugzillauiplugin getqueryoptions ibugzillaconstants values_os selectedproducts repositoryurl todo get rid of this public void update defaults string starting url throws unsupported encoding exception string server name starting url substring 0 starting url index of starting url starting url substring starting url index of 1 string options starting url split for string option options string key option substring 0 option index of string value url decoder decode option substring option index of 1 repository get character encoding if key null continue if key equals short desc summary pattern set text value else if key equals short desc type if value equals allwordssubstr value all words else if value equals anywordssubstr value any word int index 0 for string item summary operation get items if item compare to value 0 break index if index summary operation get item count summary operation select index else if key equals product string sel product get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size product set selection sel list to array sel update attributes from repository repository get url sel list to array sel false else if key equals component string sel component get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size component set selection sel list to array sel else if key equals version string sel version get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size version set selection sel list to array sel else if key equals target milestone xxx string sel target get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size target set selection sel list to array sel else if key equals version string sel version get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size version set selection sel list to array sel else if key equals long desc type if value equals allwordssubstr value all words else if value equals anywordssubstr value any word int index 0 for string item comment operation get items if item compare to value 0 break index if index comment operation get item count comment operation select index else if key equals long desc comment pattern set text value else if key equals bug status string sel status get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size status set selection sel list to array sel else if key equals resolution string sel resolution get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size resolution set selection sel list to array sel else if key equals bug severity string sel severity get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size severity set selection sel list to array sel else if key equals priority string sel priority get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size priority set selection sel list to array sel else if key equals ref platform string sel hardware get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size hardware set selection sel list to array sel else if key equals op sys string sel os get selection java util list string sel list arrays as list sel sel list new array list string sel list sel list add value sel new string sel list size os set selection sel list to array sel else if key equals emailassigned to1 hack email buttons assumed to be in same position if value equals 1 email buttons 0 set selection true else email buttons 0 set selection false else if key equals emailreporter1 hack email buttons assumed to be in same position if value equals 1 email buttons 1 set selection true else email buttons 1 set selection false else if key equals emailcc1 hack email buttons assumed to be in same position if value equals 1 email buttons 2 set selection true else email buttons 2 set selection false else if key equals emaillongdesc1 hack email buttons assumed to be in same position if value equals 1 email buttons 3 set selection true else email buttons 3 set selection false else if key equals emailtype1 int index 0 for string item email operation get items if item compare to value 0 break index if index email operation get item count email operation select index else if key equals email1 email pattern set text value else if key equals changedin days text set text value updatedefaults startingurl unsupportedencodingexception servername startingurl startingurl indexof startingurl startingurl startingurl indexof startingurl indexof urldecoder indexof getcharacterencoding short_desc summarypattern settext short_desc_type summaryoperation getitems compareto summaryoperation getitemcount summaryoperation getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray updateattributesfromrepository geturl sellist toarray getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray target_milestone getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray long_desc_type commentoperation getitems compareto commentoperation getitemcount commentoperation long_desc commentpattern settext bug_status getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray bug_severity getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray ref_platform getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray op_sys getselection sellist aslist sellist arraylist sellist sellist sellist setselection sellist toarray emailassigned_to1 emailbuttons setselection emailbuttons setselection emailbuttons setselection emailbuttons setselection emailbuttons setselection emailbuttons setselection emailbuttons setselection emailbuttons setselection emailoperation getitems compareto emailoperation getitemcount emailoperation emailpattern settext daystext settext product add selection listener new selection adapter override public void widget selected selection event e if product get selection index 1 string selected products product get selection update attributes from repository repository get url selected products false else update attributes from repository repository get url null false if restoring restoring false restore widget values if scontainer null scontainer set perform action enabled can query addselectionlistener selectionadapter widgetselected selectionevent getselectionindex selectedproducts getselection updateattributesfromrepository geturl selectedproducts updateattributesfromrepository geturl restorewidgetvalues setperformactionenabled canquery email pattern add selection listener new selection adapter override public void widget selected selection event e handle widget selected email pattern email operation previous email patterns emailpattern addselectionlistener selectionadapter widgetselected selectionevent handlewidgetselected emailpattern emailoperation previousemailpatterns override public void widget selected selection event e if repository null update attributes from repository repository get url null true else message dialog open information display get current get active shell i bugzilla constants title message dialog task repository manager message no repository widgetselected selectionevent updateattributesfromrepository geturl messagedialog openinformation getcurrent getactiveshell ibugzillaconstants title_message_dialog taskrepositorymanager message_no_repository private selection adapter update action selection adapter new selection adapter override public void widget selected selection event e if scontainer null scontainer set perform action enabled can query selectionadapter updateactionselectionadapter selectionadapter widgetselected selectionevent setperformactionenabled canquery summary pattern add selection listener new selection adapter override public void widget selected selection event e handle widget selected summary pattern summary operation previous summary patterns summarypattern addselectionlistener selectionadapter widgetselected selectionevent handlewidgetselected summarypattern summaryoperation previoussummarypatterns comment pattern add selection listener new selection adapter override public void widget selected selection event e handle widget selected comment pattern comment operation previous comment patterns commentpattern addselectionlistener selectionadapter widgetselected selectionevent handlewidgetselected commentpattern commentoperation previouscommentpatterns returns the category of the given element the category is a number used to allocate elements to bins the bins are arranged in ascending numeric order the elements within a bin are arranged via a second level sort criterion p see org eclipse jface viewers viewer sorter category object override public int category object element try i marker marker i marker element return the bugs id if marker get type equals bugzilla ui plugin hit marker id return integer marker get attribute bugzilla ui plugin hit marker attr id int value catch exception ignored ignore if there is a problem if that didn t work use the default category method return super category element viewersorter imarker imarker gettype bugzillauiplugin hit_marker_id getattribute bugzillauiplugin hit_marker_attr_id intvalue returns a negative zero or positive number depending on whether the first bug s severity goes before is the same as or goes after the second element s severity p see org eclipse jface viewers viewer sorter compare org eclipse jface viewers viewer java lang object java lang object override public int compare viewer viewer object e1 object e2 try cast the object and get its severity i marker entry1 i marker e1 integer severity1 integer entry1 get attribute bugzilla ui plugin hit marker attr severity cast the other object and get its severity i marker entry2 i marker e2 integer severity2 integer entry2 get attribute bugzilla ui plugin hit marker attr severity if neither is null compare the bugs severities if severity1 null severity2 null return severity1 compare to severity2 catch exception ignored ignore if there is a problem if that didn t work use the default compare method return super compare viewer e1 e2 viewersorter imarker imarker getattribute bugzillauiplugin hit_marker_attr_severity imarker imarker getattribute bugzillauiplugin hit_marker_attr_severity compareto returns the category of the given element the category is a number used to allocate elements to bins the bins are arranged in ascending numeric order the elements within a bin are arranged via a second level sort criterion p see org eclipse jface viewers viewer sorter category object override public int category object element try i marker marker i marker element return the bugs id if marker get type equals bugzilla ui plugin hit marker id return integer marker get attribute bugzilla ui plugin hit marker attr id int value catch exception ignored ignore if there is a problem if that didn t work use the default category method return super category element viewersorter imarker imarker gettype bugzillauiplugin hit_marker_id getattribute bugzillauiplugin hit_marker_attr_id intvalue returns a negative zero or positive number depending on whether the first bug s state goes before is the same as or goes after the second element s state p see org eclipse jface viewers viewer sorter compare org eclipse jface viewers viewer java lang object java lang object override public int compare viewer viewer object e1 object e2 try cast the object and get its state i marker entry1 i marker e1 integer state1 integer entry1 get attribute bugzilla ui plugin hit marker attr state cast the other object and get its state i marker entry2 i marker e2 integer state2 integer entry2 get attribute bugzilla ui plugin hit marker attr state if neither is null compare the bugs states if state1 null state2 null compare the states int rc state1 compare to state2 compare the resolution if the states are the same if rc 0 get the resolution of the bug integer result1 integer entry1 get attribute bugzilla ui plugin hit marker attr result get the resolution of the other bug integer result2 integer entry2 get attribute bugzilla ui plugin hit marker attr result if neither state is null compare them if result1 null result2 null rc result1 compare to result2 return rc catch exception ignored ignore if there is a problem if that didn t work use the default compare method return super compare viewer e1 e2 viewersorter imarker imarker getattribute bugzillauiplugin hit_marker_attr_state imarker imarker getattribute bugzillauiplugin hit_marker_attr_state compareto getattribute bugzillauiplugin hit_marker_attr_result getattribute bugzillauiplugin hit_marker_attr_result compareto public boolean is shown in editor match match i editor part editor public match compute contained matches abstract text search result result i editor part editor isshownineditor ieditorpart computecontainedmatches abstracttextsearchresult ieditorpart public interface i bugzilla result editor match adapter extends i editor match adapter public boolean is shown in editor match match i editor part editor ibugzillaresulteditormatchadapter ieditormatchadapter isshownineditor ieditorpart public match compute contained matches abstract text search result result i editor part editor public void set result repository search result result computecontainedmatches abstracttextsearchresult ieditorpart setresult repositorysearchresult private static i hyperlink extract hyperlink task repository repository int region offset matcher m int start 1 if m group starts with duplicate start m start m group index of m group task num group else start m start int end m end if end 1 end m group length try string bug id m group task num group trim start region offset end region offset i region sregion new region start end start return new task hyperlink sregion repository bug id catch number format exception e return null ihyperlink extracthyperlink taskrepository regionoffset startswith indexof task_num_group bugid task_num_group regionoffset regionoffset iregion taskhyperlink bugid numberformatexception override public i hyperlink find hyperlinks task repository repository string text int line offset int region offset array list i hyperlink hyperlinks found new array list i hyperlink matcher m pattern matcher text while m find if line offset m start line offset m end i hyperlink link extract hyperlink repository region offset m if link null hyperlinks found add link if hyperlinks found size 0 return hyperlinks found to array new i hyperlink 1 return null ihyperlink findhyperlinks taskrepository lineoffset regionoffset arraylist ihyperlink hyperlinksfound arraylist ihyperlink lineoffset lineoffset ihyperlink extracthyperlink regionoffset hyperlinksfound hyperlinksfound hyperlinksfound toarray ihyperlink public class bugzilla connector ui extends abstract repository connector ui override public string get account creation url task repository task repository return task repository get url createaccount cgi bugzillaconnectorui abstractrepositoryconnectorui getaccountcreationurl taskrepository taskrepository taskrepository geturl override public string get account management url task repository task repository return task repository get url userprefs cgi getaccountmanagementurl taskrepository taskrepository taskrepository geturl override public string get connector kind return bugzilla core plugin repository kind getconnectorkind bugzillacoreplugin repository_kind override public list abstract task container get legend items list abstract task container legend items new array list abstract task container bugzilla task blocker new bugzilla task critical critical blocker blocker set severity critical legend items add blocker bugzilla task major new bugzilla task major major major set severity major legend items add major bugzilla task enhancement new bugzilla task enhancement enhancement enhancement set severity enhancement legend items add enhancement bugzilla task trivial new bugzilla task trivial trivial minor trivial set severity trivial legend items add trivial return legend items abstracttaskcontainer getlegenditems abstracttaskcontainer legenditems arraylist abstracttaskcontainer bugzillatask bugzillatask setseverity legenditems bugzillatask bugzillatask setseverity legenditems bugzillatask bugzillatask setseverity legenditems bugzillatask bugzillatask setseverity legenditems legenditems override public i wizard get new task wizard task repository task repository return new new bugzilla task wizard task repository iwizard getnewtaskwizard taskrepository taskrepository newbugzillataskwizard taskrepository override public i wizard get query wizard task repository repository abstract repository query query if query instanceof bugzilla repository query return new edit bugzilla query wizard repository bugzilla repository query query else return new new bugzilla query wizard repository iwizard getquerywizard taskrepository abstractrepositoryquery bugzillarepositoryquery editbugzillaquerywizard bugzillarepositoryquery newbugzillaquerywizard override public abstract repository query page get search page task repository repository i structured selection selection return new bugzilla search page repository abstractrepositoryquerypage getsearchpage taskrepository istructuredselection bugzillasearchpage override public abstract repository settings page get settings page return new bugzilla repository settings page this abstractrepositorysettingspage getsettingspage bugzillarepositorysettingspage override public string get task kind label abstract task repository task return i bugzilla constants bugzilla task kind gettaskkindlabel abstracttask repositorytask ibugzillaconstants bugzilla_task_kind override public string get task kind label repository task data task data return i bugzilla constants bugzilla task kind gettaskkindlabel repositorytaskdata taskdata ibugzillaconstants bugzilla_task_kind override public image descriptor get task kind overlay abstract task task if task instanceof bugzilla task bugzilla task bugzilla task bugzilla task task string severity bugzilla task get severity if severity null xxx refactor to use configuration if blocker equals severity critical equals severity return bugzilla images overlay critical else if major equals severity return bugzilla images overlay major else if enhancement equals severity return bugzilla images overlay enhancement else if trivial equals severity minor equals severity return bugzilla images overlay minor else return null return super get task kind overlay task imagedescriptor gettaskkindoverlay abstracttask bugzillatask bugzillatask bugzillatask bugzillatask bugzillatask getseverity bugzillaimages overlay_critical bugzillaimages overlay_major bugzillaimages overlay_enhancement bugzillaimages overlay_minor gettaskkindoverlay override public boolean has search page return true hassearchpage suppress warnings restriction override public boolean supports due dates abstract task task if task instanceof bugzilla task xxx this is only used in the planning editor and if its input was set correctly as a repository task editor input we wouldn t have to get the task data this way from here repository task data task data tasks ui plugin get task data manager get new task data task get repository url task get task id if task data null task data get attribute bugzilla report element estimated time get key string null return true return super supports due dates task suppresswarnings supportsduedates abstracttask bugzillatask repositorytaskeditorinput repositorytaskdata taskdata tasksuiplugin gettaskdatamanager getnewtaskdata getrepositoryurl gettaskid taskdata taskdata getattribute bugzillareportelement estimated_time getkeystring supportsduedates public bugzilla custom query dialog shell parent shell string query string string description string max hits super parent shell this starting url query string this max hits max hits this name description bugzillacustomquerydialog parentshell querystring maxhits parentshell startingurl querystring maxhits maxhits override protected control create contents composite parent composite custom new composite parent swt none grid layout gl new grid layout 2 false custom set layout gl label l new label custom swt none l set text bugzilla query category name name text new text custom swt border swt single if name null name text set text name grid data gd new grid data grid data fill horizontal gd width hint 300 name text set layout data gd l new label custom swt none l set text max hits returned 1 means all max hits text new text custom swt border swt single if max hits null max hits text set text max hits gd new grid data grid data fill horizontal gd width hint 300 max hits text set layout data gd l new label custom swt none l set text query url query text new text custom swt border swt single if starting url null query text set text starting url gd new grid data grid data fill horizontal gd width hint 300 query text set layout data gd control c super create contents parent return c createcontents gridlayout gridlayout setlayout settext nametext nametext settext griddata griddata griddata fill_horizontal widthhint nametext setlayoutdata settext maxhitstext maxhits maxhitstext settext maxhits griddata griddata fill_horizontal widthhint maxhitstext setlayoutdata settext querytext startingurl querytext settext startingurl griddata griddata fill_horizontal widthhint querytext setlayoutdata createcontents public string get max hits return max hits getmaxhits maxhits public string get name return name getname public string get url return url geturl override protected void ok pressed todo validate the values url query text get text name name text get text max hits max hits text get text super ok pressed okpressed querytext gettext nametext gettext maxhits maxhitstext gettext okpressed public bugzilla custom query wizard page task repository repository bugzilla repository query query super title query get summary this query query this repository repository set title label custom query set description description set image descriptor tasks ui images banner repository bugzillacustomquerywizardpage taskrepository bugzillarepositoryquery getsummary settitle label_custom_query setdescription setimagedescriptor tasksuiimages banner_repository public bugzilla custom query wizard page task repository repository super title this repository repository set title label custom query set description description set image descriptor tasks ui images banner repository bugzillacustomquerywizardpage taskrepository settitle label_custom_query setdescription setimagedescriptor tasksuiimages banner_repository override public boolean can flip to next page return false canfliptonextpage override public void create control composite parent composite new composite parent swt none composite set layout new grid layout super create control composite create custom query group composite composite pack set control composite createcontrol setlayout gridlayout createcontrol createcustomquerygroup setcontrol private void create custom query group composite composite group group new group composite swt none group set text label custom query grid layout layout new grid layout layout num columns 1 group set layout layout grid data gd new grid data grid data fill horizontal gd horizontal span 2 gd width hint 300 group set layout data gd query text new text group swt border gd new grid data grid data fill horizontal grid data grab horizontal query text set layout data gd if query null query text set text query get url query text add key listener new key listener public void key pressed key event e ignore public void key released key event e set page complete can flip to next page createcustomquerygroup settext label_custom_query gridlayout gridlayout numcolumns setlayout griddata griddata griddata fill_horizontal horizontalspan widthhint setlayoutdata querytext griddata griddata fill_horizontal griddata grab_horizontal querytext setlayoutdata querytext settext geturl querytext addkeylistener keylistener keypressed keyevent keyreleased keyevent setpagecomplete canfliptonextpage override public bugzilla repository query get query if query null query new bugzilla repository query repository get url query text get text this get query title query set custom query true else query set handle identifier this get query title query set url query text get text return query bugzillarepositoryquery getquery bugzillarepositoryquery geturl querytext gettext getquerytitle setcustomquery sethandleidentifier getquerytitle seturl querytext gettext query text add key listener new key listener public void key pressed key event e ignore querytext addkeylistener keylistener keypressed keyevent public void key released key event e set page complete can flip to next page keyreleased keyevent setpagecomplete canfliptonextpage public bugzilla query type wizard page task repository repository super title set title title set description description set image descriptor tasks ui images banner repository custom page new bugzilla custom query wizard page repository search page new bugzilla search page repository search page set restore query options false bugzillaquerytypewizardpage taskrepository settitle setdescription setimagedescriptor tasksuiimages banner_repository custompage bugzillacustomquerywizardpage searchpage bugzillasearchpage searchpage setrestorequeryoptions public void create control composite parent composite new composite parent swt none grid data grid data new grid data grid data fill horizontal grid data grab excess vertical space false composite set layout data grid data composite set layout new grid layout 1 false button form new button composite swt radio button form set text button label form button form set selection true button custom new button composite swt radio button custom set text button label query set page complete true set control composite createcontrol griddata griddata griddata griddata fill_horizontal griddata grabexcessverticalspace setlayoutdata griddata setlayout gridlayout buttonform buttonform settext button_label_form buttonform setselection buttoncustom buttoncustom settext button_label_query setpagecomplete setcontrol override public i wizard page get next page if button form get selection search page set wizard this get wizard return search page custom page set wizard this get wizard return custom page iwizardpage getnextpage buttonform getselection searchpage setwizard getwizard searchpage custompage setwizard getwizard custompage override protected void apply validator result validator validator super apply validator result validator if bugzilla validator validator get result null bugzilla validator validator get result null set bugzilla version bugzilla validator validator get result applyvalidatorresult applyvalidatorresult bugzillavalidator getresult bugzillavalidator getresult setbugzillaversion bugzillavalidator getresult public bugzilla repository settings page abstract repository connector ui repository ui super title description repository ui set needs anonymous login true set needs encoding true set needs time zone false set needs http auth true bugzillarepositorysettingspage abstractrepositoryconnectorui repositoryui repositoryui setneedsanonymouslogin setneedsencoding setneedstimezone setneedshttpauth public bugzilla validator task repository repository string version server url get server url new user id get user name new password get password is anonymous is anonymous access new encoding get character encoding http auth user get http auth user id http auth pass get http auth password proxy repository get proxy versions 0 version bugzillavalidator taskrepository serverurl getserverurl newuserid getusername newpassword getpassword isanonymous isanonymousaccess newencoding getcharacterencoding httpauthuser gethttpauthuserid httpauthpass gethttpauthpassword getproxy override protected void create additional controls composite parent for repository template template connector get templates server url combo add template label server url combo add selection listener new selection adapter override public void widget selected selection event e string text server url combo get text repository template template connector get template text if template null repository label editor set string value template label set url template repository url set anonymous info anonymous set bugzilla version template version if template character encoding null set encoding template character encoding get container update buttons return label repository version label new label parent swt none repository version label set text repository version repository version combo new combo parent swt read only repository version combo add label automatic version for bugzilla server version version bugzilla server version values repository version combo add version to string if repository null repository version combo index of repository get version 0 repository version combo select repository version combo index of repository get version else int default index repository version combo get item count 1 repository version combo select default index set version repository version combo get item default index repository version combo add selection listener new selection listener public void widget selected selection event e if repository version combo get selection index 0 set version repository version combo get item repository version combo get selection index public void widget default selected selection event e ignore label short login label new label parent swt none short login label set text label short logins cleanqa contact new button parent swt check swt left if repository null boolean short login boolean parse boolean repository get property i bugzilla constants repository setting short login cleanqa contact set selection short login label cached config label new label parent swt none cached config label set text label cached configuration cached config button new button parent swt check swt left if repository null boolean is cached true string old timestamp repository get property i bugzilla constants property configtimestamp if old timestamp null old timestamp equals i bugzilla constants timestamp not available is cached false cached config button set selection is cached createadditionalcontrols repositorytemplate gettemplates serverurlcombo serverurlcombo addselectionlistener selectionadapter widgetselected selectionevent serverurlcombo gettext repositorytemplate gettemplate repositorylabeleditor setstringvalue seturl repositoryurl setanonymous setbugzillaversion characterencoding setencoding characterencoding getcontainer updatebuttons repositoryversionlabel repositoryversionlabel settext repositoryversioncombo read_only repositoryversioncombo label_automatic_version bugzillaserverversion bugzillaserverversion repositoryversioncombo tostring repositoryversioncombo indexof getversion repositoryversioncombo repositoryversioncombo indexof getversion defaultindex repositoryversioncombo getitemcount repositoryversioncombo defaultindex setversion repositoryversioncombo getitem defaultindex repositoryversioncombo addselectionlistener selectionlistener widgetselected selectionevent repositoryversioncombo getselectionindex setversion repositoryversioncombo getitem repositoryversioncombo getselectionindex widgetdefaultselected selectionevent shortloginlabel shortloginlabel settext label_short_logins cleanqacontact shortlogin parseboolean getproperty ibugzillaconstants repository_setting_short_login cleanqacontact setselection shortlogin cachedconfiglabel cachedconfiglabel settext label_cached_configuration cachedconfigbutton iscached oldtimestamp getproperty ibugzillaconstants property_configtimestamp oldtimestamp oldtimestamp ibugzillaconstants timestamp_not_available iscached cachedconfigbutton setselection iscached private void display error final string server url throwable e i status status if e instanceof malformedurl exception status new bugzilla status status warning bugzilla core plugin plugin id repository status error network server url is invalid else if e instanceof core exception status core exception e get status else if e instanceof io exception status new bugzilla status status warning bugzilla core plugin plugin id repository status error io server url e get message else status new bugzilla status status warning bugzilla core plugin plugin id repository status error network server url e get message status handler display status validation failed status set status status displayerror serverurl istatus malformedurlexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_network coreexception coreexception getstatus ioexception bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_io serverurl getmessage bugzillastatus bugzillacoreplugin plugin_id repositorystatus error_network serverurl getmessage statushandler displaystatus setstatus public string get result return versions 0 getresult override protected validator get validator task repository repository if repository version combo get selection index 0 return new bugzilla validator repository repository version combo get item repository version combo get selection index else return new bugzilla validator repository null getvalidator taskrepository repositoryversioncombo getselectionindex bugzillavalidator repositoryversioncombo getitem repositoryversioncombo getselectionindex bugzillavalidator override public boolean is page complete return super is page complete ispagecomplete ispagecomplete override protected boolean is valid url string name if name starts with url prefix https name starts with url prefix http try new url name return true catch malformedurl exception e return false isvalidurl startswith url_prefix_https startswith url_prefix_http malformedurlexception override public void run i progress monitor monitor throws core exception try validate monitor catch exception e display error server url e iprogressmonitor coreexception displayerror serverurl public void set bugzilla version string version if version null repository version combo select 0 else int i repository version combo index of version to string if i 1 repository version combo select i set version version else for i bugzilla constants bugzilla server version server version i bugzilla constants bugzilla server version values if version starts with server version to string i repository version combo index of server version to string if i 1 repository version combo select i set version server version to string break if i 1 status handler log could not resolve repository version version this set version i bugzilla constants bugzilla server version server 218 to string setbugzillaversion repositoryversioncombo repositoryversioncombo indexof tostring repositoryversioncombo setversion ibugzillaconstants bugzillaserverversion serverversion ibugzillaconstants bugzillaserverversion startswith serverversion tostring repositoryversioncombo indexof serverversion tostring repositoryversioncombo setversion serverversion tostring statushandler setversion ibugzillaconstants bugzillaserverversion server_218 tostring override public void update properties task repository repository repository set property i bugzilla constants repository setting short login string value of cleanqa contact get selection if cached config button get selection repository set property i bugzilla constants property configtimestamp else repository set property i bugzilla constants property configtimestamp i bugzilla constants timestamp not available updateproperties taskrepository setproperty ibugzillaconstants repository_setting_short_login valueof cleanqacontact getselection cachedconfigbutton getselection setproperty ibugzillaconstants property_configtimestamp setproperty ibugzillaconstants property_configtimestamp ibugzillaconstants timestamp_not_available public void validate i progress monitor monitor throws io exception core exception if monitor null monitor new null progress monitor try monitor begin task validating server settings i progress monitor unknown bugzilla client client null proxy temp proxy proxy no proxy if get use default proxy temp proxy task repository get system proxy else temp proxy web client util get proxy get proxy hostname get proxy port get proxy username get proxy password boolean check version versions 0 null if is anonymous client bugzilla client factory create client server url new user id new password http auth user http auth pass proxy new encoding client logout else if versions null client bugzilla client factory create client server url new user id new password http auth user http auth pass proxy new encoding client validate if check version client null repository configuration config client get repository configuration if config null versions 0 config get install version finally monitor done iprogressmonitor ioexception coreexception nullprogressmonitor begintask iprogressmonitor bugzillaclient tempproxy no_proxy getusedefaultproxy tempproxy taskrepository getsystemproxy tempproxy webclientutil getproxy getproxyhostname getproxyport getproxyusername getproxypassword checkversion isanonymous bugzillaclientfactory createclient serverurl newuserid newpassword httpauthuser httpauthpass newencoding bugzillaclientfactory createclient serverurl newuserid newpassword httpauthuser httpauthpass newencoding checkversion repositoryconfiguration getrepositoryconfiguration getinstallversion public void widget default selected selection event e ignore widgetdefaultselected selectionevent server url combo add selection listener new selection adapter override public void widget selected selection event e string text server url combo get text repository template template connector get template text if template null repository label editor set string value template label set url template repository url set anonymous info anonymous set bugzilla version template version if template character encoding null set encoding template character encoding get container update buttons return serverurlcombo addselectionlistener selectionadapter widgetselected selectionevent serverurlcombo gettext repositorytemplate gettemplate repositorylabeleditor setstringvalue seturl repositoryurl setanonymous setbugzillaversion characterencoding setencoding characterencoding getcontainer updatebuttons public void widget selected selection event e if repository version combo get selection index 0 set version repository version combo get item repository version combo get selection index widgetselected selectionevent repositoryversioncombo getselectionindex setversion repositoryversioncombo getitem repositoryversioncombo getselectionindex override public boolean can create editor for abstract task task return task instanceof bugzilla task cancreateeditorfor abstracttask bugzillatask override public boolean can create editor for i editor input input if input instanceof repository task editor input return bugzilla core plugin repository kind equals repository task editor input input get repository get connector kind return false cancreateeditorfor ieditorinput repositorytaskeditorinput bugzillacoreplugin repository_kind repositorytaskeditorinput getrepository getconnectorkind override public editor part create editor task editor parent editor i editor input editor input abstract repository task editor editor null if editor input instanceof repository task editor input repository task editor input task input repository task editor input editor input if task input get task data is new editor new new bugzilla task editor parent editor else editor new bugzilla task editor parent editor else if editor input instanceof task editor input editor new bugzilla task editor parent editor return editor editorpart createeditor taskeditor parenteditor ieditorinput editorinput abstractrepositorytaskeditor editorinput repositorytaskeditorinput repositorytaskeditorinput taskinput repositorytaskeditorinput editorinput taskinput gettaskdata isnew newbugzillataskeditor parenteditor bugzillataskeditor parenteditor editorinput taskeditorinput bugzillataskeditor parenteditor override public i editor input create editor input abstract task task if task instanceof bugzilla task bugzilla task bugzilla task bugzilla task task final task repository repository tasks ui plugin get repository manager get repository bugzilla core plugin repository kind bugzilla task get repository url bugzilla task editor input input new bugzilla task editor input repository bugzilla task true return input return null ieditorinput createeditorinput abstracttask bugzillatask bugzillatask bugzillatask bugzillatask taskrepository tasksuiplugin getrepositorymanager getrepository bugzillacoreplugin repository_kind bugzillatask getrepositoryurl bugzillataskeditorinput bugzillataskeditorinput bugzillatask override public string get title return title gettitle override public boolean provides outline return true providesoutline public bugzilla task editor input task repository repository bugzilla task bugzilla task boolean offline super repository bugzilla task get task id bugzilla task get url this bug task bugzilla task update options get task data update options get old task data bugzillataskeditorinput taskrepository bugzillatask bugzillatask bugzillatask gettaskid bugzillatask geturl bugtask bugzillatask updateoptions gettaskdata updateoptions getoldtaskdata override public boolean exists return true suppress warnings unchecked override public object get adapter class adapter return null suppresswarnings getadapter return returns the code bugzilla task code public bugzilla task get bug task return bug task bugzillatask bugzillatask getbugtask bugtask override public i persistable element get persistable return null ipersistableelement getpersistable override public string get tool tip text return bug title gettooltiptext bugtitle protected void set bug title string str 03 20 03 allows editor to store title once it is known bug title str setbugtitle bugtitle todo repository configuration update remove at some point private void update options repository task data task data try if task data null bugzilla repository connector bugzilla connector bugzilla repository connector tasks ui plugin get repository manager get repository connector bugzilla core plugin repository kind bugzilla connector update attribute options repository task data catch exception e ignore updateoptions repositorytaskdata taskdata taskdata bugzillarepositoryconnector bugzillaconnector bugzillarepositoryconnector tasksuiplugin getrepositorymanager getrepositoryconnector bugzillacoreplugin repository_kind bugzillaconnector updateattributeoptions taskdata override public boolean can create abstract repository query category return category instanceof bugzilla repository query cancreate abstractrepositoryquery bugzillarepositoryquery override public boolean can create abstract task task return task instanceof bugzilla task cancreate abstracttask bugzillatask override public abstract repository query create query string repository url string query string string label element element bugzilla repository query query new bugzilla repository query repository url query string label if element get node name equals tag bugzilla custom query query set custom query true return query abstractrepositoryquery createquery repositoryurl querystring bugzillarepositoryquery bugzillarepositoryquery repositoryurl querystring getnodename tag_bugzilla_custom_query setcustomquery override public abstract task create task string repository url string task id string summary element element bugzilla task task new bugzilla task repository url task id summary if element has attribute key severity task set severity element get attribute key severity if element has attribute key product task set product element get attribute key product return task abstracttask createtask repositoryurl taskid bugzillatask bugzillatask repositoryurl taskid hasattribute key_severity setseverity getattribute key_severity hasattribute key_product setproduct getattribute key_product override public string get query element name abstract repository query query if query instanceof bugzilla repository query if bugzilla repository query query is custom query return tag bugzilla custom query else return tag bugzilla query return null getqueryelementname abstractrepositoryquery bugzillarepositoryquery bugzillarepositoryquery iscustomquery tag_bugzilla_custom_query tag_bugzilla_query override public set string get query element names set string names new hash set string names add tag bugzilla query names add tag bugzilla custom query return names getqueryelementnames hashset tag_bugzilla_query tag_bugzilla_custom_query private static final string tag bugzilla report bugzilla report override public string get task element name return tag bugzilla report tag_bugzilla_report bugzillareport gettaskelementname tag_bugzilla_report override public void set additional attributes abstract task task element element element set attribute key severity bugzilla task task get severity element set attribute key product bugzilla task task get product setadditionalattributes abstracttask setattribute key_severity bugzillatask getseverity setattribute key_product bugzillatask getproduct override public void add pages if bugzilla repository query query is custom query page new bugzilla custom query wizard page repository bugzilla repository query query else page new bugzilla search page repository bugzilla repository query query add page page addpages bugzillarepositoryquery iscustomquery bugzillacustomquerywizardpage bugzillarepositoryquery bugzillasearchpage bugzillarepositoryquery addpage override public boolean can finish if page null page is page complete return true return false canfinish ispagecomplete public class edit bugzilla query wizard extends abstract edit query wizard public edit bugzilla query wizard task repository repository bugzilla repository query query super repository query editbugzillaquerywizard abstracteditquerywizard editbugzillaquerywizard taskrepository bugzillarepositoryquery override public void add pages page1 new bugzilla query type wizard page repository page1 set wizard this add page page1 addpages bugzillaquerytypewizardpage setwizard addpage override public boolean can finish if page1 get next page null page1 get next page is page complete return true return false canfinish getnextpage getnextpage ispagecomplete workspace modify operation op new workspace modify operation override protected void execute i progress monitor monitor throws core exception monitor begin task executing query 50 try abstract repository connector connector tasks ui plugin get repository manager get repository connector bugzilla core plugin repository kind tasks ui plugin get synchronization manager synchronize connector query category null true finally monitor done workspacemodifyoperation workspacemodifyoperation iprogressmonitor coreexception begintask abstractrepositoryconnector tasksuiplugin getrepositorymanager getrepositoryconnector bugzillacoreplugin repository_kind tasksuiplugin getsynchronizationmanager querycategory public new bugzilla query wizard task repository repository this repository repository set needs progress monitor true set window title title newbugzillaquerywizard taskrepository setneedsprogressmonitor setwindowtitle override public boolean perform finish abstract repository query page page if page1 get next page null page1 get next page instanceof abstract repository query page page abstract repository query page page1 get next page else return false final bugzilla repository query query category bugzilla repository query page get query tasks ui plugin get task list manager get task list add query query category workspace modify operation op new workspace modify operation override protected void execute i progress monitor monitor throws core exception monitor begin task executing query 50 try abstract repository connector connector tasks ui plugin get repository manager get repository connector bugzilla core plugin repository kind tasks ui plugin get synchronization manager synchronize connector query category null true finally monitor done try get container run true false op catch exception e status handler log e there was a problem executing the query refresh return true performfinish abstractrepositoryquerypage getnextpage getnextpage abstractrepositoryquerypage abstractrepositoryquerypage getnextpage bugzillarepositoryquery querycategory bugzillarepositoryquery getquery tasksuiplugin gettasklistmanager gettasklist addquery querycategory workspacemodifyoperation workspacemodifyoperation iprogressmonitor coreexception begintask abstractrepositoryconnector tasksuiplugin getrepositorymanager getrepositoryconnector bugzillacoreplugin repository_kind tasksuiplugin getsynchronizationmanager querycategory getcontainer statushandler escape all of the special regex characters from the string param s the string to escape the characters for return a string with all of the special characters escaped br code br br br br br br br br br br br br br br br code public static string escape for regex string s string s fixed s replace all special regex characters s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all s fixed s fixed replace all return s fixed escapeforregex sfixed sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed sfixed replaceall sfixed get the comment that this stack trace came from return returns the comment if it was a comment else a string if it was the summary public object get comment return comment getcomment get the length of the bug return returns the length public int get length return length getlength get the next at clause from a potential stack trace looks ahead 4 lines param lines the array of all of the lines in the bug param i the current position to start at param char pos the current character position in the original string return the next at clause or code null code br if an at line is matched but the end isn t within the 4 lines only the first line is returned also char pos is updated as well as i private static string get next at string lines int i int char pos string regex at string at string regex end string d int index i 0 string l1 l2 l3 l4 l1 l2 l3 l4 null string res null get the first line to look at if lines length index l1 lines index else if the first line doesn t exist we are done and should return return null get the next 3 lines if lines length index 1 l2 lines index 1 if lines length index 2 l3 lines index 2 if lines length index 3 l4 lines index 3 make sure that the first line is the start of an at if not return null if l1 trim matches regex at string char pos 0 l1 length 2 res l1 else return null now determine where the end is if it wasn t on 1 line if res trim matches regex end string if l2 null l2 trim matches regex end string it was on the second line update the current position and the result string i 0 index 1 char pos 0 l2 length 2 res l2 trim else if l2 null l3 null l3 trim matches regex end string it was on the third line update the current position and the result string i 0 index 2 char pos 0 l2 length l3 length 4 res l2 trim res l3 trim else if l2 null l3 null l4 null l4 trim matches regex end string it was on the fourth line update the current position and the result string i 0 index 3 char pos 0 l2 length l3 length l4 length 6 res l2 trim res l3 trim res l4 trim return the result return res charpos charpos getnextat charpos regexatstring regexendstring regexatstring charpos regexendstring regexendstring charpos regexendstring charpos regexendstring charpos get the offset for the stack trace return returns the offset public int get offset return offset getoffset get the stack trace for the bug return returns the stack trace public string get stack trace return stack trace stacktrace getstacktrace stacktrace find a standard java stack trace in the given string param s the string to search for stack traces param comment the comment that the text came from br comment if a comment else a string return string of stack traces each element is 1 trace public static stack trace get stack trace string s object comment setup the regex used to determine if it looks like we are at a stack trace and whether it is something that should be skipped string regex exception type exception error throwable string regex skip get all of the individual lines for the string string lines s split r n n the character start of the current stack trace int char stack start 0 the current character in the string used for the start and the offset int char pos 0 array so pass by reference boolean in stack trace false list string stack trace null list stack trace stack traces new array list stack trace go through each of the lines of the string for int i 0 i lines length i if lines i matches regex skip update the current character position char pos 0 lines i length 2 else if lines i trim matches regex exception type in stack trace we have matched the stack trace and we are not already in one add the old stack trace to the list of stack traces if stack trace null stack trace size 1 stack traces add get stack trace stack trace char stack start char pos 0 char stack start comment prepare for a new stack trace stack trace new array list string in stack trace true the current line is the start of our stack trace stack trace add lines i char stack start char pos 0 char pos 0 lines i length 2 else if in stack trace we are in a stack trace int pos i array so pass by reference get the next at clause of the stack trace string stack get next at lines pos char pos check if there was an at if stack null there wasn t so we are done this stack trace in stack trace false if stack trace null stack trace size 1 stack traces add get stack trace stack trace char stack start char pos 0 char stack start comment stack trace null else if stack trace null we had one so add it to this stack trace stack trace add stack update the position i pos 0 else update the current character position char pos 0 lines i length 2 make sure to add the stack trace if it was the last in the string if stack trace null stack trace size 1 stack traces add get stack trace stack trace char stack start char pos 0 char stack start comment if stack traces size 0 return null get the string values of the stack traces and return it return get traces from list stack traces stacktrace getstacktrace regexexceptiontype regexskip charstackstart charpos instacktrace stacktrace stacktrace stacktraces arraylist stacktrace regexskip charpos regexexceptiontype instacktrace stacktrace stacktrace stacktraces getstacktrace stacktrace charstackstart charpos charstackstart stacktrace arraylist instacktrace stacktrace charstackstart charpos charpos instacktrace getnextat charpos instacktrace stacktrace stacktrace stacktraces getstacktrace stacktrace charstackstart charpos charstackstart stacktrace stacktrace stacktrace charpos stacktrace stacktrace stacktraces getstacktrace stacktrace charstackstart charpos charstackstart stacktraces gettracesfromlist stacktraces get the stack trace param l the list of lines that contain the trace param start the start of the stack trace param offset the offset of the stack trace param comment the comment that the stack trace came from return the stack trace for the given data private static stack trace get stack trace list string l int offset int length object comment string s for string s2 l s s2 r n return new stack trace s offset length comment stacktrace stacktrace stacktrace getstacktrace stacktrace convert a list stack traces to a stack trace br param l the list of stack traces return stack trace of the list private static stack trace get traces from list list stack trace l make sure that there is something to convert else return null if l null l size 0 return null convert the list of strings to an array of strings int i 0 stack trace s new stack trace l size for stack trace st l s i st i return the string array return s stacktraces stacktrace stacktraces stacktrace stacktrace gettracesfromlist stacktrace stacktrace stacktrace stacktrace constructor param stack trace the stack trace string param offset the offset of the stack trace in the original string param length the length of the stack trace in the original string param comment the comment that the stack trace came from public stack trace string stack trace int offset int length object comment this stack trace stack trace this offset offset this length length this comment comment stacktrace stacktrace stacktrace stacktrace stacktrace applies the status to the status line of a dialog page param status the status to apply to the status line protected void apply to status line i status status string message status get message if message length 0 message null switch status get severity case i status ok set error message null set message message break case i status warning set error message null set message message wizard page warning break case i status info set error message null set message message wizard page information break default set error message null set message message wizard page error break applytostatusline istatus getmessage getseverity istatus seterrormessage setmessage istatus seterrormessage setmessage wizardpage istatus seterrormessage setmessage wizardpage seterrormessage setmessage wizardpage constructor for bugzilla product page param workbench the instance of the workbench param bug wiz the bug wizard which created this page param repository the repository the data is coming from param selection public bugzilla product page i workbench workbench new bugzilla task wizard bug wiz task repository repository super page1 set title i bugzilla constants title new bug set description description this workbench workbench this bug wizard bug wiz this repository repository set image descriptor bugzilla ui plugin image descriptor from plugin org eclipse mylyn bugzilla ui icons wizban bug wizard gif bugzillaproductpage bugwiz bugzillaproductpage iworkbench newbugzillataskwizard bugwiz taskrepository settitle ibugzillaconstants title_new_bug setdescription bugwizard bugwiz setimagedescriptor bugzillauiplugin imagedescriptorfromplugin public void create control composite parent create the composite to hold the widgets composite composite new composite parent swt null create the desired layout for this wizard page composite set layout new grid layout create the list of bug reports product list new filtered tree composite swt single swt border new pattern filter product list set layout data grid data factory swt defaults align swt fill swt fill grab true true hint swt default 200 create final tree viewer product viewer product list get viewer product viewer set label provider new label provider product viewer set content provider new i tree content provider public object get children object parent element if parent element instanceof collection return collection parent element to array return null public object get parent object element return null public boolean has children object element return false public object get elements object input element return get children input element public void dispose public void input changed viewer viewer object old input object new input init products product viewer set input products product viewer add post selection changed listener new i selection changed listener public void selection changed selection changed event event initialize a variable with the no error status status status new status i status ok bugzilla ui plugin plugin id 0 null if product viewer get selection is empty status new status i status error bugzilla ui plugin plugin id 0 you must select a product null show the most serious error apply to status line status is page complete get wizard get container update buttons hack waiting on delayed refresh of filtered tree final string selected products get selected products if selected products length 0 new ui job override public i status run inui thread i progress monitor monitor product viewer set selection new structured selection selected products true product viewer get control set focus return status ok status schedule 300l else product list set focus button update button new button composite swt left swt push update button set text label update update button set layout data new grid data update button add selection listener new selection adapter override public void widget selected selection event e try final abstract repository connector connector tasks ui plugin get repository manager get repository connector repository get connector kind get container run true false new i runnable with progress public void run i progress monitor monitor throws invocation target exception interrupted exception monitor begin task updating repository report options i progress monitor unknown try connector update attributes repository monitor catch core exception ce if ce get status get exception instanceof general security exception status handler fail ce bugzilla could not log you in to get the information you requested since login name or password is incorrect n please ensure proper configuration in tasks ui plugin label view repositories true else if ce get status get exception instanceof io exception status handler fail ce connection error please ensure proper configuration in tasks ui plugin label view repositories true else status handler fail ce error updating repository attributes for repository get url true return bugzilla ui plugin update query options repository monitor products new array list string for string product bugzilla ui plugin get query options i bugzilla constants values product null repository get url products add product product viewer set input products catch invocation target exception ex message dialog open error null error updating product list error reported n ex get cause get message catch interrupted exception ex was cancelled set the composite as the control for this page set control composite is page complete get wizard get container update buttons createcontrol setlayout gridlayout productlist filteredtree patternfilter productlist setlayoutdata griddatafactory swtdefaults treeviewer productviewer productlist getviewer productviewer setlabelprovider labelprovider productviewer setcontentprovider itreecontentprovider getchildren parentelement parentelement parentelement toarray getparent haschildren getelements inputelement getchildren inputelement inputchanged oldinput newinput initproducts productviewer setinput productviewer addpostselectionchangedlistener iselectionchangedlistener selectionchanged selectionchangedevent istatus bugzillauiplugin plugin_id productviewer getselection isempty istatus bugzillauiplugin plugin_id applytostatusline ispagecomplete getwizard getcontainer updatebuttons selectedproducts getselectedproducts selectedproducts uijob istatus runinuithread iprogressmonitor productviewer setselection structuredselection selectedproducts productviewer getcontrol setfocus ok_status productlist setfocus updatebutton updatebutton settext label_update updatebutton setlayoutdata griddata updatebutton addselectionlistener selectionadapter widgetselected selectionevent abstractrepositoryconnector tasksuiplugin getrepositorymanager getrepositoryconnector getconnectorkind getcontainer irunnablewithprogress iprogressmonitor invocationtargetexception interruptedexception begintask iprogressmonitor updateattributes coreexception getstatus getexception generalsecurityexception statushandler tasksuiplugin label_view_repositories getstatus getexception ioexception statushandler tasksuiplugin label_view_repositories statushandler geturl bugzillauiplugin updatequeryoptions arraylist bugzillauiplugin getqueryoptions ibugzillaconstants values_product geturl productviewer setinput invocationtargetexception messagedialog openerror getcause getmessage interruptedexception setcontrol ispagecomplete getwizard getcontainer updatebuttons public void dispose public object get children object parent element if parent element instanceof collection return collection parent element to array return null getchildren parentelement parentelement parentelement toarray public object get elements object input element return get children input element getelements inputelement getchildren inputelement public object get parent object element return null getparent private string get selected products i structured selection selection get selection if selection null return new string 0 array list string products new array list string object element selection get first element if element instanceof bugzilla task bugzilla task bugzilla task bugzilla task element if bugzilla task get product null products add bugzilla task get product else bugzilla repository query query null if element instanceof bugzilla repository query query bugzilla repository query element if query null string query url query get url query url query url substring query url index of 1 string options query url split for string option options string key option substring 0 option index of if product equals key try products add url decoder decode option substring option index of 1 repository get character encoding todo list box only accepts a single selection so we break on first found break catch unsupported encoding exception ex ignore else if element instanceof i adaptable i adaptable adaptable i adaptable element abstract task task abstract task adaptable get adapter abstract task class if task instanceof bugzilla task bugzilla task bugzilla task bugzilla task task if bugzilla task get product null products add bugzilla task get product return products to array new string products size getselectedproducts istructuredselection getselection arraylist arraylist getfirstelement bugzillatask bugzillatask bugzillatask bugzillatask bugzillatask getproduct bugzillatask getproduct bugzillarepositoryquery bugzillarepositoryquery bugzillarepositoryquery queryurl geturl queryurl queryurl queryurl indexof queryurl indexof urldecoder indexof getcharacterencoding unsupportedencodingexception iadaptable iadaptable iadaptable abstracttask abstracttask getadapter abstracttask bugzillatask bugzillatask bugzillatask bugzillatask bugzillatask getproduct bugzillatask getproduct toarray private i structured selection get selection i workbench window window platformui get workbench get active workbench window i selection selection window get selection service get selection if selection instanceof i structured selection return i structured selection selection return null istructuredselection getselection iworkbenchwindow getworkbench getactiveworkbenchwindow iselection getselectionservice getselection istructuredselection istructuredselection public boolean has children object element return false haschildren private void init products try to get the list of products from the server try products bugzilla core plugin get repository configuration repository false get products catch final core exception e platformui get workbench get display async exec new runnable public void run message dialog open error display get default get active shell new bugzilla task error title unable to get products ensure proper repository configuration in tasks ui plugin label view repositories n n initproducts bugzillacoreplugin getrepositoryconfiguration getproducts coreexception getworkbench getdisplay asyncexec messagedialog openerror getdefault getactiveshell new_bugzilla_task_error_title tasksuiplugin label_view_repositories public void input changed viewer viewer object old input object new input inputchanged oldinput newinput override public boolean is page complete bug wizard completed product list get viewer get selection is empty return bug wizard completed ispagecomplete bugwizard productlist getviewer getselection isempty bugwizard platformui get workbench get display async exec new runnable public void run message dialog open error display get default get active shell new bugzilla task error title unable to get products ensure proper repository configuration in tasks ui plugin label view repositories n n getworkbench getdisplay asyncexec messagedialog openerror getdefault getactiveshell new_bugzilla_task_error_title tasksuiplugin label_view_repositories get container run true false new i runnable with progress public void run i progress monitor monitor throws invocation target exception interrupted exception monitor begin task updating repository report options i progress monitor unknown try connector update attributes repository monitor catch core exception ce if ce get status get exception instanceof general security exception status handler fail ce bugzilla could not log you in to get the information you requested since login name or password is incorrect n please ensure proper configuration in tasks ui plugin label view repositories true else if ce get status get exception instanceof io exception status handler fail ce connection error please ensure proper configuration in tasks ui plugin label view repositories true else status handler fail ce error updating repository attributes for repository get url true return bugzilla ui plugin update query options repository monitor products new array list string for string product bugzilla ui plugin get query options i bugzilla constants values product null repository get url products add product getcontainer irunnablewithprogress iprogressmonitor invocationtargetexception interruptedexception begintask iprogressmonitor updateattributes coreexception getstatus getexception generalsecurityexception statushandler tasksuiplugin label_view_repositories getstatus getexception ioexception statushandler tasksuiplugin label_view_repositories statushandler geturl bugzillauiplugin updatequeryoptions arraylist bugzillauiplugin getqueryoptions ibugzillaconstants values_product geturl new ui job override public i status run inui thread i progress monitor monitor product viewer set selection new structured selection selected products true product viewer get control set focus return status ok status uijob istatus runinuithread iprogressmonitor productviewer setselection structuredselection selectedproducts productviewer getcontrol setfocus ok_status save the currently selected product to the task data when next is clicked public void save data to model throws core exception repository task data model bug wizard task data model set attribute value bugzilla report element product get key string string i structured selection product list get viewer get selection get first element bugzilla repository connector setup new bug attributes repository model bugzilla core plugin get default set platform options model taskdata savedatatomodel coreexception repositorytaskdata bugwizard taskdata setattributevalue bugzillareportelement getkeystring istructuredselection productlist getviewer getselection getfirstelement bugzillarepositoryconnector setupnewbugattributes bugzillacoreplugin getdefault setplatformoptions public void selection changed selection changed event event initialize a variable with the no error status status status new status i status ok bugzilla ui plugin plugin id 0 null if product viewer get selection is empty status new status i status error bugzilla ui plugin plugin id 0 you must select a product null show the most serious error apply to status line status is page complete get wizard get container update buttons selectionchanged selectionchangedevent istatus bugzillauiplugin plugin_id productviewer getselection isempty istatus bugzillauiplugin plugin_id applytostatusline ispagecomplete getwizard getcontainer updatebuttons override public void widget selected selection event e try final abstract repository connector connector tasks ui plugin get repository manager get repository connector repository get connector kind get container run true false new i runnable with progress public void run i progress monitor monitor throws invocation target exception interrupted exception monitor begin task updating repository report options i progress monitor unknown try connector update attributes repository monitor catch core exception ce if ce get status get exception instanceof general security exception status handler fail ce bugzilla could not log you in to get the information you requested since login name or password is incorrect n please ensure proper configuration in tasks ui plugin label view repositories true else if ce get status get exception instanceof io exception status handler fail ce connection error please ensure proper configuration in tasks ui plugin label view repositories true else status handler fail ce error updating repository attributes for repository get url true return bugzilla ui plugin update query options repository monitor products new array list string for string product bugzilla ui plugin get query options i bugzilla constants values product null repository get url products add product product viewer set input products catch invocation target exception ex message dialog open error null error updating product list error reported n ex get cause get message catch interrupted exception ex was cancelled widgetselected selectionevent abstractrepositoryconnector tasksuiplugin getrepositorymanager getrepositoryconnector getconnectorkind getcontainer irunnablewithprogress iprogressmonitor invocationtargetexception interruptedexception begintask iprogressmonitor updateattributes coreexception getstatus getexception generalsecurityexception statushandler tasksuiplugin label_view_repositories getstatus getexception ioexception statushandler tasksuiplugin label_view_repositories statushandler geturl bugzillauiplugin updatequeryoptions arraylist bugzillauiplugin getqueryoptions ibugzillaconstants values_product geturl productviewer setinput invocationtargetexception messagedialog openerror getcause getmessage interruptedexception override public void add pages super add pages add page product page addpages addpages addpage productpage override public boolean can finish return completed canfinish public void init i workbench workbench i structured selection selection this workbench instance workbench iworkbench istructuredselection workbenchinstance public new bugzilla task wizard task repository repository this false repository task data new repository task data new bugzilla attribute factory bugzilla core plugin repository kind repository get url tasks ui plugin get default get next new repository task id task data set new true super set default page image descriptor bugzilla ui plugin image descriptor from plugin org eclipse mylyn internal bugzilla ui icons wizban bug wizard gif super set window title title set needs progress monitor true newbugzillataskwizard taskrepository taskdata repositorytaskdata bugzillaattributefactory bugzillacoreplugin repository_kind geturl tasksuiplugin getdefault getnextnewrepositorytaskid taskdata setnew setdefaultpageimagedescriptor bugzillauiplugin imagedescriptorfromplugin setwindowtitle setneedsprogressmonitor public new bugzilla task wizard boolean from dialog task repository repository super this repository repository this product page new bugzilla product page workbench instance this repository newbugzillataskwizard fromdialog taskrepository productpage bugzillaproductpage workbenchinstance override public boolean perform finish try product page save data to model new task editor input editor input new new task editor input repository task data i workbench page page platformui get workbench get active workbench window get active page tasks ui util open editor editor input task editor id editor page return true catch exception e product page apply to status line new status i status error not used 0 problem occurred retrieving repository configuration from repository get url null return false performfinish productpage savedatatomodel newtaskeditorinput editorinput newtaskeditorinput taskdata iworkbenchpage getworkbench getactiveworkbenchwindow getactivepage tasksuiutil openeditor editorinput taskeditor id_editor productpage applytostatusline istatus not_used geturl