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

com.vaadin.polymer.app.widget.AppPouchdbConflictResolution Maven / Gradle / Ivy

The newest version!
/*
 * This code was generated with Vaadin Web Component GWT API Generator, 
 * from app-pouchdb project by The Polymer Authors
 * that is licensed with http://polymer.github.io/LICENSE.txt license.
 */
package com.vaadin.polymer.app.widget;

import com.vaadin.polymer.app.*;

import com.vaadin.polymer.*;
import com.vaadin.polymer.elemental.*;
import com.vaadin.polymer.PolymerWidget;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.core.client.JavaScriptObject;

/**
 * 

app-pouchdb-conflict-resolution enables declarative configuration of conflict
resolution strategies ordered by logical relationships in the DOM. Currently
two basic strategies are supported: firstWriteWins and lastWriteWins.

*

To use app-pouchdb-conflict-resolution, simply include the element somewhere
in a document subtree at or above the ShadowRoot of an app-pouchdb-document
or app-pouchdb-query:

*
<app-pouchdb-conflict-resolution
 *     strategy="lastWriteWins">
 * </app-pouchdb-conflict-resolution>
 * <app-pouchdb-document
 *     db-name="cats"
 *     doc-id="parsnip">
 * </app-pouchdb-document>
 * 
*

When a conflict occurs, the app-pouchdb-document will request fire an event
to notify of the conflict and request a resolution strategy. The
app-pouchdb-conflict-resolution element listens at its nearest ShadowRoot
boundary for conflict notifications, and responds to them as needed with a
configured strategy.

*/ public class AppPouchdbConflictResolution extends PolymerWidget { /** * Default Constructor. */ public AppPouchdbConflictResolution() { this(""); } /** * Constructor used by UIBinder to create widgets with content. */ public AppPouchdbConflictResolution(String html) { super(AppPouchdbConflictResolutionElement.TAG, AppPouchdbConflictResolutionElement.SRC, html); } /** * Gets a handle to the Polymer object's underlying DOM element. */ public AppPouchdbConflictResolutionElement getPolymerElement() { return (AppPouchdbConflictResolutionElement) getElement(); } /** *

By default, this element stops propagation of any conflict events
that it is able to handle. If set to true, the element will allow
such events to continue propagating, opening the possibility that
another conflict resolution strategy higher up the document tree will
superseed this one.

* * JavaScript Info: * @property allowAncestralResolution * @type Boolean * */ public boolean getAllowAncestralResolution() { return getPolymerElement().getAllowAncestralResolution(); } /** *

By default, this element stops propagation of any conflict events
that it is able to handle. If set to true, the element will allow
such events to continue propagating, opening the possibility that
another conflict resolution strategy higher up the document tree will
superseed this one.

* * JavaScript Info: * @property allowAncestralResolution * @type Boolean * */ public void setAllowAncestralResolution(boolean value) { getPolymerElement().setAllowAncestralResolution(value); } /** *

The name of the strategy to use to reslve the conflict. Supported
strategies are firstWriteWins (the default) and lastWriteWins.

* * JavaScript Info: * @property strategy * @type String * */ public String getStrategy() { return getPolymerElement().getStrategy(); } /** *

The name of the strategy to use to reslve the conflict. Supported
strategies are firstWriteWins (the default) and lastWriteWins.

* * JavaScript Info: * @property strategy * @type String * */ public void setStrategy(String value) { getPolymerElement().setStrategy(value); } /** * * * JavaScript Info: * @method firstWriteWins * @param {} db * @param {} method * @param {} doc * @param {} error * * */ public void firstWriteWins(Object db, Object method, Object doc, Object error) { getPolymerElement().firstWriteWins(db, method, doc, error); } /** * * * JavaScript Info: * @method lastWriteWins * @param {} db * @param {} method * @param {} doc * @param {} error * * */ public void lastWriteWins(Object db, Object method, Object doc, Object error) { getPolymerElement().lastWriteWins(db, method, doc, error); } /** * * * JavaScript Info: * @method resolveConflict * @param {} event * * */ public void resolveConflict(Object event) { getPolymerElement().resolveConflict(event); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy