Skip to content

Commit

Permalink
adobeGH-55 adding asset_created osgi event mapping
Browse files Browse the repository at this point in the history
+ a few other fixes/polishing
  • Loading branch information
francoisledroff committed Mar 28, 2022
1 parent 8567f57 commit 47cb385
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"aio.event.code": "asset_created",
"aio.event.label": "Asset Created",
"aio.event.description": "Asset Created Event",
"aio.xdm.event.type": "com.adobe.xdm.event.AemAssetCreatedEvent",
"osgi.event.handler.type": "com.adobe.aio.aem.event.osgimapping.eventhandler.ResourceEventHandler",
"osgi.topic": "org/apache/sling/api/resource/Resource/ADDED",
"osgi.filter": "(&(resourceType=dam:Asset)(!(event.application=*)))",
"osgi.jcr.path.filter": "/content/dam/"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"aio.event.label": "osgi_ping",
"aio.event.description": "osgi ping event",
"aio.xdm.event.type": "com.adobe.xdm.event.OsgiEmittedEvent",
"osgi.event.handler.type": "com.adobe.io.event.osgi.eventhandler.OsgiEventHandler",
"osgi.event.handler.type": "com.adobe.aio.aem.event.osgimapping.eventhandler.OsgiEventHandler",
"osgi.topic": "aio/adobe/event/ping",
"osgi.filter": "",
"osgi.jcr.path.filter": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ public void registerEventHandler(OsgiEventMapping osgiEventMapping) {
Dictionary props = new Hashtable();
String[] eventTopics = {osgiEventMapping.getOsgiTopic()};
props.put(EventConstants.EVENT_TOPIC, eventTopics);
props.put("aio.event.code",osgiEventMapping.getEventCode());
props.put("aio.event.handler",osgiEventMapping.getEventHandlerType());
props.put("aio.event.path.filter",osgiEventMapping.getPathFilter());
props.put("aio.event.xdm.type",osgiEventMapping.getXdmEventType());
String osgiFilter = osgiEventMapping.getOsgiFilter();
if (null != osgiFilter && !osgiFilter.isEmpty()) {
props.put(EventConstants.EVENT_FILTER, osgiFilter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public @interface OsgiEventMappingConfig {

String EMPTY = "";
String OSGI_EVENT_HANDLER_CLASS_NAME_DEFAULT = "com.adobe.io.event.osgi.eventhandler.OsgiEventHandler";
String OSGI_EVENT_HANDLER_CLASS_NAME_DEFAULT = "com.adobe.aio.aem.event.osgimapping.eventhandler.OsgiEventHandler";
String IO_XDM_EVENT_CLASS_NAME_DEFAULT = "com.adobe.xdm.event.OsgiEmittedEvent";

@AttributeDefinition(name = "Adobe I/O Event Code",
Expand Down

0 comments on commit 47cb385

Please sign in to comment.