use of org.olat.portfolio.manager.EPFrontendManager in project OpenOLAT by OpenOLAT.
the class PortfolioHandler method readyToDelete.
@Override
public boolean readyToDelete(RepositoryEntry entry, Identity identity, Roles roles, Locale locale, ErrorList errors) {
EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
PortfolioStructure map = ePFMgr.loadPortfolioStructure(entry.getOlatResource());
if (map instanceof EPStructuredMapTemplate) {
EPStructuredMapTemplate exercise = (EPStructuredMapTemplate) map;
if (ePFMgr.isTemplateInUse(exercise, null, null, null)) {
return false;
}
}
ReferenceManager refM = CoreSpringFactory.getImpl(ReferenceManager.class);
String referencesSummary = refM.getReferencesToSummary(entry.getOlatResource(), locale);
if (referencesSummary != null) {
Translator translator = Util.createPackageTranslator(RepositoryManager.class, locale);
errors.setError(translator.translate("details.delete.error.references", new String[] { referencesSummary, entry.getDisplayname() }));
return false;
}
return true;
}
use of org.olat.portfolio.manager.EPFrontendManager in project OpenOLAT by OpenOLAT.
the class EfficiencyStatementArtefactHandler method createDetailsController.
@Override
public Controller createDetailsController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact, boolean readOnlyMode) {
EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
String statementXml = ePFMgr.getArtefactFullTextContent(artefact);
EfficiencyStatement statement = null;
if (StringHelper.containsNonWhitespace(statementXml)) {
try {
statement = (EfficiencyStatement) myXStream.fromXML(statementXml);
} catch (Exception e) {
log.error("Cannot load efficiency statement from artefact", e);
}
}
CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(wControl, ureq, statement);
return new LayoutMain3ColsController(ureq, wControl, efficiencyCtrl);
}
use of org.olat.portfolio.manager.EPFrontendManager 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;
}
use of org.olat.portfolio.manager.EPFrontendManager in project openolat by klemens.
the class PortfolioHandler method copy.
@Override
public RepositoryEntry copy(Identity author, RepositoryEntry source, RepositoryEntry target) {
OLATResource sourceResource = source.getOlatResource();
OLATResource targetResource = target.getOlatResource();
EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
PortfolioStructure structure = ePFMgr.loadPortfolioStructure(sourceResource);
PortfolioStructure newStructure = EPXStreamHandler.copy(structure);
ePFMgr.importPortfolioMapTemplate(newStructure, targetResource);
return target;
}
use of org.olat.portfolio.manager.EPFrontendManager in project openolat by klemens.
the class PortfolioHandler method readyToDelete.
@Override
public boolean readyToDelete(RepositoryEntry entry, Identity identity, Roles roles, Locale locale, ErrorList errors) {
EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
PortfolioStructure map = ePFMgr.loadPortfolioStructure(entry.getOlatResource());
if (map instanceof EPStructuredMapTemplate) {
EPStructuredMapTemplate exercise = (EPStructuredMapTemplate) map;
if (ePFMgr.isTemplateInUse(exercise, null, null, null)) {
return false;
}
}
ReferenceManager refM = CoreSpringFactory.getImpl(ReferenceManager.class);
String referencesSummary = refM.getReferencesToSummary(entry.getOlatResource(), locale);
if (referencesSummary != null) {
Translator translator = Util.createPackageTranslator(RepositoryManager.class, locale);
errors.setError(translator.translate("details.delete.error.references", new String[] { referencesSummary, entry.getDisplayname() }));
return false;
}
return true;
}
Aggregations