Source Code Cross Referenced for Profile.java in  » Content-Management-System » webman » de » webman » acl » 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 » Content Management System » webman » de.webman.acl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package de.webman.acl;
002:
003:        import com.teamkonzept.lib.ErrorCodes;
004:        import com.teamkonzept.lib.TKException;
005:        import com.teamkonzept.lib.TKVector;
006:        import de.webman.acl.db.LoginDBData;
007:        import com.teamkonzept.webman.mainint.events.TKUserException;
008:        import com.teamkonzept.webman.mainint.events.UserCodes;
009:
010:        /**
011:         * A profile is a group of users. It may have sub-profiles as well as a parent profile.
012:         *
013:         * @version 1.0
014:         * @since 1.0
015:         * @author © 2001 Webman AG
016:         */
017:        public class Profile extends Login {
018:
019:            // $Header: /cvsroot/webman-cms/source/webman/de/webman/acl/Profile.java,v 1.1 2001/08/20 08:25:07 mischa Exp $
020:
021:            // Constructors
022:
023:            /**
024:             * Provide instantion only to package classes or subclasses.
025:             *
026:             * @param data the initial profile data.
027:             */
028:            protected Profile(LoginDBData data) {
029:                super (data);
030:            }
031:
032:            // Method implementations
033:
034:            /**
035:             * Returns the factory of the object.
036:             *
037:             * @return the factory of the object.
038:             * @exception com.teamkonzept.lib.TKException if an error occured during factory retrieval.
039:             */
040:            public final ObjectFactory getFactory() throws TKException {
041:                return ProfileFactory.getInstance();
042:            }
043:
044:            /**
045:             * Checks wether this login object represents a user.
046:             *
047:             * @return <CODE>false</CODE>.
048:             */
049:            public final boolean isUser() {
050:                return false;
051:            }
052:
053:            /**
054:             * Checks wether this login object represents a profile.
055:             *
056:             * @return <CODE>true</CODE>.
057:             */
058:            public final boolean isProfile() {
059:                return true;
060:            }
061:
062:            /**
063:             * Checks wether this login object is a parent of the given login object.
064:             *
065:             * @param login the login object.
066:             * @return <CODE>true</CODE> if this login object is a parent of the
067:             * given login object, otherwise <CODE>false</CODE>.
068:             * @exception com.teamkonzept.lib.TKException if an error occured during login retrieval.
069:             */
070:            public final boolean isParent(Login login) throws TKException {
071:                // Check children.
072:                if (hasChild(login)) {
073:                    return true;
074:                }
075:
076:                // Check grandchildren.
077:                TKVector children = getChildren();
078:
079:                if (children != null) {
080:                    int index = 0;
081:                    int size = children.size();
082:
083:                    while (index < size) {
084:                        if (((Login) children.elementAt(index)).isParent(login)) {
085:                            return true;
086:                        }
087:
088:                        index++;
089:                    }
090:                }
091:
092:                // No such child or grandchild.
093:                return false;
094:            }
095:
096:            /**
097:             * Checks wether the given login is a member of this profile.
098:             *
099:             * @param login the login.
100:             * @return <CODE>true</CODE> if the given login is a member of this profile,
101:             * otherwise <CODE>false</CODE>.
102:             * @exception com.teamkonzept.lib.TKException if an error occured during login retrieval.
103:             * @deprecated
104:             * @see #hasChild(Login)
105:             */
106:            public final boolean isMember(Login login) throws TKException {
107:                return hasChild(login);
108:            }
109:
110:            /**
111:             * Returns all children logins.
112:             *
113:             * @return all children logins.
114:             * @exception com.teamkonzept.lib.TKException if an error occured during login retrieval.
115:             */
116:            public final TKVector getChildren() throws TKException {
117:                return LoginFactory.getInstance().getObjects(
118:                        super .getAssociations());
119:            }
120:
121:            /**
122:             * Associates the given child login with the profile.
123:             *
124:             * @param child the child login.
125:             * @exception com.teamkonzept.lib.TKException if an error occured during login retrieval
126:             * or the given child login is a parent of the profile.
127:             */
128:            public final void addChild(Login child) throws TKException {
129:                // Perform self check.
130:                if (child.equals(this )) {
131:                    throw new TKUserException("A group cannot contain itself.",
132:                            UserCodes.SELF_RELATION, ErrorCodes.USER_SEVERITY,
133:                            true, null);
134:                }
135:
136:                // Perform cycle check.
137:                if (child.isParent(this )) {
138:                    throw new TKUserException("The group '" + child.getName()
139:                            + "' is already contains this group.",
140:                            UserCodes.CYCLIC_RELATION,
141:                            ErrorCodes.USER_SEVERITY, true,
142:                            new Object[] { child.getName() }, null);
143:                }
144:
145:                // Add child.
146:                super .addAssociation(child);
147:
148:                // Notify child.
149:                child.updatedParents();
150:            }
151:
152:            /**
153:             * Removes the association with the given child login.
154:             *
155:             * @param child the child login.
156:             * @exception com.teamkonzept.lib.TKException if an error occured during login retrieval.
157:             */
158:            public final void removeChild(Login child) throws TKException {
159:                // Remove child.
160:                super .removeAssociation(child);
161:
162:                // Notify child.
163:                child.updatedParents();
164:            }
165:
166:            /**
167:             * Removes the association with all children logins.
168:             *
169:             * @exception com.teamkonzept.lib.TKException if an error occured during login retrieval.
170:             */
171:            public final void removeChildren() throws TKException {
172:                // Get all children.
173:                TKVector children = LoginFactory.getInstance().getObjects(
174:                        super .getAssociations());
175:
176:                // Remove all children.
177:                super .removeAssociations();
178:
179:                // Notify all children.
180:                if (children != null) {
181:                    int index = 0;
182:                    int size = children.size();
183:
184:                    while (index < size) {
185:                        ((Login) children.elementAt(index++)).updatedParents();
186:                    }
187:                }
188:            }
189:
190:            /**
191:             * Checks wether there is an association with the given child login.
192:             *
193:             * @param login the child login.
194:             * @return <CODE>true</CODE> if there is an association with the
195:             * given child login, otherwise <CODE>false</CODE>.
196:             * @exception com.teamkonzept.lib.TKException if an error occured during login retrieval.
197:             */
198:            public final boolean hasChild(Login login) throws TKException {
199:                return super.containsAssociation(login);
200:            }
201:
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.