Source Code Cross Referenced for CommunityMembershipEntry.java in  » Portal » Open-Portal » com » sun » portal » app » communityportlets » faces » 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.app.communityportlets.faces 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.sun.portal.app.communityportlets.faces;
002:
003:        import java.util.*;
004:        import java.io.*;
005:        import java.text.*;
006:
007:        import javax.faces.context.FacesContext;
008:
009:        import com.sun.portal.community.CommunityId;
010:        import com.sun.portal.community.RoleId;
011:
012:        public class CommunityMembershipEntry implements  Comparable {
013:
014:            private CommunityId cId = null;
015:            private String url = null;
016:            private RoleId roleId = null;
017:            private int requestedMemberships = 0;
018:
019:            public CommunityMembershipEntry() {
020:            }
021:
022:            public CommunityMembershipEntry(CommunityId cId, String url,
023:                    RoleId roleId) {
024:                this .cId = cId;
025:                this .url = url;
026:                this .roleId = roleId;
027:                this .requestedMemberships = 0;
028:            }
029:
030:            public CommunityMembershipEntry(CommunityId cId, String url,
031:                    RoleId roleId, int requestedMemberships) {
032:                this .cId = cId;
033:                this .url = url;
034:                this .roleId = roleId;
035:                this .requestedMemberships = requestedMemberships;
036:            }
037:
038:            public String getName() {
039:                return cId.getName();
040:            }
041:
042:            public String getUrl() {
043:                return url;
044:            }
045:
046:            public String getRole() {
047:                if (roleId != null) {
048:                    return roleId.toString();
049:                } else {
050:                    try {
051:                        FacesContext fc = FacesContext.getCurrentInstance();
052:                        ResourceBundle rb = ResourceBundle
053:                                .getBundle(
054:                                        "com.sun.portal.app.communityportlets.bundle.CommunityMembership",
055:                                        fc.getViewRoot().getLocale());
056:                        return rb.getString("disabled");
057:                    } catch (MissingResourceException mre) {
058:                        return "disabled";
059:                    }
060:                }
061:            }
062:
063:            public String getRequestedMemberships() {
064:                return Integer.toString(requestedMemberships);
065:            }
066:
067:            public String getRequestedMembershipsText() {
068:                try {
069:                    FacesContext fc = FacesContext.getCurrentInstance();
070:                    ResourceBundle rb = ResourceBundle
071:                            .getBundle(
072:                                    "com.sun.portal.app.communityportlets.bundle.CommunityMembership",
073:                                    fc.getViewRoot().getLocale());
074:                    Object[] args = { (String) Integer
075:                            .toString(requestedMemberships) };
076:                    if (requestedMemberships == 1) {
077:                        return MessageFormat.format(rb
078:                                .getString("requested_membership"), args);
079:                    } else {
080:                        return MessageFormat.format(rb
081:                                .getString("requested_memberships"), args);
082:                    }
083:                } catch (MissingResourceException mre) {
084:                    return Integer.toString(requestedMemberships);
085:                }
086:            }
087:
088:            public boolean getIsOwner() {
089:                if (roleId != null) {
090:                    return (roleId.equals(RoleId.OWNER_ROLE)) ? true : false;
091:                } else {
092:                    return false;
093:                }
094:            }
095:
096:            public boolean getIsPending() {
097:                if (roleId != null) {
098:                    return (roleId.equals(RoleId.PENDING_ROLE)) ? true : false;
099:                } else {
100:                    return false;
101:                }
102:            }
103:
104:            public boolean getIsInvited() {
105:                if (roleId != null) {
106:                    return (roleId.equals(RoleId.INVITED_ROLE)) ? true : false;
107:                } else {
108:                    return false;
109:                }
110:            }
111:
112:            public boolean getIsRejected() {
113:                if (roleId != null) {
114:                    return (roleId.equals(RoleId.REJECTED_ROLE)) ? true : false;
115:                } else {
116:                    return false;
117:                }
118:            }
119:
120:            public boolean getIsBanned() {
121:                if (roleId != null) {
122:                    return (roleId.equals(RoleId.BANNED_ROLE)) ? true : false;
123:                } else {
124:                    return false;
125:                }
126:            }
127:
128:            public boolean getIsDisabled() {
129:                if (roleId == null) {
130:                    return true;
131:                } else {
132:                    return false;
133:                }
134:            }
135:
136:            public int compareTo(Object o) {
137:                CommunityMembershipEntry cme = (CommunityMembershipEntry) o;
138:                return getName().compareTo(cme.getName());
139:            }
140:
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.