com.esri.adf.web.ags.data.edit
Class EditWorkspace

java.lang.Object
  extended by com.esri.adf.web.ags.data.edit.EditWorkspace
All Implemented Interfaces:
Serializable

public class EditWorkspace
extends Object
implements Serializable

A wrapper of IWorkspace. It handles both versioned and non-versioned workspace. An EditWorkspace may fire the following events:

  • PostActionEvent
  • PreActionEvent
  • Check ArcObject com.esri.arcgis.geodatabase.IWorkspace for more information.

    See Also:
    Serialized Form

    Constructor Summary
    EditWorkspace(String version, boolean pooled, com.esri.arcgis.carto.IFeatureLayer layer, String wsID, Boolean childWin, Boolean columnLevel)
              Instantiates an object of EditWorkspace.
     
    Method Summary
     void addEventListener(ActionEventListener listener)
              Registers an event listener.
     void discard()
              Discards all changes since the last save, and release all cached resources.
     boolean equals(Object obj)
              Returns true if two workspaces are refer to same server workspace object.
    protected  void fireEvent(EditEvent event)
              Fires an event to listeners.
     boolean hasEdits()
              Returns true if there are edits.
     int hashCode()
               
     boolean hasRedo()
              Returns true if edits can be redone.
     boolean hasUndo()
              Returns true if edits can be undone.
     boolean isBeingEdited()
              Returns true if the workspace is being edited.
     boolean isValid()
              Returns true if the workspace is valid.
     void perform(ActionContext context, EditAction... actions)
              Performs one or more predefined actions.
     void redo()
              Redo previous edit if the action can be redone.
     void removeEventListener(ActionEventListener listener)
              Unregisters an event listener.
     void save()
              Saves changes since the last save, and release all cached resources.
     void startEditOperation()
              Starts editing.
     void stopEditOperation()
              Stops editing.
     void undo()
              Undo previous edit if the previous action can be undone.
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    EditWorkspace

    public EditWorkspace(String version,
                         boolean pooled,
                         com.esri.arcgis.carto.IFeatureLayer layer,
                         String wsID,
                         Boolean childWin,
                         Boolean columnLevel)
                  throws com.esri.arcgis.interop.AutomationException,
                         IOException
    Instantiates an object of EditWorkspace.

    Parameters:
    version - the work version name.
    pooled - set to true if the map server is pooled.
    layer - the work layer.
    wsID - the optional workspace ID.
    childWin - set to true for child win reconcile.
    columnLevel - set to true for column level reconcile.
    Throws:
    com.esri.arcgis.interop.AutomationException - If the ArcObject component throws an exception.
    IOException - If there are interop problems.
    Method Detail

    hasRedo

    public boolean hasRedo()
    Returns true if edits can be redone.

    Returns:
    Returns true if edits can be redone.

    hasEdits

    public boolean hasEdits()
    Returns true if there are edits.

    Returns:
    Returns true if there are edits.

    isBeingEdited

    public boolean isBeingEdited()
    Returns true if the workspace is being edited.

    Returns:
    Returns true if the workspace is being edited.

    hasUndo

    public boolean hasUndo()
    Returns true if edits can be undone.

    Returns:
    Returns true if edits can be undone.

    save

    public void save()
              throws com.esri.arcgis.interop.AutomationException,
                     IOException
    Saves changes since the last save, and release all cached resources.

    Throws:
    com.esri.arcgis.interop.AutomationException
    IOException

    discard

    public void discard()
                 throws Throwable
    Discards all changes since the last save, and release all cached resources.

    Throws:
    Throwable

    undo

    public void undo()
              throws com.esri.arcgis.interop.AutomationException,
                     IOException
    Undo previous edit if the previous action can be undone.

    Throws:
    com.esri.arcgis.interop.AutomationException
    IOException
    See Also:
    hasUndo()

    redo

    public void redo()
              throws com.esri.arcgis.interop.AutomationException,
                     IOException
    Redo previous edit if the action can be redone.

    Throws:
    com.esri.arcgis.interop.AutomationException
    IOException
    See Also:
    hasRedo()

    startEditOperation

    public void startEditOperation()
    Starts editing. If the action is session aware, the perform method will start editing session beforehand.

    See Also:
    perform(ActionContext, EditAction...)

    stopEditOperation

    public void stopEditOperation()
                           throws Exception
    Stops editing. If the action is session aware, the perform method will start editing session beforehand.

    Throws:
    IllegalAccessException - when unable to delete the vertex. The number of points will be less than required for the feature.
    Exception
    See Also:
    perform(ActionContext, EditAction...)

    equals

    public boolean equals(Object obj)
    Returns true if two workspaces are refer to same server workspace object.

    Overrides:
    equals in class Object

    hashCode

    public int hashCode()
    Overrides:
    hashCode in class Object

    isValid

    public boolean isValid()
    Returns true if the workspace is valid.

    Returns:
    true if the workspace is valid.

    perform

    public void perform(ActionContext context,
                        EditAction... actions)
                 throws Exception
    Performs one or more predefined actions. For multiple actions perform, the edit session starts from the first session aware action, and stop after finishing the last action.

    Parameters:
    context - the action context.
    actions - one or more actions.
    Throws:
    Exception

    addEventListener

    public void addEventListener(ActionEventListener listener)
    Registers an event listener. EditWorkspace may fire the following events:
  • PostActionEvent
  • PreActionEvent
  • Parameters:
    listener - the listener to register.

    removeEventListener

    public void removeEventListener(ActionEventListener listener)
    Unregisters an event listener.

    Parameters:
    listener - listener to unregister.

    fireEvent

    protected void fireEvent(EditEvent event)
    Fires an event to listeners.

    Parameters:
    event - the event to fire.