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


001:        /*
002:         * Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
003:         * PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
004:         */
005:
006:        package com.sun.portal.search.admin.model;
007:
008:        import javax.servlet.http.HttpServletRequest; /*
009:         import com.iplanet.sm.ServiceSchema;
010:         import com.iplanet.sm.ServiceSchemaManager;
011:         import com.iplanet.sm.AttributeSchema;
012:         import com.iplanet.sm.SMSException;
013:         */
014:        import com.sun.identity.sm.ServiceSchema;
015:        import com.sun.identity.sm.ServiceSchemaManager;
016:        import com.sun.identity.sm.AttributeSchema;
017:        import com.sun.identity.sm.SMSException;
018:        import com.iplanet.sso.SSOException;
019:        import com.iplanet.am.util.Locale;
020:        import com.iplanet.am.console.base.model.AMModelBase;
021:
022:        import java.util.ResourceBundle;
023:        import java.util.Collection;
024:        import java.util.Collections;
025:        import java.util.List;
026:        import java.util.ArrayList;
027:        import java.util.Iterator;
028:        import java.util.Set;
029:        import java.util.Arrays;
030:        import java.util.SortedSet;
031:        import java.util.TreeSet;
032:
033:        /*
034:         * The model implementation for managing the properties of a service.
035:         */
036:        public class CSServiceModelImpl extends AMModelBase implements 
037:                CSServiceModel {
038:            private boolean processed = false;
039:
040:            /* The service name.*/
041:            private String svcName = "";
042:            /* The localized service name.*/
043:            private String lSvcName = "";
044:
045:            private int globalSize = 0;
046:            private int orgSize = 0;
047:            private int dynSize = 0;
048:
049:            private ResourceBundle resBundle = null;
050:
051:            private ServiceSchema globalSvcSchema = null;
052:            private ServiceSchema orgSvcSchema = null;
053:            private ServiceSchema dynSvcSchema = null;
054:
055:            private List globalAttrs = Collections.EMPTY_LIST;
056:            private List orgAttrs = Collections.EMPTY_LIST;
057:            private List dynAttrs = Collections.EMPTY_LIST;
058:
059:            /*
060:             * @param req The HttpServletRequest object.
061:             * @param rbName The name of the resource bundle.
062:             */
063:            public CSServiceModelImpl(HttpServletRequest req, String rbName) {
064:                super (req, rbName);
065:                //Get the service name stored in the token by SMNavModelImpl
066:                svcName = "SunPortalSearchService";
067:            }
068:
069:            /*
070:             * This method does the actual work of retrieving the attribute schemas and
071:             * preparing a list of attributes.
072:             */
073:            public void process() {
074:                if (svcName == null || svcName.length() == 0) {
075:                    //TOFIX: Preferably throw an exception.
076:                    debugError("CSServiceModelImpl: Invalid service name.");
077:                    return;
078:                }
079:
080:                //If this method has already executed then no op.
081:                if (processed) {
082:                    return;
083:                }
084:
085:                ServiceSchemaManager schemaMgr = null;
086:                String rbFileName = null;
087:
088:                //Get the schema manager.
089:                try {
090:                    schemaMgr = new ServiceSchemaManager(svcName, ssoToken);
091:                } catch (SMSException sms) {
092:                    //TOFIX: Handle this properly
093:                    debugError(sms.getMessage());
094:                    return;
095:                } catch (SSOException ssoe) {
096:                    //TOFIX: Handle this properly
097:                    debugError(ssoe.getMessage());
098:                    return;
099:                }
100:
101:                //Get the global schema
102:                try {
103:                    globalSvcSchema = schemaMgr.getGlobalSchema();
104:                } catch (SMSException sms) {
105:                    debugMessage(sms.getMessage());
106:                }
107:
108:                //Get the org schema
109:                try {
110:                    orgSvcSchema = schemaMgr.getOrganizationSchema();
111:                } catch (SMSException sms) {
112:                    debugMessage(sms.getMessage());
113:                }
114:
115:                //Get the dynamic schema.
116:                try {
117:                    dynSvcSchema = schemaMgr.getDynamicSchema();
118:                } catch (SMSException sms) {
119:                    debugMessage(sms.getMessage());
120:                }
121:
122:                /* Remember that this method has already executed and no need to
123:                 * repeat the same thing again.*/
124:                processed = true;
125:            }
126:
127:            public Set getInstances() {
128:                Set instances = null;
129:                if (globalSvcSchema != null) {
130:                    AttributeSchema as = globalSvcSchema
131:                            .getAttributeSchema("sunPortalSearchInstances");
132:                    if (as != null) {
133:                        instances = as.getDefaultValues();
134:                    }
135:                }
136:
137:                return instances;
138:
139:            }
140:
141:            public String getHelpAnchorTag(String key) {
142:                return super.getHelpAnchorTag(key);
143:            }
144:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.