Source Code Cross Referenced for CPermissionsManagerServant.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » channels » permissionsmanager » 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 » uPortal_rel 2 6 1 GA » org.jasig.portal.channels.permissionsmanager 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright 2001 The JA-SIG Collaborative.  All rights reserved.
002:         *  See license distributed with this file and
003:         *  available online at http://www.uportal.org/license.html
004:         */
005:
006:        package org.jasig.portal.channels.permissionsmanager;
007:
008:        import java.util.HashMap;
009:
010:        import org.jasig.portal.IPermissible;
011:        import org.jasig.portal.IServant;
012:        import org.jasig.portal.PortalException;
013:        import org.jasig.portal.security.IAuthorizationPrincipal;
014:        import org.jasig.portal.security.IPermission;
015:        import org.apache.commons.logging.Log;
016:        import org.apache.commons.logging.LogFactory;
017:        import org.jasig.portal.utils.XSLT;
018:
019:        /**
020:         * CPermissionsManagerServant is an IServant subclass of CPermissionsManager
021:         * This will allow other channels to delegate to CPermissionsManager at runtime
022:         *
023:         * Master channels should instantiate this channel with the following
024:         * staticData parameter preset:
025:         *
026:         * prmOwners = IPermissible[] owners
027:         *
028:         * where owners is an array with a single element being an instance of the
029:         * master's representative IPermissible class.
030:         *
031:         * see org.jasig.portal.IPermissible for more information
032:         *
033:         * @author Alex Vigdor
034:         * @version $Revision: 36568 $
035:         */
036:        public class CPermissionsManagerServant extends CPermissionsManager
037:                implements  IServant {
038:            private static final Log log = LogFactory
039:                    .getLog(CPermissionsManagerServant.class);
040:
041:            private IPermission[] results;
042:
043:            /** Creates new CPermissionsManagerServant */
044:            public CPermissionsManagerServant() {
045:            }
046:
047:            /**
048:             * put your documentation comment here
049:             * @param xslt
050:             */
051:            protected void transform(XSLT xslt) {
052:                if (!isFinished()) {
053:                    try {
054:                        xslt.setStylesheetParameter("isAdminUser", "true");
055:                        xslt.transform();
056:                    } catch (Exception e) {
057:                        log.debug(e, e);
058:                    }
059:                }
060:            }
061:
062:            /**
063:             * put your documentation comment here
064:             * 
065:             * @return <code>true</code> if finished; <code>false</code> otherwise
066:             */
067:            public boolean isFinished() {
068:                return session.isFinished;
069:            }
070:
071:            /**
072:             * put your documentation comment here
073:             * Currently returns and empy array
074:             * @return the results
075:             */
076:            public Object[] getResults() {
077:                return results;
078:            }
079:
080:            public void setStaticData(org.jasig.portal.ChannelStaticData sD)
081:                    throws PortalException {
082:                super .setStaticData(sD);
083:                session.isAuthorized = true;
084:
085:                // handle pre-selection for servant mode
086:                if (session.staticData.get("prmOwners") != null) {
087:                    log
088:                            .debug("PermissionServant.setStaticData(): processing pre-selection");
089:
090:                    // use specified set of owners
091:                    IPermissible[] selOwners = (IPermissible[]) session.staticData
092:                            .get("prmOwners");
093:                    for (int j = 0; j < selOwners.length; j++) {
094:                        PermissionsXML.setSelected(session, selOwners[j]
095:                                .getClass().getName(), "owner", selOwners[j]
096:                                .getOwnerToken(), true);
097:
098:                        if (session.staticData.get("prmTargets") != null) {
099:                            if (((HashMap) session.staticData.get("prmTargets"))
100:                                    .get(selOwners[j].getOwnerToken()) != null) {
101:                                String[] selTargets = (String[]) ((HashMap) session.staticData
102:                                        .get("prmTargets")).get(selOwners[j]
103:                                        .getOwnerToken());
104:                                if (log.isDebugEnabled())
105:                                    log
106:                                            .debug("PermissionServant.setStaticData(): got "
107:                                                    + selTargets.length
108:                                                    + " pre-selected targets");
109:                                for (int s = 0; s < selTargets.length; s++) {
110:                                    PermissionsXML.setSelected(session,
111:                                            selOwners[j].getClass().getName(),
112:                                            "target", selTargets[s], true);
113:                                }
114:                                session.gotTargets = true;
115:                            } else {
116:                                log
117:                                        .debug("PermissionServant.setStaticData(): error retrieving pre-selected targets");
118:                            }
119:                        }
120:
121:                        if (session.staticData.get("prmActivities") != null) {
122:                            if (((HashMap) session.staticData
123:                                    .get("prmActivities")).get(selOwners[j]
124:                                    .getOwnerToken()) != null) {
125:                                String[] selActivities = (String[]) ((HashMap) session.staticData
126:                                        .get("prmActivities")).get(selOwners[j]
127:                                        .getOwnerToken());
128:                                if (log.isDebugEnabled())
129:                                    log
130:                                            .debug("PermissionServant.setStaticData(): got "
131:                                                    + selActivities.length
132:                                                    + " pre-selected activities");
133:                                for (int s = 0; s < selActivities.length; s++) {
134:                                    PermissionsXML.setSelected(session,
135:                                            selOwners[j].getClass().getName(),
136:                                            "activity", selActivities[s], true);
137:                                }
138:                                session.gotActivities = true;
139:                            } else {
140:                                log
141:                                        .debug("PermissionServant.setStaticData(): error retrieving pre-selected activities");
142:                            }
143:                        }
144:
145:                    }
146:                    session.gotOwners = true;
147:                }
148:                if (session.staticData.get("prmPrincipals") != null) {
149:                    session.principals = (IAuthorizationPrincipal[]) session.staticData
150:                            .get("prmPrincipals");
151:                    PermissionsXML.populatePrincipals(session);
152:                }
153:            }
154:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.