[picketlink-commits] Picketlink SVN: r1477 - in console/trunk/gui: src and 26 other directories.

picketlink-commits at lists.jboss.org picketlink-commits at lists.jboss.org
Sat Mar 3 01:11:46 EST 2012


Author: pcraveiro
Date: 2012-03-03 01:11:44 -0500 (Sat, 03 Mar 2012)
New Revision: 1477

Added:
   console/trunk/gui/src/
   console/trunk/gui/src/main/
   console/trunk/gui/src/main/java/
   console/trunk/gui/src/main/java/org/
   console/trunk/gui/src/main/java/org/picketlink/
   console/trunk/gui/src/main/java/org/picketlink/console/
   console/trunk/gui/src/main/java/org/picketlink/console/PicketLinkConsole.gwt.xml
   console/trunk/gui/src/main/java/org/picketlink/console/client/
   console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsole.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsoleFramework.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/core/
   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/place/
   console/trunk/gui/src/main/java/org/picketlink/console/client/core/place/DefaultPlace.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/core/place/DefaultPlaceManager.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/core/place/NameTokens.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/gin/
   console/trunk/gui/src/main/java/org/picketlink/console/client/model/
   console/trunk/gui/src/main/java/org/picketlink/console/client/model/BeanFactory.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/model/Credentials.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/place/
   console/trunk/gui/src/main/java/org/picketlink/console/client/resources/
   console/trunk/gui/src/main/java/org/picketlink/console/client/resources/ImageFactory.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/resources/Images.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/
   console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/close.gif
   console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/login.gif
   console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/picketlink-banner-1180px.png
   console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/user.png
   console/trunk/gui/src/main/java/org/picketlink/console/client/security/
   console/trunk/gui/src/main/java/org/picketlink/console/client/view/
   console/trunk/gui/src/main/java/org/picketlink/console/client/view/MainPagePresenter.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/view/MainPageView.java
   console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/
   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/
   console/trunk/gui/src/main/java/org/picketlink/console/client/widgets/common/
   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/MenuTreeWidget.java
   console/trunk/gui/src/main/java/org/picketlink/console/public/
   console/trunk/gui/src/main/java/org/picketlink/console/public/images/
   console/trunk/gui/src/main/java/org/picketlink/console/public/images/close.gif
   console/trunk/gui/src/main/java/org/picketlink/console/public/images/login.gif
   console/trunk/gui/src/main/java/org/picketlink/console/public/images/picketlink-banner-1180px.png
   console/trunk/gui/src/main/java/org/picketlink/console/public/images/user.png
   console/trunk/gui/src/main/java/org/picketlink/console/server/
   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/
   console/trunk/gui/src/main/java/org/picketlink/console/server/guice/DispatchServletModule.java
   console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServerModule.java
   console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServletModule.java
   console/trunk/gui/src/main/java/org/picketlink/console/shared/
   console/trunk/gui/src/main/resources/
   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
   console/trunk/gui/src/main/webapp/
   console/trunk/gui/src/main/webapp/PicketLinkConsole.html
   console/trunk/gui/src/main/webapp/WEB-INF/
   console/trunk/gui/src/main/webapp/WEB-INF/web.xml
   console/trunk/gui/src/main/webapp/picketlink-console.css
Log:
Initial commit.

