Projects >> orbeon-forms >>d03b9a988c548d4458863d53b7aa5f7a549cd15f

Chunk
Conflicting content
     * Build the entire tree of controls and associated information.
     *
     * @param propertyContext       current context
<<<<<<< HEAD
     * @param containingDocument    containing document
     * @param rootContainer         root XBL container
     * @param isRestoringState      whether this is called while restoring the state
     */
    public void initialize(PropertyContext propertyContext, XFormsContainingDocument containingDocument, XBLContainer rootContainer, boolean isRestoringState) {
=======
     * @param containingDocument
     * @param indentedLogger        logger
     * @param rootContainer
     * @param evaluateItemsets  whether to evaluate itemsets (true when restoring dynamic state only)
     */
    public void initialize(PropertyContext propertyContext, XFormsContainingDocument containingDocument, IndentedLogger indentedLogger, XBLContainer rootContainer, boolean evaluateItemsets) {
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425

        indentedLogger.startHandleOperation("controls", "building");
Solution content
     * Build the entire tree of controls and associated information.
     *
     * @param propertyContext       current context
     * @param containingDocument    containing document
     * @param rootContainer         root XBL container
     * @param isRestoringState      whether this is called while restoring the state
     */
    public void initialize(PropertyContext propertyContext, XFormsContainingDocument containingDocument, XBLContainer rootContainer, boolean isRestoringState) {

        indentedLogger.startHandleOperation("controls", "building");
File
ControlTree.java
Developer's decision
Version 1
Kind of conflict
Comment
Method signature
Chunk
Conflicting content
        // This is called upon the first creation of the XForms engine only

        // Create XForms controls and models
<<<<<<< HEAD
        createControlsAndModels(pipelineContext, true);
=======
        createControlsAndModels(pipelineContext);

        // Before dispatching initialization events, remember that first refresh must be performed
        this.mustPerformInitializationFirstRefresh = XFormsProperties.isDispatchInitialEvents(this);
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425

        // Group all xforms-model-construct-done and xforms-ready events within a single outermost action handler in
        // order to optimize events
Solution content
        // This is called upon the first creation of the XForms engine only

        // Create XForms controls and models
        createControlsAndModels(pipelineContext, true);

        // Group all xforms-model-construct-done and xforms-ready events within a single outermost action handler in
        // order to optimize events
File
XFormsContainingDocument.java
Developer's decision
Version 1
Kind of conflict
Attribute
Comment
Method invocation
Chunk
Conflicting content
import org.dom4j.Element;
import org.orbeon.oxf.common.OXFException;
import org.orbeon.oxf.common.ValidationException;
<<<<<<< HEAD
=======
import org.orbeon.oxf.util.IndentedLogger;
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
import org.orbeon.oxf.util.PropertyContext;
import org.orbeon.oxf.util.XPathCache;
import org.orbeon.oxf.xforms.control.XFormsControl;
Solution content
import org.dom4j.Element;
import org.orbeon.oxf.common.OXFException;
import org.orbeon.oxf.common.ValidationException;
import org.orbeon.oxf.util.IndentedLogger;
import org.orbeon.oxf.util.PropertyContext;
import org.orbeon.oxf.util.XPathCache;
import org.orbeon.oxf.xforms.control.XFormsControl;
File
XFormsContextStack.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import org.orbeon.oxf.util.PropertyContext;
import org.orbeon.oxf.xforms.control.*;
import org.orbeon.oxf.xforms.control.controls.XFormsRepeatControl;
import org.apache.log4j.Logger;
import org.dom4j.Element;
import org.orbeon.oxf.common.OXFException;
<<<<<<< HEAD
=======
import org.orbeon.oxf.pipeline.api.PipelineContext;
import org.orbeon.oxf.util.IndentedLogger;
import org.orbeon.oxf.util.LoggerFactory;
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
Solution content
import org.apache.log4j.Logger;
import org.dom4j.Element;
import org.orbeon.oxf.common.OXFException;
import org.orbeon.oxf.util.IndentedLogger;
import org.orbeon.oxf.util.LoggerFactory;
import org.orbeon.oxf.util.PropertyContext;
import org.orbeon.oxf.xforms.control.*;
import org.orbeon.oxf.xforms.control.controls.XFormsRepeatControl;
File
XFormsControls.java
Developer's decision
Combination
Kind of conflict
Import
Chunk
Conflicting content
=======
import org.orbeon.oxf.xforms.event.XFormsEvents;
import org.orbeon.oxf.xforms.control.controls.XFormsRepeatControl;
import org.orbeon.oxf.xforms.control.controls.XFormsRepeatIterationControl;
import org.orbeon.oxf.xforms.control.controls.XXFormsDialogControl;
<<<<<<< HEAD
import org.orbeon.oxf.xforms.itemset.Itemset;
import org.orbeon.oxf.xforms.xbl.XBLContainer;
import org.orbeon.oxf.xml.dom4j.Dom4jUtils;
import org.orbeon.oxf.xforms.event.events.*;
import org.orbeon.oxf.xforms.itemset.Itemset;
import org.orbeon.oxf.xforms.xbl.XBLContainer;
import org.orbeon.oxf.xml.dom4j.Dom4jUtils;
import org.orbeon.saxon.dom4j.NodeWrapper;
import org.orbeon.saxon.om.Item;
import org.orbeon.saxon.om.NodeInfo;
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425

import java.util.ArrayList;
import java.util.HashMap;
Solution content
import org.orbeon.oxf.xforms.control.controls.XFormsRepeatControl;
import org.orbeon.oxf.xforms.control.controls.XFormsRepeatIterationControl;
import org.orbeon.oxf.xforms.control.controls.XXFormsDialogControl;
import org.orbeon.oxf.xforms.itemset.Itemset;
import org.orbeon.oxf.xforms.xbl.XBLContainer;
import org.orbeon.oxf.xml.dom4j.Dom4jUtils;

import java.util.ArrayList;
import java.util.HashMap;
File
XFormsControls.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
 */
public class XFormsControls implements XFormsObjectResolver {

<<<<<<< HEAD
=======
    public static final String LOGGING_CATEGORY = "control";
    public static final Logger logger = LoggerFactory.createLogger(XFormsModel.class);
    public final IndentedLogger indentedLogger;

>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
    private boolean initialized;
    private ControlTree initialControlTree;
    private ControlTree currentControlTree;
Solution content
 */
public class XFormsControls implements XFormsObjectResolver {

    public static final String LOGGING_CATEGORY = "control";
    public static final Logger logger = LoggerFactory.createLogger(XFormsModel.class);
    public final IndentedLogger indentedLogger;

    private boolean initialized;
    private ControlTree initialControlTree;
    private ControlTree currentControlTree;
File
XFormsControls.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
     * Initialize the controls if needed, passing initial state information. This is called if the state of the engine
     * needs to be built or rebuilt.
     *
<<<<<<< HEAD
     * @param propertyContext   current context
     * @param isRestoringState  whether we are restoring the state
=======
     * @param propertyContext       current context
     * @param evaluateItemsets      whether to evaluateItemsets (for dynamic state restoration)
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
     */
    public void initializeState(PropertyContext propertyContext, boolean isRestoringState) {
Solution content
     * Initialize the controls if needed, passing initial state information. This is called if the state of the engine
     * needs to be built or rebuilt.
     *
     * @param propertyContext   current context
     * @param isRestoringState  whether we are restoring the state
     */
    public void initializeState(PropertyContext propertyContext, boolean isRestoringState) {
File
XFormsControls.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
                currentControlTree = initialControlTree = new ControlTree(containingDocument);

                // Initialize new control tree
<<<<<<< HEAD
                currentControlTree.initialize(propertyContext, containingDocument, rootContainer, isRestoringState);
=======
                currentControlTree.initialize(propertyContext, containingDocument, indentedLogger, rootContainer, evaluateItemsets);
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
            }
        }
Solution content
                // Initialize new control tree
                currentControlTree.initialize(propertyContext, containingDocument, rootContainer, isRestoringState);
            }
        }
File
XFormsControls.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
     * WARNING: The binding context must be set to the current iteration before calling.
     *
     * @param propertyContext   current context
<<<<<<< HEAD
     * @param bindingContext    binding context set to the context of the new iteration
=======
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
     * @param repeatControl     repeat control
     * @param iterationIndex    new iteration index (1..repeat size + 1)
     * @return                  newly created repeat iteration control
Solution content
     * WARNING: The binding context must be set to the current iteration before calling.
     *
     * @param propertyContext   current context
     * @param bindingContext    binding context set to the context of the new iteration
     * @param repeatControl     repeat control
     * @param iterationIndex    new iteration index (1..repeat size + 1)
     * @return                  newly created repeat iteration control
File
XFormsControls.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
            throw new OXFException("Cannot call insertRepeatIteration() when initialControlTree == currentControlTree");

        final XFormsRepeatIterationControl repeatIterationControl;
<<<<<<< HEAD
        containingDocument.startHandleOperation("controls", "adding iteration");
        {
            repeatIterationControl = currentControlTree.createRepeatIterationTree(propertyContext, containingDocument, bindingContext, repeatControl, iterationIndex);
        }
        containingDocument.endHandleOperation();
=======
        indentedLogger.startHandleOperation("controls", "adding iteration");
        repeatIterationControl = currentControlTree.createRepeatIterationTree(propertyContext, bindingContext, repeatControl, iterationIndex);
        indentedLogger.endHandleOperation();
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425

        return repeatIterationControl;
    }
Solution content
            throw new OXFException("Cannot call insertRepeatIteration() when initialControlTree == currentControlTree");

        final XFormsRepeatIterationControl repeatIterationControl;
        indentedLogger.startHandleOperation("controls", "adding iteration");
        {
            repeatIterationControl = currentControlTree.createRepeatIterationTree(propertyContext, containingDocument, bindingContext, repeatControl, iterationIndex);
        }
        indentedLogger.endHandleOperation();

        return repeatIterationControl;
    }
File
XFormsControls.java
Developer's decision
Combination
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
=======
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
     * Rebuild the controls tree bindings if needed.
     *
     * @param propertyContext   current context
<<<<<<< HEAD
     * @return                  true iif bindings were updated
     */
    private boolean updateControlBindingsIfNeeded(final PropertyContext propertyContext) {
Solution content
     * Rebuild the controls tree bindings if needed.
     *
     * @param propertyContext   current context
     * @return                  true iif bindings were updated
     */
    private boolean updateControlBindingsIfNeeded(final PropertyContext propertyContext) {
File
XFormsControls.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
            {
            // Clone if needed
            cloneInitialStateIfNeeded();

                // Visit all controls and update their bindings
                visitControlElementsHandleRepeat(propertyContext, containingDocument, rootContainer, listener);
<<<<<<< HEAD
            containingDocument.startHandleOperation("controls", "updating bindings");
            final ControlTree.UpdateBindingsListener listener = new ControlTree.UpdateBindingsListener(propertyContext, currentControlTree.getEffectiveIdsToControls());
=======
            indentedLogger.startHandleOperation("controls", "updating bindings");
            final UpdateBindingsListener listener = new UpdateBindingsListener(propertyContext, currentControlTree.getEffectiveIdsToControls(), currentControlTree.getEventsToDispatch());
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
Solution content
            // Clone if needed
            cloneInitialStateIfNeeded();

            indentedLogger.startHandleOperation("controls", "updating bindings");
            final ControlTree.UpdateBindingsListener listener = new ControlTree.UpdateBindingsListener(propertyContext, currentControlTree.getEffectiveIdsToControls());
            {
                // Visit all controls and update their bindings
                visitControlElementsHandleRepeat(propertyContext, containingDocument, rootContainer, listener);
File
XFormsControls.java
Developer's decision
Combination
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
<<<<<<< HEAD
                    // o whose value changed
            return;
        }
                    //
        containingDocument.startHandleOperation("model", "performing refresh", "container id", container.getEffectiveId());
        {
            // Update control bindings
            updateControlBindingsIfNeeded(propertyContext);
            // Update control values
            evaluateControlValuesIfNeeded(propertyContext, true);
=======
        indentedLogger.startHandleOperation("model", "performing refresh", "model id", model.getEffectiveId());

        // Update control bindings if needed
        updateControlBindingsIfNeeded(propertyContext);

        // Obtain global information about event handlers. This is a rough optimization so we can avoid sending certain
        // types of events below.
        final boolean isAllowSendingValueChangedEvents = hasHandlerForEvent(XFormsEvents.XFORMS_VALUE_CHANGED);
        final boolean isAllowSendingRequiredEvents = hasHandlerForEvent(XFormsEvents.XFORMS_REQUIRED) || hasHandlerForEvent(XFormsEvents.XFORMS_OPTIONAL);
        final boolean isAllowSendingRelevantEvents = hasHandlerForEvent(XFormsEvents.XFORMS_ENABLED) || hasHandlerForEvent(XFormsEvents.XFORMS_DISABLED);
        final boolean isAllowSendingReadonlyEvents = hasHandlerForEvent(XFormsEvents.XFORMS_READONLY) || hasHandlerForEvent(XFormsEvents.XFORMS_READWRITE);
        final boolean isAllowSendingValidEvents = hasHandlerForEvent(XFormsEvents.XFORMS_VALID) || hasHandlerForEvent(XFormsEvents.XFORMS_INVALID);

        final boolean isAllowSendingUIEvents = isAllowSendingValueChangedEvents || isAllowSendingRequiredEvents || isAllowSendingRelevantEvents || isAllowSendingReadonlyEvents || isAllowSendingValidEvents;
        if (isAllowSendingUIEvents) {
            // There are potentially event handlers for UI events, so do the whole processing

            // If this is the first refresh we mark nodes to dispatch MIP events
            final boolean isFirstRefresh = isInitialRefreshEvents && containingDocument.isInitializationFirstRefreshClear();

            // Build list of events to send
            final Map relevantBindingEvents = getCurrentControlTree().getEventsToDispatch();
            final List eventsToDispatch = new ArrayList();

            // Iterate through controls and check the nodes they are bound to
            visitAllControls(new XFormsControlVisitorAdapter() {
                public void startVisitControl(XFormsControl control) {

                    // We must be an XFormsSingleNodeControl
                    // NOTE: We don't dispatch events to repeat iterations
                    if (!(control instanceof XFormsSingleNodeControl && !(control instanceof XFormsRepeatIterationControl)))
                        return;

                    // This can happen if control is not bound to anything (includes xforms:group[not(@ref) and not(@bind)])
                    final NodeInfo currentNodeInfo = ((XFormsSingleNodeControl) control).getBoundNode();
                    if (currentNodeInfo == null)
                        return;

                    // We only dispatch events for controls bound to a mutable document
                    // TODO: what about initial events? those could be sent.
                    if (!(currentNodeInfo instanceof NodeWrapper))
                        return;

                    // Check if value has changed

                    // NOTE: For the purpose of dispatching value change and MIP events, we used to make a
                    // distinction between value controls and plain single-node controls. However it seems that it is
                    // still reasonable to dispatch those events to xforms:group, xforms:switch, and even repeat
                    // iterations if they are bound.

                    final String effectiveId = control.getEffectiveId();
                    final EventSchedule existingEventSchedule = (relevantBindingEvents == null) ? null : relevantBindingEvents.get(effectiveId);
                                    // ... nothing else
                                    if (isAllowSendingRelevantEvents)
                            }
                        }


                    // Allow dispatching value change to:
                    // o relevant control
                                    addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.VALUE);
                                }
                            } else {
                                if (!isPlainValueChange) {
                                    // Dispatch all the allowed MIP events

                                    if (isAllowSendingRequiredEvents)
                                        addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.REQUIRED);
                    // NOTE: We tried dispatching also during first refresh, but only if it is not a container control
                    // OR if the bound node is simple content. However, right now we have decided against dispatching
                    // this during initialization. See:
                    //
                    //   http://wiki.orbeon.com/forms/doc/contributor-guide/xforms-ui-events

//                     This last part of the logic is there to prevent dispatching spurious value change events for all
                        if (!isShouldSendValueChangeEvent || isPlainValueChange) {
//                     groups during initialization, while still allowing listening to value changes on groups that have
//                     simple content and therefore can hold a value.
//
//                     Whether the control is a container control: group, switch, repeat iteration
//                    final boolean isContainerControl = control instanceof XFormsSingleNodeContainerControl;
//                    final boolean isShouldSendValueChangeEvent
//                            = newRelevantState
//                                && (isControlValueChanged
//                                    || isFirstRefresh && (!isContainerControl || Dom4jUtils.isSimpleContent((Node) ((NodeWrapper) currentNodeInfo).getUnderlyingNode())));

                    // NOTE: In the whole refresh process, no control evaluation takes place. This is needed at this
                    // point because with multiple models, a refresh might occur before all models have been RRR. This
                    // means that evaluating here might incorrect values for MIPs and control values.

                    // Don't dispatch events to static readonly triggers, as they in fact behave as if they were not relevant!
                    if (control instanceof XFormsTriggerControl && XFormsSingleNodeControl.isStaticReadonlyNoEvaluate((XFormsSingleNodeControl) control)) {
                        return;
                    }

                    final boolean newRelevantState = InstanceData.getInheritedRelevant(currentNodeInfo);
                    final boolean isControlValueChanged = InstanceData.isValueChanged(currentNodeInfo);
                    // TODO: if control *becomes* non-relevant and value changed, arguably we should dispatch the value-changed event
                    final boolean isShouldSendValueChangeEvent = newRelevantState && isControlValueChanged;

                    if (isFirstRefresh) {
                        // Special processing for first refresh

                        // Don't dispatch any value change
                        // NOP

                        // Display events only if the control is relevant
                        if (newRelevantState) {

                            // Dispatch xforms-enabled if needed
                            if (isAllowSendingRelevantEvents) {
                                addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.RELEVANT);
                            }

                            // Dispatch events only if the MIP value is different from the default

                            // Dispatch xforms-required if needed
                            if (isAllowSendingRequiredEvents && InstanceData.getRequired(currentNodeInfo)) {
                                addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.REQUIRED);
                            }

                            // Dispatch xforms-readonly if needed
                            if (isAllowSendingReadonlyEvents && InstanceData.getInheritedReadonly(currentNodeInfo)) {
                                addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.READONLY);
                            }

                            // Dispatch xforms-invalid if needed
                            if (isAllowSendingValidEvents && !InstanceData.getValid(currentNodeInfo)) {
                                addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.VALID);
                            }
                        }

                    } else {
                        // Subsequent refreshes

                        if (isShouldSendValueChangeEvent) {
                            if (isAllowSendingValueChangedEvents) {
                                // Dispatch value change and...

                                if (!isPlainValueChange) {
                                    // ... all MIP events
                                    addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.ALL);
                                } else {
                                        addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.RELEVANT);
                                    if (isAllowSendingReadonlyEvents)
                                        addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.READONLY);
                                    if (isAllowSendingValidEvents)
                                        addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.VALID);
                                }
                            // Send individual MIP events
                            // Come here if MIP events are not already handled above

                            // Dispatch xforms-optional/xforms-required if needed
                            if (isAllowSendingRequiredEvents) {
                                // Send only when value has changed
                                final boolean previousRequiredState = InstanceData.getPreviousRequiredState(currentNodeInfo);
                                final boolean newRequiredState = InstanceData.getRequired(currentNodeInfo);

                                if (previousRequiredState != newRequiredState) {
                                    addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.REQUIRED);
                                }
                            }
                            // Dispatch xforms-enabled/xforms-disabled if needed
                            if (isAllowSendingRelevantEvents) {
                                // Send only when value has changed
                                final boolean previousRelevantState = InstanceData.getPreviousInheritedRelevantState(currentNodeInfo);

                                if (previousRelevantState != newRelevantState) {
                                    addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.RELEVANT);
                                }
                            }
                            // Dispatch xforms-readonly/xforms-readwrite if needed
                            if (isAllowSendingReadonlyEvents) {
                                final boolean previousReadonlyState = InstanceData.getPreviousInheritedReadonlyState(currentNodeInfo);
                                final boolean newReadonlyState = InstanceData.getInheritedReadonly(currentNodeInfo);

                                if (previousReadonlyState != newReadonlyState) {
                                    addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.READONLY);
                                }
                            }

                            // Dispatch xforms-valid/xforms-invalid if needed

                            // NOTE: There is no mention in the spec that these events should be displatched automatically
                            // when the value has changed, contrary to the other events above.
                            if (isAllowSendingValidEvents) {
                                final boolean previousValidState = InstanceData.getPreviousValidState(currentNodeInfo);
                                final boolean newValidState = InstanceData.getValid(currentNodeInfo);

                                if (previousValidState != newValidState) {
                                    addEventToSchedule(existingEventSchedule, effectiveId, EventSchedule.VALID);
                                }
                            }
                        }
                    }
                }

                private void addEventToSchedule(EventSchedule eventSchedule, String effectiveControlId, int type) {
                    if (eventSchedule == null)
                        eventsToDispatch.add(new EventSchedule(effectiveControlId, type));
                    else
                        eventSchedule.updateType(type);
                }
            });

            // Clear InstanceData event state
            // NOTE: We clear for all models, as we are processing refresh events for all models here. This may have to be changed in the future.
            containingDocument.synchronizeInstanceDataEventState();
            getCurrentControlTree().clearEventsToDispatch();

            // "Actions that directly invoke rebuild, recalculate, revalidate, or refresh always
            // have an immediate effect, and clear the corresponding flag."
            model.refreshDone();

            // Add "relevant binding" events
            if (relevantBindingEvents != null)
                eventsToDispatch.addAll(relevantBindingEvents.values());

            // Send events and (try to) make sure the event corresponds to the current instance data
            // NOTE: event order and the exact steps to take are under-specified in 1.0.
            for (EventSchedule eventSchedule : eventsToDispatch) {

                final String controlInfoId = eventSchedule.getEffectiveControlId();
                final int type = eventSchedule.getType();
                final boolean isRelevantBindingEvent = (type & EventSchedule.RELEVANT_BINDING) != 0;

                final XFormsControl xformsControl = (XFormsControl) getObjectByEffectiveId(controlInfoId);

                if (!isRelevantBindingEvent) {
                    // Regular type of event
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425

            if (currentControlTree.isAllowSendingRefreshEvents()) {
                // There are potentially event handlers for UI events, so do the whole processing
Solution content
            return;
        }

        indentedLogger.startHandleOperation("model", "performing refresh", "container id", container.getEffectiveId());
        {
            // Update control bindings
            updateControlBindingsIfNeeded(propertyContext);
            // Update control values
            evaluateControlValuesIfNeeded(propertyContext, true);

            if (currentControlTree.isAllowSendingRefreshEvents()) {
                // There are potentially event handlers for UI events, so do the whole processing
File
XFormsControls.java
Developer's decision
Manual
Kind of conflict
Attribute
Cast expression
Comment
For statement
If statement
Method invocation
Variable
Chunk
Conflicting content

>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
    }
                // No UI events to send because there is no event handlers for any of them
                containingDocument.logDebug("model", "refresh skipping sending of UI events because no listener was found", "container id", container.getEffectiveId());

<<<<<<< HEAD
                // "Actions that directly invoke rebuild, recalculate, revalidate, or refresh always have an immediate
                // effect, and clear the corresponding flag."
                refreshDone();
            }
        }
        containingDocument.endHandleOperation();
=======
                    if (isAllowSendingValueChangedEvents && (type & EventSchedule.VALUE) != 0) {
                        container.dispatchEvent(propertyContext, new XFormsValueChangeEvent(containingDocument, xformsControl));
                    }
                    if (currentNodeInfo != null && currentNodeInfo instanceof NodeWrapper) {
                        if (isAllowSendingRequiredEvents && (type & EventSchedule.REQUIRED) != 0) {
                            final boolean currentRequiredState = InstanceData.getRequired(currentNodeInfo);
                            if (currentRequiredState) {
                                container.dispatchEvent(propertyContext, new XFormsRequiredEvent(containingDocument, xformsControl));
                            } else {
                                container.dispatchEvent(propertyContext, new XFormsOptionalEvent(containingDocument, xformsControl));
                            }
                        }
                        if (isAllowSendingRelevantEvents && (type & EventSchedule.RELEVANT) != 0) {
                            final boolean currentRelevantState = InstanceData.getInheritedRelevant(currentNodeInfo);
                            if (currentRelevantState) {
                                container.dispatchEvent(propertyContext, new XFormsEnabledEvent(containingDocument, xformsControl));
                            } else {
                                container.dispatchEvent(propertyContext, new XFormsDisabledEvent(containingDocument, xformsControl));
                            }
                        }
                        if (isAllowSendingReadonlyEvents && (type & EventSchedule.READONLY) != 0) {
                            final boolean currentReadonlyState = InstanceData.getInheritedReadonly(currentNodeInfo);
                            if (currentReadonlyState) {
                                container.dispatchEvent(propertyContext, new XFormsReadonlyEvent(containingDocument, xformsControl));
                            } else {
                                container.dispatchEvent(propertyContext, new XFormsReadwriteEvent(containingDocument, xformsControl));
                            }
                        }
                        if (isAllowSendingValidEvents && (type & EventSchedule.VALID) != 0) {
                            final boolean currentValidState = InstanceData.getValid(currentNodeInfo);
                            if (currentValidState) {
                                container.dispatchEvent(propertyContext, new XFormsValidEvent(containingDocument, xformsControl));
                            } else {
                                container.dispatchEvent(propertyContext, new XFormsInvalidEvent(containingDocument, xformsControl));
                            }
                        }
                    }
                } else {

                            // We only dispatch value-changed and other events for controls bound to a mutable document
                            if (!(currentNodeInfo instanceof NodeWrapper))
                                continue;
    private List gatherRefreshEvents() {
                        // If control is not bound (e.g. xforms:group[not(@ref) and not(@bind)]) no events are sent
                    // Handle special case of "relevant binding" events, i.e. relevance that changes because a node becomes
                    // bound or unbound to a node.

                    if (xformsControl != null) {

            containingDocument.synchronizeInstanceDataEventState();
            getCurrentControlTree().clearEventsToDispatch();
                        final boolean isControlBound = xformsControl.getBindingContext().isNewBind();
                        if (!isControlBound)
                            continue;

                        // Re-obtain node to which control is bound, in case things have changed
                        final NodeInfo currentNodeInfo = ((XFormsSingleNodeControl) xformsControl).getBoundNode();
                        if (currentNodeInfo != null) {
                            final boolean currentRelevantState = InstanceData.getInheritedRelevant(currentNodeInfo);
                            if (currentRelevantState) {
                                // The control is newly bound to a relevant node

                                final XBLContainer container = xformsControl.getXBLContainer();

                                if (isAllowSendingRelevantEvents) {
                                    container.dispatchEvent(propertyContext, new XFormsEnabledEvent(containingDocument, xformsControl));
                                }

                                // Also send other MIP events
                                if (isAllowSendingRequiredEvents) {
                                    final boolean currentRequiredState = InstanceData.getRequired(currentNodeInfo);
                                    if (currentRequiredState) {
                                        container.dispatchEvent(propertyContext, new XFormsRequiredEvent(containingDocument, xformsControl));
                                    } else {
                                        container.dispatchEvent(propertyContext, new XFormsOptionalEvent(containingDocument, xformsControl));
                                    }
                                }

                                if (isAllowSendingReadonlyEvents) {
                                    final boolean currentReadonlyState = InstanceData.getInheritedReadonly(currentNodeInfo);
                                    if (currentReadonlyState) {
                                        container.dispatchEvent(propertyContext, new XFormsReadonlyEvent(containingDocument, xformsControl));
                                    } else {
                                        container.dispatchEvent(propertyContext, new XFormsReadwriteEvent(containingDocument, xformsControl));
                                    }
                                }

                                if (isAllowSendingValidEvents) {
                                    final boolean currentValidState = InstanceData.getValid(currentNodeInfo);
                                    if (currentValidState) {
                                        container.dispatchEvent(propertyContext, new XFormsValidEvent(containingDocument, xformsControl));
                                    } else {
                                        container.dispatchEvent(propertyContext, new XFormsInvalidEvent(containingDocument, xformsControl));
                                    }
                                }
                            }
                        } else {
                            // The control is not bound to a node
                            sendDefaultEventsForDisabledControl(propertyContext, xformsControl,
                                    isAllowSendingRequiredEvents, isAllowSendingRelevantEvents, isAllowSendingReadonlyEvents, isAllowSendingValidEvents);
                        }
                    } else {
                        // The control no longer exists
                        if (eventSchedule.getXFormsControl() != null) {
                            // In this case, we get a reference to the "old" control
                            sendDefaultEventsForDisabledControl(propertyContext, eventSchedule.getXFormsControl(),
                                    isAllowSendingRequiredEvents, isAllowSendingRelevantEvents, isAllowSendingReadonlyEvents, isAllowSendingValidEvents);
                        }
                    }
                }
            }
        } else {
            // No UI events to send because there is no event handlers for any of them
            indentedLogger.logDebug("model", "refresh skipping sending of UI events because no listener was found", "model id", model.getEffectiveId());

            // NOTE: We clear for all models, as we are processing refresh events for all models here. This may have to be changed in the future.

            // "Actions that directly invoke rebuild, recalculate, revalidate, or refresh always
            // have an immediate effect, and clear the corresponding flag."
            model.refreshDone();
        }

        indentedLogger.endHandleOperation();
