Search in sources :

Example 1 with VFSLeafButSystemFilter

use of org.olat.core.util.vfs.filters.VFSLeafButSystemFilter in project OpenOLAT by OpenOLAT.

the class OLATUpgrade_12_3_0 method moveDocumentPoolInfosPage.

private boolean moveDocumentPoolInfosPage(UpgradeManager upgradeManager, UpgradeHistoryData uhd) {
    boolean allOk = true;
    if (!uhd.getBooleanDataValue(MOVE_DOC_POOL_INFOS_PAGE)) {
        String path = "/" + TaxonomyService.DIRECTORY + "/" + DocumentPoolModule.INFOS_PAGE_DIRECTORY;
        VFSContainer taxonomyContainer = new OlatRootFolderImpl(path, null);
        VFSContainer documentPoolContainer = documentPoolModule.getInfoPageContainer();
        if (taxonomyContainer.exists() && documentPoolContainer.getItems(new VFSLeafButSystemFilter()).isEmpty() && !taxonomyContainer.getItems(new VFSLeafButSystemFilter()).isEmpty()) {
            VFSManager.copyContent(taxonomyContainer, documentPoolContainer);
            taxonomyContainer.delete();
        }
        uhd.setBooleanDataValue(MOVE_DOC_POOL_INFOS_PAGE, allOk);
        upgradeManager.setUpgradesHistory(uhd, VERSION);
    }
    return allOk;
}
Also used : OlatRootFolderImpl(org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl) VFSLeafButSystemFilter(org.olat.core.util.vfs.filters.VFSLeafButSystemFilter) VFSContainer(org.olat.core.util.vfs.VFSContainer)

Example 2 with VFSLeafButSystemFilter

use of org.olat.core.util.vfs.filters.VFSLeafButSystemFilter in project openolat by klemens.

the class OLATUpgrade_12_3_0 method moveDocumentPoolInfosPage.

private boolean moveDocumentPoolInfosPage(UpgradeManager upgradeManager, UpgradeHistoryData uhd) {
    boolean allOk = true;
    if (!uhd.getBooleanDataValue(MOVE_DOC_POOL_INFOS_PAGE)) {
        String path = "/" + TaxonomyService.DIRECTORY + "/" + DocumentPoolModule.INFOS_PAGE_DIRECTORY;
        VFSContainer taxonomyContainer = new OlatRootFolderImpl(path, null);
        VFSContainer documentPoolContainer = documentPoolModule.getInfoPageContainer();
        if (taxonomyContainer.exists() && documentPoolContainer.getItems(new VFSLeafButSystemFilter()).isEmpty() && !taxonomyContainer.getItems(new VFSLeafButSystemFilter()).isEmpty()) {
            VFSManager.copyContent(taxonomyContainer, documentPoolContainer);
            taxonomyContainer.delete();
        }
        uhd.setBooleanDataValue(MOVE_DOC_POOL_INFOS_PAGE, allOk);
        upgradeManager.setUpgradesHistory(uhd, VERSION);
    }
    return allOk;
}
Also used : OlatRootFolderImpl(org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl) VFSLeafButSystemFilter(org.olat.core.util.vfs.filters.VFSLeafButSystemFilter) VFSContainer(org.olat.core.util.vfs.VFSContainer)

Aggregations

OlatRootFolderImpl (org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2 VFSLeafButSystemFilter (org.olat.core.util.vfs.filters.VFSLeafButSystemFilter)2