Source Code Cross Referenced for FormSet.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » forms » 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 » Wiki Engine » JSPWiki » com.ecyrd.jspwiki.forms 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:            WikiForms - a WikiPage FORM handler for JSPWiki.
03:         
04:            Copyright (C) 2003 BaseN. 
05:
06:            JSPWiki Copyright (C) 2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
07:
08:            This program is free software; you can redistribute it and/or modify
09:            it under the terms of the GNU Lesser General Public License as published
10:            by the Free Software Foundation; either version 2.1 of the License, or
11:            (at your option) any later version.
12:         
13:            This program is distributed in the hope that it will be useful,
14:            but WITHOUT ANY WARRANTY; without even the implied warranty of
15:            MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16:            GNU Lesser General Public License for more details.
17:         
18:            You should have received a copy of the GNU Lesser General Public License
19:            along with this program; if not, write to the Free Software
20:         */
21:        package com.ecyrd.jspwiki.forms;
22:
23:        import com.ecyrd.jspwiki.*;
24:        import com.ecyrd.jspwiki.plugin.*;
25:        import java.util.*;
26:
27:        /**
28:         * FormSet is a companion WikiPlugin for Form. 
29:         * 
30:         * <p>The mandatory 'form' parameter specifies which form the variable
31:         * applies to.  Any other parameters are put directly into a FormInfo
32:         * object that will be available to a Form plugin called 'form'
33:         * (presumably invoked later on the same WikiPage).
34:         * 
35:         * <p>If the name of a FormSet parameter is the same as the name of
36:         * a Form plugin input element later on the same page, the Form will
37:         * consider the given value the default for the form field. (However,
38:         * the handler for the Form is free to use the value as it wishes, and
39:         * even override it.)
40:         *
41:         * <p>If the name of a parameter is not present in Form input fields,
42:         * the parameter is presumably meant for sending initial information
43:         * to the Form handler. If this is the case, you may want to specify the
44:         * <i>populate=''</i> in the Form <i>open</i> element, otherwise the
45:         * form won't be displayed on the first invocation.
46:         *  
47:         * <p>This object looks for a FormInfo object named
48:         * FORM_VALUES_CARRIER in the WikiContext. If found, it checks that
49:         * its name matches the 'form' parameter, and if it does, adds the
50:         * plugin parameters to the FormInfo. If the names don't match, the
51:         * old FormInfo is discarded and a new one is created. Only one
52:         * FormInfo is supported at a time. A practical consequence of this is
53:         * that a FormSet invocation only applies to the Form plugins that
54:         * follow it; any further Forms need new FormSet calls.
55:         *
56:         * @see FormInfo
57:         * @author ebu
58:         */
59:        public class FormSet implements  WikiPlugin {
60:            public String execute(WikiContext ctx, Map params)
61:                    throws PluginException {
62:                String formName = (String) params.get(FormElement.PARAM_FORM);
63:                if (formName == null || formName.trim().length() == 0) {
64:                    return "";
65:                }
66:
67:                FormInfo info = (FormInfo) ctx
68:                        .getVariable(FormElement.FORM_VALUES_CARRIER);
69:
70:                if (info == null || formName.equals(info.getName()) == false) {
71:                    info = new FormInfo();
72:                    ctx.setVariable(FormElement.FORM_VALUES_CARRIER, info);
73:                }
74:
75:                //
76:                //  Create a copy for the context.  Unfortunately we need to 
77:                //  create slightly modified copy, because otherwise on next
78:                //  invocation this might be coming from a cache; so we can't
79:                //  modify the original param string.
80:                //
81:                info.setName(formName);
82:                HashMap hm = new HashMap();
83:                hm.putAll(params);
84:
85:                hm.remove(FormElement.PARAM_FORM);
86:                info.addSubmission(hm);
87:
88:                return "";
89:            }
90:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.