use of org.olat.modules.scorm.ScormMainManager in project openolat by klemens.
the class SCORMCPHandler method copy.
@Override
public RepositoryEntry copy(Identity author, RepositoryEntry source, RepositoryEntry target) {
final ScormMainManager scormManager = ScormMainManager.getInstance();
OLATResource sourceResource = source.getOlatResource();
OLATResource targetResource = target.getOlatResource();
File sourceFileroot = FileResourceManager.getInstance().getFileResourceRootImpl(sourceResource).getBasefile();
File zipRoot = new File(sourceFileroot, FileResourceManager.ZIPDIR);
File targetFileroot = FileResourceManager.getInstance().getFileResourceRootImpl(targetResource).getBasefile();
FileUtils.copyFileToDir(zipRoot, targetFileroot, "add file resource");
// copy packaging info
ScormPackageConfig scormConfig = scormManager.getScormPackageConfig(sourceResource);
if (scormConfig != null) {
scormManager.setScormPackageConfig(targetResource, scormConfig);
}
return target;
}
use of org.olat.modules.scorm.ScormMainManager in project OpenOLAT by OpenOLAT.
the class SCORMCPHandler method copy.
@Override
public RepositoryEntry copy(Identity author, RepositoryEntry source, RepositoryEntry target) {
final ScormMainManager scormManager = ScormMainManager.getInstance();
OLATResource sourceResource = source.getOlatResource();
OLATResource targetResource = target.getOlatResource();
File sourceFileroot = FileResourceManager.getInstance().getFileResourceRootImpl(sourceResource).getBasefile();
File zipRoot = new File(sourceFileroot, FileResourceManager.ZIPDIR);
File targetFileroot = FileResourceManager.getInstance().getFileResourceRootImpl(targetResource).getBasefile();
FileUtils.copyFileToDir(zipRoot, targetFileroot, "add file resource");
// copy packaging info
ScormPackageConfig scormConfig = scormManager.getScormPackageConfig(sourceResource);
if (scormConfig != null) {
scormManager.setScormPackageConfig(targetResource, scormConfig);
}
return target;
}
Aggregations