You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/08/31 21:38:44 UTC
svn commit: r265562 [2/4] - in /beehive/trunk/netui:
src/core/org/apache/beehive/netui/core/factory/
src/pageflow/org/apache/beehive/netui/pageflow/
src/pageflow/org/apache/beehive/netui/pageflow/config/
src/pageflow/org/apache/beehive/netui/pageflow/h...
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java Wed Aug 31 12:37:55 2005
@@ -19,7 +19,7 @@
import org.apache.struts.config.ControllerConfig;
import org.apache.struts.upload.CommonsMultipartRequestHandler;
-import org.apache.beehive.netui.util.config.bean.PageflowConfig;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.PageflowConfig;
import org.apache.beehive.netui.pageflow.internal.InternalUtils;
import java.util.LinkedHashMap;
@@ -31,7 +31,7 @@
public class PageFlowControllerConfig extends ControllerConfig
{
private static final String COMMONS_MULTIPART_HANDLER_CLASS = CommonsMultipartRequestHandler.class.getName();
-
+
private boolean _isNestedPageFlow;
private boolean _isLongLivedPageFlow;
private boolean _isReturnToPageDisabled;
@@ -44,7 +44,7 @@
private String _overrideMemFileSize = null;
private boolean _forceMultipartDisabled = false;
-
+
public boolean isNestedPageFlow()
{
return _isNestedPageFlow;
@@ -102,10 +102,10 @@
_sharedFlowTypes = null;
return;
}
-
+
String[] keyValues = sharedFlows.split( "," );
_sharedFlowTypes = new LinkedHashMap/*< String, String >*/();
-
+
for ( int i = 0; i < keyValues.length; i++ )
{
String keyValue = keyValues[i];
@@ -115,12 +115,12 @@
_sharedFlowTypes.put( keyValue.substring( 0, delim ), keyValue.substring( delim + 1 ) );
}
}
-
+
public String getSharedFlows()
{
throw new UnsupportedOperationException( "not implemented; uses getSharedFlowTypes" );
}
-
+
public Map/*< String, String >*/ getSharedFlowTypes()
{
return _sharedFlowTypes;
@@ -149,12 +149,12 @@
/**
* This gets the multipart class. If it was explicitly set on the associated <controller> element, just use that;
* otherwise, get the value from WEB-INF/beehive-netui-config.xml.
- */
+ */
public String getMultipartClass()
{
if ( _forceMultipartDisabled ) return null;
if ( _overrideMultipartClass != null ) return _overrideMultipartClass;
-
+
PageflowConfig.MultipartHandler.Enum mpHandler = InternalUtils.getMultipartHandlerType();
if ( mpHandler != null )
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/Handlers.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/Handlers.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/Handlers.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/Handlers.java Wed Aug 31 12:37:55 2005
@@ -18,9 +18,9 @@
package org.apache.beehive.netui.pageflow.handler;
import org.apache.beehive.netui.util.internal.DiscoveryUtils;
-import org.apache.beehive.netui.util.config.bean.CustomProperty;
-import org.apache.beehive.netui.util.config.bean.NetuiConfigDocument;
-import org.apache.beehive.netui.util.config.bean.PageflowHandlers;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.CustomProperty;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.NetuiConfigDocument;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.PageflowHandlers;
import org.apache.beehive.netui.util.config.ConfigUtil;
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.beehive.netui.pageflow.internal.InternalConstants;
@@ -40,14 +40,14 @@
/**
* ServletContext-scoped container for various Page Flow {@link Handler} instances.
- */
+ */
public class Handlers
implements Serializable
{
private static final Logger _log = Logger.getInstance( Handlers.class );
-
+
private static final String CONTEXT_ATTR = InternalConstants.ATTR_PREFIX + "_handlers";
-
+
private ActionForwardHandler _actionForwardHandler = null;
private ExceptionsHandler _exceptionsHandler = null;
private ForwardRedirectHandler _forwardRedirectHandler = null;
@@ -55,11 +55,11 @@
private StorageHandler _storageHandler = null;
private ReloadableClassHandler _reloadableClassHandler = null;
private transient ServletContext _servletContext;
-
+
public static Handlers get( ServletContext servletContext )
{
Handlers handlers = ( Handlers ) servletContext.getAttribute( CONTEXT_ATTR );
-
+
if ( handlers == null )
{
if ( _log.isErrorEnabled() )
@@ -68,67 +68,67 @@
+ PageFlowActionServlet.class.getName() + " must be the Struts action servlet, or "
+ PageFlowContextListener.class.getName() + " must be registered as a listener in web.xml." );
}
-
+
//
// We can initialize it now, but it's not good because many requests could conceivably be in this
// code at the same time.
//
return init( servletContext );
}
-
- handlers.reinit( servletContext );
+
+ handlers.reinit( servletContext );
return handlers;
}
-
+
public static Handlers init( ServletContext servletContext )
{
Handlers handlers = new Handlers( servletContext );
servletContext.setAttribute( CONTEXT_ATTR, handlers );
return handlers;
}
-
+
private Handlers( ServletContext servletContext )
{
_servletContext = servletContext;
-
+
//
// Load/create Handlers.
//
NetuiConfigDocument.NetuiConfig netuiConfig = ConfigUtil.getConfig();
PageflowHandlers handlers = netuiConfig.getPageflowHandlers();
-
+
DefaultHandler defaultActionForwardHandler = new DefaultActionForwardHandler( servletContext );
DefaultHandler defaultExceptionsHandler = new DefaultExceptionsHandler( servletContext );
DefaultHandler defaultForwardRedirectHandler = new DefaultForwardRedirectHandler( servletContext );
DefaultHandler defaultLoginHandler = new DefaultLoginHandler( servletContext );
DefaultHandler defaultStorageHandler = new DeferredSessionStorageHandler( servletContext );
DefaultHandler defaultReloadableClassHandler = new DefaultReloadableClassHandler( servletContext );
-
+
_actionForwardHandler = ( ActionForwardHandler )
adaptHandler( handlers != null ? handlers.getActionForwardHandlerArray() : null,
defaultActionForwardHandler, ActionForwardHandler.class, servletContext );
-
+
_exceptionsHandler = ( ExceptionsHandler )
adaptHandler( handlers != null ? handlers.getExceptionsHandlerArray() : null, defaultExceptionsHandler,
ExceptionsHandler.class, servletContext );
-
+
_forwardRedirectHandler = ( ForwardRedirectHandler )
adaptHandler( handlers != null ? handlers.getForwardRedirectHandlerArray() : null,
defaultForwardRedirectHandler, ForwardRedirectHandler.class, servletContext );
-
+
_loginHandler = ( LoginHandler )
adaptHandler( handlers != null ? handlers.getLoginHandlerArray() : null, defaultLoginHandler,
LoginHandler.class, servletContext );
-
+
_storageHandler = ( StorageHandler )
adaptHandler( handlers != null ? handlers.getStorageHandlerArray() : null, defaultStorageHandler,
StorageHandler.class, servletContext );
-
+
_reloadableClassHandler = ( ReloadableClassHandler )
adaptHandler( handlers != null ? handlers.getReloadableClassHandlerArray() : null,
defaultReloadableClassHandler, ReloadableClassHandler.class, servletContext );
}
-
+
public void reinit( ServletContext servletContext )
{
if ( _servletContext == null )
@@ -152,33 +152,33 @@
{
return _exceptionsHandler;
}
-
+
public ForwardRedirectHandler getForwardRedirectHandler()
{
return _forwardRedirectHandler;
}
-
+
public LoginHandler getLoginHandler()
{
return _loginHandler;
}
-
+
public StorageHandler getStorageHandler()
{
return _storageHandler;
}
-
+
public ReloadableClassHandler getReloadableClassHandler()
{
return _reloadableClassHandler;
}
-
- private static Handler adaptHandler( org.apache.beehive.netui.util.config.bean.Handler[] handlerBeanConfigs,
+
+ private static Handler adaptHandler( org.apache.beehive.netui.util.config.internal.xmlbean.generated.Handler[] handlerBeanConfigs,
DefaultHandler defaultHandler, Class baseClassOrInterface,
ServletContext servletContext )
{
Handler retVal = defaultHandler;
-
+
if ( handlerBeanConfigs != null )
{
for ( int i = 0; i < handlerBeanConfigs.length; i++ )
@@ -186,11 +186,11 @@
String handlerClass = handlerBeanConfigs[i].getHandlerClass();
CustomProperty[] props = handlerBeanConfigs[i].getCustomPropertyArray();
Handler handler = createHandler( handlerClass, baseClassOrInterface, retVal, servletContext );
-
+
if ( handler != null )
{
HandlerConfig config = new HandlerConfig( handlerClass );
-
+
for ( int j = 0; j < props.length; j++ )
{
CustomProperty prop = props[j];
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/InterceptorContext.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/InterceptorContext.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/InterceptorContext.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/InterceptorContext.java Wed Aug 31 12:37:55 2005
@@ -17,7 +17,7 @@
*/
package org.apache.beehive.netui.pageflow.interceptor;
-import org.apache.beehive.netui.util.config.bean.CustomProperty;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.CustomProperty;
import org.apache.beehive.netui.util.internal.DiscoveryUtils;
import org.apache.beehive.netui.util.logging.Logger;
@@ -26,12 +26,12 @@
/**
* Base context for callbacks on {@link Interceptor}s.
- */
+ */
public class InterceptorContext
implements Serializable
{
private static final Logger _log = Logger.getInstance( InterceptorContext.class );
-
+
private Object _resultOverride;
private Interceptor _overridingInterceptor;
@@ -40,7 +40,7 @@
_resultOverride = newResult;
_overridingInterceptor = interceptor;
}
-
+
public boolean hasResultOverride()
{
return _overridingInterceptor != null;
@@ -50,24 +50,24 @@
{
return _resultOverride;
}
-
+
public Interceptor getOverridingInterceptor()
{
return _overridingInterceptor;
}
-
- protected static void addInterceptors( org.apache.beehive.netui.util.config.bean.Interceptor[] configBeans,
+
+ protected static void addInterceptors( org.apache.beehive.netui.util.config.internal.xmlbean.generated.Interceptor[] configBeans,
List/*< Interceptor >*/ interceptorsList, Class baseClassOrInterface )
{
if ( configBeans != null )
{
for ( int i = 0; i < configBeans.length; i++ )
{
- org.apache.beehive.netui.util.config.bean.Interceptor configBean = configBeans[i];
+ org.apache.beehive.netui.util.config.internal.xmlbean.generated.Interceptor configBean = configBeans[i];
String className = configBean.getInterceptorClass();
InterceptorConfig config = new InterceptorConfig( className );
CustomProperty[] customProps = configBean.getCustomPropertyArray();
-
+
if ( customProps != null )
{
for ( int j = 0; j < customProps.length; j++ )
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/action/ActionInterceptorContext.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/action/ActionInterceptorContext.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/action/ActionInterceptorContext.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/action/ActionInterceptorContext.java Wed Aug 31 12:37:55 2005
@@ -23,7 +23,7 @@
import org.apache.beehive.netui.pageflow.interceptor.action.internal.OriginalForward;
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.beehive.netui.util.config.ConfigUtil;
-import org.apache.beehive.netui.util.config.bean.PageflowActionInterceptors;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.PageflowActionInterceptors;
import org.apache.struts.action.ActionForward;
import org.apache.beehive.netui.util.internal.concurrent.InternalConcurrentHashMap;
@@ -38,18 +38,18 @@
/**
* Context passed to {@link ActionInterceptor} methods.
- */
+ */
public class ActionInterceptorContext
extends RequestInterceptorContext
{
private static final String ACTIVE_INTERCEPTOR_CONTEXT_ATTR = InternalConstants.ATTR_PREFIX + "interceptorContext";
private static final String CACHE_ATTR = InternalConstants.ATTR_PREFIX + "actionInterceptorConfig";
-
+
private PageFlowController _pageFlow;
private InterceptorForward _originalForward;
private String _actionName;
-
+
public ActionInterceptorContext( HttpServletRequest request, HttpServletResponse response,
ServletContext servletContext, PageFlowController controller,
InterceptorForward originalForward, String actionName )
@@ -62,17 +62,17 @@
/**
* Get the page flow on which the action is being raised.
- */
+ */
public PageFlowController getPageFlow()
{
return _pageFlow;
}
/**
- *
+ *
* Get a wrapper for the original URI from the action that was intercepted. This value will be <code>null</code>
* if the interceptor was run before the action, or if the action itself returned <code>null</code>.
- */
+ */
public InterceptorForward getOriginalForward()
{
return _originalForward;
@@ -80,7 +80,7 @@
/**
* Get the name of the action being raised.
- */
+ */
public String getActionName()
{
return _actionName;
@@ -90,17 +90,17 @@
* Set an {@link InterceptorForward} that changes the destination URI of the intercepted action. If the
* InterceptorForward points to a nested page flow, then {@link ActionInterceptor#afterNestedIntercept} will be
* called before the nested page flow returns to the original page flow.
- */
+ */
public void setOverrideForward( InterceptorForward fwd, ActionInterceptor interceptor )
{
setResultOverride( fwd, interceptor );
-
+
//
// If there was no original forward (i.e., this is happening before the action was invoked), create a
// pseudo-forward out of the original request.
//
if ( _originalForward == null ) _originalForward = new OriginalForward( getRequest() );
-
+
//
// Store this context in the request.
//
@@ -116,12 +116,12 @@
{
return ( InterceptorForward ) getResultOverride();
}
-
+
public boolean hasInterceptorForward()
{
return hasResultOverride();
}
-
+
public static ActionInterceptorContext getActiveContext( ServletRequest request, boolean consume )
{
ActionInterceptorContext context =
@@ -129,14 +129,14 @@
if ( consume ) request.removeAttribute( ACTIVE_INTERCEPTOR_CONTEXT_ATTR );
return context;
}
-
-
+
+
public List/*< Interceptor >*/ getActionInterceptors()
{
ServletContext servletContext = getServletContext();
InternalConcurrentHashMap/*< String, HashMap< String, ArrayList< Interceptor > > >*/ cache =
( InternalConcurrentHashMap ) servletContext.getAttribute( CACHE_ATTR );
-
+
if ( cache == null )
{
//
@@ -147,7 +147,7 @@
cache = new InternalConcurrentHashMap/*< String, HashMap< String, ArrayList< Interceptor > > >*/();
servletContext.setAttribute( CACHE_ATTR, cache );
}
-
+
String modulePath = getPageFlow().getModulePath();
String actionName = getActionName();
HashMap/*< String, ArrayList< Interceptor > >*/ cacheByPageFlow = ( HashMap ) cache.get( modulePath );
@@ -156,44 +156,44 @@
List/*< Interceptor >*/ interceptors = ( List ) cacheByPageFlow.get( actionName );
if ( interceptors != null ) return interceptors;
}
-
+
//
// We didn't find it in the cache -- build it.
//
if ( cacheByPageFlow == null ) cacheByPageFlow = new HashMap/*< String, ArrayList< Interceptor > >*/();
PageflowActionInterceptors config = ConfigUtil.getConfig().getPageflowActionInterceptors();
ArrayList/*< Interceptor >*/ interceptorsList = new ArrayList/*< Interceptor >*/();
-
+
if ( config == null )
{
cacheByPageFlow.put( actionName, interceptorsList );
cache.put( modulePath, cacheByPageFlow );
return interceptorsList;
}
-
+
//
// Global interceptors.
//
PageflowActionInterceptors.Global globalInterceptors = config.getGlobal();
-
+
if ( globalInterceptors != null )
{
addInterceptors( globalInterceptors.getActionInterceptorArray(), interceptorsList, ActionInterceptor.class );
addSimpleInterceptors( globalInterceptors.getSimpleActionInterceptorArray(), interceptorsList );
}
-
+
//
// Per-pageflow and per-action interceptors.
//
String pageFlowURI = getPageFlow().getURI();
PageflowActionInterceptors.PerPageflow[] perPageFlowInterceptorsConfig = config.getPerPageflowArray();
-
+
if ( perPageFlowInterceptorsConfig != null )
{
for ( int i = 0; i < perPageFlowInterceptorsConfig.length; i++ )
{
PageflowActionInterceptors.PerPageflow ppfi = perPageFlowInterceptorsConfig[i];
-
+
if ( ppfi != null && pageFlowURI.equals( ppfi.getPageflowUri() ) )
{
//
@@ -203,22 +203,22 @@
ActionInterceptor.class );
addSimpleInterceptors( perPageFlowInterceptorsConfig[i].getSimpleActionInterceptorArray(),
interceptorsList );
-
+
PageflowActionInterceptors.PerPageflow.PerAction[] perActionConfigs =
perPageFlowInterceptorsConfig[i].getPerActionArray();
-
+
if ( perActionConfigs != null )
{
for ( int j = 0; j < perActionConfigs.length; j++ )
{
PageflowActionInterceptors.PerPageflow.PerAction perActionConfig = perActionConfigs[j];
-
+
if ( perActionConfig != null && actionName.equals( perActionConfig.getActionName() ) )
{
//
// This is a matching action -- add per-action interceptors.
//
- addInterceptors( perActionConfig.getActionInterceptorArray(), interceptorsList,
+ addInterceptors( perActionConfig.getActionInterceptorArray(), interceptorsList,
ActionInterceptor.class );
addSimpleInterceptors( perActionConfig.getSimpleActionInterceptorArray(),
interceptorsList );
@@ -228,18 +228,18 @@
}
}
}
-
+
cacheByPageFlow.put( actionName, interceptorsList );
cache.put( modulePath, cacheByPageFlow );
return interceptorsList;
}
-
- private static void addSimpleInterceptors( org.apache.beehive.netui.util.config.bean.SimpleActionInterceptor[] configBeans,
+
+ private static void addSimpleInterceptors( org.apache.beehive.netui.util.config.internal.xmlbean.generated.SimpleActionInterceptor[] configBeans,
List/*< Interceptor >*/ interceptorsList )
{
for ( int i = 0; i < configBeans.length; i++ )
{
- org.apache.beehive.netui.util.config.bean.SimpleActionInterceptor configBean = configBeans[i];
+ org.apache.beehive.netui.util.config.internal.xmlbean.generated.SimpleActionInterceptor configBean = configBeans[i];
String path = configBean.getInterceptPath();
boolean afterAction = configBean.getAfterAction();
SimpleActionInterceptorConfig config = new SimpleActionInterceptorConfig( path, afterAction );
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/request/RequestInterceptorContext.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/request/RequestInterceptorContext.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/request/RequestInterceptorContext.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/request/RequestInterceptorContext.java Wed Aug 31 12:37:55 2005
@@ -20,7 +20,7 @@
import org.apache.beehive.netui.pageflow.interceptor.InterceptorContext;
import org.apache.beehive.netui.pageflow.internal.InternalConstants;
import org.apache.beehive.netui.util.config.ConfigUtil;
-import org.apache.beehive.netui.util.config.bean.RequestInterceptors;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.RequestInterceptors;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
@@ -30,16 +30,16 @@
/**
* Context passed to methods on {@link RequestInterceptor}.
- */
+ */
public class RequestInterceptorContext
extends InterceptorContext
{
private static final String INTERCEPTORS_LIST_ATTR = InternalConstants.ATTR_PREFIX + "requestInterceptors";
-
+
private transient ServletContext _servletContext;
private transient HttpServletRequest _request;
private transient HttpServletResponse _response;
-
+
public RequestInterceptorContext( HttpServletRequest request, HttpServletResponse response,
ServletContext servletContext )
{
@@ -47,43 +47,43 @@
_response = response;
_servletContext = servletContext;
}
-
+
public void cancelRequest( RequestInterceptor interceptor )
{
setResultOverride( null, interceptor );
}
-
+
public boolean requestWasCancelled()
{
return hasResultOverride() && getResultOverride() == null;
}
-
+
public HttpServletRequest getRequest()
{
return _request;
}
-
+
public HttpServletResponse getResponse()
{
return _response;
}
-
+
public ServletContext getServletContext()
{
return _servletContext;
}
-
+
public static void init( ServletContext servletContext )
{
RequestInterceptors requestInterceptors = ConfigUtil.getConfig().getRequestInterceptors();
-
+
if ( requestInterceptors != null )
{
RequestInterceptors.Global globalRequestInterceptors = requestInterceptors.getGlobal();
-
+
if ( globalRequestInterceptors != null )
{
- org.apache.beehive.netui.util.config.bean.Interceptor[] interceptors =
+ org.apache.beehive.netui.util.config.internal.xmlbean.generated.Interceptor[] interceptors =
globalRequestInterceptors.getRequestInterceptorArray();
ArrayList/*< Interceptor >*/ interceptorsList = new ArrayList/*< Interceptor >*/();
addInterceptors( interceptors, interceptorsList, RequestInterceptor.class );
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java Wed Aug 31 12:37:55 2005
@@ -30,7 +30,7 @@
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.internal.ServletUtils;
import org.apache.beehive.netui.util.config.ConfigUtil;
-import org.apache.beehive.netui.util.config.bean.PageflowConfig;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.PageflowConfig;
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.struts.Globals;
import org.apache.struts.util.MessageResources;
@@ -65,7 +65,7 @@
implements PageFlowConstants, InternalConstants
{
private static final Logger _log = Logger.getInstance( InternalUtils.class );
-
+
private static final String BEA_XMLOBJECT_CLASSNAME = "com.bea.xml.XmlObject";
private static final String APACHE_XMLOBJECT_CLASSNAME = "org.apache.xmlbeans.XmlObject";
private static final Class BEA_XMLOBJECT_CLASS = loadClassNonFatal( BEA_XMLOBJECT_CLASSNAME );
@@ -79,11 +79,11 @@
private static final String FORWARDED_FORMBEAN_ATTR = ATTR_PREFIX + "forwardedForm";
private static final String FORWARDING_MODULE_ATTR = ATTR_PREFIX + "fwdModule";
private static final String IGNORE_INCLUDE_SERVLET_PATH_ATTR = ATTR_PREFIX + "ignoreIncludeServletPath";
-
-
+
+
/**
* If not in production mode, write an error to the response; otherwise, set a response error code.
- */
+ */
public static void sendDevTimeError( String messageKey, Throwable cause, int productionTimeErrorCode,
ServletRequest request, ServletResponse response,
ServletContext servletContext, Object[] messageArgs )
@@ -91,11 +91,11 @@
{
sendDevTimeError( messageKey, messageArgs, cause, productionTimeErrorCode, request, response, servletContext );
}
-
+
/**
* If not in production mode, write an error to the response; otherwise, set a response error code.
- * @deprecated Use {@link #sendDevTimeError(String, Throwable, int, ServletRequest, ServletResponse, ServletContext, Object[])}
- */
+ * @deprecated Use {@link #sendDevTimeError(String, Throwable, int, ServletRequest, ServletResponse, ServletContext, Object[])}
+ */
public static void sendDevTimeError( String messageKey, Object[] messageArgs, Throwable cause,
int productionTimeErrorCode, ServletRequest request,
ServletResponse response, ServletContext servletContext )
@@ -103,7 +103,7 @@
{
boolean prodMode = AdapterManager.getServletContainerAdapter( servletContext ).isInProductionMode();
boolean avoidDirectResponseOutput = avoidDirectResponseOutput( request );
-
+
if ( prodMode && ! avoidDirectResponseOutput && response instanceof HttpServletResponse )
{
if ( _log.isErrorEnabled() )
@@ -111,7 +111,7 @@
_log.error( "Error (message key " + messageKey + ") occurred. Response error was set to "
+ productionTimeErrorCode, cause );
}
-
+
( ( HttpServletResponse ) response ).sendError( productionTimeErrorCode );
}
else
@@ -119,63 +119,63 @@
sendError( messageKey, messageArgs, request, response, cause, prodMode || avoidDirectResponseOutput );
}
}
-
+
/**
* Write an error to the response.
- */
+ */
public static void sendError( String messageKey, Throwable cause, ServletRequest request,
HttpServletResponse response, Object[] messageArgs )
throws IOException
{
- // TODO: the following null check will be unnecessary once the deprecated
+ // TODO: the following null check will be unnecessary once the deprecated
// FlowController.sendError(String, HttpServletResponse) is removed.
boolean avoidDirectResponseOutput = request != null ? avoidDirectResponseOutput( request ) : false;
sendError( messageKey, messageArgs, request, response, cause, avoidDirectResponseOutput );
}
-
+
/**
* Write an error to the response.
- */
- public static void sendError( String messageKey, Object[] messageArgs, ServletRequest request,
+ */
+ public static void sendError( String messageKey, Object[] messageArgs, ServletRequest request,
ServletResponse response, Throwable cause, boolean avoidDirectResponseOutput )
throws IOException
{
assert messageArgs.length == 0 || ! ( messageArgs[0] instanceof Object[] )
: "Object[] passed to sendError; this is probably a mistaken use of varargs";
-
+
// request may be null because of deprecated FlowController.sendError().
if ( request != null && avoidDirectResponseOutput )
{
String baseMessage = Bundle.getString( messageKey + "_Message", messageArgs );
throw new ResponseOutputException( baseMessage, cause );
}
-
+
String html = Bundle.getString( messageKey + "_Page", messageArgs );
response.setContentType( "text/html;charset=UTF-8" );
- response.getWriter().println( html );
- ServletUtils.preventCache( response );
+ response.getWriter().println( html );
+ ServletUtils.preventCache( response );
}
-
+
/**
* We unwrap two special form types: XmlBeanActionForm and AnyBeanActionForm.
- */
+ */
// TODO: make this pluggable
public static Object unwrapFormBean( ActionForm form )
{
if ( form == null ) return null;
-
+
if ( form instanceof AnyBeanActionForm )
{
return ( ( AnyBeanActionForm ) form ).getBean();
}
-
+
return form;
}
-
+
public static ActionForm wrapFormBean( Object formBean )
{
if ( formBean == null ) return null;
-
+
//
// Notice that we even wrap form beans that extend ActionForm but don't extend FormData. This is because
// FormData has special logic to make validation annotations work correctly.
@@ -187,7 +187,7 @@
else
{
Class formClass = formBean.getClass();
-
+
if ( BEA_XMLOBJECT_CLASS != null && BEA_XMLOBJECT_CLASS.isAssignableFrom( formClass ) )
{
return new XmlBeanActionForm( formBean );
@@ -196,11 +196,11 @@
{
return new XmlBeanActionForm( formBean );
}
-
+
return new AnyBeanActionForm( formBean );
}
}
-
+
private static Class loadClassNonFatal( String className )
{
try
@@ -210,24 +210,24 @@
catch ( ClassNotFoundException e )
{
// Not fatal -- we don't require this to be there. Only if the user wants to use it.
-
+
if ( _log.isDebugEnabled() )
{
_log.debug( "Could not load class " + className );
}
}
-
+
return null;
}
-
+
/**
* Get a Method in a Class.
- *
+ *
* @param parentClass the Class in which to find the Method.
* @param methodName the name of the Method.
* @param signature the argument types for the Method.
* @return the Method with the given name and signature, or <code>null</code> if the method does not exist.
- */
+ */
public static Method lookupMethod( Class parentClass, String methodName, Class[] signature )
{
try
@@ -239,7 +239,7 @@
Class superClass = parentClass.getSuperclass();
return superClass != null ? lookupMethod( superClass, methodName, signature ) : null;
}
- }
+ }
public static String getFlowControllerClassName( String modulePath, ServletRequest request, ServletContext context )
{
@@ -249,20 +249,20 @@
ModuleConfig mc = ensureModuleConfig( modulePath, request, context );
return mc != null ? getFlowControllerClassName( mc ) : null;
}
-
+
public static String getFlowControllerClassName( ModuleConfig mc )
{
ControllerConfig cc = mc.getControllerConfig();
return cc instanceof PageFlowControllerConfig ? ( ( PageFlowControllerConfig ) cc ).getControllerClass() : null;
}
-
+
/**
* Tell whether the given module is a long-lived page flow.
*/
public static boolean isLongLived( ModuleConfig moduleConfig )
{
ControllerConfig cc = moduleConfig.getControllerConfig();
-
+
if ( cc instanceof PageFlowControllerConfig )
{
return ( ( PageFlowControllerConfig ) cc ).isLongLivedPageFlow();
@@ -272,27 +272,27 @@
return false;
}
}
-
+
/**
* Tell whether the given module is a nested page flow.
- */
+ */
public static boolean isNestable( ModuleConfig moduleConfig )
{
ControllerConfig cc = moduleConfig.getControllerConfig();
return cc instanceof PageFlowControllerConfig && ( ( PageFlowControllerConfig ) cc ).isNestedPageFlow();
}
-
+
public static String getLongLivedFlowAttr( String modulePath )
{
return LONGLIVED_PAGEFLOWS_ATTR_PREFIX + modulePath;
}
-
+
public static void setCurrentPageFlow( PageFlowController jpf, HttpServletRequest request,
ServletContext servletContext )
{
setCurrentActionResolver( jpf, request, servletContext );
}
-
+
public static void removeCurrentPageFlow( HttpServletRequest request, ServletContext servletContext )
{
StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
@@ -301,34 +301,34 @@
String currentJpfAttrName = ScopedServletUtils.getScopedSessionAttrName( CURRENT_JPF_ATTR, unwrappedRequest );
String currentLongLivedAttrName =
ScopedServletUtils.getScopedSessionAttrName( CURRENT_LONGLIVED_ATTR, unwrappedRequest );
-
+
sh.removeAttribute( rc, currentJpfAttrName );
sh.removeAttribute( rc, currentLongLivedAttrName );
}
-
+
public static void removeCurrentFacesBackingBean( HttpServletRequest request, ServletContext servletContext )
{
StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
RequestContext rc = new RequestContext( unwrappedRequest, null );
String attrName = ScopedServletUtils.getScopedSessionAttrName( FACES_BACKING_ATTR, unwrappedRequest );
-
+
sh.removeAttribute( rc, attrName );
}
-
+
public static String getDecodedURI( HttpServletRequest request )
{
return request.getContextPath() + getDecodedServletPath( request );
}
-
+
public static String getDecodedServletPath( HttpServletRequest request )
{
if ( ignoreIncludeServletPath( request ) ) return request.getServletPath();
-
+
String servletIncludePath = ( String ) request.getAttribute( RequestProcessor.INCLUDE_SERVLET_PATH );
return servletIncludePath != null ? servletIncludePath : request.getServletPath();
}
-
+
public static void addActionOutputs( Map toAdd, ServletRequest request, boolean overwrite )
{
if ( toAdd != null )
@@ -340,7 +340,7 @@
Map.Entry entry = ( Map.Entry ) i.next();
String name = ( String ) entry.getKey();
boolean alreadyExists = map.containsKey( name );
-
+
if ( overwrite || ! alreadyExists )
{
if ( alreadyExists )
@@ -350,33 +350,33 @@
_log.warn( "Overwriting action output \"" + name + "\"." );
}
}
-
+
map.put( name, entry.getValue() );
}
}
}
}
-
+
public static void addActionError( String propertyName, ActionMessage error, ServletRequest request )
{
ActionErrors errors = ( ActionErrors ) request.getAttribute( Globals.ERROR_KEY );
if ( errors == null ) request.setAttribute( Globals.ERROR_KEY, errors = new ActionErrors() );
errors.add( propertyName, error );
}
-
+
public static Object newReloadableInstance( String className, ServletContext servletContext )
throws ClassNotFoundException, InstantiationException, IllegalAccessException
{
return getReloadableClass( className, servletContext ).newInstance();
}
-
+
public static Class getReloadableClass( String className, ServletContext servletContext )
throws ClassNotFoundException
{
ReloadableClassHandler handler = Handlers.get( servletContext ).getReloadableClassHandler();
return handler.loadClass( className );
}
-
+
public static Map getActionOutputMap( ServletRequest request, boolean createIfNotExist )
{
Map map = ( Map ) request.getAttribute( ACTIONOUTPUT_MAP_ATTR );
@@ -389,7 +389,7 @@
return map;
}
-
+
public static Map getPageInputMap( ServletRequest request, ServletContext servletContext )
{
Map actionOutputsFromPageFlow = getActionOutputMap( request, false );
@@ -397,7 +397,7 @@
FacesBackingBean fbb = getFacesBackingBean( request, servletContext );
return fbb != null ? fbb.getPageInputMap() : null;
}
-
+
public static Map getPageInputMap( ServletRequest request )
{
Map actionOutputsFromPageFlow = getActionOutputMap( request, false );
@@ -405,25 +405,25 @@
FacesBackingBean fbb = getFacesBackingBean( request, getServletContext( request ) );
return fbb != null ? fbb.getPageInputMap() : null;
}
-
+
/**
* Get the Struts ModuleConfig for the given module path.
- */
+ */
public static ModuleConfig getModuleConfig( String modulePath, ServletContext context )
{
- return ( ModuleConfig ) context.getAttribute( Globals.MODULE_KEY + modulePath );
+ return ( ModuleConfig ) context.getAttribute( Globals.MODULE_KEY + modulePath );
}
-
+
/**
* Get the Struts ModuleConfig for the given module path. If there is none registered,
* and if it is possible to register one automatically, do so.
- */
+ */
public static ModuleConfig ensureModuleConfig( String modulePath, ServletRequest request, ServletContext context )
{
try
{
ModuleConfig ret = getModuleConfig( modulePath, context );
-
+
if ( ret != null )
{
return ret;
@@ -431,10 +431,10 @@
else
{
ActionServlet as = getActionServlet( context );
-
+
if ( as instanceof AutoRegisterActionServlet )
{
- return ( ( AutoRegisterActionServlet ) as ).ensureModuleRegistered( modulePath, request );
+ return ( ( AutoRegisterActionServlet ) as ).ensureModuleRegistered( modulePath, request );
}
}
}
@@ -446,58 +446,58 @@
{
_log.error( "Error while registering Struts module " + modulePath, e );
}
-
+
return null;
}
-
+
/**
* Get the current ActionServlet.
- *
+ *
* @param context the current ServletContext
* @return the ActionServlet that is stored as an attribute in the ServletContext
- */
+ */
public static ActionServlet getActionServlet( ServletContext context )
{
if ( context == null ) return null;
return ( ActionServlet ) context.getAttribute( Globals.ACTION_SERVLET_KEY );
}
-
+
/**
* Add a BindingUpdateError to the request.
- *
+ *
* @param request the current ServletRequest.
* @param expression the expression associated with this error.
* @param message the error message.
* @param cause the Throwable that caused the error.
- */
+ */
public static void addBindingUpdateError( ServletRequest request, String expression, String message, Throwable cause )
{
Map errors = ( Map ) request.getAttribute( BINDING_UPDATE_ERRORS_ATTR );
-
+
if ( errors == null )
{
errors = new LinkedHashMap();
request.setAttribute( BINDING_UPDATE_ERRORS_ATTR, errors );
}
-
+
errors.put( expression, new BindingUpdateError( expression, message, cause ) );
}
-
+
/**
* Get a map of BindingUpdateErrors stored in the request.
- *
+ *
* @return a Map of expression (String) -> BindingUpdateError.
- */
+ */
public static Map getBindingUpdateErrors( ServletRequest request )
{
return ( Map ) request.getAttribute( BINDING_UPDATE_ERRORS_ATTR );
}
-
+
public static void setCurrentModule( ModuleConfig mc, ServletRequest request )
{
request.setAttribute( Globals.MODULE_KEY, mc );
}
-
+
public static ActionForm createActionForm( ActionMapping mapping, ModuleConfig moduleConfig,
ActionServlet actionServlet, ServletContext servletContext )
{
@@ -505,18 +505,18 @@
if ( formName == null ) return null;
FormBeanConfig config = moduleConfig.findFormBeanConfig( formName );
if ( config == null ) return null;
-
+
try
{
ActionForm bean;
-
+
if ( config.getDynamic() )
{
if ( _log.isDebugEnabled() )
{
_log.debug( "Creating new DynaActionForm instance of type " + config.getType() );
}
-
+
DynaActionFormClass dynaClass = DynaActionFormClass.createDynaActionFormClass( config );
bean = ( ActionForm ) dynaClass.newInstance();
( ( DynaActionForm ) bean ).initialize( mapping );
@@ -527,10 +527,10 @@
{
_log.debug( "Creating new ActionForm instance of type " + config.getType() );
}
-
+
bean = ( ActionForm ) newReloadableInstance( config.getType(), servletContext );
}
-
+
bean.setServlet( actionServlet );
return bean;
}
@@ -540,11 +540,11 @@
{
_log.error( "Error creating action form of type " + config.getType(), e );
}
-
+
return null;
}
}
-
+
/**
* Set the given form in either the request or session, as appropriate, so Struts/NetUI
* tags will have access to it.
@@ -557,7 +557,7 @@
if ( isSessionScope( mapping ) )
{
HttpSession session = request.getSession();
-
+
if ( overwrite || session.getAttribute( formName ) == null )
{
session.setAttribute( formName, form );
@@ -572,16 +572,16 @@
}
}
}
-
+
public static boolean isSessionScope( ActionMapping mapping )
{
return ( mapping.getScope() == null || mapping.getScope().equals( "session" ) );
}
-
+
public static ActionForm getFormBean( ActionMapping mapping, ServletRequest request )
{
String formBeanName = mapping.getAttribute();
-
+
if ( formBeanName != null )
{
if ( isSessionScope( mapping ) )
@@ -594,15 +594,15 @@
return ( ActionForm ) request.getAttribute( formBeanName );
}
}
-
+
return null;
}
-
+
/**
* Set the current ActionResolver ({@link PageFlowController}) in the user session.
- *
+ *
* @param resolver the ActionResolver to set as the current one in the user session.
- */
+ */
public static void setCurrentActionResolver( ActionResolver resolver, HttpServletRequest request,
ServletContext servletContext )
{
@@ -612,14 +612,14 @@
String currentJpfAttrName = ScopedServletUtils.getScopedSessionAttrName( CURRENT_JPF_ATTR, unwrappedRequest );
String currentLongLivedJpfAttrName =
ScopedServletUtils.getScopedSessionAttrName( CURRENT_LONGLIVED_ATTR, unwrappedRequest );
-
+
if ( resolver == null )
{
sh.removeAttribute( rc, currentJpfAttrName );
sh.removeAttribute( rc, currentLongLivedJpfAttrName );
return;
}
-
+
//
// If this is a long-lived page flow, also store the instance in an attribute that never goes away.
//
@@ -627,14 +627,14 @@
{
String longLivedAttrName = getLongLivedFlowAttr( resolver.getModulePath() );
longLivedAttrName = ScopedServletUtils.getScopedSessionAttrName( longLivedAttrName, unwrappedRequest );
-
+
// Only set this attribute if it's not already there. We want to avoid our onDestroy() callback that's
// invoked when the page flow's session attribute is unbound.
if ( sh.getAttribute( rc, longLivedAttrName ) != resolver )
{
sh.setAttribute( rc, longLivedAttrName, resolver );
}
-
+
sh.setAttribute( rc, currentLongLivedJpfAttrName, resolver.getModulePath() );
sh.removeAttribute( rc, currentJpfAttrName );
}
@@ -644,13 +644,13 @@
sh.removeAttribute( rc, currentLongLivedJpfAttrName );
}
}
-
+
public static boolean isSharedFlowModule( ModuleConfig mc )
{
ControllerConfig cc = mc.getControllerConfig();
return cc instanceof PageFlowControllerConfig && ( ( PageFlowControllerConfig ) cc ).isSharedFlow();
}
-
+
public static FacesBackingBean getFacesBackingBean( ServletRequest request, ServletContext servletContext )
{
@@ -662,14 +662,14 @@
String attrName = ScopedServletUtils.getScopedSessionAttrName( FACES_BACKING_ATTR, unwrappedRequest );
return ( FacesBackingBean ) sh.getAttribute( rc, attrName );
}
-
+
return null;
}
-
+
public static String inferModulePathFromClassName( String className )
{
int lastDot = className.lastIndexOf( '.' );
-
+
if ( lastDot != -1 )
{
className = className.substring( 0, lastDot );
@@ -680,32 +680,32 @@
return "";
}
}
-
+
public static boolean isMultipartHandlingEnabled( ServletRequest request )
{
ModuleConfig moduleConfig = ( ModuleConfig ) request.getAttribute( Globals.MODULE_KEY );
return moduleConfig.getControllerConfig().getMultipartClass() != null;
}
-
+
public static PageflowConfig.MultipartHandler.Enum getMultipartHandlerType()
{
PageflowConfig pfConfig = ConfigUtil.getConfig().getPageflowConfig();
return pfConfig != null ? pfConfig.getMultipartHandler() : null;
}
-
+
public static void setServletContext( ServletRequest request, ServletContext servletContext )
{
ScopedServletUtils.getOuterServletRequest( request ).setAttribute( SERVLET_CONTEXT_ATTR, servletContext );
}
-
+
public static ServletContext getServletContext( ServletRequest req )
{
HttpSession session = getHttpSession( req, false );
return session != null
? session.getServletContext()
- : ( ServletContext ) ScopedServletUtils.getOuterServletRequest( req ).getAttribute( SERVLET_CONTEXT_ATTR );
+ : ( ServletContext ) ScopedServletUtils.getOuterServletRequest( req ).getAttribute( SERVLET_CONTEXT_ATTR );
}
-
+
public static HttpSession getHttpSession( ServletRequest request, boolean create )
{
if ( ! ( request instanceof HttpServletRequest ) ) return null;
@@ -714,12 +714,12 @@
/**
* Simply adds the context path and parent directory, based on the current request URI.
- */
+ */
public static String createActionURL( HttpServletRequest servletRequest, String qualifiedAction )
{
String pageURI = getDecodedURI( servletRequest );
int lastSlash = pageURI.lastIndexOf( '/' );
-
+
if ( lastSlash != -1 )
{
InternalStringBuilder value = new InternalStringBuilder( qualifiedAction.length() + lastSlash );
@@ -734,7 +734,7 @@
public static String createActionPath( ServletRequest request, String qualifiedAction )
{
ModuleConfig appConfig = ( ModuleConfig ) request.getAttribute( Globals.MODULE_KEY );
-
+
if ( appConfig != null )
{
InternalStringBuilder value = new InternalStringBuilder( qualifiedAction.length() + 16 );
@@ -763,7 +763,7 @@
return sb.toString();
}
-
+
/**
* Return the form action converted into an action mapping path. The
* value of the <code>action</code> property is manipulated as follows in
@@ -774,7 +774,7 @@
* <li>If the resulting value does not start with a slash, then a
* slash is prepended.</li>
* </ul>
- *
+ *
* @param action the action name to be converted.
* @return an action path, suitable for lookup in the Struts configuration file.
*/
@@ -782,7 +782,7 @@
{
return getCleanActionName( action, true );
}
-
+
public static String getCleanActionName( String action, boolean prependSlash )
{
int question = action.indexOf( '?' );
@@ -790,12 +790,12 @@
{
action = action.substring( 0, question );
}
-
+
if ( action.endsWith( ACTION_EXTENSION ) )
{
action = action.substring( 0, action.length() - ACTION_EXTENSION_LEN );
}
-
+
if ( action.charAt( 0 ) == '/' )
{
if ( ! prependSlash ) action = action.substring( 1 );
@@ -804,7 +804,7 @@
{
if ( prependSlash ) action = '/' + action;
}
-
+
return action;
}
@@ -822,14 +822,14 @@
{
return url + ( url.indexOf( '?' ) != -1 ? '&' : '?' ) + paramName + '=' + paramVal;
}
-
+
public static String getActionName( ActionMapping mapping )
{
if ( mapping == null ) return null;
-
+
String actionName = mapping.getPath();
if ( actionName.charAt( 0 ) == '/' ) actionName = actionName.substring( 1 );
-
+
//
// Look to see if we need are in a disambiguated action, i.e., one whose name is qualified
// by the form. If so, we need to restore the unqualified action name.
@@ -839,21 +839,21 @@
String unqualifiedAction = ( ( PageFlowActionMapping ) mapping ).getUnqualifiedActionName();
if ( unqualifiedAction != null ) actionName = unqualifiedAction;
}
-
+
return actionName;
}
-
+
public static ActionMapping getCurrentActionMapping( ServletRequest request )
{
return ( ActionMapping ) request.getAttribute( Globals.MAPPING_KEY );
}
-
+
public static ActionForm getCurrentActionForm( ServletRequest request )
{
ActionMapping mapping = getCurrentActionMapping( request );
String attribute = mapping != null ? mapping.getAttribute() : null;
if ( attribute == null ) return null;
-
+
if ( "request".equals( mapping.getScope() ) )
{
return ( ActionForm ) request.getAttribute( attribute );
@@ -864,29 +864,29 @@
return session != null ? ( ActionForm ) session.getAttribute( attribute ) : null;
}
}
-
+
public static boolean sessionExpired( ServletRequest servletRequest )
{
if ( servletRequest instanceof HttpServletRequest )
{
HttpServletRequest request = ( HttpServletRequest ) servletRequest;
String requestedSessionID = request.getRequestedSessionId();
-
+
if ( requestedSessionID != null )
{
HttpSession session = request.getSession( false );
return session == null || ! requestedSessionID.equals( session.getId() );
}
}
-
+
return false;
}
-
+
public static void throwPageFlowException( PageFlowException ex )
{
throwPageFlowException( ex, null );
}
-
+
public static void throwPageFlowException( PageFlowException effect, ServletRequest request )
throws PageFlowException
{
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/LegacySettings.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/LegacySettings.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/LegacySettings.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/LegacySettings.java Wed Aug 31 12:37:55 2005
@@ -19,7 +19,7 @@
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.beehive.netui.util.config.ConfigUtil;
-import org.apache.beehive.netui.util.config.bean.PageflowConfig;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.PageflowConfig;
import org.apache.beehive.netui.pageflow.PageFlowActionServlet;
import org.apache.beehive.netui.pageflow.PageFlowContextListener;
import org.apache.beehive.netui.pageflow.PageFlowConstants;
@@ -33,22 +33,22 @@
implements Serializable, PageFlowConstants
{
private static final Logger _log = Logger.getInstance( LegacySettings.class );
-
+
private static final String CONTEXT_ATTR = InternalConstants.ATTR_PREFIX + "_cache";
private static final int DEFAULT_MAX_FORWARDS_PER_REQUEST = 25;
private static final int DEFAULT_MAX_NESTING_STACK_DEPTH = 10;
-
+
public static final int serialVersionUID = 1;
-
+
private boolean _secureForwards = false;
private int _forwardOverflowCount;
private int _nestingOverflowCount;
-
-
+
+
public static LegacySettings get( ServletContext servletContext )
{
LegacySettings ls = ( LegacySettings ) servletContext.getAttribute( CONTEXT_ATTR );
-
+
if ( ls == null )
{
if ( _log.isErrorEnabled() )
@@ -57,29 +57,29 @@
+ PageFlowActionServlet.class.getName() + " must be the Struts action servlet, or "
+ PageFlowContextListener.class.getName() + " must be registered as a listener in web.xml." );
}
-
+
//
// We can initialize it now, but it's not good because many requests could conceivably be in this
// code at the same time.
//
return init( servletContext );
}
-
+
return ls;
}
-
+
public static LegacySettings init( ServletContext servletContext )
{
LegacySettings cache = new LegacySettings( servletContext );
servletContext.setAttribute( CONTEXT_ATTR, cache );
return cache;
}
-
+
private void loadLegacySettings( ServletContext servletContext )
{
PageflowConfig pageflowConfig = ConfigUtil.getConfig().getPageflowConfig();
if ( pageflowConfig == null ) pageflowConfig = ConfigUtil.getConfig().addNewPageflowConfig(); // for defaults
-
+
Integer forwardOverflowCount =
loadLegacyParam( FORWARD_OVERFLOW_COUNT_PARAM, servletContext, "max-forwards-per-request" );
if ( forwardOverflowCount != null )
@@ -93,7 +93,7 @@
? pageflowConfig.getMaxForwardsPerRequest()
: DEFAULT_MAX_FORWARDS_PER_REQUEST;
}
-
+
Integer nestingOverflowCount =
loadLegacyParam( NESTING_OVERFLOW_COUNT_PARAM, servletContext, "max-nesting-stack-depth" );
if ( nestingOverflowCount != null )
@@ -107,9 +107,9 @@
? pageflowConfig.getMaxNestingStackDepth()
: DEFAULT_MAX_NESTING_STACK_DEPTH;
}
-
+
String doSecureForwards = servletContext.getInitParameter( SECURE_FORWARDS_PARAM );
-
+
if ( doSecureForwards != null )
{
_log.warn( "Servlet context-param " + SECURE_FORWARDS_PARAM +
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/URIContextFactory.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/URIContextFactory.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/URIContextFactory.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/URIContextFactory.java Wed Aug 31 12:37:55 2005
@@ -20,7 +20,7 @@
import org.apache.beehive.netui.core.urls.MutableURI;
import org.apache.beehive.netui.core.urls.URIContext;
import org.apache.beehive.netui.util.config.ConfigUtil;
-import org.apache.beehive.netui.util.config.bean.UrlConfig;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.UrlConfig;
/**
* Factory for the {@link URIContext} with the data needed to write out
Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/ExpressionEvaluatorFactory.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/ExpressionEvaluatorFactory.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/ExpressionEvaluatorFactory.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/ExpressionEvaluatorFactory.java Wed Aug 31 12:37:55 2005
@@ -21,9 +21,9 @@
import java.util.Map;
import org.apache.beehive.netui.util.config.ConfigUtil;
-import org.apache.beehive.netui.util.config.bean.NetuiConfigDocument.NetuiConfig;
-import org.apache.beehive.netui.util.config.bean.ExpressionLanguages;
-import org.apache.beehive.netui.util.config.bean.ExpressionLanguages.ExpressionLanguage;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.NetuiConfigDocument.NetuiConfig;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.ExpressionLanguages;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.ExpressionLanguages.ExpressionLanguage;
import org.apache.beehive.netui.util.logging.Logger;
/**
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java Wed Aug 31 12:37:55 2005
@@ -19,7 +19,7 @@
import org.apache.beehive.netui.tags.tree.InheritableState;
import org.apache.beehive.netui.util.config.ConfigUtil;
-import org.apache.beehive.netui.util.config.bean.JspTagConfig;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.JspTagConfig;
/**
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java Wed Aug 31 12:37:55 2005
@@ -28,7 +28,7 @@
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.ParamHelper;
import org.apache.beehive.netui.util.config.ConfigUtil;
-import org.apache.beehive.netui.util.config.bean.UrlConfig;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.UrlConfig;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java Wed Aug 31 12:37:55 2005
@@ -22,7 +22,7 @@
import org.apache.beehive.netui.tags.html.Html;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.config.ConfigUtil;
-import org.apache.beehive.netui.util.config.bean.JspTagConfig;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.JspTagConfig;
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.struts.util.ResponseUtils;
Modified: beehive/trunk/netui/src/util/beehive-netui-config-default.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/beehive-netui-config-default.xml?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/util/beehive-netui-config-default.xml (original)
+++ beehive/trunk/netui/src/util/beehive-netui-config-default.xml Wed Aug 31 12:37:55 2005
@@ -41,3 +41,4 @@
</prefix-handlers>
</netui-config>
+
Added: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigFactory.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigFactory.java?rev=265562&view=auto
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigFactory.java (added)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigFactory.java Wed Aug 31 12:37:55 2005
@@ -0,0 +1,36 @@
+/**
+ Copyright 2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Header:$
+ */
+package org.apache.beehive.netui.util.config;
+
+import java.io.InputStream;
+
+import org.apache.beehive.netui.util.config.bean.NetUIConfig;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.NetuiConfigDocument;
+
+/**
+ * <p>
+ * Abstract factory class used to create an instance of a <code>NetUIConfig</code> document.
+ * </p>
+ */
+public abstract class ConfigFactory {
+
+ public abstract NetUIConfig getNewConfig(NetuiConfigDocument.NetuiConfig config);
+
+ public abstract NetuiConfigDocument.NetuiConfig getConfig(InputStream inputStream);
+}
+
Propchange: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigInitializationException.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigInitializationException.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigInitializationException.java (original)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigInitializationException.java Wed Aug 31 12:37:55 2005
@@ -24,7 +24,7 @@
* </p>
*/
public class ConfigInitializationException
- extends Exception {
+ extends RuntimeException {
/**
* Default constructor.
Modified: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigUtil.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigUtil.java?rev=265562&r1=265561&r2=265562&view=diff
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigUtil.java (original)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/ConfigUtil.java Wed Aug 31 12:37:55 2005
@@ -18,18 +18,12 @@
package org.apache.beehive.netui.util.config;
import java.io.InputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import org.apache.beehive.netui.util.config.bean.NetuiConfigDocument;
-import org.apache.beehive.netui.util.config.bean.NetuiConfigDocument.NetuiConfig;
-import org.apache.beehive.netui.util.internal.InternalStringBuilder;
+import org.apache.beehive.netui.util.config.bean.NetUIConfig;
+import org.apache.beehive.netui.util.config.internal.XmlBeanConfigFactory;
+import org.apache.beehive.netui.util.config.internal.xmlbean.generated.NetuiConfigDocument;
import org.apache.beehive.netui.util.logging.Logger;
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlOptions;
-import org.apache.xmlbeans.XmlError;
-
/**
* <p/>
* Utility class for reading properties from the NetUI configuration file.
@@ -47,18 +41,15 @@
*/
public class ConfigUtil {
- // @todo: need to change NetuiConfigDocument.NetuiConfig to NetUIConfig
// @todo: need to provide a read-only implementation so that users can't edit the config file on the fly
private static final Logger LOGGER = Logger.getInstance(ConfigUtil.class);
- private static final String DEFAULT_CONFIG = "org/apache/beehive/netui/util/config/beehive-netui-config-default.xml";
-
- private static NetuiConfigDocument _config = null;
+ private static NetuiConfigDocument.NetuiConfig _config = null;
+ private static NetUIConfig _newConfig = null;
/* do not construct */
- protected ConfigUtil() {
- }
+ protected ConfigUtil() {}
/**
* <p/>
@@ -75,84 +66,28 @@
* @throws ConfigInitializationException thrown when an error occurs loading the configuration file
* or when the configuration is reinitialized.
*/
- public static final void init(InputStream is)
+ public static void init(InputStream is)
throws ConfigInitializationException {
+
if(_config != null)
throw new ConfigInitializationException("Config initialization already completed; unable to reload the NetUI config file.");
internalInit(is);
}
+
+ protected static void internalInit(InputStream is) {
+ ConfigFactory configFactory = new XmlBeanConfigFactory();
+
+ _config = configFactory.getConfig(is);
+ //_newConfig = configFactory.getNewConfig(_config);
+ }
- public static final boolean isInit() {
+ public static boolean isInit() {
return _config != null;
}
- /**
- * Internal method used to re-initialize the static class member that holds the
- * ConfigDocument. Note, this method does <b>no</b> checks to ensure that an
- * existing document is being overwritten. The behavior of ConfigUtil clients
- * is undefined if their initial configuration is re-loaded.
- *
- * @param is The {@link java.io.InputStream} that contains the config document to load
- * @throws ConfigInitializationException thrown when an error occurs loading the
- * configuration file.
- */
- protected static final void internalInit(InputStream is)
- throws ConfigInitializationException {
-
- // when initialized with a null InputStream, revert to using a default, barebones config file
- if(is == null) {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- is = cl.getResourceAsStream(DEFAULT_CONFIG);
-
- if(is == null)
- throw new ConfigInitializationException("The NetUI runtime could not find the default config file. " +
- "The webapp may not function properly.");
-
- if(LOGGER.isInfoEnabled())
- LOGGER.info("Loading the default NetUI config file. The runtime will be configured " +
- "with a set of minimum parameters.");
- }
-
- if(_config == null) {
- try {
- XmlOptions loadOptions = new XmlOptions();
- loadOptions.setLoadLineNumbers();
- _config = NetuiConfigDocument.Factory.parse(is, loadOptions);
- }
- // XmlException | IOException
- catch(Exception ex) {
- assert ex instanceof XmlException || ex instanceof IOException;
-
- throw new ConfigInitializationException("Unable load the NetUI config file. Cause: " + ex, ex);
- }
- }
-
- assert _config != null;
-
- // Validate the document.
- XmlOptions validateOptions = new XmlOptions();
- ArrayList errorList = new ArrayList();
- validateOptions.setErrorListener(errorList);
- boolean isValid = _config.validate(validateOptions);
-
- // Throw an exception if the XML is invalid.
- if(!isValid) {
- InternalStringBuilder msg = new InternalStringBuilder("Invalid NetUI configuration file.");
-
- for(int i = 0; i < errorList.size(); i++) {
- XmlError error = (XmlError)errorList.get(i);
- msg.append("\n line ");
- msg.append(error.getLine());
- msg.append(": ");
- msg.append(error.getMessage());
- msg.append(" (");
- msg.append(error.getCursorLocation().toString());
- msg.append(")");
- }
-
- throw new ConfigInitializationException(msg.toString());
- }
+ public static NetUIConfig getNewConfig() {
+ return _newConfig;
}
/**
@@ -161,9 +96,9 @@
* @return a configuration bean that contains data
* parsed from the netui-config.xml file.
*/
- public static NetuiConfig getConfig() {
+ public static NetuiConfigDocument.NetuiConfig getConfig() {
if(_config != null) {
- return _config.getNetuiConfig();
+ return _config;
}
/*
If the config file wasn't initialized, attempt to initialize a configuration
Added: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/BindingContextConfig.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/BindingContextConfig.java?rev=265562&view=auto
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/BindingContextConfig.java (added)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/BindingContextConfig.java Wed Aug 31 12:37:55 2005
@@ -0,0 +1,40 @@
+/**
+ Copyright 2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Header:$
+ */
+package org.apache.beehive.netui.util.config.bean;
+
+/**
+ *
+ */
+public class BindingContextConfig {
+
+ private String _name;
+ private String _factoryClass;
+
+ public BindingContextConfig(String name, String factoryClass) {
+ _name = name;
+ _factoryClass = factoryClass;
+ }
+
+ public String getName() {
+ return _name;
+ }
+
+ public String getFactoryClass() {
+ return _factoryClass;
+ }
+}
Propchange: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/BindingContextConfig.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/CustomPropertyConfig.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/CustomPropertyConfig.java?rev=265562&view=auto
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/CustomPropertyConfig.java (added)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/CustomPropertyConfig.java Wed Aug 31 12:37:55 2005
@@ -0,0 +1,40 @@
+/**
+ Copyright 2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Header:$
+ */
+package org.apache.beehive.netui.util.config.bean;
+
+/**
+ *
+ */
+public class CustomPropertyConfig {
+
+ private String _name;
+ private String _value;
+
+ public CustomPropertyConfig(String name, String value) {
+ _name = name;
+ _value = value;
+ }
+
+ public String getName() {
+ return _name;
+ }
+
+ public String getValue() {
+ return _value;
+ }
+}
Propchange: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/CustomPropertyConfig.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/DocType.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/DocType.java?rev=265562&view=auto
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/DocType.java (added)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/DocType.java Wed Aug 31 12:37:55 2005
@@ -0,0 +1,97 @@
+/**
+ Copyright 2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Header:$
+ */
+package org.apache.beehive.netui.util.config.bean;
+
+/**
+ *
+ */
+public final class DocType
+ implements java.io.Serializable {
+
+ public static final int INT_HTML4_LOOSE = 0;
+ public static final int INT_HTML4_LOOSE_QUIRKS = 1;
+ public static final int INT_XHTML1_TRANSITIONAL = 2;
+
+ /**
+ */
+ public static final DocType HTML4_LOOSE = new DocType(INT_HTML4_LOOSE);
+
+ /**
+ */
+ public static final DocType HTML4_LOOSE_QUIRKS = new DocType(INT_HTML4_LOOSE_QUIRKS);
+
+ /**
+ */
+ public static final DocType XHTML1_TRANSITIONAL = new DocType(INT_XHTML1_TRANSITIONAL);
+
+ private int _val;
+
+ private DocType(int val) {
+ _val = val;
+ }
+
+ /**
+ * Convert this doc type to a readable String.
+ * @return the readable doc type name
+ */
+ public String toString() {
+ switch(_val) {
+ case INT_HTML4_LOOSE:
+ return "html4-loose";
+ case INT_HTML4_LOOSE_QUIRKS:
+ return "html4-loose-quirks";
+ case INT_XHTML1_TRANSITIONAL:
+ return "xhtml1-transitional";
+ }
+
+ String message = "Encountered an unknown doc type with value \"" + _val + "\"";
+ assert false : message;
+ throw new IllegalStateException(message);
+ }
+
+ /**
+ * Equals method.
+ * @param value value to check
+ * @return <code>true</code> if this doc type matches the <code>value</code>; <code>false</code> otherwise.
+ */
+ public boolean equals(Object value) {
+ if(value == this)
+ return true;
+ if(value == null || !(value instanceof DocType))
+ return false;
+
+ return ((DocType)value)._val == _val;
+ }
+
+ /**
+ * Hash code.
+ * @return the hash code
+ */
+ public int hashCode() {
+ return _val;
+ }
+
+ /**
+ * The doc type's int value.
+ *
+ * @return the doc type's value
+ */
+ public int getValue() {
+ return _val;
+ }
+}
Propchange: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/DocType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/ExpressionLanguageConfig.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/ExpressionLanguageConfig.java?rev=265562&view=auto
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/ExpressionLanguageConfig.java (added)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/ExpressionLanguageConfig.java Wed Aug 31 12:37:55 2005
@@ -0,0 +1,46 @@
+/**
+ Copyright 2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Header:$
+ */
+package org.apache.beehive.netui.util.config.bean;
+
+/**
+ *
+ */
+public class ExpressionLanguageConfig {
+
+ private String _name;
+ private String _factoryClass;
+ private BindingContextConfig[] _bindingContexts;
+
+ public ExpressionLanguageConfig(String name, String factoryClass, BindingContextConfig[] bindingContexts) {
+ _name = name;
+ _factoryClass = factoryClass;
+ _bindingContexts = bindingContexts;
+ }
+
+ public String getName() {
+ return _name;
+ }
+
+ public String getFactoryClass() {
+ return _factoryClass;
+ }
+
+ public BindingContextConfig[] getBindingContexts() {
+ return _bindingContexts;
+ }
+}
Propchange: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/ExpressionLanguageConfig.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/ExpressionLanguagesConfig.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/ExpressionLanguagesConfig.java?rev=265562&view=auto
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/ExpressionLanguagesConfig.java (added)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/ExpressionLanguagesConfig.java Wed Aug 31 12:37:55 2005
@@ -0,0 +1,40 @@
+/**
+ Copyright 2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Header:$
+ */
+package org.apache.beehive.netui.util.config.bean;
+
+/**
+ *
+ */
+public class ExpressionLanguagesConfig {
+
+ private String _defaultLanguage;
+ private ExpressionLanguageConfig[] _expressionLanguages;
+
+ public ExpressionLanguagesConfig(String defaultLanguage, ExpressionLanguageConfig[] expressionLanguages) {
+ _defaultLanguage = defaultLanguage;
+ _expressionLanguages = expressionLanguages;
+ }
+
+ public String getDefaultLanguage() {
+ return _defaultLanguage;
+ }
+
+ public ExpressionLanguageConfig[] getExpressionLanguages() {
+ return _expressionLanguages;
+ }
+}
Propchange: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/ExpressionLanguagesConfig.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/GlobalPageFlowActionInterceptorConfig.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/GlobalPageFlowActionInterceptorConfig.java?rev=265562&view=auto
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/GlobalPageFlowActionInterceptorConfig.java (added)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/GlobalPageFlowActionInterceptorConfig.java Wed Aug 31 12:37:55 2005
@@ -0,0 +1,41 @@
+/**
+ Copyright 2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Header:$
+ */
+package org.apache.beehive.netui.util.config.bean;
+
+/**
+ *
+ */
+public class GlobalPageFlowActionInterceptorConfig {
+
+ private SimpleActionInterceptorConfig[] _simpleActionInterceptor;
+ private InterceptorConfig[] _actionInterceptor;
+
+ public GlobalPageFlowActionInterceptorConfig(SimpleActionInterceptorConfig[] simpleActionInterceptor,
+ InterceptorConfig[] actionInterceptor) {
+ _simpleActionInterceptor = simpleActionInterceptor;
+ _actionInterceptor = actionInterceptor;
+ }
+
+ public SimpleActionInterceptorConfig[] getSimpleActionInterceptor() {
+ return _simpleActionInterceptor;
+ }
+
+ public InterceptorConfig[] getActionInterceptor() {
+ return _actionInterceptor;
+ }
+}
Propchange: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/GlobalPageFlowActionInterceptorConfig.java
------------------------------------------------------------------------------
svn:eol-style = native