Source Code Cross Referenced for RepositoryTreeModel.java in  » Content-Management-System » openedit » com » openedit » webui » tree » 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 » openedit » com.openedit.webui.tree 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:        Copyright (c) 2003 eInnovation Inc. All rights reserved
003:
004:        This library is free software; you can redistribute it and/or modify it under the terms
005:        of the GNU Lesser General Public License as published by the Free Software Foundation;
006:        either version 2.1 of the License, or (at your option) any later version.
007:
008:        This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
009:        without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
010:        See the GNU Lesser General Public License for more details.
011:         */
012:
013:        package com.openedit.webui.tree;
014:
015:        import org.openedit.repository.ContentItem;
016:        import org.openedit.repository.Repository;
017:        import org.openedit.repository.RepositoryException;
018:
019:        import com.openedit.OpenEditException;
020:        import com.openedit.OpenEditRuntimeException;
021:        import com.openedit.PageAccessListener;
022:        import com.openedit.page.Page;
023:        import com.openedit.page.manage.PageManager;
024:
025:        /**
026:         * This model represents a tree of site content.
027:         *
028:         * @author Matt Avery, mavery@einnovation.com
029:         */
030:        public class RepositoryTreeModel extends DefaultWebTreeModel implements 
031:                PageAccessListener {
032:            protected Repository fieldRepository;
033:            protected String fieldRootPath;
034:            protected PageManager fieldPageManager;
035:
036:            /**
037:             * Constructor for PageTreeModel.
038:             *
039:             * @param inSiteContext DOCUMENT ME!
040:             */
041:            public RepositoryTreeModel(Repository inRepository) {
042:                this (inRepository, "/");
043:            }
044:
045:            public RepositoryTreeModel(Repository inRepository,
046:                    String inRootPath) {
047:                super ();
048:                fieldRepository = inRepository;
049:                fieldRootPath = inRootPath;
050:            }
051:
052:            /* (non-Javadoc)
053:             * @see TreeModel#getRoot()
054:             */
055:            public Object getRoot() {
056:                if (fieldRoot == null) {
057:                    reload();
058:                }
059:
060:                return fieldRoot;
061:            }
062:
063:            /**
064:             * Find the page tree node at the given path.  This method will not automatically expand any
065:             * node in the tree if it is not already expanded.
066:             *
067:             * @param inPath The path (e.g. "abc/def/ghi.html")
068:             *
069:             * @return The node at the given path, or <code>null</code> if no node could be found that
070:             * 		   matched the given path
071:             */
072:            public RepositoryTreeNode findNode(String inPath) {
073:                return ((RepositoryTreeNode) getRoot()).findNode(inPath);
074:            }
075:
076:            /**
077:             *
078:             */
079:            public void reload() {
080:                ContentItem rootItem;
081:                try {
082:                    rootItem = getRepository().get(getRootPath());
083:                    //TODO: Add all the ignore paths depending on permissions
084:                    //At least handle directory level permissions _site.xconf
085:                    //TODO: Add user, page manager create basewebrequests
086:                } catch (RepositoryException e) {
087:                    throw new OpenEditRuntimeException(e);
088:                }
089:                RepositoryTreeNode newRoot = new RepositoryTreeNode(
090:                        getRepository(), rootItem);
091:                if (newRoot != null) {
092:                    newRoot.fieldFilter = getFilter();
093:                    newRoot.fieldPageManager = getPageManager();
094:                }
095:                fieldRoot = newRoot;
096:
097:            }
098:
099:            public Repository getRepository() {
100:                return fieldRepository;
101:            }
102:
103:            public void setRepository(Repository repository) {
104:                fieldRepository = repository;
105:            }
106:
107:            public String getRootPath() {
108:                return fieldRootPath;
109:            }
110:
111:            public void setRootPath(String rootPath) {
112:                fieldRootPath = rootPath;
113:            }
114:
115:            /**
116:             * DOCUMENT ME!
117:             *
118:             * @param inPage
119:             * @param inRevision
120:             *
121:             * @throws OpenEditException
122:             */
123:            public void pageAdded(Page inPage) {
124:                reload();
125:            }
126:
127:            /**
128:             * DOCUMENT ME!
129:             *
130:             * @param inPage
131:             * @param inRevision
132:             *
133:             * @throws OpenEditException
134:             */
135:            public void pageModified(Page inPage) {
136:                reload();
137:            }
138:
139:            /**
140:             * DOCUMENT ME!
141:             *
142:             * @param inPage
143:             * @param inRevision
144:             *
145:             * @throws OpenEditException
146:             */
147:            public void pageRemoved(Page inPage) {
148:                reload();
149:            }
150:
151:            /**
152:             * DOCUMENT ME!
153:             *
154:             * @param inPage
155:             *
156:             * @throws OpenEditException
157:             */
158:            public void pageRequested(Page inPage) {
159:                // do nothing
160:            }
161:
162:            protected boolean hasLoadedChildren(Object inRoot) {
163:                //Only look in nodes with already loaded children
164:                RepositoryTreeNode parent = (RepositoryTreeNode) inRoot;
165:                if (parent.fieldChildren == null) {
166:                    return false;
167:                }
168:
169:                return true;
170:            }
171:
172:            public PageManager getPageManager() {
173:                return fieldPageManager;
174:            }
175:
176:            public void setPageManager(PageManager inPageManager) {
177:                fieldPageManager = inPageManager;
178:            }
179:
180:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.