Managed the event showdatasetevent from the publisher widget
This commit is contained in:
parent
573c0b14de
commit
81a76f51b8
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,7 +68,8 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-module deploy-name="gcube-ckan-datacatalog-2.3.0-SNAPSHOT">
|
<wb-module deploy-name="gcube-ckan-datacatalog-2.3.0-SNAPSHOT">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -135,7 +137,8 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -203,7 +206,8 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -277,7 +281,8 @@
|
||||||
<dependent-module archiveName="ckan-metadata-publisher-widget-2.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-metadata-publisher-widget/ckan-metadata-publisher-widget">
|
<dependent-module archiveName="ckan-metadata-publisher-widget-2.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-metadata-publisher-widget/ckan-metadata-publisher-widget">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -345,7 +350,8 @@
|
||||||
|
|
||||||
|
|
||||||
<property name="context-root" value="gcube-ckan-datacatalog"/>
|
<property name="context-root" value="gcube-ckan-datacatalog"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -413,7 +419,8 @@
|
||||||
|
|
||||||
|
|
||||||
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -481,7 +488,8 @@
|
||||||
|
|
||||||
|
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -168,6 +168,8 @@ public class CkanEventHandlerManager {
|
||||||
|
|
||||||
if (addResourceEvent.getDatasetIDorName() != null) {
|
if (addResourceEvent.getDatasetIDorName() != null) {
|
||||||
eventBus.fireEvent(new ShowDatasetsEvent(false, addResourceEvent.getDatasetIDorName()));
|
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() {
|
eventBus.addHandler(ShowManageProductWidgetEvent.TYPE, new ShowManageProductWidgetEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -104,10 +104,6 @@ public class CkanMetadataManagementPanel extends FlowPanel {
|
||||||
items.setType(ButtonType.LINK);
|
items.setType(ButtonType.LINK);
|
||||||
types.setType(ButtonType.LINK);
|
types.setType(ButtonType.LINK);
|
||||||
|
|
||||||
// myDatasets.setType(ButtonType.LINK);
|
|
||||||
//myOrganizations.setType(ButtonType.LINK);
|
|
||||||
// myGroups.setType(ButtonType.LINK);
|
|
||||||
|
|
||||||
statistics.setType(ButtonType.LINK);
|
statistics.setType(ButtonType.LINK);
|
||||||
|
|
||||||
shareLink.setType(ButtonType.LINK);
|
shareLink.setType(ButtonType.LINK);
|
||||||
|
@ -121,9 +117,7 @@ public class CkanMetadataManagementPanel extends FlowPanel {
|
||||||
manageCModS.setType(ButtonType.PRIMARY);
|
manageCModS.setType(ButtonType.PRIMARY);
|
||||||
manageCModS.getElement().getStyle().setFloat(Float.RIGHT);
|
manageCModS.getElement().getStyle().setFloat(Float.RIGHT);
|
||||||
manageCModS.getElement().getStyle().setMarginRight(20, Unit.PX);
|
manageCModS.getElement().getStyle().setMarginRight(20, Unit.PX);
|
||||||
// messageModerationEnanbled.setType(AlertType.INFO);
|
|
||||||
// messageModerationEnanbled.setClose(false);
|
|
||||||
// messageModerationEnanbled.addStyleName("moderation-message");
|
|
||||||
messageModerationEnanbled.setTitle(MESSAGE_MODERATED_CATALOGUE);
|
messageModerationEnanbled.setTitle(MESSAGE_MODERATED_CATALOGUE);
|
||||||
messageModerationEnanbled.getElement().setInnerHTML("<i class='icon-user'></i> " + MESSAGE_MODERATED_CATALOGUE);
|
messageModerationEnanbled.getElement().setInnerHTML("<i class='icon-user'></i> " + MESSAGE_MODERATED_CATALOGUE);
|
||||||
messageModerationEnanbled.addStyleName("moderation-enabled-flag");
|
messageModerationEnanbled.addStyleName("moderation-enabled-flag");
|
||||||
|
@ -146,12 +140,16 @@ public class CkanMetadataManagementPanel extends FlowPanel {
|
||||||
manageGRSFProduct.setIcon(IconType.CHECK_SIGN);
|
manageGRSFProduct.setIcon(IconType.CHECK_SIGN);
|
||||||
manageCModS.setIcon(IconType.CHECK_SIGN);
|
manageCModS.setIcon(IconType.CHECK_SIGN);
|
||||||
|
|
||||||
// hide edit and insert
|
// disabling share and upload
|
||||||
shareLink.setEnabled(false);
|
shareLink.setEnabled(false);
|
||||||
uploadToZenodo.setEnabled(false);
|
uploadToZenodo.setEnabled(false);
|
||||||
editMeta.setEnabled(false);
|
|
||||||
deleteItem.setEnabled(false);
|
// hide publish/update/delete
|
||||||
|
editMeta.setVisible(false);
|
||||||
|
deleteItem.setVisible(false);
|
||||||
insertMeta.setVisible(false);
|
insertMeta.setVisible(false);
|
||||||
|
|
||||||
|
//hide manage GRSF product and Moderation
|
||||||
manageGRSFProduct.setVisible(false);
|
manageGRSFProduct.setVisible(false);
|
||||||
manageGRSFProduct.setEnabled(false);
|
manageGRSFProduct.setEnabled(false);
|
||||||
manageCModS.setVisible(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
|
* Those buttons can be only visible when the logged user has role
|
||||||
* edit/admin/sysadmin.
|
* EDITOR/ADMIN/SYSADMIN
|
||||||
*
|
*
|
||||||
* @param show the show
|
* @param show the show
|
||||||
*/
|
*/
|
||||||
public void showInsertAndEditProductButtons(boolean show) {
|
public void visibilityPublishUpdateDeleteButtons(boolean show) {
|
||||||
|
|
||||||
// editMeta.setVisible(show); TODO
|
// editMeta.setVisible(show); TODO
|
||||||
// separatorAdminButtons.setVisible(show);
|
// separatorAdminButtons.setVisible(show);
|
||||||
insertMeta.setVisible(show);
|
insertMeta.setVisible(show);
|
||||||
|
editMeta.setVisible(show);
|
||||||
|
deleteItem.setVisible(show);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,23 +181,23 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
showEditInsertButtons(false);
|
showPublishUpdateDeleteButtons(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(RolesCkanGroupOrOrg result) {
|
public void onSuccess(RolesCkanGroupOrOrg result) {
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case ADMIN:
|
case ADMIN:
|
||||||
showEditInsertButtons(true);
|
showPublishUpdateDeleteButtons(true);
|
||||||
break;
|
break;
|
||||||
case EDITOR:
|
case EDITOR:
|
||||||
showEditInsertButtons(true);
|
showPublishUpdateDeleteButtons(true);
|
||||||
break;
|
break;
|
||||||
case MEMBER:
|
case MEMBER:
|
||||||
showEditInsertButtons(false);
|
showPublishUpdateDeleteButtons(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
showEditInsertButtons(false);
|
showPublishUpdateDeleteButtons(false);
|
||||||
break;
|
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
|
* @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