cziegeler    02/01/14 07:23:40

  Modified:    .        build.xml
               src/java/org/apache/cocoon/components/deli Deli.java
                        DeliImpl.java
               src/java/org/apache/cocoon/transformation
                        TraxTransformer.java
  Added:       lib/optional deli.jar
  Removed:     lib/core deli.jar
  Log:
  Deli is now really optional. I changed the interface of the role for this!
  
  Revision  Changes    Path
  1.135     +2 -2      xml-cocoon2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/build.xml,v
  retrieving revision 1.134
  retrieving revision 1.135
  diff -u -r1.134 -r1.135
  --- build.xml 14 Jan 2002 12:11:52 -0000      1.134
  +++ build.xml 14 Jan 2002 15:23:39 -0000      1.135
  @@ -558,7 +558,7 @@
           <exclude name="**/JSP*.java"               unless="servlet.present"/>
           <exclude name="**/Jsp*.java"               unless="servlet.present"/>
           <exclude name="**/servlet.sitemap"         unless="servlet.present"/>
  -        <exclude name="**/components/deli/**.java" unless="servlet.present"/>
  +        <exclude name="**/components/deli/DeliImpl.java" unless="servlet.present"/>
           <exclude name="**/servlet/*.java"          unless="servlet.present"/>
           <exclude name="**/environment/http/*.java" unless="servlet.present"/>
           <exclude name="**/generation/StreamGenerator.java" 
unless="servlet.present"/>
  @@ -567,7 +567,7 @@
           <exclude name="**/ScriptGenerator.java"   unless="bsf.present"/>
           <exclude name="**/bsf.sitemap"            unless="bsf.present"/>
   
  -        <exclude name="**/components/deli/**.java" unless="deli.present"/>
  +        <exclude name="**/components/deli/DeliImpl.java" unless="deli.present"/>
           <exclude name="**/deli.sitemap"            unless="deli.present"/>
   
           <exclude name="**/HTMLGenerator.java"  unless="tidy.present"/>
  
  
  
  1.1                  xml-cocoon2/lib/optional/deli.jar
  
        <<Binary file>>
  
  
  1.2       +32 -26    xml-cocoon2/src/java/org/apache/cocoon/components/deli/Deli.java
  
  Index: Deli.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/deli/Deli.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Deli.java 9 Jan 2002 22:20:42 -0000       1.1
  +++ Deli.java 14 Jan 2002 15:23:39 -0000      1.2
  @@ -11,44 +11,50 @@
   import org.apache.avalon.framework.component.Component;
   import org.apache.cocoon.environment.Request;
   import org.w3c.dom.Document;
  -import javax.servlet.http.HttpServletRequest;
  -import javax.servlet.Servlet;
  -import javax.servlet.ServletException;
   import java.io.IOException;
  -import com.hp.hpl.deli.*;
  +//import com.hp.hpl.deli.*;
   
   /**
    * A component for providing CC/PP and UAProf support using the DELI
    * library.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Mark H. Butler</a>
  - * @version CVS $ $ $Date: 2002/01/09 22:20:42 $
  + * @version CVS $ $ $Date: 2002/01/14 15:23:39 $
    */
   
   public interface Deli extends Component {
   
       String ROLE = "org.apache.cocoon.components.deli.Deli";
   
  -  /** Process a HttpServletRequest and either extract
  -   *  CC/PP or UAProf information from it and use this information 
  -   *  to resolve a profile or examine the user agent string, match
  -   *  this using the DELI legacy device database, and use this
  -   *  information to retrieve the appropriate CC/PP profile. 
  -   *
  -   *@param   theRequest      The Request.
  -   *@return  The profile as a vector of profile attributes.
  -   *@exception       IOException.
  -   *@exception       ServletException.
  -   *@exception       Exception.
  -   */
  -    public Profile getProfile(Request theRequest) throws IOException, 
ServletException, Exception;
  -
  -  /** Convert a profile stored as a vector of profile attributes
  -   *  to a DOM tree.
  -   *
  -   *@param   theProfile      The profile as a vector of profile attributes.
  -   *@return  The DOM tree.
  -   */
  -    public Document getUACapabilities(Profile theProfile);
  +    /** Process a HttpServletRequest and either extract
  +     *  CC/PP or UAProf information from it and use this information
  +     *  to resolve a profile or examine the user agent string, match
  +     *  this using the DELI legacy device database, and use this
  +     *  information to retrieve the appropriate CC/PP profile.
  +     *
  +     *@param theRequest      The Request.
  +     *@return        The profile as a vector of profile attributes.
  +     *@exception     IOException.
  +     *@exception     ServletException.
  +     *@exception     Exception.
  +     */
  +    //Profile getProfile(Request theRequest) throws IOException, Exception;
  +
  +    /** Convert a profile stored as a vector of profile attributes
  +     *  to a DOM tree.
  +     *
  +     *@param theProfile      The profile as a vector of profile attributes.
  +     *@return        The DOM tree.
  +     */
  +    //Document getUACapabilities(Profile theProfile);
  +
  +    /** Convert a profile stored as a vector of profile attributes
  +     *  to a DOM tree.
  +     *
  +     *@param theProfile      The profile as a vector of profile attributes.
  +     *@return        The DOM tree.
  +     */
  +    Document getUACapabilities(Request theRequest)
  +    throws IOException, Exception;
   }
   
  
  
  
  1.3       +6 -1      
