Source Code Cross Referenced for TaskSessionBackingBean.java in  » Portal » Open-Portal » com » sun » portal » app » sharedtasks » faces » beans » 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 » Portal » Open Portal » com.sun.portal.app.sharedtasks.faces.beans 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.sun.portal.app.sharedtasks.faces.beans;
002:
003:        import java.util.Map;
004:
005:        import com.sun.portal.app.sharedtasks.util.SharedConstants;
006:        import com.sun.portal.log.common.PortalLogger;
007:        import java.util.logging.Logger;
008:
009:        import javax.faces.context.FacesContext;
010:        import javax.portlet.PortletRequest;
011:        import javax.portlet.PortletSession;
012:
013:        /**
014:         * Backing bean for task details page session info.
015:         *
016:         * @author ashwin.mathew@sun.com
017:         */
018:        public class TaskSessionBackingBean {
019:
020:            public static final String BEAN_NAME = "TaskSessionBean";
021:
022:            private String taskId;
023:
024:            private String taskRid;
025:
026:            private Boolean isEdit = Boolean.FALSE;
027:
028:            private boolean isCommSearchResultRequested = false;
029:
030:            private static Logger logger = PortalLogger
031:                    .getLogger(TaskSessionBackingBean.class);
032:
033:            private static final String PAGE_NEW_TASK = "newTask";
034:            private static final String PAGE_EDIT_TASK = "editTask";
035:
036:            public String getTaskId() {
037:                return taskId;
038:            }
039:
040:            public void setTaskId(String taskId) {
041:                this .taskId = taskId;
042:            }
043:
044:            public String getTaskRid() {
045:                return taskRid;
046:            }
047:
048:            public void setTaskRid(String taskRid) {
049:                this .taskRid = taskRid;
050:            }
051:
052:            public Boolean getIsEdit() {
053:                return isEdit;
054:            }
055:
056:            public void setIsEdit(Boolean isEdit) {
057:                this .isEdit = isEdit;
058:                if (isEdit == Boolean.FALSE) {
059:                    isCommSearchResultRequested = false;
060:                }
061:            }
062:
063:            public String setNewTask() {
064:                setIsEdit(Boolean.FALSE);
065:                setTaskId(null);
066:                setTaskRid(null);
067:
068:                return PAGE_NEW_TASK;
069:            }
070:
071:            public String setEditTask() {
072:                setIsEdit(Boolean.TRUE);
073:
074:                FacesContext context = FacesContext.getCurrentInstance();
075:
076:                Map requestMap = context.getExternalContext()
077:                        .getRequestParameterMap();
078:                String tempTaskId = (String) requestMap
079:                        .get(SharedConstants.REQ_PARAM_TASKID);
080:                if (tempTaskId != null) {
081:                    taskId = tempTaskId;
082:                    taskRid = (String) requestMap
083:                            .get(SharedConstants.REQ_PARAM_TASKRID);
084:                }
085:
086:                logger.fine("Editing task, id [" + taskId + "], rid ["
087:                        + taskRid + "]");
088:
089:                return PAGE_EDIT_TASK;
090:            }
091:
092:            private static Object getPortletSessionAttribute(String key) {
093:                FacesContext context = FacesContext.getCurrentInstance();
094:                Object pReq = context.getExternalContext().getRequest();
095:                if (pReq instanceof  PortletRequest) {
096:                    PortletSession pSession = ((PortletRequest) pReq)
097:                            .getPortletSession();
098:                    if (pSession != null) {
099:                        return pSession.getAttribute(key);
100:                    }
101:                }
102:                return null;
103:            }
104:
105:            private static void removePortletSessionAttribute(String key) {
106:                FacesContext context = FacesContext.getCurrentInstance();
107:                Object pReq = context.getExternalContext().getRequest();
108:                if (pReq instanceof  PortletRequest) {
109:                    PortletSession pSession = ((PortletRequest) pReq)
110:                            .getPortletSession();
111:                    if (pSession != null) {
112:                        pSession.removeAttribute(key);
113:                    }
114:                }
115:            }
116:
117:            private boolean checkPortletSessionForSearchResult() {
118:                String searchSt = (String) getPortletSessionAttribute(SharedConstants.URL_COMM_SEARCH_TASKS);
119:                if ((searchSt != null)
120:                        && (Boolean.valueOf(searchSt) == Boolean.TRUE)) {
121:                    taskId = (String) getPortletSessionAttribute(SharedConstants.REQ_PARAM_TASKID);
122:                    taskRid = (String) getPortletSessionAttribute(SharedConstants.REQ_PARAM_TASKRID);
123:                    setIsEdit(Boolean.TRUE);
124:                    isCommSearchResultRequested = true;
125:                    removePortletSessionAttribute(SharedConstants.URL_COMM_SEARCH_TASKS);
126:                    removePortletSessionAttribute(SharedConstants.REQ_PARAM_TASKID);
127:                    removePortletSessionAttribute(SharedConstants.REQ_PARAM_TASKRID);
128:                }
129:                return isCommSearchResultRequested;
130:
131:            }
132:
133:            public boolean isSearchResultRequested() {
134:                checkPortletSessionForSearchResult();
135:                logger.exiting(TaskSessionBackingBean.BEAN_NAME,
136:                        "isSearchResultRequested()="
137:                                + isCommSearchResultRequested);
138:                return isCommSearchResultRequested;
139:            }
140:
141:            /*
142:             * This is just a mechanism to invoke isSearchResultRequested
143:             * it is used at those places, where it expectes a return of true.
144:             * 
145:             */
146:
147:            public boolean isShowTaskDetail() {
148:                isSearchResultRequested();
149:                return true;
150:            }
151:
152:        }
w_w_w___.___j___a_va2___s___._c__o__m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.