cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/jxforms/java/org/apache/cocoon/generation JXFormsGenerator.java
Date Fri, 07 Nov 2003 11:53:47 GMT
cziegeler    2003/11/07 03:53:47

  Modified:    .        status.xml
               src/java/org/apache/cocoon/generation
                        JXTemplateGenerator.java
               src/blocks/jxforms/java/org/apache/cocoon/generation
                        JXFormsGenerator.java
  Log:
     <action dev="CZ" type="fix" fixes-bug="23538" due-to-email="samc@atnet.net.au" due-to="Sam
Coward">
       Applying patch from Sam Coward (samc@atnet.net.au) for reducing 
       setDocumentLocator calls in JXTemplateGenerator and JXFormsGenerator.
    </action>
  
  Revision  Changes    Path
  1.187     +5 -1      cocoon-2.1/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/status.xml,v
  retrieving revision 1.186
  retrieving revision 1.187
  diff -u -r1.186 -r1.187
  --- status.xml	7 Nov 2003 10:49:58 -0000	1.186
  +++ status.xml	7 Nov 2003 11:53:47 -0000	1.187
  @@ -192,6 +192,10 @@
     <changes>
   
    <release version="@version@" date="@date@">
  +   <action dev="CZ" type="fix" fixes-bug="23538" due-to-email="samc@atnet.net.au" due-to="Sam
Coward">
  +     Applying patch from Sam Coward (samc@atnet.net.au) for reducing 
  +     setDocumentLocator calls in JXTemplateGenerator and JXFormsGenerator.
  +  </action>
      <action dev="BD" type="add" fixes-bug="24294" due-to="Jelle Alten" due-to-email="jelle@ordina.nl">
        sitemap-viewer added to the scratchpad samples
     </action>
  
  
  
  1.18      +41 -5     cocoon-2.1/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
  
  Index: JXTemplateGenerator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JXTemplateGenerator.java	6 Nov 2003 20:23:04 -0000	1.17
  +++ JXTemplateGenerator.java	7 Nov 2003 11:53:47 -0000	1.18
  @@ -395,6 +395,38 @@
       }
   
       /**
  +     * Facade to the Locator to be set on the consumer prior to
  +     * sending other events, location member changeable
  +     */
  +    public class LocatorFacade implements Locator {
  +        private Locator locator;
  +   
  +        public LocatorFacade(Locator intialLocator) {
  +            this.locator = intialLocator;
  +        }
  +        
  +        public void setDocumentLocator(Locator newLocator) {
  +            this.locator = newLocator;
  +        }
  +       
  +        public int getColumnNumber() {
  +            return this.locator.getColumnNumber();
  +        }
  +        
  +        public int getLineNumber() {
  +            return this.locator.getLineNumber();
  +        }
  +        
  +        public String getPublicId() {
  +            return this.locator.getPublicId();
  +        }
  +        
  +        public String getSystemId() {
  +            return this.locator.getSystemId();
  +        }
  +    }
  +   
  +    /**
        * Jexl Introspector that supports Rhino JavaScript objects
        * as well as Java Objects
        */
  @@ -2800,10 +2832,12 @@
   
       private void executeRaw(final XMLConsumer consumer,
                               Event startEvent, Event endEvent) 
  -        throws SAXException {
  +    throws SAXException {
           Event ev = startEvent;
  +        LocatorFacade loc = new LocatorFacade(ev.location);
  +        consumer.setDocumentLocator(loc);
           while (ev != endEvent) {
  -            consumer.setDocumentLocator(ev.location);
  +            loc.setDocumentLocator(ev.location);
               if (ev instanceof Characters) {
                   TextEvent text = (TextEvent)ev;
                   consumer.characters(text.raw, 0, text.raw.length);
  @@ -2918,10 +2952,12 @@
                            MyJexlContext jexlContext,
                            JXPathContext jxpathContext,
                            Event startEvent, Event endEvent) 
  -        throws SAXException {
  +    throws SAXException {
           Event ev = startEvent;
  +        LocatorFacade loc = new LocatorFacade(ev.location);
  +        consumer.setDocumentLocator(loc);
           while (ev != endEvent) {
  -            consumer.setDocumentLocator(ev.location);
  +            loc.setDocumentLocator(ev.location);
               if (ev instanceof Characters) {
                   TextEvent text = (TextEvent)ev;
                   Iterator iter = text.substitutions.iterator();
  
  
  
  1.6       +35 -1     cocoon-2.1/src/blocks/jxforms/java/org/apache/cocoon/generation/JXFormsGenerator.java
  
  Index: JXFormsGenerator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/jxforms/java/org/apache/cocoon/generation/JXFormsGenerator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JXFormsGenerator.java	24 Sep 2003 22:04:40 -0000	1.5
  +++ JXFormsGenerator.java	7 Nov 2003 11:53:47 -0000	1.6
  @@ -167,6 +167,38 @@
       final static String XF_VALUE = "xf:value";
   
   
  +	/**
  +	 * Facade to the Locator to be set on the consumer prior to
  +	 * sending other events, location member changeable
  +	 */
  +	public class LocatorFacade implements Locator {
  +			private Locator locator;
  +            
  +			public LocatorFacade(Locator intialLocator) {
  +				this.locator = intialLocator;
  +			}
  +            
  +			public void setDocumentLocator(Locator newLocator) {
  +				this.locator = newLocator;
  +			}
  +			
  +			public int getColumnNumber() {
  +				return this.locator.getColumnNumber();
  +			}
  +            
  +			public int getLineNumber() {
  +				return this.locator.getLineNumber();
  +			}
  +            
  +			public String getPublicId() {
  +				return this.locator.getPublicId();
  +			}
  +            
  +			public String getSystemId() {
  +				return this.locator.getSystemId();
  +			}
  +	}
  +	
       static class XPathExpr {
   
           final CompiledExpression jxpath;
  @@ -1254,8 +1286,10 @@
                            Event startEvent, Event endEvent) 
           throws SAXException {
           Event ev = startEvent;
  +        LocatorFacade loc = new LocatorFacade(ev.location);
  +        consumer.setDocumentLocator(loc);
           while (ev != endEvent) {
  -            consumer.setDocumentLocator(ev.location);
  +            loc.setDocumentLocator(ev.location);
               if (ev instanceof Characters) {
                   TextEvent text = (TextEvent)ev;
                   consumer.characters(text.chars, 0, text.chars.length);
  
  
  

Mime
View raw message