com.esri.adf.web.data.results
Class WebResultsToc

java.lang.Object
  extended by com.esri.adf.web.data.TocModel
      extended by com.esri.adf.web.data.results.WebResultsToc
All Implemented Interfaces:
WebResultsObserver, WebContextInitialize, Serializable

public class WebResultsToc
extends TocModel
implements WebContextInitialize, WebResultsObserver, Serializable

Defines the result view of a web application:

 <managed-bean>
   <managed-bean-name>resultsView</managed-bean-name>
   <managed-bean-class>com.esri.adf.web.data.results.WebResultsToc</managed-bean-class>
   <managed-bean-scope>none</managed-bean-scope>
 </managed-bean>
 

See Also:
Serialized Form

Field Summary
protected static String TOC_MODEL_TYPE
           
 
Fields inherited from class com.esri.adf.web.data.TocModel
init, showContextMenu, visible
 
Fields inherited from interface com.esri.adf.web.data.results.WebResultsObserver
ALL_RESULTS_CLEARED, RESULT_ADDED, RESULT_MODIFIED, RESULT_REMOVED, RESULT_REPLACED
 
Constructor Summary
WebResultsToc()
          Instantiates an empty object of WebResultsToc.
 
Method Summary
 void destroy()
           The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.
 WebResults getResults()
          Gets the result associated with this TOC.
 Collection<TocNode> getRootNodes()
           
 ResultNode getSelectedResult()
          Gets the result node that has been selected.
 String getTocModelType()
           
 void init(WebContext context)
           The initialization chores of attributes of a WebContext should be performed in this method.
 boolean isShowOpenResultLink()
           
 void reload()
          Reloads the whole TOC tree from the associated result.
 void setResults(WebResults results)
          Sets the result associated with this TOC.
 void setSelectedResult(ResultNode selectedResult)
          Sets the result node that has been selected.
 void webResultsUpdate(WebResults webResults, int updateType, ResultNode affectedNode, Object args)
          Add, remove, replace or modify the given result node.
 
Methods inherited from class com.esri.adf.web.data.TocModel
addTimer, findNode, findNode, getTimers, isInit, isShowContextMenu, isVisible, removeNode, setInit, setShowContextMenu, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOC_MODEL_TYPE

protected static final String TOC_MODEL_TYPE
See Also:
Constant Field Values
Constructor Detail

WebResultsToc

public WebResultsToc()
Instantiates an empty object of WebResultsToc.

Method Detail

init

public void init(WebContext context)
Description copied from interface: 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.

Specified by:
init in interface WebContextInitialize
Parameters:
context - WebContext- the WebContext
See Also:
WebContext.init(WebContext), WebContext.addResource(String, GISResource, int), WebContext.removeResource(GISResource)

destroy

public void destroy()
Description copied from interface: 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.

Specified by:
destroy in interface WebContextInitialize
See Also:
WebContext.destroy()

getTocModelType

public String getTocModelType()
Specified by:
getTocModelType in class TocModel

getRootNodes

public Collection<TocNode> getRootNodes()
Specified by:
getRootNodes in class TocModel

getResults

public WebResults getResults()
Gets the result associated with this TOC.


setResults

public void setResults(WebResults results)
Sets the result associated with this TOC.


getSelectedResult

public ResultNode getSelectedResult()
Gets the result node that has been selected.


setSelectedResult

public void setSelectedResult(ResultNode selectedResult)
Sets the result node that has been selected.

Parameters:
selectedResult - the node reference.

reload

public void reload()
Reloads the whole TOC tree from the associated result.


webResultsUpdate

public void webResultsUpdate(WebResults webResults,
                             int updateType,
                             ResultNode affectedNode,
                             Object args)
Add, remove, replace or modify the given result node.

Specified by:
webResultsUpdate in interface WebResultsObserver
Parameters:
updateType - the update type e.g. WebResultsObserver.RESULT_ADDED
affectedNode - the node to be add, remove, replace or modify.
args - a ResultNode to be replaced (only for replace type).
webResults - the WebResults object that was updated

isShowOpenResultLink

public boolean isShowOpenResultLink()
Overrides:
isShowOpenResultLink in class TocModel