show the virualgroups in the order selected in the Liferay control Panel interface
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/join-vre@118897 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ad4a84dd58
commit
300e020a95
|
@ -1,8 +1,8 @@
|
|||
package org.gcube.portlets.user.joinvre.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.gcube.portlets.user.joinvre.shared.VRE;
|
||||
import org.gcube.portlets.user.joinvre.shared.VRECategory;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package org.gcube.portlets.user.joinvre.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.gcube.portlets.user.joinvre.shared.VRE;
|
||||
import org.gcube.portlets.user.joinvre.shared.VRECategory;
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.joinvre.client.panels;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
||||
*
|
||||
*/
|
||||
public enum Relevance {
|
||||
Must_Have, Recommended, Exclusive, Demonstrative
|
||||
}
|
|
@ -1,19 +1,16 @@
|
|||
package org.gcube.portlets.user.joinvre.client.responsive;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.gcube.portlets.user.joinvre.client.JoinService;
|
||||
import org.gcube.portlets.user.joinvre.client.JoinServiceAsync;
|
||||
import org.gcube.portlets.user.joinvre.client.ui.VreThumbnail;
|
||||
import org.gcube.portlets.user.joinvre.shared.VRE;
|
||||
import org.gcube.portlets.user.joinvre.shared.VRECategory;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Column;
|
||||
import com.github.gwtbootstrap.client.ui.Image;
|
||||
import com.github.gwtbootstrap.client.ui.PageHeader;
|
||||
import com.github.gwtbootstrap.client.ui.Row;
|
||||
import com.github.gwtbootstrap.client.ui.ThumbnailLink;
|
||||
import com.github.gwtbootstrap.client.ui.Thumbnails;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
<ui:style>
|
||||
.important {
|
||||
font-weight: bold;
|
||||
}
|
||||
</ui:style>
|
||||
<b:Thumbnail size="3">
|
||||
<b:Image ui:field="vreImage"/>
|
||||
<!-- The Caption is optional -->
|
||||
<b:Caption>
|
||||
<b:Heading size="4" ui:field="vreName"></b:Heading>
|
||||
<b:Paragraph ui:field="p">
|
||||
<b:Button ui:field="joinButton"></b:Button>
|
||||
<b:Button ui:field="vreInfoButton" type="INFO">Info</b:Button>
|
||||
</b:Paragraph>
|
||||
</b:Caption>
|
||||
</b:Thumbnail>
|
||||
</ui:UiBinder>
|
|
@ -1,172 +0,0 @@
|
|||
package org.gcube.portlets.user.joinvre.client.ui;
|
||||
|
||||
import static com.google.gwt.query.client.GQuery.$;
|
||||
import static com.google.gwt.query.client.css.CSS.WIDTH;
|
||||
import static com.google.gwt.query.client.GQuery.window;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.gcubewidgets.client.elements.Div;
|
||||
import org.gcube.portlets.user.joinvre.client.JoinService;
|
||||
import org.gcube.portlets.user.joinvre.client.JoinServiceAsync;
|
||||
import org.gcube.portlets.user.joinvre.shared.VRE;
|
||||
import org.gcube.portlets.user.joinvre.shared.VRECategory;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.query.client.Function;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
/**
|
||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
||||
*/
|
||||
public class DisplayVRE extends Composite {
|
||||
|
||||
interface DisplayVREUiBinder extends UiBinder<Widget, DisplayVRE> {}
|
||||
|
||||
private static DisplayVREUiBinder uiBinder = GWT.create(DisplayVREUiBinder.class);
|
||||
|
||||
private final JoinServiceAsync joinService = GWT.create(JoinService.class);
|
||||
|
||||
public static final String vreDefaultImage = GWT.getModuleBaseURL() + "../images/vre-default.png";
|
||||
public static final String loadingImage = GWT.getModuleBaseURL() + "../images/vre-image-loader.gif";
|
||||
|
||||
public static LoadingPopUp loadingPopUp = new LoadingPopUp(false, true, loadingImage);
|
||||
|
||||
public static final String REQUEST_ACCESS = "Request Access";
|
||||
public static final String FREE_ACCESS = "Free Access";
|
||||
|
||||
|
||||
|
||||
@UiField HTMLPanel mainPanel;
|
||||
@UiField Image vreImage;
|
||||
@UiField Label vreName;
|
||||
@UiField HTMLPanel vreCategories;
|
||||
@UiField Div vreDesc;
|
||||
@UiField Button joinButton;
|
||||
@UiField Button closeButton;
|
||||
|
||||
public DisplayVRE(final VRE vre) {
|
||||
Widget widget = uiBinder.createAndBindUi(this);
|
||||
vreImage.setUrl(loadingImage);
|
||||
closeButton.setText("Collapse");
|
||||
vreDesc.setHTML(vre.getDescription());
|
||||
|
||||
if(vre.getImageURL().compareTo("")!=0){
|
||||
vreImage.setUrl(vre.getImageURL());
|
||||
}else{
|
||||
vreImage.setUrl(vreDefaultImage);
|
||||
}
|
||||
|
||||
final String name = vre.getName();
|
||||
ClickHandler descriptionHandler = new ClickHandler(){
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
if ($(mainPanel).css(WIDTH).compareTo("160px") == 0)
|
||||
show();
|
||||
else
|
||||
collapse();
|
||||
|
||||
}
|
||||
};
|
||||
closeButton.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
collapse();
|
||||
}
|
||||
});
|
||||
|
||||
vreImage.setTitle("Click to see details");
|
||||
vreImage.addClickHandler(descriptionHandler);
|
||||
|
||||
vreName.setTitle(name);
|
||||
vreName.setText(name);
|
||||
vreName.addClickHandler(descriptionHandler);
|
||||
|
||||
List<VRECategory> categories = null;
|
||||
for(int i=0; i<categories.size(); i++){
|
||||
vreCategories.add(new Label(categories.get(i).getName()));
|
||||
if(i!=categories.size()-1){
|
||||
vreCategories.add(new Label(","));
|
||||
}
|
||||
}
|
||||
|
||||
if(vre.isUponRequest()){
|
||||
joinButton.setText(REQUEST_ACCESS);
|
||||
}else{
|
||||
joinButton.setText(FREE_ACCESS);
|
||||
joinButton.setStyleName("freeAccessButton", true);
|
||||
}
|
||||
joinButton.setStyleName("joinButton", true);
|
||||
joinButton.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
loadingPopUp.show();
|
||||
joinService.joinVRE(vre.getId(), new AsyncCallback<Boolean>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
loadingPopUp.hide();
|
||||
String error = "Error";
|
||||
String errorDescription = "Error while trying to join to"
|
||||
+ name + " VRE. Please Try again later. "
|
||||
+ "If the problem persist contact system administrator";
|
||||
final InfoDialog infoDialog = new InfoDialog(error, errorDescription);
|
||||
infoDialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(Boolean result) {
|
||||
loadingPopUp.hide();
|
||||
Window.open("/group/data-e-infrastructure-gateway/join-new?orgid="+vre.getId(), "_self", "");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
initWidget(widget);
|
||||
}
|
||||
|
||||
private void show() {
|
||||
$(mainPanel).animate("width:'927px'", 120, new Function(){
|
||||
public void f(Element e){
|
||||
$(vreDesc).fadeIn();
|
||||
$(closeButton).fadeIn();
|
||||
$(window).scrollTo(0, mainPanel.getAbsoluteTop()-310);
|
||||
}
|
||||
});
|
||||
vreImage.setTitle("Click to collapse");
|
||||
}
|
||||
private void collapse() {
|
||||
$(closeButton).fadeOut();
|
||||
$(vreDesc).fadeOut(new Function(){
|
||||
public void f(Element e){
|
||||
$(mainPanel).animate("width:'160px'", 150);
|
||||
}
|
||||
});
|
||||
vreImage.setTitle("Click to see details");
|
||||
}
|
||||
|
||||
public void showError(String message) {
|
||||
Window.alert("Failure: " + message);
|
||||
vreImage.setSize("100px", "100px");
|
||||
vreImage.setUrl(vreDefaultImage);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:e="urn:import:org.gcube.portlets.user.gcubewidgets.client.elements">
|
||||
|
||||
|
||||
<g:HTMLPanel ui:field="mainPanel" styleName="framed">
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<div class="vreImageDetails">
|
||||
<g:Image title="VRE Image" styleName="vreImage" url=""
|
||||
ui:field="vreImage" />
|
||||
</div>
|
||||
<div class="vreDetails">
|
||||
<g:Label ui:field="vreName" styleName="vreName" />
|
||||
<g:HTMLPanel ui:field="vreCategories" styleName="vreCategories" />
|
||||
<g:Button ui:field="joinButton"></g:Button>
|
||||
</div>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<e:Div ui:field="vreDesc" visible="false" styleName="vreDesc"></e:Div>
|
||||
<div style="width: 100%; text-align: right;">
|
||||
<g:Button ui:field="closeButton" visible="false" />
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</g:HTMLPanel>
|
||||
|
||||
|
||||
|
||||
</ui:UiBinder>
|
|
@ -1,67 +0,0 @@
|
|||
package org.gcube.portlets.user.joinvre.client.ui;
|
||||
|
||||
import org.gcube.portlets.user.gcubewidgets.client.popup.GCubeDialog;
|
||||
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.ScrollPanel;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
|
||||
|
||||
/**
|
||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
||||
*/
|
||||
public class InfoDialog extends GCubeDialog {
|
||||
private ScrollPanel scroller = new ScrollPanel();
|
||||
private VerticalPanel main_panel = null;
|
||||
|
||||
public InfoDialog(String title, String content) {
|
||||
|
||||
// PopupPanel's constructor takes 'auto-hide' as its boolean parameter.
|
||||
// If this is set, the panel closes itself automatically when the user
|
||||
// clicks outside of it.
|
||||
super(true);
|
||||
super.setText(title);
|
||||
main_panel = new VerticalPanel();
|
||||
main_panel.addStyleName("bgBlank p8 font_family font_12");
|
||||
|
||||
if (content == null || content.equals(""))
|
||||
content = "We're sorry, there is no available description yet";
|
||||
|
||||
scroller.add(new HTML(content));
|
||||
|
||||
// PopupPanel is a SimplePanel, so you have to set it's widget property to
|
||||
// whatever you want its contents to be.
|
||||
Button close = new Button("Close");
|
||||
close.addClickHandler(new ClickHandler() {
|
||||
public void onClick(ClickEvent event) {
|
||||
hide();
|
||||
}
|
||||
});
|
||||
main_panel.add(scroller);
|
||||
main_panel.add(new HTML("<hr align=\"left\" size=\"1\" width=\"100%\" color=\"gray\" noshade>"));
|
||||
main_panel.add(close);
|
||||
scroller.setPixelSize(550, 300);
|
||||
main_panel.setPixelSize(550, 350);
|
||||
setWidget(main_panel);
|
||||
}
|
||||
|
||||
public void show() {
|
||||
super.show();
|
||||
center();
|
||||
// int left = (Window.getClientWidth() - getOffsetWidth()) / 2 + getBodyScrollLeft();
|
||||
// int top = (Window.getClientHeight() - getOffsetHeight()) / 2 + getBodyScrollTop();
|
||||
// setPopupPosition(left, top);
|
||||
}
|
||||
|
||||
private native int getBodyScrollLeft() /*-{
|
||||
return $doc.body.scrollLeft;
|
||||
}-*/;
|
||||
|
||||
private native int getBodyScrollTop() /*-{
|
||||
return $doc.body.scrollTop;
|
||||
}-*/;
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
package org.gcube.portlets.user.joinvre.client.ui;
|
||||
|
||||
import com.google.gwt.user.client.ui.DialogBox;
|
||||
import com.google.gwt.user.client.ui.DockPanel;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class LoadingPopUp extends DialogBox {
|
||||
|
||||
private static LoadingPopUp singleton = null;
|
||||
private boolean hidden = true;
|
||||
private String loading_image = "";
|
||||
|
||||
public static LoadingPopUp get() {
|
||||
return singleton;
|
||||
}
|
||||
|
||||
public LoadingPopUp(boolean autoHide, boolean modal, String loading_image) {
|
||||
super(autoHide, modal);
|
||||
this.loading_image = loading_image;
|
||||
HTML msg = new HTML(setToDisplay(), true);
|
||||
DockPanel dock = new DockPanel();
|
||||
dock.setSpacing(0);
|
||||
dock.add(msg, DockPanel.NORTH);
|
||||
dock.setPixelSize(msg.getOffsetWidth(), msg.getOffsetHeight());
|
||||
setWidget(dock);
|
||||
if (singleton == null) singleton = this;
|
||||
}
|
||||
|
||||
protected String setToDisplay() {
|
||||
return
|
||||
"<center><table border='0'>"+
|
||||
"<tr>"+
|
||||
"<td>"+
|
||||
"<img src='" + this.loading_image + "'>"+
|
||||
"</td></tr>"+
|
||||
"</table></center>" ;
|
||||
}
|
||||
public void hide() {
|
||||
super.hide();
|
||||
this.hidden = true;
|
||||
}
|
||||
public void show() {
|
||||
super.show();
|
||||
this.hidden = false;
|
||||
}
|
||||
public boolean isHidden() {
|
||||
return this.hidden;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
package org.gcube.portlets.user.joinvre.client.responsive;
|
||||
package org.gcube.portlets.user.joinvre.client.ui;
|
||||
|
||||
import org.gcube.portlets.user.joinvre.client.JoinService;
|
||||
import org.gcube.portlets.user.joinvre.client.JoinServiceAsync;
|
||||
import org.gcube.portlets.user.joinvre.client.ui.InfoDialog;
|
||||
import org.gcube.portlets.user.joinvre.client.ui.InfoPanel;
|
||||
import org.gcube.portlets.user.joinvre.shared.VRE;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
|
@ -12,7 +10,6 @@ import com.github.gwtbootstrap.client.ui.Image;
|
|||
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||
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.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
|
@ -52,8 +49,6 @@ public class VreThumbnail extends Composite {
|
|||
joinButton.setText("Enter this VRE");
|
||||
}
|
||||
vreImage.setUrl(vre.getImageURL());
|
||||
vreImage.setWidth("180px");
|
||||
|
||||
}
|
||||
|
||||
@UiHandler("joinButton")
|
||||
|
@ -61,7 +56,6 @@ public class VreThumbnail extends Composite {
|
|||
joinService.joinVRE(myVre.getId(), new AsyncCallback<Boolean>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
String error = "Error";
|
||||
String errorDescription = "Error while trying to join to"
|
||||
+ myVre.getName() + " VRE. Please Try again later. "
|
||||
+ "If the problem persist contact system administrator";
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
<ui:style>
|
||||
.imageContainer {
|
||||
height: 180px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 180px;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
-ms-transform: translateY(-50%);
|
||||
-webkit-transform: translateY(-50%);
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
</ui:style>
|
||||
<b:Thumbnail size="3">
|
||||
<g:SimplePanel styleName="{style.imageContainer}">
|
||||
<b:Image ui:field="vreImage" styleName="{style.image}" />
|
||||
</g:SimplePanel>
|
||||
<b:Caption>
|
||||
<b:Heading size="4" ui:field="vreName"></b:Heading>
|
||||
<b:Paragraph ui:field="p">
|
||||
<b:Button ui:field="joinButton"></b:Button>
|
||||
<b:Button ui:field="vreInfoButton" type="INFO">Info</b:Button>
|
||||
</b:Paragraph>
|
||||
</b:Caption>
|
||||
</b:Thumbnail>
|
||||
</ui:UiBinder>
|
|
@ -4,8 +4,8 @@ import java.io.File;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
@ -17,13 +17,10 @@ import org.gcube.application.framework.core.session.SessionManager;
|
|||
import org.gcube.portal.custom.communitymanager.OrganizationsUtil;
|
||||
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
||||
import org.gcube.portlets.user.joinvre.client.JoinService;
|
||||
import org.gcube.portlets.user.joinvre.client.panels.Relevance;
|
||||
import org.gcube.portlets.user.joinvre.shared.UserBelonging;
|
||||
import org.gcube.portlets.user.joinvre.shared.VRE;
|
||||
import org.gcube.portlets.user.joinvre.shared.VRECategory;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||
import com.liferay.portal.kernel.exception.PortalException;
|
||||
import com.liferay.portal.kernel.exception.SystemException;
|
||||
|
@ -40,8 +37,8 @@ import com.liferay.portal.security.permission.PermissionThreadLocal;
|
|||
import com.liferay.portal.service.OrganizationLocalServiceUtil;
|
||||
import com.liferay.portal.service.UserLocalServiceUtil;
|
||||
import com.liferay.portal.theme.ThemeDisplay;
|
||||
import com.liferay.portlet.asset.model.AssetCategory;
|
||||
import com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil;
|
||||
import com.liferay.portlet.expando.model.ExpandoBridge;
|
||||
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
|
||||
|
||||
/**
|
||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
||||
|
@ -103,7 +100,7 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
|||
if (isWithinPortal()) {
|
||||
toReturn = getPortalOrganizationMappedToVRE();
|
||||
} else {
|
||||
VRECategory devsecCategory = new VRECategory(1, "Development", "designed to apply Data Mining techniques to biological data. "
|
||||
VRECategory devsecCategory = new VRECategory(1, "Z_Development", "designed to apply Data Mining techniques to biological data. "
|
||||
+ "The algorithms are executed in a distributed fashion on the e-Infrastructure nodes or on local multi-core machines.");
|
||||
ArrayList<VRE> vres = new ArrayList<VRE>();
|
||||
|
||||
|
@ -139,12 +136,12 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
|||
|
||||
devsecCategory = new VRECategory(2, "Sailing", "Sailing prod desc");
|
||||
vres = new ArrayList<VRE>();
|
||||
vres.add(new VRE(1, "PerformanceEvaluationInAquaculture", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false));
|
||||
vres.add(new VRE(2, "devmode", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true));
|
||||
vres.add(new VRE(1, "StrategicInvestmentAnalysis", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false));
|
||||
vres.add(new VRE(2, "devmode2", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true));
|
||||
vres.add(new VRE(1, "devVR3E", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false));
|
||||
vres.add(new VRE(2, "devmode3", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true));
|
||||
vres.add(new VRE(1, "PerformanceEvaluationInAquaculture", "devVRE VRE description", "http://placehold.it/200x100", "http://placehold.it/200x100", "/group/devVRE", UserBelonging.NOT_BELONGING, false));
|
||||
vres.add(new VRE(2, "devmode", "devmode VRE description", "http://placehold.it/200x100", "https://placeholdit.imgix.net/~text?txtsize=19&txt=200%C3%97100&w=200&h=100", "/group/devmode", UserBelonging.NOT_BELONGING, true));
|
||||
vres.add(new VRE(1, "StrategicInvestmentAnalysis", "devVRE VRE description", "", "https://placeholdit.imgix.net/~text?txtsize=19&txt=200%C3%97100&w=200&h=100", "/group/devVRE", UserBelonging.NOT_BELONGING, false));
|
||||
vres.add(new VRE(2, "devmode2", "devmode VRE description", "http://placehold.it/200x100", "", "/group/devmode", UserBelonging.NOT_BELONGING, true));
|
||||
vres.add(new VRE(1, "devVR3E", "devVRE VRE description", "http://placehold.it/200x200", "aaaa", "/group/devVRE", UserBelonging.NOT_BELONGING, false));
|
||||
vres.add(new VRE(2, "devmode3", "devmode VRE description", "http://placehold.it/200x200", "", "/group/devmode", UserBelonging.NOT_BELONGING, true));
|
||||
vres.add(new VRE(1, "devVRE4", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false));
|
||||
vres.add(new VRE(2, "devmode4", "devmode VRE description", "", "http://placehold.it/200x200", "/group/devmode", UserBelonging.NOT_BELONGING, true));
|
||||
vres.add(new VRE(1, "devVRE5", "devVRE VRE description", "", "http://placehold.it/200x200", "/group/devVRE", UserBelonging.NOT_BELONGING, false));
|
||||
|
@ -174,6 +171,18 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
|||
|
||||
private static final String REQUEST_BASED_GROUP = "Requestbasedgroup";
|
||||
|
||||
public List<String> getVirtualGroups() throws PortalException, SystemException {
|
||||
try {
|
||||
ExpandoBridge expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(OrganizationsUtil.getCompany().getCompanyId(), Organization.class.getName());
|
||||
String[] groups = (String[]) expandoBridge.getAttributeDefault("Virtualgroup");
|
||||
return Arrays.asList(groups);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean requireAccessGrant(Organization organization) throws PortalException, SystemException {
|
||||
try {
|
||||
long companyId = OrganizationsUtil.getCompany().getCompanyId();
|
||||
|
@ -210,8 +219,7 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
|||
_log.warn(String.format("Attribute %s not initialized.", CATEGORY));
|
||||
return null;
|
||||
} else {
|
||||
String[] values = (String[]) organization.getExpandoBridge().getAttribute(CATEGORY);
|
||||
System.out.println("RITORNA QUESTO -> " + values.toString());
|
||||
String[] values = (String[]) organization.getExpandoBridge().getAttribute(CATEGORY);
|
||||
return values[0];
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -221,10 +229,22 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
|||
}
|
||||
|
||||
|
||||
|
||||
public LinkedHashMap<VRECategory, ArrayList<VRE>> getPortalOrganizationMappedToVRE() throws SystemException, PortalException {
|
||||
|
||||
LinkedHashMap<VRECategory, ArrayList<VRE>> toReturn = new LinkedHashMap<VRECategory, ArrayList<VRE>>();
|
||||
|
||||
//before iterating the actual groups create the virtualGroups in the correct order
|
||||
List<String> virtualGroups = getVirtualGroups();
|
||||
for (String vg : virtualGroups) {
|
||||
String[] splits = vg.split("\\|");
|
||||
String gName = splits[0];
|
||||
String gDescription = splits[1];
|
||||
ArrayList<VRE> toCreate = new ArrayList<VRE>();
|
||||
VRECategory cat = new VRECategory(1L, gName, gDescription);
|
||||
toReturn.put(cat, toCreate);
|
||||
}
|
||||
|
||||
//start of iteration of the actual groups
|
||||
List<Organization> organizations = OrganizationLocalServiceUtil.getOrganizations(0, OrganizationLocalServiceUtil.getOrganizationsCount());
|
||||
Organization rootOrganization = null;
|
||||
for (Organization organization : organizations) {
|
||||
|
@ -264,29 +284,33 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
|||
boolean requireAccessGrant = requireAccessGrant(vreOrganization);
|
||||
|
||||
_log.debug(String.format("VRE preferences : %s", vreOrganization.getPreferences()));
|
||||
|
||||
|
||||
String catName = getCategory(vreOrganization);
|
||||
String[] splits = catName.split("\\|");
|
||||
catName = splits[0];
|
||||
String description = splits[1];
|
||||
|
||||
VRECategory toLookFor = null;
|
||||
for (VRECategory vre : toReturn.keySet()) {
|
||||
if (vre.getName().compareTo(catName)==0)
|
||||
toLookFor = vre;
|
||||
}
|
||||
System.out.println("\ngetCategory() ->" + catName);
|
||||
_log.debug("\ngetCategory() ->" + catName);
|
||||
if (toLookFor != null) {
|
||||
ArrayList<VRE> toUpdate = toReturn.get(toLookFor);
|
||||
toUpdate.add(new VRE(vreID,vreName, vreDescription, vreLogoURL, groupName,friendlyURL, UserBelonging.NOT_BELONGING, requireAccessGrant));
|
||||
} else {
|
||||
ArrayList<VRE> toCreate = new ArrayList<VRE>();
|
||||
toCreate.add(new VRE(vreID,vreName, vreDescription, vreLogoURL, groupName,friendlyURL, UserBelonging.NOT_BELONGING, requireAccessGrant));
|
||||
VRECategory cat = new VRECategory(1L, catName, description);
|
||||
toReturn.put(cat, toCreate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//sort the vres in the groups
|
||||
for (VRECategory cat : toReturn.keySet()) {
|
||||
ArrayList<VRE> toSort = toReturn.get(cat);
|
||||
Collections.sort(toSort);
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,10 +4,7 @@
|
|||
<inherits name='com.google.gwt.activity.Activity' />
|
||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||
|
||||
<set-property name="user.agent" value="gecko1_8,safari" />
|
||||
|
||||
<inherits name='com.google.gwt.query.Query' />
|
||||
<!-- Other module inherits -->
|
||||
<!-- <set-property name="user.agent" value="gecko1_8,safari" /> -->
|
||||
|
||||
<!-- Specify the app entry point class. -->
|
||||
<entry-point class='org.gcube.portlets.user.joinvre.client.JoinVRE' />
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
body {
|
||||
padding-top: 0px !important;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size:30px !important;
|
||||
}
|
||||
|
||||
h1 small {
|
||||
font-size:22px !important;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
width: 1220px !important;
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Loading…
Reference in New Issue