integrated widget for invitations
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/admin/register-vre-users@115808 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
77d55968d5
commit
fda442704c
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/register-vre-users-1.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/register-vre-users-1.2.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
|
@ -31,5 +31,5 @@
|
|||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/register-vre-users-1.1.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/register-vre-users-1.2.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
eclipse.preferences.version=1
|
||||
validateFragments=false
|
||||
validation.use-project-settings=true
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="${module}">
|
||||
<wb-module deploy-name="register-vre-users-portlet">
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
|
|
|
@ -4,4 +4,5 @@
|
|||
<installed facet="jst.web" version="2.3"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
<installed facet="java" version="1.7"/>
|
||||
<installed facet="liferay.portlet" version="6.0"/>
|
||||
</faceted-project>
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets.admin.manageusers.client.ManageVreUsers.1-0-0"
|
||||
date="2014-06-03">
|
||||
<Change>Adapted to the new maven protal bom</Change>
|
||||
<Changeset component="org.gcube.portlets-admin.register-vre-users.1-2-0"
|
||||
date="2015-07-01">
|
||||
<Change>Added invite user functionality</Change>
|
||||
<Change>Ported to GWT 2.7.0</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets.admin.manageusers.client.ManageVreUsers.1-0-0"
|
||||
<Changeset component="org.gcube.portlets-admin.register-vre-users.1-1-0"
|
||||
date="2014-06-03">
|
||||
<Change>Adapted to the new maven portal bom</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-admin.register-vre-users.1-0-0"
|
||||
date="2014-04-02">
|
||||
<Change>First Release</Change>
|
||||
</Changeset>
|
||||
|
|
52
pom.xml
52
pom.xml
|
@ -12,8 +12,8 @@
|
|||
<groupId>org.gcube.portlets.admin</groupId>
|
||||
<artifactId>register-vre-users</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
<name>Register VRE Users Portlet</name>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<name>Register VRE Users</name>
|
||||
<description>
|
||||
Rigister VRE Users Portlet allow to select a user from the portal and add her to the VRE.
|
||||
</description>
|
||||
|
@ -24,9 +24,8 @@
|
|||
</scm>
|
||||
<properties>
|
||||
<!-- Convenience property to set the GWT version -->
|
||||
<gwtVersion>2.5.1</gwtVersion>
|
||||
<gwtVersion>2.7.0</gwtVersion>
|
||||
<distroDirectory>distro</distroDirectory>
|
||||
<!-- GWT needs at least java 1.6 -->
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||
|
@ -46,18 +45,17 @@
|
|||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- This dependency is needed to use GWT UI BInder without old Xerces
|
||||
version of gCore complaining -->
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.9.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-user</artifactId>
|
||||
<scope>provided</scope>
|
||||
<version>${gwtVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-servlet</artifactId>
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||
|
@ -88,6 +86,31 @@
|
|||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>home-library</artifactId>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>asm-all</artifactId>
|
||||
<groupId>asm</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>invite-friends-widget</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>invites-common-library</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>social-networking-library</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google</groupId>
|
||||
<artifactId>gwt-jsonmaker</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.core</groupId>
|
||||
|
@ -96,8 +119,9 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sencha.gxt</groupId>
|
||||
<artifactId>gxt</artifactId>
|
||||
<version>2.2.5</version>
|
||||
<artifactId>gxt2.2.5-gwt2.X</artifactId>
|
||||
<version>2.7.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.dvos</groupId>
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import org.gcube.portlets.admin.manageusers.client.ManageUsersServiceAsync;
|
||||
import org.gcube.portlets.admin.manageusers.client.view.Display;
|
||||
import org.gcube.portlets.admin.manageusers.shared.PortalUserDTO;
|
||||
import org.gcube.portlets.widgets.inviteswidget.client.ui.InviteWidget;
|
||||
|
||||
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
||||
import com.extjs.gxt.ui.client.event.ComponentEvent;
|
||||
|
@ -14,12 +15,14 @@ import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
|||
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
||||
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
||||
import com.extjs.gxt.ui.client.event.SelectionListener;
|
||||
import com.extjs.gxt.ui.client.widget.Info;
|
||||
import com.extjs.gxt.ui.client.widget.MessageBox;
|
||||
import com.extjs.gxt.ui.client.widget.Window;
|
||||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
import com.google.gwt.user.client.ui.SimplePanel;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
/**
|
||||
*
|
||||
* @author Massimiliano Assante (assante@isti.cnr.it)
|
||||
|
@ -44,8 +47,6 @@ public class VREDeploymentPresenter implements Presenter {
|
|||
@SuppressWarnings("rawtypes")
|
||||
public void bind() {
|
||||
///*** BUTTONS & Menu
|
||||
|
||||
|
||||
SelectionListener approvesl = new SelectionListener<ComponentEvent>() {
|
||||
public void componentSelected(ComponentEvent ce) {
|
||||
List<PortalUserDTO> selectedUsers = display.getGridSelectionModel().getSelectedItems();
|
||||
|
@ -54,9 +55,17 @@ public class VREDeploymentPresenter implements Presenter {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
///*** BUTTONS & Menu
|
||||
SelectionListener inviteButtonListener = new SelectionListener<ComponentEvent>() {
|
||||
public void componentSelected(ComponentEvent ce) {
|
||||
doOpenInviteWidget();
|
||||
}
|
||||
};
|
||||
|
||||
display.getApproveButton().addSelectionListener(approvesl);
|
||||
display.getApproveMenu().addSelectionListener(approvesl);
|
||||
|
||||
display.getInviteButton().addSelectionListener(inviteButtonListener);
|
||||
|
||||
// REFRESH
|
||||
display.getRefreshButton().addSelectionListener( new SelectionListener<ButtonEvent>() {
|
||||
|
@ -75,6 +84,7 @@ public class VREDeploymentPresenter implements Presenter {
|
|||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* go method
|
||||
*/
|
||||
|
@ -99,18 +109,22 @@ public class VREDeploymentPresenter implements Presenter {
|
|||
@Override
|
||||
public void onFailure(Throwable arg0) {
|
||||
display.maskCenterPanel("", false);
|
||||
Window.alert("Failed to get users list from service " + arg0.getMessage());
|
||||
com.google.gwt.user.client.Window.alert("Failed to get users list from service " + arg0.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void doOpenInviteWidget() {
|
||||
display.displayInviteUsersPanel();
|
||||
}
|
||||
|
||||
private void doApprove(final List<PortalUserDTO> selectedUsers) {
|
||||
if (selectedUsers != null) {
|
||||
String users = "";
|
||||
for (int i = 0; i < selectedUsers.size(); i++) {
|
||||
PortalUserDTO user = selectedUsers.get(i);
|
||||
users += user.getLastName() + ", ";
|
||||
|
||||
|
||||
}
|
||||
MessageBox.confirm("Please Confirm", "You are about to register: " +users+ "?", new Listener<MessageBoxEvent>() {
|
||||
public void handleEvent(MessageBoxEvent ce) {
|
||||
|
@ -120,20 +134,20 @@ public class VREDeploymentPresenter implements Presenter {
|
|||
else
|
||||
display.maskCenterPanel("Registering selected users, please wait it may take a while ...", true);
|
||||
rpcService.registerUsers(selectedUsers, new AsyncCallback<Boolean>() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onSuccess(Boolean result) {
|
||||
MessageBox.info("Registering Operation", "User(s) were registrated successfully! ", null);
|
||||
fetchAvailableUsers();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Window.alert("Failed to register users: " + caught.getMessage());
|
||||
com.google.gwt.user.client.Window.alert("Failed to register users: " + caught.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,9 +18,12 @@ public interface Display {
|
|||
|
||||
void setGridContextMenu() ;
|
||||
Button getApproveButton();
|
||||
Button getInviteButton();
|
||||
Button getRefreshButton();
|
||||
|
||||
MenuItem getApproveMenu();
|
||||
|
||||
GridSelectionModel<PortalUserDTO> getGridSelectionModel();
|
||||
|
||||
void displayInviteUsersPanel();
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import org.gcube.portlets.admin.manageusers.client.ManageVreUsers;
|
||||
import org.gcube.portlets.admin.manageusers.shared.PortalUserDTO;
|
||||
import org.gcube.portlets.user.gcubewidgets.client.GCubePanel;
|
||||
import org.gcube.portlets.widgets.inviteswidget.client.ui.InviteWidget;
|
||||
|
||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
||||
import com.extjs.gxt.ui.client.Style.SelectionMode;
|
||||
|
@ -30,9 +31,12 @@ import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
|||
import com.extjs.gxt.ui.client.widget.menu.Menu;
|
||||
import com.extjs.gxt.ui.client.widget.menu.MenuItem;
|
||||
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HasAlignment;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
public class VREDeploymentView extends Composite implements Display {
|
||||
|
@ -47,6 +51,7 @@ public class VREDeploymentView extends Composite implements Display {
|
|||
|
||||
private Button approveButton;
|
||||
private Button refreshButton;
|
||||
private Button inviteButton;
|
||||
|
||||
private MenuItem approveMenu;
|
||||
private final CheckBoxSelectionModel<PortalUserDTO> sm = new CheckBoxSelectionModel<PortalUserDTO>();
|
||||
|
@ -103,7 +108,7 @@ public class VREDeploymentView extends Composite implements Display {
|
|||
};
|
||||
filterByLab.setEmptyText("Filter by Group");
|
||||
filterByLab.setWidth("250px");
|
||||
|
||||
|
||||
final ToggleButton expandButton = new ToggleButton("Expand/Collapse");
|
||||
expandButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||
@Override
|
||||
|
@ -164,9 +169,23 @@ public class VREDeploymentView extends Composite implements Display {
|
|||
refreshButton = new Button("Refresh");
|
||||
|
||||
approveButton.setEnabled(false);
|
||||
|
||||
inviteButton = new Button("Invite a user by email");
|
||||
|
||||
|
||||
|
||||
initWidget(mainPanel);
|
||||
updateSize();
|
||||
}
|
||||
@Override
|
||||
public void displayInviteUsersPanel() {
|
||||
VerticalPanel sp = new VerticalPanel();
|
||||
sp.getElement().getStyle().setMarginTop(15, Unit.PX);
|
||||
sp.setSpacing(10);
|
||||
sp.add(new InviteWidget());
|
||||
mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
|
||||
mainPanel.add(sp);
|
||||
}
|
||||
|
||||
/**
|
||||
* display the list of wfDocuments
|
||||
|
@ -186,7 +205,7 @@ public class VREDeploymentView extends Composite implements Display {
|
|||
gridPanel.setButtonAlign(HorizontalAlignment.CENTER);
|
||||
gridPanel.addButton(approveButton);
|
||||
gridPanel.addButton(refreshButton);
|
||||
|
||||
gridPanel.addButton(inviteButton);
|
||||
gridPanel.setBorders(false);
|
||||
tablePanel.add(gridPanel);
|
||||
tablePanel.setLayout(new FitLayout());
|
||||
|
@ -308,7 +327,8 @@ public class VREDeploymentView extends Composite implements Display {
|
|||
public Button getApproveButton() { return approveButton;
|
||||
}
|
||||
@Override
|
||||
public GridSelectionModel<PortalUserDTO> getGridSelectionModel() { return grid.getSelectionModel();
|
||||
public GridSelectionModel<PortalUserDTO> getGridSelectionModel() {
|
||||
return grid.getSelectionModel();
|
||||
}
|
||||
@Override
|
||||
public Button getRefreshButton() {return refreshButton;
|
||||
|
@ -316,4 +336,9 @@ public class VREDeploymentView extends Composite implements Display {
|
|||
@Override
|
||||
public MenuItem getApproveMenu() { return approveMenu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Button getInviteButton() {
|
||||
return inviteButton;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
<inherits name='com.extjs.gxt.ui.GXT' />
|
||||
<inherits name='com.extjs.gxt.themes.Themes' />
|
||||
<!-- Specify the app entry point class. -->
|
||||
|
||||
<inherits name='com.google.gwt.activity.Activity' />
|
||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||
<inherits name="org.gcube.portlets.widgets.inviteswidget.InvitesWidget"/>
|
||||
<!-- inherits GCUBE Widgets -->
|
||||
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||
|
||||
|
|
|
@ -4,18 +4,26 @@
|
|||
"http://java.sun.com/dtd/web-app_2_3.dtd">
|
||||
|
||||
<web-app>
|
||||
|
||||
|
||||
<!-- Servlets -->
|
||||
<servlet>
|
||||
<servlet-name>manageUsersServlet</servlet-name>
|
||||
<servlet-class>org.gcube.portlets.admin.manageusers.server.ManageUsersServiceImpl</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<!-- Servlets -->
|
||||
<servlet>
|
||||
<servlet-name>greetServlet</servlet-name>
|
||||
<servlet-class>org.gcube.portlets.widgets.inviteswidget.server.InviteServiceImpl</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>manageUsersServlet</servlet-name>
|
||||
<url-pattern>/managevreusers/manageUsersServlet</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>greetServlet</servlet-name>
|
||||
<url-pattern>/managevreusers/greet</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<!-- Default page to serve -->
|
||||
<welcome-file-list>
|
||||
<welcome-file>ManageVreUsers.html</welcome-file>
|
||||
|
|
Loading…
Reference in New Issue