Search in sources :

Example 1 with XarInstalledExtensionRepository

use of org.xwiki.extension.xar.internal.repository.XarInstalledExtensionRepository in project xwiki-platform by xwiki.

the class DocumentsDeletingListener method checkIfPageBelongToExtensions.

private void checkIfPageBelongToExtensions(EntitySelection entitySelection, ExtensionBreakingQuestion question) {
    XarInstalledExtensionRepository repository = (XarInstalledExtensionRepository) installedExtensionRepository;
    DocumentReference documentReference = (DocumentReference) entitySelection.getEntityReference();
    Collection<XarInstalledExtension> extensions = repository.getXarInstalledExtensions(documentReference);
    if (extensions.isEmpty()) {
        question.markAsFreePage(entitySelection);
        return;
    }
    for (XarInstalledExtension extension : extensions) {
        question.pageBelongsToExtension(entitySelection, extension);
    }
}
Also used : XarInstalledExtension(org.xwiki.extension.xar.internal.repository.XarInstalledExtension) XarInstalledExtensionRepository(org.xwiki.extension.xar.internal.repository.XarInstalledExtensionRepository) DocumentReference(org.xwiki.model.reference.DocumentReference)

Aggregations

XarInstalledExtension (org.xwiki.extension.xar.internal.repository.XarInstalledExtension)1 XarInstalledExtensionRepository (org.xwiki.extension.xar.internal.repository.XarInstalledExtensionRepository)1 DocumentReference (org.xwiki.model.reference.DocumentReference)1