Search in sources :

Example 6 with PortfolioModule

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;
}
Also used : PortfolioModule(org.olat.portfolio.PortfolioModule)

Example 7 with PortfolioModule

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;
}
Also used : VFSContainer(org.olat.core.util.vfs.VFSContainer) AbstractArtefact(org.olat.portfolio.model.artefacts.AbstractArtefact) PortfolioStructure(org.olat.portfolio.model.structel.PortfolioStructure) List(java.util.List) PortfolioModule(org.olat.portfolio.PortfolioModule)

Example 8 with PortfolioModule

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);
}
Also used : ArrayList(java.util.ArrayList) PortfolioV2Module(org.olat.modules.portfolio.PortfolioV2Module) BaseSecurityModule(org.olat.basesecurity.BaseSecurityModule) CalendarModule(org.olat.commons.calendar.CalendarModule) OpenMeetingsModule(org.olat.modules.openmeetings.OpenMeetingsModule) InstantMessagingModule(org.olat.instantMessaging.InstantMessagingModule) PortfolioModule(org.olat.portfolio.PortfolioModule)

Aggregations

PortfolioModule (org.olat.portfolio.PortfolioModule)8 ArrayList (java.util.ArrayList)2 List (java.util.List)2 BaseSecurityModule (org.olat.basesecurity.BaseSecurityModule)2 CalendarModule (org.olat.commons.calendar.CalendarModule)2 GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)2 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2 InstantMessagingModule (org.olat.instantMessaging.InstantMessagingModule)2 OpenMeetingsModule (org.olat.modules.openmeetings.OpenMeetingsModule)2 PortfolioV2Module (org.olat.modules.portfolio.PortfolioV2Module)2 AbstractArtefact (org.olat.portfolio.model.artefacts.AbstractArtefact)2 PortfolioStructure (org.olat.portfolio.model.structel.PortfolioStructure)2