|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.adf.web.ags.data.edit.bean.EditBean
public class EditBean
This is the backing bean that handles all editing functions. You can override this bean to change default behaviors of the Web Editor. The sample code shows how to change the default "select" action to XOR select.
public class EditEx extends EditBean{ private static final long serialVersionUID = 1L; public EditEx() { super(); } // override the server action of the select button public void select(MapEvent event) { try { // convert spatial reference of the select box to the map spatial reference. WebGeometry extent = toMapGeometry(event.getWebGeometry()); // convert the ADF geometry to an ArcObject geometry IEnvelope env = EditWebUtil.toEnvelope((WebExtent) extent, getCache() .getServerContext()); // create a select action SelectByExtent select = new SelectByExtent(env); // turn on the XOR mode select.setXorMode(true); // process the action process(select, true); // refresh the map image. getWebContext().refresh(); } catch (Exception e) { e.printStackTrace(); } }
Nested Class Summary | |
---|---|
static class |
EditBean.GeometryType
Geometry Types: point, line, polygon. |
Field Summary | |
---|---|
protected ResourceBean |
cache
The resources and cache associated with the editing bean. |
protected ConfigBean |
config
The configuration. |
protected String |
statusMessage
The status message to send to client side. |
Constructor Summary | |
---|---|
EditBean()
|
Method Summary | |
---|---|
void |
activate()
Objects (context attributes, resources and functionalities) should perform setup tasks to ready themselves up to do user operations in this method. |
void |
addPoint(MapEvent event)
A task action to add Point feature. |
void |
addPolygon(MapEvent event)
A task action to add polygon feature. |
void |
addPolyline(MapEvent event)
A task action to add line feature. |
void |
addVertex(MapEvent event)
A task action to insert a vertex either along an existing segment, or between two existing vertices. |
void |
changeConfig(Map<?,?> request,
Element response)
Handles the AJAX "changeConfig" call. |
void |
clearSelect()
Clears all the selected feature on the current layer. |
void |
closeEditor(Map<?,?> request,
Element response)
Handles the AJAX "closeEditor" call. |
void |
closeEditWindows()
A task tool to stop editing, discard unsaved edits, and close editing window. |
void |
continueEnterXY(String xValue,
String yValue)
A task action to add XY values. |
protected void |
copy(MapEvent event)
A task action to copy the feature by clicking anywhere on the map to locate the new feature. |
void |
copyPoint(MapEvent event)
A task action to copy the feature by clicking anywhere on the map to locate the new feature. |
void |
copyPolygon(MapEvent event)
A task action to copy the feature by clicking anywhere on the map to locate the new feature. |
void |
copyPolyline(MapEvent event)
A task action to copy the feature by clicking anywhere on the map to locate the new feature. |
void |
delete()
A task tool to delete the selected feature. |
void |
deleteVertex(MapEvent event)
A task action to delete the selected vertex. |
void |
destroy()
The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in
this method. |
void |
discard()
A task tool to stop editing and discard all the changes. |
void |
enterFinalXY(String xValue,
String yValue)
A task action to enter the last XY value. |
void |
enterXY(Map<?,?> request,
Element response)
Handles the AJAX "enterXY" call. |
void |
enterXY(String clientAction,
String serverAction)
A task action to build or modify geometry by entering XY values instead of using a Map Mouse click. |
protected void |
finalize()
|
void |
firstOID()
Moves to the first selected feature in the queue. |
String |
getApplyLabel()
A label property in the editing window. |
AttributeFilter |
getAttributeFilter()
Gets the attribute filter. |
Attribute[] |
getAttributes()
Gets all the attributes of the current selected feature. |
String |
getAttributesLabel()
A label property in the editing window. |
protected ResourceBean |
getCache()
Gets the resources associated with the current bean. |
String |
getCloseWindowConfirmLabel()
A label property in the editing window. |
String |
getConfigurationName()
Gets the configuration name of the EditBean. |
List<javax.faces.model.SelectItem> |
getConfigurationNames()
Gets the available configurations of the EditBean. |
List<ConfigBean> |
getConfigurations()
Gets the available configurations of the EditBean. |
String |
getContinueLabel()
A label property in the editing window. |
String |
getCreateFeatureLabel()
A label property in the editing window. |
int |
getCurrentOID()
Gets the current OID of the selected feature. |
int |
getCurrentOIDIndex()
Gets the index of the current OID in the selected features. |
DateFormat |
getDateFormat()
Gets the date format for date converting. |
String |
getEditFeatureLabel()
A label property in the editing window. |
String |
getEditLabel()
A label property in the editing window. |
String |
getEnteredLabel()
A label property in the editing window. |
String |
getEnteredLastPoint()
Gets the last entered point as a string. |
String |
getEnterGeometyType()
Gets the geometry type of the tool operation. |
ActionEventListener |
getEventListener()
Gets the event listener of actions. |
String |
getFeaturesLabel()
A label property in the editing window. |
String |
getFinalLabel()
A label property in the editing window. |
Integer |
getLayerID()
Gets the layer index of the working layer. |
Map<Integer,String> |
getLayers()
Gets the layers list for editing. |
String |
getMaxCountLabel()
A label property in the editing window. |
int |
getNumberOfConfig()
Returns the number of configurations. |
int |
getNumberOfVersions()
Returns the number of configurations. |
String |
getPixelsLabel()
A label property in the editing window. |
int |
getSeleciontSize()
Deprecated. |
String |
getSelectColorLabel()
A label property in the editing window. |
String |
getSelectConfigLabel()
A label property in the editing window. |
String |
getSelectFeaturesLabel()
A label property in the editing window. |
int |
getSelectionSize()
Gets the size of feature selection on the current layer. |
String |
getSelectVersionLabel()
A label property in the editing window. |
String |
getSettingsLabel()
A label property in the editing window. |
String |
getShapeType()
Gets the geometry type of the current working layer. |
String |
getSnapColorLabel()
A label property in the editing window. |
SnapRulesBean[] |
getSnapRules()
Gets the snapping settings. |
String |
getStartEditingLabel()
A label property in the editing window. |
String |
getStatusMessage()
A task property "statusMessage" showing operation status. |
ConfigBean |
getTaskConfig()
Gets the configuration. |
String |
getTaskName()
Gets task window title. |
String |
getToleranceLabel()
A label property in the editing window. |
String |
getTypeLabel()
A label property in the editing window. |
String |
getVersion()
Gets the working version for editing. |
List<javax.faces.model.SelectItem> |
getVersions()
Sets the available version list for editing. |
String |
getVerticesColorLabel()
A label property in the editing window. |
protected WebContext |
getWebContext()
Gets the webContext associated with the bean. |
String |
getWindowName()
Gets the current window associated with bean. |
boolean |
hasEdits()
Returns true if there are edits available. |
boolean |
hasNextOID()
Returns true if current feature is not the last in the queue. |
boolean |
hasPreOID()
Returns true if current feature is not the first in the queue. |
void |
init(Map<?,?> request,
Element response)
Handles the AJAX "init" call. |
void |
init(WebContext context)
The initialization chores of attributes of a WebContext should be performed in this method. |
boolean |
isAddFeaturesEnabled()
Returns true if add attributes function is enabled. |
boolean |
isBeingEdited()
Returns true if it is in the middle of a editing session. |
boolean |
isContinueEnterXY()
Returns true if can continue enter XY value. |
boolean |
isEditAttributesEnabled()
Returns true if edit attributes function is enabled. |
boolean |
isEditFeaturesEnabled()
Returns true if edit features function is enabled. |
boolean |
isEnterFinalXY()
Returns true if can enter final XY value. |
boolean |
isPooledEditing()
Returns true if the map service is pooled. |
boolean |
isRedoable()
Returns true if redo is enabled. |
boolean |
isReshapeable()
Returns true if the vertices is on. |
boolean |
isSelected()
Returns true if there features selected. |
boolean |
isSnapEnabled()
Returns true if the snapping is enabled. |
boolean |
isUndoable()
Returns true if undo is enabled. |
boolean |
isVersionedEditing()
Returns true if the data source supports versioning. |
boolean |
isWindowOpened()
Returns true if the editor window is opened. |
void |
lastOID()
Moves to the last selected feature in the queue. |
protected void |
merge()
A task tool to operates on a selection set at least two features must be selected. |
void |
mergePolygon()
A task tool to operates on a selection set at least two features must be selected. |
void |
mergePolyline()
A task tool to operates on a selection set at least two features must be selected. |
void |
move(MapEvent event)
A task action to re-locate the feature by clicking anywhere on the map. |
void |
moveVertex(MapEvent event)
A task tool to move an existing vertex. |
void |
nextOID()
Moves to the next OID in the queue. |
void |
onAjaxServerAction(Map<?,?> request,
Element response)
Handlers the editing AJAX calls. |
void |
passivate()
Objects (context attributes, resources and functionalities) should perform cleanup tasks after having performed user operations in this method. |
void |
preOID()
Moves to the previous selected feature in the queue. |
protected void |
process(EditAction action,
boolean changeSelection)
Processes the action. |
void |
redo()
A task tool to redo edits |
void |
refresh()
Redraws the associated MapControl. |
void |
refresh(Map<?,?> request,
Element response)
Handles the AJAX "refresh" call. |
protected void |
renderAttribute(Element root,
Attribute att)
Converts the attribute to an element and appends it to the given root element. |
protected void |
renderConfig(Element root)
Converts the ConfigBean to an element and appends it to the given parent element. |
protected void |
renderLayers(Element root)
Converts the layers to an element and appends it to the given parent element. |
protected void |
resetSelectionIndex()
Resets the index of the selection queue to "0". |
void |
save()
A task tool to stop and save all the edits. |
void |
select(MapEvent event)
Selects feature within the given extent. |
void |
setAttributeFilter(AttributeFilter attributeFilter)
Sets the attribute filter. |
void |
setAvailableConfigurations(List<ConfigBean> configBeans)
Sets the available configurations of the EditBean. |
void |
setConfigurationName(String configurationName)
Sets the configuration of the EditBean by name. |
void |
setDateFormat(DateFormat dateFormat)
Sets the date format for date converting. |
void |
setEventListener(ActionEventListener eventListener)
Sets the event listener of actions. |
void |
setLayerID(Integer layerID)
Sets the layer index of the working layer. |
void |
setTaskConfig(ConfigBean configbean)
Sets the configuration. |
void |
setTaskName(String taskName)
Sets the name of the Bean. |
void |
setVersion(String version)
Sets the working version for editing. |
void |
setWindowOpened(boolean windowOpened)
Sets to true if the editor window is opened. |
void |
showVertices()
A task tool to show vertices on selected feature. |
void |
snapPoint(Map<?,?> request,
Element response)
Handles the AJAX "snapPoint" call. |
Object[] |
snapPoint(WebPoint point)
Returns snap result of the given point in map reference system. |
void |
splitLine(MapEvent event)
A task tool allows the user to select a point along existing segment to split the line feature. |
void |
splitPolygon(MapEvent event)
A task action to sketch a line to split the polygon feature. |
void |
startEditing()
Starts editing. |
protected static String |
toLocalMessage(String message)
Gets the localized message. |
protected static String |
toLocalMessage(String message,
Object[] params)
Gets the localized message. |
protected WebGeometry |
toMapGeometry(WebGeometry geometry)
Converts the geometry to a map geometry. |
void |
toXML(Element root)
Renders attributes of this editing bean to elements and append them to the given root. |
void |
undo()
A task too to undo previous edit. |
void |
updateAttribute(int index,
String value)
Updates the attribute. |
void |
updateAttributes(Map<?,?> request,
Element response)
Handles the AJAX "updateAttributes" call. |
void |
updateSettings(Map<?,?> request,
Element response)
Handles the AJAX "updateSettings" call. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ResourceBean cache
protected ConfigBean config
protected String statusMessage
Constructor Detail |
---|
public EditBean()
Method Detail |
---|
public void destroy()
WebContextInitialize
The cleaup chores (such as releasing held resources) of attributes of a WebContext
should be performed in
this method.
Typically this method is called by the WebContext
when the context itself is destroyed.
The WebContext
attribute is unusable after this method has been called.
destroy
in interface WebContextInitialize
WebContext.destroy()
protected void finalize() throws Throwable
finalize
in class Object
Throwable
public void activate()
WebLifecycle
Objects (context attributes, resources and functionalities) should perform setup tasks to ready themselves up to do user operations in this method.
Typical setup tasks including (re)connecting to GIS servers and (re)hydrating server objects. This method is called
on context attributes and on resources by the WebContext
when the context itself is activated. The resource
subsequently calls this method on its functionalities.
This method is called on every request before the JSF lifecycle is executed.
activate
in interface WebLifecycle
WebContext.activate()
public void passivate()
WebLifecycle
Objects (context attributes, resources and functionalities) should perform cleanup tasks after having performed user operations in this method.
Typical cleanup tasks including closing connections to GIS servers and dehydrating server objects. This method is
called on context attributes and on resources by the WebContext
when the context itself is passivated. The
resource subsequently calls this method on its functionalities.
This method is called on every request after the JSF lifecycle is executed.
passivate
in interface WebLifecycle
WebContext.passivate()
public void init(WebContext context)
WebContextInitialize
The initialization chores of attributes of a WebContext
should be performed in this method.
Typically this method is called by the WebContext
when the context itself is initialized. It is important
to note that this method is again called by the context when a GISResource
is dynamically added to or
removed from the context. Classes that implement this method should keep this in mind and adapt the method to react
to the callbacks in these circumstances as well.
A WebContext
attribute is usable only after this method has been called.
init
in interface WebContextInitialize
context
- WebContext
- the WebContextWebContext.init(WebContext)
,
WebContext.addResource(String, GISResource, int)
,
WebContext.removeResource(GISResource)
public List<javax.faces.model.SelectItem> getVersions()
public String getVersion()
public void setVersion(String version)
version
- The version to set.public Map<Integer,String> getLayers()
public String getShapeType()
public Integer getLayerID()
public void setLayerID(Integer layerID)
layerID
- The layerID to set.public String getWindowName()
public void clearSelect()
public void startEditing()
public void select(MapEvent event)
event
- the map event contain the extent.public void updateAttribute(int index, String value)
value
- the new value of the attribute.index
- the index of the attribute.public Attribute[] getAttributes()
public boolean isSelected()
public boolean isReshapeable()
public int getCurrentOID()
public int getCurrentOIDIndex()
public int getSeleciontSize()
public int getSelectionSize()
public void nextOID()
public void firstOID()
public void lastOID()
public void preOID()
public boolean hasNextOID()
public boolean hasPreOID()
public void refresh()
public boolean hasEdits()
public boolean isBeingEdited()
protected static String toLocalMessage(String message)
protected static String toLocalMessage(String message, Object[] params)
public void showVertices()
public void save()
public void discard()
public boolean isUndoable()
public boolean isRedoable()
public void redo()
public void undo()
public void copyPoint(MapEvent event)
event
- public void copyPolyline(MapEvent event)
event
- public void copyPolygon(MapEvent event)
event
- protected void copy(MapEvent event)
event
- public void move(MapEvent event)
event
- public void splitLine(MapEvent event)
event
- public void splitPolygon(MapEvent event)
event
- public void delete()
public void mergePolyline()
public void mergePolygon()
protected void merge()
public void addVertex(MapEvent event)
event
- public void moveVertex(MapEvent event)
event
- public void deleteVertex(MapEvent event)
event
- public void addPoint(MapEvent event)
event
- public void addPolyline(MapEvent event)
event
- public void addPolygon(MapEvent event)
event
- public String getStatusMessage()
public ConfigBean getTaskConfig()
public void setTaskConfig(ConfigBean configbean)
configbean
- The config to set.public ActionEventListener getEventListener()
public void setEventListener(ActionEventListener eventListener)
eventListener
- The eventListener to set.public AttributeFilter getAttributeFilter()
public void setAttributeFilter(AttributeFilter attributeFilter)
attributeFilter
- The attributeFilter to set.public SnapRulesBean[] getSnapRules()
public boolean isSnapEnabled()
public Object[] snapPoint(WebPoint point)
point
- the input point in screen reference system.
1. snap point in screen reference system or null. 2. snap layers String or null.
public boolean isPooledEditing()
public boolean isVersionedEditing()
public boolean isAddFeaturesEnabled()
public boolean isEditAttributesEnabled()
public boolean isEditFeaturesEnabled()
public String getTaskName()
public void setTaskName(String taskName)
taskName
- the bean name.public boolean isContinueEnterXY()
public boolean isEnterFinalXY()
public String getEnterGeometyType()
public String getEnteredLastPoint()
public void enterXY(String clientAction, String serverAction)
public void continueEnterXY(String xValue, String yValue)
public void enterFinalXY(String xValue, String yValue)
protected void resetSelectionIndex()
protected void process(EditAction action, boolean changeSelection) throws Exception
action
- the action to process.changeSelection
- set to true if the action need to update selection.
Exception
protected WebGeometry toMapGeometry(WebGeometry geometry)
geometry
- the geometry to convert.
protected WebContext getWebContext()
protected ResourceBean getCache()
public void closeEditWindows()
public DateFormat getDateFormat()
"Sep 21, 2007 12:00:00 AM"
public void setDateFormat(DateFormat dateFormat)
"Sep 21, 2007 12:00:00 AM"
dateFormat
- The dateFormat to set.public boolean isWindowOpened()
public void setWindowOpened(boolean windowOpened)
windowOpened
- Sets to true if the editor window is opened.public String getSettingsLabel()
public String getCreateFeatureLabel()
public String getEditFeatureLabel()
public String getSelectFeaturesLabel()
public String getEditLabel()
public String getAttributesLabel()
public String getToleranceLabel()
public String getPixelsLabel()
public String getMaxCountLabel()
public String getFeaturesLabel()
public String getStartEditingLabel()
public String getSelectVersionLabel()
public String getSelectConfigLabel()
public String getSelectColorLabel()
public String getVerticesColorLabel()
public String getSnapColorLabel()
public String getApplyLabel()
public String getContinueLabel()
public String getFinalLabel()
public String getTypeLabel()
public String getEnteredLabel()
public String getCloseWindowConfirmLabel()
public void toXML(Element root)
root
- the root element to append the attributes elements.protected void renderLayers(Element root)
root
- the parent elementprotected void renderConfig(Element root)
protected void renderAttribute(Element root, Attribute att)
root
- the root element to append the attribute element.att
- the attribute to convert.public void onAjaxServerAction(Map<?,?> request, Element response)
request
- the request key value pairs.response
- the output element.public void init(Map<?,?> request, Element response)
request
- the request key value pairs.response
- the output element.public void closeEditor(Map<?,?> request, Element response)
request
- the request key value pairs.response
- the output element.public void snapPoint(Map<?,?> request, Element response)
request
- the request key value pairs.response
- the output element.public void updateAttributes(Map<?,?> request, Element response)
request
- the request key value pairs.response
- the output element.public void refresh(Map<?,?> request, Element response)
request
- the request key value pairs.response
- the output element.public void enterXY(Map<?,?> request, Element response)
request
- the request key value pairs.response
- the output element.public void updateSettings(Map<?,?> request, Element response)
request
- the request key value pairs.response
- the output element.public void changeConfig(Map<?,?> request, Element response)
request
- the request key value pairs.response
- the output element.public List<ConfigBean> getConfigurations()
public List<javax.faces.model.SelectItem> getConfigurationNames()
public String getConfigurationName()
public void setConfigurationName(String configurationName)
configurationName
- The name of the configuration bean to set.public void setAvailableConfigurations(List<ConfigBean> configBeans)
configBeans
- The available configurations to set.public int getNumberOfConfig()
public int getNumberOfVersions()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |