added notification-plugin in the module
This commit is contained in:
parent
b2d48aa780
commit
cccad98c12
|
@ -27,6 +27,13 @@
|
|||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>gcube-smartgears-bom</artifactId>
|
||||
<version>${gcube-smartgears-bom-version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.application.cms</groupId>
|
||||
<artifactId>cms-plugin-framework</artifactId>
|
||||
<version>${plugin-framework-version}</version>
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.bson.Document;
|
|||
import org.gcube.application.cms.cataloguebinding.doaction.BindingAction;
|
||||
import org.gcube.application.cms.implementations.utils.UserUtils;
|
||||
import org.gcube.application.cms.plugins.EventListenerPluginInterface;
|
||||
import org.gcube.application.cms.plugins.InitializablePlugin;
|
||||
import org.gcube.application.cms.plugins.events.EventListener;
|
||||
import org.gcube.application.cms.plugins.events.EventManager;
|
||||
import org.gcube.application.cms.plugins.events.EventManager.Event;
|
||||
|
|
|
@ -3,28 +3,42 @@ package org.gcube.application.cms.notifications;
|
|||
import org.gcube.application.cms.plugins.implementations.AbstractPlugin;
|
||||
import org.gcube.application.geoportal.common.model.plugins.PluginDescriptor;
|
||||
|
||||
import com.vdurmont.semver4j.Semver;
|
||||
|
||||
public class NotificationsPlugin extends AbstractPlugin {
|
||||
|
||||
public static final PluginDescriptor DESCRIPTOR = new PluginDescriptor(NotificationsPlugin.class.getName(),
|
||||
"Notification");
|
||||
|
||||
@Override
|
||||
public PluginDescriptor getDescriptor() {
|
||||
/*
|
||||
Should basically perform something like
|
||||
curl --location --request POST 'https://api.dev.d4science.org/social-networking-library-ws/rest/2/notifications/catalogue' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJSSklZNEpoNF9qdDdvNm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NzYW50ZSIsImdpdmVuX25hbWUiOiJNYXNzaW1pbGlhbiIsImxvY2FsZSI6ImVuIiwiZmFtaWx5X25hbWUiOiJBc3NhbnRlIiwiZW1haWwiOiJtYXNzaW1pbGlhbm8uYXNzYW50ZUBpc3RpLmNuci5pdCJ9.b7TBRgsW0__3kl2H_ljcL7fSI9I1QaIqQq0Y7S90bWHtkRvmPkPyzWuGq9hhyN1kRg52Ue_3tEEDEkGgtceBEoZ0RAbpppkum7AJvjX6tKHF79k7wpnbxl7ED65VZFk0EazfC2w_n0WvPHQsb67zdwFeZk97G0pbjsVxYUBrhmnEMtXNzmAWaC0cc_-DriE5BBn3DjuWnaxXDxp3DB74YZoJmYR9HYN94c7Y0IV1XZxGFXLZ8V7UTfcJrGqulhF7HU79jd8hccZniam3NEfTZV-knJ4uEnupRHfMLBhnn1MGzxYFPN1xPIPgwiLSvRef7lK2sjI_bi6GAcT0sg5zwA' \
|
||||
--data-raw ' {
|
||||
"idsToNotify" : ["leonardo.candela", "luca.frosini"],
|
||||
"itemId" : "Conversational search dataset with labels",
|
||||
"notifyText" : "published the test item '\''Conversational search dataset with labels'\''",
|
||||
"itemURL" : "https://data.d4science.org/ctlg/ResourceCatalogue/conversational_dataset_with_labels",
|
||||
"idsAsGroup" : false,
|
||||
"type" : "ITEM_PUBLISHED"
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
static {
|
||||
DESCRIPTOR.setVersion(new Semver("1.0.0"));
|
||||
DESCRIPTOR.setDescription("Manage the notification from Geoportal engine");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PluginDescriptor getDescriptor() {
|
||||
|
||||
/*
|
||||
* Should basically perform something like curl --location --request POST
|
||||
* 'https://api.dev.d4science.org/social-networking-library-ws/rest/2/
|
||||
* notifications/catalogue' \ --header 'Content-Type: application/json' \
|
||||
* --header 'Authorization: Bearer
|
||||
* eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA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RfdXNlcm5hbWUiOiJtYXNzaW1pbGlhbm8uYXNzYW50ZSIsImdpdmVuX25hbWUiOiJNYXNzaW1pbGlhbiIsImxvY2FsZSI6ImVuIiwiZmFtaWx5X25hbWUiOiJBc3NhbnRlIiwiZW1haWwiOiJtYXNzaW1pbGlhbm8uYXNzYW50ZUBpc3RpLmNuci5pdCJ9
|
||||
* .
|
||||
* b7TBRgsW0__3kl2H_ljcL7fSI9I1QaIqQq0Y7S90bWHtkRvmPkPyzWuGq9hhyN1kRg52Ue_3tEEDEkGgtceBEoZ0RAbpppkum7AJvjX6tKHF79k7wpnbxl7ED65VZFk0EazfC2w_n0WvPHQsb67zdwFeZk97G0pbjsVxYUBrhmnEMtXNzmAWaC0cc_
|
||||
* -
|
||||
* DriE5BBn3DjuWnaxXDxp3DB74YZoJmYR9HYN94c7Y0IV1XZxGFXLZ8V7UTfcJrGqulhF7HU79jd8hccZniam3NEfTZV
|
||||
* -knJ4uEnupRHfMLBhnn1MGzxYFPN1xPIPgwiLSvRef7lK2sjI_bi6GAcT0sg5zwA' \
|
||||
* --data-raw ' { "idsToNotify" : ["leonardo.candela", "luca.frosini"], "itemId"
|
||||
* : "Conversational search dataset with labels", "notifyText" :
|
||||
* "published the test item '\''Conversational search dataset with labels'\''",
|
||||
* "itemURL" :
|
||||
* "https://data.d4science.org/ctlg/ResourceCatalogue/conversational_dataset_with_labels",
|
||||
* "idsAsGroup" : false, "type" : "ITEM_PUBLISHED" }
|
||||
*/
|
||||
|
||||
return DESCRIPTOR;
|
||||
}
|
||||
}
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -97,8 +97,8 @@
|
|||
<module>default-lc-managers</module>
|
||||
<module>sdi-plugins</module>
|
||||
<module>catalogue-binding-plugin</module>
|
||||
<module>notifications-plugins</module>
|
||||
|
||||
<!-- <module>notifications-plugins</module> -->
|
||||
<!-- <module>dataminer-plugins</module> -->
|
||||
<!-- <module>images-plugin</module> -->
|
||||
<!-- <module>ckan-plugin</module> -->
|
||||
|
|
Loading…
Reference in New Issue