Managed the event showdatasetevent from the publisher widget
This commit is contained in:
parent
573c0b14de
commit
81a76f51b8
|
@ -45,6 +45,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -113,6 +114,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -181,6 +183,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -249,6 +252,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -323,6 +327,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -391,6 +396,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -459,6 +465,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -527,6 +534,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -168,6 +168,8 @@ public class CkanEventHandlerManager {
|
|||
|
||||
if (addResourceEvent.getDatasetIDorName() != null) {
|
||||
eventBus.fireEvent(new ShowDatasetsEvent(false, addResourceEvent.getDatasetIDorName()));
|
||||
} else {
|
||||
eventBus.fireEvent(new ShowDatasetsEvent(false));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -220,29 +222,6 @@ public class CkanEventHandlerManager {
|
|||
}
|
||||
});
|
||||
|
||||
// eventBus.addHandler(NotifyLogoutEvent.TYPE, new NotifyLogoutEventHandler() {
|
||||
//
|
||||
// @Override
|
||||
// public void onLogout(NotifyLogoutEvent editMetadataEvent) {
|
||||
//
|
||||
// // CKanLeaveFrame frame = new
|
||||
// CKanLeaveFrame(GCubeCkanDataCatalog.CKAN_LOGUT_SERVICE);
|
||||
// // DOM.appendChild(RootPanel.getBodyElement(), frame.getElement());
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// eventBus.addHandler(IFrameInstanciedEvent.TYPE, new
|
||||
// IFrameInstanciedEventHandler() {
|
||||
//
|
||||
// @Override
|
||||
// public void onNewInstance(IFrameInstanciedEvent iFrameInstanciedEvent) {
|
||||
//
|
||||
// gcubeCkanDataCatalogue.updateSize();
|
||||
// if(logoutFromCKANURL==null)
|
||||
// instanceLogoutSystem();
|
||||
// }
|
||||
// });
|
||||
|
||||
eventBus.addHandler(ShowManageProductWidgetEvent.TYPE, new ShowManageProductWidgetEventHandler() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -104,10 +104,6 @@ public class CkanMetadataManagementPanel extends FlowPanel {
|
|||
items.setType(ButtonType.LINK);
|
||||
types.setType(ButtonType.LINK);
|
||||
|
||||
// myDatasets.setType(ButtonType.LINK);
|
||||
//myOrganizations.setType(ButtonType.LINK);
|
||||
// myGroups.setType(ButtonType.LINK);
|
||||
|
||||
statistics.setType(ButtonType.LINK);
|
||||
|
||||
shareLink.setType(ButtonType.LINK);
|
||||
|
@ -121,9 +117,7 @@ public class CkanMetadataManagementPanel extends FlowPanel {
|
|||
manageCModS.setType(ButtonType.PRIMARY);
|
||||
manageCModS.getElement().getStyle().setFloat(Float.RIGHT);
|
||||
manageCModS.getElement().getStyle().setMarginRight(20, Unit.PX);
|
||||
// messageModerationEnanbled.setType(AlertType.INFO);
|
||||
// messageModerationEnanbled.setClose(false);
|
||||
// messageModerationEnanbled.addStyleName("moderation-message");
|
||||
|
||||
messageModerationEnanbled.setTitle(MESSAGE_MODERATED_CATALOGUE);
|
||||
messageModerationEnanbled.getElement().setInnerHTML("<i class='icon-user'></i> " + MESSAGE_MODERATED_CATALOGUE);
|
||||
messageModerationEnanbled.addStyleName("moderation-enabled-flag");
|
||||
|
@ -146,12 +140,16 @@ public class CkanMetadataManagementPanel extends FlowPanel {
|
|||
manageGRSFProduct.setIcon(IconType.CHECK_SIGN);
|
||||
manageCModS.setIcon(IconType.CHECK_SIGN);
|
||||
|
||||
// hide edit and insert
|
||||
// disabling share and upload
|
||||
shareLink.setEnabled(false);
|
||||
uploadToZenodo.setEnabled(false);
|
||||
editMeta.setEnabled(false);
|
||||
deleteItem.setEnabled(false);
|
||||
|
||||
// hide publish/update/delete
|
||||
editMeta.setVisible(false);
|
||||
deleteItem.setVisible(false);
|
||||
insertMeta.setVisible(false);
|
||||
|
||||
//hide manage GRSF product and Moderation
|
||||
manageGRSFProduct.setVisible(false);
|
||||
manageGRSFProduct.setEnabled(false);
|
||||
manageCModS.setVisible(false);
|
||||
|
@ -386,15 +384,17 @@ public class CkanMetadataManagementPanel extends FlowPanel {
|
|||
|
||||
/**
|
||||
* Those buttons can be only visible when the logged user has role
|
||||
* edit/admin/sysadmin.
|
||||
* EDITOR/ADMIN/SYSADMIN
|
||||
*
|
||||
* @param show the show
|
||||
*/
|
||||
public void showInsertAndEditProductButtons(boolean show) {
|
||||
public void visibilityPublishUpdateDeleteButtons(boolean show) {
|
||||
|
||||
// editMeta.setVisible(show); TODO
|
||||
// separatorAdminButtons.setVisible(show);
|
||||
insertMeta.setVisible(show);
|
||||
editMeta.setVisible(show);
|
||||
deleteItem.setVisible(show);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -181,23 +181,23 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
showEditInsertButtons(false);
|
||||
showPublishUpdateDeleteButtons(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(RolesCkanGroupOrOrg result) {
|
||||
switch (result) {
|
||||
case ADMIN:
|
||||
showEditInsertButtons(true);
|
||||
showPublishUpdateDeleteButtons(true);
|
||||
break;
|
||||
case EDITOR:
|
||||
showEditInsertButtons(true);
|
||||
showPublishUpdateDeleteButtons(true);
|
||||
break;
|
||||
case MEMBER:
|
||||
showEditInsertButtons(false);
|
||||
showPublishUpdateDeleteButtons(false);
|
||||
break;
|
||||
default:
|
||||
showEditInsertButtons(false);
|
||||
showPublishUpdateDeleteButtons(false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -415,13 +415,13 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
}
|
||||
|
||||
/**
|
||||
* show or hide edit/insert buttons according to the role.
|
||||
* show or hide the Publish/Update/Delete buttons according to the role.
|
||||
*
|
||||
* @param show the show
|
||||
*/
|
||||
public void showEditInsertButtons(boolean show) {
|
||||
public void showPublishUpdateDeleteButtons(boolean show) {
|
||||
|
||||
managementPanel.showInsertAndEditProductButtons(show);
|
||||
managementPanel.visibilityPublishUpdateDeleteButtons(show);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue