use of org.marvec.pusher.data.BackupDataEvent in project engine by Lumeer.
the class AbstractContextualTask method createEventForView.
private Event createEventForView(final View view, final String userId, final String suffix) {
final String projectId = daoContextSnapshot.getSelectedWorkspace().getProject().map(Project::getId).orElse("");
final View mappedView = viewAdapter.mapViewData(getDaoContextSnapshot().getOrganization(), getDaoContextSnapshot().getProject(), view.copy(), userId, projectId);
final PusherFacade.ObjectWithParent message = new PusherFacade.ObjectWithParent(getAppId(), mappedView, getDaoContextSnapshot().getOrganizationId(), getDaoContextSnapshot().getProjectId());
injectCorrelationId(message);
return new BackupDataEvent(PusherFacade.PRIVATE_CHANNEL_PREFIX + userId, View.class.getSimpleName() + suffix, message, getResourceId(mappedView, null), null);
}
use of org.marvec.pusher.data.BackupDataEvent in project engine by Lumeer.
the class AbstractContextualTask method createEventForDocument.
private Event createEventForDocument(final Document document, final String userId, final String suffix) {
final String projectId = daoContextSnapshot.getSelectedWorkspace().getProject().map(Project::getId).orElse("");
final Document mappedDocument = documentAdapter.mapDocumentData(new Document(document), userId, projectId);
if (PusherFacade.REMOVE_EVENT_SUFFIX.equals(suffix)) {
return createEventForRemove(Document.class.getSimpleName(), getResourceId(mappedDocument, mappedDocument.getCollectionId()), userId);
}
final PusherFacade.ObjectWithParent message = new PusherFacade.ObjectWithParent(getAppId(), mappedDocument, getDaoContextSnapshot().getOrganizationId(), getDaoContextSnapshot().getProjectId());
injectCorrelationId(message);
return new BackupDataEvent(PusherFacade.PRIVATE_CHANNEL_PREFIX + userId, Document.class.getSimpleName() + suffix, message, getResourceId(mappedDocument, mappedDocument.getCollectionId()), null);
}
use of org.marvec.pusher.data.BackupDataEvent in project engine by Lumeer.
the class AbstractContextualTask method createEventForCollection.
private Event createEventForCollection(final Collection collection, final String userId, final String suffix) {
final String projectId = daoContextSnapshot.getSelectedWorkspace().getProject().map(Project::getId).orElse("");
final Collection mappedCollection = collectionAdapter.mapCollectionComputedProperties(collection.copy(), userId, projectId);
final PusherFacade.ObjectWithParent message = new PusherFacade.ObjectWithParent(getAppId(), mappedCollection, getDaoContextSnapshot().getOrganizationId(), getDaoContextSnapshot().getProjectId());
injectCorrelationId(message);
return new BackupDataEvent(PusherFacade.PRIVATE_CHANNEL_PREFIX + userId, Collection.class.getSimpleName() + suffix, message, getResourceId(mappedCollection, null), null);
}
Aggregations