cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/transformation TraxTransformer.java
Date Fri, 11 Jan 2002 17:09:25 GMT
bloritsch    02/01/11 09:09:25

  Modified:    src/java/org/apache/cocoon/transformation
                        TraxTransformer.java
  Log:
  Deli jar no longer absolutely required.  This makes Cocoon backwards compatible without
sacrificing new functionality.
  
  Revision  Changes    Path
  1.3       +26 -27    xml-cocoon2/src/java/org/apache/cocoon/transformation/TraxTransformer.java
  
  Index: TraxTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/TraxTransformer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TraxTransformer.java	9 Jan 2002 22:20:42 -0000	1.2
  +++ TraxTransformer.java	11 Jan 2002 17:09:24 -0000	1.3
  @@ -41,9 +41,6 @@
   import java.text.StringCharacterIterator;
   import java.util.*;
   
  -import com.hp.hpl.deli.Profile;
  -import com.hp.hpl.deli.ProfileAttribute;
  -
   /**
    * This Transformer is used to transform this incomming SAX stream using
    * a XSLT stylesheet. Use the following sitemap declarations to define, configure
  @@ -116,7 +113,7 @@
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
    * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
    * @author <a href="mailto:marbut@hplb.hpl.hp.com">Mark H. Butler</a>
  - * @version CVS $Id: TraxTransformer.java,v 1.2 2002/01/09 22:20:42 ovidiu Exp $
  + * @version CVS $Id: TraxTransformer.java,v 1.3 2002/01/11 17:09:24 bloritsch Exp $
    */
   public class TraxTransformer extends AbstractTransformer
   implements Transformer, Composable, Recyclable, Configurable, Cacheable, Disposable {
  @@ -182,14 +179,14 @@
             child = conf.getChild("use-browser-capabilities-db");
             this.useBrowserCap = child.getValueAsBoolean(false);
             this._useBrowserCap = this.useBrowserCap;
  -          
  +
             child = conf.getChild("use-session-info");
             this.useSessionInfo = child.getValueAsBoolean(false);
             this._useSessionInfo = this.useSessionInfo;
   
             child = conf.getChild("xslt-processor-role");
             String xsltRole = child.getValue(XSLTProcessor.ROLE);
  -          
  +
             child = conf.getChild("use-deli");
             this.useDeli = child.getValueAsBoolean(false);
             this._useDeli = this.useDeli;
  @@ -222,7 +219,11 @@
           }
           this.browser = (Browser) manager.lookup(Browser.ROLE);
           getLogger().debug("Looking up " + Deli.ROLE);
  -        this.deli = (Deli) manager.lookup(Deli.ROLE);
  +
  +        if (this.manager.hasComponent(Deli.ROLE))
  +        {
  +            this.deli = (Deli) manager.lookup(Deli.ROLE);
  +        }
       }
   
       /**
  @@ -438,26 +439,24 @@
           }
   
           if (this._useDeli) try {
  -		Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT);
  -                if (map == null) 
  -		{
  -                	map = new HashMap();
  -            	}
  -     
  -		if (request != null) 
  -		{
  -
  -			Profile theProfile = deli.getProfile(request);
  -        	    	org.w3c.dom.Document deliCapabilities = deli.getUACapabilities(theProfile);
  -	            	map.put("deli-capabilities", deliCapabilities);
  -
  -        	       String accept = request.getParameter("accept");
  -	               if (accept == null)
  -        	           accept = request.getHeader("accept");
  -
  -	               /* add the accept param */
  -        	       map.put("accept", accept);
  -		}
  +        Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT);
  +                if (map == null)
  +        {
  +                    map = new HashMap();
  +                }
  +
  +        if (request != null)
  +        {
  +            org.w3c.dom.Document deliCapabilities = deli.getUACapabilities(deli.getProfile(request));
  +            map.put("deli-capabilities", deliCapabilities);
  +
  +            String accept = request.getParameter("accept");
  +            if (accept == null)
  +                accept = request.getHeader("accept");
  +
  +            /* add the accept param */
  +            map.put("accept", accept);
  +        }
   
           } catch (Exception e) {
               getLogger().error("Error setting DELI info", e);
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message