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:
parent
cd15ea3c6b
commit
a6b83a00b5
|
@ -19,7 +19,7 @@ import com.google.gwt.user.client.ui.Widget;
|
||||||
public class SingleNotificationView extends Composite {
|
public class SingleNotificationView extends Composite {
|
||||||
|
|
||||||
private final static String LINK_TEXT = "likes your post: shared a link. ";
|
private final static String LINK_TEXT = "likes your post: shared a link. ";
|
||||||
|
|
||||||
private static NotificationsDayUiBinder uiBinder = GWT
|
private static NotificationsDayUiBinder uiBinder = GWT
|
||||||
.create(NotificationsDayUiBinder.class);
|
.create(NotificationsDayUiBinder.class);
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ public class SingleNotificationView extends Composite {
|
||||||
@UiField HTMLPanel mainPanel;
|
@UiField HTMLPanel mainPanel;
|
||||||
@UiField Span notificationText;
|
@UiField Span notificationText;
|
||||||
@UiField Span timeArea;
|
@UiField Span timeArea;
|
||||||
|
@UiField Span goApp;
|
||||||
|
|
||||||
public SingleNotificationView(Notification toShow) {
|
public SingleNotificationView(Notification toShow) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
@ -46,7 +47,7 @@ public class SingleNotificationView extends Composite {
|
||||||
String actualHTML = new HTML(removeMarkup).getText();
|
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)) {
|
if (new HTML(actualHTML).getText().equalsIgnoreCase(LINK_TEXT)) {
|
||||||
GWT.log("E' UN LINK!");
|
GWT.log("E' UN LINK!");
|
||||||
actualHTML = actualHTML.replace("your post:", "");
|
actualHTML = actualHTML.replace("your post:", "");
|
||||||
|
@ -63,6 +64,11 @@ public class SingleNotificationView extends Composite {
|
||||||
timeArea.setHTML(DateTimeFormat.getFormat("h:mm a").format(toShow.getTime()));
|
timeArea.setHTML(DateTimeFormat.getFormat("h:mm a").format(toShow.getTime()));
|
||||||
|
|
||||||
notificationImage.setResource(getImageType(toShow.getType()));
|
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) {
|
private ImageResource getImageType(NotificationType type) {
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td valign="TOP">
|
<td valign="TOP">
|
||||||
<c:Span styleName="user-notification" ui:field="notificationText" />
|
<c:Span styleName="user-notification" ui:field="notificationText" />
|
||||||
|
<c:Span styleName="user-notification" ui:field="goApp" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -61,9 +61,10 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No
|
||||||
String sessionID = this.getThreadLocalRequest().getSession().getId();
|
String sessionID = this.getThreadLocalRequest().getSession().getId();
|
||||||
String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE);
|
String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE);
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
_log.warn("USER IS NULL setting test.user and Running OUTSIDE PORTAL");
|
|
||||||
//user = "test.user";
|
//user = "test.user";
|
||||||
user = "massimiliano.assante";
|
user = "pasquale.pagano";
|
||||||
|
|
||||||
|
_log.warn("USER IS NULL setting "+user+" and Running OUTSIDE PORTAL");
|
||||||
withinPortal = false;
|
withinPortal = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue