/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.extension.xar.internal.handler.packager;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.xwiki.extension.xar.internal.handler.XarExtensionPlan;
import org.xwiki.extension.xar.question.ConflictQuestion.ConflictType;
import org.xwiki.extension.xar.question.ConflictQuestion.GlobalAction;
import org.xwiki.job.event.status.JobStatus;
import org.xwiki.model.reference.DocumentReference;

/**
 * @version $Id$
 * @since 4.0M2
 */
public class PackageConfiguration
{
    private String wiki;

    private DocumentReference user;

    private boolean interactive;

    private JobStatus jobStatus;

    private boolean verbose = false;

    private XarExtensionPlan xarExtensionPlan;

    private Set<String> entriesToImport;

    private boolean skipMandatorytDocuments = true;

    private Map<ConflictType, GlobalAction> conflictActions = new HashMap<>();

    public String getWiki()
    {
        return this.wiki;
    }

    public void setWiki(String wiki)
    {
        this.wiki = wiki;
    }

    public DocumentReference getUserReference()
    {
        return this.user;
    }

    public void setUser(DocumentReference user)
    {
        this.user = user;
    }

    public boolean isInteractive()
    {
        return this.interactive;
    }

    public void setInteractive(boolean interactive)
    {
        this.interactive = interactive;
    }

    public JobStatus getJobStatus()
    {
        return this.jobStatus;
    }

    public void setJobStatus(JobStatus jobStatus)
    {
        this.jobStatus = jobStatus;
    }

    public boolean isVerbose()
    {
        return this.verbose;
    }

    public void setVerbose(boolean verbose)
    {
        this.verbose = verbose;
    }

    public Set<String> getEntriesToImport()
    {
        return this.entriesToImport;
    }

    public void setEntriesToImport(Set<String> entriesToImport)
    {
        this.entriesToImport = entriesToImport;
    }

    public XarExtensionPlan getXarExtensionPlan()
    {
        return this.xarExtensionPlan;
    }

    public void setXarExtensionPlan(XarExtensionPlan xarExtensionPlan)
    {
        this.xarExtensionPlan = xarExtensionPlan;
    }

    public boolean isSkipMandatorytDocuments()
    {
        return this.skipMandatorytDocuments;
    }

    public void setSkipMandatorytDocuments(boolean skipMandatorytDocuments)
    {
        this.skipMandatorytDocuments = skipMandatorytDocuments;
    }

    public GlobalAction getConflictAction(ConflictType type)
    {
        return this.conflictActions.get(type);
    }

    public void setConflictAction(ConflictType type, GlobalAction action, GlobalAction defaultAnswer)
    {
        this.conflictActions.put(type, action != null ? action : defaultAnswer);
    }

    public Map<ConflictType, GlobalAction> getConflictActions()
    {
        return this.conflictActions;
    }
}

@@ -1793,16 +1793,246 @@
 p%3C%3E();%0A%0A
+    public PackageConfiguration()%0A    %7B%0A        // Default behavior%0A        setConflictAction(ConflictType.CURRENT_DELETED, GlobalAction.CURRENT);%0A        setConflictAction(ConflictType.MERGE_SUCCESS, GlobalAction.MERGED);%0A    %7D%0A%0A
     publ
@@ -3571,32 +3571,69 @@
 cuments;%0A    %7D%0A%0A
+    /**%0A     * @since 9.2RC1%0A     */%0A
     public Globa
@@ -3729,32 +3729,242 @@
 t(type);%0A    %7D%0A%0A
+    /**%0A     * @since 9.2RC1%0A     */%0A    public void setConflictAction(ConflictType type, GlobalAction action)%0A    %7B%0A        setConflictAction(type, action, action);%0A    %7D%0A%0A    /**%0A     * @since 9.2RC1%0A     */%0A
     public void 
@@ -4135,32 +4135,69 @@
 Answer);%0A    %7D%0A%0A
+    /**%0A     * @since 9.2RC1%0A     */%0A
     public Map%3CC

Add an option to disable automatic silent merges when upgrading an extension