Search in sources :

Example 6 with EPStructureManager

use of org.olat.portfolio.manager.EPStructureManager in project OpenOLAT by OpenOLAT.

the class PortfolioCourseNode method getReferencedRepositoryEntry.

@Override
public RepositoryEntry getReferencedRepositoryEntry() {
    Object repoSoftkey = getModuleConfiguration().get(PortfolioCourseNodeConfiguration.REPO_SOFT_KEY);
    if (repoSoftkey instanceof String) {
        RepositoryManager rm = RepositoryManager.getInstance();
        RepositoryEntry entry = rm.lookupRepositoryEntryBySoftkey((String) repoSoftkey, false);
        if (entry != null) {
            return entry;
        }
    }
    Long mapKey = (Long) getModuleConfiguration().get(PortfolioCourseNodeConfiguration.MAP_KEY);
    if (mapKey != null) {
        EPStructureManager eSTMgr = (EPStructureManager) CoreSpringFactory.getBean("epStructureManager");
        RepositoryEntry re = eSTMgr.loadPortfolioRepositoryEntryByMapKey(mapKey);
        return re;
    }
    return null;
}
Also used : RepositoryManager(org.olat.repository.RepositoryManager) RepositoryEntry(org.olat.repository.RepositoryEntry) EPStructureManager(org.olat.portfolio.manager.EPStructureManager)

Example 7 with EPStructureManager

use of org.olat.portfolio.manager.EPStructureManager in project openolat by klemens.

the class PortfolioHandler method importResource.

@Override
public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description, boolean withReferences, Locale locale, File file, String filename) {
    EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
    EPStructureManager eSTMgr = CoreSpringFactory.getImpl(EPStructureManager.class);
    RepositoryEntry re = null;
    PortfolioStructure structure = EPXStreamHandler.getAsObject(file, false);
    if (structure != null) {
        OLATResource resource = eSTMgr.createPortfolioMapTemplateResource();
        re = CoreSpringFactory.getImpl(RepositoryService.class).create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS);
        ePFMgr.importPortfolioMapTemplate(structure, resource);
    }
    return re;
}
Also used : PortfolioStructure(org.olat.portfolio.model.structel.PortfolioStructure) OLATResource(org.olat.resource.OLATResource) RepositoryEntry(org.olat.repository.RepositoryEntry) EPFrontendManager(org.olat.portfolio.manager.EPFrontendManager) EPStructureManager(org.olat.portfolio.manager.EPStructureManager)

Example 8 with EPStructureManager

use of org.olat.portfolio.manager.EPStructureManager in project openolat by klemens.

the class PortfolioCourseNode method getReferencedRepositoryEntry.

@Override
public RepositoryEntry getReferencedRepositoryEntry() {
    Object repoSoftkey = getModuleConfiguration().get(PortfolioCourseNodeConfiguration.REPO_SOFT_KEY);
    if (repoSoftkey instanceof String) {
        RepositoryManager rm = RepositoryManager.getInstance();
        RepositoryEntry entry = rm.lookupRepositoryEntryBySoftkey((String) repoSoftkey, false);
        if (entry != null) {
            return entry;
        }
    }
    Long mapKey = (Long) getModuleConfiguration().get(PortfolioCourseNodeConfiguration.MAP_KEY);
    if (mapKey != null) {
        EPStructureManager eSTMgr = (EPStructureManager) CoreSpringFactory.getBean("epStructureManager");
        RepositoryEntry re = eSTMgr.loadPortfolioRepositoryEntryByMapKey(mapKey);
        return re;
    }
    return null;
}
Also used : RepositoryManager(org.olat.repository.RepositoryManager) RepositoryEntry(org.olat.repository.RepositoryEntry) EPStructureManager(org.olat.portfolio.manager.EPStructureManager)

Aggregations

EPStructureManager (org.olat.portfolio.manager.EPStructureManager)8 RepositoryEntry (org.olat.repository.RepositoryEntry)8 EPFrontendManager (org.olat.portfolio.manager.EPFrontendManager)4 OLATResource (org.olat.resource.OLATResource)4 Translator (org.olat.core.gui.translator.Translator)2 ModuleConfiguration (org.olat.modules.ModuleConfiguration)2 PortfolioStructure (org.olat.portfolio.model.structel.PortfolioStructure)2 PortfolioStructureMap (org.olat.portfolio.model.structel.PortfolioStructureMap)2 RepositoryManager (org.olat.repository.RepositoryManager)2 RepositoryService (org.olat.repository.RepositoryService)2