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


01:        /* Copyright 2002 The JA-SIG Collaborative.  All rights reserved.
02:         *  See license distributed with this file and
03:         *  available online at http://www.uportal.org/license.html
04:         */
05:
06:        package org.jasig.portal.layout.restrictions.alm;
07:
08:        import org.jasig.portal.PortalException;
09:        import org.jasig.portal.layout.node.ILayoutNode;
10:        import org.jasig.portal.utils.CommonUtils;
11:
12:        /**
13:         * BooleanRestriction checks the restriction on the boolean property for a given ILayoutNode object.
14:         * <p>
15:         * Company: Instructional Media &amp; Magic
16:         * 
17:         * Prior to uPortal 2.5, this class existed in the package org.jasig.portal.layout.restrictions.
18:         * It was moved to its present package to reflect that it is part of Aggregated Layouts.
19:         *
20:         * @author <a href="mailto:mvi@immagic.com">Michael Ivanov</a>
21:         * @version $Revision: 35731 $
22:         */
23:        public abstract class BooleanRestriction extends ALRestriction {
24:
25:            private boolean boolValue1 = false, boolValue2 = false;
26:
27:            public BooleanRestriction(String name, String nodePath) {
28:                super (name, nodePath);
29:            }
30:
31:            public BooleanRestriction(String name) {
32:                super (name);
33:            }
34:
35:            public BooleanRestriction() {
36:                super ();
37:            }
38:
39:            private boolean strToBool(String boolStr) {
40:                return ("Y".equalsIgnoreCase(boolStr)) ? true : false;
41:            }
42:
43:            /**
44:             * Parses the restriction expression of the current node
45:             * @exception PortalException
46:             */
47:            protected void parseRestrictionExpression() throws PortalException {
48:                try {
49:                    String restrictionExp = getRestrictionExpression();
50:                    int commaIndex = restrictionExp.indexOf(',');
51:                    if (commaIndex < 0) {
52:                        boolValue1 = boolValue2 = strToBool(restrictionExp);
53:                    } else {
54:                        boolValue1 = strToBool(restrictionExp.substring(0,
55:                                commaIndex));
56:                        boolValue2 = strToBool(restrictionExp
57:                                .substring(commaIndex + 1));
58:                    }
59:                } catch (Exception e) {
60:                    throw new PortalException(e);
61:                }
62:            }
63:
64:            /**
65:             * Gets the boolean property value for the specified node
66:             */
67:            protected abstract boolean getBooleanPropertyValue(ILayoutNode node);
68:
69:            protected boolean checkRestriction(boolean boolProperty)
70:                    throws PortalException {
71:                if (boolProperty == boolValue1 || boolProperty == boolValue2)
72:                    return true;
73:                return false;
74:            }
75:
76:            /**
77:             * Checks the restriction for the specified node
78:             * @param node a <code>ILayoutNode</code> user layout node to be checked
79:             * @exception PortalException
80:             */
81:            public boolean checkRestriction(ILayoutNode node)
82:                    throws PortalException {
83:                boolean boolProperty = getBooleanPropertyValue(node);
84:                return checkRestriction(boolProperty);
85:            }
86:
87:            /**
88:             * Checks the restriction for the specified property
89:             * @param propertyValue a <code>String</code> property value
90:             * @exception PortalException
91:             */
92:            public boolean checkRestriction(String propertyValue)
93:                    throws PortalException {
94:                boolean boolProperty = CommonUtils.strToBool(propertyValue);
95:                return checkRestriction(boolProperty);
96:            }
97:
98:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.