From e0dda815e5a3f12bf04f090f7d7f505edf54b2de Mon Sep 17 00:00:00 2001 From: Andy Wu Date: Fri, 13 Nov 2015 13:23:36 +0800 Subject: [PATCH 1/3] [bndtools] blade.hook.jsp demo --- bndtools/blade.hook.jsp/.classpath | 7 + bndtools/blade.hook.jsp/.project | 23 +++ bndtools/blade.hook.jsp/bnd.bnd | 7 + bndtools/blade.hook.jsp/resources/login.jsp | 178 ++++++++++++++++++++ bndtools/blade.hook.jsp/src/.gitkeep | 0 bndtools/cnf/local/index.xml | 66 +------- bndtools/cnf/local/index.xml.sha | 2 +- bndtools/cnf/release/index.xml.sha | 2 +- 8 files changed, 218 insertions(+), 67 deletions(-) create mode 100644 bndtools/blade.hook.jsp/.classpath create mode 100644 bndtools/blade.hook.jsp/.project create mode 100644 bndtools/blade.hook.jsp/bnd.bnd create mode 100644 bndtools/blade.hook.jsp/resources/login.jsp create mode 100644 bndtools/blade.hook.jsp/src/.gitkeep diff --git a/bndtools/blade.hook.jsp/.classpath b/bndtools/blade.hook.jsp/.classpath new file mode 100644 index 0000000..8578d2f --- /dev/null +++ b/bndtools/blade.hook.jsp/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bndtools/blade.hook.jsp/.project b/bndtools/blade.hook.jsp/.project new file mode 100644 index 0000000..5d66818 --- /dev/null +++ b/bndtools/blade.hook.jsp/.project @@ -0,0 +1,23 @@ + + + blade.hook.jsp + + + + + + org.eclipse.jdt.core.javabuilder + + + + + bndtools.core.bndbuilder + + + + + + org.eclipse.jdt.core.javanature + bndtools.core.bndnature + + diff --git a/bndtools/blade.hook.jsp/bnd.bnd b/bndtools/blade.hook.jsp/bnd.bnd new file mode 100644 index 0000000..bdf6dbc --- /dev/null +++ b/bndtools/blade.hook.jsp/bnd.bnd @@ -0,0 +1,7 @@ +Bundle-Name: Blade Hook Jsp +Bundle-SymbolicName: blade.hook.jsp +Bundle-Version: 1.0.0.${tstamp} +Fragment-Host: com.liferay.login.web;bundle-version="1.0.0" +-includeresource:\ + META-INF/resources=resources +-sources: true diff --git a/bndtools/blade.hook.jsp/resources/login.jsp b/bndtools/blade.hook.jsp/resources/login.jsp new file mode 100644 index 0000000..1f8392a --- /dev/null +++ b/bndtools/blade.hook.jsp/resources/login.jsp @@ -0,0 +1,178 @@ +<%-- +/** + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ +--%> + +<%@ include file="/init.jsp" %> +

changed

+ + + + <% + String signedInAs = HtmlUtil.escape(user.getFullName()); + + if (themeDisplay.isShowMyAccountIcon() && (themeDisplay.getURLMyAccount() != null)) { + String myAccountURL = String.valueOf(themeDisplay.getURLMyAccount()); + + signedInAs = "" + signedInAs + ""; + } + %> + + + + + + <% + String redirect = ParamUtil.getString(request, "redirect"); + + String login = LoginUtil.getLogin(request, "login", company); + String password = StringPool.BLANK; + boolean rememberMe = ParamUtil.getBoolean(request, "rememberMe"); + + if (Validator.isNull(authType)) { + authType = company.getAuthType(); + } + %> + + + + + + + + + + + + <% + String userEmailAddress = (String)SessionMessages.get(request, "userAdded"); + String userPassword = (String)SessionMessages.get(request, "userAddedPassword"); + %> + +
+ + + + + + + + + + + + + + + + +
+
+ + + <% + String userEmailAddress = (String)SessionMessages.get(request, "userPending"); + %> + +
+ +
+
+
+ + + + + + + + + + + + <% + UserLockoutException.PasswordPolicyLockout ule = (UserLockoutException.PasswordPolicyLockout)errorException; + %> + + + + + + + + + + <% + String loginLabel = null; + + if (authType.equals(CompanyConstants.AUTH_TYPE_EA)) { + loginLabel = "email-address"; + } + else if (authType.equals(CompanyConstants.AUTH_TYPE_SN)) { + loginLabel = "screen-name"; + } + else if (authType.equals(CompanyConstants.AUTH_TYPE_ID)) { + loginLabel = "id"; + } + %> + + + + + + + + + + + + + + + + + + + +
+ + + + + var form = AUI.$(document.fm); + + form.on( + 'submit', + function(event) { + var redirect = form.fm('redirect'); + + if (redirect) { + var redirectVal = redirect.val(); + + redirect.val(redirectVal + window.location.hash); + } + + submitForm(form); + } + ); + + form.fm('password').on( + 'keypress', + function(event) { + Liferay.Util.showCapsLock(event, 'passwordCapsLockSpan'); + } + ); + +
+
\ No newline at end of file diff --git a/bndtools/blade.hook.jsp/src/.gitkeep b/bndtools/blade.hook.jsp/src/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/bndtools/cnf/local/index.xml b/bndtools/cnf/local/index.xml index 564fa4b..346ce79 100644 --- a/bndtools/cnf/local/index.xml +++ b/bndtools/cnf/local/index.xml @@ -1,69 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/bndtools/cnf/local/index.xml.sha b/bndtools/cnf/local/index.xml.sha index e7b2f0a..0da62c2 100644 --- a/bndtools/cnf/local/index.xml.sha +++ b/bndtools/cnf/local/index.xml.sha @@ -1 +1 @@ -c3a6d4105c7b6aab34e86ab6df8a81931d49aec079db1b2378dae01c279de233 \ No newline at end of file +89f8c521633e7471dcee33049047787958f724cc4b815b88bb92d0f39aa3db0f \ No newline at end of file diff --git a/bndtools/cnf/release/index.xml.sha b/bndtools/cnf/release/index.xml.sha index f2b26bf..2771b15 100644 --- a/bndtools/cnf/release/index.xml.sha +++ b/bndtools/cnf/release/index.xml.sha @@ -1 +1 @@ -262a924c4164db96f2409bfbe8d20793eb0c91a51c3dcd7c2160cde2bac8a492 \ No newline at end of file +b699f269b1871b7ef42e54b5ceb7529989f9474ffa4217c696e5ad333ac8936c \ No newline at end of file From 067c112f4ebfc267ce7b1dd5499e83b97bbc7a7a Mon Sep 17 00:00:00 2001 From: Carlos Sierra Date: Tue, 17 Nov 2015 12:59:47 +0100 Subject: [PATCH 2/3] Correct imports --- maven/blade.jsf.portlet.ds/pom.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/maven/blade.jsf.portlet.ds/pom.xml b/maven/blade.jsf.portlet.ds/pom.xml index bfb96d1..6aa802d 100644 --- a/maven/blade.jsf.portlet.ds/pom.xml +++ b/maven/blade.jsf.portlet.ds/pom.xml @@ -40,6 +40,11 @@ org.osgi.compendium provided + + org.osgi + org.osgi.core + 6.0.0 + @@ -54,7 +59,7 @@ true {maven-resources} blade.portlet - javax.portlet;version="[2.0,3)",javax.servlet;version="[2.5,4)" + javax.portlet;version="[2.0,3)",javax.servlet;version="[2.5,4)",com.liferay.portlet.model,com.liferay.staging.portlet.data.handler,com.liferay.portlet.exportimport.lar,org.osgi.framework,org.osgi.framework.wiring <_dsannotations>* From f97c013a53ab8c45bafeaabbb76e5535d7e3c4eb Mon Sep 17 00:00:00 2001 From: Carlos Sierra Date: Wed, 18 Nov 2015 12:44:12 +0100 Subject: [PATCH 3/3] =?UTF-8?q?OJO=20que=20no=20s=C3=A9=20lo=20que=20estoy?= =?UTF-8?q?=20haciendo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maven/blade.jsf.portlet.ds/pom.xml | 39 ++++++++++++++++++- .../main/java/blade/portlet/JSFPortletDS.java | 3 +- .../main/resources/WEB-INF/faces-config.xml | 9 +++++ .../src/main/resources/WEB-INF/web.xml | 6 +-- 4 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 maven/blade.jsf.portlet.ds/src/main/resources/WEB-INF/faces-config.xml diff --git a/maven/blade.jsf.portlet.ds/pom.xml b/maven/blade.jsf.portlet.ds/pom.xml index 6aa802d..a0f524d 100644 --- a/maven/blade.jsf.portlet.ds/pom.xml +++ b/maven/blade.jsf.portlet.ds/pom.xml @@ -25,6 +25,16 @@ com.sun.faces jsf-impl + + com.liferay.portal + util-bridges + 7.0.0-SNAPSHOT + + + com.liferay.portal + util-java + 7.0.0-SNAPSHOT + javax.portlet portlet-api @@ -59,7 +69,34 @@ true {maven-resources} blade.portlet - javax.portlet;version="[2.0,3)",javax.servlet;version="[2.5,4)",com.liferay.portlet.model,com.liferay.staging.portlet.data.handler,com.liferay.portlet.exportimport.lar,org.osgi.framework,org.osgi.framework.wiring + + javax.naming, + javax.portlet;version="[2.0,3)", + javax.portlet.filter;version="[2.0,3)", + javax.servlet;version="[2.5,4)", + javax.servlet.http;version="[2.5,4)", + javax.servlet.jsp, + javax.el, + javax.el.*, + javax.management, + javax.management.*, + javax.xml, + javax.xml.*, + com.liferay.portal.model, + com.liferay.staging.portlet.data.handler, + com.liferay.portlet.exportimport.lar, + com.liferay.portal.kernel.log, + com.liferay.portal.kernel.servlet.filters.invoker, + com.liferay.portal.kernel.servlet, + com.liferay.portal.kernel.portlet, + com.sun.el, + org.w3c.dom, + org.w3c.dom.*, + org.xml.sax, + org.xml.sax.*, + org.osgi.* + + /blade-portlet <_dsannotations>* diff --git a/maven/blade.jsf.portlet.ds/src/main/java/blade/portlet/JSFPortletDS.java b/maven/blade.jsf.portlet.ds/src/main/java/blade/portlet/JSFPortletDS.java index b8e86ab..c376be9 100644 --- a/maven/blade.jsf.portlet.ds/src/main/java/blade/portlet/JSFPortletDS.java +++ b/maven/blade.jsf.portlet.ds/src/main/java/blade/portlet/JSFPortletDS.java @@ -15,6 +15,7 @@ */ package blade.portlet; +import org.osgi.framework.BundleContext; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; @@ -35,7 +36,7 @@ public class JSFPortletDS extends GenericFacesPortlet { @Activate - public void activate() { + public void activate(BundleContext bundleContext) { System.err.println("!@#$ activated " + this); } } \ No newline at end of file diff --git a/maven/blade.jsf.portlet.ds/src/main/resources/WEB-INF/faces-config.xml b/maven/blade.jsf.portlet.ds/src/main/resources/WEB-INF/faces-config.xml new file mode 100644 index 0000000..87c1f85 --- /dev/null +++ b/maven/blade.jsf.portlet.ds/src/main/resources/WEB-INF/faces-config.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/maven/blade.jsf.portlet.ds/src/main/resources/WEB-INF/web.xml b/maven/blade.jsf.portlet.ds/src/main/resources/WEB-INF/web.xml index 01b993d..6b4fc4b 100644 --- a/maven/blade.jsf.portlet.ds/src/main/resources/WEB-INF/web.xml +++ b/maven/blade.jsf.portlet.ds/src/main/resources/WEB-INF/web.xml @@ -11,9 +11,9 @@ true --> - - com.sun.faces.config.ConfigureListener - + + + Faces Servlet