use of org.olat.portfolio.PortfolioModule in project openolat by klemens.
the class EPCollectRestrictionResultController method getMessageArgs.
public static String[] getMessageArgs(CollectRestriction restriction, Translator translator) {
String[] args = new String[3];
args[0] = translator.translate("restriction." + restriction.getRestriction());
PortfolioModule portfolioModule = (PortfolioModule) CoreSpringFactory.getBean("portfolioModule");
EPArtefactHandler<?> handler = portfolioModule.getArtefactHandler(restriction.getArtefactType());
if (handler != null) {
String handlerClass = PortfolioFilterController.HANDLER_PREFIX + handler.getClass().getSimpleName() + PortfolioFilterController.HANDLER_TITLE_SUFFIX;
args[1] = handler.getHandlerTranslator(translator).translate(handlerClass);
} else {
args[1] = translator.translate("restriction.handler.unknown");
}
args[2] = Integer.toString(restriction.getAmount());
return args;
}
use of org.olat.portfolio.PortfolioModule in project openolat by klemens.
the class EPArtefactWizzardStepCallback method execute.
/**
* @see org.olat.core.gui.control.generic.wizard.StepRunnerCallback#execute(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.WindowControl,
* org.olat.core.gui.control.generic.wizard.StepsRunContext)
*/
@Override
public Step execute(UserRequest ureq2, WindowControl wControl, StepsRunContext runContext) {
boolean hasChanges = false;
if (runContext.containsKey("artefact")) {
hasChanges = true;
AbstractArtefact locArtefact = (AbstractArtefact) runContext.get("artefact");
ePFMgr = (EPFrontendManager) CoreSpringFactory.getBean("epFrontendManager");
PortfolioModule portfolioModule = (PortfolioModule) CoreSpringFactory.getBean("portfolioModule");
// set the defined signature level, if its not from inside olat
if (locArtefact.getSignature() < 0 && ((runContext.containsKey("copyright.accepted") && (Boolean) runContext.get("copyright.accepted")) || !portfolioModule.isCopyrightStepEnabled())) {
locArtefact.setSignature(-1 * locArtefact.getSignature());
}
ePFMgr.updateArtefact(locArtefact);
if (runContext.containsKey("tempArtFolder")) {
// a new text or file-artefact was created, copy everything to destination
VFSContainer tmpFolder = (VFSContainer) runContext.get("tempArtFolder");
copyFromTempToArtefactContainer(locArtefact, tmpFolder);
} else if (tempUpload != null) {
// an artefact was collected in bc, only copy the selected file
copyFromBCToArtefactContainer(locArtefact, tempUpload);
}
// add to a structure if any was selected
if (runContext.containsKey("selectedStructure")) {
PortfolioStructure parentStructure = (PortfolioStructure) runContext.get("selectedStructure");
if (parentStructure != null) {
ePFMgr.addArtefactToStructure(ureq2.getIdentity(), locArtefact, parentStructure);
}
}
@SuppressWarnings("unchecked") List<String> allTags = (List<String>) runContext.get("artefactTagsList");
ePFMgr.setArtefactTags(ureq2.getIdentity(), locArtefact, allTags);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapPortfolioOres(locArtefact));
ThreadLocalUserActivityLogger.log(EPLoggingAction.EPORTFOLIO_ARTEFACT_ADDED, getClass());
}
return hasChanges ? StepsMainRunController.DONE_MODIFIED : StepsMainRunController.DONE_UNCHANGED;
}
use of org.olat.portfolio.PortfolioModule in project openolat by klemens.
the class CollaborationToolsFactory method initAvailableTools.
/**
* Helper method to initialize the list of enabled tools based system wide
* configuration.
*/
public synchronized void initAvailableTools() {
ArrayList<String> toolArr = new ArrayList<String>();
toolArr.add(CollaborationTools.TOOL_NEWS);
toolArr.add(CollaborationTools.TOOL_CONTACT);
CalendarModule calendarModule = CoreSpringFactory.getImpl(CalendarModule.class);
if (calendarModule.isEnabled() && calendarModule.isEnableGroupCalendar()) {
toolArr.add(CollaborationTools.TOOL_CALENDAR);
}
toolArr.add(CollaborationTools.TOOL_FOLDER);
toolArr.add(CollaborationTools.TOOL_FORUM);
if (CoreSpringFactory.getImpl(InstantMessagingModule.class).isEnabled()) {
toolArr.add(CollaborationTools.TOOL_CHAT);
}
BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
if (securityModule.isWikiEnabled()) {
toolArr.add(CollaborationTools.TOOL_WIKI);
}
PortfolioModule portfolioModule = CoreSpringFactory.getImpl(PortfolioModule.class);
PortfolioV2Module portfolioV2Module = CoreSpringFactory.getImpl(PortfolioV2Module.class);
if (portfolioModule.isEnabled() || portfolioV2Module.isEnabled()) {
toolArr.add(CollaborationTools.TOOL_PORTFOLIO);
}
OpenMeetingsModule openMeetingsModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
if (openMeetingsModule.isEnabled()) {
toolArr.add(CollaborationTools.TOOL_OPENMEETINGS);
}
TOOLS = ArrayHelper.toArray(toolArr);
}
Aggregations