use of org.olat.repository.handlers.RepositoryHandler in project openolat by klemens.
the class WikiCourseNode method importNode.
@Override
public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
if (withReferences && rie.anyExportedPropertiesAvailable()) {
RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(WikiResource.TYPE_NAME);
RepositoryEntry re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(), rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
WikiEditController.setWikiRepoReference(re, getModuleConfiguration());
} else {
WikiEditController.removeWikiReference(getModuleConfiguration());
}
}
use of org.olat.repository.handlers.RepositoryHandler in project openolat by klemens.
the class IQSELFCourseNode method importNode.
@Override
public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
if (withReferences && rie.anyExportedPropertiesAvailable()) {
File file = rie.importGetExportedFile();
RepositoryHandler handlerQTI21 = RepositoryHandlerFactory.getInstance().getRepositoryHandler(ImsQTI21Resource.TYPE_NAME);
RepositoryEntry re;
if (handlerQTI21.acceptImport(file, "repo.zip").isValid()) {
re = handlerQTI21.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(), rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
getModuleConfiguration().set(IQEditController.CONFIG_KEY_TYPE_QTI, IQEditController.CONFIG_VALUE_QTI21);
} else {
RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(TestFileResource.TYPE_NAME);
re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(), rie.getDescription(), false, locale, file, null);
}
IQEditController.setIQReference(re, getModuleConfiguration());
} else {
IQEditController.removeIQReference(getModuleConfiguration());
}
}
use of org.olat.repository.handlers.RepositoryHandler in project openolat by klemens.
the class PodcastCourseNode method importNode.
@Override
public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
if (withReferences) {
RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(PodcastFileResource.TYPE_NAME);
importFeed(handler, importDirectory, owner, locale);
} else {
FeedNodeEditController.removeReference(getModuleConfiguration());
}
}
use of org.olat.repository.handlers.RepositoryHandler in project openolat by klemens.
the class PortfolioCourseNode method importNode.
@Override
public void importNode(File importDirectory, ICourse course, Identity owner, Locale locale, boolean withReferences) {
RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importDirectory, getIdent());
if (withReferences && rie.anyExportedPropertiesAvailable()) {
RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(EPTemplateMapResource.TYPE_NAME);
RepositoryEntry re = handler.importResource(owner, rie.getInitialAuthor(), rie.getDisplayName(), rie.getDescription(), false, locale, rie.importGetExportedFile(), null);
if (re != null) {
EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
PortfolioStructure map = ePFMgr.loadPortfolioStructure(re.getOlatResource());
PortfolioCourseNodeEditController.setReference(re, map, getModuleConfiguration());
} else {
PortfolioCourseNodeEditController.removeReference(getModuleConfiguration());
}
} else {
PortfolioCourseNodeEditController.removeReference(getModuleConfiguration());
}
}
Aggregations