xml-cocoon2/src/java/org/apache/cocoon/components/deli/DeliImpl.java
  
  Index: DeliImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/deli/DeliImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DeliImpl.java     10 Jan 2002 15:01:52 -0000      1.2
  +++ DeliImpl.java     14 Jan 2002 15:23:39 -0000      1.3
  @@ -66,7 +66,7 @@
    * A Delivery Context Library for CC/PP and UAProf</a>.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Mark H. Butler</a>
  - * @version CVS $ $ $Date: 2002/01/10 15:01:52 $
  + * @version CVS $ $ $Date: 2002/01/14 15:23:39 $
    */
   
   public class DeliImpl
  @@ -202,6 +202,11 @@
       }
       return document;
     }
  +
  +    public Document getUACapabilities(Request theRequest)
  +    throws IOException, Exception {
  +        return this.getUACapabilities(this.getProfile(theRequest));
  +    }
   
      /**
        * Stub implementation of HttpServletRequest
  
  
  
  1.4       +18 -19    
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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TraxTransformer.java      11 Jan 2002 17:09:24 -0000      1.3
  +++ TraxTransformer.java      14 Jan 2002 15:23:40 -0000      1.4
  @@ -113,7 +113,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Giacomo Pati</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Ovidiu Predescu</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Mark H. Butler</a>
  - * @version CVS $Id: TraxTransformer.java,v 1.3 2002/01/11 17:09:24 bloritsch Exp $
  + * @version CVS $Id: TraxTransformer.java,v 1.4 2002/01/14 15:23:40 cziegeler Exp $
    */
   public class TraxTransformer extends AbstractTransformer
   implements Transformer, Composable, Recyclable, Configurable, Cacheable, Disposable 
{
  @@ -438,30 +438,29 @@
               getLogger().error("Error setting Browser info", e);
           }
   
  -        if (this._useDeli) try {
  -        Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT);
  -                if (map == null)
  -        {
  +        if (this._useDeli) {
  +            try {
  +                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");
  +                if (request != null) {
  +                    org.w3c.dom.Document deliCapabilities = 
deli.getUACapabilities(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);
  -        }
  +                    /* add the accept param */
  +                    map.put("accept", accept);
  +                }
   
  -        } catch (Exception e) {
  -            getLogger().error("Error setting DELI info", e);
  +            } catch (Exception e) {
  +                getLogger().error("Error setting DELI info", e);
  +            }
           }
  -
           return map;
       }
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to