fixed link to explore VREs when user has no VREs yet
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/my-vres@130655 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b2ab8caf97
commit
781d933483
|
@ -18,4 +18,6 @@ public interface MyVREsService extends RemoteService {
|
||||||
void loadLayout(String scope, String URL);
|
void loadLayout(String scope, String URL);
|
||||||
|
|
||||||
String showMoreVREs();
|
String showMoreVREs();
|
||||||
|
|
||||||
|
String getSiteLandingPagePath();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,4 +17,6 @@ public interface MyVREsServiceAsync {
|
||||||
|
|
||||||
void showMoreVREs(AsyncCallback<String> callback);
|
void showMoreVREs(AsyncCallback<String> callback);
|
||||||
|
|
||||||
|
void getSiteLandingPagePath(AsyncCallback<String> callback);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,9 @@ package org.gcube.portlet.user.my_vres.client;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.google.gwt.user.client.ui.Anchor;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
@ -10,14 +13,26 @@ public class NoVresPanel extends Composite {
|
||||||
private static NoVresPanelUiBinder uiBinder = GWT
|
private static NoVresPanelUiBinder uiBinder = GWT
|
||||||
.create(NoVresPanelUiBinder.class);
|
.create(NoVresPanelUiBinder.class);
|
||||||
|
|
||||||
|
private final MyVREsServiceAsync myVREsService = GWT.create(MyVREsService.class);
|
||||||
|
|
||||||
interface NoVresPanelUiBinder extends UiBinder<Widget, NoVresPanel> {
|
interface NoVresPanelUiBinder extends UiBinder<Widget, NoVresPanel> {
|
||||||
}
|
}
|
||||||
|
@UiField Anchor joinLink;
|
||||||
|
@UiField Anchor availableLink;
|
||||||
public NoVresPanel() {
|
public NoVresPanel() {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
}
|
myVREsService.getSiteLandingPagePath(new AsyncCallback<String>() {
|
||||||
|
|
||||||
public NoVresPanel(String firstName) {
|
@Override
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
public void onSuccess(String result) {
|
||||||
|
joinLink.setHref(result);
|
||||||
|
availableLink.setHref(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<div class="NoVresStyle">
|
<div class="NoVresStyle">
|
||||||
You are not subscribed to any environment,
|
You are not subscribed to any environment,
|
||||||
please begin by
|
please begin by
|
||||||
<a class="vrelink" href="/explore"><span class="important">joining</span></a> one. <br /><br />
|
<g:Anchor ui:field="joinLink" styleName="vrelink"><span class="important">joining</span></g:Anchor> one.<br /><br />
|
||||||
<a class="vrelink" href="/explore"><span class="important">Explore</span></a> the research environments available in the infrastructure.
|
<g:Anchor ui:field="availableLink" styleName="vrelink"><span class="important">Explore</span></g:Anchor> the Virtual Research Environments available in the infrastructure.
|
||||||
</div>
|
</div>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</ui:UiBinder>
|
</ui:UiBinder>
|
|
@ -57,6 +57,13 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
|
||||||
public String showMoreVREs() {
|
public String showMoreVREs() {
|
||||||
return PortalContext.getConfiguration().getSiteLandingPagePath(getThreadLocalRequest());
|
return PortalContext.getConfiguration().getSiteLandingPagePath(getThreadLocalRequest());
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String getSiteLandingPagePath() {
|
||||||
|
String user = getASLSession().getUsername();
|
||||||
|
_log.debug("user=" + user + " has no VREs");
|
||||||
|
String toReturn = PortalContext.getConfiguration().getSiteLandingPagePath(getThreadLocalRequest())+GCubePortalConstants.VRES_EXPLORE_FRIENDLY_URL;
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return true if you're running into the portal, false if in development
|
* @return true if you're running into the portal, false if in development
|
||||||
|
@ -236,4 +243,5 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -33,8 +33,6 @@ a.vrelink:hover {
|
||||||
|
|
||||||
.NoVresStyle {
|
.NoVresStyle {
|
||||||
line-height: 25px;
|
line-height: 25px;
|
||||||
font-family: 'Architects Daughter', Arial, Verdana, sans-serif;
|
|
||||||
font-size: 15px;
|
|
||||||
padding-left: 0px;
|
padding-left: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue