diff --git a/.classpath b/.classpath index 7af9f72..e003a06 100644 --- a/.classpath +++ b/.classpath @@ -20,16 +20,16 @@ - - - - - + + + + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index ad26666..23f2710 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,9 @@ -#Thu Sep 02 10:42:20 CEST 2010 +#Mon Jan 28 22:47:29 CET 2013 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index 7ff7048..d215cd0 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,7 +1,7 @@ - + diff --git a/pom.xml b/pom.xml index 0d0b734..35cd5a2 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ org.gcube.core gcf - [1.4.0,1.5.0] + [1.4.0,1.6.0] provided @@ -163,8 +163,8 @@ maven-compiler-plugin 2.3.2 - 1.5 - 1.5 + 1.6 + 1.6 diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/Notifications.java b/src/main/java/org/gcube/portlets/user/notifications/client/Notifications.java index 249a31f..461fefe 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/Notifications.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/Notifications.java @@ -3,7 +3,6 @@ package org.gcube.portlets.user.notifications.client; import org.gcube.portlets.user.notifications.client.view.NotificationsPanel; import com.google.gwt.core.client.EntryPoint; -import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.ui.RootPanel; /** 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 0a973fe..c123b6c 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 @@ -11,12 +11,15 @@ import com.google.gwt.resources.client.ImageResource; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; 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 SingleNotificationView extends Composite { + private final static String LINK_TEXT = "likes your post: shared a link. "; + private static NotificationsDayUiBinder uiBinder = GWT .create(NotificationsDayUiBinder.class); @@ -39,9 +42,22 @@ public class SingleNotificationView extends Composite { myNotification = toShow; String notificationToShow = toShow.getDescription(); + String removeMarkup = notificationToShow.replaceAll("&", "&"); + String actualHTML = new HTML(removeMarkup).getText(); + + + //in case of links behave differently, i know is terrible //TODO: write better code here + if (new HTML(actualHTML).getText().equalsIgnoreCase(LINK_TEXT)) { + GWT.log("E' UN LINK!"); + actualHTML = actualHTML.replace("your post:", ""); + actualHTML = actualHTML.replace("shared", ""); + actualHTML = actualHTML.replace("link.", "link"); + actualHTML += " you shared."; + } + notificationText.setHTML( ""+ - toShow.getSenderFullName()+" " + notificationToShow); + toShow.getSenderFullName()+" " + actualHTML); timeArea.setHTML(DateTimeFormat.getFormat("h:mm a").format(toShow.getTime())); @@ -77,6 +93,16 @@ public class SingleNotificationView extends Composite { return images.jobNOK(); case JOB_COMPLETED_OK: return images.jobOK(); + case DOCUMENT_WORKFLOW_EDIT: + return images.documentWorkflow(); + case DOCUMENT_WORKFLOW_VIEW: + return images.documentWorkflow(); + case DOCUMENT_WORKFLOW_STEP_REQUEST_TASK: + return images.documentWorkflow(); + case DOCUMENT_WORKFLOW_STEP_FORWARD_OWNER: + return images.workflowForward(); + case DOCUMENT_WORKFLOW_STEP_FORWARD_PEER: + return images.workflowForward(); default: return images.generic(); } diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/NotificationImages.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/NotificationImages.java index f9148bb..0f19eac 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/NotificationImages.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/NotificationImages.java @@ -25,6 +25,12 @@ public interface NotificationImages extends ClientBundle { @Source("job_nok.png") ImageResource jobNOK(); + @Source("document-workflow.png") + ImageResource documentWorkflow(); + + @Source("workflow-forward.png") + ImageResource workflowForward(); + @Source("notification-generic.png") ImageResource generic(); } diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/comment.png b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/comment.png index 82f6f3a..8c76768 100644 Binary files a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/comment.png and b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/comment.png differ diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/document-workflow.png b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/document-workflow.png new file mode 100644 index 0000000..a437cc3 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/document-workflow.png differ diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/workflow-forward.png b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/workflow-forward.png new file mode 100644 index 0000000..fac40e5 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/workflow-forward.png differ