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
This commit is contained in:
Massimiliano Assante 2013-01-29 00:32:04 +00:00
parent cd15ea3c6b
commit a6b83a00b5
3 changed files with 12 additions and 4 deletions

View File

@ -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("<a class=\"link\" href=\""+toShow.getUri()+"\"> See this Document Workflow.</a>");
}
}
private ImageResource getImageType(NotificationType type) {

View File

@ -15,6 +15,7 @@
</td>
<td valign="TOP">
<c:Span styleName="user-notification" ui:field="notificationText" />
<c:Span styleName="user-notification" ui:field="goApp" />
</td>
</tr>
</table>

View File

@ -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 {