Solution content
                // No UI events to send because there is no event handlers for any of them
                indentedLogger.logDebug("model", "refresh skipping sending of UI events because no listener was found", "container id", container.getEffectiveId());

                // "Actions that directly invoke rebuild, recalculate, revalidate, or refresh always have an immediate
                // effect, and clear the corresponding flag."
                refreshDone();
            }
        }
        indentedLogger.endHandleOperation();
    }

    private List gatherRefreshEvents() {
File
XFormsControls.java
Developer's decision
Combination
Kind of conflict
Comment
If statement
Method invocation
Chunk
Conflicting content
        // Send events for default MIP values

        if (isAllowSendingRequiredEvents)
        final List eventsToDispatch = new ArrayList();

<<<<<<< HEAD
        // Iterate through controls and check the nodes they are bound to
        visitAllControls(new XFormsControlVisitorAdapter() {
            public void startVisitControl(XFormsControl control) {
                if (XFormsControl.supportsRefreshEvents(control)) {// test here just to make smaller list
                    eventsToDispatch.add(control.getEffectiveId());
                }
            }
        });

        return eventsToDispatch;
=======
        // Control is disabled
        if (isAllowSendingRelevantEvents)
            container.dispatchEvent(propertyContext, new XFormsDisabledEvent(containingDocument, xformsControl));
            container.dispatchEvent(propertyContext, new XFormsOptionalEvent(containingDocument, xformsControl));

        if (isAllowSendingReadonlyEvents)
            container.dispatchEvent(propertyContext, new XFormsReadwriteEvent(containingDocument, xformsControl));

        if (isAllowSendingValidEvents)
            container.dispatchEvent(propertyContext, new XFormsValidEvent(containingDocument, xformsControl));
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
    }

    private void dispatchRefreshEvents(PropertyContext propertyContext, List eventsToDispatch) {
Solution content
        final List eventsToDispatch = new ArrayList();

        // Iterate through controls and check the nodes they are bound to
        visitAllControls(new XFormsControlVisitorAdapter() {
            public void startVisitControl(XFormsControl control) {
                if (XFormsControl.supportsRefreshEvents(control)) {// test here just to make smaller list
                    eventsToDispatch.add(control.getEffectiveId());
                }
            }
        });

        return eventsToDispatch;
    }

    private void dispatchRefreshEvents(PropertyContext propertyContext, List eventsToDispatch) {
File
XFormsControls.java
Developer's decision
Version 1
Kind of conflict
Comment
If statement
Method invocation
Return statement
Variable
Chunk
Conflicting content
            // As of 2009-03-18 decision, XForms 1.1 specifies that deferred event handling flags are set instead of
            // performing RRRR directly
            deferredActionContext.setAllDeferredFlags(true);
<<<<<<< HEAD
=======

            if (updatedInstance.isReadOnly()) {
                // Read-only instance: replacing does not cause value change events at the moment, so we just set the
                // flags but do not mark values as changed. Anyway, that event logic is broken, see below.

                // NOP for now
            } else {
                // Read-write instance

                // NOTE: Besides setting the flags, for read-write instances, we go through a marking process used for
                // event dispatch. This process requires:
                //
                // o up-to-date control bindings, for 1) relevance handling and 2) type handling
                // o which in turn requires RRR
                //
                // So we do perform RRR below, which clears the flags set above. This should be seen as temporary
                // measure until we do proper (i.e. not like XForms 1.1 specifies!) UI event updates.

                // Update control bindings if needed 
                doRebuild(propertyContext);
                doRecalculate(propertyContext);
                doRevalidate(propertyContext);
                xformsControls.updateControlBindingsIfNeeded(propertyContext);

                if (indentedLogger.isDebugEnabled())
                    indentedLogger.logDebug("replace", "marking nodes for value change following instance replacement",
                            "instance id", updatedInstance.getEffectiveId());

                // Mark all nodes to which single-node controls are bound
                xformsControls.visitAllControls(new XFormsControls.XFormsControlVisitorAdapter() {
                    public void startVisitControl(XFormsControl control) {

                        // Don't do anything if it's not a single node control
                        // NOTE: We don't dispatch events to repeat iterations
                        if (!(control instanceof XFormsSingleNodeControl && !(control instanceof XFormsRepeatIterationControl)))
                            return;

                        // This can happen if control is not bound to anything (includes xforms:group[not(@ref) and not(@bind)])
                        final NodeInfo boundNodeInfo = ((XFormsSingleNodeControl) control).getBoundNode();
                        if (boundNodeInfo == null)
                            return;

                        // We only mark nodes in mutable documents
                        if (!(boundNodeInfo instanceof NodeWrapper))
                            return;

                        // Mark node only if it is within the updated tree
                        if (!Navigator.isAncestorOrSelf(updatedTreeRoot, boundNodeInfo))
                            return;

                        // Finally, mark node
                        InstanceData.markValueChanged(boundNodeInfo);
                    }
                });
            }
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
        }
    }
