Source Code Cross Referenced for PortalOptionsSaver.java in  » Portal » stringbeans-3.5 » com » nabhinc » portlet » admin » 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 » stringbeans 3.5 » com.nabhinc.portlet.admin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * (C) Copyright 2000 - 2006 Nabh Information Systems, Inc.
003:         *
004:         * This program is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU General Public License
006:         * as published by the Free Software Foundation; either version 2
007:         * of the License, or (at your option) any later version.
008:         *
009:         * This program is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:         * GNU General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU General Public License
015:         * along with this program; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
017:         *
018:         */
019:        package com.nabhinc.portlet.admin;
020:
021:        import java.io.IOException;
022:
023:        import javax.portlet.ActionRequest;
024:        import javax.portlet.ActionResponse;
025:        import javax.portlet.PortletException;
026:
027:        import com.nabhinc.portal.api.PortalInformationStoreLocator;
028:        import com.nabhinc.portal.model.PortalConfiguration;
029:        import com.nabhinc.portlet.mvcportlet.core.ActionConfig;
030:        import com.nabhinc.portlet.mvcportlet.core.ActionProcessor;
031:        import com.nabhinc.portlet.mvcportlet.core.BaseRequestProcessor;
032:        import com.nabhinc.util.StringUtil;
033:
034:        /**
035:         * 
036:         *
037:         * @author Padmanabh Dabke<br/>
038:         * (c) 2006 Nabh Information Systems, Inc. All Rights Reserved.
039:         */
040:        public class PortalOptionsSaver extends BaseRequestProcessor implements 
041:                ActionProcessor {
042:            @SuppressWarnings("unchecked")
043:            public String process(ActionRequest request,
044:                    ActionResponse response, ActionConfig actionConfig)
045:                    throws PortletException, IOException {
046:
047:                PortalConfiguration config = PortalConfiguration.getInstance();
048:                config
049:                        .setAJAXDisabled(request
050:                                .getParameter(PortalAdminConstants.DISABLE_AJAX_PARAM) != null);
051:                config
052:                        .setLoginCaptchaEnabled(request
053:                                .getParameter(PortalAdminConstants.LOGIN_CAPTCHA_PARAM) != null);
054:                config
055:                        .setRegistrationCaptchaEnabled(request
056:                                .getParameter(PortalAdminConstants.REG_CAPTCHA_PARAM) != null);
057:                config
058:                        .setRememberMe(request
059:                                .getParameter(PortalAdminConstants.REMEMBER_ME_PARAM) != null);
060:                config
061:                        .setRememberUsername(request
062:                                .getParameter(PortalAdminConstants.REMEMBER_USER_NAME_PARAM) != null);
063:                config
064:                        .setSecureConnectionSupported(request
065:                                .getParameter(PortalAdminConstants.SUPPORT_SSL_PARAM) != null);
066:                config
067:                        .setSecureLogin(request
068:                                .getParameter(PortalAdminConstants.SECURE_LOGIN_PARAM) != null);
069:                config
070:                        .setSelfRegistrationAllowed(request
071:                                .getParameter(PortalAdminConstants.ALLOW_SELF_REG_PARAM) != null);
072:                config
073:                        .setSendUsername(request
074:                                .getParameter(PortalAdminConstants.SEND_USER_NAME_PARAM) != null);
075:                config
076:                        .setShowLocaleIcons(request
077:                                .getParameter(PortalAdminConstants.SHOW_LOCALE_ICONS_PARAM) != null);
078:
079:                if (StringUtil.isNullOrEmpty(request
080:                        .getParameter(PortalAdminConstants.TIMEOUT_PARAM))) {
081:                    config.setSessionTimeout(0);
082:                } else {
083:                    config.setSessionTimeout(Integer.parseInt(request
084:                            .getParameter(PortalAdminConstants.TIMEOUT_PARAM)));
085:                }
086:
087:                String lang = "";
088:                String country = "";
089:                String defaultLocale = request
090:                        .getParameter(PortalAdminConstants.DEFAULT_LOCALE_PARAM);
091:                if (StringUtil.isNotNullOrEmpty(defaultLocale)) {
092:                    int index = defaultLocale.indexOf("_");
093:                    if (index != -1) {
094:                        lang = defaultLocale.substring(0, index);
095:                        country = defaultLocale.substring(index + 1);
096:                    } else {
097:                        lang = defaultLocale;
098:                    }
099:                }
100:
101:                PortalConfiguration.LocaleConfig lc = new PortalConfiguration.LocaleConfig();
102:                lc.lang = lang;
103:                lc.country = country;
104:                config.setDefaultLocaleConfig(lc);
105:
106:                config.setPortalAdminEmail(request
107:                        .getParameter(PortalAdminConstants.ADMIN_EMAIL_PARAM));
108:                config
109:                        .setPortalSecureURLPrefix(request
110:                                .getParameter(PortalAdminConstants.PORTAL_SECURE_URL_PREFIX_PARAM));
111:                config
112:                        .setPortalURLPrefix(request
113:                                .getParameter(PortalAdminConstants.PORTAL_URL_PREFIX_PARAM));
114:                config.setThemesDir(request
115:                        .getParameter(PortalAdminConstants.THEMES_DIR_PARAM));
116:                config
117:                        .setWidePortlets(request
118:                                .getParameter(PortalAdminConstants.WIDE_PORTLETS_PARAM));
119:
120:                /*
121:                 * Must uncomment the following two lines if the two fields are added to the UI.
122:                config.setProtectedPortletRedirectURL(request.getParameter(PortalAdminConstants.PROTECTED_REDIRECT_PARAM));
123:                config.setNotFoundPortlet(request.getParameter(PortalAdminConstants.NOT_FOUND_PORTLET_PARAM));
124:                 */
125:
126:                PortalInformationStoreLocator.getPortalInformationStore()
127:                        .savePortalConfiguration(config);
128:
129:                // Reset session parameters
130:                actionConfig.getForm().cancel(request, response);
131:
132:                return "success";
133:            }
134:
135:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.