From a6b83a00b599a626832f30d51d450c8d94710951 Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Tue, 29 Jan 2013 00:32:04 +0000 Subject: [PATCH] open app related for document workflow request task git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/notifications@68450 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/view/templates/SingleNotificationView.java | 10 ++++++++-- .../view/templates/SingleNotificationView.ui.xml | 1 + .../notifications/server/NotificationsServiceImpl.java | 5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java index c123b6c..14b0fa0 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java @@ -19,7 +19,7 @@ import com.google.gwt.user.client.ui.Widget; public class SingleNotificationView extends Composite { private final static String LINK_TEXT = "likes your post: shared a link. "; - + private static NotificationsDayUiBinder uiBinder = GWT .create(NotificationsDayUiBinder.class); @@ -36,6 +36,7 @@ public class SingleNotificationView extends Composite { @UiField HTMLPanel mainPanel; @UiField Span notificationText; @UiField Span timeArea; + @UiField Span goApp; public SingleNotificationView(Notification toShow) { initWidget(uiBinder.createAndBindUi(this)); @@ -46,7 +47,7 @@ public class SingleNotificationView extends Composite { String actualHTML = new HTML(removeMarkup).getText(); - //in case of links behave differently, i know is terrible //TODO: write better code here + //in case of links behave differently, i know is terrible //TODO: write better code here i think if (new HTML(actualHTML).getText().equalsIgnoreCase(LINK_TEXT)) { GWT.log("E' UN LINK!"); actualHTML = actualHTML.replace("your post:", ""); @@ -63,6 +64,11 @@ public class SingleNotificationView extends Composite { timeArea.setHTML(DateTimeFormat.getFormat("h:mm a").format(toShow.getTime())); notificationImage.setResource(getImageType(toShow.getType())); + + switch (toShow.getType()) { + case DOCUMENT_WORKFLOW_STEP_REQUEST_TASK: + goApp.setHTML(" See this Document Workflow."); + } } private ImageResource getImageType(NotificationType type) { diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.ui.xml b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.ui.xml index dd8824c..b74577d 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.ui.xml +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.ui.xml @@ -15,6 +15,7 @@ + diff --git a/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java b/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java index c253df5..a133eff 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java @@ -61,9 +61,10 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No String sessionID = this.getThreadLocalRequest().getSession().getId(); String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE); if (user == null) { - _log.warn("USER IS NULL setting test.user and Running OUTSIDE PORTAL"); //user = "test.user"; - user = "massimiliano.assante"; + user = "pasquale.pagano"; + + _log.warn("USER IS NULL setting "+user+" and Running OUTSIDE PORTAL"); withinPortal = false; } else {