Source Code Cross Referenced for ProxyletBean.java in  » Portal » Open-Portal » com » sun » portal » admin » console » sra » proxylet » 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.admin.console.sra.proxylet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $Id: ProxyletBean.java,v 1.20 2006/11/28 13:10:18 aa147324 Exp $
003:         * Copyright 2005 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.portal.admin.console.sra.proxylet;
014:
015:        import java.io.Serializable;
016:        import java.util.*;
017:
018:        import com.sun.portal.admin.console.sra.ISraBean;
019:        import com.sun.portal.admin.console.sra.SraBaseBean;
020:        import com.sun.portal.admin.console.sra.accesslist.ACL;
021:        import com.sun.portal.admin.console.sra.utils.SraObjectListDataProvider;
022:        import com.sun.data.provider.DataProvider;
023:        import com.sun.data.provider.impl.ObjectListDataProvider;
024:
025:        /**
026:         * author: Noble Paul Date: May 19, 2005, 11:35:23 AM
027:         */
028:        public class ProxyletBean extends SraBaseBean implements  Serializable {
029:            private static final String BIND_IP = "sunPortalProxyletBindIP";
030:
031:            private static final String BIND_PORT = "sunPortalProxyletPort";
032:
033:            private static final String AUTO_DWNLD = "sunPortalProxyletDownloadDefault";
034:
035:            private static final String LAUNCH_MODE = "sunPortalProxyletLaunchMode";
036:
037:            //private static final String APP_URLS = "sunPortalProxyletAppUrls";
038:
039:            private static final String PAC_LOC = "sunPortalProxyletPacLocation";
040:
041:            private static final String RULES = "sunPortalProxyletRules";
042:
043:            private static final String JNLP = "Java Web Start";
044:
045:            private static final String APPLET = "Applet";
046:
047:            //private static final String[] ATTR_LIST = {BIND_IP, BIND_PORT, APP_URLS , AUTO_DWNLD, LAUNCH_MODE, PAC_LOC, RULES};
048:            private static final String[] ATTR_LIST = { COS_PRIORITY, BIND_IP,
049:                    BIND_PORT, AUTO_DWNLD, LAUNCH_MODE, PAC_LOC, RULES };
050:
051:            private String bindIP;//sunPortalProxyletBindIP
052:
053:            private String bindPort;//sunPortalProxyletPort
054:
055:            private boolean autoDownload;//sunPortalProxyletDownloadDefault
056:
057:            private boolean appletLaunchMode = true;//sunPortalProxyletLaunchMode
058:
059:            private String pacFileLocation;//sunPortalProxyletPacLocation
060:
061:            //private List appURLList;//sunPortalProxyletAppUrls
062:
063:            //private ObjectListDataProvider appURLData;
064:
065:            private List rulesList;//sunPortalProxyletRules
066:
067:            private SraObjectListDataProvider rulesData;
068:            static {
069:                setPropertyVisibility(BIND_IP, SHOW, SHOW, SHOW);
070:                setPropertyVisibility(BIND_PORT, SHOW, SHOW, SHOW);
071:                setPropertyVisibility(AUTO_DWNLD, SHOW, SHOW, SHOW);
072:                setPropertyVisibility(LAUNCH_MODE, SHOW, SHOW, SHOW);
073:
074:                //setPropertyVisibility(APP_URLS, SHOW, SHOW, HIDE);
075:                setPropertyVisibility(PAC_LOC, SHOW, SHOW, HIDE);
076:                setPropertyVisibility(RULES, SHOW, SHOW, HIDE);
077:                setPropertyVisibility(COS_PRIORITY, HIDE, SHOW, HIDE);
078:
079:            }
080:
081:            public ProxyletBean() {
082:                super (PROXYLET_SVC, ATTR_LIST);
083:                initData();
084:            }
085:
086:            public void initData() {
087:                autoDownload = getBooleanValue(AUTO_DWNLD);
088:                bindIP = getStringValue(BIND_IP);
089:                bindPort = getStringValue(BIND_PORT);
090:                //appURLList = getListValue(APP_URLS);
091:                pacFileLocation = getStringValue(PAC_LOC);
092:                rulesList = new ArrayList();
093:                for (StringTokenizer stringTokenizer = new StringTokenizer(
094:                        getStringValue(RULES), "|", false); stringTokenizer
095:                        .hasMoreTokens();) {
096:                    rulesList.add(Rule.decode(stringTokenizer.nextToken()));
097:                }
098:                if (rulesList.isEmpty()) {
099:                    rulesList.add(new Rule());
100:                }
101:                appletLaunchMode = APPLET
102:                        .equalsIgnoreCase(getStringValue(LAUNCH_MODE));
103:            }
104:
105:            /*public DataProvider getAppUrlData(){
106:                List result = new ArrayList();
107:                if(appURLData == null){
108:                    for (int i = 0; i < appURLList.size(); i++) {
109:                        result.add(AppUrl.decode((String) appURLList.get(i)));
110:                    }
111:                    if(result.isEmpty()){
112:                        result.add(new AppUrl());
113:                    }
114:                    appURLData = new SraObjectListDataProvider(AppUrl.class.getName(), result);
115:                }
116:                return appURLData;
117:            }
118:
119:            public void addAppUrl(){
120:                appURLData.appendRow(new AppUrl());
121:                appURLData.commitChanges();
122:            }
123:            public void removeAppurl(){
124:                appURLData.commitChanges();
125:                List l =  appURLData.getList();
126:                for (int i = 0; i < l.size(); i++) {
127:                    AppUrl appUrl = (AppUrl) l.get(i);
128:                    if(appUrl.getSelected()) {
129:                        appURLData.removeObject(appUrl);
130:                        appURLData.commitChanges();
131:                    }
132:                }
133:                saveAppUrls();
134:
135:            }
136:
137:            private void saveAppUrls() {
138:                List l = appURLData.getList();
139:                List result = new ArrayList();
140:                for (int i = 0; i < l.size(); i++) {
141:                    AppUrl appUrl = (AppUrl) l.get(i);
142:                    if(!appUrl.isEmpty()){
143:                        result.add(AppUrl.encode(appUrl));
144:                    }
145:                }
146:                if ( result.isEmpty() )
147:                	result.add("");
148:
149:                appURLList = result;
150:                updateAttributeNVMap(APP_URLS,result);
151:                storeDataToStore(APP_URLS);
152:            }*/
153:
154:            public String getPacFileLocation() {
155:                return pacFileLocation;
156:            }
157:
158:            public void setPacFileLocation(String pacFileLocation) {
159:                this .pacFileLocation = pacFileLocation;
160:                updateAttributeNVMap(PAC_LOC, pacFileLocation);
161:            }
162:
163:            public boolean getAppletLaunchMode() {
164:                return appletLaunchMode;
165:            }
166:
167:            public void setAppletLaunchMode(boolean appletLaunchMode) {
168:                this .appletLaunchMode = appletLaunchMode;
169:                updateAttributeNVMap(LAUNCH_MODE, appletLaunchMode ? APPLET
170:                        : JNLP);
171:
172:            }
173:
174:            public boolean getJnlpLaunchMode() {
175:                return !appletLaunchMode;
176:            }
177:
178:            public void setJnlpLaunchMode(boolean jnlpLaunchMode) {
179:                this .appletLaunchMode = !jnlpLaunchMode;
180:                updateAttributeNVMap(LAUNCH_MODE, jnlpLaunchMode ? JNLP
181:                        : APPLET);
182:            }
183:
184:            public String getBindIP() {
185:                return bindIP;
186:            }
187:
188:            public void setBindIP(String val) {
189:                this .bindIP = val;
190:                updateAttributeNVMap(BIND_IP, val);
191:            }
192:
193:            public boolean getAutoDownload() {
194:                return autoDownload;
195:            }
196:
197:            public void setAutoDownload(boolean val) {
198:                this .autoDownload = val;
199:                updateAttributeNVMap(AUTO_DWNLD, Boolean.toString(val));
200:
201:            }
202:
203:            public boolean getDontAutoDownload() {
204:                return !autoDownload;
205:            }
206:
207:            public void setDontAutoDownload(boolean val) {
208:                this .autoDownload = !val;
209:                updateAttributeNVMap(AUTO_DWNLD, Boolean.toString(!val));
210:
211:            }
212:
213:            public String getBindPort() {
214:                return bindPort;
215:            }
216:
217:            public void setBindPort(String val) {
218:                this .bindPort = val;
219:                updateAttributeNVMap(BIND_PORT, val);
220:            }
221:
222:            public String submit() {
223:                if (rulesData != null) {
224:                    rulesData.commitChanges();
225:                    saveRules();
226:                }
227:                //appURLData.commitChanges();
228:                //saveAppUrls();
229:                storeDataToStore();
230:                return "success";
231:
232:            }
233:
234:            public String storeData() {
235:                return submit();
236:
237:            }
238:
239:            private void saveRules() {
240:                List rulesArray = rulesData.getList();
241:                StringBuffer sb = new StringBuffer();
242:                for (int i = 0; i < rulesArray.size(); i++) {
243:                    Rule rule = (Rule) rulesArray.get(i);
244:                    if (!rule.isEmpty()) {
245:                        sb.append(Rule.encode(rule)).append("|");
246:                    }
247:                }
248:                updateAttributeNVMap(RULES, sb.toString());
249:                storeDataToStore(RULES);
250:            }
251:
252:            public void addRule() {
253:                rulesData.appendRow(new Rule());
254:                rulesData.commitChanges();
255:            }
256:
257:            public DataProvider getRulesData() {
258:                if (rulesData == null) {
259:                    rulesData = new SraObjectListDataProvider(Rule.class
260:                            .getName(), rulesList);
261:                }
262:                return rulesData;
263:            }
264:
265:            public void removeRule() {
266:                rulesData.commitChanges();
267:                List l = rulesData.getList();
268:                for (int i = 0; i < l.size(); i++) {
269:                    Rule rule = (Rule) l.get(i);
270:                    if (rule.getSelected()) {
271:                        rulesData.removeObject(rule);
272:                    }
273:                }
274:                rulesData.commitChanges();
275:                saveRules();
276:
277:            }
278:
279:            public boolean isServiceAssigned() {
280:                return isServiceAssigned("srapProxyletService");
281:            }
282:        }
ww___w___.___j___a_v__a2_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.