Source Code Cross Referenced for PageImpl.java in  » J2EE » Pustefix » de » schlund » pfixcore » editor2 » core » spring » internal » 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 » J2EE » Pustefix » de.schlund.pfixcore.editor2.core.spring.internal 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of PFIXCORE.
003:         *
004:         * PFIXCORE is free software; you can redistribute it and/or modify
005:         * it under the terms of the GNU Lesser General Public License as published by
006:         * the Free Software Foundation; either version 2 of the License, or
007:         * (at your option) any later version.
008:         *
009:         * PFIXCORE is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:         * GNU Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public License
015:         * along with PFIXCORE; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */
018:
019:        package de.schlund.pfixcore.editor2.core.spring.internal;
020:
021:        import java.util.ArrayList;
022:        import java.util.Collection;
023:        import java.util.Collections;
024:        import java.util.HashSet;
025:        import java.util.List;
026:
027:        import de.schlund.pfixcore.editor2.core.dom.AbstractPage;
028:        import de.schlund.pfixcore.editor2.core.dom.Page;
029:        import de.schlund.pfixcore.editor2.core.dom.Project;
030:        import de.schlund.pfixcore.editor2.core.dom.Target;
031:        import de.schlund.pfixcore.editor2.core.dom.Theme;
032:        import de.schlund.pfixcore.editor2.core.dom.ThemeList;
033:        import de.schlund.pfixcore.editor2.core.dom.Variant;
034:        import de.schlund.pfixcore.editor2.core.spring.PustefixTargetUpdateService;
035:        import de.schlund.pfixcore.editor2.core.spring.TargetFactoryService;
036:        import de.schlund.pfixcore.editor2.core.spring.ThemeFactoryService;
037:        import de.schlund.pfixxml.targets.PageInfoFactory;
038:        import de.schlund.pfixxml.targets.TargetGenerationException;
039:
040:        /**
041:         * Implementation of Page using classes from PFIXCORE
042:         * 
043:         * @author Sebastian Marsching <sebastian.marsching@1und1.de>
044:         */
045:        public class PageImpl extends AbstractPage implements  MutablePage {
046:            private String name;
047:
048:            private Variant variant;
049:
050:            private ProjectImpl project;
051:
052:            private TargetFactoryService targetfactory;
053:
054:            private PustefixTargetUpdateService updater;
055:
056:            private ArrayList<Page> childPages = new ArrayList<Page>();
057:
058:            private ThemeFactoryService themefactory;
059:
060:            private String handlerPath;
061:
062:            /**
063:             * Creates a page using the specified parameters
064:             * 
065:             * @param targetfactory
066:             *            Reference to the TargetFactoryService
067:             * @param updater
068:             *            Reference to the PustefixTargetUpdateService
069:             * @param themefactory
070:             *            Reference to the ThemesFactoryService
071:             * @param pageName
072:             *            Name of the page to create (without variant)
073:             * @param variant
074:             *            Variant of the page (or <code>null</code> for default)
075:             * @param project
076:             *            Project this page belongs to
077:             */
078:            public PageImpl(TargetFactoryService targetfactory,
079:                    PustefixTargetUpdateService updater,
080:                    ThemeFactoryService themefactory, String pageName,
081:                    Variant variant, Project project) {
082:                this .targetfactory = targetfactory;
083:                this .name = pageName;
084:                this .variant = variant;
085:
086:                // Cast without check
087:                // There is no other implementation of Project
088:                // and even if there was one, we would have no
089:                // chance than throwing an exception
090:                this .project = (ProjectImpl) project;
091:                this .updater = updater;
092:                this .themefactory = themefactory;
093:            }
094:
095:            /*
096:             * (non-Javadoc)
097:             * 
098:             * @see de.schlund.pfixcore.editor2.core.dom.Page#getName()
099:             */
100:            public String getName() {
101:                return this .name;
102:            }
103:
104:            /*
105:             * (non-Javadoc)
106:             * 
107:             * @see de.schlund.pfixcore.editor2.core.dom.Page#getVariant()
108:             */
109:            public Variant getVariant() {
110:                return this .variant;
111:            }
112:
113:            /*
114:             * (non-Javadoc)
115:             * 
116:             * @see de.schlund.pfixcore.editor2.core.dom.Page#getHandlerPath()
117:             */
118:            public String getHandlerPath() {
119:                return this .handlerPath;
120:            }
121:
122:            public void setHandlerPath(String path) {
123:                this .handlerPath = path;
124:            }
125:
126:            /*
127:             * (non-Javadoc)
128:             * 
129:             * @see de.schlund.pfixcore.editor2.core.dom.Page#getPageTarget()
130:             */
131:            public Target getPageTarget() {
132:                return this .targetfactory.getTargetFromPustefixTarget(this 
133:                        .getPfixTarget(), this .project);
134:            }
135:
136:            /*
137:             * (non-Javadoc)
138:             * 
139:             * @see de.schlund.pfixcore.editor2.core.dom.Page#getThemes()
140:             */
141:            public ThemeList getThemes() {
142:                de.schlund.pfixxml.targets.Target target = this .getPfixTarget();
143:                if (target == null) {
144:                    return new ThemeList() {
145:
146:                        public List<Theme> getThemes() {
147:                            return Collections.emptyList();
148:                        }
149:
150:                        public boolean includesTheme(Theme theme) {
151:                            return false;
152:                        }
153:
154:                        public boolean themeOverridesTheme(Theme t1, Theme t2) {
155:                            return false;
156:                        }
157:                    };
158:                }
159:                return new ThemeListImpl(this .themefactory, target.getThemes());
160:            }
161:
162:            /*
163:             * (non-Javadoc)
164:             * 
165:             * @see de.schlund.pfixcore.editor2.core.dom.Page#getProject()
166:             */
167:            public Project getProject() {
168:                return this .project;
169:            }
170:
171:            /*
172:             * (non-Javadoc)
173:             * 
174:             * @see de.schlund.pfixcore.editor2.core.dom.Page#getSubPages()
175:             */
176:            public Collection<Page> getSubPages() {
177:                HashSet<Page> pages = new HashSet<Page>(this .childPages);
178:                return pages;
179:            }
180:
181:            public void setSubPages(Collection<Page> pages) {
182:                this .childPages = new ArrayList<Page>(pages);
183:            }
184:
185:            public void registerForUpdate() {
186:                if (this .getPfixTarget() != null) {
187:                    this .updater.registerTargetForUpdate(this .getPfixTarget());
188:                }
189:            }
190:
191:            public void update() {
192:                if (this .getPfixTarget() == null) {
193:                    return;
194:                }
195:                try {
196:                    this .getPfixTarget().getValue();
197:                } catch (TargetGenerationException e) {
198:                    // Ignore errors during target generation
199:                }
200:            }
201:
202:            private de.schlund.pfixxml.targets.Target getPfixTarget() {
203:                return project.getTargetGenerator().getPageTargetTree()
204:                        .getTargetForPageInfo(
205:                                PageInfoFactory.getInstance().getPage(
206:                                        project.getTargetGenerator(),
207:                                        this.getName(),
208:                                        (variant == null) ? null : this.variant
209:                                                .getName()));
210:            }
211:
212:        }
w_w_w._ja_v___a2__s_._c__om___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.