dflorey     2004/06/02 08:35:39

  Modified:    proposals/projector/src/java/org/apache/slide/projector/engine
                        ProcessServlet.java
               proposals/projector/src/java/org/apache/slide/projector
                        Constants.java HttpContext.java
               proposals/projector/src/conf web.xml
               proposals/projector build.xml todo.txt
               proposals/projector/src/java/org/apache/slide/projector/connector/webdav
                        WebdavConnector.java
               proposals/projector/src/java/org/apache/slide/projector/processor/query
                        ResultResolver.java
  Log:
  Projector now runs as independant webapp.
  Preparation for later cluster mode.
  
  Revision  Changes    Path
  1.8       +3 -0      
jakarta-slide/proposals/projector/src/java/org/apache/slide/projector/engine/ProcessServlet.java
  
  Index: ProcessServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/projector/src/java/org/apache/slide/projector/engine/ProcessServlet.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ProcessServlet.java       1 Jun 2004 07:49:54 -0000       1.7
  +++ ProcessServlet.java       2 Jun 2004 15:35:39 -0000       1.8
  @@ -33,6 +33,9 @@
       public void service(HttpServletRequest request, HttpServletResponse response) 
throws ServletException, IOException {
        ApplicationManager.getInstance();
        Context context = new HttpContext(request, response);
  +        logger.log(Level.INFO, "Request uri=" + request.getRequestURI());
  +        logger.log(Level.INFO, "Context path=" + request.getContextPath());
  +        logger.log(Level.INFO, "Servlet path=" + request.getServletPath());
           URI uri = new 
URIValue(request.getRequestURI().substring(request.getContextPath().length()+request.getServletPath().length()+1));
           try {
               Result result;
  
  
  
  1.10      +0 -1      
jakarta-slide/proposals/projector/src/java/org/apache/slide/projector/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/projector/src/java/org/apache/slide/projector/Constants.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Constants.java    1 Jun 2004 16:13:10 -0000       1.9
  +++ Constants.java    2 Jun 2004 15:35:39 -0000       1.10
  @@ -28,7 +28,6 @@
       */
   
       public final static Credentials CREDENTIALS = new 
UsernamePasswordCredentials(REPOSITORY_USER, REPOSITORY_PASSWORD);
  -    public final static String PROCESS_SERVLET_PATH = "/process";
       public static final String PROCESS_ID_PARAMETER = "_process_id_";
       public static final String STEP_PARAMETER = "step";
        public static final int PROCESS_ID_LENGTH = 12;
  
  
  
  1.3       +1 -1      
jakarta-slide/proposals/projector/src/java/org/apache/slide/projector/HttpContext.java
  
  Index: HttpContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/projector/src/java/org/apache/slide/projector/HttpContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HttpContext.java  1 Jun 2004 07:49:54 -0000       1.2
  +++ HttpContext.java  2 Jun 2004 15:35:39 -0000       1.3
  @@ -20,7 +20,7 @@
       private String contextPath;
   
       public HttpContext(HttpServletRequest request, HttpServletResponse response) {
  -        this.contextPath = request.getContextPath()+Constants.PROCESS_SERVLET_PATH;
  +        this.contextPath = request.getContextPath()+request.getServletPath();
           sessionStore = new SessionStore(request);
           formStore = new FormStore(this, sessionStore);
           requestAttributeStore = new RequestAttributeStore(request);
  
  
  
  1.3       +4 -4      jakarta-slide/proposals/projector/src/conf/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/projector/src/conf/web.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- web.xml   5 May 2004 09:58:08 -0000       1.2
  +++ web.xml   2 Jun 2004 15:35:39 -0000       1.3
  @@ -3,15 +3,15 @@
   <web-app>
       <!-- Definition and configuration of Projector's WebDAV servlet. -->
       <servlet>
  -        <servlet-name>process</servlet-name>
  -        <display-name>Projector<display-name>
  +        <servlet-name>projector</servlet-name>
  +        <display-name>Projector</display-name>
           
<servlet-class>org.apache.slide.projector.engine.ProcessServlet</servlet-class>
           <load-on-startup>1</load-on-startup>
       </servlet>
       <!-- The mapping for the process servlet. -->
       <servlet-mapping>
  -        <servlet-name>process</servlet-name>
  -        <url-pattern>/</url-pattern>
  +        <servlet-name>projector</servlet-name>
  +        <url-pattern>/*</url-pattern>
       </servlet-mapping>
       <!-- Set the default session timeout (in seconds) -->
       <session-config>
  
  
  
  1.2       +3 -2      jakarta-slide/proposals/projector/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/projector/build.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.xml 3 May 2004 14:20:29 -0000       1.1
  +++ build.xml 2 Jun 2004 15:35:39 -0000       1.2
  @@ -103,8 +103,9 @@
               </fileset>

           </copy>

           <mkdir dir="${webapp.dist}"/>

  -        <war warfile="${webapp.dist}/projector.war" 
webxml="${dist.dir}/conf/web.xml">

  -            <lib dir="${lib.dir}"/>

  +        <war destfile="${webapp.dist}/projector.war" 
webxml="${dist.dir}/conf/web.xml">

  +            <lib dir="${lib.dir}" />

  +            <lib dir="${build.lib}" />

           </war>

       </target>

        

  
  
  
  1.3       +0 -1      jakarta-slide/proposals/projector/todo.txt
  
  Index: todo.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/projector/todo.txt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- todo.txt  18 May 2004 11:37:24 -0000      1.2
  +++ todo.txt  2 Jun 2004 15:35:39 -0000       1.3
  @@ -8,7 +8,6 @@
   * Use JbossTreeCache for cluster wide transactional data cache
   * Eclipse plugin for process modelling
   * Make processors SOAP-Aware
  -* Switch parsing of process descriptions to decentralized jdom
   * Single property query?
   * Category sensitive caching (language, channel...)
   * Access baselines or workspaces
  
  
  
  1.9       +3 -8      
jakarta-slide/proposals/projector/src/java/org/apache/slide/projector/connector/webdav/WebdavConnector.java
  
  Index: WebdavConnector.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/projector/src/java/org/apache/slide/projector/connector/webdav/WebdavConnector.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WebdavConnector.java      2 Jun 2004 13:58:53 -0000       1.8
  +++ WebdavConnector.java      2 Jun 2004 15:35:39 -0000       1.9
  @@ -19,6 +19,7 @@
   import java.io.IOException;
   import java.io.InputStream;
   import java.util.*;
  +import java.util.logging.Level;
   import java.util.logging.Logger;
   
   public class WebdavConnector implements Connector {
  @@ -149,20 +150,14 @@
           for ( Enumeration e = searchMethod.getAllResponseURLs(); 
e.hasMoreElements(); ) {
               Map searchResults = new HashMap(); 
               String uri = (String)e.nextElement();
  -             for ( Enumeration pe = searchMethod.getResponseProperties(uri); 
pe.hasMoreElements(); ) {
  +            for ( Enumeration pe = searchMethod.getResponseProperties(uri); 
pe.hasMoreElements(); ) {
                    Property property = (Property)pe.nextElement();
                                searchResults.put(property.getLocalName(), 
property.getPropertyAsString());
                }
  -                     if ( uri.indexOf(Constants.REPOSITORY_DOMAIN) > 0  ) {
  +                     if ( uri.indexOf(Constants.REPOSITORY_DOMAIN) != -1  ) {
                                uri = 
uri.substring(uri.indexOf(Constants.REPOSITORY_DOMAIN));
                        }
                        searchResults.put("uri", uri);
  -                                     /*
  -                     Value resource = getResource(new URIValue(uri), credentials);
  -            if ( resource != null ) {
  -                resources.add(resource);
  -            }
  -            */
                        values.add(new MapValue(searchResults));
           }
           return (Value [])values.toArray(new Value[values.size()]);
  
  
  
  1.2       +16 -14    
jakarta-slide/proposals/projector/src/java/org/apache/slide/projector/processor/query/ResultResolver.java
  
  Index: ResultResolver.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/projector/src/java/org/apache/slide/projector/processor/query/ResultResolver.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResultResolver.java       2 Jun 2004 13:58:53 -0000       1.1
  +++ ResultResolver.java       2 Jun 2004 15:35:39 -0000       1.2
  @@ -102,22 +102,24 @@
                        resultMap.putAll(map);
                        URI uri = (URI)map.get(URI_ENTRY);
                        Value content = 
ConnectorFactory.getConnector().getResource(uri, context.getCredentials()); 
  -                     if ( instructions instanceof MapValue ) {
  -                             if ( includeContent ) {
  -                                     content = new 
MultipleStreamableValue((StreamableValue) content);
  +                     if ( content != null ) {
  +                             if ( instructions instanceof MapValue ) {
  +                                     if ( includeContent ) {
  +                                             content = new 
MultipleStreamableValue((StreamableValue) content);
  +                                     }
  +                                     DocumentValue documentValue = new 
DocumentValue((StreamableValue)content);
  +                                     Map instructionMap = 
((MapValue)instructions).getMap();
  +                                     for ( Iterator j = 
instructionMap.entrySet().iterator(); j.hasNext(); ) {
  +                                             Map.Entry entry = (Map.Entry)j.next();
  +                                             String key = (String) entry.getKey();
  +                                             XPath xPath = 
XPath.newInstance(entry.getValue().toString());
  +                                             List nodeList = 
xPath.selectNodes(documentValue.getRootElement());
  +                                             resultMap.put(key, 
XPathQuery.createValueFromNodeList(nodeList));
  +                                     }
                                }
  -                             DocumentValue documentValue = new 
DocumentValue((StreamableValue)content);
  -                             Map instructionMap = ((MapValue)instructions).getMap();
  -                             for ( Iterator j = 
instructionMap.entrySet().iterator(); j.hasNext(); ) {
  -                                     Map.Entry entry = (Map.Entry)j.next();
  -                                     String key = (String) entry.getKey();
  -                             XPath xPath = 
XPath.newInstance(entry.getValue().toString());
  -                             List nodeList = 
xPath.selectNodes(documentValue.getRootElement());
  -                             resultMap.put(key, 
XPathQuery.createValueFromNodeList(nodeList));
  +                             if ( includeContent ) {
  +                                     resultMap.put(CONTENT_ENTRY, content);
                                }
  -                     }
  -                     if ( includeContent ) {
  -                             resultMap.put(CONTENT_ENTRY, content);
                        }
                        arrayEntries.add(new MapValue(resultMap));
                }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to