[picketlink-commits] Picketlink SVN: r1473 - in console/trunk/gui/src/main: java/org/picketlink/console/client and 14 other directories.
picketlink-commits at lists.jboss.org
picketlink-commits at lists.jboss.org
Sat Mar 3 00:48:20 EST 2012
Author: pcraveiro
Date: 2012-03-03 00:48:17 -0500 (Sat, 03 Mar 2012)
New Revision: 1473
Added:
console/trunk/gui/src/main/java/org/picketlink/console/client/core/
console/trunk/gui/src/main/java/org/picketlink/console/client/core/DefaultPlace.java
console/trunk/gui/src/main/java/org/picketlink/console/client/core/DefaultPlaceManager.java
console/trunk/gui/src/main/java/org/picketlink/console/client/core/NameTokens.java
console/trunk/gui/src/main/java/org/picketlink/console/client/core/NewTokenFormatter.java
console/trunk/gui/src/main/java/org/picketlink/console/client/core/gin/
console/trunk/gui/src/main/java/org/picketlink/console/client/core/gin/PicketLinkGinjector.java
console/trunk/gui/src/main/java/org/picketlink/console/client/core/gin/PicketLinkModule.java
console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/
console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessageConstants.java
console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessageConstants.properties
console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessagesFactory.java
console/trunk/gui/src/main/java/org/picketlink/console/client/core/security/
console/trunk/gui/src/main/java/org/picketlink/console/client/core/security/CurrentUser.java
console/trunk/gui/src/main/java/org/picketlink/console/client/core/security/SecurityManager.java
console/trunk/gui/src/main/java/org/picketlink/console/public/
console/trunk/gui/src/main/java/org/picketlink/console/server/config/
console/trunk/gui/src/main/java/org/picketlink/console/server/config/GuiceServletConfig.java
console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServletModule.java
console/trunk/gui/src/main/resources/META-INF/
console/trunk/gui/src/main/resources/META-INF/persistence.xml
console/trunk/gui/src/main/resources/log4j.xml
Removed:
console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessageConstants.java
console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessageConstants.properties
console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessagesFactory.java
console/trunk/gui/src/main/java/org/picketlink/console/server/guice/GuiceServletConfig.java
Modified:
console/trunk/gui/src/main/java/org/picketlink/console/PicketLinkConsole.gwt.xml
console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsole.java
console/trunk/gui/src/main/java/org/picketlink/console/client/view/MainPagePresenter.java
console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginPresenter.java
console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginView.java
console/trunk/gui/src/main/java/org/picketlink/console/client/widgets/common/MainPanelWidget.java
console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServerModule.java
console/trunk/gui/src/main/webapp/WEB-INF/web.xml
Log:
Initial commit.
Modified: console/trunk/gui/src/main/java/org/picketlink/console/PicketLinkConsole.gwt.xml
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/PicketLinkConsole.gwt.xml 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/PicketLinkConsole.gwt.xml 2012-03-03 05:48:17 UTC (rev 1473)
@@ -30,6 +30,6 @@
<source path='shared'/>
<define-configuration-property name='gin.ginjector' is-multi-valued='false' />
- <set-configuration-property name='gin.ginjector' value='org.picketlink.console.client.gin.PicketLinkGinjector' />
+ <set-configuration-property name='gin.ginjector' value='org.picketlink.console.client.core.gin.PicketLinkGinjector' />
</module>
\ No newline at end of file
Modified: console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsole.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsole.java 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsole.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -21,7 +21,7 @@
*/
package org.picketlink.console.client;
-import org.picketlink.console.client.gin.PicketLinkGinjector;
+import org.picketlink.console.client.core.gin.PicketLinkGinjector;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
@@ -37,7 +37,7 @@
public class PicketLinkConsole implements EntryPoint {
public static final PicketLinkGinjector MODULES = GWT.create(PicketLinkGinjector.class);
-
+
@Override
public void onModuleLoad() {
// This is required for Gwt-Platform proxy's generator
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/DefaultPlace.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/DefaultPlace.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/DefaultPlace.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This 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 software 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.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.picketlink.console.client.core;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import com.google.inject.BindingAnnotation;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+ at BindingAnnotation
+ at Target({ FIELD, PARAMETER, METHOD })
+ at Retention(RUNTIME)
+public @interface DefaultPlace {
+}
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/DefaultPlaceManager.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/DefaultPlaceManager.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/DefaultPlaceManager.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This 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 software 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.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.picketlink.console.client.core;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.proxy.PlaceManagerImpl;
+import com.gwtplatform.mvp.client.proxy.PlaceRequest;
+import com.gwtplatform.mvp.client.proxy.TokenFormatter;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class DefaultPlaceManager extends PlaceManagerImpl {
+
+ private final PlaceRequest defaultPlaceRequest;
+
+ @Inject
+ public DefaultPlaceManager(final EventBus eventBus, final TokenFormatter tokenFormatter,
+ @DefaultPlace final String defaultPlaceNameToken) {
+ super(eventBus, tokenFormatter);
+ this.defaultPlaceRequest = new PlaceRequest(defaultPlaceNameToken);
+ }
+
+ @Override
+ public void revealDefaultPlace() {
+ revealPlace(defaultPlaceRequest, false);
+ }
+
+ @Override
+ public void revealErrorPlace(String invalidHistoryToken) {
+ // TODO: Configure a error place
+ super.revealErrorPlace(invalidHistoryToken);
+ }
+}
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/NameTokens.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/NameTokens.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/NameTokens.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This 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 software 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.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.picketlink.console.client.core;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class NameTokens {
+
+ public static final String main = "main";
+ public static final String signInPage = "signInPage";
+
+ public static String getMain() {
+ return main;
+ }
+
+ public static String getSignInPage() {
+ return signInPage;
+ }
+}
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/NewTokenFormatter.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/NewTokenFormatter.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/NewTokenFormatter.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,296 @@
+package org.picketlink.console.client.core;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import com.google.gwt.http.client.URL;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.proxy.PlaceRequest;
+import com.gwtplatform.mvp.client.proxy.TokenFormatException;
+import com.gwtplatform.mvp.client.proxy.TokenFormatter;
+
+/**
+ * Formats tokens from {@code String} values to {@link PlaceRequest} and {@link PlaceRequest} hierarchies and vice-versa. The default implementation
+ * uses:
+ * <ul>
+ * <li>{@code '/'} to separate {@link PlaceRequest}s in a hierarchy;</li>
+ * <li>{@code ';'} to separate parameters in a {@link PlaceRequest};</li>
+ * <li>{@code '='} to separate the parameter name from its value;</li>
+ * <li>{@code '\'} to escape separators inside parameters names and values in a {@link PlaceRequest}.</li>
+ * </ul>
+ * These symbols cannot be used in a name token. If one of the separating symbol is encountered in a parameter or a value it is escaped using the
+ * {@code '\'} character by replacing {@code '/'} with {@code '\0'}, {@code ';'} with {@code '\1'}, {@code '='} with {@code '\2'} and {@code '\'} with
+ * {@code '\3'}.
+ * <p />
+ * Before decoding a {@link String} URL fragment into a {@link PlaceRequest} or a {@link PlaceRequest} hierarchy, {@link NewTokenFormatter} will first
+ * pass the {@link String} through {@link URL#decodeQueryString(String)} so that if the URL was URL-encoded by some user agent, like a mail user
+ * agent, it is still parsed correctly.
+ * <p />
+ * For example, {@link NewTokenFormatter} would parse any of the following:
+ *
+ * <pre>
+ * nameToken1%3Bparam1.1%3Dvalue1.1%3Bparam1.2%3Dvalue1.2%2FnameToken2%2FnameToken3%3Bparam3.1%3Dvalue%03%11
+ * nameToken1;param1.1=value1.1;param1.2=value1.2/nameToken2/nameToken3;param3.1=value\03\21
+ * </pre>
+ *
+ * Into the following hierarchy of {@link PlaceRequest}:
+ *
+ * <pre>
+ * {
+ * { "nameToken1", { {"param1.1", "value1.1"}, {"parame1.2","value1.2"} },
+ * "nameToken2", {},
+ * "nameToken3", { {"param3.1", "value/3=1"} } }
+ * }
+ * </pre>
+ *
+ * If you want to use different symbols as separator, use the {@link #ParameterTokenFormatter(String, String, String, String)} constructor.
+ *
+ * @author Philippe Beaudoin
+ * @author Yannis Gonianakis
+ * @author Daniel Colchete
+ */
+public class NewTokenFormatter implements TokenFormatter {
+
+ protected static final String DEFAULT_HIERARCHY_SEPARATOR = "/";
+ protected static final String DEFAULT_PARAM_SEPARATOR = ";";
+ protected static final String DEFAULT_VALUE_SEPARATOR = "=";
+ protected static final String DEFAULT_ESCAPE_CHARACTER = "\\";
+
+ protected static final String ESCAPED_HIERARCHY_SEPARATOR = "\\0"; // escaped version for the DEFAULT_HIERARCHY_SEPARATOR
+ protected static final String ESCAPED_PARAM_SEPARATOR = "\\1"; // escaped version for the DEFAULT_PARAM_SEPARATOR
+ protected static final String ESCAPED_VALUE_SEPARATOR = "\\2"; // escaped version for the DEFAULT_VALUE_SEPARATOR
+ protected static final String ESCAPED_ESCAPE_CHAR = "\\3"; // escaped version for the DEFAULT_ESCAPE_CHARACTER
+
+ private final String escapeCharacter;
+ private final String hierarchySeparator;
+ private final String paramSeparator;
+ private final String valueSeparator;
+
+ /**
+ * Builds a {@link NewTokenFormatter} using the default separators and escape character.
+ */
+ @Inject
+ public NewTokenFormatter() {
+ this(DEFAULT_HIERARCHY_SEPARATOR, DEFAULT_PARAM_SEPARATOR, DEFAULT_VALUE_SEPARATOR, DEFAULT_ESCAPE_CHARACTER);
+ }
+
+ /**
+ * This constructor makes it possible to use custom separators in your token formatter. The separators must be 1-letter strings, they must all be
+ * different from one another, and they must be encoded when ran through {@link URL#encodeQueryString(String)})
+ *
+ * @param hierarchySeparator
+ * The symbol used to separate {@link PlaceRequest} in a hierarchy. Must be a 1-character string and can't be {@code %}.
+ * @param paramSeparator
+ * The symbol used to separate parameters in a {@link PlaceRequest}. Must be a 1-character string and can't be {@code %}.
+ * @param valueSeparator
+ * The symbol used to separate the parameter name from its value. Must be a 1-character string and can't be {@code %}.
+ */
+ public NewTokenFormatter(String hierarchySeparator, String paramSeparator, String valueSeparator) {
+ this(hierarchySeparator, paramSeparator, valueSeparator, DEFAULT_ESCAPE_CHARACTER);
+ }
+
+ /**
+ * This constructor makes it possible to use custom separators and custom escape character in your token formatter. The separators and the escape
+ * character must be 1-letter strings, they must all be different from one another, and they must be encoded when ran through
+ * {@link URL#encodeQueryString(String)})
+ *
+ * @param hierarchySeparator
+ * The symbol used to separate {@link PlaceRequest} in a hierarchy. Must be a 1-character string and can't be {@code %}.
+ * @param paramSeparator
+ * The symbol used to separate parameters in a {@link PlaceRequest}. Must be a 1-character string and can't be {@code %}.
+ * @param valueSeparator
+ * The symbol used to separate the parameter name from its value. Must be a 1-character string and can't be {@code %}.
+ * @param escapeCharacter
+ * The symbol used to escape the separator symbols inside parameter names and values. Must be a 1-character string and can't be
+ * {@code %}.
+ */
+ public NewTokenFormatter(String hierarchySeparator, String paramSeparator, String valueSeparator, String escapeCharacter) {
+ assert hierarchySeparator.length() == 1;
+ assert paramSeparator.length() == 1;
+ assert valueSeparator.length() == 1;
+ assert escapeCharacter.length() == 1;
+ assert !escapeCharacter.equals(hierarchySeparator);
+ assert !escapeCharacter.equals(paramSeparator);
+ assert !escapeCharacter.equals(valueSeparator);
+ assert !hierarchySeparator.equals(paramSeparator);
+ assert !hierarchySeparator.equals(valueSeparator);
+ assert !paramSeparator.equals(valueSeparator);
+ assert !escapeCharacter.equals(URL.encodeQueryString(escapeCharacter));
+ assert !valueSeparator.equals(URL.encodeQueryString(valueSeparator));
+ assert !hierarchySeparator.equals(URL.encodeQueryString(hierarchySeparator));
+ assert !paramSeparator.equals(URL.encodeQueryString(paramSeparator));
+ assert !escapeCharacter.equals("%");
+ assert !hierarchySeparator.equals("%");
+ assert !paramSeparator.equals("%");
+ assert !valueSeparator.equals("%");
+
+ this.hierarchySeparator = hierarchySeparator;
+ this.paramSeparator = paramSeparator;
+ this.valueSeparator = valueSeparator;
+ this.escapeCharacter = escapeCharacter;
+ }
+
+ @Override
+ public String toHistoryToken(List<PlaceRequest> placeRequestHierarchy) throws TokenFormatException {
+ StringBuilder out = new StringBuilder();
+
+ for (int i = 0; i < placeRequestHierarchy.size(); ++i) {
+ if (i != 0) {
+ out.append(hierarchySeparator);
+ }
+ out.append(toPlaceTokenUnescaped(placeRequestHierarchy.get(i)));
+ }
+
+ return out.toString();
+ }
+
+ @Override
+ public PlaceRequest toPlaceRequest(String placeToken) throws TokenFormatException {
+ return unescapedToPlaceRequest(URL.decodeQueryString(placeToken));
+ }
+
+ private PlaceRequest unescapedToPlaceRequest(String unescapedPlaceToken) throws TokenFormatException {
+ PlaceRequest req = null;
+
+ int split = unescapedPlaceToken.indexOf(paramSeparator);
+ if (split == 0) {
+ throw new TokenFormatException("Place history token is missing.");
+ } else if (split == -1) {
+ req = new PlaceRequest(unescapedPlaceToken);
+ } else if (split >= 0) {
+ req = new PlaceRequest(unescapedPlaceToken.substring(0, split));
+ String paramsChunk = unescapedPlaceToken.substring(split + 1);
+ String[] paramTokens = paramsChunk.split(paramSeparator);
+ for (String paramToken : paramTokens) {
+ if (paramToken.isEmpty()) {
+ throw new TokenFormatException("Bad parameter: Successive parameters require a single '" + paramSeparator + "' between them.");
+ }
+ String[] param = splitParamToken(paramToken);
+ String key = paramValueUnescape(param[0]);
+ String value = paramValueUnescape(param[1]);
+ req = req.with(key, value);
+ }
+ }
+ return req;
+ }
+
+ @Override
+ public List<PlaceRequest> toPlaceRequestHierarchy(String historyToken) throws TokenFormatException {
+ historyToken = URL.decodeQueryString(historyToken);
+
+ int split = historyToken.indexOf(hierarchySeparator);
+ if (split == 0) {
+ throw new TokenFormatException("Place history token is missing.");
+ } else {
+ List<PlaceRequest> result = new ArrayList<PlaceRequest>();
+ if (split == -1) {
+ result.add(unescapedToPlaceRequest(historyToken)); // History token consists of a single place token
+ } else {
+ String[] placeTokens = historyToken.split(hierarchySeparator);
+ for (String placeToken : placeTokens) {
+ if (placeToken.isEmpty()) {
+ throw new TokenFormatException("Bad parameter: Successive place tokens require a single '" + hierarchySeparator + "' between them.");
+ }
+ result.add(unescapedToPlaceRequest(placeToken));
+ }
+ }
+ return result;
+ }
+ }
+
+ @Override
+ public String toPlaceToken(PlaceRequest placeRequest) throws TokenFormatException {
+ return toPlaceTokenUnescaped(placeRequest);
+ }
+
+ private String toPlaceTokenUnescaped(PlaceRequest placeRequest) throws TokenFormatException {
+ StringBuilder out = new StringBuilder();
+ out.append(placeRequest.getNameToken());
+
+ Set<String> params = placeRequest.getParameterNames();
+ if (params != null) {
+ for (String name : params) {
+ out.append(paramSeparator).append(paramValueEscape(name)).append(valueSeparator).append(paramValueEscape(placeRequest.getParameter(name, null)));
+ }
+ }
+
+ return out.toString();
+ }
+
+ private String[] splitParamToken(String paramToken) {
+ String[] param = paramToken.split(valueSeparator, 2);
+ if (param.length == 1 // pattern didn't match
+ || param[0].contains(valueSeparator) // un-escaped separator encountered in the key
+ || param[1].contains(valueSeparator)) { // un-escaped separator encountered in the value
+ throw new TokenFormatException("Bad parameter: Parameters require a single '" + valueSeparator + "' between the key and value.");
+ }
+ return param;
+ }
+
+ private String paramValueEscape(String value) {
+
+ StringBuffer sbuf = new StringBuffer();
+ int len = value.length();
+
+ char escapeChar = escapeCharacter.charAt(0);
+ char hierarchyChar = hierarchySeparator.charAt(0);
+ char paramChar = paramSeparator.charAt(0);
+ char valueChar = valueSeparator.charAt(0);
+
+ for (int i = 0; i < len; i++) {
+ char ch = value.charAt(i);
+
+ if (ch == escapeChar) {
+ sbuf.append(ESCAPED_ESCAPE_CHAR);
+ } else if (ch == hierarchyChar) {
+ sbuf.append(ESCAPED_HIERARCHY_SEPARATOR);
+ } else if (ch == paramChar) {
+ sbuf.append(ESCAPED_PARAM_SEPARATOR);
+ } else if (ch == valueChar) {
+ sbuf.append(ESCAPED_VALUE_SEPARATOR);
+ } else {
+ sbuf.append(ch);
+ }
+ }
+
+ return URL.encodeQueryString(sbuf.toString());
+ }
+
+ private String paramValueUnescape(String value) {
+ value = URL.decodeQueryString(value);
+
+ StringBuffer sbuf = new StringBuffer();
+ int len = value.length();
+
+ char escapeChar = escapeCharacter.charAt(0);
+
+ char hierarchyNum = ESCAPED_HIERARCHY_SEPARATOR.charAt(1);
+ char paramNum = ESCAPED_PARAM_SEPARATOR.charAt(1);
+ char valueNum = ESCAPED_VALUE_SEPARATOR.charAt(1);
+ char escapeNum = ESCAPED_ESCAPE_CHAR.charAt(1);
+
+ for (int i = 0; i < len; i++) {
+ char ch = value.charAt(i);
+
+ if (ch == escapeChar) {
+ i++;
+ char ch2 = value.charAt(i);
+ if (ch2 == hierarchyNum) {
+ sbuf.append(hierarchySeparator);
+ } else if (ch2 == paramNum) {
+ sbuf.append(paramSeparator);
+ } else if (ch2 == valueNum) {
+ sbuf.append(valueSeparator);
+ } else if (ch2 == escapeNum) {
+ sbuf.append('\\');
+ }
+ } else {
+ sbuf.append(ch);
+ }
+ }
+
+ return sbuf.toString();
+ }
+
+}
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/gin/PicketLinkGinjector.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/gin/PicketLinkGinjector.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/gin/PicketLinkGinjector.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This 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 software 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.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.picketlink.console.client.core.gin;
+
+import org.picketlink.console.client.view.MainPagePresenter;
+import org.picketlink.console.client.view.security.LoginPresenter;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.inject.client.GinModules;
+import com.google.gwt.inject.client.Ginjector;
+import com.google.inject.Provider;
+import com.gwtplatform.dispatch.client.gin.DispatchAsyncModule;
+import com.gwtplatform.mvp.client.proxy.PlaceManager;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+ at GinModules({ DispatchAsyncModule.class, PicketLinkModule.class })
+public interface PicketLinkGinjector extends Ginjector {
+
+ EventBus getEventBus();
+
+ PlaceManager getPlaceManager();
+
+ Provider<MainPagePresenter> getMainPagePresenter();
+
+ Provider<LoginPresenter> getLoginPresenter();
+}
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/gin/PicketLinkModule.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/gin/PicketLinkModule.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/gin/PicketLinkModule.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This 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 software 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.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.picketlink.console.client.core.gin;
+
+import org.picketlink.console.client.core.DefaultPlace;
+import org.picketlink.console.client.core.DefaultPlaceManager;
+import org.picketlink.console.client.core.NameTokens;
+import org.picketlink.console.client.core.NewTokenFormatter;
+import org.picketlink.console.client.core.security.CurrentUser;
+import org.picketlink.console.client.view.MainPagePresenter;
+import org.picketlink.console.client.view.MainPageView;
+import org.picketlink.console.client.view.security.LoginPresenter;
+import org.picketlink.console.client.view.security.LoginView;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.event.shared.SimpleEventBus;
+import com.google.inject.Singleton;
+import com.gwtplatform.mvp.client.RootPresenter;
+import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+import com.gwtplatform.mvp.client.proxy.PlaceManager;
+import com.gwtplatform.mvp.client.proxy.TokenFormatter;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class PicketLinkModule extends AbstractPresenterModule {
+
+ @Override
+ protected void configure() {
+ bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
+ bind(PlaceManager.class).to(DefaultPlaceManager.class).in(Singleton.class);
+ bind(TokenFormatter.class).to(NewTokenFormatter.class).in(Singleton.class);
+ bind(RootPresenter.class).asEagerSingleton();
+ bind(CurrentUser.class).in(Singleton.class);
+
+ bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.signInPage);
+
+ bindPresenter(LoginPresenter.class, LoginPresenter.MyView.class, LoginView.class, LoginPresenter.MyProxy.class);
+
+ bindPresenter(MainPagePresenter.class, MainPagePresenter.MyView.class, MainPageView.class,
+ MainPagePresenter.MyProxy.class);
+ }
+}
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessageConstants.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessageConstants.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessageConstants.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This 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 software 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.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.picketlink.console.client.core.message;
+
+import com.google.gwt.i18n.client.Messages;
+import com.google.gwt.safehtml.shared.SafeHtml;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public interface MessageConstants extends Messages {
+
+ String UserName();
+ String Password();
+ String OK();
+ String Login();
+ String Authenticating();
+ String IncorrectUsernameOrPassword();
+ String LoginWelcomeMessage();
+
+}
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessageConstants.properties
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessageConstants.properties (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessageConstants.properties 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,7 @@
+UserName=User:
+Password=Password:
+OK=OK
+Login=Login
+Authenticating=Authenticating
+IncorrectUsernameOrPassword=Incorrect user name or password
+LoginWelcomeMessage=Welcome to PicketLink Administration Console. Please, enter your credentials:
\ No newline at end of file
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessagesFactory.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessagesFactory.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/message/MessagesFactory.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This 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 software 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.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.picketlink.console.client.core.message;
+
+import com.google.gwt.core.client.GWT;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class MessagesFactory {
+
+ private static MessageConstants instance;
+
+ private MessagesFactory() {
+
+ }
+
+ public static final MessageConstants instance() {
+ if (instance == null) {
+ instance = GWT.create( MessageConstants.class );
+ }
+
+ return instance;
+ }
+
+}
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/security/CurrentUser.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/security/CurrentUser.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/security/CurrentUser.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,27 @@
+package org.picketlink.console.client.core.security;
+
+import com.google.inject.Singleton;
+
+ at Singleton
+public class CurrentUser {
+
+ private boolean loggedIn;
+ private String userName;
+
+ public boolean isLoggedIn() {
+ return loggedIn;
+ }
+
+ public void setLoggedIn(boolean loggedIn) {
+ this.loggedIn = loggedIn;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+}
Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/security/SecurityManager.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/security/SecurityManager.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/security/SecurityManager.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This 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 software 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.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.picketlink.console.client.core.security;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class SecurityManager {
+
+ private static SecurityManager instance;
+
+ private SecurityManager() {
+
+ }
+
+ public static SecurityManager instance() {
+ if (instance == null) {
+ instance = new SecurityManager();
+ }
+
+ return instance;
+ }
+
+ public boolean login(String userName, String password) {
+// if (userName != null && userName.equals("admin")) {
+ return true;
+// }
+
+// return false;
+ }
+
+ public String getCurrentUser() {
+ return "admin";
+ }
+}
Deleted: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessageConstants.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessageConstants.java 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessageConstants.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This 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 software 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.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.picketlink.console.client.resources;
-
-import com.google.gwt.i18n.client.Messages;
-import com.google.gwt.safehtml.shared.SafeHtml;
-
-/**
- * @author Pedro Silva
- * @since 03/01/2011
- */
-public interface MessageConstants extends Messages {
-
- String UserName();
- String Password();
- String OK();
- String Login();
- String Authenticating();
- String IncorrectUsernameOrPassword();
- String LoginWelcomeMessage();
-
-}
Deleted: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessageConstants.properties
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessageConstants.properties 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessageConstants.properties 2012-03-03 05:48:17 UTC (rev 1473)
@@ -1,7 +0,0 @@
-UserName=User:
-Password=Password:
-OK=OK
-Login=Login
-Authenticating=Authenticating
-IncorrectUsernameOrPassword=Incorrect user name or password
-LoginWelcomeMessage=Welcome to PicketLink Administration Console. Please, enter your credentials:
\ No newline at end of file
Deleted: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessagesFactory.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessagesFactory.java 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/resources/MessagesFactory.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -1,46 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This 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 software 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.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.picketlink.console.client.resources;
-
-import com.google.gwt.core.client.GWT;
-
-/**
- * @author Pedro Silva
- * @since 03/01/2011
- */
-public class MessagesFactory {
-
- private static MessageConstants instance;
-
- private MessagesFactory() {
-
- }
-
- public static final MessageConstants instance() {
- if (instance == null) {
- instance = GWT.create( MessageConstants.class );
- }
-
- return instance;
- }
-
-}
Modified: console/trunk/gui/src/main/java/org/picketlink/console/client/view/MainPagePresenter.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/view/MainPagePresenter.java 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/view/MainPagePresenter.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -21,7 +21,7 @@
*/
package org.picketlink.console.client.view;
-import org.picketlink.console.client.place.NameTokens;
+import org.picketlink.console.client.core.NameTokens;
import com.google.gwt.event.shared.EventBus;
import com.google.inject.Inject;
Modified: console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginPresenter.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginPresenter.java 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginPresenter.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -21,18 +21,18 @@
*/
package org.picketlink.console.client.view.security;
+import org.picketlink.console.client.core.NameTokens;
+import org.picketlink.console.client.core.security.SecurityManager;
import org.picketlink.console.client.model.Credentials;
-import org.picketlink.console.client.place.NameTokens;
-import org.picketlink.console.client.security.SecurityManager;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.EventBus;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.View;
import com.gwtplatform.mvp.client.annotations.NameToken;
+import com.gwtplatform.mvp.client.annotations.NoGatekeeper;
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
import com.gwtplatform.mvp.client.proxy.PlaceManager;
import com.gwtplatform.mvp.client.proxy.PlaceRequest;
@@ -57,7 +57,8 @@
}
@ProxyStandard
- @NameToken(NameTokens.login)
+ @NameToken(NameTokens.signInPage)
+ @NoGatekeeper
public interface MyProxy extends ProxyPlace<LoginPresenter> {
}
Modified: console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginView.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginView.java 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginView.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -26,8 +26,8 @@
import org.jboss.ballroom.client.widgets.window.DefaultWindow;
import org.jboss.ballroom.client.widgets.window.DialogueOptions;
import org.jboss.ballroom.client.widgets.window.WindowContentBuilder;
+import org.picketlink.console.client.core.message.MessagesFactory;
import org.picketlink.console.client.model.Credentials;
-import org.picketlink.console.client.resources.MessagesFactory;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
@@ -57,8 +57,8 @@
public Widget asWidget() {
this.window = new DefaultWindow("Login");
- this.window.setWidth(480);
- this.window.setHeight(230);
+ this.window.setWidth(290);
+ this.window.setHeight(240);
this.window.setModal(true);
this.window.setGlassEnabled(false);
@@ -106,8 +106,11 @@
form = new Form<Credentials>(Credentials.class);
userNameTextbox = new TextBoxItem("userName", MessagesFactory.instance().UserName());
+ userNameTextbox.asWidget().setWidth("200px");
+
passwordTextbox = new TextBoxItem("password", MessagesFactory.instance().Password());
-
+ passwordTextbox.asWidget().setWidth("200px");
+
form.setFields(userNameTextbox, passwordTextbox);
layout.add(form);
Modified: console/trunk/gui/src/main/java/org/picketlink/console/client/widgets/common/MainPanelWidget.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/widgets/common/MainPanelWidget.java 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/widgets/common/MainPanelWidget.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -1,9 +1,9 @@
package org.picketlink.console.client.widgets.common;
+import org.picketlink.console.client.core.security.SecurityManager;
import org.picketlink.console.client.resources.ImageFactory;
-import org.picketlink.console.client.security.SecurityManager;
import com.google.gwt.dom.client.Style.FontWeight;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.Anchor;
Added: console/trunk/gui/src/main/java/org/picketlink/console/server/config/GuiceServletConfig.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/server/config/GuiceServletConfig.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/server/config/GuiceServletConfig.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,36 @@
+package org.picketlink.console.server.config;
+
+import javax.servlet.ServletContextEvent;
+
+import org.picketlink.console.server.guice.DispatchServletModule;
+import org.picketlink.console.server.guice.ServerModule;
+import org.picketlink.console.server.guice.ServletModule;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.persist.jpa.JpaPersistModule;
+import com.google.inject.servlet.GuiceServletContextListener;
+
+public class GuiceServletConfig extends GuiceServletContextListener {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.google.inject.servlet.GuiceServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
+ */
+ @Override
+ public void contextInitialized(ServletContextEvent servletContextEvent) {
+ super.contextInitialized(servletContextEvent);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.google.inject.servlet.GuiceServletContextListener#getInjector()
+ */
+ @Override
+ protected Injector getInjector() {
+ return Guice.createInjector(new ServerModule(), new DispatchServletModule(), new JpaPersistModule("picketlink-console-pu"), new ServletModule());
+ }
+
+}
\ No newline at end of file
Deleted: console/trunk/gui/src/main/java/org/picketlink/console/server/guice/GuiceServletConfig.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/server/guice/GuiceServletConfig.java 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/server/guice/GuiceServletConfig.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -1,13 +0,0 @@
-package org.picketlink.console.server.guice;
-
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.servlet.GuiceServletContextListener;
-
-public class GuiceServletConfig extends GuiceServletContextListener {
-
- @Override
- protected Injector getInjector() {
- return Guice.createInjector(new ServerModule(), new DispatchServletModule());
- }
-}
Modified: console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServerModule.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServerModule.java 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServerModule.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -6,6 +6,5 @@
@Override
protected void configureHandlers() {
-
}
}
Added: console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServletModule.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServletModule.java (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServletModule.java 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,12 @@
+package org.picketlink.console.server.guice;
+
+import com.google.inject.persist.PersistFilter;
+
+public class ServletModule extends com.google.inject.servlet.ServletModule {
+
+ @Override
+ protected void configureServlets() {
+ filter("/*").through(PersistFilter.class);
+ }
+
+}
Added: console/trunk/gui/src/main/resources/META-INF/persistence.xml
===================================================================
--- console/trunk/gui/src/main/resources/META-INF/persistence.xml (rev 0)
+++ console/trunk/gui/src/main/resources/META-INF/persistence.xml 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Persistence deployment descriptor for dev profile -->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+
+ <persistence-unit name="picketlink-console-pu"
+ transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+
+ <properties>
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:picketlink-console-db" />
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" />
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
+ <property name="hibernate.hbm2ddl.auto" value="create-drop" />
+ <property name="hibernate.connection.username" value="sa" />
+ <property name="hibernate.connection.password" value="" />
+ </properties>
+ </persistence-unit>
+
+</persistence>
Added: console/trunk/gui/src/main/resources/log4j.xml
===================================================================
--- console/trunk/gui/src/main/resources/log4j.xml (rev 0)
+++ console/trunk/gui/src/main/resources/log4j.xml 2012-03-03 05:48:17 UTC (rev 1473)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <!-- Appenders -->
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%-5p: %c - %m%n" />
+ </layout>
+ </appender>
+ <logger name="org.hibernate">
+ <level value="INFO" />
+ </logger>
+ <!-- Root Logger -->
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="console" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Modified: console/trunk/gui/src/main/webapp/WEB-INF/web.xml
===================================================================
--- console/trunk/gui/src/main/webapp/WEB-INF/web.xml 2012-03-03 05:47:33 UTC (rev 1472)
+++ console/trunk/gui/src/main/webapp/WEB-INF/web.xml 2012-03-03 05:48:17 UTC (rev 1473)
@@ -5,7 +5,7 @@
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<listener>
- <listener-class>org.picketlink.console.server.guice.GuiceServletConfig</listener-class>
+ <listener-class>org.picketlink.console.server.config.GuiceServletConfig</listener-class>
</listener>
<filter>
<filter-name>guiceFilter</filter-name>
More information about the picketlink-commits
mailing list