diff --git a/.classpath b/.classpath index 8825513..9f69b60 100644 --- a/.classpath +++ b/.classpath @@ -39,6 +39,5 @@ - diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 160c7b8..29abf99 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -3,5 +3,4 @@ encoding//src/main/java=UTF-8 encoding//src/main/resources=UTF-8 encoding//src/test/java=UTF-8 encoding//src/test/resources=UTF-8 -encoding//target/generated-sources/gwt=UTF-8 encoding/=UTF-8 diff --git a/distro/INSTALL b/distro/INSTALL new file mode 100644 index 0000000..139597f --- /dev/null +++ b/distro/INSTALL @@ -0,0 +1,2 @@ + + diff --git a/distro/LICENSE b/distro/LICENSE new file mode 100644 index 0000000..cdb5851 --- /dev/null +++ b/distro/LICENSE @@ -0,0 +1,7 @@ +gCube System - License +------------------------------------------------------------ + +The gCube/gCore software is licensed as Free Open Source software conveying to the EUPL (http://ec.europa.eu/idabc/eupl). +The software and documentation is provided by its authors/distributors "as is" and no expressed or +implied warranty is given for its use, quality or fitness for a particular case. + diff --git a/distro/MAINTAINERS b/distro/MAINTAINERS new file mode 100644 index 0000000..680cebb --- /dev/null +++ b/distro/MAINTAINERS @@ -0,0 +1,6 @@ +Mantainers +------- + +* Massimiliano Assante (massimiliano.assante@isti.cnr.it), CNR Pisa, + Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo". + diff --git a/distro/README b/distro/README new file mode 100644 index 0000000..53c1a5c --- /dev/null +++ b/distro/README @@ -0,0 +1,35 @@ +The gCube System - Social Library +------------------------------------------------------------ + +This work is partially funded by the European Commission in the +context of the iMarine project (www.i-marine.eu), under the 1st call of FP7 IST priority. + +Authors +------- +Massimiliano Assante +* +Version and Release Date +------------------------ +Jan 2013 + + +Description +----------- +Social networking Library + +Download information +-------------------- +Source code is available from SVN: +https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user + +Binaries can be downloaded from: +http://software.d4science.research-infrastructures.eu/ + +Documentation +------------- +Documentation is available on-line from the Projects Documentation Wiki: + +Licensing +--------- + +This software is licensed under the terms you may find in the file named "LICENSE" in this directory. diff --git a/distro/changelog.xml b/distro/changelog.xml new file mode 100644 index 0000000..16b8f92 --- /dev/null +++ b/distro/changelog.xml @@ -0,0 +1,6 @@ + + + First Release + + diff --git a/distro/descriptor.xml b/distro/descriptor.xml new file mode 100644 index 0000000..4efc827 --- /dev/null +++ b/distro/descriptor.xml @@ -0,0 +1,48 @@ + + servicearchive + + tar.gz + + / + + + ${distroDirectory} + / + true + + README + LICENSE + INSTALL + MAINTAINERS + changelog.xml + + 755 + true + + + target/apidocs + /${artifactId}/doc/api + true + 755 + + + + + ${distroDirectory}/profile.xml + ./ + true + + + target/${build.finalName}.war + /${artifactId} + + + ${distroDirectory}/svnpath.txt + /${artifactId} + true + + + \ No newline at end of file diff --git a/distro/profile.xml b/distro/profile.xml new file mode 100644 index 0000000..f66180c --- /dev/null +++ b/distro/profile.xml @@ -0,0 +1,25 @@ + + + + Service + + ${Description} + PortletUser + ${artifactId} + ${version} + + + ${artifactId} + ${version} + + ${groupId} + ${artifactId} + ${version} + + + target/${build.finalName}.war + + + + + diff --git a/distro/svnpath.txt b/distro/svnpath.txt new file mode 100644 index 0000000..edacb04 --- /dev/null +++ b/distro/svnpath.txt @@ -0,0 +1 @@ +${scm.url} \ No newline at end of file diff --git a/pom.xml b/pom.xml index cc025d7..34723a2 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,11 @@ gwt-dev provided + + com.github.gwtbootstrap + gwt-bootstrap + 2.3.2.0 + junit junit @@ -184,7 +189,7 @@ compile - + generateAsync diff --git a/src/main/java/org/gcube/portlets/user/invitefriends/client/InviteFriendsPanel.java b/src/main/java/org/gcube/portlets/user/invitefriends/client/InviteFriendsPanel.java index a14be52..4c0e662 100644 --- a/src/main/java/org/gcube/portlets/user/invitefriends/client/InviteFriendsPanel.java +++ b/src/main/java/org/gcube/portlets/user/invitefriends/client/InviteFriendsPanel.java @@ -2,9 +2,15 @@ package org.gcube.portlets.user.invitefriends.client; import org.gcube.portlets.user.invitefriends.client.resources.Images; +import com.github.gwtbootstrap.client.ui.Button; +import com.github.gwtbootstrap.client.ui.Label; +import com.github.gwtbootstrap.client.ui.Modal; +import com.github.gwtbootstrap.client.ui.ModalFooter; +import com.github.gwtbootstrap.client.ui.TextBox; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HasAlignment; @@ -20,40 +26,56 @@ import com.google.gwt.user.client.ui.VerticalPanel; public class InviteFriendsPanel extends Composite { private final InviteServiceAsync service = GWT.create(InviteService.class); - public static final String DISPLAY_NAME = "Invite your friends"; + public static final String DISPLAY_NAME = "Invite people to this VRE"; private Image loadingImage; - private Image postToImage; - private VerticalPanel mainPanel = new VerticalPanel(); + + private VerticalPanel mainPanel; public InviteFriendsPanel() { super(); + + mainPanel = new VerticalPanel(); + mainPanel.setWidth("100%"); mainPanel.setStyleName("invites-frame"); - Images images = GWT.create(Images.class); - loadingImage = new Image(images.membersLoader().getSafeUri()); - postToImage = new Image(images.postToIcon().getSafeUri()); HTML name = new HTML(DISPLAY_NAME); - name.setStyleName("invites-title"); HorizontalPanel hp = new HorizontalPanel(); hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); hp.add(name); - postToImage.setStyleName("mail-image"); - hp.add(postToImage); + + TextBox text = new TextBox(); + text.setPlaceholder("e-mail address"); + + Button send = new Button("Send Invite"); + mainPanel.add(hp); + mainPanel.add(text); + mainPanel.add(send); initWidget(mainPanel); - postToImage.addClickHandler(new ClickHandler() { + send.addClickHandler(new ClickHandler() { @Override - public void onClick(ClickEvent event) { - + public void onClick(ClickEvent arg0) { + Modal mod = new Modal(); + + mod.add(new Label("Ciao")); + ModalFooter mf = new ModalFooter(); + Button asend = new Button("Send"); + mf.add(asend); + mod.setAnimation(true); + mod.show(); + + mod.add(mf); + } }); + } diff --git a/src/main/java/org/gcube/portlets/user/invitefriends/client/ui/Form.java b/src/main/java/org/gcube/portlets/user/invitefriends/client/ui/Form.java new file mode 100644 index 0000000..f1f20a8 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/invitefriends/client/ui/Form.java @@ -0,0 +1,46 @@ +package org.gcube.portlets.user.invitefriends.client.ui; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.uibinder.client.UiHandler; +import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.ui.Button; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.HasText; +import com.google.gwt.user.client.ui.Widget; + +public class Form extends Composite implements HasText { + + private static FormUiBinder uiBinder = GWT.create(FormUiBinder.class); + + interface FormUiBinder extends UiBinder { + } + + public Form() { + initWidget(uiBinder.createAndBindUi(this)); + } + + @UiField + Button button; + + public Form(String firstName) { + initWidget(uiBinder.createAndBindUi(this)); + button.setText(firstName); + } + + @UiHandler("button") + void onClick(ClickEvent e) { + Window.alert("Hello!"); + } + + public void setText(String text) { + button.setText(text); + } + + public String getText() { + return button.getText(); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/invitefriends/client/ui/Form.ui.xml b/src/main/java/org/gcube/portlets/user/invitefriends/client/ui/Form.ui.xml new file mode 100644 index 0000000..3fd6809 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/invitefriends/client/ui/Form.ui.xml @@ -0,0 +1,13 @@ + + + + .important { + font-weight: bold; + } + + + Hello, + + + \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/invitefriends/server/portlet/InviteFriendsPortlet.java b/src/main/java/org/gcube/portlets/user/invitefriends/server/portlet/InviteFriendsPortlet.java new file mode 100644 index 0000000..de3e4ae --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/invitefriends/server/portlet/InviteFriendsPortlet.java @@ -0,0 +1,30 @@ + +package org.gcube.portlets.user.invitefriends.server.portlet; + +import javax.portlet.GenericPortlet; +import javax.portlet.ActionRequest; +import javax.portlet.RenderRequest; +import javax.portlet.ActionResponse; +import javax.portlet.RenderResponse; +import javax.portlet.PortletException; +import java.io.IOException; +import javax.portlet.PortletRequestDispatcher; + +import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper; + +/** + * + * @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it + */ + public class InviteFriendsPortlet extends GenericPortlet { + public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { + response.setContentType("text/html"); + ScopeHelper.setContext(request); + PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/InviteFriends_view.jsp"); + dispatcher.include(request, response); + } + + public void processAction(ActionRequest request, ActionResponse response) + throws PortletException, IOException { + } +} diff --git a/src/main/resources/org/gcube/portlets/user/invitefriends/InviteFriends.gwt.xml b/src/main/resources/org/gcube/portlets/user/invitefriends/InviteFriends.gwt.xml index f1cd2bc..096d3f3 100644 --- a/src/main/resources/org/gcube/portlets/user/invitefriends/InviteFriends.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/invitefriends/InviteFriends.gwt.xml @@ -1,22 +1,17 @@ - - - + + + + - - - - - - + - + + - - - - - - + + + diff --git a/src/main/webapp/InviteFriends.html b/src/main/webapp/InviteFriends.html index 01d5d3d..ec31c4d 100644 --- a/src/main/webapp/InviteFriends.html +++ b/src/main/webapp/InviteFriends.html @@ -9,22 +9,14 @@ - - - - - - - + + Web Application Starter Project - - - - - - + + + diff --git a/src/main/webapp/WEB-INF/jsp/InviteFriends_view.jsp b/src/main/webapp/WEB-INF/jsp/InviteFriends_view.jsp new file mode 100644 index 0000000..09f4919 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/InviteFriends_view.jsp @@ -0,0 +1,22 @@ +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + +<%-- Uncomment below lines to add portlet taglibs to jsp +<%@ page import="javax.portlet.*"%> +<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%> + + +--%> + + + + + + +
+ + + diff --git a/src/main/webapp/WEB-INF/liferay-display.xml b/src/main/webapp/WEB-INF/liferay-display.xml new file mode 100644 index 0000000..705067f --- /dev/null +++ b/src/main/webapp/WEB-INF/liferay-display.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/main/webapp/WEB-INF/liferay-plugin-package.properties b/src/main/webapp/WEB-INF/liferay-plugin-package.properties new file mode 100644 index 0000000..f873307 --- /dev/null +++ b/src/main/webapp/WEB-INF/liferay-plugin-package.properties @@ -0,0 +1,9 @@ +name=InviteFriends +module-group-id=liferay +module-incremental-version=1 +tags= +short-description= +change-log= +page-url=http://www.d4science.org +author=D4Science Org. +licenses=EUPL \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/liferay-portlet.xml b/src/main/webapp/WEB-INF/liferay-portlet.xml new file mode 100644 index 0000000..e6b9b94 --- /dev/null +++ b/src/main/webapp/WEB-INF/liferay-portlet.xml @@ -0,0 +1,13 @@ + + + + + + InviteFriends + false + false + false + + /InviteFriends.css + + diff --git a/src/main/webapp/WEB-INF/portlet.xml b/src/main/webapp/WEB-INF/portlet.xml new file mode 100644 index 0000000..4de6273 --- /dev/null +++ b/src/main/webapp/WEB-INF/portlet.xml @@ -0,0 +1,21 @@ + + + + + InviteFriends + gCube Invite Friends + org.gcube.portlets.user.invitefriends.server.portlet.InviteFriendsPortlet + 0 + + text/html + + + Invite Friends + Invite Friends + Invite Friends + + + diff --git a/src/test/java/org/gcube/portlets/user/invitefriends/client/GwtTestInviteFriends.java b/src/test/java/org/gcube/portlets/user/invitefriends/client/GwtTestInviteFriends.java deleted file mode 100644 index c67a203..0000000 --- a/src/test/java/org/gcube/portlets/user/invitefriends/client/GwtTestInviteFriends.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.gcube.portlets.user.invitefriends.client; - -import org.gcube.portlets.user.invitefriends.shared.FieldVerifier; -import com.google.gwt.core.client.GWT; -import com.google.gwt.junit.client.GWTTestCase; -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.google.gwt.user.client.rpc.ServiceDefTarget; - -/** - * GWT JUnit integration tests must extend GWTTestCase. - * Using "GwtTest*" naming pattern exclude them from running with - * surefire during the test phase. - * - * If you run the tests using the Maven command line, you will have to - * navigate with your browser to a specific url given by Maven. - * See http://mojo.codehaus.org/gwt-maven-plugin/user-guide/testing.html - * for details. - */ -public class GwtTestInviteFriends extends GWTTestCase { - - /** - * Must refer to a valid module that sources this class. - */ - public String getModuleName() { - return "org.gcube.portlets.user.invitefriends.InviteFriendsJUnit"; - } - - /** - * Tests the FieldVerifier. - */ - public void testFieldVerifier() { - assertFalse(FieldVerifier.isValidName(null)); - assertFalse(FieldVerifier.isValidName("")); - assertFalse(FieldVerifier.isValidName("a")); - assertFalse(FieldVerifier.isValidName("ab")); - assertFalse(FieldVerifier.isValidName("abc")); - assertTrue(FieldVerifier.isValidName("abcd")); - } - - /** - * This test will send a request to the server using the greetServer method in - * InviteService and verify the response. - */ - public void testGreetingService() { - // Create the service that we will test. - GreetingServiceAsync greetingService = GWT.create(InviteService.class); - ServiceDefTarget target = (ServiceDefTarget) greetingService; - target.setServiceEntryPoint(GWT.getModuleBaseURL() + "InviteFriends/greet"); - - // Since RPC calls are asynchronous, we will need to wait for a response - // after this test method returns. This line tells the test runner to wait - // up to 10 seconds before timing out. - delayTestFinish(10000); - - // Send a request to the server. - greetingService.greetServer("GWT User", new AsyncCallback() { - public void onFailure(Throwable caught) { - // The request resulted in an unexpected error. - fail("Request failure: " + caught.getMessage()); - } - - public void onSuccess(String result) { - // Verify that the response is correct. - assertTrue(result.startsWith("Hello, GWT User!")); - - // Now that we have received a response, we need to tell the test runner - // that the test is complete. You must call finishTest() after an - // asynchronous test finishes successfully, or the test will time out. - finishTest(); - } - }); - } - - -}