Author: pcraveiro
Date: 2012-03-19 19:53:07 -0400 (Mon, 19 Mar 2012)
New Revision: 1533
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/IdentityProvider.java
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/ServiceProvider.java
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/AbstractFederationDetails.java
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/AbstractModelElementTable.java
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/EditableFederationDetails.java
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/IdentityProviderDetails.java
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/NewFederationWizard.java
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/NewFederationWizardStep1.java
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/ServiceProviderDetails.java
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/ServiceProviderTable.java
Modified:
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/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/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/extension/PicketLinkApplicationMetaDataGenerator.java
Log:
Service Provider support.
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/BeanFactory.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -23,6 +23,8 @@
package org.picketlink.as.console.client;
import org.picketlink.as.console.client.shared.subsys.model.Federation;
+import org.picketlink.as.console.client.shared.subsys.model.IdentityProvider;
+import org.picketlink.as.console.client.shared.subsys.model.ServiceProvider;
import com.google.gwt.autobean.shared.AutoBean;
@@ -32,9 +34,13 @@
* bean definitions from the AS7 Console.</p>
*
* @author Pedro Silva
- * @sice Mar 13, 2012
+ * @since Mar 13, 2012
*/
public interface BeanFactory extends org.jboss.as.console.client.shared.BeanFactory {
AutoBean<Federation> federation();
+
+ AutoBean<IdentityProvider> identityProvider();
+
+ AutoBean<ServiceProvider> serviceProvider();
}
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ItemMenuText.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -26,7 +26,7 @@
* Constants for the names of the menu items of the PicketLink profile.
*
* @author Pedro Silva
- * @sice Mar 14, 2012
+ * @since Mar 14, 2012
*/
public interface ItemMenuText {
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/Federation.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -30,7 +30,7 @@
* <p>This interface also defines the address to be used when using the AS7
management API.</p>
*
* @author Pedro Silva
- * @sice Mar 14, 2012
+ * @since Mar 14, 2012
*/
@Address("/subsystem=picketlink/federation={0}")
public interface Federation {
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/FederationStore.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -24,13 +24,15 @@
import java.util.List;
+import org.jboss.as.console.client.domain.model.SimpleCallback;
+
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
+ * @since Mar 14, 2012
*/
public interface FederationStore {
@@ -41,4 +43,20 @@
*/
void loadFederations(AsyncCallback<List<Federation>> callback);
+ /**
+ * <p>
+ * Loads the identity providers configurations given a federation instance.
+ * </p>
+ *
+ * @param federation
+ * @param callback
+ */
+ void loadIdentityProviders(Federation federation, final
AsyncCallback<List<IdentityProvider>> callback);
+
+ /**
+ * @param federation
+ * @param simpleCallback
+ */
+ void loadServiceProviders(Federation federation,
SimpleCallback<List<ServiceProvider>> simpleCallback);
+
}
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/FederationStoreImpl.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -30,6 +30,7 @@
import javax.inject.Inject;
+import org.jboss.as.console.client.domain.model.SimpleCallback;
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;
@@ -48,16 +49,20 @@
* </p>
*
* @author Pedro Silva
- * @sice Mar 14, 2012
+ * @since Mar 14, 2012
*/
public class FederationStoreImpl implements FederationStore {
private final DispatchAsync dispatcher;
private final ApplicationMetaData metaData;
private final EntityAdapter<Federation> federationAdapter;
+ private final EntityAdapter<IdentityProvider> identityProviderAdapter;
+ private final EntityAdapter<ServiceProvider> serviceProviderAdapter;
private BeanMetaData federationMetaData;
private Baseadress baseadress;
+ private BeanMetaData identityProviderMetaData;
+ private BeanMetaData serviceProviderMetaData;
@Inject
public FederationStoreImpl(DispatchAsync dispatcher, ApplicationMetaData
propertyMetaData, Baseadress baseadress) {
@@ -65,7 +70,11 @@
this.metaData = propertyMetaData;
this.baseadress = baseadress;
this.federationMetaData = metaData.getBeanMetaData(Federation.class);
+ this.identityProviderMetaData =
metaData.getBeanMetaData(IdentityProvider.class);
+ this.serviceProviderMetaData = metaData.getBeanMetaData(ServiceProvider.class);
this.federationAdapter = new EntityAdapter<Federation>(Federation.class,
propertyMetaData);
+ this.identityProviderAdapter = new
EntityAdapter<IdentityProvider>(IdentityProvider.class, propertyMetaData);
+ this.serviceProviderAdapter = new
EntityAdapter<ServiceProvider>(ServiceProvider.class, propertyMetaData);
}
/* (non-Javadoc)
@@ -96,5 +105,61 @@
}
});
}
+
+ public void loadIdentityProviders(Federation federation, final
AsyncCallback<List<IdentityProvider>> callback) {
+ AddressBinding address = this.identityProviderMetaData.getAddress();
+
+ ModelNode operation = address.asSubresource(federation.getAlias());
+ 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<IdentityProvider> datasources =
identityProviderAdapter.fromDMRList(response.get(RESULT).asList());
+ callback.onSuccess(datasources);
+ }
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see
org.picketlink.as.console.client.shared.subsys.model.FederationStore#loadServiceProviders(org.picketlink.as.console.client.shared.subsys.model.Federation,
org.jboss.as.console.client.domain.model.SimpleCallback)
+ */
+ @Override
+ public void loadServiceProviders(Federation federation, final
SimpleCallback<List<ServiceProvider>> callback) {
+ AddressBinding address = this.serviceProviderMetaData.getAddress();
+
+ ModelNode operation = address.asSubresource(federation.getAlias());
+ 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<ServiceProvider> datasources =
serviceProviderAdapter.fromDMRList(response.get(RESULT).asList());
+ callback.onSuccess(datasources);
+ }
+ }
+ });
+ }
+
}
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/IdentityProvider.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/IdentityProvider.java
(rev 0)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/IdentityProvider.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -0,0 +1,54 @@
+/*
+ * 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
+ * @since Mar 14, 2012
+ */
+@Address("/subsystem=picketlink/federation={0}/identity-provider={1}")
+public interface IdentityProvider {
+
+ @Binding(key = true)
+ String getAlias();
+ void setAlias(String alias);
+
+ @Binding (detypedName="url")
+ String getUrl();
+ void setUrl(String url);
+
+ @Binding (detypedName="signOutgoingMessages")
+ String getSignOutgoingMessages();
+ void setSignOutgoingMessages(String url);
+
+ @Binding (detypedName="ignoreIncomingSignatures")
+ String getIgnoreIncomingSignatures();
+ void setIgnoreIncomingSignatures(String url);
+
+}
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/ServiceProvider.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/ServiceProvider.java
(rev 0)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/shared/subsys/model/ServiceProvider.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -0,0 +1,46 @@
+/*
+ * 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
+ * @since Mar 14, 2012
+ */
+@Address("/subsystem=picketlink/federation={0}/service-provider={0}")
+public interface ServiceProvider {
+
+ @Binding(key = true)
+ String getAlias();
+ void setAlias(String alias);
+
+ @Binding(key = true)
+ String getUrl();
+ void setUrl(String url);
+
+}
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/AbstractFederationDetails.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/AbstractFederationDetails.java
(rev 0)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/AbstractFederationDetails.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -0,0 +1,101 @@
+/*
+ * 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.shared.help.FormHelpPanel;
+import org.jboss.as.console.client.shared.viewframework.builder.FormLayout;
+import org.jboss.ballroom.client.widgets.forms.Form;
+import org.jboss.ballroom.client.widgets.forms.FormItem;
+import org.jboss.dmr.client.ModelNode;
+import org.picketlink.as.console.client.shared.subsys.model.IdentityProvider;
+
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
+ * @since Mar 19, 2012
+ */
+public abstract class AbstractFederationDetails<T> {
+
+ private Form<T> form;
+ private IdentityProvider entityInstance;
+
+ public AbstractFederationDetails() {
+ this.form = new Form(getEntityClass());
+ this.form.setNumColumns(2);
+ }
+
+ /**
+ * @return
+ */
+ protected abstract Class<?> getEntityClass();
+
+ public Widget asWidget() {
+ VerticalPanel detailPanel = new VerticalPanel();
+ detailPanel.setStyleName("fill-layout-width");
+
+ List<FormItem<?>> formItems = getFormItems();
+
+ form.setFields(formItems.toArray(new FormItem<?>[formItems.size()]));
+
+ form.setEnabled(false);
+
+ Widget formWidget = form.asWidget();
+
+ final FormHelpPanel helpPanel = new FormHelpPanel(new
FormHelpPanel.AddressCallback() {
+ @Override
+ public ModelNode getAddress() {
+ return getHelpModelAddress();
+ }
+
+ }, form);
+
+ detailPanel.add(formWidget);
+
+ return new FormLayout().setHelp(helpPanel).setForm(form).build();
+ }
+
+ protected abstract ModelNode getHelpModelAddress();
+
+ /**
+ * @return
+ */
+ protected abstract List<FormItem<?>> getFormItems();
+
+ /**
+ * @param entityInstance the entityInstance to set
+ */
+ public void setEntityInstance(IdentityProvider entityInstance) {
+ this.entityInstance = entityInstance;
+ }
+
+ /**
+ * @return the form
+ */
+ public Form<T> getForm() {
+ return this.form;
+ }
+}
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/AbstractModelElementTable.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/AbstractModelElementTable.java
(rev 0)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/AbstractModelElementTable.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -0,0 +1,103 @@
+/*
+ * 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 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;
+
+/**
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
+ * @since Mar 19, 2012
+ */
+public abstract class AbstractModelElementTable<T> {
+
+ private static final int PAGE_SIZE = 5;
+ private DefaultCellTable<T> dataTable;
+ private ListDataProvider<T> dataProvider;
+
+ Widget asWidget() {
+ VerticalPanel layout = new VerticalPanel();
+ layout.setStyleName("fill-layout-width");
+
+ layout.add(getCellTable());
+
+ DefaultPager pager = new DefaultPager();
+
+ pager.setDisplay(getCellTable());
+
+ layout.add(pager);
+
+ return layout;
+ }
+
+ /**
+ * Returns a instance of {@link DefaultCellTable} used to list federation instances.
+ *
+ * @return
+ */
+ public DefaultCellTable<T> getCellTable() {
+ if (this.dataTable == null) {
+ this.dataTable = new DefaultCellTable<T>(
+ PAGE_SIZE,
+ new ProvidesKey<T>() {
+ @Override
+ public Object getKey(T item) {
+ return doGetKey(item);
+ }
+ });
+
+ doAddConlumns(this.dataTable);
+
+ }
+
+ return this.dataTable;
+ }
+
+ protected abstract Object doGetKey(T item);
+
+ /**
+ * @param federationTable2
+ */
+ protected abstract void doAddConlumns(DefaultCellTable<T> federationTable);
+
+ /**
+ * Returns a instance of {@link ListDataProvider} to be used to manipulate table
items.
+ *
+ * @return
+ */
+ public ListDataProvider<T> getDataProvider() {
+ if (this.dataProvider == null) {
+ this.dataProvider = new ListDataProvider<T>();
+ this.dataProvider.addDataDisplay(getCellTable());
+ }
+
+ return this.dataProvider;
+ }
+
+}
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/EditableFederationDetails.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/EditableFederationDetails.java
(rev 0)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/EditableFederationDetails.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -0,0 +1,119 @@
+/*
+ * 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.viewframework.builder.FormLayout;
+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.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
+ * @since Mar 14, 2012
+ */
+public class EditableFederationDetails {
+
+ private Form<Federation> form;
+ private FederationPresenter presenter;
+ private ToolButton disableBtn;
+
+ public EditableFederationDetails(FederationPresenter presenter) {
+ this.presenter = presenter;
+ form = new Form(Federation.class);
+ form.setNumColumns(2);
+ }
+
+ public Widget asWidget() {
+ VerticalPanel detailPanel = new VerticalPanel();
+ detailPanel.setStyleName("fill-layout-width");
+
+ final TextItem aliasItem = new TextItem("alias", "Alias");
+
+ form.setFields(aliasItem);
+
+ form.setEnabled(false);
+
+ Widget formWidget = form.asWidget();
+
+ FormToolStrip<Federation> toolStrip = new FormToolStrip<Federation>(
+ form,
+ new FormToolStrip.FormCallback<Federation>() {
+ @Override
+ public void onSave(Map<String, Object> changeset) {
+ }
+
+ @Override
+ public void onDelete(Federation entity) {
+
+ }
+ });
+
+
+
+ toolStrip.providesDeleteOp(false);
+
+ detailPanel.add(toolStrip.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(formWidget);
+
+ FormLayout layout = new
FormLayout().setHelp(helpPanel).setForm(form).setSetTools(toolStrip);
+
+ return layout.build();
+ }
+
+ public void bind(CellTable<Federation> dataSourceTable) {
+ form.bind(dataSourceTable);
+ }
+
+ public void setEnabled(boolean b) {
+ form.setEnabled(b);
+ }
+
+ public Federation getCurrentSelection() {
+ return form.getEditedEntity();
+ }
+
+}
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationDetails.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -22,12 +22,9 @@
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.as.console.client.shared.viewframework.builder.FormLayout;
import org.jboss.ballroom.client.widgets.forms.Form;
import org.jboss.ballroom.client.widgets.forms.TextItem;
import org.jboss.ballroom.client.widgets.tools.ToolButton;
@@ -35,15 +32,16 @@
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.
+ * <p>
+ * This class defines the widget to be displayed to show the general informations about a
selected federation instance.
+ * </p>
*
- * @author Pedro Silva
- * @sice Mar 14, 2012
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
+ * @since Mar 14, 2012
*/
public class FederationDetails {
@@ -53,72 +51,35 @@
public FederationDetails(FederationPresenter presenter) {
this.presenter = presenter;
- form = new Form(DataSource.class);
+ form = new Form(Federation.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);
-
+
+ form.setEnabled(false);
+
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);
- 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;
+ return new FormLayout().setHelp(helpPanel).setForm(form).build();
}
public void bind(CellTable<Federation> dataSourceTable) {
@@ -132,5 +93,5 @@
public Federation getCurrentSelection() {
return form.getEditedEntity();
}
-
+
}
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationEditor.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -23,19 +23,21 @@
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.shared.subsys.jca.DataSourcePresenter;
+import org.jboss.as.console.client.shared.subsys.jca.wizard.NewDatasourceWizard;
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.DefaultWindow;
import org.jboss.ballroom.client.widgets.window.Feedback;
+import org.picketlink.as.console.client.BeanFactory;
import org.picketlink.as.console.client.shared.subsys.model.Federation;
+import org.picketlink.as.console.client.shared.subsys.model.IdentityProvider;
+import org.picketlink.as.console.client.shared.subsys.model.ServiceProvider;
import com.google.gwt.dom.client.Style;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -50,144 +52,282 @@
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>
+ * <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
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
+ * @since Mar 14, 2012
*/
public class FederationEditor {
+ /**
+ *
+ */
+ private static final String EDITOR_DESCRIPTION = "The PicketLink Federation
provides the configurations for IDPs and SPs given a federation configuration.";
+
+ private static final String EDITOR_LABEL_TEXT = "Federation";
+
private FederationPresenter presenter;
private FederationTable federationTable;
- private FederationDetails details;
+ private FederationDetails federationDetails;
- public FederationEditor(FederationPresenter presenter) {
+ private IdentityProviderDetails identityProviderDetails;
+
+ private ServiceProviderDetails serviceProviderDetails;
+
+ private DefaultWindow window;
+
+ private BeanFactory beanFactory;
+
+ public FederationEditor(FederationPresenter presenter, BeanFactory beanFactory) {
this.presenter = presenter;
+ this.beanFactory = beanFactory;
}
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(EDITOR_LABEL_TEXT));
+ vpanel.add(new ContentDescription(EDITOR_DESCRIPTION));
- vpanel.add(new ContentHeaderLabel("Federation"));
- vpanel.add(new ContentDescription("The PicketLink Federation provides the
configurations for IDPs and SPs given a federation configuration."));
+ addTableWidgets(vpanel);
+ addSelectionWidgets(vpanel);
- federationTable = new FederationTable();
+ return layout;
+ }
+ /**
+ * <p>
+ * Adds the widgets to be displayed when a item is selected from the table.
+ * </p>
+ *
+ * @param vpanel
+ * @return
+ */
+ private void addSelectionWidgets(VerticalPanel vpanel) {
+ vpanel.add(new ContentGroupLabel(Console.CONSTANTS.common_label_selection()));
+
+ TabPanel bottomPanel = new TabPanel();
- vpanel.add(new
ContentGroupLabel(Console.MESSAGES.available("Federations")));
- vpanel.add(topLevelTools.asWidget());
- vpanel.add(federationTable.asWidget());
+ bottomPanel.setStyleName("default-tabpanel");
+ bottomPanel.add(getFederationDetails().asWidget(), "General");
+ bottomPanel.add(getIdentityProvidersDetails().asWidget(), "Identity
Provider");
+ bottomPanel.add(getServiceProviderDetails().asWidget(), "Service
Providers");
+ bottomPanel.add(new SimplePanel(), "Digital Certificates");
+ bottomPanel.selectTab(0);
+
+ addSelectionChangeHandler();
- // -----------
- details = new FederationDetails(presenter);
- details.bind(federationTable.getCellTable());
+ vpanel.add(bottomPanel);
+ }
- SingleSelectionModel<Federation> selectionModel =
-
(SingleSelectionModel<Federation>)federationTable.getCellTable().getSelectionModel();
+ /**
+ * @return
+ */
+ private ServiceProviderDetails getServiceProviderDetails() {
+ if (this.serviceProviderDetails == null) {
+ this.serviceProviderDetails = new ServiceProviderDetails();
+ }
- selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler () {
+ return this.serviceProviderDetails;
+ }
+
+ /**
+ * <p>
+ * Adds a {@link SelectionChangeEvent.Handler} to handle selection from the table.
+ * This method must be called after the
<code>addSelectionWidgets</code>.
+ * </p>
+ */
+ private void addSelectionChangeHandler() {
+ SingleSelectionModel<Federation> selectionModel =
(SingleSelectionModel<Federation>) this.getFederationTable()
+ .getCellTable().getSelectionModel();
+
+ selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
- Federation selectedObject = ((SingleSelectionModel<Federation>)
federationTable.getCellTable().getSelectionModel()).getSelectedObject();
- details.setEnabled(true);
+ getFederationDetails().setEnabled(false);
+ presenter.loadIdentityProvider(((SingleSelectionModel<Federation>)
event.getSource()).getSelectedObject());
+ presenter.loadServiceProviders(((SingleSelectionModel<Federation>)
event.getSource()).getSelectedObject());
}
});
+ }
- // -----------------
+ /**
+ * Adds the widgtes related with the table from which items can be selected, addes or
removed.
+ *
+ * @param vpanel
+ */
+ private void addTableWidgets(VerticalPanel vpanel) {
+ vpanel.add(new
ContentGroupLabel(Console.MESSAGES.available("Federations")));
+ vpanel.add(createTopLevelActions().asWidget());
+ vpanel.add(this.getFederationTable().asWidget());
+ }
- TabPanel bottomPanel = new TabPanel();
- bottomPanel.setStyleName("default-tabpanel");
+ /**
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ private FederationDetails getFederationDetails() {
+ if (this.federationDetails == null) {
+ this.federationDetails = new FederationDetails(this.presenter);
+ this.federationDetails.bind(getFederationTable().getCellTable());
+ }
- bottomPanel.add(details.asWidget(), "Attributes");
+ return this.federationDetails;
+ }
- // -----------------
+ /**
+ * @return
+ */
+ private IdentityProviderDetails getIdentityProvidersDetails() {
+ if (this.identityProviderDetails == null) {
+ this.identityProviderDetails = new IdentityProviderDetails(this.presenter);
+ }
- bottomPanel.add(new SimplePanel(), "Identity Provider");
- bottomPanel.add(new SimplePanel(), "Service Providers");
- bottomPanel.add(new SimplePanel(), "Digital Certificates");
+ return this.identityProviderDetails;
+ }
+
+ /**
+ * @return
+ */
+ private ToolStrip createTopLevelActions() {
+ ToolStrip topLevelTools = new ToolStrip();
+
+ topLevelTools.addToolButtonRight(createAddFederationButton());
+ topLevelTools.addToolButtonRight(createDeleteFederationButton());
- bottomPanel.selectTab(0);
+ return topLevelTools;
+ }
- // -----------------
+ /**
+ * <p>
+ * Creates a instance of {@link ToolButton} to add federation instances from the
table.
+ * </p>
+ *
+ * @return
+ */
+ private ToolButton createAddFederationButton() {
+ return new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() {
- vpanel.add(new ContentGroupLabel(Console.CONSTANTS.common_label_selection()));
+ @Override
+ public void onClick(ClickEvent event) {
+ lunchNewFederationWizard();
+ }
+ });
+ }
- vpanel.add(bottomPanel);
+ private void lunchNewFederationWizard() {
+ window = new
DefaultWindow(Console.MESSAGES.createTitle("Federation"));
+ window.setWidth(480);
+ window.setHeight(450);
- return layout;
+ window.setWidget(
+ new NewFederationWizard(this.presenter, this).asWidget()
+ );
+
+ window.setGlassEnabled(true);
+ window.center();
}
+ /**
+ * <p>
+ * Creates a instance of {@link ToolButton} to delete federation instances from the
table.
+ * </p>
+ *
+ * @return
+ */
+ private ToolButton createDeleteFederationButton() {
+ ClickHandler clickHandler = new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
- private Federation getCurrentSelection() {
- Federation ds = ((SingleSelectionModel<Federation>)
federationTable.getCellTable().getSelectionModel()).getSelectedObject();
- return ds;
+ final Federation currentSelection =
getFederationDetails().getCurrentSelection();
+
+ if (currentSelection != null) {
+ Feedback.confirm(Console.MESSAGES.deleteTitle(EDITOR_LABEL_TEXT),
+ 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);
+
+ return deleteBtn;
}
- public void updateDataSources(List<Federation> datasources) {
+ /**
+ * Updates the table wich the federation instances are listed.
+ *
+ * @param datasources
+ */
+ public void updateFederations(List<Federation> datasources) {
+ getFederationTable().getDataProvider().setList(datasources);
+ getFederationTable().getCellTable().selectDefaultEntity();
+ }
- federationTable.getDataProvider().setList(datasources);
+ /**
+ * Returns a instance of the table to be used to show the federation instances.
+ *
+ * @return
+ */
+ private FederationTable getFederationTable() {
+ if (this.federationTable == null) {
+ this.federationTable = new FederationTable();
+ }
- final DefaultCellTable<Federation> cellTable =
federationTable.getCellTable();
- cellTable.selectDefaultEntity();
+ return this.federationTable;
}
- public void setEnabled(boolean isEnabled) {
+ /**
+ * @param identityProviders
+ */
+ public void updateIdentityProviders(List<IdentityProvider> identityProviders)
{
+ this.getIdentityProvidersDetails().updateIdentityProvider(identityProviders);
+ }
+ /**
+ * @param result
+ */
+ public void updateServiceProviders(List<ServiceProvider> result) {
+ this.getServiceProviderDetails().updateServiceProviders(result);
+ }
+ /**
+ *
+ */
+ public void closeDialogue() {
+ window.hide();
}
- public void enableDetails(boolean b) {
- details.setEnabled(b);
+ /**
+ * @return the beanFactory
+ */
+ public BeanFactory getBeanFactory() {
+ return this.beanFactory;
}
-
}
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationPresenter.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -22,7 +22,6 @@
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;
@@ -31,6 +30,8 @@
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 org.picketlink.as.console.client.shared.subsys.model.IdentityProvider;
+import org.picketlink.as.console.client.shared.subsys.model.ServiceProvider;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.event.shared.EventBus;
@@ -44,15 +45,37 @@
import com.gwtplatform.mvp.client.proxy.Proxy;
/**
- * @author Pedro Silva
+ * <p>
+ * The presenter for the PicketLink -> Federation menu item.
+ * </p>
+ *
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
* @since 03/01/2011
*/
public class FederationPresenter extends Presenter<FederationPresenter.MyView,
FederationPresenter.MyProxy> {
public interface MyView extends View {
void setPresenter(FederationPresenter presenter);
+
+ /**
+ * <p>
+ * Updates the view with federations instances configured in the subsystem.
+ * </p>
+ * @param federations
+ */
+ void updateFederations(List<Federation> federations);
- void updateFederations(List<Federation> federations);
+ /**
+ * Updates the view with the informations about a identity provider.
+ *
+ * @param result
+ */
+ void updateIdentityProviders(List<IdentityProvider> result);
+
+ /**
+ * @param result
+ */
+ void updateServiceProviders(List<ServiceProvider> result);
}
@ProxyCodeSplit
@@ -60,22 +83,22 @@
public interface MyProxy extends Proxy<FederationPresenter>, Place {
}
- private final PlaceManager placeManager;
private final RevealStrategy revealStrategy;
- private final BeanFactory beanFactory;
private FederationStore federationStore;
+ private BeanFactory beanFactory;
@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.federationStore = federationStore;
this.beanFactory = beanFactory;
- this.federationStore = federationStore;
}
+ /* (non-Javadoc)
+ * @see com.gwtplatform.mvp.client.PresenterWidget#onReveal()
+ */
@Override
protected void onReveal() {
super.onReveal();
@@ -87,19 +110,38 @@
});
}
+ /* (non-Javadoc)
+ * @see com.gwtplatform.mvp.client.Presenter#revealInParent()
+ */
@Override
protected void revealInParent() {
this.revealStrategy.revealInParent(this);
}
+ /* (non-Javadoc)
+ * @see com.gwtplatform.mvp.client.HandlerContainerImpl#onBind()
+ */
@Override
protected void onBind() {
super.onBind();
+ getView().setPresenter(this);
}
+ /* (non-Javadoc)
+ * @see com.gwtplatform.mvp.client.PresenterWidget#onReset()
+ */
@Override
protected void onReset() {
super.onReset();
+ loadFederations();
+ }
+
+ /**
+ * <p>
+ * Loads the federation instances from the subsystem.
+ * </p>
+ */
+ private void loadFederations() {
this.federationStore.loadFederations(new
SimpleCallback<List<Federation>>() {
@Override
public void onSuccess(List<Federation> result) {
@@ -107,15 +149,34 @@
}
});
}
-
+
/**
- * @param alias
- * @param changedValues
+ * <p>
+ * Loads the federation instances from the subsystem.
+ * </p>
*/
- public void onSaveFederationDetails(String alias, Map<String, Object>
changedValues) {
- // TODO: on save federation details
+ public void loadIdentityProvider(Federation federation) {
+ this.federationStore.loadIdentityProviders(federation, new
SimpleCallback<List<IdentityProvider>>() {
+ @Override
+ public void onSuccess(List<IdentityProvider> result) {
+ getView().updateIdentityProviders(result);
+ }
+ });
}
+
+ /**
+ * @param federation
+ */
+ public void loadServiceProviders(Federation federation) {
+ this.federationStore.loadServiceProviders(federation, new
SimpleCallback<List<ServiceProvider>>() {
+ @Override
+ public void onSuccess(List<ServiceProvider> result) {
+ getView().updateServiceProviders(result);
+ }
+ });
+ }
+
/**
* @param currentSelection
*/
@@ -123,4 +184,18 @@
// TODO: on delete federation
}
+ /**
+ * @param updatedEntity
+ */
+ public void onCreateFederation(Federation updatedEntity) {
+
+ }
+
+ /**
+ * @return
+ */
+ public BeanFactory getBeanFactory() {
+ return this.beanFactory;
+ }
+
}
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationTable.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -23,43 +23,30 @@
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 {
+ * @since Mar 14, 2012
+ */public class FederationTable extends AbstractModelElementTable<Federation> {
- private static final int PAGE_SIZE = 5;
- private DefaultCellTable<Federation> federationTable;
- private ListDataProvider<Federation> dataProvider;
+ /* (non-Javadoc)
+ * @see
org.picketlink.as.console.client.ui.federation.AbstractModelElementTable#doGetKey(java.lang.Object)
+ */
+ @Override
+ protected Object doGetKey(Federation item) {
+ return item.getAlias();
+ }
- 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);
-
+ /* (non-Javadoc)
+ * @see
org.picketlink.as.console.client.ui.federation.AbstractModelElementTable#doAddConlumns(org.jboss.ballroom.client.widgets.tables.DefaultCellTable)
+ */
+ @Override
+ protected void doAddConlumns(DefaultCellTable<Federation> federationTable) {
TextColumn<Federation> aliasColumn = new TextColumn<Federation>() {
@Override
public String getValue(Federation record) {
@@ -67,25 +54,6 @@
}
};
- 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;
+ federationTable.addColumn(aliasColumn, "Name");
}
-
- public DefaultCellTable<Federation> getCellTable() {
- return federationTable;
- }
-
- public ListDataProvider<Federation> getDataProvider() {
- return dataProvider;
- }
}
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/FederationView.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -24,47 +24,73 @@
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 org.picketlink.as.console.client.shared.subsys.model.IdentityProvider;
+import org.picketlink.as.console.client.shared.subsys.model.ServiceProvider;
import com.google.gwt.dom.client.Style;
import com.google.gwt.user.client.ui.Widget;
/**
- * @author pedroigor
- * @sice Mar 14, 2012
+ * <p>
+ * The view for the PicketLink -> Federation menu item.
+ * </p>
+ *
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
+ * @since Mar 14, 2012
*/
public class FederationView extends SuspendableViewImpl implements
FederationPresenter.MyView {
private FederationPresenter presenter;
private FederationEditor federationEditor;
+ /* (non-Javadoc)
+ * @see org.jboss.as.console.client.core.SuspendableView#createWidget()
+ */
@Override
public Widget createWidget() {
-
- this.federationEditor = new FederationEditor(presenter);
-
+ this.federationEditor = new FederationEditor(presenter,
this.presenter.getBeanFactory());
DefaultTabLayoutPanel tabLayoutpanel = new DefaultTabLayoutPanel(40,
Style.Unit.PX);
+
tabLayoutpanel.addStyleName("default-tabpanel");
-
-
tabLayoutpanel.add(federationEditor.asWidget(), "PicketLink
Federation", true);
-
tabLayoutpanel.selectTab(0);
return tabLayoutpanel;
}
+ /* (non-Javadoc)
+ * @see
org.picketlink.as.console.client.ui.federation.FederationPresenter.MyView#updateFederations(java.util.List)
+ */
@Override
- public void setPresenter(FederationPresenter presenter) {
- this.presenter = presenter;
+ public void updateFederations(List<Federation> federations) {
+ this.federationEditor.updateFederations(federations);
}
+ /* (non-Javadoc)
+ * @see
org.picketlink.as.console.client.ui.federation.FederationPresenter.MyView#updateFederations(java.util.List)
+ */
@Override
- public void updateFederations(List<Federation> federations) {
- federationEditor.updateDataSources(federations);
+ public void updateIdentityProviders(List<IdentityProvider> federations) {
+ this.federationEditor.updateIdentityProviders(federations);
}
+
+ /* (non-Javadoc)
+ * @see
org.picketlink.as.console.client.ui.federation.FederationPresenter.MyView#updateServiceProviders(java.util.List)
+ */
+ @Override
+ public void updateServiceProviders(List<ServiceProvider> result) {
+ this.federationEditor.updateServiceProviders(result);
+ }
+ /* (non-Javadoc)
+ * @see
org.picketlink.as.console.client.ui.federation.FederationPresenter.MyView#setPresenter(org.picketlink.as.console.client.ui.federation.FederationPresenter)
+ */
+ @Override
+ public void setPresenter(FederationPresenter presenter) {
+ this.presenter = presenter;
+ }
+
}
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/IdentityProviderDetails.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/IdentityProviderDetails.java
(rev 0)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/IdentityProviderDetails.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -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 java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.as.console.client.shared.subsys.Baseadress;
+import org.jboss.ballroom.client.widgets.forms.FormItem;
+import org.jboss.ballroom.client.widgets.forms.TextItem;
+import org.jboss.dmr.client.ModelNode;
+import org.picketlink.as.console.client.shared.subsys.model.IdentityProvider;
+
+/**
+ * <p>
+ * This class defines the widget to that renders a read-only form for the informations
about a Identity Provider.
+ * </p>
+ *
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
+ * @since Mar 14, 2012
+ */
+public class IdentityProviderDetails extends
AbstractFederationDetails<IdentityProvider> {
+
+ public IdentityProviderDetails(FederationPresenter presenter) {
+ super();
+ }
+
+ protected List<FormItem<?>> getFormItems() {
+ List<FormItem<?>> items = new ArrayList<FormItem<?>>();
+
+ items.add(new TextItem("alias", "Alias"));
+ items.add(new TextItem("url", "Identity URL"));
+ items.add(new TextItem("signOutgoingMessages", "Sign Outgoing
Messages"));
+ items.add(new TextItem("ignoreIncomingSignatures", "Ignore
Incoming Signatures"));
+
+ return items;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.picketlink.as.console.client.ui.federation.AbstractFederationDetails#getHelpModelAddress()
+ */
+ @Override
+ protected ModelNode getHelpModelAddress() {
+ ModelNode address = Baseadress.get();
+
+ address.add("subsystem", "picketlink");
+ address.add("federation", "*");
+ address.add("identity-provider", "*");
+
+ return address;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.picketlink.as.console.client.ui.federation.AbstractFederationDetails#getEntityClass()
+ */
+ @Override
+ protected Class<?> getEntityClass() {
+ return IdentityProvider.class;
+ }
+
+ /**
+ * @param identityProviders
+ */
+ public void updateIdentityProvider(List<IdentityProvider> identityProviders) {
+ setEntityInstance(identityProviders.get(0));
+ getForm().edit(identityProviders.get(0));
+ }
+
+}
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/NewFederationWizard.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/NewFederationWizard.java
(rev 0)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/NewFederationWizard.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -0,0 +1,86 @@
+/*
+ * 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.picketlink.as.console.client.shared.subsys.model.Federation;
+
+import com.google.gwt.user.client.ui.DeckPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
+ * @since Mar 19, 2012
+ */
+public class NewFederationWizard {
+
+ private FederationPresenter presenter;
+
+ private DeckPanel deck;
+
+
+ private Federation baseAttributes = null;
+
+ private FederationEditor editor;
+
+ public NewFederationWizard(
+ FederationPresenter presenter, FederationEditor editor) {
+ this.presenter = presenter;
+ this.editor = editor;
+ }
+
+ public Widget asWidget() {
+ deck = new DeckPanel();
+
+ deck.add(new NewFederationWizardStep1(this,
this.editor.getBeanFactory()).asWidget());
+
+ deck.showWidget(0);
+
+ return deck;
+ }
+
+ public FederationPresenter getPresenter() {
+ return presenter;
+ }
+
+ public void onFinish(Federation updatedEntity) {
+
+ // merge previous attributes into single entity
+ updatedEntity.setAlias(baseAttributes.getAlias());
+
+ presenter.onCreateFederation(updatedEntity);
+ }
+
+ /**
+ * @param updatedEntity
+ */
+ public void onConfigureBaseAttributes(Federation updatedEntity) {
+ this.presenter.onCreateFederation(updatedEntity);
+ }
+
+ /**
+ * @return the editor
+ */
+ public FederationEditor getEditor() {
+ return this.editor;
+ }
+}
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/NewFederationWizardStep1.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/NewFederationWizardStep1.java
(rev 0)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/NewFederationWizardStep1.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -0,0 +1,124 @@
+/*
+ * 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.as.console.client.Console;
+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.shared.subsys.jca.wizard.NewDatasourceWizard;
+import org.jboss.as.console.client.widgets.forms.items.JndiNameItem;
+import org.jboss.ballroom.client.widgets.forms.Form;
+import org.jboss.ballroom.client.widgets.forms.FormValidation;
+import org.jboss.ballroom.client.widgets.forms.TextBoxItem;
+import org.jboss.ballroom.client.widgets.window.DialogueOptions;
+import org.jboss.ballroom.client.widgets.window.WindowContentBuilder;
+import org.jboss.dmr.client.ModelNode;
+import org.picketlink.as.console.client.BeanFactory;
+import org.picketlink.as.console.client.shared.subsys.model.Federation;
+
+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;
+
+/**
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
+ * @since Mar 19, 2012
+ */
+public class NewFederationWizardStep1 {
+
+ NewFederationWizard wizard;
+ private BeanFactory beanFactory;
+
+ public NewFederationWizardStep1(NewFederationWizard wizard) {
+ this.wizard = wizard;
+ }
+
+ /**
+ * @param newFederationWizard
+ * @param beanFactory
+ */
+ public NewFederationWizardStep1(NewFederationWizard newFederationWizard, BeanFactory
beanFactory) {
+ this.beanFactory = beanFactory;
+ }
+
+ Widget asWidget() {
+
+ VerticalPanel layout = new VerticalPanel();
+ layout.setStyleName("window-content");
+
+ layout.add(new HTML("<h3>New Federation</h3>"));
+
+ final Form<Federation> form = new
Form<Federation>(Federation.class);
+
+ final TextBoxItem name = new TextBoxItem("alias", "Alias");
+
+ form.setFields(name);
+
+ form.edit(this.beanFactory.federation().as());
+
+ 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
+ );
+
+ layout.add(helpPanel.asWidget());
+
+ layout.add(form.asWidget());
+
+ ClickHandler submitHandler = new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ FormValidation validation = form.validate();
+ if(!validation.hasErrors())
+ {
+ wizard.onConfigureBaseAttributes(form.getUpdatedEntity());
+ }
+ }
+ };
+
+ ClickHandler cancelHandler = new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ wizard.getEditor().closeDialogue();
+ }
+ };
+
+ DialogueOptions options = new DialogueOptions(
+ Console.CONSTANTS.common_label_save(),submitHandler,
+ Console.CONSTANTS.common_label_cancel(),cancelHandler
+ );
+
+ return new WindowContentBuilder(layout, options).build();
+ }
+
+}
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/ServiceProviderDetails.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/ServiceProviderDetails.java
(rev 0)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/ServiceProviderDetails.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -0,0 +1,82 @@
+/*
+ * 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.widgets.ContentDescription;
+import org.picketlink.as.console.client.shared.subsys.model.ServiceProvider;
+
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * <p>
+ * This class defines the widget to be displayed to show the general informations about a
selected federation instance.
+ * </p>
+ *
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
+ * @since Mar 14, 2012
+ */
+public class ServiceProviderDetails {
+
+ private ServiceProviderTable serviceProviderTable;
+
+ public Widget asWidget() {
+ VerticalPanel layout = new VerticalPanel();
+
+ layout.setStyleName("rhs-content-panel");
+
+ HorizontalPanel horizontalPanel = new HorizontalPanel();
+
+ horizontalPanel.setHeight("10px");
+
+ layout.add(horizontalPanel);
+ layout.add(new ContentDescription("Avaiable Service Providers"));
+ layout.add(getFederationTable().asWidget());
+
+ return layout;
+ }
+
+ /**
+ * Returns a instance of the table to be used to show the service provider
instances.
+ *
+ * @return
+ */
+ private ServiceProviderTable getFederationTable() {
+ if (this.serviceProviderTable == null) {
+ this.serviceProviderTable = new ServiceProviderTable();
+ }
+
+ return this.serviceProviderTable;
+ }
+
+ /**
+ * @param result
+ */
+ public void updateServiceProviders(List<ServiceProvider> result) {
+ this.getFederationTable().getDataProvider().setList(result);
+ }
+
+}
Added:
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/ServiceProviderTable.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/ServiceProviderTable.java
(rev 0)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/client/ui/federation/ServiceProviderTable.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -0,0 +1,65 @@
+/*
+ * 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.picketlink.as.console.client.shared.subsys.model.ServiceProvider;
+
+import com.google.gwt.user.cellview.client.TextColumn;
+
+/**
+ * @author <a href="mailto:psilva@redhat.com">Pedro Silva</a>
+ * @since Mar 19, 2012
+ */
+public class ServiceProviderTable extends
AbstractModelElementTable<ServiceProvider> {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.picketlink.as.console.client.ui.federation.AbstractModelElementTable#doGetKey(java.lang.Object)
+ */
+ @Override
+ protected Object doGetKey(ServiceProvider item) {
+ return item.getAlias();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ *
org.picketlink.as.console.client.ui.federation.AbstractModelElementTable#doAddConlumns(org.jboss.ballroom.client.widgets
+ * .tables.DefaultCellTable)
+ */
+ @Override
+ protected void doAddConlumns(DefaultCellTable<ServiceProvider> federationTable)
{
+ TextColumn<ServiceProvider> aliasColumn = new
TextColumn<ServiceProvider>() {
+ @Override
+ public String getValue(ServiceProvider record) {
+ return record.getAlias();
+ }
+ };
+
+ federationTable.addColumn(aliasColumn, "Name");
+ }
+
+}
Modified:
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 2012-03-19
20:47:37 UTC (rev 1532)
+++
console/trunk/gui/src/main/java/org/picketlink/as/console/rebind/extension/PicketLinkApplicationMetaDataGenerator.java 2012-03-19
23:53:07 UTC (rev 1533)
@@ -29,7 +29,7 @@
* <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
+ * @since Mar 14, 2012
*/
public class PicketLinkApplicationMetaDataGenerator extends
ApplicationMetaDataGeneratorExtension {