@param Node  $node
@param Event $event
@param Pbjx  $pbjx

@return PublishNode
181915
protected function createPublishNode(Node $node, Event $event, Pbjx $pbjx): PublishNode
    {
        $curie = $node::schema()->getCurie();
        $commandCurie = "{$curie->getVendor()}:{$curie->getPackage()}:command:publish-{$curie->getMessage()}";

        /** @var PublishNode $class */
        $class = MessageResolver::resolveCurie(SchemaCurie::fromString($commandCurie));
        return $class::create();
    }
132756
void publishOsgiEvent(org.osgi.service.event.Event event, boolean async) {
        String topic = event.getTopic();
        com.ibm.websphere.event.Event e = createEvent(topic);
        for (String key : event.getPropertyNames()) {
            e.setProperty(key, event.getProperty(key));
        }
        publishEvent(e, async);
    }
413681
protected function handle(GetAllAppsRequest $request, Pbjx $pbjx): GetAllAppsResponse
    {
        $apps = [];
        /** @var Schema $schema */
        foreach (AppV1Mixin::findAll() as $schema) {
            $this->ncr->pipeNodes($schema->getQName(), function (Node $node) use (&$apps) {
                $apps[] = $node;
            }, $this->createNcrContext($request));
        }

        return $this->createGetAllAppsResponse($request, $pbjx)->addToList('nodes', $apps);
    }
1004265
@Subscribe
    public void publishJCREvent(final FedoraEvent fedoraEvent) throws JMSException {
        LOGGER.debug("Received an event from the internal bus.");
        final Message tm =
                eventFactory.getMessage(fedoraEvent, jmsSession);
        LOGGER.debug("Transformed the event to a JMS message.");
        producer.send(tm);

        LOGGER.debug("Put event: {} onto JMS.", tm.getJMSMessageID());
    }
180119
private static void publishEvent(String event, SiteNode node) {
		ZAP.getEventBus().publishSyncEvent(SiteMapEventPublisher.getPublisher(), new Event(SiteMapEventPublisher.getPublisher(), event, new Target(node)));
	}
384781
protected function createSearchNodesResponse(SearchNodesRequest $request, Pbjx $pbjx): SearchNodesResponse
    {
        /** @var SearchNodesResponse $response */
        $response = $this->createResponseFromRequest($request, $pbjx);
        return $response;
    }
1038504
function publishEvent( channelName, eventObj ) {
  var broker = getEventBroker( 'main' )
  eventObj.channel = channelName
  broker.publish( eventObj ); 
}
1276900
protected function createNodeScheduled(PublishNode $command, Pbjx $pbjx): NodeScheduled
    {
        /** @var NodeScheduled $event */
        $event = $this->createEventFromCommand($command, 'scheduled');
        return $event;
    }
545128
public function updateEventsAfterPublish()
    {
        if (!$this->eventEmittingService->isEnabled()) {
            return;
        }

        /** @var $entityManager EntityManager */
        $entityManager = $this->entityManager;

        foreach ($this->scheduledNodeEventUpdates as $documentPublish) {
            /* @var $nodeEvent NodeEvent */
            $nodeEvent = $this->eventEmittingService->emit(self::DOCUMENT_PUBLISHED, [], NodeEvent::class);
            $nodeEvent->setNode($documentPublish['documentNode']);
            $nodeEvent->setWorkspaceName($documentPublish['targetWorkspace']);
            $this->persistenceManager->whitelistObject($nodeEvent);
            $this->persistenceManager->persistAll(true);

            $parentEventIdentifier = $this->persistenceManager->getIdentifierByObject($nodeEvent);

            $qb = $entityManager->createQueryBuilder();
            $qb->update(NodeEvent::class, 'e')
                ->set('e.parentEvent', ':parentEventIdentifier')
                ->setParameter('parentEventIdentifier', $parentEventIdentifier)
                ->where('e.parentEvent IS NULL')
                ->andWhere('e.workspaceName = :workspaceName')
                ->setParameter('workspaceName', $documentPublish['workspaceName'])
                ->andWhere('e.documentNodeIdentifier = :documentNodeIdentifier')
                ->setParameter('documentNodeIdentifier', $documentPublish['documentNode']->getIdentifier())
                ->andWhere('e.eventType != :publishedEventType')
                ->setParameter('publishedEventType', self::DOCUMENT_PUBLISHED)
                ->getQuery()->execute();
        }

        $this->scheduledNodeEventUpdates = [];
    }