Solution content
            // As of 2009-03-18 decision, XForms 1.1 specifies that deferred event handling flags are set instead of
            // performing RRRR directly
            deferredActionContext.setAllDeferredFlags(true);
        }
    }
File
XFormsModel.java
Developer's decision
Version 1
Kind of conflict
If statement
Chunk
Conflicting content
=======

        if (currentDeferredActionContext.rebuild) {
            container.dispatchEvent(propertyContext, new XFormsRebuildEvent(this));
            containingDocument.startOutermostActionHandler();
<<<<<<< HEAD
            containingDocument.endOutermostActionHandler(propertyContext);
            containingDocument.endOutermostActionHandler(propertyContext);
        }
        if (currentDeferredActionContext.recalculate) {
            containingDocument.startOutermostActionHandler();
            container.dispatchEvent(propertyContext, new XFormsRecalculateEvent(this));
            containingDocument.endOutermostActionHandler(propertyContext);
        }
        if (currentDeferredActionContext.revalidate) {
            containingDocument.startOutermostActionHandler();
            container.dispatchEvent(propertyContext, new XFormsRevalidateEvent(this));
            container.dispatchEvent(pipelineContext, new XFormsRebuildEvent(containingDocument, this));
            containingDocument.endOutermostActionHandler(pipelineContext);
        }
        if (currentDeferredActionContext.recalculate) {
            containingDocument.startOutermostActionHandler();
            container.dispatchEvent(pipelineContext, new XFormsRecalculateEvent(containingDocument, this));
            containingDocument.endOutermostActionHandler(pipelineContext);
        }
        if (currentDeferredActionContext.revalidate) {
            containingDocument.startOutermostActionHandler();
            container.dispatchEvent(pipelineContext, new XFormsRevalidateEvent(containingDocument, this));
            containingDocument.endOutermostActionHandler(pipelineContext);
        }
        if (currentDeferredActionContext.refresh) {
            containingDocument.startOutermostActionHandler();
            container.dispatchEvent(pipelineContext, new XFormsRefreshEvent(containingDocument, this));
            containingDocument.endOutermostActionHandler(pipelineContext);
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
        }
    }