Added: console/trunk/gui/src/main/java/org/picketlink/console/PicketLinkConsole.gwt.xml
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/PicketLinkConsole.gwt.xml	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/PicketLinkConsole.gwt.xml	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,35 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<module rename-to='PicketLinkConsole'>
+	<!-- Inherit the core Web Toolkit stuff.                        -->
+	<inherits name='com.google.gwt.user.User'/>
+	<inherits name='com.google.gwt.inject.Inject'/>
+	<inherits name='com.google.gwt.resources.Resources'/>
+
+	<!-- Inherit the default GWT style sheet.  You can change       -->
+	<!-- the theme of your GWT application by uncommenting          -->
+	<!-- any one of the following lines.                            -->
+<!-- 	<inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
+	<inherits name='com.google.gwt.user.theme.chrome.Chrome'/>
+	<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->
+
+	<!-- Other module inherits                                      -->
+	<inherits name='com.gwtplatform.mvp.Mvp'/>
+	<inherits name='com.gwtplatform.dispatch.Dispatch'/>
+
+	<!-- Ballroom -->
+	<inherits name="org.jboss.ballroom.Framework_RH"/>
+	<replace-with class="org.picketlink.console.client.PicketLinkConsoleFramework">
+        <when-type-is class="org.jboss.ballroom.client.spi.Framework"/>
+    </replace-with>
+
+	<!-- Specify the app entry point class.                         -->
+	<entry-point class='org.picketlink.console.client.PicketLinkConsole'/>
+
+	<!-- Specify the paths for translatable code                    -->
+	<source path='client'/>
+	<source path='shared'/>
+
+	<define-configuration-property name='gin.ginjector' is-multi-valued='false' />
+	<set-configuration-property name='gin.ginjector' value='org.picketlink.console.client.core.gin.PicketLinkGinjector' />
+
+</module>
\ No newline at end of file

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsole.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsole.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsole.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,77 @@
+/*
+* 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;
+
+import org.picketlink.console.client.core.gin.PicketLinkGinjector;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.user.client.Window;
+import com.gwtplatform.mvp.client.DelayedBindRegistry;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+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
+        DelayedBindRegistry.bind(MODULES);
+
+        // final Image loadingImage = new Image(
+        // "/PicketLinkConsole/images/loading_lite.gif");
+        // loadingImage.getElement().setAttribute("style",
+        // "margin-top:200px;margin-left:auto;margin-right:auto;");
+        //
+        // RootLayoutPanel.get().add(loadingImage);
+
+        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
+            @Override
+            public void execute() {
+                onModuleLoad2();
+            }
+        });
+    }
+
+    private void onModuleLoad2() {
+        GWT.runAsync(new RunAsyncCallback() {
+            public void onFailure(Throwable caught) {
+                Window.alert("Code download failed");
+            }
+
+            public void onSuccess() {
+                // DelayedBindRegistry.bind(MODULES);
+
+                // RootLayoutPanel.get().remove(loadingImage);
+
+                MODULES.getPlaceManager().revealDefaultPlace();
+            }
+        });
+    }
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsoleFramework.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsoleFramework.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/PicketLinkConsoleFramework.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -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;
+
+
+import org.jboss.ballroom.client.spi.Framework;
+import org.picketlink.console.client.model.BeanFactory;
+
+import com.google.gwt.autobean.shared.AutoBeanFactory;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.shared.EventBus;
+import com.gwtplatform.mvp.client.proxy.PlaceManager;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class PicketLinkConsoleFramework implements Framework {
+
+    private final static BeanFactory factory = GWT.create(BeanFactory.class);
+
+    @Override
+    public EventBus getEventBus() {
+        return PicketLinkConsole.MODULES.getEventBus();
+    }
+
+    @Override
+    public PlaceManager getPlaceManager() {
+        return PicketLinkConsole.MODULES.getPlaceManager();
+    }
+
+    @Override
+    public AutoBeanFactory getBeanFactory() {
+        return factory;
+    }
+}

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 06:11:44 UTC (rev 1477)
@@ -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 06:11:44 UTC (rev 1477)
@@ -0,0 +1,52 @@
+/*
+* 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.place.DefaultPlace;
+import org.picketlink.console.client.core.place.DefaultPlaceManager;
+import org.picketlink.console.client.core.place.NameTokens;
+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.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+import com.gwtplatform.mvp.client.gin.DefaultModule;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class PicketLinkModule extends AbstractPresenterModule {
+
+    @Override
+    protected void configure() {
+        install(new DefaultModule(DefaultPlaceManager.class));
+        
+        bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.login);
+
+        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 06:11:44 UTC (rev 1477)
@@ -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 06:11:44 UTC (rev 1477)
@@ -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 06:11:44 UTC (rev 1477)
@@ -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/place/DefaultPlace.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/place/DefaultPlace.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/place/DefaultPlace.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -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.place;
+
+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/place/DefaultPlaceManager.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/place/DefaultPlaceManager.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/place/DefaultPlaceManager.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,49 @@
+/*
+* 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.place;
+
+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);
+    }
+}

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/core/place/NameTokens.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/core/place/NameTokens.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/core/place/NameTokens.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,45 @@
+/*
+* 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.place;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class NameTokens {
+
+    public static final String main = "main";
+    public static final String response = "response";
+    public static final String login = "login";
+
+    public static String getMain() {
+        return main;
+    }
+
+    public static String getResponse() {
+        return response;
+    }
+
+    public static String getLogin() {
+        return login;
+    }
+}

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/model/BeanFactory.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/model/BeanFactory.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/model/BeanFactory.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,34 @@
+/*
+* 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.model;
+
+import com.google.gwt.autobean.shared.AutoBean;
+import com.google.gwt.autobean.shared.AutoBeanFactory;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public interface BeanFactory extends AutoBeanFactory {
+
+    AutoBean<Credentials> credentials();
+}

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/model/Credentials.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/model/Credentials.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/model/Credentials.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,38 @@
+/*
+* 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.model;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public interface Credentials {
+
+    String getUserName();
+
+    void setUsername(String userName);
+
+    String getPassword();
+
+    void setPassword(String password);
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/ImageFactory.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/resources/ImageFactory.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/resources/ImageFactory.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -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.resources;
+
+import com.google.gwt.core.client.GWT;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class ImageFactory {
+
+	private static Images instance;
+	
+	private ImageFactory() {
+		
+	}
+	
+	public static final Images instance() {
+		if (instance == null) {
+			instance = GWT.create( Images.class );
+		}
+		
+		return instance;
+	}
+	
+}

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/Images.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/resources/Images.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/resources/Images.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,45 @@
+/*
+* 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.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public interface Images extends ClientBundle {
+
+	@Source ("images/login.gif")
+	ImageResource login();
+	
+	@Source ("images/close.gif")
+	ImageResource close();
+
+	@Source ("images/user.png")
+	ImageResource user();
+
+	@Source ("images/picketlink-banner-1180px.png")
+	ImageResource banner();
+	
+}

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/close.gif
===================================================================
(Binary files differ)


Property changes on: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/close.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/login.gif
===================================================================
(Binary files differ)


Property changes on: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/login.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/picketlink-banner-1180px.png
===================================================================
(Binary files differ)


Property changes on: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/picketlink-banner-1180px.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/user.png
===================================================================
(Binary files differ)


Property changes on: console/trunk/gui/src/main/java/org/picketlink/console/client/resources/images/user.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: 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	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/view/MainPagePresenter.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,75 @@
+/*
+* 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.view;
+
+import org.picketlink.console.client.core.place.NameTokens;
+
+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.ProxyStandard;
+import com.gwtplatform.mvp.client.proxy.PlaceManager;
+import com.gwtplatform.mvp.client.proxy.ProxyPlace;
+import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class MainPagePresenter extends Presenter<MainPagePresenter.MyView, MainPagePresenter.MyProxy> {
+
+    public interface MyView extends View {
+
+    }
+
+    @ProxyStandard
+    @NameToken(NameTokens.main)
+    public interface MyProxy extends ProxyPlace<MainPagePresenter> {
+    }
+
+    private final PlaceManager placeManager;
+
+    @Inject
+    public MainPagePresenter(final EventBus eventBus, final MyView view, final MyProxy proxy, final PlaceManager placeManager) {
+        super(eventBus, view, proxy);
+
+        this.placeManager = placeManager;
+    }
+
+    @Override
+    protected void revealInParent() {
+        RevealRootContentEvent.fire(this, this);
+    }
+
+    @Override
+    protected void onBind() {
+        super.onBind();
+    }
+
+    @Override
+    protected void onReset() {
+        super.onReset();
+    }
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/view/MainPageView.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/view/MainPageView.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/view/MainPageView.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,45 @@
+/*
+* 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.view;
+
+import org.picketlink.console.client.widgets.common.MainPanelWidget;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.ViewImpl;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class MainPageView extends ViewImpl implements MainPagePresenter.MyView {
+
+    @Inject
+    public MainPageView() {
+    }
+
+    @Override
+    public Widget asWidget() {
+        return new MainPanelWidget();
+    }
+
+}

Added: 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	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginPresenter.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,117 @@
+/*
+* 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.view.security;
+
+import org.picketlink.console.client.core.place.NameTokens;
+import org.picketlink.console.client.core.security.SecurityManager;
+import org.picketlink.console.client.model.Credentials;
+
+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;
+import com.gwtplatform.mvp.client.proxy.ProxyPlace;
+import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class LoginPresenter extends Presenter<LoginPresenter.MyView, LoginPresenter.MyProxy> {
+
+    public interface MyView extends View {
+
+        Credentials getUserCredentials();
+
+        void setLoginClickHandlers(ClickHandler clickHandler);
+
+        void resetAndFocus();
+
+        void setError(String errorText);
+    }
+
+    @ProxyStandard
+    @NameToken(NameTokens.login)
+    @NoGatekeeper
+    public interface MyProxy extends ProxyPlace<LoginPresenter> {
+    }
+
+    private final PlaceManager placeManager;
+
+    @Inject
+    public LoginPresenter(final EventBus eventBus, final MyView view, final MyProxy proxy, final PlaceManager placeManager) {
+        super(eventBus, view, proxy);
+        
+        this.placeManager = placeManager;
+    }
+
+    @Override
+    protected void revealInParent() {
+        RevealRootContentEvent.fire(this, this);
+    }
+
+    @Override
+    protected void onBind() {
+        super.onBind();
+        getView().setLoginClickHandlers(new ClickHandler() {
+            @Override
+            public void onClick(ClickEvent event) {
+                authenticate();
+            }
+        });
+    }
+
+    @Override
+    protected void onReset() {
+        super.onReset();
+        getView().resetAndFocus();
+    }
+
+    /**
+     * Send the name from the nameField to the server and wait for a response.
+     */
+    private void authenticate() {
+        getView().setError(null);
+        
+        String userName = getView().getUserCredentials().getUserName();
+        
+        if (userName == null || userName.trim().isEmpty()) {
+            getView().setError("Please enter at least four characters");
+            return;
+        }
+        
+        if (!SecurityManager.instance().login(userName, getView().getUserCredentials().getPassword())) {
+            getView().setError("Invalid credentials.");
+            return;
+        }
+
+        placeManager.revealPlace(new PlaceRequest(NameTokens.main));
+    }
+}