635665
protected function createGetEventsResponse(GetEventsRequest $request, Pbjx $pbjx): GetEventsResponse
    {
        /** @var GetEventsResponse $response */
        $response = $this->createResponseFromRequest($request, $pbjx);
        return $response;
    }
1373084
function onPublish( $object, $nodes  )
    {
        $dataType = $this->dataType();
        if ( $dataType )
            $dataType->onPublish( $this, $object, $nodes );
    }
462307
private void publishEvent(WSJobExecution jobEx, String topicToPublish, String correlationId) {
        if (eventsPublisher != null) {
            eventsPublisher.publishJobExecutionEvent(jobEx, topicToPublish, correlationId);
        }
    }
1206588
function(node) {
            var instance = this,
                pjaxselectionCont = Y.one('.pjaxselection'),
                pjaxselectionButtons = pjaxselectionCont.all('button');

            pjaxselectionCont.delegate(
                'click',
                function(e) {
                    var btn = e.currentTarget,
                        pjaxtype;
                    pjaxselectionButtons.removeClass(PURE_BUTTON_ACTIVE);
                    btn.addClass(PURE_BUTTON_ACTIVE);
                    pjaxtype = btn.getAttribute('data-pjaxtype');
                    switch (pjaxtype) {
                        case '0':
                            instance.switchAttribute(false);
                        break;
                        case '1':
                            instance.switchAttribute(true);
                            instance.allAnchor.removeAttribute('data-pjax-cache');
                        break;
                        case '2':
                            instance.switchAttribute(true);
                            instance.allAnchor.setAttribute('data-pjax-cache', true);
                        break;
                    }
                    Y.soon(Y.bind(instance.refreshCodedescription, instance));
                },
                'button'
            );
        }
940914
public function addEventListener(EventListenerInterface $eventListener, string $payloadName): EventPublisher
    {
        $this->eventListeners[$payloadName][] = $eventListener;

        return $this;
    }
1026401
protected function createNodeMarkedAsDraft(MarkNodeAsDraft $command, Pbjx $pbjx): NodeMarkedAsDraft
    {
        /** @var NodeMarkedAsDraft $event */
        $event = $this->createEventFromCommand($command, 'marked-as-draft');
        return $event;
    }
1020278
private function handleEvent(Envelope $envelope, Request $request, Event $event): Envelope
    {
        try {
            $this->pbjx->publish($event);
        } catch (\Throwable $e) {
            return $this->handleException($envelope, $request, $event, $e);
        }

        $envelope
            ->set('code', Code::OK)
            ->set('http_code', HttpCode::HTTP_ACCEPTED())
            ->set('message_ref', $event->generateMessageRef());

        if ($request->attributes->getBoolean('pbjx_console')) {
            $envelope->set('message', $event);
        }

        return $envelope;
    }
803534
private function checkPublishSlaves(ElementVersion $elementVersion, TreeNodeInterface $node, Teaser $teaser = null, $language)
    {
        $publishSlaves = ['elements' => [], 'languages' => []];

        if ($elementVersion->getElement()->getMasterLanguage() !== $language) {
            return $publishSlaves;
        }

        foreach ($this->availableLanguages as $slaveLanguage) {
            if ($language === $slaveLanguage) {
                continue;
            }

            if ($teaser) {
                if ($this->teaserManager->isPublished($teaser, $slaveLanguage)) {
                    if (!$this->teaserManager->isAsync($teaser, $slaveLanguage)) {
                        $publishSlaves['languages'][] = $slaveLanguage;
                    } else {
                        $publishSlaves['elements'][] = [$teaser->getId(), $slaveLanguage, $elementVersion->getVersion(), 'async', 1];
                    }
                }
                // TODO: needed?
                /*
                } else {
                    if ($this->container->getParameter(
                        'phlexible_element.publish.cross_language_publish_offline'
                    )
                    ) {
                        $publishSlaves[] = array($teaser->getId(), $slaveLanguage, 0, '', 0);
                    }
                */
            } else {
                if ($node->getTree()->isPublished($node, $slaveLanguage)) {
                    if (!$node->getTree()->isAsync($node, $slaveLanguage)) {
                        $publishSlaves['languages'][] = $slaveLanguage;
                    } else {
                        $publishSlaves['elements'][] = [$node->getId(), $slaveLanguage, $elementVersion->getVersion(), 'async', 1];
                    }
                }
                // TODO: needed?
                /*
                } else {
                    if ($this->container->getParameter('phlexible_element.publish.cross_language_publish_offline')) {
                        $publishSlaves[] = array($node->getId(), $slaveLanguage, $newVersion, '', 0);
                    }
                */
            }
        }

        return $publishSlaves;
    }