Solution content
        if (currentDeferredActionContext.rebuild) {
            containingDocument.startOutermostActionHandler();
            container.dispatchEvent(propertyContext, new XFormsRebuildEvent(containingDocument, this));
            containingDocument.endOutermostActionHandler(propertyContext);
        }
        if (currentDeferredActionContext.recalculate) {
            containingDocument.startOutermostActionHandler();
            container.dispatchEvent(propertyContext, new XFormsRecalculateEvent(containingDocument, this));
            containingDocument.endOutermostActionHandler(propertyContext);
        }
        if (currentDeferredActionContext.revalidate) {
            containingDocument.startOutermostActionHandler();
            container.dispatchEvent(propertyContext, new XFormsRevalidateEvent(containingDocument, this));
            containingDocument.endOutermostActionHandler(propertyContext);
        }
    }
File
XFormsModel.java
Developer's decision
Manual
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
            throw new ValidationException("Invalid model id: " + modelId, (LocationData) actionElement.getData());

        // Because of inter-model dependencies, we consider for now that the action must force the operation
<<<<<<< HEAD
        container.requireRefresh();
        container.dispatchEvent(propertyContext, new XFormsRefreshEvent(model));
=======
        model.getDeferredActionContext().refresh = true;
        container.dispatchEvent(propertyContext, new XFormsRefreshEvent(containingDocument, model));
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
    }
}
Solution content
            throw new ValidationException("Invalid model id: " + modelId, (LocationData) actionElement.getData());

        // Because of inter-model dependencies, we consider for now that the action must force the operation
        container.requireRefresh();
        container.dispatchEvent(propertyContext, new XFormsRefreshEvent(containingDocument, model));
    }
}
File
XFormsRefreshAction.java
Developer's decision
Combination
Kind of conflict
Method invocation
Chunk
Conflicting content
import org.orbeon.oxf.xforms.event.XFormsEventObserver;
import org.orbeon.oxf.xforms.event.XFormsEventTarget;
import org.orbeon.oxf.xforms.event.events.XXFormsValueChanged;
<<<<<<< HEAD
import org.orbeon.oxf.xforms.processor.XFormsServer;
import org.orbeon.oxf.xforms.xbl.XBLContainer;
=======
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
import org.orbeon.oxf.xml.dom4j.LocationData;
import org.orbeon.saxon.om.Item;
import org.orbeon.saxon.om.NodeInfo;
Solution content
import org.orbeon.oxf.xforms.event.XFormsEventObserver;
import org.orbeon.oxf.xforms.event.XFormsEventTarget;
import org.orbeon.oxf.xforms.event.events.XXFormsValueChanged;
import org.orbeon.oxf.xforms.xbl.XBLContainer;

