All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.openutils.mgnllms.module.LMSModuleVersionHandler Maven / Gradle / Ivy

/**
 *
 * E-learning Module for Magnolia CMS (http://www.openmindlab.com/lab/products/lms.html)
 * Copyright(C) 2010-2013, Openmind S.r.l. http://www.openmindonline.it
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see .
 */
package net.sourceforge.openutils.mgnllms.module;

import info.magnolia.cms.security.Permission;
import info.magnolia.module.InstallContext;
import info.magnolia.module.delta.SetPropertyTask;
import info.magnolia.module.delta.Task;
import it.openutils.mgnltasks.AddPermissionTask;
import it.openutils.mgnltasks.FilesExtractionTask;
import it.openutils.mgnltasks.SimpleModuleVersionHandler;

import java.util.ArrayList;
import java.util.List;

import net.sourceforge.openutils.mgnllms.filters.AggregatorServingZipFilter;
import net.sourceforge.openutils.mgnllms.filters.RenderingServingZipFilter;


/**
 * @author molaschi
 * @version $Id: $
 */
public class LMSModuleVersionHandler extends SimpleModuleVersionHandler
{

    /**
     *
     */
    public LMSModuleVersionHandler()
    {
        super();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected List getStartupTasks(InstallContext installContext)
    {
        List tasks = new ArrayList();

        if (samplesEnabled())
        {
            tasks.add(new FilesExtractionTask("/samples-lms/"));

            tasks.add(new AddPermissionTask("anonymous", "website", "/sample-lms", Permission.READ));
            tasks.add(new AddPermissionTask("anonymous", "website", "/sample-lms/*", Permission.NONE));
            tasks.add(new AddPermissionTask("anonymous", "uri", "/sample-lms.html", Permission.READ));
        }

        tasks.add(new SetPropertyTask(
            "config",
            "/server/filters/cms/rendering",
            "class",
            RenderingServingZipFilter.class.getName())); // net.sourceforge.openutils.mgnllms.filters.RenderingServingZipFilter
        tasks.add(new SetPropertyTask(
            "config",
            "/server/filters/cms/aggregator",
            "class",
            AggregatorServingZipFilter.class.getName())); // net.sourceforge.openutils.mgnllms.filters.AggregatorServingZipFilter
        return tasks;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy