Source Code Cross Referenced for GenericConfigFailedLoginPageContext.java in  » Workflow-Engines » JFolder » org » jfolder » security » lifecycle » 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 » Workflow Engines » JFolder » org.jfolder.security.lifecycle 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JFolder, Copyright 2001-2006 Gary Steinmetz
003:         *
004:         * Distributable under LGPL license.
005:         * See terms of license at gnu.org.
006:         */
007:
008:        package org.jfolder.security.lifecycle;
009:
010:        //base classes
011:        import java.io.IOException;
012:        import java.util.HashMap;
013:        import javax.servlet.http.HttpServletRequest;
014:
015:        //project specific classes
016:        import org.jfolder.common.UnexpectedSystemException;
017:        import org.jfolder.common.utils.xml.LinearXPath;
018:        import org.jfolder.common.utils.xml.XMLHelper;
019:        import org.jfolder.common.web.template.ConsoleParameterContext;
020:        import org.jfolder.common.web.template.ConsoleTemplateContext;
021:        import org.jfolder.common.web.template.ConsoleTemplateParameters;
022:        import org.jfolder.common.web.template.SubmitActionContext;
023:        import org.jfolder.common.web.template.SubmitActionParameters;
024:        import org.jfolder.config.instance.ConfigInstance;
025:        import org.jfolder.config.instance.ConfigInstanceConfig;
026:        import org.jfolder.security.lifecycle.SecurityLifecycleHelper;
027:        import org.jfolder.security.model.UserHolder;
028:        import org.jfolder.services.config.ConfigService;
029:        import org.jfolder.services.config.ConfigServiceCaller;
030:        import org.jfolder.services.config.ConfigServiceCallerFactory;
031:
032:        //other classes
033:
034:        public class GenericConfigFailedLoginPageContext extends
035:                ConsoleTemplateContext {
036:
037:            //
038:            private final static LinearXPath XPATH_SECURITY_CONSOLE = LinearXPath
039:                    .r("security").b("console");
040:            private final static LinearXPath XPATH_SECURITY_CONSOLE_DEFAULT = XPATH_SECURITY_CONSOLE
041:                    .b("default");
042:            //
043:            private final static String BUTTON__LOGIN = "BUTTON__LOGIN";
044:
045:            //
046:            private UserHolder uh = null;
047:
048:            protected GenericConfigFailedLoginPageContext(UserHolder inUh) {
049:                //
050:                super ();
051:                //
052:                this .uh = inUh;
053:            }
054:
055:            //protected final static LoginPageContext newInstance(UserHolder inUh) {
056:            //    
057:            //    return new LoginPageContext(inUh);
058:            //}
059:
060:            public String getFromPage() {
061:                return ConsoleTemplateParameters.SERVLET_CONSOLE;
062:            }
063:
064:            public String getHandle() {
065:                return NULL_HANDLE;
066:            }
067:
068:            public String getHandleExtension() {
069:                throw new UnexpectedSystemException(
070:                        "This function should not be called in this class");
071:            }
072:
073:            protected void renderConsolePage() throws IOException {
074:
075:                //get dynamic values
076:                ConfigService cs = ConfigServiceCallerFactory
077:                        .getConfigService();
078:                ConfigInstanceConfig cic = cs
079:                        .accessConfig(ConfigInstance.SECURITY);
080:                boolean showDomain = cic.getPropertyAttribute(
081:                        ConfigInstance.STANDARD_CONTENT,
082:                        XPATH_SECURITY_CONSOLE, "show-domain", "").equals(
083:                        "true");
084:                String username = cic.getPropertyAttribute(
085:                        ConfigInstance.STANDARD_CONTENT,
086:                        XPATH_SECURITY_CONSOLE_DEFAULT, "username", "");
087:                String password = cic.getPropertyAttribute(
088:                        ConfigInstance.STANDARD_CONTENT,
089:                        XPATH_SECURITY_CONSOLE_DEFAULT, "password", "");
090:                String domain = cic.getPropertyAttribute(
091:                        ConfigInstance.STANDARD_CONTENT,
092:                        XPATH_SECURITY_CONSOLE_DEFAULT, "domain", "");
093:                if (!this .uh.getUserIdentity().isValid()) {
094:                    username = this .uh.getUserIdentity().getName();
095:                    password = "";
096:                }
097:
098:                //cm.close();
099:
100:                //render content
101:                HashMap attrs = new HashMap();
102:
103:                setColumnWidth(110);
104:
105:                startCommonPage();
106:
107:                printAndIndent("<table width=\"100%\" height=\"100%\" align=\"center\">");
108:                printAndIndent("<tr>");
109:                printAndIndent("<td width=\"100%\" height=\"100%\" align=\"center\">");
110:                //
111:                attrs.clear();
112:                attrs.put("border", "1");
113:                attrs.put("bordercolor", "#666666");
114:                startEnclosingTableAndRowAndCell(attrs);
115:                //
116:                startAndEndStretchTableAndRowAndCell("<hr color=\"#FFFFF\"/>");
117:                //
118:                attrs.clear();
119:                attrs.put("style",
120:                        "font-size: 22; font-family: Arial; color: #000000;");
121:                attrs.put("align", "center");
122:                startAndEndSimpleTableAndRowAndCell(3, "Welcome to JFolder!",
123:                        attrs);
124:                //
125:                startAndEndStretchTableAndRowAndCell("<hr/>");
126:                //
127:                startTable(3);
128:                startRow();
129:                attrs.clear();
130:                attrs.put("style",
131:                        "font-size: 16; font-family: Arial; color: #000000;");
132:                startAndEndCell(1, XMLHelper.NBSP_XML + "User Name:", attrs);
133:                attrs.clear();
134:                attrs.put("style",
135:                        "font-size: 16; font-family: Arial; color: #000000;");
136:                attrs.put("align", "center");
137:                startAndEndCell(2, "<input type=\"text\" name=\""
138:                        + SecurityLifecycleHelper.USERNAME + "\" value=\""
139:                        + XMLHelper.fromStringToCData(username) + "\"/>", attrs);
140:                endRow();
141:                endTable();
142:                //
143:                startAndEndStretchTableAndRowAndCell("<hr color=\"#FFFFF\"/>");
144:                //
145:                startTable(3);
146:                startRow();
147:                attrs.clear();
148:                attrs.put("style",
149:                        "font-size: 16; font-family: Arial; color: #000000;");
150:                startAndEndCell(1, XMLHelper.NBSP_XML + "Password:", attrs);
151:                attrs.clear();
152:                attrs.put("style",
153:                        "font-size: 16; font-family: Arial; color: #000000;");
154:                attrs.put("align", "center");
155:                startAndEndCell(2, "<input type=\"password\" name=\""
156:                        + SecurityLifecycleHelper.PASSWORD + "\" value=\""
157:                        + XMLHelper.fromStringToCData(password) + "\"/>", attrs);
158:                endRow();
159:                endTable();
160:                //
161:                if (showDomain) {
162:                    startAndEndStretchTableAndRowAndCell("<hr color=\"#FFFFF\"/>");
163:                    //
164:                    startTable(3);
165:                    startRow();
166:                    attrs.clear();
167:                    attrs
168:                            .put("style",
169:                                    "font-size: 16; font-family: Arial; color: #000000;");
170:                    startAndEndCell(1, XMLHelper.NBSP_XML + "Domain:", attrs);
171:                    attrs.clear();
172:                    attrs
173:                            .put("style",
174:                                    "font-size: 16; font-family: Arial; color: #000000;");
175:                    attrs.put("align", "center");
176:                    startAndEndCell(2, "<input type=\"text\" name=\""
177:                            + SecurityLifecycleHelper.DOMAIN + "\" value=\""
178:                            + XMLHelper.fromStringToCData(domain) + "\"/>",
179:                            attrs);
180:                    endRow();
181:                    endTable();
182:                }
183:                //
184:                startAndEndStretchTableAndRowAndCell("<hr/>");
185:                //
186:                SubmitActionContext sacLogin = SubmitActionContext
187:                        .newInstance(this );
188:                sacLogin.addAction(ConsoleParameterContext.FIRST_INPUT,
189:                        singleQuotes(SubmitActionParameters.LOGIN));
190:
191:                SubmitActionContext sacLicense = SubmitActionContext
192:                        .newInstance(this );
193:                sacLicense.addAction(ConsoleParameterContext.FIRST_INPUT,
194:                        singleQuotes(SubmitActionParameters.GET_SUPPORT));
195:                //sacLicense.setTarget(SubmitActionContext.TARGET_BLANK);
196:                sacLicense
197:                        .setGoToPage("http://www.jfolder.com/support/support.html");
198:
199:                startTable(3);
200:                startRow();
201:                //startAndEndCell(1, "");
202:                attrs.clear();
203:                attrs.put("align", "center");
204:                startCell(3, attrs);
205:                createButton(BUTTON__LOGIN, "Login", 150,
206:                        submitActionCall(sacLogin), null, null, null, null);
207:                endCell();
208:                //attrs.clear();
209:                //attrs.put("align", "center");
210:                //startCell(1, attrs);
211:                //simpleAndPrint(padNbsp(1));
212:                ////createButton(null, "Support", 75, sacLicense.submitActionCall(),
213:                ////    null, null, null, null);
214:                //endCell();
215:                endRow();
216:                endTable();
217:                //
218:                startAndEndStretchTableAndRowAndCell("<hr color=\"#FFFFF\"/>");
219:                //
220:                endEnclosingTableAndRowAndCell();
221:                //
222:                revertAndPrint("</td>");
223:                revertAndPrint("</tr>");
224:                revertAndPrint("</table>");
225:
226:                endCommonPage();
227:            }
228:
229:            //public String getDisplayUserName() {
230:            //
231:            //    String returnString = null;
232:            //
233:            //    if (isNotFirstLoginAttempt()) {
234:            //        returnString = getUser().getName();
235:            //    }
236:            //    else {
237:            //        ConfigManager cm = ConfigManagerFactory.getConfigManager();
238:            //        returnString = cm.getPropertyAttribute(
239:            //            "/project-properties[1]/security[1]/console[1]/default[1]",
240:            //            "username", null);
241:            //        cm.close();
242:            //        //returnString = PFUtils.getPFProperty(
243:            //"pf.login.default.username");
244:            //        if (returnString == null) {
245:            //            returnString = "";
246:            //        }
247:            //    }
248:            //
249:            //    return returnString;
250:            //}
251:
252:            //public String getDisplayPassword() {
253:            //
254:            //    String returnString = null;
255:            //
256:            //    if (isNotFirstLoginAttempt()) {
257:            //        returnString = "";
258:            //    }
259:            //    else {
260:            //        ConfigManager cm = ConfigManagerFactory.getConfigManager();
261:            //        returnString = cm.getPropertyAttribute(
262:            //            "/project-properties[1]/security[1]/console[1]/default[1]",
263:            //            "password", null);
264:            //        cm.close();
265:            //        //returnString = PFUtils.getPFProperty(
266:            //"pf.login.default.password");
267:            //        if (returnString == null) {
268:            //            returnString = "";
269:            //        }
270:            //    }
271:            //
272:            //    return returnString;
273:            //}
274:
275:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.