Source Code Cross Referenced for FetchCalIdTag.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:        // Copyright %G% Sun Microsystems, Inc. All Rights Reserved.
002:        // "%W% %E% Sun Microsystems"
003:
004:        package com.sun.portal.wireless.taglibs.cal.socs;
005:
006:        import javax.servlet.jsp.*;
007:        import javax.servlet.jsp.tagext.*;
008:
009:        import com.sun.comclient.calendar.*;
010:        import com.sun.comclient.calendar.socs.*;
011:
012:        import com.sun.portal.wireless.taglibs.cal.*;
013:
014:        /**
015:         * FetchCalIdTag : It fetches the list of calIds 
016:         * Gets the list of subscribed calendarIds by default
017:         * If search parameter is specified it searches and returns search result-
018:         * 
019:         * */
020:
021:        public class FetchCalIdTag extends CalCommandTag {
022:
023:            private String searchString = null;
024:            private boolean exact = false;
025:
026:            /**
027:             * the default constructor
028:             */
029:            public FetchCalIdTag() {
030:                super ();
031:            }
032:
033:            /**
034:             * Perform the fetch operation, 
035:             * if search is specified 
036:             *    searches the calids which "contains" the searchstring 
037:             *    return only 10 results
038:             * @return true
039:             * @exception JspException
040:             */
041:            public boolean execute() throws JspException {
042:                SOCSContext context = (SOCSContext) getContext();
043:                CalendarStore calStore = getCalStore();
044:                String[] result = null;
045:                if (searchString != null && (!searchString.trim().equals(""))) {
046:                    try {
047:                        //    searches the calids which "contains" the searchstring 
048:                        //    return only 10 results
049:                        // WCAP only supports CONTAINS and BEGINS_WITH searches, so we cant use EXACT searches
050:                        // Instead, we implement an EXACT search by creating a (client-side) calendar with the
051:                        // given name, and try to fetch its properties from the server. This throws a CalendarException if
052:                        // the calender does not exist on the server.
053:                        if (exact) {
054:                            ICalendar cal = calStore.openCalendar(searchString);
055:                            try {
056:                                cal.getCalProps();
057:                                result = new String[1];
058:                                result[0] = cal.getCalID();
059:                            } catch (CalendarException e) {
060:                                result = null;
061:                            }
062:                        } else {
063:                            ICalendar[] calArr = calStore.searchCalendars(
064:                                    searchString, SOCSCalendarStore.CONTAINS,
065:                                    10);
066:                            result = new String[calArr.length];
067:                            for (int i = 0; i < calArr.length; i++) {
068:                                result[i] = (calArr[i]).getCalID();
069:                            }
070:                        }
071:                    } catch (CalendarStoreException ex1) {
072:                        throw new JspException(ex1.getMessage());
073:                    } catch (OperationNotSupportedException ex2) {
074:                        throw new JspException(ex2.getMessage());
075:                    }
076:
077:                } else {
078:                    try {
079:                        result = calStore.getSubscribedCalenders();
080:                    } catch (CalendarStoreException ex) {
081:                        throw new JspException(ex.getMessage());
082:                    } catch (OperationNotSupportedException ex1) {
083:                        throw new JspException(ex1.getMessage());
084:                    }
085:                }
086:                context.setCalIds(result);
087:                return true;
088:            }
089:
090:            /**
091:             * Sets the searchString, Optional parameter for this Tag
092:             *     searches the calids which "contains" the searchstring 
093:             *     fetches only 10 results
094:             * @param the string to be searched
095:             */
096:
097:            public void setSearch(String searchSt) {
098:                this .searchString = searchSt;
099:            }
100:
101:            /**
102:             * Sets the exact flag, optional parameter for this Tag
103:             * controls whether an exact search is made
104:             * @param exact boolean
105:             */
106:            public void setExact(String e) {
107:                this .exact = "true".equalsIgnoreCase(e);
108:            }
109:
110:            public void release() {
111:                exact = false;
112:                super.release();
113:            }
114:        }
ww__w__.__j___a__va___2__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.