Source Code Cross Referenced for ViewBugDetails.java in  » Issue-Tracking » javafreedom-bugtracker » com » espada » bugtracker » servlets » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Issue Tracking » javafreedom bugtracker » com.espada.bugtracker.servlets 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:        ====================================================================
003:        Project Name: bugtracker
004:        File Name: /src/com/espada/bugtracker/servlets/ViewBugDetails.java
005:        Author: Kishan Peiris <kishan@espadanet.com>
006:        Description: View bug details
007:        CVS Repository: goliath:/projects/repository/cvsroot/
008:        CVS Module: bugtracker
009:        Version: CVS $Id: $
010:        ====================================================================
011:         */
012:
013:        package com.espada.bugtracker.servlets;
014:
015:        import com.sr.espada.se.util.config.*;
016:        import com.sr.espada.se.util.logwriter.*;
017:        import com.sr.espada.se.util.mail.*;
018:
019:        // webmacro resources
020:        import org.webmacro.*;
021:        import org.webmacro.broker.*;
022:        import org.webmacro.resource.*;
023:        import org.webmacro.servlet.WebContext;
024:
025:        // servlet libraries
026:        import javax.servlet.http.*;
027:        import javax.servlet.*;
028:
029:        // java library
030:        import javax.mail.MessagingException;
031:        import java.util.*;
032:
033:        // bugtracker java apps
034:        import com.espada.bugtracker.app.*;
035:
036:        public class ViewBugDetails extends BTServlet {
037:
038:            /** the default template to use **/
039:            public String getInitialTemplate() {
040:                return ("viewBug.wm");
041:            }
042:
043:            protected void doAction(HttpServletRequest request,
044:                    HttpServletResponse response, WebContext c) {
045:                bugDetails(request, response, c);
046:            }
047:
048:            /**************************** Start Of Method bugDetails ********************************************/
049:            /** View bug details of a selected project */
050:
051:            public void bugDetails(HttpServletRequest request,
052:                    HttpServletResponse response, WebContext c) {
053:                HttpSession session = request.getSession();
054:
055:                String SuccessLoggedIn = (String) session
056:                        .getAttribute("loggedIn");
057:
058:                boolean loggedIn = false;
059:                String update = new String();
060:
061:                if (SuccessLoggedIn != null) {
062:                    if (SuccessLoggedIn.equals("true")) {
063:                        defaultTemplate = "viewBug.wm";
064:
065:                        loggedIn = true;
066:
067:                        c.put("USER", session.getAttribute("USER"));
068:
069:                        c.put("currentProject", session
070:                                .getAttribute("currentProject"));
071:
072:                        c.put("waite", String.valueOf(session
073:                                .getAttribute("page")));
074:
075:                        /*******************************************************************************************/
076:                        /*******************
077:                         Creating bug severity array of objects
078:                         ********************/
079:
080:                        Vector sev = Severity.getSeverities(); //vector of severity
081:
082:                        /*******************************************************************************************/
083:                        /*******************
084:                         Creating bug status array of objects
085:                         ********************/
086:
087:                        Vector stv = Status.getStatusList(false);
088:
089:                        /*******************************************************************************************/
090:                        /*******************
091:                         Required parameters from WebMacro file
092:                         *******************/
093:
094:                        Bug b = new Bug(Integer.parseInt(request
095:                                .getParameter("bid")));
096:
097:                        String To = request.getParameter("repby");
098:                        String repEmail = request.getParameter("repemail");
099:                        String solution = request.getParameter("solution");
100:                        String title = request.getParameter("title");
101:
102:                        String emailSolution = new String();
103:                        String senderEmail = (String) session
104:                                .getAttribute("EMAIL");
105:                        String senderName = (String) session
106:                                .getAttribute("USER");
107:
108:                        c.put("b", b);
109:                        c.put("pros", sev);
110:                        c.put("statObj", stv);
111:                        c.put("RoleID", (String) session.getAttribute("PUR"));
112:
113:                        LogWriter.write("Add value : "
114:                                + request.getParameter("add"));
115:
116:                        /*if(request.getParameter("removeBug") != null)
117:                        {
118:                           if( b.delete() )
119:                           {
120:                                defaultTemplate = "errorMesg.wm";
121:                                c.put("errorId","22");
122:                           }
123:                        }
124:                        else */
125:
126:                        if (request.getParameter("add") != null) {
127:                            b.detail = request.getParameter("description");
128:                            b.reproduced = (request
129:                                    .getParameter("reproducable") != null);
130:                            b.bugURL = request.getParameter("bugURL");
131:                            b.browserVersion = request
132:                                    .getParameter("browserVersion");
133:                            b.status = new Status(Integer.parseInt(request
134:                                    .getParameter("status")));
135:                            b.severity = new Severity(Integer.parseInt(request
136:                                    .getParameter("severity")));
137:
138:                            update = b.update();
139:
140:                            if (update != null) {
141:                                c.put("errorId", "12");
142:
143:                                defaultTemplate = "errorMesg.wm";
144:                                LogWriter.write("Role is "
145:                                        + session.getAttribute("PUR"));
146:
147:                                if (!solution.equals("Empty")) {
148:
149:                                    emailSolution = "Hello.\n\nYour bug details at BUGTRACKER is as follows:\nBug ID          :"
150:                                            + b.bid
151:                                            + "\n\nBug Description :"
152:                                            + request
153:                                                    .getParameter("description")
154:                                            + "\n\nSolution        :"
155:                                            + solution + "\n\nThank you.";
156:
157:                                    try {
158:                                        SimpleEmail SE = new SimpleEmail(
159:                                                ConfigFactory.getInstance());
160:                                        SE.setMsg(emailSolution);
161:                                        SE.setFrom(senderEmail,
162:                                                "BUGTRACKER APPLICATION :"
163:                                                        + senderName);
164:
165:                                        //no-reply@infomutual.com", "BUGTRACKER APPLICATION"
166:
167:                                        SE.addTo(repEmail, To);
168:                                        SE.setSubject("Solution to a bug");
169:                                        SE.send();
170:
171:                                        c.put("repTo", To);
172:                                        c.put("errorId", "15");
173:                                    } catch (MessagingException e) {
174:                                        c.put("errorId", "5");
175:                                    } catch (ConfigFileMissingException ex) {
176:                                        System.out.println("File Missing....!");
177:                                    }
178:
179:                                    c.put("repTo", To);
180:                                    c.put("errorId", "15");
181:                                }
182:
183:                            }
184:
185:                        }
186:
187:                    } else {
188:                        loggedIn = false;
189:
190:                        defaultTemplate = "errorMesg.wm";
191:
192:                        c.put("errorId", "9");
193:                    }
194:                } else {
195:                    loggedIn = false;
196:
197:                    defaultTemplate = "errorMesg.wm";
198:
199:                    c.put("errorId", "9");
200:                }
201:
202:                c.put("loggedIn", String.valueOf(loggedIn));
203:                c.put("update", update);
204:                c.put("myRoleId", session.getAttribute("USERROLE"));
205:
206:            } //end of method
207:
208:            public void deleteAbug(HttpServletRequest request,
209:                    HttpServletResponse response, WebContext c) {
210:                HttpSession session = request.getSession();
211:
212:                String SuccessLoggedIn = (String) session
213:                        .getAttribute("loggedIn");
214:
215:                boolean loggedIn = false;
216:                String update = new String();
217:
218:                if (SuccessLoggedIn != null) {
219:                    if (SuccessLoggedIn.equals("true")) {
220:                        defaultTemplate = "viewBug.wm";
221:
222:                        loggedIn = true;
223:
224:                        c.put("USER", session.getAttribute("USER"));
225:
226:                        c.put("currentProject", session
227:                                .getAttribute("currentProject"));
228:
229:                        c.put("waite", String.valueOf(session
230:                                .getAttribute("page")));
231:
232:                        Bug b = new Bug(Integer.parseInt(request
233:                                .getParameter("bid")));
234:
235:                        if (b.delete()) {
236:                            defaultTemplate = "errorMesg.wm";
237:                            c.put("errorId", "22");
238:                        }
239:
240:                    } else {
241:                        loggedIn = false;
242:
243:                        defaultTemplate = "errorMesg.wm";
244:
245:                        c.put("errorId", "9");
246:                    }
247:                } else {
248:                    loggedIn = false;
249:
250:                    defaultTemplate = "errorMesg.wm";
251:
252:                    c.put("errorId", "9");
253:                }
254:
255:                c.put("loggedIn", String.valueOf(loggedIn));
256:                c.put("myRoleId", session.getAttribute("USERROLE"));
257:
258:            } //end of method
259:            /**************************** End Of Method bugDetails ********************************************/
260:
261:        } //end of class
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.