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


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/search/tags/sakai_2-4-1/search-tool/tool/src/java/org/sakaiproject/search/tool/SearchBeanFactoryImpl.java $
003:         * $Id: SearchBeanFactoryImpl.java 22723 2007-03-16 01:35:32Z ian@caret.cam.ac.uk $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2003, 2004, 2005, 2006 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.search.tool;
021:
022:        import javax.servlet.ServletContext;
023:        import javax.servlet.http.HttpServletRequest;
024:
025:        import org.apache.commons.logging.Log;
026:        import org.apache.commons.logging.LogFactory;
027:        import org.sakaiproject.component.api.ComponentManager;
028:        import org.sakaiproject.exception.IdUnusedException;
029:        import org.sakaiproject.exception.PermissionException;
030:        import org.sakaiproject.search.api.SearchService;
031:        import org.sakaiproject.search.tool.api.OpenSearchBean;
032:        import org.sakaiproject.search.tool.api.SearchAdminBean;
033:        import org.sakaiproject.search.tool.api.SearchBean;
034:        import org.sakaiproject.search.tool.api.SearchBeanFactory;
035:        import org.sakaiproject.search.tool.api.SherlockSearchBean;
036:        import org.sakaiproject.site.api.SiteService;
037:        import org.sakaiproject.tool.api.SessionManager;
038:        import org.sakaiproject.tool.api.ToolManager;
039:
040:        /**
041:         * @author ieb
042:         */
043:        public class SearchBeanFactoryImpl implements  SearchBeanFactory {
044:
045:            private static Log log = LogFactory
046:                    .getLog(SearchBeanFactoryImpl.class);
047:
048:            private SearchService searchService;
049:
050:            private SiteService siteService;
051:
052:            private ToolManager toolManager;
053:
054:            private SessionManager sessionManager;
055:
056:            private ServletContext context;
057:
058:            public void init() {
059:                ComponentManager cm = org.sakaiproject.component.cover.ComponentManager
060:                        .getInstance();
061:                sessionManager = (SessionManager) load(cm, SessionManager.class
062:                        .getName());
063:                searchService = (SearchService) load(cm, SearchService.class
064:                        .getName());
065:                siteService = (SiteService) load(cm, SiteService.class
066:                        .getName());
067:                toolManager = (ToolManager) load(cm, ToolManager.class
068:                        .getName());
069:            }
070:
071:            private Object load(ComponentManager cm, String name) {
072:                Object o = cm.get(name);
073:                if (o == null) {
074:                    log.error("Cant find Spring component named " + name);
075:                }
076:                return o;
077:            }
078:
079:            /**
080:             * {@inheritDoc}
081:             * 
082:             * @throws PermissionException
083:             */
084:            public SearchBean newSearchBean(HttpServletRequest request) {
085:                try {
086:                    SearchBeanImpl searchBean = new SearchBeanImpl(request,
087:                            searchService, siteService, toolManager);
088:
089:                    return searchBean;
090:                } catch (IdUnusedException e) {
091:                    throw new RuntimeException(Messages
092:                            .getString("searchbeanfact_siteerror"));
093:                }
094:            }
095:
096:            /**
097:             * {@inheritDoc}
098:             * 
099:             * @throws PermissionException
100:             */
101:            public SearchAdminBean newSearchAdminBean(HttpServletRequest request)
102:                    throws PermissionException {
103:                try {
104:                    SearchAdminBeanImpl searchAdminBean = new SearchAdminBeanImpl(
105:                            request, searchService, siteService, toolManager,
106:                            sessionManager);
107:                    return searchAdminBean;
108:                } catch (IdUnusedException e) {
109:                    throw new RuntimeException(Messages
110:                            .getString("searchbeanfact_siteerror"));
111:                }
112:            }
113:
114:            public SearchBean newSearchBean(HttpServletRequest request,
115:                    String sortName, String filterName)
116:                    throws PermissionException {
117:                try {
118:                    SearchBeanImpl searchBean = new SearchBeanImpl(request,
119:                            sortName, filterName, searchService, siteService,
120:                            toolManager);
121:
122:                    return searchBean;
123:                } catch (IdUnusedException e) {
124:                    throw new RuntimeException(Messages
125:                            .getString("searchbeanfact_siteerror"));
126:                }
127:            }
128:
129:            public OpenSearchBean newOpenSearchBean(HttpServletRequest request)
130:                    throws PermissionException {
131:                try {
132:                    OpenSearchBean openSearchBean = new OpenSearchBeanImpl(
133:                            request, searchService, siteService, toolManager);
134:
135:                    return openSearchBean;
136:                } catch (IdUnusedException e) {
137:                    throw new RuntimeException(Messages
138:                            .getString("searchbeanfact_siteerror"));
139:                }
140:            }
141:
142:            public SherlockSearchBean newSherlockSearchBean(
143:                    HttpServletRequest request) throws PermissionException {
144:                try {
145:                    SherlockSearchBean sherlockSearchBean = new SherlockSearchBeanImpl(
146:                            request, context, searchService, siteService,
147:                            toolManager);
148:
149:                    return sherlockSearchBean;
150:                } catch (IdUnusedException e) {
151:                    throw new RuntimeException(Messages
152:                            .getString("searchbeanfact_siteerror"));
153:                }
154:            }
155:
156:            /**
157:             * @return the context
158:             */
159:            public ServletContext getContext() {
160:                return context;
161:            }
162:
163:            /**
164:             * @param context the context to set
165:             */
166:            public void setContext(ServletContext context) {
167:                this.context = context;
168:            }
169:
170:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.