mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-01 14:41:46 +00:00
Cherry pick ACS-9665 add event generation extensions (#3593) 280a873cb6
Piotr Żurek <Piotr.Zurek@hyland.com> 26 Sep 2025 at 10:25
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
* Copyright (C) 2005 - 2025 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -94,19 +94,26 @@ public abstract class EventConsolidator<REF extends EntityRef, RES extends Resou
|
|||||||
* @return the {@link RepoEvent} instance
|
* @return the {@link RepoEvent} instance
|
||||||
*/
|
*/
|
||||||
public RepoEvent<DataAttributes<RES>> getRepoEvent(EventInfo eventInfo)
|
public RepoEvent<DataAttributes<RES>> getRepoEvent(EventInfo eventInfo)
|
||||||
|
{
|
||||||
|
final RepoEvent.Builder<DataAttributes<RES>> builder = RepoEvent.builder();
|
||||||
|
|
||||||
|
configureRepoEventBuilder(builder, eventInfo);
|
||||||
|
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void configureRepoEventBuilder(RepoEvent.Builder<DataAttributes<RES>> builder, EventInfo eventInfo)
|
||||||
{
|
{
|
||||||
EventType eventType = getDerivedEvent();
|
EventType eventType = getDerivedEvent();
|
||||||
|
|
||||||
DataAttributes<RES> eventData = buildEventData(eventInfo, resource, eventType);
|
DataAttributes<RES> eventData = buildEventData(eventInfo, resource, eventType);
|
||||||
|
|
||||||
return RepoEvent.<DataAttributes<RES>>builder()
|
builder.setId(eventInfo.getId())
|
||||||
.setId(eventInfo.getId())
|
.setSource(eventInfo.getSource())
|
||||||
.setSource(eventInfo.getSource())
|
.setTime(eventInfo.getTimestamp())
|
||||||
.setTime(eventInfo.getTimestamp())
|
.setType(eventType.getType())
|
||||||
.setType(eventType.getType())
|
.setData(eventData)
|
||||||
.setData(eventData)
|
.setDataschema(EventJSONSchema.getSchemaV1(eventType));
|
||||||
.setDataschema(EventJSONSchema.getSchemaV1(eventType))
|
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user