diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 8b60e94..b9f44a3 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -3,7 +3,7 @@ - + uses diff --git a/pom.xml b/pom.xml index b1281e5..5170f03 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ org.gcube.portlets.user gcube-loggedin war - 2.4.0-SNAPSHOT + 2.5.0-SNAPSHOT gCube Loggedin Portlet diff --git a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/GCubeLoggedin.java b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/GCubeLoggedin.java index 974d99d..73be6ee 100644 --- a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/GCubeLoggedin.java +++ b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/GCubeLoggedin.java @@ -1,10 +1,7 @@ package org.gcube.portlets.user.gcubeloggedin.client; -import org.gcube.portal.custom.communitymanager.OrganizationsUtil; -import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper; import org.gcube.portlets.user.gcubeloggedin.client.ui.AboutView; import org.gcube.portlets.user.gcubeloggedin.shared.VObject; -import org.gcube.portlets.user.gcubeloggedin.shared.VREClient; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; @@ -13,11 +10,6 @@ import com.google.gwt.user.client.rpc.ServiceDefTarget; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.VerticalPanel; -import com.liferay.portal.model.User; -import com.liferay.portal.security.permission.PermissionChecker; -import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil; -import com.liferay.portal.security.permission.PermissionThreadLocal; -import com.liferay.portal.service.UserLocalServiceUtil; /** * Entry point classes define onModuleLoad(). diff --git a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/UIConstants.java b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/UIConstants.java index 438707e..dc30b96 100644 --- a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/UIConstants.java +++ b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/UIConstants.java @@ -7,5 +7,7 @@ public class UIConstants { public static final String LOADING_IMAGE = GWT.getModuleBaseURL() + "../images/loading-bar.gif"; public static final String LOADINGE = GWT.getModuleBaseURL() + "../images/loading.gif"; + + public static final String HOME = GWT.getModuleBaseURL() + "../images/home.png"; } diff --git a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.java b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.java index 4029bb4..fdc4cbc 100644 --- a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.java +++ b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.java @@ -7,18 +7,22 @@ import org.gcube.portlets.user.gcubeloggedin.shared.VREClient; import org.gcube.portlets.widgets.sessionchecker.client.CheckSession; import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.Document; +import com.google.gwt.core.client.Scheduler; 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.Command; +import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.Window.Location; import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.Anchor; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTMLPanel; +import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.Widget; public class AboutView extends Composite { @@ -36,24 +40,36 @@ public class AboutView extends Composite { @UiField HTMLPanel htmlPanel; @UiField HTML description; - @UiField Button backButton; - @UiField Button leaveButton; + @UiField Anchor backButton; + @UiField Anchor leaveButton; + private LoggedinServiceAsync loggedinService; public AboutView(VObject vobj, LoggedinServiceAsync loggedinService) { initWidget(uiBinder.createAndBindUi(this)); + + vobj.setMandatory(true); + this.loggedinService = loggedinService; description.setHTML("" + vobj.getDescription()); - if (vobj instanceof VREClient && !vobj.isMandatory()) { - leaveButton.getElement().getStyle().setBackgroundColor("#F2DEDE"); - leaveButton.getElement().getStyle().setBorderColor("#EBCCD1"); - leaveButton.getElement().getStyle().setColor("#A94440"); + leaveButton.setStyleName("leave-group"); + + if (vobj instanceof VREClient && !vobj.isMandatory()) { wa = new WarningAlert("Are you sure you want to leave this group? " + "By leaving this group you will no longer receive updates and lose the workspace folder related to the group.", this); - } else - htmlPanel.remove(leaveButton); + } + else { + //remove the login button + Scheduler.get().scheduleDeferred(new Command() { + public void execute () { + DOM.getElementById("removable-item-li").removeFromParent(); + } + }); + } + + } @UiHandler("backButton") diff --git a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.ui.xml b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.ui.xml index 2b55a08..73b17fb 100644 --- a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.ui.xml +++ b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.ui.xml @@ -1,10 +1,18 @@ - - + + +
+
    +
  • +       +
  • +
  • + Leave Group +
  • +
+
- Back - Leave Group
\ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/gcubeloggedin/server/LoggedinServiceImpl.java b/src/main/java/org/gcube/portlets/user/gcubeloggedin/server/LoggedinServiceImpl.java index 84548f5..f96678d 100644 --- a/src/main/java/org/gcube/portlets/user/gcubeloggedin/server/LoggedinServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/gcubeloggedin/server/LoggedinServiceImpl.java @@ -9,8 +9,6 @@ import java.util.List; import java.util.Properties; import java.util.Set; -import javax.portlet.PortletSession; -import javax.portlet.RenderRequest; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -27,9 +25,7 @@ import org.gcube.portlets.user.gcubeloggedin.shared.VObject.UserBelongingClient; import org.gcube.portlets.user.gcubeloggedin.shared.VREClient; import org.gcube.vomanagement.usermanagement.GroupManager; import org.gcube.vomanagement.usermanagement.UserManager; -import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault; import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException; -import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault; import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayGroupManager; import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager; import org.gcube.vomanagement.usermanagement.model.RoleModel; diff --git a/src/main/resources/org/gcube/portlets/user/gcubeloggedin/GCubeLoggedin.gwt.xml b/src/main/resources/org/gcube/portlets/user/gcubeloggedin/GCubeLoggedin.gwt.xml index 733b601..e8c96ac 100644 --- a/src/main/resources/org/gcube/portlets/user/gcubeloggedin/GCubeLoggedin.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/gcubeloggedin/GCubeLoggedin.gwt.xml @@ -1,17 +1,14 @@ + - - - - - - - + - - + + + + diff --git a/src/main/webapp/GCubeLoggedin.css b/src/main/webapp/GCubeLoggedin.css index 9c790d6..816a93f 100644 --- a/src/main/webapp/GCubeLoggedin.css +++ b/src/main/webapp/GCubeLoggedin.css @@ -3,15 +3,51 @@ margin-right: 10px; } +#vre-header-container { + border-bottom: 1px solid #ccc; +} + +#vre-header-container ul { + margin: 6px 2px 0px; + padding: 1px; + height: 23px; +} + +#vre-header li { + display: inline; + list-style-type: none; + border-right: 1px solid #ccc; + padding: 8px 20px; +} + +#vre-header li a { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-size: 14px; + color: #666; + text-decoration: none; +} + +#vre-header li a span { + background-image: url('images/home.png'); + background-repeat: no-repeat; + background-position: 50% 80%; +} + +#vre-header li a:hover { + color: #A94440; + opacity: 0.8; +} + +.description { + padding: 10px; +} + table { border-collapse: separate !important; border-spacing: 0; } -.framed { - margin: 0 0 10px; - padding: 10px; - margin: 0px 5px; +.envhome-frame { background: #FFF; border-radius: 6px !important; -moz-border-radius: 6px !important; @@ -34,4 +70,4 @@ table { color: #A94440; font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 14px; -} +} \ No newline at end of file diff --git a/src/main/webapp/images/home.png b/src/main/webapp/images/home.png new file mode 100644 index 0000000..7f318fe Binary files /dev/null and b/src/main/webapp/images/home.png differ