Source Code Cross Referenced for XSPModuleHelper.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » components » language » markup » xsp » 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 » apache lenya 2.0 » org.apache.cocoon.components.language.markup.xsp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.apache.cocoon.components.language.markup.xsp;
018:
019:        import org.apache.cocoon.components.modules.input.InputModuleHelper;
020:
021:        import org.xml.sax.ContentHandler;
022:        import org.xml.sax.SAXException;
023:        import org.xml.sax.helpers.AttributesImpl;
024:
025:        import java.util.Iterator;
026:        import java.util.Map;
027:
028:        /**
029:         * Helper class that caches references to InputModules for use in
030:         * XSPs. Works in conjunction with the input.xsl
031:         * logicsheet. References are obtained the first time a module is
032:         * accessed and kept until the page is completely displayed.
033:         *
034:         * @author <a href="mailto:haul@apache.org">Christian Haul</a>
035:         * @version CVS $Id: XSPModuleHelper.java 433543 2006-08-22 06:22:54Z crossley $
036:         */
037:        public class XSPModuleHelper extends InputModuleHelper {
038:
039:            private static final String PREFIX = "input";
040:            private static final String URI = "http://apache.org/cocoon/xsp/input/1.0";
041:
042:            /**
043:             * Output the request attribute values for a given name to the
044:             * content handler.
045:             *
046:             * @param objectModel The Map objectModel
047:             * @param contentHandler The SAX content handler
048:             * @param module a <code>String</code> value holding the module name
049:             * @param name a <code>String</code> value holding the attribute name
050:             * @exception SAXException If a SAX error occurs
051:             * @exception RuntimeException if an error occurs
052:             */
053:            public void getAttributeValues(Map objectModel,
054:                    ContentHandler contentHandler, String module, String name)
055:                    throws SAXException, RuntimeException {
056:
057:                AttributesImpl attr = new AttributesImpl();
058:                XSPObjectHelper.addAttribute(attr, "name", name);
059:
060:                XSPObjectHelper.start(URI, PREFIX, contentHandler,
061:                        "attribute-values", attr);
062:
063:                Object[] values = this .getAttributeValues(objectModel, module,
064:                        name, null);
065:
066:                if (values != null) {
067:                    for (int i = 0; i < values.length; i++) {
068:                        XSPObjectHelper.elementData(URI, PREFIX,
069:                                contentHandler, "value", String
070:                                        .valueOf(values[i]));
071:                    }
072:                }
073:
074:                XSPObjectHelper.end(URI, PREFIX, contentHandler,
075:                        "attribute-values");
076:            }
077:
078:            /**
079:             * Output attribute names for a given request
080:             *
081:             * @param objectModel The Map objectModel
082:             * @param contentHandler The SAX content handler
083:             * @param module the module's name
084:             * @exception SAXException If a SAX error occurs
085:             * @exception RuntimeException if an error occurs
086:             */
087:            public void getAttributeNames(Map objectModel,
088:                    ContentHandler contentHandler, String module)
089:                    throws SAXException, RuntimeException {
090:
091:                XSPObjectHelper.start(URI, PREFIX, contentHandler,
092:                        "attribute-names");
093:
094:                Iterator iter = this .getAttributeNames(objectModel, module);
095:                while (iter.hasNext()) {
096:                    String name = (String) iter.next();
097:                    XSPObjectHelper.elementData(URI, PREFIX, contentHandler,
098:                            "name", name);
099:                }
100:
101:                XSPObjectHelper.end(URI, PREFIX, contentHandler,
102:                        "attribute-names");
103:            }
104:
105:        }
www.__ja___v__a2s___.c_o___m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.