Source Code Cross Referenced for VoteImpl.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » poll » model » 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.model 
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.model;
021:
022:        import java.util.Date;
023:
024:        import org.sakaiproject.user.api.User;
025:        import org.sakaiproject.user.cover.UserDirectoryService;
026:        import org.sakaiproject.user.api.User;
027:        import org.sakaiproject.entity.api.Entity;
028:        import org.sakaiproject.event.cover.UsageSessionService;
029:        import org.sakaiproject.event.api.UsageSession;
030:
031:        public class VoteImpl implements  Vote {
032:
033:            private Long id;
034:            private String userId;
035:            private String ip;
036:            private Long pollId;
037:            private Date voteDate;
038:            private Long optionid;
039:            private String submissionId;
040:
041:            public VoteImpl() {
042:                //needed by hibernate
043:            }
044:
045:            public VoteImpl(Poll poll, Option option, String subId) {
046:
047:                this .pollId = poll.getPollId();
048:                this .optionid = option.getId();
049:                this .submissionId = subId;
050:
051:                // the date can default to now
052:                voteDate = new Date();
053:                //user is current user
054:                User currentuser = UserDirectoryService.getCurrentUser();
055:                userId = currentuser.getId();
056:                //set the Ip to the current sessions IP
057:                UsageSession usageSession = UsageSessionService.getSession();
058:                ip = usageSession.getIpAddress();
059:            }
060:
061:            public void setId(Long value) {
062:                id = value;
063:
064:            }
065:
066:            public Long getId() {
067:
068:                return id;
069:            }
070:
071:            public void setUserId(String uid) {
072:                userId = uid;
073:
074:            }
075:
076:            public String getUserId() {
077:
078:                return userId;
079:            }
080:
081:            public void setIp(String value) {
082:                ip = value;
083:
084:            }
085:
086:            public String getIp() {
087:
088:                return ip;
089:            }
090:
091:            public void setVoteDate(Date date) {
092:                this .voteDate = date;
093:
094:            }
095:
096:            public Date getVoteDate() {
097:
098:                return this .voteDate;
099:            }
100:
101:            public void setPollOption(Long voption) {
102:
103:                optionid = voption;
104:            }
105:
106:            public Long getPollOption() {
107:
108:                return optionid;
109:            }
110:
111:            public void setPollId(Long value) {
112:                this .pollId = value;
113:
114:            }
115:
116:            public Long getPollId() {
117:
118:                return pollId;
119:            }
120:
121:            public void setSubmissionId(String sid) {
122:                this .submissionId = sid;
123:
124:            }
125:
126:            public String getSubmissionId() {
127:
128:                return this .submissionId;
129:            }
130:
131:            public String toString() {
132:
133:                return this .pollId + ":" + this .userId + ":" + this .ip + ":"
134:                        + this.optionid;
135:
136:            }
137:
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.