org.vfny.geoserver.action
Class ConfigAction

java.lang.Object
  extended byorg.apache.struts.action.Action
      extended byorg.vfny.geoserver.action.GeoServerAction
          extended byorg.vfny.geoserver.action.ConfigAction
Direct Known Subclasses:
DataAttributeTypesEditorAction, DataAttributeTypesNewAction, DataAttributeTypesSelectAction, DataDataStoresEditorAction, DataDataStoresNewAction, DataDataStoresSelectAction, DataFeatureTypesEditorAction, DataFeatureTypesNewAction, DataFeatureTypesSelectAction, DataNamespacesAction, DataStylesAction, GeoServerConfigurationSubmit, LoadXMLAction, SaveXMLAction, UpdateGSAction, ValidationTestEditorAction, ValidationTestNewAction, ValidationTestSelectAction, ValidationTestSuiteNewAction, ValidationTestSuiteSelectAction, WFSContentAction, WFSDescriptionAction, WMSContentAction, WMSDescriptionAction

public class ConfigAction
extends GeoServerAction

GeoConfigAction is a common super class used by STRUTS Actions.

ConfigAction is used to store shared services, such as looking up the Configuration Model.

Capabilities:

Most config actions require the follow check to be made:


 class MyConfigAction extends ConfigAction {
   Redirect execute( HttpServletRequest request, ){
     if( !isLoggedIn( request )){
       return new Redirect(“Login Page”);
     }
     UserContainer user = getUserContainer( request );
     …
     return new Redirect(“my.jsp”);
   }
 }
 

To prevent the duplication of the above code in each and every config action pleaes make use of the alternate execute method:


 class MyConfigAction extends ConfigAction {
   Redirect execute( UserContainer user, HttpServletRequest request ){
     …
     return new Redirect(“my.jsp”);
   }
 }
 

Please remember that Actions (like servlets) should never make use of instance variables in order to remain thread-safe.


Field Summary
 
Fields inherited from class org.apache.struts.action.Action
ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY
 
Constructor Summary
ConfigAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Execute method that redirects user if not loggin in.
protected  DataConfig getDataConfig()
          Access Catalog Configuration Model from the WebContainer.
protected  GlobalConfig getGlobalConfig()
          Access Web Map Server Configuration Model from the WebContainer.
protected  WFSConfig getWFSConfig()
          Access Web Feature Server Configuration Model from the WebContainer.
protected  WMSConfig getWMSConfig()
          Access Web Map Server Configuration Model from the WebContainer.
 
Methods inherited from class org.vfny.geoserver.action.GeoServerAction
getApplicationState, getGeoServer, getUserContainer, isLoggedIn, logOut
 
Methods inherited from class org.apache.struts.action.Action
execute, generateToken, getDataSource, getDataSource, getLocale, getResources, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, perform, perform, resetToken, saveErrors, saveMessages, saveToken, setLocale, setServlet, toHex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigAction

public ConfigAction()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws java.lang.Exception
Execute method that redirects user if not loggin in.

The UserContainer is gathered from the session context using the GeoServerAction.getUserContainer( request method ).

Throws:
java.lang.Exception
See Also:
Action.execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

getWMSConfig

protected WMSConfig getWMSConfig()
Access Web Map Server Configuration Model from the WebContainer.

Note that this represents the Configuration and not the state of the Web Feature Server.

Returns:
Configuration information for the Web Map Server

getWFSConfig

protected WFSConfig getWFSConfig()
Access Web Feature Server Configuration Model from the WebContainer.

Note that this represents the Configuration and not the state of the Web Feature Server.

Returns:
Configuration information for Web Feature Server

getGlobalConfig

protected GlobalConfig getGlobalConfig()
Access Web Map Server Configuration Model from the WebContainer.

Returns:
Configuration model for Global information.

getDataConfig

protected DataConfig getDataConfig()
Access Catalog Configuration Model from the WebContainer.

Returns:
Configuration model for Catalog information.