From 776a6b9bb7bb85b8ab2d0ee9bda208e2809da83b Mon Sep 17 00:00:00 2001 From: cnapagoda Date: Wed, 3 Jun 2015 15:34:53 +0530 Subject: [PATCH] Fix for REGISTRY-2554 - G-Reg support for GC notification --- .../ui/i18n/Resources.properties | 7 + .../registrysubscription-ajaxprocessor.jsp | 11 +- .../handlers/GovernanceEventingHandler.java | 221 +++++++++++++++--- .../PublisherCheckListItemCheckedEvent.java | 51 ++++ .../PublisherCheckListItemUncheckedEvent.java | 51 ++++ .../PublisherLifeCycleStateChangedEvent.java | 51 ++++ .../events/PublisherResourceUpdatedEvent.java | 51 ++++ .../StoreLifeCycleStateChangedEvent.java | 51 ++++ .../events/StoreResourceUpdatedEvent.java | 51 ++++ .../eventing/internal/EventDataHolder.java | 95 ++++++++ ...nanceRegistryEventingServiceComponent.java | 14 +- .../registry/eventing/internal/Utils.java | 94 -------- 12 files changed, 618 insertions(+), 130 deletions(-) create mode 100644 components/governance/org.wso2.carbon.governance.registry.eventing/src/main/java/org/wso2/carbon/governance/registry/eventing/handlers/utils/events/PublisherCheckListItemCheckedEvent.java create mode 100644 components/governance/org.wso2.carbon.governance.registry.eventing/src/main/java/org/wso2/carbon/governance/registry/eventing/handlers/utils/events/PublisherCheckListItemUncheckedEvent.java create mode 100644 components/governance/org.wso2.carbon.governance.registry.eventing/src/main/java/org/wso2/carbon/governance/registry/eventing/handlers/utils/events/PublisherLifeCycleStateChangedEvent.java create mode 100644 components/governance/org.wso2.carbon.governance.registry.eventing/src/main/java/org/wso2/carbon/governance/registry/eventing/handlers/utils/events/PublisherResourceUpdatedEvent.java create mode 100644 components/governance/org.wso2.carbon.governance.registry.eventing/src/main/java/org/wso2/carbon/governance/registry/eventing/handlers/utils/events/StoreLifeCycleStateChangedEvent.java create mode 100644 components/governance/org.wso2.carbon.governance.registry.eventing/src/main/java/org/wso2/carbon/governance/registry/eventing/handlers/utils/events/StoreResourceUpdatedEvent.java create mode 100644 components/governance/org.wso2.carbon.governance.registry.eventing/src/main/java/org/wso2/carbon/governance/registry/eventing/internal/EventDataHolder.java delete mode 100644 components/governance/org.wso2.carbon.governance.registry.eventing/src/main/java/org/wso2/carbon/governance/registry/eventing/internal/Utils.java diff --git a/components/governance/org.wso2.carbon.governance.notifications.ui/src/main/resources/org/wso2/carbon/governance/notifications/ui/i18n/Resources.properties b/components/governance/org.wso2.carbon.governance.notifications.ui/src/main/resources/org/wso2/carbon/governance/notifications/ui/i18n/Resources.properties index 31b8250f1..8cdbe39c8 100644 --- a/components/governance/org.wso2.carbon.governance.notifications.ui/src/main/resources/org/wso2/carbon/governance/notifications/ui/i18n/Resources.properties +++ b/components/governance/org.wso2.carbon.governance.notifications.ui/src/main/resources/org/wso2/carbon/governance/notifications/ui/i18n/Resources.properties @@ -86,3 +86,10 @@ work.list.add.new.notifications=Add Request To Work List work.list.hide=Hide work.list.create=Create work.list.cancel=Cancel + +publisher.checklist.checked=Publisher Checklist Check +publisher.checklist.unchecked=Publisher Checklist Uncheck +publisher.lifecycle.state.changed=Publisher Lifecycle Change +publisher.update=Publisher Update +store.lifecycle.state.changed=Store Lifecycle Change +store.update=Store Update diff --git a/components/governance/org.wso2.carbon.governance.notifications.ui/src/main/resources/web/notifications/registrysubscription-ajaxprocessor.jsp b/components/governance/org.wso2.carbon.governance.notifications.ui/src/main/resources/web/notifications/registrysubscription-ajaxprocessor.jsp index 60665ccd0..baa3b5ab7 100644 --- a/components/governance/org.wso2.carbon.governance.notifications.ui/src/main/resources/web/notifications/registrysubscription-ajaxprocessor.jsp +++ b/components/governance/org.wso2.carbon.governance.notifications.ui/src/main/resources/web/notifications/registrysubscription-ajaxprocessor.jsp @@ -35,6 +35,7 @@ String[] events = null; String[] resourceEventNames = null; String[] collectionEventNames = null; + boolean[] isEventVisible = null; boolean isResource = true; boolean canSubscribeOthers = false; boolean canSubscribeOtherRoles = false; @@ -63,11 +64,17 @@ events = new String[eventTypes.length]; resourceEventNames = new String[eventTypes.length]; collectionEventNames = new String[eventTypes.length]; + isEventVisible = new boolean[eventTypes.length]; for (int i = 0; i < eventTypes.length; i++) { if (eventTypes[i] != null) { events[i] = eventTypes[i].getId(); resourceEventNames[i] = eventTypes[i].getResourceEvent(); collectionEventNames[i] = eventTypes[i].getCollectionEvent(); + if (eventTypes[i].getId().startsWith("publisher") || eventTypes[i].getId().startsWith("store")){ + isEventVisible[i] = false; + } else{ + isEventVisible[i] = true; + } } } if (request.getParameter("path") != null) { @@ -97,7 +104,7 @@ <% for (int i = 0; i < events.length; i++) { if (isResource) { - if (resourceEventNames[i] != null) { + if (resourceEventNames[i] != null && isEventVisible[i]) { %> <% } - } else if (collectionEventNames[i] != null) { + } else if (collectionEventNames[i] != null && isEventVisible[i]) { %>