Source Code Cross Referenced for StartForgotPassword.java in  » Content-Management-System » dspace » org » dspace » app » xmlui » aspect » eperson » 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 » dspace » org.dspace.app.xmlui.aspect.eperson 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * StartForgotPassword.java
003:         *
004:         * Version: $Revision: 1.8 $
005:         *
006:         * Date: $Date: 2006/08/08 20:57:24 $
007:         *
008:         * Copyright (c) 2002, Hewlett-Packard Company and Massachusetts
009:         * Institute of Technology.  All rights reserved.
010:         *
011:         * Redistribution and use in source and binary forms, with or without
012:         * modification, are permitted provided that the following conditions are
013:         * met:
014:         *
015:         * - Redistributions of source code must retain the above copyright
016:         * notice, this list of conditions and the following disclaimer.
017:         *
018:         * - Redistributions in binary form must reproduce the above copyright
019:         * notice, this list of conditions and the following disclaimer in the
020:         * documentation and/or other materials provided with the distribution.
021:         *
022:         * - Neither the name of the Hewlett-Packard Company nor the name of the
023:         * Massachusetts Institute of Technology nor the names of their
024:         * contributors may be used to endorse or promote products derived from
025:         * this software without specific prior written permission.
026:         *
027:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
028:         * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
029:         * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
030:         * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
031:         * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
032:         * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
033:         * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
034:         * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
035:         * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
036:         * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
037:         * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
038:         * DAMAGE.
039:         */
040:
041:        package org.dspace.app.xmlui.aspect.eperson;
042:
043:        import java.io.IOException;
044:        import java.util.ArrayList;
045:        import java.util.Arrays;
046:        import java.util.Map;
047:
048:        import org.apache.avalon.framework.parameters.Parameters;
049:        import org.apache.cocoon.ProcessingException;
050:        import org.apache.cocoon.environment.SourceResolver;
051:        import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
052:        import org.dspace.app.xmlui.wing.Message;
053:        import org.dspace.app.xmlui.wing.WingException;
054:        import org.dspace.app.xmlui.wing.element.Body;
055:        import org.dspace.app.xmlui.wing.element.Division;
056:        import org.dspace.app.xmlui.wing.element.Item;
057:        import org.dspace.app.xmlui.wing.element.List;
058:        import org.dspace.app.xmlui.wing.element.PageMeta;
059:        import org.dspace.app.xmlui.wing.element.Text;
060:        import org.xml.sax.SAXException;
061:
062:        /**
063:         * Display the forgot password form, allowing the user to enter 
064:         * in an email address and have the system verify the email address
065:         * before allowing the user to reset their password.
066:         * 
067:         * There are two parameters that may be given to the form:
068:         * 
069:         * email - The email of the forgotten account
070:         * 
071:         * retry - A boolean value indicating that the previously entered email was invalid.
072:         * 
073:         * @author Scott Phillips
074:         */
075:        public class StartForgotPassword extends AbstractDSpaceTransformer {
076:            /** Language strings */
077:            private final static Message T_title = message("xmlui.EPerson.StartForgotPassword.title");
078:
079:            private final static Message T_dspace_home = message("xmlui.general.dspace_home");
080:
081:            private final static Message T_trail_forgot_password = message("xmlui.EPerson.trail_forgot_password");
082:
083:            private final static Message T_head = message("xmlui.EPerson.StartForgotPassword.head");
084:
085:            private final static Message T_para1 = message("xmlui.EPerson.StartForgotPassword.para1");
086:
087:            private final static Message T_email_address = message("xmlui.EPerson.StartForgotPassword.email_address");
088:
089:            private final static Message T_email_address_help = message("xmlui.EPerson.StartForgotPassword.email_address_help");
090:
091:            private final static Message T_error_not_found = message("xmlui.EPerson.StartForgotPassword.error_not_found");
092:
093:            private final static Message T_submit = message("xmlui.EPerson.StartForgotPassword.submit");
094:
095:            /** The email of the forgotten account */
096:            private String email;
097:
098:            /** A list of fields in error */
099:            private java.util.List<String> errors;
100:
101:            public void setup(SourceResolver resolver, Map objectModel,
102:                    String src, Parameters parameters)
103:                    throws ProcessingException, SAXException, IOException {
104:                super .setup(resolver, objectModel, src, parameters);
105:
106:                this .email = parameters.getParameter("email", "");
107:
108:                String errors = parameters.getParameter("errors", "");
109:                if (errors.length() > 0)
110:                    this .errors = Arrays.asList(errors.split(","));
111:                else
112:                    this .errors = new ArrayList<String>();
113:            }
114:
115:            public void addPageMeta(PageMeta pageMeta) throws WingException {
116:                // Set the page title
117:                pageMeta.addMetadata("title").addContent(T_title);
118:
119:                pageMeta.addTrailLink(contextPath + "/", T_dspace_home);
120:                pageMeta.addTrail().addContent(T_trail_forgot_password);
121:            }
122:
123:            public void addBody(Body body) throws WingException {
124:
125:                Division forgot = body.addInteractiveDivision(
126:                        "start-forgot-password", contextPath + "/forgot",
127:                        Division.METHOD_POST, "primary");
128:
129:                forgot.setHead(T_head);
130:
131:                EPersonUtils.forgottProgressList(forgot, 1);
132:
133:                forgot.addPara(T_para1);
134:
135:                List form = forgot.addList("form", List.TYPE_FORM);
136:
137:                Text email = form.addItem().addText("email");
138:                email.setRequired();
139:                email.setLabel(T_email_address);
140:                email.setHelp(T_email_address_help);
141:
142:                // Prefill with invalid email if this is a retry attempt.
143:                if (email != null)
144:                    email.setValue(this .email);
145:                if (errors.contains("email"))
146:                    email.addError(T_error_not_found);
147:
148:                Item submit = form.addItem();
149:                submit.addButton("submit").setValue(T_submit);
150:
151:                forgot.addHidden("eperson-continue").setValue(knot.getId());
152:            }
153:
154:            /**
155:             * Recycle
156:             */
157:            public void recycle() {
158:                this.email = null;
159:                super.recycle();
160:            }
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.