[jboss-cvs] Picketlink SVN: r1512 - in console/trunk: gui and 18 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 14 21:23:51 EDT 2012


Author: pcraveiro
Date: 2012-03-14 21:23:49 -0400 (Wed, 14 Mar 2012)
New Revision: 1512

Added:
   console/trunk/gui/
   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/as/
   console/trunk/gui/src/main/java/org/picketlink/as/console/
   console/trunk/gui/src/main/java/org/picketlink/as/console/PicketLinkConsole.gwt.xml
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/BeanFactory.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ItemMenuText.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/NameTokens.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/core/
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/core/gin/
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/core/gin/PicketLinkClientModule.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/core/gin/PicketLinkGinjector.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/Federation.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/FederationStore.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/FederationStoreImpl.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPageEditor.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPagePresenter.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPageView.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationDetails.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationEditor.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationPresenter.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationTable.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationView.java
   console/trunk/gui/src/main/java/org/picketlink/as/console/rebind/
   console/trunk/gui/src/main/java/org/picketlink/as/console/rebind/extension/
   console/trunk/gui/src/main/java/org/picketlink/as/console/rebind/extension/PicketLinkApplicationMetaDataGenerator.java
   console/trunk/gui/src/main/resources/
   console/trunk/gui/src/test/
   console/trunk/gui/src/test/java/
   console/trunk/gui/src/test/resources/
