org.nuxeo.ecm.core.event.Event.getName()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(173)

本文整理了Java中org.nuxeo.ecm.core.event.Event.getName()方法的一些代码示例,展示了Event.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getName()方法的具体详情如下:
包路径:org.nuxeo.ecm.core.event.Event
类名称:Event
方法名:getName

Event.getName介绍

[英]Gets the event name.

The name must be unique. It is recommended to use prefixes in the style of java package names to differentiate between similar events that are sent by different components.
[中]获取事件名称。
名称必须是唯一的。建议使用java包名称样式的前缀来区分不同组件发送的类似事件。

代码示例

代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-core

/**
 * Accepts documentCreatedByCopy event.
 */
@Override
public boolean acceptEvent(Event event) {
  return DocumentEventTypes.DOCUMENT_CREATED_BY_COPY.equals(event.getName());
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-imaging-core

@Override
  public boolean acceptEvent(Event event) {
    return UPDATE_PICTURE_VIEW_EVENT.equals(event.getName());
  }
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-event

public List<String> getEventNames() {
    List<String> eventNames = new ArrayList<String>();
    for (Event event : sourceEventBundle) {
      eventNames.add(event.getName());
    }
    return eventNames;
  }
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-event

@Override
public void push(Event event) {
  events.add(event);
  String eventName = event.getName();
  if (eventName != null) {
    eventNames.add(eventName);
  }
}

代码示例来源:origin: acaren-nuxeo-base/acaren-nuxeo-base-core

public void handleEvent(EventBundle events) throws ClientException {
  for (Event event : events) {
    if (DocumentEventTypes.DOCUMENT_UPDATED.equals(event.getName())) {
      setModifiedDocMetaData(event);
    } else if (DocumentEventTypes.DOCUMENT_MOVED.equals(event.getName()) || DocumentEventTypes.DOCUMENT_CREATED_BY_COPY.equals(event.getName())) {
      setMovedDocMetaData(event);
    } // else, ignore
  }
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-imaging-core

@Override
public void handleEvent(EventBundle events) {
  for (Event event : events) {
    if (UPDATE_PICTURE_VIEW_EVENT.equals(event.getName())) {
      handleEvent(event);
    }
  }
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-notification-core

@Override
public boolean acceptEvent(Event event) {
  if (notificationService == null) {
    return false;
  }
  return notificationService.getNotificationEventNames().contains(event.getName());
}

代码示例来源:origin: acaren-nuxeo-base/acaren-nuxeo-base-maintenance

@Override
public void handleEvent(EventBundle events) throws ClientException {
  for (Event event : events) {
    if (AcarenMntConst.CST_EVENT_LIST_FACETED_DOCS.equals(event.getName())) {
      listFacetedDocs(event);
    } else if (AcarenMntConst.CST_EVENT_BUILD_SQL_QUERY_INITIALISE_TOUTATICE.equals(event.getName())) {
      buildSQLQueryInitTTCTable(event);
    } else if (AcarenMntConst.CST_EVENT_BUILD_SQL_QUERY_SET_SPACE_ID.equals(event.getName())) {
      buildSQLQuerySetSpaceID(event);
    }
  }
}

代码示例来源:origin: acaren-nuxeo-base/acaren-nuxeo-base-core

@Override
public void handleEvent(EventBundle events) throws ClientException {
  for (Event event : events) {
    if (GlobalConst.CST_EVENT_PROPAGATE_ORGANISATION_SOURCE.equals(event.getName())) {
      handleEventPropagateOrgSource(event);
    } else if (GlobalConst.CST_EVENT_PROPAGATE_SECTIONS.equals(event.getName())) {
      handleEventPropagateSections(event);
    }
  }
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-tag-core

@Override
  public boolean acceptEvent(Event event) {
    String name = event.getName();
    return DOCUMENT_PROXY_PUBLISHED.equals(name)
        || DOCUMENT_RESTORED.equals(name)
        || DOCUMENT_REMOVED.equals(name)
        || DOCUMENT_TRASHED.equals(name)
        || (LifeCycleConstants.TRANSITION_EVENT.equals(name) && LifeCycleConstants.DELETED_STATE.equals(event.getContext().getProperty(
        LifeCycleConstants.TRANSTION_EVENT_OPTION_TO)));
  }
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-audit-core

@Override
public boolean acceptEvent(Event event) {
  AuditLogger logger = Framework.getService(AuditLogger.class);
  if (logger == null) {
    return false;
  }
  return logger.getAuditableEventNames().contains(event.getName());
}

代码示例来源:origin: org.nuxeo.ecm.automation/nuxeo-automation-core

@Override
public boolean acceptEvent(Event event) {
  EventHandlerRegistry registry = Framework.getService(EventHandlerRegistry.class);
  if (!registry.getPostCommitEventNames().contains(event.getName())) {
    return false;
  }
  List<EventHandler> handlers = registry.getPostCommitEventHandlers(event.getName());
  return registry.acceptEvent(event, handlers);
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-storage-sql-test

@Override
public void handleEvent(Event event) {
  if (DocumentEventTypes.BEFORE_DOC_UPDATE.equals(event.getName())) {
    DocumentEventContext context = (DocumentEventContext) event.getContext();
    DocumentModel doc = context.getSourceDocument();
    if (Boolean.TRUE.equals(doc.getContextData(PERDORM_UPDATE_FLAG))) {
      doc.setPropertyValue("dc:description", "auto" + RANDOM.nextDouble());
    }
  }
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-cache

@Override
  public void handleEvent(Event event) {
    if (event.getName().equals(EVENT)) {
      WorkManager wm = Framework.getService(WorkManager.class);
      wm.schedule(new TransiantStorageGCWork());
    }
  }
}

代码示例来源:origin: org.nuxeo.ecm.routing/nuxeo-routing-core

@Override
public void handleEvent(Event event) {
  if (!EXECUTE_ESCALATION_RULE_EVENT.equals(event.getName())) {
    return;
  }
  RepositoryManager repositoryManager = Framework.getService(RepositoryManager.class);
  for (String repositoryName : repositoryManager.getRepositoryNames()) {
    triggerEsclationRulesExecution(repositoryName);
  }
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core

public void handleEvent(Event event) {
    if (UPDATE_ACE_STATUS_EVENT.equals(event.getName())) {
      WorkManager workManager = Framework.getService(WorkManager.class);
      workManager.schedule(new UpdateACEStatusWork());
    }
  }
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-comment

@Override
public boolean accept(Event event) {
  DocumentEventContext docCtx = (DocumentEventContext) event.getContext();
  if ("documentCreated".equals(event.getName())
      && (docCtx.getSourceDocument().getType().equals("Post") || docCtx.getSourceDocument().getType().equals(
          "Comment"))) {
    return false;
  }
  return true;
}

代码示例来源:origin: org.nuxeo.ecm.automation/nuxeo-automation-core

@Override
public void handleEvent(Event event) {
  if (registry == null) {
    registry = Framework.getService(EventHandlerRegistry.class);
  }
  List<EventHandler> handlers = registry.getEventHandlers(event.getName());
  registry.handleEvent(event, handlers, false);
}

代码示例来源:origin: acaren-nuxeo-base/acaren-nuxeo-base-core

@Override
public void run() throws ClientException {
  DocumentEventContext eventContext = (DocumentEventContext) this.event.getContext();
  String eventName = this.event.getName();
  DocumentModel document = eventContext.getSourceDocument();
  
  run(eventContext, document, eventName);
}

代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-core

/**
 * Changes creator (and creation date) when document is copied.
 */
@Override
public void handleEvent(Event event) throws NuxeoException {
  if (DocumentEventTypes.DOCUMENT_CREATED_BY_COPY.equals(event.getName()) && event.getContext() instanceof DocumentEventContext) {
    DocumentEventContext docCtx = (DocumentEventContext) event.getContext();
    DocumentModel srcDoc = docCtx.getSourceDocument();
    if (ToutaticeDocumentEventListenerHelper.isAlterableDocument(srcDoc) && !block(docCtx)) {
      changeCreationProperties(event, docCtx, srcDoc);
    }
  }
}

相关文章