Added: 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	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginView.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,122 @@
+/*
+* 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.view.security;
+
+import org.jboss.ballroom.client.widgets.forms.Form;
+import org.jboss.ballroom.client.widgets.forms.TextBoxItem;
+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 com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.ViewImpl;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class LoginView extends ViewImpl implements LoginPresenter.MyView {
+    
+    private DefaultWindow window;
+    private DialogueOptions options;
+    private Form<Credentials> form;
+    private TextBoxItem userNameTextbox;
+    private TextBoxItem passwordTextbox;
+
+    @Inject
+    public LoginView() {
+    }
+
+    @Override
+    public Widget asWidget() {
+        this.window = new DefaultWindow("Login");
+
+        this.window.setWidth(289);
+        this.window.setHeight(240);
+        this.window.setModal(true);
+
+        this.window.setGlassEnabled(false);
+        
+        this.window.setWidget(new WindowContent().asWidget());
+        
+        return this.window;
+    }
+
+    public Credentials getUserCredentials() {
+        return this.form.getUpdatedEntity();
+    }
+    
+    @Override
+    public void setLoginClickHandlers(ClickHandler clickHandler) {
+        this.options = new DialogueOptions(MessagesFactory.instance().OK(), clickHandler, "cancel", new ClickHandler() {
+
+            @Override
+            public void onClick(ClickEvent event) {
+
+            }
+        });
+    }
+
+    @Override
+    public void resetAndFocus() {
+        this.window.center();
+    }
+
+    @Override
+    public void setError(String errorText) {
+        if (errorText != null) {
+            this.userNameTextbox.setErroneous(true);
+            this.userNameTextbox.setErrMessage(errorText);
+        }
+    }
+
+    class WindowContent {
+        Widget asWidget() {
+
+            VerticalPanel layout = new VerticalPanel();
+
+            layout.add(new HTML(MessagesFactory.instance().LoginWelcomeMessage()));
+
+            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);
+            
+            return new WindowContentBuilder(layout, options.showCancel(false)).build();
+
+        }
+    }
+}

Added: 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	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/widgets/common/MainPanelWidget.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,93 @@
+package org.picketlink.console.client.widgets.common;
+
+
+import org.picketlink.console.client.core.security.SecurityManager;
+import org.picketlink.console.client.resources.ImageFactory;
+
+import com.google.gwt.dom.client.Style.FontWeight;
+import com.google.gwt.dom.client.Style.Unit;
+import com.google.gwt.user.client.ui.Anchor;
+import com.google.gwt.user.client.ui.DecoratorPanel;
+import com.google.gwt.user.client.ui.DockLayoutPanel;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HasVerticalAlignment;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.ui.SplitLayoutPanel;
+import com.google.gwt.user.client.ui.StackLayoutPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class MainPanelWidget extends DockLayoutPanel {
+
+	private Panel contentPanel = new DecoratorPanel();
+	
+	public MainPanelWidget() {
+		super(Unit.EM);
+
+		this.setPixelSize(1015, 500);
+		this.getElement().getStyle().setProperty("border", "5px solid #e7e7e7");
+		this.addNorth(createTopPanel(), 15);
+		this.addSouth(createMainPanel(), 28);
+	}
+
+	private VerticalPanel createTopPanel() {
+		VerticalPanel topPanel = new VerticalPanel();
+		
+		topPanel.setPixelSize(1015, 135);
+		topPanel.getElement().getStyle().setBackgroundColor("#e7e7e7");	
+		topPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
+		
+		topPanel.add(new Image(ImageFactory.instance().banner()));
+		topPanel.add(createStatusPanel());
+		
+		return topPanel;
+	}
+
+	private FlexTable createStatusPanel() {
+		FlexTable horizontalPanel = new FlexTable();
+		
+		horizontalPanel.setPixelSize(1015, 10);
+		
+		horizontalPanel.getFlexCellFormatter().setWidth(0, 1, "25%");
+		horizontalPanel.getFlexCellFormatter().setWidth(0, 2, "6%");
+		horizontalPanel.getFlexCellFormatter().setWidth(0, 3, "69%");
+		
+		horizontalPanel.setWidget(0, 0, new Image(ImageFactory.instance().user()));
+		horizontalPanel.setWidget(0, 1, new HTML("You are logged as: " + SecurityManager.instance().getCurrentUser()));
+		
+		Label messagesLabel = new Label("Messages: ");
+		
+		messagesLabel.getElement().getStyle().setFontWeight(FontWeight.BOLD);
+		
+		horizontalPanel.setWidget(0, 2, messagesLabel);
+		
+		horizontalPanel.setWidget(0, 3, new Label("There are no system messages."));
+
+		horizontalPanel.setWidget(0, 4, new Anchor("Logout"));
+
+		return horizontalPanel;
+	}
+
+	private SplitLayoutPanel createMainPanel() {
+		SplitLayoutPanel mainPanel = new SplitLayoutPanel(2);
+		
+		mainPanel.addWest(createConfigurationMenuPanel(), 300);
+
+		mainPanel.add(this.contentPanel);
+		
+		return mainPanel;
+	}
+
+	private StackLayoutPanel createConfigurationMenuPanel() {
+		StackLayoutPanel configMenuPanel = new StackLayoutPanel(Unit.EM);
+
+		configMenuPanel.add(new MenuTreeWidget(this.contentPanel), new Label("Identity Federation"), 1.5);
+		configMenuPanel.add(new HTML("asasa"), new Label("Circle of Trust"), 1.5);
+		configMenuPanel.add(new HTML("asasa"), new Label("Identity Management"), 1.5);
+		
+		return configMenuPanel;
+	}
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/console/client/widgets/common/MenuTreeWidget.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/client/widgets/common/MenuTreeWidget.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/client/widgets/common/MenuTreeWidget.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,62 @@
+package org.picketlink.console.client.widgets.common;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.Anchor;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+
+public class MenuTreeWidget extends Tree {
+
+	private final Panel contentPanel;
+	
+	public MenuTreeWidget(Panel contentPanel) {
+		init();
+		this.contentPanel = contentPanel;
+	}
+
+	private void init() {
+		this.addItem(createSecurityDomainOptions());
+		this.addItem(createIdentityProviderOptions());
+		this.addItem(createServiceProviderOptions());
+		this.addItem(new TreeItem("SAML Configurations"));
+	}
+	
+	private TreeItem createSecurityDomainOptions() {
+		TreeItem itemIDP = new TreeItem("Security Domains");
+		
+		Anchor newSecurityDomainAnchor = new Anchor("New ...");
+		
+		newSecurityDomainAnchor.addClickHandler(new ClickHandler() {
+			
+			@Override
+			public void onClick(ClickEvent event) {
+			}
+		});
+		
+		itemIDP.addItem(newSecurityDomainAnchor);
+		itemIDP.addItem(new Anchor("Search ..."));
+
+		return itemIDP;
+	}
+
+	private TreeItem createIdentityProviderOptions() {
+		TreeItem itemIDP = new TreeItem("Identity Providers");
+		
+		itemIDP.addItem(new Anchor("New ..."));
+		itemIDP.addItem(new Anchor("Search ..."));
+
+		return itemIDP;
+	}
+
+	private TreeItem createServiceProviderOptions() {
+		TreeItem itemIDP = new TreeItem("Service Providers");
+		
+		itemIDP.addItem(new Anchor("New ..."));
+		itemIDP.addItem(new Anchor("Search ..."));
+
+		return itemIDP;
+	}
+	
+}

Added: console/trunk/gui/src/main/java/org/picketlink/console/public/images/close.gif
===================================================================
(Binary files differ)


Property changes on: console/trunk/gui/src/main/java/org/picketlink/console/public/images/close.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: console/trunk/gui/src/main/java/org/picketlink/console/public/images/login.gif
===================================================================
(Binary files differ)


Property changes on: console/trunk/gui/src/main/java/org/picketlink/console/public/images/login.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: console/trunk/gui/src/main/java/org/picketlink/console/public/images/picketlink-banner-1180px.png
===================================================================
(Binary files differ)


Property changes on: console/trunk/gui/src/main/java/org/picketlink/console/public/images/picketlink-banner-1180px.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: console/trunk/gui/src/main/java/org/picketlink/console/public/images/user.png
===================================================================
(Binary files differ)


Property changes on: console/trunk/gui/src/main/java/org/picketlink/console/public/images/user.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

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 06:11:44 UTC (rev 1477)
@@ -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

Added: console/trunk/gui/src/main/java/org/picketlink/console/server/guice/DispatchServletModule.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/console/server/guice/DispatchServletModule.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/server/guice/DispatchServletModule.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,13 @@
+package org.picketlink.console.server.guice;
+
+import com.google.inject.servlet.ServletModule;
+import com.gwtplatform.dispatch.server.guice.DispatchServiceImpl;
+import com.gwtplatform.dispatch.shared.ActionImpl;
+
+public class DispatchServletModule extends ServletModule {
+
+    @Override
+    public void configureServlets() {
+        serve("/" + ActionImpl.DEFAULT_SERVICE_NAME).with(DispatchServiceImpl.class);
+    }
+}

Added: 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	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/console/server/guice/ServerModule.java	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,10 @@
+package org.picketlink.console.server.guice;
+
+import com.gwtplatform.dispatch.server.guice.HandlerModule;
+
+public class ServerModule extends HandlerModule {
+
+    @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 06:11:44 UTC (rev 1477)
@@ -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 06:11:44 UTC (rev 1477)
@@ -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 06:11:44 UTC (rev 1477)
@@ -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

Added: console/trunk/gui/src/main/webapp/PicketLinkConsole.html
===================================================================
--- console/trunk/gui/src/main/webapp/PicketLinkConsole.html	                        (rev 0)
+++ console/trunk/gui/src/main/webapp/PicketLinkConsole.html	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,48 @@
+<!doctype html>
+<!-- The DOCTYPE declaration above will set the    -->
+<!-- browser's rendering engine into               -->
+<!-- "Standards Mode". Replacing this declaration  -->
+<!-- with a "Quirks Mode" doctype may lead to some -->
+<!-- differences in layout.                        -->
+
+<html>
+	<head>
+		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+
+		<!--                                                               -->
+		<!-- Consider inlining CSS to reduce the number of requested files -->
+		<!--                                                               -->
+		<link type="text/css" rel="stylesheet" href="picketlink-console.css">
+
+		<!--                                           -->
+		<!-- Any title is fine                         -->
+		<!--                                           -->
+		<title>picketlink-console</title>
+
+		<!--                                           -->
+		<!-- This script loads your compiled module.   -->
+		<!-- If you add any GWT meta tags, they must   -->
+		<!-- be added before this line.                -->
+		<!--                                           -->
+		<script type="text/javascript" language="javascript" src="PicketLinkConsole/PicketLinkConsole.nocache.js"></script>
+	</head>
+
+	<!--                                           -->
+	<!-- The body can have arbitrary html, or      -->
+	<!-- you can leave the body empty if you want  -->
+	<!-- to create a completely dynamic UI.        -->
+	<!--                                           -->
+	<body>
+
+		<!-- OPTIONAL: include this if you want history support -->
+		<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position: absolute; width: 0;height: 0; border: 0;"></iframe>
+
+		<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
+		<noscript>
+			<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif;">
+				Your web browser must have JavaScript enabled
+				in order for this application to display correctly.
+			</div>
+		</noscript>
+	</body>
+</html>
\ No newline at end of file

Added: console/trunk/gui/src/main/webapp/WEB-INF/web.xml
===================================================================
--- console/trunk/gui/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ console/trunk/gui/src/main/webapp/WEB-INF/web.xml	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
+  <display-name>picketlink-console</display-name>
+  <welcome-file-list>
+    <welcome-file>index.html</welcome-file>
+  </welcome-file-list>
+  <listener>
+    <listener-class>org.picketlink.console.server.config.GuiceServletConfig</listener-class>
+  </listener>
+  <filter>
+    <filter-name>guiceFilter</filter-name>
+    <filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
+  </filter>
+  <filter-mapping>
+    <filter-name>guiceFilter</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
+</web-app>
\ No newline at end of file

Added: console/trunk/gui/src/main/webapp/picketlink-console.css
===================================================================
--- console/trunk/gui/src/main/webapp/picketlink-console.css	                        (rev 0)
+++ console/trunk/gui/src/main/webapp/picketlink-console.css	2012-03-03 06:11:44 UTC (rev 1477)
@@ -0,0 +1,2 @@
+/* Add css rules here for your application. */
+



More information about the picketlink-commits mailing list