Log:
Initial import.

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/PicketLinkConsole.gwt.xml
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/PicketLinkConsole.gwt.xml	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/PicketLinkConsole.gwt.xml	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,27 @@
+<!-- ~ JBoss, Home of Professional Open Source ~ Copyright 2011-2012 Red 
+	Hat Inc. and/or its affiliates and other contributors ~ as indicated by the 
+	@author tags. All rights reserved. ~ See the copyright.txt in the distribution 
+	for a ~ full listing of individual contributors. ~ ~ This copyrighted material 
+	is made available to anyone wishing to use, ~ modify, copy, or redistribute 
+	it subject to the terms and conditions ~ of the GNU Lesser General Public 
+	License, v. 2.1. ~ This program is distributed in the hope that it will be 
+	useful, but WITHOUT A ~ 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, ~ v.2.1 along with this distribution; if not, write 
+	to the Free Software ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, 
+	Boston, ~ MA 02110-1301, USA. -->
+
+<module rename-to="PicketLinkConsole">
+
+	<inherits name="org.jboss.as.console.App" />
+	
+	<generate-with class="org.picketlink.as.console.rebind.extension.PicketLinkApplicationMetaDataGenerator">
+        <when-type-assignable class="org.jboss.as.console.client.widgets.forms.ApplicationMetaData" />
+    </generate-with>
+	
+	<!-- Specify the paths for translatable code -->
+	<source path='client' />
+	<source path='shared' />
+
+</module>

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/BeanFactory.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/BeanFactory.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/BeanFactory.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as.console.client;
+
+import org.picketlink.as.console.client.shared.subsys.model.Federation;
+
+import com.google.gwt.autobean.shared.AutoBean;
+
+/**
+ * <p><code>com.google.gwt.autobean.shared.AutoBeanFactory</code> for the PicketLink module.</p>
+ * <p>This class extends the AS7 Console AutoBeanFactory as an extension to allow the PicketLink module reuse all
+ * bean definitions from the AS7 Console.</p>
+ * 
+ * @author Pedro Silva
+ * @sice Mar 13, 2012
+ */
+public interface BeanFactory extends org.jboss.as.console.client.shared.BeanFactory {
+
+    AutoBean<Federation> federation();
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/ItemMenuText.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/ItemMenuText.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/ItemMenuText.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as.console.client;
+
+/**
+ * Constants for the names of the menu items of the PicketLink profile. 
+ * 
+ * @author Pedro Silva
+ * @sice Mar 14, 2012
+ */
+public interface ItemMenuText {
+
+    public static final String PICKETLINK = "PicketLink";
+    public static final String FEDERATION = "Federation";
+    
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/NameTokens.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/NameTokens.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/NameTokens.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+
+package org.picketlink.as.console.client;
+
+/**
+ * NameTokens
+ * 
+ * PicketLink specific path tokens.
+ * 
+ * @author Pedro Silva
+ */
+public final class NameTokens {
+
+    private NameTokens() {
+    }
+
+    /**
+     * PicketLink main path
+     */
+    public static final String MAIN_PAGE = "picketlink-main";
+    
+    /**
+     * Federation configuration path
+     */
+    public static final String FEDERATION = "picletlink-federation";
+    
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/core/gin/PicketLinkClientModule.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/core/gin/PicketLinkClientModule.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/core/gin/PicketLinkClientModule.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+
+package org.picketlink.as.console.client.core.gin;
+
+import org.picketlink.as.console.client.shared.subsys.model.FederationStore;
+import org.picketlink.as.console.client.shared.subsys.model.FederationStoreImpl;
+import org.picketlink.as.console.client.ui.MainPagePresenter;
+import org.picketlink.as.console.client.ui.MainPageView;
+import org.picketlink.as.console.client.ui.federation.FederationPresenter;
+import org.picketlink.as.console.client.ui.federation.FederationView;
+
+import com.google.inject.Singleton;
+import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+
+
+/**
+ * PicketLink configuration bindings.
+ * 
+ * @author Pedro Silva
+ */
+public class PicketLinkClientModule extends AbstractPresenterModule {
+
+    /* (non-Javadoc)
+     * @see com.google.gwt.inject.client.AbstractGinModule#configure()
+     */
+    protected void configure() {
+        bindMain();
+        bindFederation();
+    }
+
+    /**
+     * Binds the components related with the main path
+     */
+    private void bindMain() {
+        bindPresenter(MainPagePresenter.class, MainPagePresenter.MyView.class, MainPageView.class,
+                MainPagePresenter.MyProxy.class);
+    }
+
+    /**
+     * Binds the components related with the federation configuration path
+     */
+    private void bindFederation() {
+        bindPresenter(FederationPresenter.class, FederationPresenter.MyView.class, FederationView.class,
+                FederationPresenter.MyProxy.class);
+        bind(FederationStore.class).to(FederationStoreImpl.class).in(Singleton.class);
+    }
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/core/gin/PicketLinkGinjector.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/core/gin/PicketLinkGinjector.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/core/gin/PicketLinkGinjector.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+
+package org.picketlink.as.console.client.core.gin;
+
+import org.jboss.as.console.client.shared.SubsystemExtension;
+import org.jboss.as.console.client.shared.SubsystemExtension.SubsystemGroupDefinition;
+import org.jboss.as.console.client.shared.SubsystemExtension.SubsystemItemDefinition;
+import org.picketlink.as.console.client.ItemMenuText;
+import org.picketlink.as.console.client.NameTokens;
+import org.picketlink.as.console.client.ui.MainPagePresenter;
+import org.picketlink.as.console.client.ui.federation.FederationPresenter;
+
+import com.google.gwt.inject.client.AsyncProvider;
+import com.google.gwt.inject.client.GinModules;
+import com.google.gwt.inject.client.Ginjector;
+
+
+/**
+ * <p>Ginjector interface for the PicketLink module.</p>
+ * <p>This interface also provides the configuration for the AS7 extension mechanism. The annotations declared in the type
+ * are uses the extension mechanism to add the PicketLink module features in the AS7 Console Profile menu tree.</p>
+ * 
+ * @see PicketLinkClientModule
+ * 
+ * @author Pedro Silva
+ * @author Rob Cernich
+ */
+ at SubsystemExtension(@SubsystemGroupDefinition(subsystem="picketlink", name = ItemMenuText.PICKETLINK, items = {
+        @SubsystemItemDefinition(presenter = NameTokens.FEDERATION, name = ItemMenuText.FEDERATION)}))
+ at GinModules(PicketLinkClientModule.class)
+public interface PicketLinkGinjector extends Ginjector {
+
+    AsyncProvider<MainPagePresenter> getMainPagePresenter();
+    
+    AsyncProvider<FederationPresenter> getFederationPresenter();
+    
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/Federation.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/Federation.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/Federation.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as.console.client.shared.subsys.model;
+
+import org.jboss.as.console.client.widgets.forms.Address;
+import org.jboss.as.console.client.widgets.forms.Binding;
+
+/**
+ * <p>Federation bean definition.</p>
+ * <p>This interface also defines the address to be used when using the AS7 management API.</p>
+ * 
+ * @author Pedro Silva
+ * @sice Mar 14, 2012
+ */
+ at Address("/subsystem=picketlink/federation={0}")
+public interface Federation {
+
+    @Binding(key = true)
+    String getAlias();
+    void setAlias(String alias);
+    
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/FederationStore.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/FederationStore.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/FederationStore.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as.console.client.shared.subsys.model;
+
+import java.util.List;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * <p>This interface defines the methods that can be used to manipulate the {@link Federation} model.</p>
+ * 
+ * @author Pedro Silva
+ * @sice Mar 14, 2012
+ */
+public interface FederationStore {
+
+    /**
+     * Loads all federation configurations.
+     * 
+     * @param callback
+     */
+    void loadFederations(AsyncCallback<List<Federation>> callback);
+    
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/FederationStoreImpl.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/FederationStoreImpl.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/FederationStoreImpl.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as.console.client.shared.subsys.model;
+
+import static org.jboss.dmr.client.ModelDescriptionConstants.OP;
+import static org.jboss.dmr.client.ModelDescriptionConstants.READ_CHILDREN_RESOURCES_OPERATION;
+import static org.jboss.dmr.client.ModelDescriptionConstants.RESULT;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.jboss.as.console.client.shared.dispatch.DispatchAsync;
+import org.jboss.as.console.client.shared.dispatch.impl.DMRAction;
+import org.jboss.as.console.client.shared.dispatch.impl.DMRResponse;
+import org.jboss.as.console.client.shared.subsys.Baseadress;
+import org.jboss.as.console.client.widgets.forms.AddressBinding;
+import org.jboss.as.console.client.widgets.forms.ApplicationMetaData;
+import org.jboss.as.console.client.widgets.forms.BeanMetaData;
+import org.jboss.as.console.client.widgets.forms.EntityAdapter;
+import org.jboss.dmr.client.ModelNode;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * <p>
+ * Implementation of {@link FederationStore}.
+ * </p>
+ * 
+ * @author Pedro Silva
+ * @sice Mar 14, 2012
+ */
+public class FederationStoreImpl implements FederationStore {
+
+    private final DispatchAsync dispatcher;
+    private final ApplicationMetaData metaData;
+    private final EntityAdapter<Federation> federationAdapter;
+
+    private BeanMetaData federationMetaData;
+    private Baseadress baseadress;
+
+    @Inject
+    public FederationStoreImpl(DispatchAsync dispatcher, ApplicationMetaData propertyMetaData, Baseadress baseadress) {
+        this.dispatcher = dispatcher;
+        this.metaData = propertyMetaData;
+        this.baseadress = baseadress;
+        this.federationMetaData = metaData.getBeanMetaData(Federation.class);
+        this.federationAdapter = new EntityAdapter<Federation>(Federation.class, propertyMetaData);
+    }
+
+    /* (non-Javadoc)
+     * @see org.picketlink.as.console.client.shared.subsys.model.FederationStore#loadFederations(com.google.gwt.user.client.rpc.AsyncCallback)
+     */
+    @Override
+    public void loadFederations(final AsyncCallback<List<Federation>> callback) {
+        AddressBinding address = federationMetaData.getAddress();
+        ModelNode operation = address.asSubresource(baseadress.getAdress());
+        operation.get(OP).set(READ_CHILDREN_RESOURCES_OPERATION);
+
+        dispatcher.execute(new DMRAction(operation), new AsyncCallback<DMRResponse>() {
+            @Override
+            public void onFailure(Throwable caught) {
+                callback.onFailure(caught);
+            }
+
+            @Override
+            public void onSuccess(DMRResponse result) {
+                ModelNode response = result.get();
+
+                if (response.isFailure()) {
+                    callback.onFailure(new RuntimeException(response.getFailureDescription()));
+                } else {
+                    List<Federation> datasources = federationAdapter.fromDMRList(response.get(RESULT).asList());
+                    callback.onSuccess(datasources);
+                }
+            }
+        });
+    }
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPageEditor.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPageEditor.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPageEditor.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+
+package org.picketlink.as.console.client.ui;
+
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * @author Pedro Silva
+ */
+public class MainPageEditor {
+    
+    private Panel componentDetails;
+    
+    public MainPageEditor() {
+    }
+
+    /**
+     * @return this editor as a Widget.
+     */
+    public Widget asWidget() {
+
+        VerticalPanel layout = new VerticalPanel();
+        layout.setStyleName("fill-layout-width");
+        
+        layout.add(new Label("teste"));
+
+        return layout;
+    }
+    
+    /**
+     * @param content component specific content.
+     */
+    public void setComponentContent(Widget content) {
+        this.componentDetails.clear();
+        
+        if (content != null) {
+            this.componentDetails.add(content);
+        }
+    }
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPagePresenter.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPagePresenter.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPagePresenter.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,92 @@
+/*
+* 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.as.console.client.ui;
+
+import org.jboss.as.console.client.shared.subsys.RevealStrategy;
+import org.jboss.ballroom.client.layout.LHSHighlightEvent;
+import org.picketlink.as.console.client.NameTokens;
+
+import com.google.gwt.core.client.Scheduler;
+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.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Place;
+import com.gwtplatform.mvp.client.proxy.PlaceManager;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class MainPagePresenter extends Presenter<MainPagePresenter.MyView, MainPagePresenter.MyProxy> {
+
+    public interface MyView extends View {
+
+    }
+
+    @ProxyCodeSplit
+    @NameToken(NameTokens.MAIN_PAGE)
+    public interface MyProxy extends Proxy<MainPagePresenter>, Place {
+    }
+
+    private final PlaceManager placeManager;
+    private RevealStrategy revealStrategy;
+
+    @Inject
+    public MainPagePresenter(final EventBus eventBus, final MyView view, final MyProxy proxy, final PlaceManager placeManager, RevealStrategy revealStrategy) {
+        super(eventBus, view, proxy);
+
+        this.placeManager = placeManager;
+        this.revealStrategy = revealStrategy;
+    }
+    
+    @Override
+    protected void onReveal() {
+        super.onReveal();
+        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
+            @Override
+            public void execute() {
+                fireEvent(new LHSHighlightEvent("unused", "PicketLink",
+                        "profiles"));
+            }
+        });
+    }
+
+    @Override
+    protected void revealInParent() {
+        this.revealStrategy.revealInParent(this);
+    }
+
+    @Override
+    protected void onBind() {
+        super.onBind();
+    }
+
+    @Override
+    protected void onReset() {
+        super.onReset();
+    }
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPageView.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPageView.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/MainPageView.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+
+package org.picketlink.as.console.client.ui;
+
+import org.jboss.as.console.client.core.DisposableViewImpl;
+import org.jboss.as.console.client.shared.viewframework.builder.SimpleLayout;
+
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * @author Pedro Silva
+ */
+public class MainPageView extends DisposableViewImpl implements MainPagePresenter.MyView {
+
+    private MainPageEditor mainPageEditor;
+
+    @Override
+    public Widget createWidget() {
+        mainPageEditor = new MainPageEditor();
+        SimpleLayout layout = new SimpleLayout().setTitle("PicketLink Subsystem Details")
+                .setHeadline("Federation Configuration").setDescription("Displays all federation configurations.")
+                .addContent("Runtime Details", mainPageEditor.asWidget());
+        return layout.build();
+    }
+    
+    @Override
+    public void setInSlot(Object slot, Widget content) {
+        this.mainPageEditor.setComponentContent(content);
+    }
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationDetails.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationDetails.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationDetails.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as.console.client.ui.federation;
+
+import java.util.Map;
+
+import org.jboss.as.console.client.shared.help.FormHelpPanel;
+import org.jboss.as.console.client.shared.subsys.Baseadress;
+import org.jboss.as.console.client.shared.subsys.jca.model.DataSource;
+import org.jboss.as.console.client.widgets.forms.FormToolStrip;
+import org.jboss.ballroom.client.widgets.forms.Form;
+import org.jboss.ballroom.client.widgets.forms.TextItem;
+import org.jboss.ballroom.client.widgets.tools.ToolButton;
+import org.jboss.dmr.client.ModelNode;
+import org.picketlink.as.console.client.shared.subsys.model.Federation;
+
+import com.google.gwt.user.cellview.client.CellTable;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * This class defines the widget to be displayed when a federation instance is selected.
+ * 
+ * @author Pedro Silva
+ * @sice Mar 14, 2012
+ */
+public class FederationDetails {
+
+    private Form<Federation> form;
+    private FederationPresenter presenter;
+    private ToolButton disableBtn;
+
+    public FederationDetails(FederationPresenter presenter) {
+        this.presenter = presenter;
+        form = new Form(DataSource.class);
+        form.setNumColumns(2);
+
+        /*form.addEditListener(new EditListener<DataSource>() {
+            @Override
+            public void editingBean(DataSource bean) {
+                String nextState = bean.isEnabled() ? Console.CONSTANTS.common_label_disable():Console.CONSTANTS.common_label_enable();
+                disableBtn.setText(nextState);
+            }
+        });*/
+    }
+
+    public Widget asWidget() {
+        VerticalPanel detailPanel = new VerticalPanel();
+        detailPanel.setStyleName("fill-layout-width");
+
+        FormToolStrip<Federation> toolStrip = new FormToolStrip<Federation>(
+                form,
+                new FormToolStrip.FormCallback<Federation>() {
+                    @Override
+                    public void onSave(Map<String, Object> changeset) {
+                         presenter.onSaveFederationDetails(form.getEditedEntity().getAlias(), form.getChangedValues());
+                    }
+
+                    @Override
+                    public void onDelete(Federation entity) {
+
+                    }
+                });
+
+
+        toolStrip.providesDeleteOp(false);
+
+       /* toolStrip.addToolButtonRight(disableBtn);
+
+        // not available in domain mode
+        if(Console.MODULES.getBootstrapContext().isStandalone())
+            toolStrip.addToolButtonRight(verifyBtn);  */
+
+        detailPanel.add(toolStrip.asWidget());
+
+        final TextItem aliasItem = new TextItem("alias", "Alias");
+
+        form.setFields(aliasItem);
+
+        Widget formWidget = form.asWidget();
+
+        final FormHelpPanel helpPanel = new FormHelpPanel(
+                new FormHelpPanel.AddressCallback() {
+                    @Override
+                    public ModelNode getAddress() {
+                        ModelNode address = Baseadress.get();
+                        address.add("subsystem", "picketlink");
+                        address.add("federation", "*");
+                        return address;
+                    }
+                }, form
+        );
+
+        detailPanel.add(helpPanel.asWidget());
+
+        detailPanel.add(formWidget);
+
+        ScrollPanel scroll = new ScrollPanel(detailPanel);
+        
+        return scroll;
+    }
+
+    public void bind(CellTable<Federation> dataSourceTable) {
+        form.bind(dataSourceTable);
+    }
+
+    public void setEnabled(boolean b) {
+        form.setEnabled(b);
+    }
+
+    public Federation getCurrentSelection() {
+        return form.getEditedEntity();
+    }
+    
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationEditor.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationEditor.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationEditor.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,193 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as.console.client.ui.federation;
+
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.as.console.client.Console;
+import org.jboss.as.console.client.shared.subsys.jca.model.DataSource;
+import org.jboss.as.console.client.widgets.ContentDescription;
+import org.jboss.as.console.client.widgets.forms.FormToolStrip;
+import org.jboss.ballroom.client.widgets.ContentGroupLabel;
+import org.jboss.ballroom.client.widgets.ContentHeaderLabel;
+import org.jboss.ballroom.client.widgets.tables.DefaultCellTable;
+import org.jboss.ballroom.client.widgets.tools.ToolButton;
+import org.jboss.ballroom.client.widgets.tools.ToolStrip;
+import org.jboss.ballroom.client.widgets.window.Feedback;
+import org.picketlink.as.console.client.shared.subsys.model.Federation;
+
+import com.google.gwt.dom.client.Style;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.LayoutPanel;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.TabPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.view.client.SelectionChangeEvent;
+import com.google.gwt.view.client.SingleSelectionModel;
+
+/**
+ * <p>This class defines the widget to be displayed when the Federation option is selected from the menu.</p>
+ * <p>It defines the layout for the federation configuration main page.</p>
+ * 
+ * @author Pedro Silva
+ * @sice Mar 14, 2012
+ */
+public class FederationEditor {
+
+    private FederationPresenter presenter;
+    private FederationTable federationTable;
+    private FederationDetails details;
+
+    public FederationEditor(FederationPresenter presenter) {
+        this.presenter = presenter;
+    }
+
+    public Widget asWidget() {
+
+        LayoutPanel layout = new LayoutPanel();
+
+        ToolStrip topLevelTools = new ToolStrip();
+        topLevelTools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() {
+
+            @Override
+            public void onClick(ClickEvent event) {
+                //TODO: launch new federation wizard
+            }
+        }));
+
+
+        ClickHandler clickHandler = new ClickHandler() {
+            @Override
+            public void onClick(ClickEvent event) {
+
+                final Federation currentSelection = details.getCurrentSelection();
+                if(currentSelection!=null)
+                {
+                    Feedback.confirm(
+                            Console.MESSAGES.deleteTitle("Federation"),
+                            Console.MESSAGES.deleteConfirm("Federation " + currentSelection.getAlias()),
+                            new Feedback.ConfirmationHandler() {
+                                @Override
+                                public void onConfirmation(boolean isConfirmed) {
+                                    if (isConfirmed) {
+                                        presenter.onDelete(currentSelection);
+                                    }
+                                }
+                            });
+                }
+            }
+        };
+        ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete());
+        deleteBtn.addClickHandler(clickHandler);
+        topLevelTools.addToolButtonRight(deleteBtn);
+
+        // ----
+
+        VerticalPanel vpanel = new VerticalPanel();
+        vpanel.setStyleName("rhs-content-panel");
+
+        ScrollPanel scroll = new ScrollPanel(vpanel);
+        layout.add(scroll);
+
+        layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);
+
+        // ---
+
+        vpanel.add(new ContentHeaderLabel("Federation"));
+        vpanel.add(new ContentDescription("The PicketLink Federation provides the configurations for IDPs and SPs given a federation configuration."));
+
+        federationTable = new FederationTable();
+
+
+        vpanel.add(new ContentGroupLabel(Console.MESSAGES.available("Federations")));
+        vpanel.add(topLevelTools.asWidget());
+        vpanel.add(federationTable.asWidget());
+
+
+        // -----------
+        details = new FederationDetails(presenter);
+        details.bind(federationTable.getCellTable());
+
+        SingleSelectionModel<Federation> selectionModel =
+                (SingleSelectionModel<Federation>)federationTable.getCellTable().getSelectionModel();
+
+        selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler () {
+            @Override
+            public void onSelectionChange(SelectionChangeEvent event) {
+                Federation selectedObject = ((SingleSelectionModel<Federation>) federationTable.getCellTable().getSelectionModel()).getSelectedObject();
+                details.setEnabled(true);
+            }
+        });
+
+        // -----------------
+
+        TabPanel bottomPanel = new TabPanel();
+        bottomPanel.setStyleName("default-tabpanel");
+
+        bottomPanel.add(details.asWidget(), "Attributes");
+
+        // -----------------
+
+        bottomPanel.add(new SimplePanel(), "Identity Provider");
+        bottomPanel.add(new SimplePanel(), "Service Providers");
+        bottomPanel.add(new SimplePanel(), "Digital Certificates");
+        
+        bottomPanel.selectTab(0);
+
+        // -----------------
+
+        vpanel.add(new ContentGroupLabel(Console.CONSTANTS.common_label_selection()));
+
+        vpanel.add(bottomPanel);
+
+        return layout;
+    }
+
+
+    private Federation getCurrentSelection() {
+        Federation ds = ((SingleSelectionModel<Federation>) federationTable.getCellTable().getSelectionModel()).getSelectedObject();
+        return ds;
+    }
+
+    public void updateDataSources(List<Federation> datasources) {
+
+        federationTable.getDataProvider().setList(datasources);
+
+        final DefaultCellTable<Federation> cellTable = federationTable.getCellTable();
+        cellTable.selectDefaultEntity();
+    }
+
+    public void setEnabled(boolean isEnabled) {
+
+
+    }
+
+    public void enableDetails(boolean b) {
+        details.setEnabled(b);
+    }
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationPresenter.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationPresenter.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationPresenter.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,126 @@
+/*
+ * 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.as.console.client.ui.federation;
+
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.as.console.client.domain.model.SimpleCallback;
+import org.jboss.as.console.client.shared.subsys.RevealStrategy;
+import org.jboss.ballroom.client.layout.LHSHighlightEvent;
+import org.picketlink.as.console.client.BeanFactory;
+import org.picketlink.as.console.client.NameTokens;
+import org.picketlink.as.console.client.shared.subsys.model.Federation;
+import org.picketlink.as.console.client.shared.subsys.model.FederationStore;
+
+import com.google.gwt.core.client.Scheduler;
+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.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Place;
+import com.gwtplatform.mvp.client.proxy.PlaceManager;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+
+/**
+ * @author Pedro Silva
+ * @since 03/01/2011
+ */
+public class FederationPresenter extends Presenter<FederationPresenter.MyView, FederationPresenter.MyProxy> {
+
+    public interface MyView extends View {
+        void setPresenter(FederationPresenter presenter);
+
+        void updateFederations(List<Federation> federations);
+    }
+
+    @ProxyCodeSplit
+    @NameToken(NameTokens.FEDERATION)
+    public interface MyProxy extends Proxy<FederationPresenter>, Place {
+    }
+
+    private final PlaceManager placeManager;
+    private final RevealStrategy revealStrategy;
+    private final BeanFactory beanFactory;
+    private FederationStore federationStore;
+
+    @Inject
+    public FederationPresenter(final EventBus eventBus, BeanFactory beanFactory, final MyView view, final MyProxy proxy,
+            final PlaceManager placeManager, RevealStrategy revealStrategy, FederationStore federationStore) {
+        super(eventBus, view, proxy);
+
+        this.placeManager = placeManager;
+        this.revealStrategy = revealStrategy;
+        this.beanFactory = beanFactory;
+        this.federationStore = federationStore;
+    }
+
+    @Override
+    protected void onReveal() {
+        super.onReveal();
+        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
+            @Override
+            public void execute() {
+                fireEvent(new LHSHighlightEvent("unused", "PicketLink", "profiles"));
+            }
+        });
+    }
+
+    @Override
+    protected void revealInParent() {
+        this.revealStrategy.revealInParent(this);
+    }
+
+    @Override
+    protected void onBind() {
+        super.onBind();
+    }
+
+    @Override
+    protected void onReset() {
+        super.onReset();
+        this.federationStore.loadFederations(new SimpleCallback<List<Federation>>() {
+            @Override
+            public void onSuccess(List<Federation> result) {
+                getView().updateFederations(result);
+            }
+        });
+    }
+
+    /**
+     * @param alias
+     * @param changedValues
+     */
+    public void onSaveFederationDetails(String alias, Map<String, Object> changedValues) {
+        // TODO: on save federation details
+    }
+
+    /**
+     * @param currentSelection
+     */
+    public void onDelete(Federation currentSelection) {
+        // TODO: on delete federation
+    }
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationTable.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationTable.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationTable.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as.console.client.ui.federation;
+
+import org.jboss.ballroom.client.widgets.tables.DefaultCellTable;
+import org.jboss.ballroom.client.widgets.tables.DefaultPager;
+import org.picketlink.as.console.client.shared.subsys.model.Federation;
+
+import com.google.gwt.user.cellview.client.TextColumn;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.view.client.ListDataProvider;
+import com.google.gwt.view.client.ProvidesKey;
+
+/**
+ * This class defines the widget to be displayed for the table of federations.
+ * 
+ * @author Pedro Silva
+ * @sice Mar 14, 2012
+ */public class FederationTable {
+
+    private static final int PAGE_SIZE = 5;
+    private DefaultCellTable<Federation> federationTable;
+    private ListDataProvider<Federation> dataProvider;
+
+    Widget asWidget() {
+
+        VerticalPanel layout = new VerticalPanel();
+        layout.setStyleName("fill-layout-width");
+
+        federationTable = new DefaultCellTable<Federation>(
+                PAGE_SIZE,
+                new ProvidesKey<Federation>() {
+                    @Override
+                    public Object getKey(Federation item) {
+                        return item.getAlias();
+                    }
+                });
+
+        dataProvider = new ListDataProvider<Federation>();
+        dataProvider.addDataDisplay(federationTable);
+
+        TextColumn<Federation> aliasColumn = new TextColumn<Federation>() {
+            @Override
+            public String getValue(Federation record) {
+                return record.getAlias();
+            }
+        };
+
+        federationTable.addColumn(aliasColumn, "Name");
+
+        layout.add(federationTable);
+
+        // ---
+        // http://code.google.com/p/google-web-toolkit/issues/detail?id=4988
+
+        DefaultPager pager = new DefaultPager();
+        pager.setDisplay(federationTable);
+        layout.add(pager);
+
+        return layout;
+    }
+
+    public DefaultCellTable<Federation> getCellTable() {
+        return federationTable;
+    }
+
+    public ListDataProvider<Federation> getDataProvider() {
+        return dataProvider;
+    }
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationView.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationView.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationView.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as.console.client.ui.federation;
+
+import java.util.List;
+
+import org.jboss.as.console.client.Console;
+import org.jboss.as.console.client.core.SuspendableViewImpl;
+import org.jboss.as.console.client.widgets.tabs.DefaultTabLayoutPanel;
+import org.picketlink.as.console.client.shared.subsys.model.Federation;
+
+import com.google.gwt.dom.client.Style;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * @author pedroigor
+ * @sice Mar 14, 2012
+ */
+public class FederationView extends SuspendableViewImpl implements FederationPresenter.MyView {
+
+    private FederationPresenter presenter;
+    private FederationEditor federationEditor;
+
+    @Override
+    public Widget createWidget() {
+
+        this.federationEditor = new FederationEditor(presenter);
+
+        DefaultTabLayoutPanel tabLayoutpanel = new DefaultTabLayoutPanel(40, Style.Unit.PX);
+        tabLayoutpanel.addStyleName("default-tabpanel");
+
+
+        tabLayoutpanel.add(federationEditor.asWidget(), "PicketLink Federation", true);
+
+        tabLayoutpanel.selectTab(0);
+
+        return tabLayoutpanel;
+    }
+
+    @Override
+    public void setPresenter(FederationPresenter presenter) {
+        this.presenter = presenter;
+    }
+
+    @Override
+    public void updateFederations(List<Federation> federations) {
+        federationEditor.updateDataSources(federations);
+    }
+
+}

Added: console/trunk/gui/src/main/java/org/picketlink/as/console/rebind/extension/PicketLinkApplicationMetaDataGenerator.java
===================================================================
--- console/trunk/gui/src/main/java/org/picketlink/as/console/rebind/extension/PicketLinkApplicationMetaDataGenerator.java	                        (rev 0)
+++ console/trunk/gui/src/main/java/org/picketlink/as/console/rebind/extension/PicketLinkApplicationMetaDataGenerator.java	2012-03-15 01:23:49 UTC (rev 1512)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.as.console.rebind.extension;
+
+import org.jboss.as.console.rebind.extensions.ApplicationMetaDataGeneratorExtension;
+
+/**
+ * <p>Extension to the AS7 Console to load the bean definitions from the PicketLink AutoBeanFactory.</p>
+ * <p>This class allows to load all metadata related with the beans to be used to access the subsystem.</p>
+ * 
+ * @author pedroigor
+ * @sice Mar 14, 2012
+ */
+public class PicketLinkApplicationMetaDataGenerator extends ApplicationMetaDataGeneratorExtension {
+
+    /* (non-Javadoc)
+     * @see org.jboss.as.console.rebind.extensions.ApplicationMetaDataGeneratorExtension#getBeanFactory()
+     */
+    @Override
+    protected String getBeanFactory() {
+        return "org.picketlink.as.console.client.BeanFactory";
+    }
+    
+}



More information about the jboss-cvs-commits mailing list