From c56c77c0c854cab4ff49873ec80d39d23da2f0b2 Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Mon, 15 Jun 2015 15:39:45 +0000 Subject: [PATCH] integrated gwt bootstrap 2 for notification settings modal git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/notifications@115398 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 4 +- .settings/org.eclipse.jst.jsp.core.prefs | 3 + .settings/org.eclipse.wst.common.component | 2 +- ....eclipse.wst.common.project.facet.core.xml | 1 + pom.xml | 12 +++- .../view/NotificationSettingsDialog.java | 60 ++++++------------ .../client/view/NotificationsPanel.java | 1 - .../view/templates/CategoryWrapper.java | 2 +- .../view/templates/CategoryWrapper.ui.xml | 8 ++- .../templates/NotificationPreferenceView.java | 2 +- .../NotificationPreferenceView.ui.xml | 17 +++-- .../templates/SingleNotificationView.java | 13 +++- .../templates/images/NotificationImages.java | 3 + .../view/templates/images/table_share.png | Bin 0 -> 744 bytes .../server/NotificationsServiceImpl.java | 15 +++-- .../user/notifications/Notifications.gwt.xml | 3 +- src/main/webapp/Notifications.css | 6 +- .../webapp/conf/categorybytype.properties | 19 +++--- src/main/webapp/conf/descbytype.properties | 5 +- src/main/webapp/conf/labelbytype.properties | 4 ++ 20 files changed, 100 insertions(+), 80 deletions(-) create mode 100644 .settings/org.eclipse.jst.jsp.core.prefs create mode 100644 src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/table_share.png diff --git a/.classpath b/.classpath index 9979f37..b19a0f5 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,6 @@ - + @@ -30,5 +30,5 @@ - + diff --git a/.settings/org.eclipse.jst.jsp.core.prefs b/.settings/org.eclipse.jst.jsp.core.prefs new file mode 100644 index 0000000..3a5c98d --- /dev/null +++ b/.settings/org.eclipse.jst.jsp.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +validateFragments=false +validation.use-project-settings=true diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 2c15b14..ce34fc0 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,5 @@ - + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index c24712e..afd5d47 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -4,4 +4,5 @@ + diff --git a/pom.xml b/pom.xml index be79183..3b6f52d 100644 --- a/pom.xml +++ b/pom.xml @@ -13,12 +13,12 @@ org.gcube.portlets.user notifications war - 1.3.1-SNAPSHOT + 1.4.0-SNAPSHOT gCube Notifications Portlet - 2.5.1 + 2.7.0 distro 1.7 1.7 @@ -42,13 +42,20 @@ com.google.gwt gwt-user + 2.7.0 provided com.google.gwt gwt-servlet + 2.7.0 provided + + com.github.gwtbootstrap + gwt-bootstrap + 2.3.2.0 + com.googlecode.gwtquery gwtquery @@ -85,6 +92,7 @@ org.gcube.core common-scope-maps + compile org.gcube.applicationsupportlayer diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationSettingsDialog.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationSettingsDialog.java index fb7095c..004b4e6 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationSettingsDialog.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationSettingsDialog.java @@ -3,50 +3,36 @@ package org.gcube.portlets.user.notifications.client.view; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; -import java.util.List; -import java.util.TreeMap; import org.gcube.portal.databook.shared.NotificationChannelType; import org.gcube.portal.databook.shared.NotificationType; -import org.gcube.portlets.user.gcubewidgets.client.popup.GCubeDialog; import org.gcube.portlets.user.notifications.client.NotificationsServiceAsync; import org.gcube.portlets.user.notifications.client.view.templates.CategoryWrapper; -import org.gcube.portlets.user.notifications.client.view.templates.NotificationPreferenceView; import org.gcube.portlets.user.notifications.shared.NotificationPreference; - +import com.github.gwtbootstrap.client.ui.Modal; +import com.github.gwtbootstrap.client.ui.ModalFooter; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.user.client.DOM; -import com.google.gwt.user.client.Timer; -import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; -import com.google.gwt.user.client.ui.Button; -import com.google.gwt.user.client.ui.CheckBox; +import com.github.gwtbootstrap.client.ui.Button; +import com.github.gwtbootstrap.client.ui.constants.ButtonType; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HasAlignment; -import com.google.gwt.user.client.ui.HasHorizontalAlignment; import com.google.gwt.user.client.ui.HasVerticalAlignment; -import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.Image; -import com.google.gwt.user.client.ui.Label; -import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.VerticalPanel; -import com.google.gwt.user.client.ui.Widget; /** * @author Massimiliano Assante ISTI-CNR * */ -public class NotificationSettingsDialog extends GCubeDialog { +public class NotificationSettingsDialog extends Modal { private VerticalPanel mainPanel = new VerticalPanel(); - private VerticalPanel container = new VerticalPanel(); - private HorizontalPanel buttonsContainerPanel = new HorizontalPanel(); - private HorizontalPanel buttonsPanel = new HorizontalPanel(); public static final String loading = GWT.getModuleBaseURL() + "../images/feeds-loader.gif"; public static final String mailSentOK = GWT.getModuleBaseURL() + "../images/yes.png"; @@ -59,32 +45,22 @@ public class NotificationSettingsDialog extends GCubeDialog { public NotificationSettingsDialog(LinkedHashMap> preferences, final NotificationsServiceAsync notificationService) { super(); - ScrollPanel scroller = new ScrollPanel(); - scroller.setWidth("890px"); - scroller.setHeight("500px"); - buttonsPanel.setWidth("100%"); - buttonsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); - - container.setStyleName("user-notification"); - container.setWidth("850px"); - + setAnimation(true); + //container.setStyleName("user-notification"); + setWidth(950); for (String category : preferences.keySet()) { CategoryWrapper cat = new CategoryWrapper(category, preferences.get(category)); - container.add(cat); + add(cat); myCategories.add(cat); } - buttonsContainerPanel.add(cancel); - buttonsContainerPanel.add(save); - buttonsPanel.add(buttonsContainerPanel); - //container.add(buttonsPanel); - - - setText("Notification Settings"); - scroller.add(container); - mainPanel.add(scroller); - mainPanel.add(buttonsPanel); - setWidget(mainPanel); + setTitle("Notification Settings"); + + ModalFooter footer = new ModalFooter(); + save.setType(ButtonType.PRIMARY); + footer.add(save); + footer.add(cancel); + add(footer); save.addClickHandler(new ClickHandler() { @Override @@ -126,12 +102,12 @@ public class NotificationSettingsDialog extends GCubeDialog { mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); if (success) { - setText("Notifications Settings Saved"); + setTitle("Notifications Settings Saved"); mainPanel.add(new HTML("Notifications Settings correctly saved.")); mainPanel.add(new Image(mailSentOK)); } else { - setText("Notifications Settings Saving Error"); + setTitle("Notifications Settings Saving Error"); mainPanel.add(new Image(mailSentNOK)); mainPanel.add(new HTML("There were problems contacting the server, please try again in a short while.")); Button close = new Button("Close"); diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationsPanel.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationsPanel.java index 7b9f32a..c3f5dbb 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationsPanel.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/NotificationsPanel.java @@ -107,7 +107,6 @@ public class NotificationsPanel extends Composite { @Override public void onSuccess(LinkedHashMap> result) { NotificationSettingsDialog dlg = new NotificationSettingsDialog(result, notificationService); - dlg.center(); dlg.show(); showSettingsLoader(false); } diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/CategoryWrapper.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/CategoryWrapper.java index 35d7ce7..111626e 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/CategoryWrapper.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/CategoryWrapper.java @@ -16,7 +16,7 @@ import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.CheckBox; +import com.github.gwtbootstrap.client.ui.CheckBox; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Widget; diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/CategoryWrapper.ui.xml b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/CategoryWrapper.ui.xml index 372f145..004853e 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/CategoryWrapper.ui.xml +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/CategoryWrapper.ui.xml @@ -2,7 +2,7 @@ + xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" xmlns:g="urn:import:com.google.gwt.user.client.ui">
@@ -10,8 +10,10 @@ +
- Portal - Email + Portal + + Email diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/NotificationPreferenceView.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/NotificationPreferenceView.java index 1b976d0..f20490d 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/NotificationPreferenceView.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/NotificationPreferenceView.java @@ -15,7 +15,7 @@ import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.CheckBox; +import com.github.gwtbootstrap.client.ui.CheckBox; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/NotificationPreferenceView.ui.xml b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/NotificationPreferenceView.ui.xml index 9fda583..c0fb131 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/NotificationPreferenceView.ui.xml +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/NotificationPreferenceView.ui.xml @@ -1,18 +1,23 @@ + xmlns:w="urn:import:org.gcube.portlets.widgets.switchbutton.client" + xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" xmlns:g="urn:import:com.google.gwt.user.client.ui"> - + +
- Portal - Email - + + Portal + + Email + + 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 0372c4c..43857c7 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 @@ -117,6 +117,13 @@ public class SingleNotificationView extends Composite { case CALENDAR_DELETED_EVENT: goApp.setHTML(" Go to Calendar."); break; + case TDM_TAB_RESOURCE_SHARE: + goApp.setHTML(" See this Tabular Resource."); + break; + case TDM_RULE_SHARE: + case TDM_TEMPLATE_SHARE: + goApp.setHTML(" Go to Tabular Data Manager."); + break; } } @@ -168,7 +175,11 @@ public class SingleNotificationView extends Composite { case CALENDAR_DELETED_EVENT: return images.calendarDelete(); case POST_ALERT: - return images.postAlert(); + return images.postAlert(); + case TDM_TAB_RESOURCE_SHARE: + case TDM_RULE_SHARE: + case TDM_TEMPLATE_SHARE: + return images.tableShare(); 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 dc77208..54b948f 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 @@ -57,4 +57,7 @@ public interface NotificationImages extends ClientBundle { @Source("notification-generic.png") ImageResource generic(); + + @Source("table_share.png") + ImageResource tableShare(); } diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/table_share.png b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/images/table_share.png new file mode 100644 index 0000000000000000000000000000000000000000..1d90b4587ba840fba4294e1d26e5626eabcf4632 GIT binary patch literal 744 zcmVP);zKvX_ylm+cV6SpkY9V^{5sWHTbF)qaz-4PN@T$zC11Qi7$5H$hpCs?Qu zbUH1QlId?|>U$Ha=tdJ>a&zasbMCpH_lC*m^VrW~x(5egsjdBez%U--s{bQ)lO%t_ znQLmGD#~8q(Bt9Zk$**B@cFJ#&&jgr6BF<>U(~WVateYQJi>E#FcUlsgR>V4 zfxxdJlI*(vqA$=@RM@WzLL6T2DFg_iv2+L0_BNE1gmOItN4*UtkdXNF40=`v6SCNR zF#_xQWLalX)WGpPk90Z%Ns^FECdqJQd?i965urUEtg1q_&4$j?Js5rX04**Tj=5TK zvg2m^)7zInb7r#{F>(VYlL>ym|3?)+F!Nhm*oa24I6tplaihb58f#U0 z>FwkyzaHYnRQ@G-A&nyKtE6P}E*a#HHcLwAse{K-S=rQn#%;AbTFix;S`97<3)8Qn zVm$VKDuU5s17_$Gv(b2BI$~-1I*FBb+0aUa2J|fI3j&IY)z@nnd$WeAU2cZi@9+Fm afB^vXOI8Y^oj6_q0000 " + propertyfile); return null; } } @@ -305,7 +306,7 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No try { ServletContext servletContext = getServletContext(); String contextPath = servletContext.getRealPath(File.separator); - String propertyfile = contextPath + "conf" + File.separator + TYPE_DESCRIPTIONS_FILENAME; + String propertyfile = contextPath + File.separator +"conf" + File.separator + TYPE_DESCRIPTIONS_FILENAME; File propsFile = new File(propertyfile); FileInputStream fis = new FileInputStream(propsFile); props.load( fis); diff --git a/src/main/resources/org/gcube/portlets/user/notifications/Notifications.gwt.xml b/src/main/resources/org/gcube/portlets/user/notifications/Notifications.gwt.xml index 5471073..01fc0e5 100644 --- a/src/main/resources/org/gcube/portlets/user/notifications/Notifications.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/notifications/Notifications.gwt.xml @@ -3,11 +3,12 @@ - + + diff --git a/src/main/webapp/Notifications.css b/src/main/webapp/Notifications.css index 51fd301..c7f348f 100644 --- a/src/main/webapp/Notifications.css +++ b/src/main/webapp/Notifications.css @@ -78,9 +78,9 @@ a.link:hover { } .single-notification-table { - width: 100%; + width: 920px; padding: 5px; - border-top: 1px solid #EFEFEF; + border-bottom: 1px solid #EFEFEF; } @@ -98,7 +98,7 @@ a.link:hover { .notification-photo { display: block; padding: 2px; - border: 1px solid #E6E6E6; + border: none; } .user-notification-time { diff --git a/src/main/webapp/conf/categorybytype.properties b/src/main/webapp/conf/categorybytype.properties index 3c9d8ec..c5d35c3 100644 --- a/src/main/webapp/conf/categorybytype.properties +++ b/src/main/webapp/conf/categorybytype.properties @@ -1,10 +1,13 @@ -DOCUMENT_WORKFLOW_EDIT=Document Workflow -DOCUMENT_WORKFLOW_VIEW=Document Workflow -DOCUMENT_WORKFLOW_STEP_REQUEST_TASK=Document Workflow -DOCUMENT_WORKFLOW_FIRST_STEP_REQUEST_INVOLVMENT=Document Workflow -DOCUMENT_WORKFLOW_USER_FORWARD_TO_OWNER=Document Workflow -DOCUMENT_WORKFLOW_FORWARD_STEP_COMPLETED_OWNER=Document Workflow -DOCUMENT_WORKFLOW_STEP_FORWARD_PEER=Document Workflow +DOCUMENT_WORKFLOW_EDIT=Application: Document Workflow +DOCUMENT_WORKFLOW_VIEW=Application: Document Workflow +DOCUMENT_WORKFLOW_STEP_REQUEST_TASK=Application: Document Workflow +DOCUMENT_WORKFLOW_FIRST_STEP_REQUEST_INVOLVMENT=Application: Document Workflow +DOCUMENT_WORKFLOW_USER_FORWARD_TO_OWNER=Application: Document Workflow +DOCUMENT_WORKFLOW_FORWARD_STEP_COMPLETED_OWNER=Application: Document Workflow +DOCUMENT_WORKFLOW_STEP_FORWARD_PEER=Application: Document Workflow +TDM_TAB_RESOURCE_SHARE=Application: Tabular Data Manager +TDM_RULE_SHARE=Application: Tabular Data Manager +TDM_TEMPLATE_SHARE=Application: Tabular Data Manager WP_FOLDER_SHARE=Workspace Sharing WP_FOLDER_UNSHARE=Workspace Sharing WP_ADMIN_UPGRADE=Workspace Sharing @@ -24,4 +27,4 @@ MESSAGE=Social Networking POST_ALERT=Social Networking CALENDAR_ADDED_EVENT=Shared Calendars CALENDAR_UPDATED_EVENT=Shared Calendars -CALENDAR_DELETED_EVENT=Shared Calendars \ No newline at end of file +CALENDAR_DELETED_EVENT=Shared Calendars diff --git a/src/main/webapp/conf/descbytype.properties b/src/main/webapp/conf/descbytype.properties index a9dc398..ee69bde 100644 --- a/src/main/webapp/conf/descbytype.properties +++ b/src/main/webapp/conf/descbytype.properties @@ -24,4 +24,7 @@ DOCUMENT_WORKFLOW_FORWARD_STEP_COMPLETED_OWNER=A document workflow you created w DOCUMENT_WORKFLOW_STEP_FORWARD_PEER=Someone completed his task on a document workflow where you still need to do yours CALENDAR_ADDED_EVENT=Someone added a new event in one of your shared calendars CALENDAR_UPDATED_EVENT=Someone edited an event in one of your shared calendars -CALENDAR_DELETED_EVENT=Someone deleted an event in one of your shared calendars \ No newline at end of file +CALENDAR_DELETED_EVENT=Someone deleted an event in one of your shared calendars +TDM_TAB_RESOURCE_SHARE=Sharing of Tabular Resources with you +TDM_RULE_SHARE=Sharing of Tabular Data Manager Rules with you +TDM_TEMPLATE_SHARE=Sharing of Tabular Data Manager Templates with you \ No newline at end of file diff --git a/src/main/webapp/conf/labelbytype.properties b/src/main/webapp/conf/labelbytype.properties index 0b1a547..f79fe84 100644 --- a/src/main/webapp/conf/labelbytype.properties +++ b/src/main/webapp/conf/labelbytype.properties @@ -18,6 +18,9 @@ POST_ALERT=Post Alerts CALENDAR_ADDED_EVENT=Added events CALENDAR_UPDATED_EVENT=Edited events CALENDAR_DELETED_EVENT=Deleted events +TDM_TAB_RESOURCE_SHARE=Shared Tabular Resource +TDM_RULE_SHARE=Shared Tabular Data Manager Rule +TDM_TEMPLATE_SHARE=Shared Tabular Data Manager Template DOCUMENT_WORKFLOW_EDIT=Edit DOCUMENT_WORKFLOW_VIEW=View DOCUMENT_WORKFLOW_STEP_REQUEST_TASK=Task request @@ -25,3 +28,4 @@ DOCUMENT_WORKFLOW_FIRST_STEP_REQUEST_INVOLVMENT=Involvement request DOCUMENT_WORKFLOW_USER_FORWARD_TO_OWNER=Forward DOCUMENT_WORKFLOW_FORWARD_STEP_COMPLETED_OWNER=Step completed DOCUMENT_WORKFLOW_STEP_FORWARD_PEER=Forward from peer +