Source Code Cross Referenced for PollOptionDeleteProducer.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » poll » tool » producers » 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 » ERP CRM Financial » sakai » org.sakaiproject.poll.tool.producers 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL: $
003:         * $Id:  $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2006,2007 The Sakai Foundation.
007:         * 
008:         * Licensed under the Educational Community License, Version 1.0 (the "License"); 
009:         * you may not use this file except in compliance with the License. 
010:         * You may obtain a copy of the License at
011:         * 
012:         *      http://www.opensource.org/licenses/ecl1.php
013:         * 
014:         * Unless required by applicable law or agreed to in writing, software 
015:         * distributed under the License is distributed on an "AS IS" BASIS, 
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
017:         * See the License for the specific language governing permissions and 
018:         * limitations under the License.
019:         *
020:         **********************************************************************************/package org.sakaiproject.poll.tool.producers;
021:
022:        import org.apache.commons.logging.Log;
023:        import org.apache.commons.logging.LogFactory;
024:
025:        import uk.org.ponder.messageutil.MessageLocator;
026:        import uk.org.ponder.rsf.components.UIContainer;
027:        import uk.org.ponder.rsf.components.UIELBinding;
028:        import uk.org.ponder.rsf.components.UIOutput;
029:        import uk.org.ponder.rsf.components.UIInternalLink;
030:        import uk.org.ponder.rsf.components.UIForm;
031:        import uk.org.ponder.rsf.components.UICommand;
032:
033:        import uk.org.ponder.rsf.view.ComponentChecker;
034:        import uk.org.ponder.rsf.view.ViewComponentProducer;
035:        import uk.org.ponder.rsf.viewstate.ViewParameters;
036:
037:        import org.sakaiproject.poll.logic.PollListManager;
038:        import org.sakaiproject.poll.model.VoteCollection;
039:        import org.sakaiproject.poll.model.Poll;
040:        import org.sakaiproject.poll.model.Option;
041:        import org.sakaiproject.poll.tool.params.VoteBean;
042:
043:        import uk.org.ponder.rsf.flow.jsfnav.NavigationCase;
044:        import uk.org.ponder.rsf.flow.jsfnav.NavigationCaseReporter;
045:        import uk.org.ponder.rsf.viewstate.ViewParamsReporter;
046:        import uk.org.ponder.rsf.viewstate.SimpleViewParameters;
047:        import uk.org.ponder.rsf.viewstate.EntityCentredViewParameters;
048:        import uk.org.ponder.localeutil.LocaleGetter;
049:        import uk.org.ponder.rsf.components.UIInput;
050:        import uk.org.ponder.beanutil.entity.EntityID;
051:
052:        import java.util.List;
053:        import java.util.ArrayList;
054:
055:        public class PollOptionDeleteProducer implements  ViewComponentProducer,
056:                NavigationCaseReporter, ViewParamsReporter {
057:            //,
058:            public static final String VIEW_ID = "pollOptionDelete";
059:            private static Log m_log = LogFactory
060:                    .getLog(PollOptionDeleteProducer.class);
061:            private VoteBean voteBean;
062:
063:            private MessageLocator messageLocator;
064:            private LocaleGetter localegetter;
065:
066:            public String getViewID() {
067:
068:                return VIEW_ID;
069:            }
070:
071:            public void setVoteBean(VoteBean vb) {
072:                this .voteBean = vb;
073:            }
074:
075:            public void setMessageLocator(MessageLocator messageLocator) {
076:
077:                this .messageLocator = messageLocator;
078:            }
079:
080:            public void setLocaleGetter(LocaleGetter localegetter) {
081:                this .localegetter = localegetter;
082:            }
083:
084:            private PollListManager pollListManager;
085:
086:            public void setPollListManager(PollListManager p) {
087:                this .pollListManager = p;
088:            }
089:
090:            public void fillComponents(UIContainer tofill,
091:                    ViewParameters viewparams, ComponentChecker arg2) {
092:                m_log.info("rendering view");
093:                Poll poll = null;
094:                Option option = null;
095:                UIOutput.make(tofill, "confirm_delete", messageLocator
096:                        .getMessage("delete_confirm"));
097:                UIOutput.make(tofill, "error", messageLocator
098:                        .getMessage("delete_option_message"));
099:                EntityCentredViewParameters ecvp = (EntityCentredViewParameters) viewparams;
100:                if (poll == null || ecvp != null) {
101:                    //check the ecvp
102:
103:                    String strId = ecvp.getELPath().substring(
104:                            ecvp.getELPath().indexOf(".") + 1);
105:                    String type = strId.substring(0, strId.indexOf('_'));
106:                    String id = strId.substring(strId.indexOf('_') + 1);
107:                    m_log.debug("got id of " + strId);
108:                    if (type.equals("Poll")) {
109:                        poll = pollListManager.getPollById(new Long(id));
110:                    } else {
111:                        option = pollListManager.getOptionById(new Long(id));
112:                        poll = pollListManager.getPollById(option.getPollId());
113:                    }
114:                }
115:                UIOutput.make(tofill, "poll_text", option.getOptionText());
116:                UIForm form = UIForm.make(tofill, "opt-form");
117:                UIInput.make(form, "opt-text", "#{option.optionText}", option
118:                        .getOptionText());
119:
120:                form.parameters.add(new UIELBinding("#{option.id}", option
121:                        .getId()));
122:                form.parameters.add(new UIELBinding("#{option.pollId}", poll
123:                        .getPollId()));
124:
125:                UICommand saveAdd = UICommand.make(form, "submit-option-add",
126:                        messageLocator.getMessage("delete_option_confirm"),
127:                        "#{pollToolBean.proccessActionDeleteOption}");
128:                saveAdd.parameters.add(new UIELBinding("#{option.status}",
129:                        "delete"));
130:
131:                UICommand cancel = UICommand.make(form, "cancel",
132:                        messageLocator.getMessage("new_poll_cancel"),
133:                        "#{pollToolBean.cancel}");
134:                cancel.parameters.add(new UIELBinding("#{option.status}",
135:                        "cancel"));
136:
137:            }
138:
139:            public List reportNavigationCases() {
140:                List togo = new ArrayList();
141:                togo.add(new NavigationCase(null, new SimpleViewParameters(
142:                        this .VIEW_ID)));
143:                togo.add(new NavigationCase("success",
144:                        new EntityCentredViewParameters(
145:                                AddPollProducer.VIEW_ID, new EntityID("Poll",
146:                                        "0"))));
147:                togo.add(new NavigationCase("cancel",
148:                        new EntityCentredViewParameters(
149:                                AddPollProducer.VIEW_ID, new EntityID("Poll",
150:                                        "0"))));
151:                return togo;
152:            }
153:
154:            public ViewParameters getViewParameters() {
155:                return new EntityCentredViewParameters(VIEW_ID, new EntityID(
156:                        "Option", null));
157:
158:            }
159:
160:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.