def content_created(content, event): if (content != event.object or IObjectCopiedEvent.providedBy(event) or IVersionedContent.providedBy(content)): return ICataloging(content).index() ChangesTask.get().modified(content, created=True)
def version_created(version, event): if IObjectCopiedEvent.providedBy(event): return created = version == event.object ChangesTask.get().modified(version, created) if created: ICataloging(version).index() ICataloging(version.get_silva_object()).index(with_versions=False)
def index_and_update_author_modified_content(content, event): """A content have been created of modifed. Update its author information. """ # In the same way, we discard event on versioned content if they # are about adding or removing a version. if IVersionedContent.providedBy(content) and IContainerModifiedEvent.providedBy(event): return if getattr(content, "__initialization__", False): return ChangesTask.get().modified(content) ICataloging(content).reindex()
def index_and_update_author_modified_content(content, event): """A content have been created of modifed. Update its author information. """ # In the same way, we discard event on versioned content if they # are about adding or removing a version. if (IVersionedContent.providedBy(content) and IContainerModifiedEvent.providedBy(event)): return if getattr(content, '__initialization__', False): return ChangesTask.get().modified(content) ICataloging(content).reindex()
def version_modified(version, event): if not IPublishingEvent.providedBy(event): # This version have been modified ChangesTask.get().modified(version) ICataloging(version).reindex() ICataloging(version.get_silva_object()).reindex(with_versions=False)
def version_closed(version, event): ChangesTask.get().modified(version) ICataloging(version).unindex() ICataloging(version.get_silva_object()).reindex(with_versions=False)
def content_created(content, event): if content != event.object or IObjectCopiedEvent.providedBy(event) or IVersionedContent.providedBy(content): return ICataloging(content).index() ChangesTask.get().modified(content, created=True)