Author: hfnukal
Date: 2011-08-08 13:17:41 -0400 (Mon, 08 Aug 2011)
New Revision: 7009
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java
Log:
JBEPP-1001 Remember my login redirects at blank page
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2011-08-08
16:23:15 UTC (rev 7008)
+++
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2011-08-08
17:17:41 UTC (rev 7009)
@@ -121,7 +121,8 @@
<value>jar:/conf/gatein-nodetypes.xml</value>
<value>jar:/conf/mop-nodetypes.xml</value>
<value>jar:/conf/application-nodetypes.xml</value>
- <value>jar:/conf/content-nodetypes.xml</value>
+ <value>jar:/conf/content-nodetypes.xml</value>
+ <value>jar:/conf/autologin-nodetypes.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl 2011-08-08
16:23:15 UTC (rev 7008)
+++
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl 2011-08-08
17:17:41 UTC (rev 7009)
@@ -22,22 +22,20 @@
<div class="MiddleRightLoginDecorator">
<div class="LoginDecoratorBackground">
<div class="LoginDetailBox">
- <% uiform.begin(); %>
- <!--<form class="UIForm" id="$uicomponent.id"
name="loginForm" action="<%= rcontext.getRequestContextPath() +
"/login"%>" method="post" style="margin: 0px;">
- <input type="hidden" name="<%= uiform.ACTION %>"
value=""/>-->
+ <form class="UIForm" id="$uicomponent.id"
name="loginForm" action="<%= rcontext.getRequestContextPath() +
"/login"%>" method="post" style="margin: 0px;">
<input type="hidden" name="initialURI"
value="<%=requestPath %>"/>
<div class="VerticalLayout">
<table class="UIFormGrid">
<tr class="UserNameField">
<td
class="FieldLabel"><%=_ctx.appRes("UILoginForm.label.UserName")%></td>
- <td><% uiform.renderChild(0)%></td>
+ <td><input class="UserName"
name="username"/></td>
</tr>
<tr class="PasswordField" id="UIPortalLoginFormControl"
onkeypress="eXo.portal.UIPortalControl.onEnterPress(event)">
<td
class="FieldLabel"><%=_ctx.appRes("UILoginForm.label.password")%></td>
- <td><% uiform.renderChild(1)%></td>
+ <td><input class="Password" type="password"
name="password"/></td>
</tr>
<tr class="RememberField"
onkeypress="eXo.portal.UIPortalControl.onEnterPress(event)">
- <td class="FieldLabel"><%
uiform.renderChild(2)%></td>
+ <td class="FieldLabel"><input type="checkbox"
class="checkbox" value="true"
name="rememberme"/></td>
<td><%=_ctx.appRes("UILoginForm.label.RememberOnComputer")%></td>
</tr>
</table>
@@ -69,7 +67,7 @@
</table>
</div>
</div>
- <%uiform.end()%>
+ </form>
</div>
</div>
</div>
@@ -84,7 +82,6 @@
<script>
function login(ele) {
var formEle = eXo.core.DOMUtil.findAncestorByTagName(ele,'form');
- formEle.action = eXo.env.portal.context + "/login";
formEle.submit();
}
</script>
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java 2011-08-08
16:23:15 UTC (rev 7008)
+++
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java 2011-08-08
17:17:41 UTC (rev 7009)
@@ -20,17 +20,13 @@
package org.exoplatform.portal.webui.login;
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
-import org.exoplatform.web.login.InitiateLoginServlet;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormCheckBoxInput;
-import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.validator.MandatoryValidator;
/**
* Created by The eXo Platform SARL
@@ -38,58 +34,16 @@
* nhudinhthuan(a)exoplatform.com
* Jul 11, 2006
*/
-@ComponentConfig(lifecycle = UIFormLifecycle.class, template =
"system:/groovy/portal/webui/UILoginForm.gtmpl", events = {
- // @EventConfig(listeners = UILoginForm.SigninActionListener.class),
+@ComponentConfig(template = "system:/groovy/portal/webui/UILoginForm.gtmpl",
events = {
@EventConfig(phase = Phase.DECODE, listeners =
UIMaskWorkspace.CloseActionListener.class),
@EventConfig(phase = Phase.DECODE, listeners =
UILoginForm.ForgetPasswordActionListener.class)})
-public class UILoginForm extends UIForm
+public class UILoginForm extends UIComponent
{
- final static String USER_NAME = "username";
- final static String PASSWORD = "password";
-
public UILoginForm() throws Exception
{
- addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME,
null).addValidator(MandatoryValidator.class))
- .addUIFormInput(
- new UIFormStringInput(PASSWORD, PASSWORD,
null).setType(UIFormStringInput.PASSWORD_TYPE).addValidator(
- MandatoryValidator.class));
- addUIFormInput(new
UIFormCheckBoxInput<String>(InitiateLoginServlet.COOKIE_NAME,
- InitiateLoginServlet.COOKIE_NAME, Boolean.TRUE.toString()));
}
- static public class SigninActionListener extends EventListener<UILoginForm>
- {
-
- public void execute(Event<UILoginForm> event) throws Exception
- {
- // UILoginForm uiForm = event.getSource();
- // String username = uiForm.getUIStringInput(USER_NAME).getValue();
- // String password = uiForm.getUIStringInput(PASSWORD).getValue();
- // OrganizationService orgService =
uiForm.getApplicationComponent(OrganizationService.class);
- // boolean authentication =
orgService.getUserHandler().authenticate(username, password);
- // if(!authentication){
- // throw new MessageException(new
ApplicationMessage("UILoginForm.msg.Invalid-account", null));
- // }
- // PortalRequestContext prContext = Util.getPortalRequestContext();
- // HttpServletRequest request = prContext.getRequest();
- // HttpSession session = request.getSession();
- // session.setAttribute("authentication.username", username);
- // session.setAttribute("authentication.password", password);
- // UIPortal uiPortal = Util.getUIPortal();
- // prContext.setResponseComplete(true);
- // String portalName = uiPortal.getName() ;
- // HttpServletRequestWrapper wrapper = new
HttpServletRequestWrapper(request) ;
- // wrapper.getParameterMap().put("username", username) ;
- // wrapper.getParameterMap().put("password", password) ;
- // portalName = URLEncoder.encode(portalName, "UTF-8") ;
- // String redirect = request.getContextPath() + "/private/" +
portalName + "/";
- // prContext.getResponse().sendRedirect(redirect);
- }
-
- }
-
- //TODO: dang.tung - forget password
static public class ForgetPasswordActionListener extends
EventListener<UILoginForm>
{
public void execute(Event<UILoginForm> event) throws Exception
@@ -100,4 +54,18 @@
event.getRequestContext().addUIComponentToUpdateByAjax(uiLogin);
}
}
+
+ @Override
+ public void processDecode(WebuiRequestContext context) throws Exception
+ {
+ super.processDecode(context);
+ String action = context.getRequestParameter(context.getActionParameterName());
+ Event<UIComponent> event = createEvent(action, Event.Phase.DECODE, context);
+ if (event != null)
+ {
+ event.broadcast();
+ }
+ }
+
+
}