Added EventListenerPluginInterface

This commit is contained in:
Francesco Mangiacrapa 2024-01-19 11:12:57 +01:00
parent 94bb1b9315
commit b2d48aa780
3 changed files with 26 additions and 5 deletions

View File

@ -1,8 +1,8 @@
gCube CMS Suite : Catalogue Binding Plugin
--------------------------------------------------
This component is expected to contain the "Catalogue Binding Plugin" for binding from
the products registered in the Geoportal system to the D4Science Catalogue system.
The "Catalogue Binding Plugin" implements the binding from
(the products registered in) the Geoportal system to the D4Science Catalogue system.
## Built with
* [gCube SmartGears] (https://gcube.wiki.gcube-system.org/gcube/SmartGears) - The gCube SmartGears framework
@ -14,7 +14,7 @@ the products registered in the Geoportal system to the D4Science Catalogue syste
## Documentation
[gCube CMS Suite](../) parent module containing references, documentation, guides ad utilities.
This plugin requires an handler registered in the UCD so defined:
The "Catalogue Binding Plugin" requires an handler registered in the UCD so defined:
{
"_id": "Catalogue-Binding-Plugin",

View File

@ -8,6 +8,7 @@ import java.util.Map;
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;
@ -36,10 +37,10 @@ import lombok.extern.slf4j.Slf4j;
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jan 17, 2024
* Jan 19, 2024
*/
@Slf4j
public class CatalogueBindingPlugin extends AbstractPlugin implements InitializablePlugin {
public class CatalogueBindingPlugin extends AbstractPlugin implements EventListenerPluginInterface {
public static final PluginDescriptor DESCRIPTOR = new PluginDescriptor(CatalogueBindingPlugin.PLUGIN_ID,
CatalogueBindingPlugin.PLUGIN_TYPE);
@ -98,6 +99,10 @@ public class CatalogueBindingPlugin extends AbstractPlugin implements Initializa
* Jan 17, 2024
*/
/**
* Instantiates a new subscribe events config.
*/
/**
* Instantiates a new subscribe events config.
*/
@ -309,6 +314,12 @@ public class CatalogueBindingPlugin extends AbstractPlugin implements Initializa
}
/**
* Do action.
*
* @param observerd the observerd
*/
@Override
public void doAction(ItemObserved<Project> observerd) {
new BindingAction().doAction(observerd);

View File

@ -0,0 +1,10 @@
package org.gcube.application.cms.plugins;
import org.gcube.application.cms.plugins.events.ItemObserved;
import org.gcube.application.geoportal.common.model.document.Project;
public interface EventListenerPluginInterface extends InitializablePlugin {
public void doAction(ItemObserved<Project> itemObserved);
}