1 19 package org.netbeans.modules.exceptions.web; 20 21 import java.net.URLEncoder ; 22 import javax.persistence.EntityManagerFactory; 23 import javax.persistence.Persistence; 24 import javax.servlet.jsp.tagext.*; 25 import javax.servlet.jsp.JspWriter ; 26 import javax.servlet.jsp.JspException ; 27 import org.netbeans.modules.exceptions.entity.Issue; 28 29 34 35 public class IssuezillaHandler extends SimpleTagSupport { 36 37 public static final String ISSUEZILLA_DETAIL = "http://www.netbeans.org/issues/show_bug.cgi?id="; 38 public static final String ISSUEZILLA_ENTER_BUG = "izredirect?"; 39 public static final String EXCEPTION_DETAIL = "http://anna.nbextras.org/exceptions/detail.do?id="; 41 42 private String id; 43 private Issue issue; 44 45 public void doTag() throws JspException { 46 47 JspWriter out=getJspContext().getOut(); 48 49 try { 50 if (issue != null) { 51 Integer issuezillaId = issue.getIssuezillaid(); 52 if (issuezillaId.intValue() == 0) { 53 out.print("<A HREF='"); 54 55 out.print(ISSUEZILLA_ENTER_BUG + "component=" + URLEncoder.encode(issue.getComponent())); 56 out.print("&subcomponent=" + URLEncoder.encode(issue.getSubcomponent())); 57 out.print("&comment=" + URLEncoder.encode("\n\nDON'T DELETE THIS TEXT:\n" 58 + EXCEPTION_DETAIL + issue.getId() + 59 "\nBuild: " + issue.getProductversion() + 60 "\nVM: " + issue.getVm() + 61 "\nOS: " + issue.getOperatingsystem())); 62 out.print("&short_desc=" + URLEncoder.encode(issue.getSummary())); 63 out.print("&version=6.0"); 64 out.print("&exceptionsid=" + issue.getId()); 65 out.println("'>enter</A>"); 66 67 } else { 68 out.print("<A HREF='"); 69 out.print(ISSUEZILLA_DETAIL + issuezillaId); 70 out.println("'>" + issue.getIssuezillaid() + "</A>"); 71 } 72 } 73 74 JspFragment f=getJspBody(); 75 if (f != null) f.invoke(out); 76 77 } catch (java.io.IOException ex) { 78 throw new JspException (ex.getMessage()); 79 } 80 81 } 82 83 public void setId(String id) { 84 this.id = id; 85 } 86 87 public void setIssue(Issue issue) { 88 this.issue = issue; 89 } 90 91 } 92 | Popular Tags |