import org.orbeon.oxf.xml.dom4j.LocationData;
import org.orbeon.saxon.om.Item;
import org.orbeon.saxon.om.NodeInfo;
File
XFormsSetvalueAction.java
Developer's decision
Combination
Kind of conflict
Import
Chunk
Conflicting content
            if (modifiedInstance != null) {// can be null if you set a value in a non-instance doc

                // Dispatch extension event to instance
<<<<<<< HEAD
                final XBLContainer modifiedContainer = modifiedInstance.getXBLContainer(containingDocument);
                modifiedContainer.dispatchEvent(propertyContext, new XXFormsValueChanged(modifiedInstance));
=======
                modifiedInstance.getXBLContainer(containingDocument).dispatchEvent(propertyContext, new XXFormsValueChanged(containingDocument, modifiedInstance));
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425

                if (!isCalculate) {
                    // When this is called from a calculate, we don't set the flags as revalidate and refresh will have been set already
Solution content
                if (!isCalculate) {
            if (modifiedInstance != null) {// can be null if you set a value in a non-instance doc

                // Dispatch extension event to instance
                final XBLContainer modifiedContainer = modifiedInstance.getXBLContainer(containingDocument);
                modifiedContainer.dispatchEvent(propertyContext, new XXFormsValueChanged(containingDocument, modifiedInstance));

                    // When this is called from a calculate, we don't set the flags as revalidate and refresh will have been set already
File
XFormsSetvalueAction.java
Developer's decision
Manual
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
        final boolean isInsert = insertedNodeInfos != null;

<<<<<<< HEAD
        final boolean isDebugEnabled = XFormsServer.logger.isDebugEnabled();
        final ControlTree currentControlTree = controls.getCurrentControlTree();
=======
        final IndentedLogger indentedLogger = containingDocument.getControls().getIndentedLogger();
        final boolean isDebugEnabled = indentedLogger.isDebugEnabled();
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
        if (newRepeatNodeset != null && newRepeatNodeset.size() > 0) {

            // For each new node, what its old index was, -1 if it was not there
Solution content
        final boolean isInsert = insertedNodeInfos != null;

        final ControlTree currentControlTree = controls.getCurrentControlTree();

        final IndentedLogger indentedLogger = containingDocument.getControls().getIndentedLogger();
        final boolean isDebugEnabled = indentedLogger.isDebugEnabled();

        if (newRepeatNodeset != null && newRepeatNodeset.size() > 0) {

            // For each new node, what its old index was, -1 if it was not there
File
XFormsRepeatControl.java
Developer's decision
Combination
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
                        if (isDebugEnabled) {
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
                    final XFormsRepeatIterationControl movedOrRemovedIteration = (XFormsRepeatIterationControl) oldChildren.get(i);


                    if (isRemoved) {
<<<<<<< HEAD
                        // Indicate to iteration that it is being removed
                        movedOrRemovedIteration.iterationRemoved(propertyContext);
                            containingDocument.startHandleOperation("repeat", "removing iteration", "id", getEffectiveId(), "index", Integer.toString(i + 1));
                        }

                        // Dispatch destruction events
                        currentControlTree.dispatchDestructionEvents(propertyContext, containingDocument, movedOrRemovedIteration);
=======
                        if (isDebugEnabled)
                            indentedLogger.logDebug("xforms:repeat", "removing iteration", "id", getEffectiveId(), "index", Integer.toString(i + 1));
Solution content
                    final XFormsRepeatIterationControl movedOrRemovedIteration = (XFormsRepeatIterationControl) oldChildren.get(i);

                    if (isRemoved) {
                        if (isDebugEnabled) {
                            indentedLogger.startHandleOperation("xforms:repeat", "removing iteration", "id", getEffectiveId(), "index", Integer.toString(i + 1));
                        }

                        // Dispatch destruction events
                        currentControlTree.dispatchDestructionEvents(propertyContext, movedOrRemovedIteration);

                        // Indicate to iteration that it is being removed
                        movedOrRemovedIteration.iterationRemoved(propertyContext);
File
XFormsRepeatControl.java
Developer's decision
Manual
Kind of conflict
Comment
If statement
Method invocation
Chunk
Conflicting content
                    // This new node was not in the old nodeset so create a new one

                    if (isDebugEnabled) {
<<<<<<< HEAD
                        containingDocument.startHandleOperation("repeat", "creating new iteration", "id", getEffectiveId(), "index", Integer.toString(repeatIndex));
=======
                        indentedLogger.logDebug("xforms:repeat", "creating new iteration", "id", getEffectiveId(), "index", Integer.toString(repeatIndex));
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
                    }

                    final XFormsContextStack contextStack = getXBLContainer().getContextStack();
Solution content
                    // This new node was not in the old nodeset so create a new one

                    if (isDebugEnabled) {
                        indentedLogger.startHandleOperation("xforms:repeat", "creating new iteration", "id", getEffectiveId(), "index", Integer.toString(repeatIndex));
                    }

                    final XFormsContextStack contextStack = getXBLContainer().getContextStack();
File
XFormsRepeatControl.java
Developer's decision
Manual
Kind of conflict
Method invocation
Chunk
Conflicting content
                for (int i = 0; i < oldChildren.size(); i++) {

                    if (isDebugEnabled) {
<<<<<<< HEAD
                        containingDocument.startHandleOperation("repeat", "removing iteration", "id", getEffectiveId(), "index", Integer.toString(i + 1));
=======
                        indentedLogger.logDebug("xforms:repeat", "removing iteration", "id", getEffectiveId(), "index", Integer.toString(i + 1));
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
                    }

                    final XFormsRepeatIterationControl removedIteration = (XFormsRepeatIterationControl) oldChildren.get(i);
Solution content
                for (int i = 0; i < oldChildren.size(); i++) {

                    if (isDebugEnabled) {
                        indentedLogger.startHandleOperation("xforms:repeat", "removing iteration", "id", getEffectiveId(), "index", Integer.toString(i + 1));
                    }

                    final XFormsRepeatIterationControl removedIteration = (XFormsRepeatIterationControl) oldChildren.get(i);
File
XFormsRepeatControl.java
Developer's decision
Manual
Kind of conflict
Method invocation
Chunk
Conflicting content
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.QName;
<<<<<<< HEAD
=======
import org.orbeon.oxf.util.IndentedLogger;
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
import org.orbeon.oxf.util.PropertyContext;
import org.orbeon.oxf.xforms.XFormsConstants;
import org.orbeon.oxf.xforms.XFormsUtils;
Solution content
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.QName;
import org.orbeon.oxf.util.IndentedLogger;
import org.orbeon.oxf.util.PropertyContext;
import org.orbeon.oxf.xforms.XFormsConstants;
import org.orbeon.oxf.xforms.XFormsUtils;
File
XFormsTextareaControl.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import org.orbeon.oxf.xforms.XFormsUtils;
import org.orbeon.oxf.xforms.control.XFormsControl;
import org.orbeon.oxf.xforms.control.XFormsValueControl;
<<<<<<< HEAD
import org.orbeon.oxf.xforms.processor.XFormsServer;
=======
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
import org.orbeon.oxf.xforms.xbl.XBLContainer;
import org.orbeon.oxf.xml.XMLUtils;
import org.orbeon.oxf.xml.dom4j.Dom4jUtils;
Solution content
import org.orbeon.oxf.xforms.XFormsUtils;
import org.orbeon.oxf.xforms.control.XFormsControl;
import org.orbeon.oxf.xforms.control.XFormsValueControl;
import org.orbeon.oxf.xforms.xbl.XBLContainer;
import org.orbeon.oxf.xml.XMLUtils;
import org.orbeon.oxf.xml.dom4j.Dom4jUtils;
File
XFormsTextareaControl.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
    }

    private void testOutputResponseState(final PipelineContext pipelineContext, final XFormsContainingDocument containingDocument,
<<<<<<< HEAD
                                         final ContentHandler contentHandler, final XFormsStateManager.XFormsDecodedClientState xformsDecodedClientState) throws SAXException {
=======
                                         final IndentedLogger indentedLogger, final ContentHandler contentHandler,
                                         final XFormsStateManager.XFormsDecodedClientState xformsDecodedClientState) throws SAXException {

        // Make sure we have up to date controls
        final XFormsControls xformsControls = containingDocument.getControls();
        xformsControls.updateControlBindingsIfNeeded(pipelineContext);
        xformsControls.evaluateControlValuesIfNeeded(pipelineContext);

>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
        // Output XML response
        XFormsServer.outputAjaxResponse(containingDocument, indentedLogger, null, pipelineContext, contentHandler, xformsDecodedClientState, null, false, false, false, true);
    }
Solution content
    }

    private void testOutputResponseState(final PipelineContext pipelineContext, final XFormsContainingDocument containingDocument,
                                         final IndentedLogger indentedLogger, final ContentHandler contentHandler,
                                         final XFormsStateManager.XFormsDecodedClientState xformsDecodedClientState) throws SAXException {
        // Output XML response
        XFormsServer.outputAjaxResponse(containingDocument, indentedLogger, null, pipelineContext, contentHandler, xformsDecodedClientState, null, false, false, false, true);
    }
File
XFormsToXHTML.java
Developer's decision
Combination
Kind of conflict
Comment
Method invocation
Variable
Chunk
Conflicting content
                    {
                        // Heartbeat delay
                        {
                final Map clientPropertiesMap;
                {
                    // Dynamic properties
<<<<<<< HEAD
                    final Map dynamicProperties = new HashMap();
=======
                    final Map dynamicProperties = new HashMap();
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
Solution content
                final Map clientPropertiesMap;
                {
                    // Dynamic properties
                    final Map dynamicProperties = new HashMap();
                    {
                        // Heartbeat delay
                        {
File
XHTMLHeadHandler.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
                                    && eventHandler.isMatchEventName(retargetedEvent.getEventName())
                                    && eventHandler.isMatchTarget(retargetedEvent.getTargetObject().getId())) {
                                // Capture phase match on event name and target is specified
<<<<<<< HEAD
=======
                                indentedLogger.startHandleOperation("dispatchEvent", "capture handler");
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
                                containingDocument.startHandleEvent(retargetedEvent);
                                try {
                                    eventHandler.handleEvent(propertyContext, currentEventObserver.getXBLContainer(containingDocument), currentEventObserver, retargetedEvent);
Solution content
                                    && eventHandler.isMatchEventName(retargetedEvent.getEventName())
                                    && eventHandler.isMatchTarget(retargetedEvent.getTargetObject().getId())) {
                                // Capture phase match on event name and target is specified
                                indentedLogger.startHandleOperation("dispatchEvent", "capture handler");
                                containingDocument.startHandleEvent(retargetedEvent);
                                try {
                                    eventHandler.handleEvent(propertyContext, currentEventObserver.getXBLContainer(containingDocument), currentEventObserver, retargetedEvent);
File
XBLContainer.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
                        nextBoundaryIndex++;
                    }

<<<<<<< HEAD
                    if (XFormsServer.logger.isDebugEnabled()) {
                        containingDocument.logDebug("event", "retargeting",
=======
                    if (indentedLogger.isDebugEnabled()) {
                        indentedLogger.logDebug("dispatchEvent", "retargeting",
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
                                "name", originalEvent.getEventName(),
                                "original id", originalEvent.getTargetObject().getEffectiveId(),
                                "new id", retargetedEvent.getTargetObject().getEffectiveId()
Solution content
                        indentedLogger.logDebug("dispatchEvent", "retargeting",
                                "name", originalEvent.getEventName(),
                                "original id", originalEvent.getTargetObject().getEffectiveId(),
                        nextBoundaryIndex++;
                    }

                    if (indentedLogger.isDebugEnabled()) {
                                "new id", retargetedEvent.getTargetObject().getEffectiveId()
File
XBLContainer.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
                        retargetedEvent = getRetargetedEvent(eventsForBoundaries, nextBoundaryEffectiveId, observer, originalEvent);
                        nextBoundaryIndex--;

<<<<<<< HEAD
                        if (XFormsServer.logger.isDebugEnabled()) {
                            containingDocument.logDebug("event", "retargeting",
=======
                        if (indentedLogger.isDebugEnabled()) {
                            indentedLogger.logDebug("dispatchEvent", "retargeting",
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
                                    "name", originalEvent.getEventName(),
                                    "original id", originalEvent.getTargetObject().getEffectiveId(),
                                    "new id", retargetedEvent.getTargetObject().getEffectiveId()
Solution content
                        retargetedEvent = getRetargetedEvent(eventsForBoundaries, nextBoundaryEffectiveId, observer, originalEvent);
                        nextBoundaryIndex--;

                        if (indentedLogger.isDebugEnabled()) {
                            indentedLogger.logDebug("dispatchEvent", "retargeting",
                                    "name", originalEvent.getEventName(),
                                    "original id", originalEvent.getTargetObject().getEffectiveId(),
                                    "new id", retargetedEvent.getTargetObject().getEffectiveId()
File
XBLContainer.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
                                    && eventHandler.isMatchEventName(retargetedEvent.getEventName())
                                    && eventHandler.isMatchTarget(retargetedEvent.getTargetObject().getId())) {
                                // Bubbling phase match on event name and target is specified
<<<<<<< HEAD
=======
                                indentedLogger.startHandleOperation("dispatchEvent", "bubble handler");
>>>>>>> 4a6d2c0a2704e73705cfb3c0dbd5415b21130425
                                containingDocument.startHandleEvent(retargetedEvent);
                                try {
                                    eventHandler.handleEvent(propertyContext, currentEventObserver.getXBLContainer(containingDocument), currentEventObserver, retargetedEvent);
Solution content
                                    && eventHandler.isMatchEventName(retargetedEvent.getEventName())
                                    && eventHandler.isMatchTarget(retargetedEvent.getTargetObject().getId())) {
                                // Bubbling phase match on event name and target is specified
                                indentedLogger.startHandleOperation("dispatchEvent", "bubble handler");
                                containingDocument.startHandleEvent(retargetedEvent);
                                try {
                                    eventHandler.handleEvent(propertyContext, currentEventObserver.getXBLContainer(containingDocument), currentEventObserver, retargetedEvent);
File
XBLContainer.java
Developer's decision
Version 2
Kind of conflict
Method invocation