Source Code Cross Referenced for EmailReminderBean.java in  » Portal » Open-Portal » com » sun » portal » wireless » taglibs » cal » socs » 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.wireless.taglibs.cal.socs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.sun.portal.wireless.taglibs.cal.socs;
002:
003:        import com.sun.portal.wireless.taglibs.base.Util;
004:        import com.sun.portal.log.common.PortalLogger;
005:        import com.sun.comclient.calendar.*;
006:
007:        import java.util.logging.Logger;
008:        import java.util.logging.Level;
009:
010:        /** 
011:         * This exposes only the Email aspect of Reminder by extending ReminderBean
012:         */
013:
014:        public class EmailReminderBean extends ReminderBean {
015:
016:            // Create a logger for this class
017:            private static Logger debugLogger = PortalLogger
018:                    .getLogger(EmailReminderBean.class);
019:
020:            private VAlarm alarm = null;
021:
022:            /**
023:             * This reminderBean does not have a default constructor
024:             * Takes an alarm object ,
025:             * which might have been created by event/task.createAlarm  
026:             * @param theAlarm object
027:             */
028:            public EmailReminderBean(VAlarm aAlarm) {
029:                super (aAlarm);
030:                this .alarm = aAlarm;
031:            }
032:
033:            /**
034:             * Gets this object as String
035:             * @return the String form of the object
036:             **/
037:            public String getString() {
038:                return toString();
039:            }
040:
041:            /**
042:             * Gets this object as String
043:             * @return the String form of the object
044:             **/
045:            public String toString() {
046:                return super .toString() + ":" + getEmailAttendee();
047:            }
048:
049:            /**
050:             * Sets the Emails of attendees to the alarm
051:             * It does not add the new attendees to the existing list , 
052:             * but replaces the old list of attendees by the new list
053:             * @param String list containing attendee email addresses
054:             */
055:            public void setEmailAttendee(String addrListSt) {
056:                try {
057:                    //Remove all the attendee from alarm
058:                    Attendee[] attendees = alarm.getAttendees();
059:                    if (attendees != null && attendees.length > 0) {
060:                        for (int i = 0; i < attendees.length; i++) {
061:                            alarm.removeAttendee(attendees[i]);
062:                        }
063:                    }
064:                    if (addrListSt.indexOf("MAILTO") == -1) {
065:                        addrListSt = "MAILTO:" + addrListSt;
066:                    }
067:                    Attendee att = new Attendee(Attendee.INDIVIDUAL, addrListSt);
068:                    alarm.addAttendee(att);
069:                    alarm.setAction("EMAIL");
070:                } catch (Exception ex) {
071:                    debugLogger.log(Level.INFO, "PSMA_CSPWTCS0001", ex);
072:                }
073:            }
074:
075:            /** 
076:             * verifies if the attendee list is Empty
077:             * @return true if it is null or "" else false
078:             */
079:            public boolean isEmailAttendeeEmpty() {
080:                String email = getEmailAttendee();
081:                if (email == null || email.trim().equals("")) {
082:                    return true;
083:                }
084:                return false;
085:            }
086:
087:            /** <P> Gets the Email Address to prefill the
088:             * change attendee's address field in reminder
089:             * BEAWARE: it sepeartes the attendees by commas 
090:             * In our case we are dealing with one attendee with one or more emails
091:             * like Mailto:a@sun.com,b@iplanet.com 
092:             * removes the "MAILTO:" if exist </P>
093:             * @return String Email Address of the attendee
094:             */
095:            public String getEmailAttendee() {
096:                StringBuffer result = new StringBuffer();
097:                String delimiter = ",";
098:                Attendee[] addrList = alarm.getAttendees();
099:                if (addrList != null) {
100:                    for (int i = 0; i < addrList.length; i++) {
101:                        String addr = (String) addrList[i].getValue();
102:                        debugLogger.log(Level.FINER, "PSMA_CSPWTCS0002", addr);
103:                        if (addr.length() >= 7) {
104:                            String tmp = addr.substring(0, 7);
105:                            if (tmp.equalsIgnoreCase("Mailto:")) {
106:                                addr = addr.substring(7);
107:                            }
108:                        }
109:                        result.append(addr);
110:                        if (i != (addrList.length - 1)) {
111:                            result.append(delimiter);
112:                        }
113:                    }
114:                }
115:                return result.toString();
116:            }
117:
118:            /**
119:             * <p>A small text note that can be included in the reminder. Some
120:             * calendar servers may not support this.</p>
121:             *
122:             * @param   note       free form text
123:             */
124:            public void setReminderNote(String note) throws Exception {
125:                if (note == null) {
126:                    note = "";
127:                }
128:                alarm.setDescription(note);
129:            }
130:
131:            /**
132:             * <p>Returns any text the user may have entered to be included with the
133:             * reminder.</p>
134:             *
135:             * @return free form textual notes
136:             */
137:            public String getReminderNote() {
138:                return alarm.getDescription();
139:            }
140:        }
w_w__w.ja_v___a___2s___.c_o__m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.