Converting VREMember Portlet to JoinVRE needs
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/join-vre@112332 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
44a1e11f4c
commit
d45222d31b
5
pom.xml
5
pom.xml
|
@ -109,6 +109,11 @@
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.8</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<!-- Generate compiled stuff in the folder used for developing mode -->
|
<!-- Generate compiled stuff in the folder used for developing mode -->
|
||||||
|
|
|
@ -12,7 +12,7 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
||||||
*/
|
*/
|
||||||
@RemoteServiceRelativePath("memberservice")
|
@RemoteServiceRelativePath("JoinService")
|
||||||
public interface JoinService extends RemoteService {
|
public interface JoinService extends RemoteService {
|
||||||
|
|
||||||
ArrayList<VRE> getVREs();
|
ArrayList<VRE> getVREs();
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
package org.gcube.portlets.user.joinvre.client;
|
package org.gcube.portlets.user.joinvre.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
|
|
||||||
import org.gcube.portlets.user.joinvre.client.panels.JoinVREPanel;
|
import org.gcube.portlets.user.joinvre.client.panels.JoinVREPanel;
|
||||||
|
|
||||||
import com.google.gwt.core.client.EntryPoint;
|
import com.google.gwt.core.client.EntryPoint;
|
||||||
import com.google.gwt.user.client.Window.Location;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
||||||
import com.google.gwt.user.client.ui.RootPanel;
|
import com.google.gwt.user.client.ui.RootPanel;
|
||||||
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point classes define <code>onModuleLoad()</code>.
|
* Entry point classes define <code>onModuleLoad()</code>.
|
||||||
|
@ -15,18 +14,14 @@ import com.google.gwt.user.client.ui.RootPanel;
|
||||||
*/
|
*/
|
||||||
public class JoinVRE implements EntryPoint {
|
public class JoinVRE implements EntryPoint {
|
||||||
|
|
||||||
|
public static final String loading = GWT.getModuleBaseURL() + "../images/vre-loader.gif";
|
||||||
|
|
||||||
public void onModuleLoad() {
|
public void onModuleLoad() {
|
||||||
|
VerticalPanel mainPanel = new VerticalPanel();
|
||||||
|
|
||||||
ClientScopeHelper.getService().setScope(Location.getHref(), new AsyncCallback<Boolean>() {
|
RootPanel.get("JoinVRE-Container").add(mainPanel);
|
||||||
@Override
|
mainPanel.add(new JoinVREPanel(mainPanel));
|
||||||
public void onSuccess(Boolean result) {
|
|
||||||
// TODO
|
|
||||||
RootPanel.get("JoinVRE-Container").add(new JoinVREPanel());
|
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -26,17 +26,16 @@ public class JoinVREPanel extends Composite {
|
||||||
* Create a remote service proxy to talk to the server-side Greeting service.
|
* Create a remote service proxy to talk to the server-side Greeting service.
|
||||||
*/
|
*/
|
||||||
private final JoinServiceAsync joinService = GWT.create(JoinService.class);
|
private final JoinServiceAsync joinService = GWT.create(JoinService.class);
|
||||||
|
public static final String loading = GWT.getModuleBaseURL() + "../images/vre-loader.gif";
|
||||||
|
|
||||||
public static final String loading = GWT.getModuleBaseURL() + "../images/members-loader.gif";
|
private VerticalPanel mainPanel;
|
||||||
|
|
||||||
private Image loadingImage;
|
public JoinVREPanel(final VerticalPanel verticalPanel) {
|
||||||
|
|
||||||
private VerticalPanel mainPanel = new VerticalPanel();
|
|
||||||
public JoinVREPanel() {
|
|
||||||
super();
|
super();
|
||||||
loadingImage = new Image(loading);
|
GWT.log("JoinVREPanel");
|
||||||
mainPanel.add(loadingImage);
|
this.mainPanel = new VerticalPanel();
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
||||||
joinService.getVREs(new AsyncCallback<ArrayList<VRE>>() {
|
joinService.getVREs(new AsyncCallback<ArrayList<VRE>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -46,7 +45,8 @@ public class JoinVREPanel extends Composite {
|
||||||
mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
|
mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
|
||||||
|
|
||||||
|
|
||||||
// TODO
|
// TODO <div id="JoinVRE-Container"></div>
|
||||||
|
|
||||||
|
|
||||||
if (vres == null || vres.isEmpty()) {
|
if (vres == null || vres.isEmpty()) {
|
||||||
mainPanel.add(new HTML("<div class=\"frame\" style=\"font-size: 16px;\">Ops, something went wrong. Please <a href=\"javascript: location.reload();\">reload<a/> this page.</div>"));
|
mainPanel.add(new HTML("<div class=\"frame\" style=\"font-size: 16px;\">Ops, something went wrong. Please <a href=\"javascript: location.reload();\">reload<a/> this page.</div>"));
|
||||||
|
@ -71,7 +71,6 @@ public class JoinVREPanel extends Composite {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
initWidget(mainPanel);
|
initWidget(mainPanel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,6 +80,9 @@ public class JoinVREPanel extends Composite {
|
||||||
mainPanel.setHeight("300px");
|
mainPanel.setHeight("300px");
|
||||||
mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
|
mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
|
||||||
mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
|
mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
|
||||||
|
|
||||||
|
Image loadingImage = new Image(loading);
|
||||||
mainPanel.add(loadingImage);
|
mainPanel.add(loadingImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,31 +15,25 @@ import com.google.gwt.user.client.ui.Widget;
|
||||||
/**
|
/**
|
||||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
||||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class DisplayVRE extends Composite {
|
public class DisplayVRE extends Composite {
|
||||||
|
|
||||||
protected final static String HEADLINE_TEXT = "Professional Headline";
|
interface DisplayVREUiBinder extends UiBinder<Widget, DisplayVRE> {}
|
||||||
protected final static String ISTI_TEXT = "Company";
|
|
||||||
|
|
||||||
private static DisplayBadgeUiBinder uiBinder = GWT.create(DisplayBadgeUiBinder.class);
|
private static DisplayVREUiBinder uiBinder = GWT.create(DisplayVREUiBinder.class);
|
||||||
|
|
||||||
interface DisplayBadgeUiBinder extends UiBinder<Widget, DisplayVRE> {}
|
|
||||||
|
|
||||||
public static final String vreDefault = GWT.getModuleBaseURL() + "../images/vre-default.png";
|
public static final String vreDefault = GWT.getModuleBaseURL() + "../images/vre-default.png";
|
||||||
|
|
||||||
public static final String loading = GWT.getModuleBaseURL() + "../images/vre-image-loader.gif";
|
public static final String loading = GWT.getModuleBaseURL() + "../images/vre-image-loader.gif";
|
||||||
|
|
||||||
@UiField HTMLPanel mainPanel;
|
@UiField HTMLPanel mainPanel;
|
||||||
@UiField Image vreImage;
|
@UiField Image vreImage;
|
||||||
|
|
||||||
@UiField AnchorElement vreName;
|
@UiField AnchorElement vreName;
|
||||||
|
|
||||||
public DisplayVRE(VRE vre) {
|
public DisplayVRE(VRE vre) {
|
||||||
vreImage.setUrl(loading);
|
Widget widget = uiBinder.createAndBindUi(this);
|
||||||
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
|
||||||
vreImage.setUrl(loading);
|
vreImage.setUrl(loading);
|
||||||
|
mainPanel.addStyleName("profile-section");
|
||||||
|
|
||||||
vreImage.setUrl(vre.getImageURL());
|
vreImage.setUrl(vre.getImageURL());
|
||||||
vreImage.setTitle(vre.getName());
|
vreImage.setTitle(vre.getName());
|
||||||
|
@ -48,6 +42,7 @@ public class DisplayVRE extends Composite {
|
||||||
vreName.setHref(vre.getFriendlyURL());
|
vreName.setHref(vre.getFriendlyURL());
|
||||||
vreName.setInnerText(vre.getName());
|
vreName.setInnerText(vre.getName());
|
||||||
|
|
||||||
|
initWidget(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showError(String message) {
|
public void showError(String message) {
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
<!-- <set-property name="user.agent" value="gecko1_8,safari" /> -->
|
<!-- <set-property name="user.agent" value="gecko1_8,safari" /> -->
|
||||||
|
|
||||||
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||||
<inherits name='org.gcube.portal.databook.GCubeSocialNetworking' />
|
|
||||||
<!-- Other module inherits -->
|
<!-- Other module inherits -->
|
||||||
|
|
||||||
<!-- Specify the app entry point class. -->
|
<!-- Specify the app entry point class. -->
|
||||||
|
|
|
@ -7,23 +7,13 @@
|
||||||
|
|
||||||
<!-- Servlets -->
|
<!-- Servlets -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>greetServlet</servlet-name>
|
<servlet-name>JoinVRE</servlet-name>
|
||||||
<servlet-class>org.gcube.portlets.user.joinvre.server.JoinServiceImpl</servlet-class>
|
<servlet-class>org.gcube.portlets.user.joinvre.server.JoinServiceImpl</servlet-class>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>scopeService</servlet-name>
|
|
||||||
<servlet-class>org.gcube.portlets.user.gcubewidgets.server.ScopeServiceImpl</servlet-class>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>greetServlet</servlet-name>
|
<servlet-name>JoinVRE</servlet-name>
|
||||||
<url-pattern>/joinvre/joinservice</url-pattern>
|
<url-pattern>/JoinVRE/JoinService</url-pattern>
|
||||||
</servlet-mapping>
|
|
||||||
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>scopeService</servlet-name>
|
|
||||||
<url-pattern>/joinvre/scopeService</url-pattern>
|
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- Default page to serve -->
|
<!-- Default page to serve -->
|
||||||
|
|
Loading…
Reference in New Issue