cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom FOM_Cocoon.java
Date Tue, 13 Jan 2004 01:40:46 GMT
vgritsenko    2004/01/12 17:40:46

  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/binding
                        RepeaterJXPathBindingBuilder.java
               src/java/org/apache/cocoon/components/flow/javascript/fom
                        FOM_Cocoon.java
  Log:
  Cosmetic changes
  
  Revision  Changes    Path
  1.10      +5 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/RepeaterJXPathBindingBuilder.java
  
  Index: RepeaterJXPathBindingBuilder.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/RepeaterJXPathBindingBuilder.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- RepeaterJXPathBindingBuilder.java	11 Jan 2004 20:51:16 -0000	1.9
  +++ RepeaterJXPathBindingBuilder.java	13 Jan 2004 01:40:46 -0000	1.10
  @@ -134,7 +134,10 @@
                       BindingManager.NAMESPACE,
                       "on-bind");
   
  -            if (childWrapElement == null) throw new BindingException("RepeaterBinding misses
'<on-bind>' child definition. " + DomHelper.getLocation(bindingElm));
  +            if (childWrapElement == null) {
  +                throw new BindingException("RepeaterBinding misses '<on-bind>' child
definition. " +
  +                                           DomHelper.getLocation(bindingElm));
  +            }
   
               JXPathBindingBase[] childBindings = assistant.makeChildBindings(childWrapElement);
   
  
  
  
  1.24      +98 -98    cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
  
  Index: FOM_Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- FOM_Cocoon.java	26 Dec 2003 18:48:40 -0000	1.23
  +++ FOM_Cocoon.java	13 Jan 2004 01:40:46 -0000	1.24
  @@ -93,7 +93,7 @@
   /**
    * Implementation of FOM (Flow Object Model).
    *
  - * @since 2.1 
  + * @since 2.1
    * @author <a href="mailto:coliver.at.apache.org">Christopher Oliver</a>
    * @author <a href="mailto:reinhard.at.apache.org">Reinhard P�tz</a>
    * @version CVS $Id$
  @@ -136,7 +136,7 @@
       }
   
       void setup(FOM_JavaScriptInterpreter interp,
  -               Environment env, 
  +               Environment env,
                  ComponentManager manager,
                  ServiceManager serviceManager,
                  Context avalonContext,
  @@ -159,7 +159,7 @@
               // Cannot use logger here, as it might already be null
               System.err.println("Request is null. Might be trying to invalidate an already
invalidated FOM_Cocoon instance.");
           }
  -        
  +
           // Cleanup everything
           this.request = null;
           this.response = null;
  @@ -174,25 +174,25 @@
   
   
       private FOM_WebContinuation forwardTo(String uri, Object bizData,
  -                                          Continuation continuation) 
  +                                          Continuation continuation)
           throws Exception {
           WebContinuation wk = null;
           if (continuation != null) {
               ContinuationsManager contMgr = (ContinuationsManager)
                   componentManager.lookup(ContinuationsManager.ROLE);
  -            wk = lastContinuation = 
  +            wk = lastContinuation =
                   contMgr.createWebContinuation(continuation,
                                                 lastContinuation,
                                                 0,
                                                 null);
           }
  -        
  +
           String redUri = uri;
  -        
  +
           FOM_WebContinuation fom_wk =
               new FOM_WebContinuation(wk);
           fom_wk.setParentScope(getParentScope());
  -        fom_wk.setPrototype(getClassPrototype(getParentScope(), 
  +        fom_wk.setPrototype(getClassPrototype(getParentScope(),
                                                 fom_wk.getClassName()));
           interpreter.forwardTo(getParentScope(), this, redUri,
                                 bizData, fom_wk, environment);
  @@ -207,23 +207,23 @@
           return result;
       }
   
  -    public FOM_WebContinuation jsFunction_sendPage(String uri, 
  -                                                   Object obj, 
  -                                                   Object continuation) 
  +    public FOM_WebContinuation jsFunction_sendPage(String uri,
  +                                                   Object obj,
  +                                                   Object continuation)
           throws Exception {
  -        return forwardTo(uri, unwrap(obj), (Continuation)unwrap(continuation)); 
  +        return forwardTo(uri, unwrap(obj), (Continuation)unwrap(continuation));
       }
  -                                    
  +
   
       public void jsFunction_processPipelineTo(String uri,
                                                Object map,
  -                                             Object outputStream) 
  +                                             Object outputStream)
           throws Exception {
           if (!(unwrap(outputStream) instanceof OutputStream)) {
               throw new JavaScriptException("expected a java.io.OutputStream instead of "
+ outputStream);
           }
  -        interpreter.process(getParentScope(), this, uri, map, 
  -                            (OutputStream)unwrap(outputStream), 
  +        interpreter.process(getParentScope(), this, uri, map,
  +                            (OutputStream)unwrap(outputStream),
                               environment);
       }
   
  @@ -236,41 +236,41 @@
       public void jsFunction_sendStatus(int sc) {
           PipelinesNode.getRedirector(environment).sendStatus(sc);
       }
  -    
  +
   /*
   
    NOTE (SM): These are the hooks to the future FOM Event Model that will be
    designed in the future. It has been postponed because we think
    there are more important things to do at the moment, but these
    are left here to indicate that they are planned.
  - 
  -    public void jsFunction_addEventListener(String eventName, 
  +
  +    public void jsFunction_addEventListener(String eventName,
                                               Object function) {
           // what is this?
       }
  -    
  +
       public void jsFunction_removeEventListener(String eventName,
                                                  Object function) {
           // what is this?
       }
  -    
  +
   */
   
       /**
        * Access components.
  -     * 
  +     *
        * TODO: Do we want to restrict the access of sitemap components? (RP)
        * TODO: Do we want to raise an error or return null? (RP)
  -     */  
  -    public Object jsFunction_getComponent(String id) 
  -        throws Exception { 
  +     */
  +    public Object jsFunction_getComponent(String id)
  +        throws Exception {
           return componentManager.lookup(id);
       }
  -    
  +
       /**
        * Release pooled components.
  -     * 
  -     * @param component - an <code>Object</code> that is an instance 
  +     *
  +     * @param component - an <code>Object</code> that is an instance
        * of <code>org.apache.avalon.framework.component.Component</code>
        */
       public void jsFunction_releaseComponent( Object component ) throws Exception {
  @@ -288,12 +288,12 @@
        * @return an <code>Object</code> value
        * @exception JavaScriptException if an error occurs
        */
  -    public Object jsFunction_load( String filename ) 
  +    public Object jsFunction_load( String filename )
           throws Exception {
  -        org.mozilla.javascript.Context cx = 
  +        org.mozilla.javascript.Context cx =
               org.mozilla.javascript.Context.getCurrentContext();
           Scriptable scope = getParentScope();
  -        Script script = interpreter.compileScript( cx, 
  +        Script script = interpreter.compileScript( cx,
                                                      environment,
                                                      filename );
           return script.exec( cx, scope );
  @@ -327,7 +327,7 @@
                true);
            return obj;
       }
  -    
  +
       /**
        * Create and setup an object so that it can access the information provided to regular
components.
        * This is done by calling the various Avalon lifecycle interfaces implemented by the
object, which
  @@ -346,14 +346,14 @@
        */
       public Object jsFunction_createObject(Object classObj) throws Exception {
           Object result;
  -        
  +
           if (classObj instanceof String) {
               result = ClassUtils.newInstance((String)classObj);
  -            
  +
           } else if (classObj instanceof NativeJavaClass) {
               Class clazz = ((NativeJavaClass)classObj).getClassObject();
               result = clazz.newInstance();
  -            
  +
           } else {
               throw new IllegalArgumentException("cocoon.createObject expects either a String
or Class argument, but got "
                   + classObj.getClass());
  @@ -361,10 +361,10 @@
   
           return jsFunction_setupObject(result);
       }
  -    
  +
       /**
  -     * Dispose an object that has been created using {@link #jsFunction_createObject(Class)}.
  -     * 
  +     * Dispose an object that has been created using {@link #jsFunction_createObject(Object)}.
  +     *
        * @param obj
        * @throws Exception
        */
  @@ -372,7 +372,7 @@
           LifecycleHelper.decommission(obj);
       }
   
  -    public static class FOM_Request 
  +    public static class FOM_Request
           extends ScriptableObject implements Request {
   
           Request request;
  @@ -384,7 +384,7 @@
           public FOM_Request(Object request) {
               this.request = (Request)unwrap(request);
           }
  -		
  +
           public String getClassName() {
               return "FOM_Request";
           }
  @@ -440,7 +440,7 @@
               return request.getCharacterEncoding();
           }
   
  -        public void jsFunction_setCharacterEncoding(String value) 
  +        public void jsFunction_setCharacterEncoding(String value)
               throws Exception {
               request.setCharacterEncoding(value);
           }
  @@ -468,47 +468,47 @@
           public String jsFunction_getAuthType() {
               return request.getAuthType();
           }
  -        
  +
           public String jsFunction_getProtocol() {
               return request.getProtocol();
           }
  -        
  +
           public String jsFunction_getServerName() {
               return request.getServerName();
           }
  -        
  +
           public String jsFunction_getRemoteAddr() {
               return request.getRemoteAddr();
           }
  -        
  +
           public String jsFunction_getRemoteHost() {
               return request.getRemoteHost();
           }
  -        
  +
           public int jsFunction_getServerPort() {
               return request.getServerPort();
           }
  -        
  +
           public String jsFunction_getScheme() {
               return request.getScheme();
           }
  -        
  +
           public String jsFunction_getMethod() {
               return request.getMethod();
           }
  -        
  +
           public boolean jsFunction_isSecure() {
               return request.isSecure();
           }
  -        
  +
           public Locale jsFunction_getLocale() {
               return request.getLocale();
           }
  -        
  +
           public Enumeration jsFunction_getLocales() {
               return request.getLocales();
           }
  -        
  +
           public FOM_Cookie[] jsFunction_getCookies() {
               Cookie[] cookies = request.getCookies();
               FOM_Cookie[] FOM_cookies = new FOM_Cookie[cookies!=null ? cookies.length :
0];
  @@ -520,11 +520,11 @@
               }
               return FOM_cookies;
           }
  -        
  +
           public Scriptable jsGet_cookies() {
               return org.mozilla.javascript.Context.getCurrentContext().newArray(getParentScope(),
jsFunction_getCookies());
           }
  -            
  +
           public FOM_Cookie jsFunction_getCookie(String name) {
               Object     cookie  = request.getCookieMap().get(name);
               FOM_Cookie fcookie = null;
  @@ -535,7 +535,7 @@
               }
               return fcookie;
           }
  -        
  +
           public String jsFunction_getHeader(String name) {
               return request.getHeader(name);
           }
  @@ -545,11 +545,11 @@
           public Enumeration jsFunction_getHeaders(String name) {
               return request.getHeaders(name);
           }
  -        
  +
           public Enumeration jsFunction_getHeaderNames() {
               return request.getHeaderNames();
           }
  -        
  +
           public Principal jsFunction_getUserPrincipal() {
               return request.getUserPrincipal();
           }
  @@ -559,7 +559,7 @@
           }
   
           // Request interface
  -        
  +
           public Object get(String name) {
               return request.get(name);
           }
  @@ -588,7 +588,7 @@
               return request.getCharacterEncoding();
           }
   
  -        public void setCharacterEncoding(String enc) 
  +        public void setCharacterEncoding(String enc)
               throws java.io.UnsupportedEncodingException {
               request.setCharacterEncoding(enc);
           }
  @@ -660,7 +660,7 @@
           public long getDateHeader(String name) {
               return request.getDateHeader(name);
           }
  -        
  +
           public String getHeader(String name) {
               return request.getHeader(name);
           }
  @@ -672,7 +672,7 @@
           public Enumeration getHeaderNames() {
               return request.getHeaderNames();
           }
  -        
  +
           public String getMethod() {
               return request.getMethod();
           }
  @@ -700,7 +700,7 @@
           public Principal getUserPrincipal() {
               return request.getUserPrincipal();
           }
  -        
  +
           public boolean isUserInRole(String role) {
               return request.isUserInRole(role);
           }
  @@ -712,7 +712,7 @@
           public String getRequestURI() {
               return request.getRequestURI();
           }
  -        
  +
           public String getSitemapURI() {
               return request.getSitemapURI();
           }
  @@ -743,7 +743,7 @@
   
       }
   
  -    public static class FOM_Cookie 
  +    public static class FOM_Cookie
           extends ScriptableObject implements Cookie {
   
           Cookie cookie;
  @@ -877,13 +877,13 @@
           public int getVersion() {
               return cookie.getVersion();
           }
  -        
  +
           public void setVersion(int v) {
               cookie.setVersion(v);
           }
       }
   
  -    public static class FOM_Response 
  +    public static class FOM_Response
           extends ScriptableObject implements Response {
   
           Response response;
  @@ -901,14 +901,14 @@
           }
   
           public Object jsFunction_createCookie(String name, String value) {
  -            FOM_Cookie result = 
  +            FOM_Cookie result =
                   new FOM_Cookie(response.createCookie(name, value));
               result.setParentScope(getParentScope());
               result.setPrototype(getClassPrototype(this, result.getClassName()));
               return result;
           }
   
  -        public void jsFunction_addCookie(Object cookie) 
  +        public void jsFunction_addCookie(Object cookie)
               throws JavaScriptException {
               if (!(cookie instanceof FOM_Cookie)) {
                   throw new JavaScriptException("expected a Cookie instead of " + cookie);
  @@ -928,7 +928,7 @@
           public void jsFunction_addHeader(String name, String value) {
               response.addHeader(name, value);
           }
  -        
  +
           public void jsFunction_setStatus(int sc) {
               if (response instanceof HttpResponse) {
                   ((HttpResponse) response).setStatus(sc);
  @@ -936,7 +936,7 @@
           }
   
           // Response interface
  -        
  +
           public String getCharacterEncoding() {
               return response.getCharacterEncoding();
           }
  @@ -963,7 +963,7 @@
           public String encodeURL(String url) {
               return response.encodeURL(url);
           }
  -        
  +
           public void setDateHeader(String name, long date) {
               response.setDateHeader(name, date);
           }
  @@ -983,13 +983,13 @@
           public void setIntHeader(String name, int value) {
               response.setIntHeader(name, value);
           }
  -        
  +
           public void addIntHeader(String name, int value) {
               response.addIntHeader(name, value);
           }
       }
   
  -    public static class FOM_Session 
  +    public static class FOM_Session
           extends ScriptableObject implements Session {
   
           Session session;
  @@ -1034,7 +1034,7 @@
           public Object jsFunction_getAttribute(String name) {
               return session.getAttribute(name);
           }
  -        
  +
           public void jsFunction_setAttribute(String name, Object value) {
               if (value instanceof NativeJavaObject) {
                   value = ((NativeJavaObject) value).unwrap();
  @@ -1079,12 +1079,12 @@
           }
   
   
  -        // Session interface 
  +        // Session interface
   
           public long getCreationTime() {
               return session.getCreationTime();
           }
  -        
  +
           public String getId() {
               return session.getId();
           }
  @@ -1126,7 +1126,7 @@
           }
       }
   
  -    public static class FOM_Context extends ScriptableObject 
  +    public static class FOM_Context extends ScriptableObject
           implements org.apache.cocoon.environment.Context {
   
           org.apache.cocoon.environment.Context context;
  @@ -1187,7 +1187,7 @@
               }
               return value;
           }
  -        
  +
           /* TODO: Vote on the inclusion of this method
           public String jsFunction_getRealPath(String path) {
           	return context.getRealPath(path);
  @@ -1212,11 +1212,11 @@
               return context.getAttributeNames();
           }
   
  -        public URL getResource(String path) 
  +        public URL getResource(String path)
               throws MalformedURLException {
               return context.getResource(path);
           }
  -        
  +
           public String getRealPath(String path) {
               return context.getRealPath(path);
           }
  @@ -1232,7 +1232,7 @@
           public InputStream getResourceAsStream(String path) {
               return context.getResourceAsStream(path);
           }
  -        
  +
       }
   
       public static class FOM_Log extends ScriptableObject {
  @@ -1249,19 +1249,19 @@
           public String getClassName() {
               return "FOM_Log";
           }
  -        
  +
           public void jsFunction_debug(String message) {
               logger.debug(message);
           }
  -        
  +
           public void jsFunction_info(String message) {
               logger.info(message);
           }
  -        
  +
           public void jsFunction_warn(String message) {
               logger.warn(message);
           }
  -        
  +
           public void jsFunction_error(String message) {
               logger.error(message);
           }
  @@ -1307,7 +1307,7 @@
               return null;
           }
           Map objectModel = environment.getObjectModel();
  -        response = 
  +        response =
               new FOM_Response(ObjectModelHelper.getResponse(objectModel));
           response.setParentScope(getParentScope());
           response.setPrototype(getClassPrototype(this, "FOM_Response"));
  @@ -1329,7 +1329,7 @@
               return context;
           }
           Map objectModel = environment.getObjectModel();
  -        context = 
  +        context =
               new FOM_Context(ObjectModelHelper.getContext(objectModel));
           context.setParentScope(getParentScope());
           context.setPrototype(getClassPrototype(this, "FOM_Context"));
  @@ -1345,7 +1345,7 @@
               return null;
           }
           Map objectModel = environment.getObjectModel();
  -        session = 
  +        session =
               new FOM_Session(ObjectModelHelper.getRequest(objectModel).getSession(true));
           session.setParentScope(getParentScope());
           session.setPrototype(getClassPrototype(this, "FOM_Session"));
  @@ -1355,7 +1355,7 @@
       /**
        * Get Sitemap parameters
        *
  -     * @return a <code>Scriptable</code> value whose properties represent 
  +     * @return a <code>Scriptable</code> value whose properties represent
        * the Sitemap parameters from <map:call>
        */
       public Scriptable jsGet_parameters() {
  @@ -1383,7 +1383,7 @@
        * @return The request
        */
       public Request getRequest() {
  -        FOM_Request fom_request = jsGet_request(); 
  +        FOM_Request fom_request = jsGet_request();
           return fom_request != null ? fom_request.request : null;
       }
   
  @@ -1440,10 +1440,10 @@
   
       public void forwardTo(String uri,
                             Object bean,
  -                          FOM_WebContinuation fom_wk) 
  +                          FOM_WebContinuation fom_wk)
           throws Exception {
           interpreter.forwardTo(getTopLevelScope(this),
  -                              this, 
  +                              this,
                                 uri,
                                 bean,
                                 fom_wk,
  @@ -1452,14 +1452,14 @@
   
       /**
        * Perform the behavior of <map:call continuation="blah">
  -     * This can be used in cases where the continuation id is not encoded 
  +     * This can be used in cases where the continuation id is not encoded
        * in the request in a form convenient to access in the sitemap.
  -     * Your script can extract the id from the request and then call 
  +     * Your script can extract the id from the request and then call
        * this method to process it as normal.
        * @param kontId The continuation id
        * @param parameters Any parameters you want to pass to the continuation (may be null)
        */
  -    public void handleContinuation(String kontId, Scriptable parameters) 
  +    public void handleContinuation(String kontId, Scriptable parameters)
           throws Exception {
           List list = null;
           if (parameters == null || parameters == Undefined.instance) {
  @@ -1486,7 +1486,7 @@
   
       public FOM_WebContinuation makeWebContinuation(Continuation k,
                                                      FOM_WebContinuation parent,
  -                                                   int timeToLive) 
  +                                                   int timeToLive)
           throws Exception {
           if (k == null) return null;
           WebContinuation wk;
  @@ -1499,7 +1499,7 @@
                                              null);
           FOM_WebContinuation result = new FOM_WebContinuation(wk);
           result.setParentScope(getParentScope());
  -        result.setPrototype(getClassPrototype(getParentScope(), 
  +        result.setPrototype(getClassPrototype(getParentScope(),
                                                 result.getClassName()));
           return result;
       }
  
  
  

Mime
View raw message