avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon/merlin/kernel/servlet/src/webapp/css merlin.css
Date Sun, 21 Dec 2003 23:14:49 GMT
mcconnell    2003/12/21 15:14:49

  Modified:    merlin/kernel/servlet/src/java/org/apache/avalon/merlin/servlet
                        MerlinServlet.java
               merlin/kernel/servlet/src/webapp/WEB-INF web.xml
               merlin/kernel/servlet/src/webapp/css merlin.css
  Log:
  Add listing of the kernel parameters as part of the default behaviour of the merlin servlet.
  
  Revision  Changes    Path
  1.2       +74 -12    avalon/merlin/kernel/servlet/src/java/org/apache/avalon/merlin/servlet/MerlinServlet.java
  
  Index: MerlinServlet.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/kernel/servlet/src/java/org/apache/avalon/merlin/servlet/MerlinServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MerlinServlet.java	21 Dec 2003 01:43:47 -0000	1.1
  +++ MerlinServlet.java	21 Dec 2003 23:14:49 -0000	1.2
  @@ -66,6 +66,7 @@
   import org.apache.avalon.composition.model.ContainmentModel;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.merlin.Kernel;
  +import org.apache.avalon.merlin.KernelCriteria;
   import org.apache.avalon.repository.Artifact;
   import org.apache.avalon.repository.provider.Builder;
   import org.apache.avalon.repository.provider.InitialContext;
  @@ -99,6 +100,8 @@
       // state
       //----------------------------------------------------------
   
  +    private KernelCriteria m_criteria;
  +
       private Block m_block;
   
       private Kernel m_kernel;
  @@ -138,11 +141,11 @@
               Builder builder = 
                 new DefaultBuilder( context, artifact );
               Factory factory = builder.getFactory();
  -            Map criteria = factory.createDefaultCriteria();
  +            m_criteria = (KernelCriteria) factory.createDefaultCriteria();
   
  -            criteria.put( "merlin.server", "true" );
  -            criteria.put( "merlin.info", "true" ); 
  -            criteria.put( "merlin.debug", "true" ); 
  +            m_criteria.put( "merlin.server", "true" );
  +            m_criteria.put( "merlin.info", "true" );
  +            m_criteria.put( "merlin.debug", "true" );
   
               //
               // this is where we customize content based on web.xml
  @@ -150,7 +153,7 @@
               // with merlin.properties first of all)
               //
   
  -            m_kernel = (Kernel) factory.create( criteria );
  +            m_kernel = (Kernel) factory.create( m_criteria );
               
               System.out.println("kernel established");
   
  @@ -210,21 +213,49 @@
           response.setContentType("text/html");
           PrintWriter writer = response.getWriter();
   
  +        String context = request.getContextPath();
  +
           writer.println("<html>");
  +
           writer.println("<head>");
  -        writer.println("<title>Merlin Test Servlet Page</title>");
  +        writer.println(
  +          "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + context + "/css/merlin.css\">"
);
  +        writer.println("<title>Merlin Servlet Info</title>" );
           writer.println("</head>");
  -        writer.println("<body bgcolor=white>");
  +        writer.println("<body background=\"" + context + "/images/Paper.gif\">" );
   
  -        writer.println("<table border=\"0\">");
  -        writer.println("<tr>");
  -        writer.println("<td>");
  -        writer.println("<h1>Merlin Servlet Info</h1>");
  +        writer.println("<table border=\"1\" width=\"100%\" cellpadding=\"1\">");
  +        writer.println("<tr bgcolor=\"7171A5\">");
  +        writer.println("<td align=\"left\" colspan=\"2\">");
  +        writer.println("<div class=\"page-title-text\">Merlin Servlet Info</div>");
           writer.println("</td>");
           writer.println("</tr>");
  +
  +        writer.println("<tr class=\"table-header-row\" bgcolor=\"EEEEFF\">" );
  +        writer.println("<td width=\"20%\">Criteria</td>");
  +        writer.println("<td>Value</td>");
  +        writer.println("</tr>");
  +
  +        row( writer, "${merlin.anchor}", m_criteria.getAnchorDirectory() );
  +        row( writer, "${merlin.config}", m_criteria.getConfigDirectory() );
  +        row( writer, "${merlin.context}", m_criteria.getContextDirectory() );
  +        row( writer, "${merlin.home}", m_criteria.getHomeDirectory() );
  +        row( writer, "${merlin.kernel}", m_criteria.getKernelURL() );
  +        row( writer, "${merlin.lang}", m_criteria.getLanguageCode() );
  +        row( writer, "${merlin.override}", m_criteria.getOverridePath() );
  +        row( writer, "${merlin.repository}", m_criteria.getRepositoryDirectory() );
  +        row( writer, "${merlin.system}", m_criteria.getSystemDirectory() );
  +        row( writer, "${merlin.temp}", m_criteria.getTempDirectory() );
  +        row( writer, "${merlin.dir}", m_criteria.getWorkingDirectory() );
  +        row( writer, "${merlin.autostart}", m_criteria.isAutostartEnabled() );
  +        row( writer, "${merlin.debug}", m_criteria.isDebugEnabled() );
  +        row( writer, "${merlin.info}", m_criteria.isInfoEnabled() );
  +        row( writer, "${merlin.server}", m_criteria.isServerEnabled() );
  +
           writer.println("</table>");
   
  -        writer.println("<hr/>");
  +        writer.println("</body>");
  +        writer.println("</html>");
       }
   
      /**
  @@ -271,5 +302,36 @@
                 ExceptionHelper.packException( error, e, true );
               throw new RuntimeException( message );
           }
  +    }
  +
  +    private void row( PrintWriter writer, String item, boolean val )
  +    {
  +        if( val )
  +        {
  +            row( writer, item, "true" );
  +        }
  +        else
  +        {
  +            row( writer, item, "false" );
  +        }
  +    }
  +
  +    private void row( PrintWriter writer, String item, Object val )
  +    {
  +        writer.println("<tr class=\"table-row\">");
  +        writer.println("<td>");
  +        writer.println( item );
  +        writer.println("</td>");
  +        writer.println("<td>");
  +        if( null != val )
  +        {
  +            writer.println( val.toString() );
  +        }
  +        else
  +        {
  +            writer.println( "&nbsp;" );
  +        }
  +        writer.println("</td>");
  +        writer.println("</tr>");
       }
   }
  
  
  
  1.2       +1 -1      avalon/merlin/kernel/servlet/src/webapp/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/kernel/servlet/src/webapp/WEB-INF/web.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- web.xml	21 Dec 2003 01:43:47 -0000	1.1
  +++ web.xml	21 Dec 2003 23:14:49 -0000	1.2
  @@ -18,7 +18,7 @@
   
     <servlet-mapping>
       <servlet-name>merlin</servlet-name>
  -    <url-pattern>/*</url-pattern>
  +    <url-pattern>/info</url-pattern>
     </servlet-mapping>
   
   </web-app>
  
  
  
  1.2       +15 -2     avalon/merlin/kernel/servlet/src/webapp/css/merlin.css
  
  Index: merlin.css
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/kernel/servlet/src/webapp/css/merlin.css,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- merlin.css	21 Dec 2003 01:43:47 -0000	1.1
  +++ merlin.css	21 Dec 2003 23:14:49 -0000	1.2
  @@ -41,12 +41,25 @@
   }
   
   .table-row { 
  -  margin-top: 3px; margin-bottom: 3px;
  +  margin-top: 3px; 
  +  margin-bottom: 3px;
  +  margin-left: 3px; 
  +  margin-right: 3px; 
  +  font-family: Verdana, Arial, Helvetica, sans-serif
  +}
  +
  +.table-header-row { 
  +  margin-top: 3px; 
  +  margin-bottom: 3px;
  +  margin-left: 3px; 
  +  margin-right: 3px; 
  +  font-family: Verdana, Arial, Helvetica, sans-serif
   }
   
   P{
  +  color: #FFFFFF;  
     font-size: 10pt; 
  -  font-family: verdana; color: black;  
  +  font-family: Verdana, Arial, Helvetica, sans-serif
     margin-left: 3px; 
     margin-right: 3px; 
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message