mcardle     2005/12/05 17:49:04 CET

  Modified files:
    .                    ESI_readme.txt build.properties.default 
                         build.xml 
    src/net/sf/j2ep      ProxyFilter.java 
    src/org/jahia/esi    Utils.java 
    src/org/jahia/esi/cache ContentCacheObject.java 
                            FragmentCache.java UrlCacheObject.java 
    src/org/jahia/esi/exceptions DetailedServerException.java 
                                 RedirectException.java 
                                 TransferFailedException.java 
    src/org/jahia/esi/stats EsiStats.java 
    src                  src.iml 
  Added files:
    src/org/jahia/esi/exceptions EsiServerException.java 
    esiadmin             cachestatus.jsp contentcachestatus.jsp 
                         index.jsp 
    esiadmin/css         screen.css 
    esiadmin/img         arrow_down.png arrow_off.png arrow_up.png 
                         ico_file_csv.png ico_file_excel.png 
                         ico_file_pdf.png ico_file_xml.png 
                         paginazione.png paginazione_ahead.png 
                         paginazione_back.png valid-xhtml10.png 
    esiadmin/inc         footer.jsp header.jsp 
    src/org/jahia/esi/admin CacheStatus.java 
  Log:
  * adds ESI server admin center accessible at 
http://localhost:8081/esadmin/index.jsp
  
  Revision  Changes    Path
  1.5       +2 -0      esi_server/ESI_readme.txt
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/ESI_readme.txt.diff?r1=1.4&r2=1.5&f=h
  1.4       +1 -1      esi_server/build.properties.default
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/build.properties.default.diff?r1=1.3&r2=1.4&f=h
  1.9       +41 -26    esi_server/build.xml
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/build.xml.diff?r1=1.8&r2=1.9&f=h
  1.1       +95 -0     esi_server/esiadmin/cachestatus.jsp (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/cachestatus.jsp?rev=1.1&content-type=text/plain
  1.1       +84 -0     esi_server/esiadmin/contentcachestatus.jsp (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/contentcachestatus.jsp?rev=1.1&content-type=text/plain
  1.1       +326 -0    esi_server/esiadmin/css/screen.css (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/css/screen.css?rev=1.1&content-type=text/plain
  1.1       +4 -0      esi_server/esiadmin/img/arrow_down.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/arrow_down.png?rev=1.1&content-type=text/plain
  1.1       +4 -0      esi_server/esiadmin/img/arrow_off.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/arrow_off.png?rev=1.1&content-type=text/plain
  1.1       +4 -0      esi_server/esiadmin/img/arrow_up.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/arrow_up.png?rev=1.1&content-type=text/plain
  1.1       +5 -0      esi_server/esiadmin/img/ico_file_csv.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/ico_file_csv.png?rev=1.1&content-type=text/plain
  1.1       +4 -0      esi_server/esiadmin/img/ico_file_excel.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/ico_file_excel.png?rev=1.1&content-type=text/plain
  1.1       +4 -0      esi_server/esiadmin/img/ico_file_pdf.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/ico_file_pdf.png?rev=1.1&content-type=text/plain
  1.1       +4 -0      esi_server/esiadmin/img/ico_file_xml.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/ico_file_xml.png?rev=1.1&content-type=text/plain
  1.1       +6 -0      esi_server/esiadmin/img/paginazione.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/paginazione.png?rev=1.1&content-type=text/plain
  1.1       +7 -0      esi_server/esiadmin/img/paginazione_ahead.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/paginazione_ahead.png?rev=1.1&content-type=text/plain
  1.1       +6 -0      esi_server/esiadmin/img/paginazione_back.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/paginazione_back.png?rev=1.1&content-type=text/plain
  1.1       +10 -0     esi_server/esiadmin/img/valid-xhtml10.png (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/img/valid-xhtml10.png?rev=1.1&content-type=text/plain
  1.1       +12 -0     esi_server/esiadmin/inc/footer.jsp (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/inc/footer.jsp?rev=1.1&content-type=text/plain
  1.1       +43 -0     esi_server/esiadmin/inc/header.jsp (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/inc/header.jsp?rev=1.1&content-type=text/plain
  1.1       +55 -0     esi_server/esiadmin/index.jsp (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/esiadmin/index.jsp?rev=1.1&content-type=text/plain
  1.13      +17 -2     esi_server/src/net/sf/j2ep/ProxyFilter.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/net/sf/j2ep/ProxyFilter.java.diff?r1=1.12&r2=1.13&f=h
  1.13      +29 -30    esi_server/src/org/jahia/esi/Utils.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/org/jahia/esi/Utils.java.diff?r1=1.12&r2=1.13&f=h
  1.1       +79 -0     esi_server/src/org/jahia/esi/admin/CacheStatus.java (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/org/jahia/esi/admin/CacheStatus.java?rev=1.1&content-type=text/plain
  1.3       +11 -1     
esi_server/src/org/jahia/esi/cache/ContentCacheObject.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/org/jahia/esi/cache/ContentCacheObject.java.diff?r1=1.2&r2=1.3&f=h
  1.9       +14 -3     esi_server/src/org/jahia/esi/cache/FragmentCache.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/org/jahia/esi/cache/FragmentCache.java.diff?r1=1.8&r2=1.9&f=h
  1.5       +13 -7     esi_server/src/org/jahia/esi/cache/UrlCacheObject.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/org/jahia/esi/cache/UrlCacheObject.java.diff?r1=1.4&r2=1.5&f=h
  1.2       +1 -1      
esi_server/src/org/jahia/esi/exceptions/DetailedServerException.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/org/jahia/esi/exceptions/DetailedServerException.java.diff?r1=1.1&r2=1.2&f=h
  1.1       +23 -0     
esi_server/src/org/jahia/esi/exceptions/EsiServerException.java (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/org/jahia/esi/exceptions/EsiServerException.java?rev=1.1&content-type=text/plain
  1.3       +1 -1      
esi_server/src/org/jahia/esi/exceptions/RedirectException.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/org/jahia/esi/exceptions/RedirectException.java.diff?r1=1.2&r2=1.3&f=h
  1.3       +1 -1      
esi_server/src/org/jahia/esi/exceptions/TransferFailedException.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/org/jahia/esi/exceptions/TransferFailedException.java.diff?r1=1.2&r2=1.3&f=h
  1.2       +32 -0     esi_server/src/org/jahia/esi/stats/EsiStats.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/org/jahia/esi/stats/EsiStats.java.diff?r1=1.1&r2=1.2&f=h
  1.4       +6 -8      esi_server/src/src.iml
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/esi_server/src/src.iml.diff?r1=1.3&r2=1.4&f=h
  
  
  
  Index: ESI_readme.txt
  ===================================================================
  RCS file: /home/cvs/repository/esi_server/ESI_readme.txt,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ESI_readme.txt    30 Nov 2005 16:33:55 -0000      1.4
  +++ ESI_readme.txt    5 Dec 2005 16:49:00 -0000       1.5
  @@ -148,6 +148,8 @@
      by "debug" in 
\YOUR_JAHIA_DIR\tomcat\webapps\jahia\WEB-INF\etc\config\log4j.xml.
      You will need to restart the ESI server for this changes to be taken into 
account.
   
  +15/ To access the administration page of the ESI server, please go to
  +     http://YOUR_ESI_SERVER_IP:8081/esiadmin/index.jsp
   
   Note: In this example config, we used port 8080 for the Jahia server and 
8081 for the ESI server.
   However, you can change this to any suitable port combination by first 
changing the server.xml
  
  
  
  Index: build.properties.default
  ===================================================================
  RCS file: /home/cvs/repository/esi_server/build.properties.default,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.properties.default  30 Nov 2005 16:11:16 -0000      1.3
  +++ build.properties.default  5 Dec 2005 16:49:00 -0000       1.4
  @@ -6,7 +6,7 @@
   manager.username= username that can use the manager
   manager.password= password for user above
   
  -targetapp.dir=${catalina.home}/webapps/ROOT/WEB-INF/
  +targetapp.dir=${catalina.home}/webapps/ROOT/
   
   #server
   server.url = http://localhost:8080
  
  
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/repository/esi_server/build.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- build.xml 30 Nov 2005 16:11:16 -0000      1.8
  +++ build.xml 5 Dec 2005 16:49:00 -0000       1.9
  @@ -224,7 +224,7 @@
       -->
       <target name="go" depends="release" description="MARC : compiles and 
copies new jar into tomcat root webinf">
   
  -        <copy file="${dist.home}/${app.name}-custom.jar" 
todir="${targetapp.dir}/lib">
  +        <copy file="${dist.home}/${app.name}-custom.jar" 
todir="${targetapp.dir}/WEB-INF/lib">
           </copy>
   
       </target>
  @@ -405,41 +405,56 @@
                <property name="aspectjrt-1.2.1.jar" 
value="${lib.home}/aspectjrt-1.2.1.jar" />
                <property name="regexp-1.2.jar" 
value="${lib.home}/regexp-1.2.jar" />
   
  +             <property name="itext-0.99.jar" 
value="${lib.home}/itext-0.99.jar" />
  +             <property name="displaytag-1.0.jar" 
value="${lib.home}/displaytag-1.0.jar" />
  +
           <!-- Create build directories as needed -->
           <mkdir  dir="${build.home}"/>
           <mkdir  dir="${build.home}"/>
           <mkdir  dir="${build.home}"/>
           <mkdir  dir="${reports.test}"/>
  -             <mkdir  dir="${targetapp.dir}/config"/>
  -             <mkdir  dir="${targetapp.dir}/classes"/>
  +             <mkdir  dir="${targetapp.dir}/WEB-INF/config"/>
  +             <mkdir  dir="${targetapp.dir}/WEB-INF/classes"/>
   
           <!-- Copy external dependencies as required -->
  -        <mkdir  dir="${targetapp.dir}/lib"/>
  -        <copy todir="${targetapp.dir}/lib" 
file="${commons-httpclient-3.0-rc3.jar}"/>
  -        <copy todir="${targetapp.dir}/lib" 
file="${commons-digester-1.7.jar}"/>
  -        <copy todir="${targetapp.dir}/lib" file="${commons-beanutils.jar}"/>
  -        <copy todir="${targetapp.dir}/lib" file="${commons-codec-1.3.jar}"/>
  -     <copy todir="${targetapp.dir}/lib" file="${commons-logging-1.0.4.jar}"/>
  -     <copy todir="${targetapp.dir}/lib" file="${log4j-1.2.8.jar}"/>
  -     <copy todir="${targetapp.dir}/lib" file="${fastmd5-2.6.jar}"/>
  -
  -     <copy todir="${targetapp.dir}/lib" file="${htmllexer.jar}"/>
  -     <copy todir="${targetapp.dir}/lib" file="${htmlparser.jar}"/>
  -     <copy todir="${targetapp.dir}/lib" file="${thumbelina.jar}"/>
  -     <copy todir="${targetapp.dir}/lib" file="${filterbuilder.jar}"/>
  -
  -     <copy todir="${targetapp.dir}/lib" file="${cactus-1.7.jar}"/>
  -     <copy todir="${targetapp.dir}/lib" file="${xercesImpl.jar}"/>
  -     <copy todir="${targetapp.dir}/lib" file="${aspectjrt-1.2.1.jar}"/>
  -     <copy todir="${targetapp.dir}/lib" file="${regexp-1.2.jar}"/>
  +        <mkdir  dir="${targetapp.dir}/WEB-INF/lib"/>
  +        <copy todir="${targetapp.dir}/WEB-INF/lib" 
file="${commons-httpclient-3.0-rc3.jar}"/>
  +        <copy todir="${targetapp.dir}/WEB-INF/lib" 
file="${commons-digester-1.7.jar}"/>
  +        <copy todir="${targetapp.dir}/WEB-INF/lib" 
file="${commons-beanutils.jar}"/>
  +        <copy todir="${targetapp.dir}/WEB-INF/lib" 
file="${commons-codec-1.3.jar}"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" 
file="${commons-logging-1.0.4.jar}"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" file="${log4j-1.2.8.jar}"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" file="${fastmd5-2.6.jar}"/>
  +
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" file="${htmllexer.jar}"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" file="${htmlparser.jar}"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" file="${thumbelina.jar}"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" file="${filterbuilder.jar}"/>
  +
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" file="${cactus-1.7.jar}"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" file="${xercesImpl.jar}"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" 
file="${aspectjrt-1.2.1.jar}"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/lib" file="${regexp-1.2.jar}"/>
  +
  +             <copy todir="${targetapp.dir}/WEB-INF/lib" 
file="${cactus-ant-1.7.jar}"/>
   
  -             <copy todir="${targetapp.dir}/lib" 
file="${cactus-ant-1.7.jar}"/>
  +             <copy todir="${targetapp.dir}/WEB-INF/lib" 
file="${itext-0.99.jar}"/>
  +             <copy todir="${targetapp.dir}/WEB-INF/lib" 
file="${displaytag-1.0.jar}"/>
   
        <!-- Copy config files -->
  -     <copy todir="${targetapp.dir}" file="${app.home}/web.xml"/>
  -     <copy todir="${targetapp.dir}" file="${app.home}/log4j.xml"/>
  -     <copy todir="${targetapp.dir}/config" 
file="${app.home}/config/data.xml"/>
  -     <copy todir="${targetapp.dir}/classes" 
file="${app.home}/classes/WCSinvalidation.dtd"/>
  +     <copy todir="${targetapp.dir}/WEB-INF" file="${app.home}/web.xml"/>
  +     <copy todir="${targetapp.dir}/WEB-INF" file="${app.home}/log4j.xml"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/config" 
file="${app.home}/config/data.xml"/>
  +     <copy todir="${targetapp.dir}/WEB-INF/classes" 
file="${app.home}/classes/WCSinvalidation.dtd"/>
  +     <copy todir="${targetapp.dir}/WEB-INF" 
file="${app.home}/displaytag-11.tld"/>
  +
  +             <!-- Copy JSP admin files -->
  +     <mkdir  dir="${targetapp.dir}/esiadmin"/>
  +     <copy todir="${targetapp.dir}/esiadmin">
  +       <fileset dir="${basedir}/esiadmin" />
  +             </copy>
  +
  +             <property name="build.home"             
value="${basedir}/build"/>
   
                <!-- Define the Cactus tasks -->
           <taskdef resource="cactus.tasks" classpathref="compile.classpath" />
  
  
  
  Index: ProxyFilter.java
  ===================================================================
  RCS file: /home/cvs/repository/esi_server/src/net/sf/j2ep/ProxyFilter.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ProxyFilter.java  28 Nov 2005 17:18:54 -0000      1.12
  +++ ProxyFilter.java  5 Dec 2005 16:49:00 -0000       1.13
  @@ -40,6 +40,8 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.jahia.esi.Utils;
  +import org.jahia.esi.exceptions.EsiServerException;
  +import org.jahia.esi.admin.GetContent;
   import org.jahia.esi.settings.GeneralSettings;
   import org.jahia.esi.invalidation.services.Invalidator;
   
  @@ -101,8 +103,21 @@
               server = serverChain.evaluate(clientHttpRequest);
           }
   
  -        if (server == null) {
  -            filterChain.doFilter(request, response);
  +        if (server == null
  +           || origRequestUrl.getPath().indexOf("/esiadmin/")!=-1) //ignore 
anything targeted at ESI webcache adminstration Menu 
  +        {
  +            //special case for admin Menu cache retrieval requests
  +            if 
(origRequestUrl.getPath().indexOf("/esiadmin/getContent")!=-1)  {
  +                GetContent getContent = new GetContent(clientHttpResponse, 
clientHttpRequest);
  +                try {
  +                    getContent.process();
  +                } catch (EsiServerException exc) {
  +                     throw new ServletException(exc);
  +                }
  +            }
  +            else
  +                filterChain.doFilter(request, response);
  +
           }
           else {
               String uri = server.getRule().process(getURI(clientHttpRequest));
  
  
  
  Index: Utils.java
  ===================================================================
  RCS file: /home/cvs/repository/esi_server/src/org/jahia/esi/Utils.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Utils.java        2 Dec 2005 10:47:05 -0000       1.12
  +++ Utils.java        5 Dec 2005 16:49:00 -0000       1.13
  @@ -13,8 +13,6 @@
   import java.util.ArrayList;
   import java.util.Enumeration;
   
  -import net.sf.j2ep.responsehandlers.ResponseHandlerBase;
  -
   /**
    * Created by IntelliJ IDEA.
    * User: jahia
  @@ -26,7 +24,8 @@
   
       private static final transient Log log = LogFactory.getLog(Utils.class);
   
  -
  +    public static String jahiaEsiServerBuildNumber = "0.1";
  +    
       public static GetMethod copyMethod ( HttpMethod method)  {
           try {
               //TODO: expand to other methods than GetMethod
  @@ -270,7 +269,9 @@
           return 0;
       }
   
  -    public static String jahiaEsiServerBuildNumber = "0.1";
  +    public static String getJahiaEsiServerBuildNumber() {
  +      return jahiaEsiServerBuildNumber;
  +    }
   
       public static void startupWithTrust(  )
       {
  @@ -279,19 +280,7 @@
   
           StringBuffer msg = new StringBuffer ("\n\n\n\n");
           msg.append ("\n");
  -        msg.append ("         __       .__    .__                            
  .__      \n");
  -        msg.append ("        |__|____  |  |__ |__|____      ____ _____    
____ |  |__   ____\n");
  -        msg.append ("        |  \\__  \\ |  |  \\|  \\__  \\   _/ ___\\\\__  
\\ _/ ___\\|  |  \\_/ __ \\  \n");
  -        msg.append ("        |  |/ __ \\|   Y  \\  |/ __ \\_ \\  \\___ / __ 
\\\\  \\___|   Y  \\  ___/   \n");
  -        msg.append ("    /\\__|  (____  /___|  /__(____  /  \\___  >____  
/\\___  >___|  /\\___  >      \n");
  -        msg.append ("    \\______|    \\/     \\/        \\/       \\/     
\\/     \\/     \\/     \\/   \n");
  -        msg.append ("\n");
  -        msg.append ("                     ______ ______________  __ 
___________   \n");
  -        msg.append ("                    /  ___// __ \\_  __ \\  \\/ // __ 
\\_  __ \\   \n");
  -        msg.append ("                    \\___ \\\\  ___/|  | \\/\\   /\\  
___/|  | \\/  \n");
  -        msg.append ("                   /____  >\\___  >__|    \\_/  \\___  
>__|     \n");
  -        msg.append ("                        \\/     \\/                 \\/ 
       \n");
  -        msg.append ("\n");
  +        msg.append (getJahiaWebCacheLogo());
           msg.append ("      . . . s t a r t i n g   j a h i a   W e b c a c h 
e   b u i l d   " + jahiaEsiServerBuildNumber + " . . .\n");
           msg.append ("\n\n");
           msg.append ("   Copyright 2002-2005 - jahia http://www.jahia.org - 
all rights reserved\n");
  @@ -322,19 +311,9 @@
           page.append("</head>\n" );
           page.append("\n" );
           page.append("<body bgcolor=\"white\">\n" );
  -        page.append ("<pre>     __       .__    .__                          
    .__      \n");
  -        page.append ("    |__|____  |  |__ |__|____      ____ _____    ____ 
|  |__   ____\n");
  -        page.append ("    |  \\__  \\ |  |  \\|  \\__  \\   _/ ___\\\\__  \\ 
_/ ___\\|  |  \\_/ __ \\  \n");
  -        page.append ("    |  |/ __ \\|   Y  \\  |/ __ \\_ \\  \\___ / __ 
\\\\  \\___|   Y  \\  ___/   \n");
  -        page.append ("/\\__|  (____  /___|  /__(____  /  \\___  >____  
/\\___  >___|  /\\___  >      \n");
  -        page.append ("\\______|    \\/     \\/        \\/       \\/     \\/  
   \\/     \\/     \\/   \n");
  -        page.append ("\n");
  -        page.append ("                 ______ ______________  __ ___________ 
  \n");
  -        page.append ("                /  ___// __ \\_  __ \\  \\/ // __ \\_  
__ \\   \n");
  -        page.append ("                \\___ \\\\  ___/|  | \\/\\   /\\  
___/|  | \\/  \n");
  -        page.append ("               /____  >\\___  >__|    \\_/  \\___  
>__|     \n");
  -        page.append ("                    \\/     \\/                 \\/    
    </pre>\n");
  -        page.append ("\n");
  +        page.append ("<pre> \n" );
  +        page.append (getJahiaWebCacheLogo());
  +        page.append ("</pre>\n");
           page.append("<fieldset style='border-width: 7px; border-color: red; 
border: inset'> <font color=\"red\">\n" );
           page.append("<h1>Error due to Response from Application Web 
Server</h1>\n" );
           page.append("<p>No Response from Application Web Server</p>\n" );
  @@ -350,6 +329,26 @@
           return page.toString();
       }
   
  +    public static String getJahiaWebCacheLogo() {
  +        StringBuffer logo         = new StringBuffer();
  +        logo.append ("\n");
  +        logo.append ("     __       .__    .__                              
.__      \n");
  +        logo.append ("    |__|____  |  |__ |__|____      ____ _____    ____ 
|  |__   ____\n");
  +        logo.append ("    |  \\__  \\ |  |  \\|  \\__  \\   _/ ___\\\\__  \\ 
_/ ___\\|  |  \\_/ __ \\  \n");
  +        logo.append ("    |  |/ __ \\|   Y  \\  |/ __ \\_ \\  \\___ / __ 
\\\\  \\___|   Y  \\  ___/   \n");
  +        logo.append ("/\\__|  (____  /___|  /__(____  /  \\___  >____  
/\\___  >___|  /\\___  >      \n");
  +        logo.append ("\\______|    \\/     \\/        \\/       \\/     \\/  
   \\/     \\/     \\/   \n");
  +        logo.append ("\n");
  +        logo.append ("                 ______ ______________  __ ___________ 
  \n");
  +        logo.append ("                /  ___// __ \\_  __ \\  \\/ // __ \\_  
__ \\   \n");
  +        logo.append ("                \\___ \\\\  ___/|  | \\/\\   /\\  
___/|  | \\/  \n");
  +        logo.append ("               /____  >\\___  >__|    \\_/  \\___  
>__|     \n");
  +        logo.append ("                    \\/     \\/                 \\/    
    \n");
  +        logo.append ("\n");
  +        return logo.toString();
  +    }
  +
  +
       public static void printRequestHeaders(HttpServletRequest clientRequest) 
{
           printRequestHeaders( clientRequest, null);
       }
  
  
  
  Index: ContentCacheObject.java
  ===================================================================
  RCS file: 
/home/cvs/repository/esi_server/src/org/jahia/esi/cache/ContentCacheObject.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContentCacheObject.java   24 Nov 2005 16:57:44 -0000      1.2
  +++ ContentCacheObject.java   5 Dec 2005 16:49:01 -0000       1.3
  @@ -16,10 +16,12 @@
       int updateCount = 0;
       int readCount = 0;
       int hitCount = 0;
  +    String contentType;
   
  -    public ContentCacheObject(byte[] content) {
  +    public ContentCacheObject(byte[] content, String contentType) {
           this.content = content;
           this.creationDate = new Date();
  +        this.contentType = contentType;
       }
   
       public byte[] getByteContent() {
  @@ -30,6 +32,14 @@
           this.content = content;
       }
   
  +    public String getContentType() {
  +        return contentType;
  +    }
  +
  +    public void setContentType(String contentType) {
  +        this.contentType = contentType;
  +    }
  +
       public Date getCreationDate() {
           return creationDate;
       }
  
  
  
  Index: FragmentCache.java
  ===================================================================
  RCS file: 
/home/cvs/repository/esi_server/src/org/jahia/esi/cache/FragmentCache.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FragmentCache.java        24 Nov 2005 17:25:16 -0000      1.8
  +++ FragmentCache.java        5 Dec 2005 16:49:01 -0000       1.9
  @@ -7,6 +7,7 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.commons.httpclient.HttpMethod;
  +import org.apache.commons.httpclient.Header;
   import org.apache.commons.codec.binary.Base64;
   import org.jahia.esi.cache.CacheObject;
   import org.jahia.esi.cache.ContentCacheObject;
  @@ -38,7 +39,7 @@
       //is referenced by entries in hashCache. If it's 0, then the entry in 
contentCache can removed safely
       //private HashMap countCache = new HashMap();
   
  -    static Base64 base64 = null;
  +    public static Base64 base64 = null;
   
   
       /**
  @@ -124,7 +125,7 @@
   
           //add associated it to a contentCache entry
           if (!contentCache.containsKey(byteContentHash)) {
  -            ContentCacheObject newContentObj = new 
ContentCacheObject(errorMsg.getBytes());
  +            ContentCacheObject newContentObj = new 
ContentCacheObject(errorMsg.getBytes(), "text/html");
               contentCache.put(byteContentHash, newContentObj);
               EsiStats.getInstance().contentCacheMiss();
               if (log.isDebugEnabled()) log.debug("Content Cache Miss: 
recieved content ["+byteContentHash +"] was not in cache (for request urlKey 
["+urlKey +"])");
  @@ -190,7 +191,7 @@
   
           //add associated it to a contentCache entry
           if (!contentCache.containsKey(byteContentHash)) {
  -            ContentCacheObject newContentObj = new 
ContentCacheObject(byteContent);
  +            ContentCacheObject newContentObj = new 
ContentCacheObject(byteContent, getContentType(method));
               contentCache.put(byteContentHash, newContentObj);
               EsiStats.getInstance().contentCacheMiss();
               if (log.isDebugEnabled()) log.debug("Content Cache Miss: 
recieved content ["+byteContentHash +"] was not in cache (for request urlKey 
["+urlKey +"])");
  @@ -203,6 +204,7 @@
               if (log.isDebugEnabled()) log.debug("Content Cache Hit: recieved 
content ["+byteContentHash +"] already in cache (for request urlKey ["+urlKey 
+"])");
           }
       }
  +
       public boolean contains(String urlKey ) {
   
           UrlCacheObject urlObj = (UrlCacheObject) hashCache.get(urlKey);
  @@ -348,6 +350,15 @@
           return null;
       }
   
  +    private String getContentType(HttpMethod method) {
  +        String contentType=null;
  +        Header header = method.getResponseHeader("Content-Type");
  +        if (header != null) {
  +            contentType = header.getValue();
  +        }
  +        return contentType;
  +    }
  +
   
   
   
  
  
  
  Index: UrlCacheObject.java
  ===================================================================
  RCS file: 
/home/cvs/repository/esi_server/src/org/jahia/esi/cache/UrlCacheObject.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- UrlCacheObject.java       24 Nov 2005 17:25:16 -0000      1.4
  +++ UrlCacheObject.java       5 Dec 2005 16:49:01 -0000       1.5
  @@ -2,6 +2,8 @@
   
   import org.apache.commons.httpclient.HttpMethod;
   import org.apache.commons.httpclient.Header;
  +import org.apache.commons.httpclient.methods.GetMethod;
  +import org.apache.commons.httpclient.methods.PostMethod;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.jahia.esi.Utils;
  @@ -30,7 +32,7 @@
       protected  int hitCount = 0;
       protected  int readCount = 0;
       protected HttpMethod method;
  -    protected String Url;
  +    protected String url;
       //TODO: convert all these to vectors!!!
       protected String[] referencedObjs; //referenced object
       protected int[] referencedObjsStartIndex; //start offset position of 
referenced object in current object
  @@ -52,7 +54,7 @@
                             long maxRemovalDelayInSecs) {
   
           this.referencedObjsUrls = referencedObjsUrls;
  -        this.Url = Url;
  +        this.url = Url;
           this.contentHash = contentHash;
           this.method = method;
           this.referencedObjs = referencedObjs;
  @@ -93,11 +95,11 @@
               for (int p=0; p < cks.length; p++) {
                   if 
(cks[p].getName().equalsIgnoreCase(GeneralSettings.getInstance().getUserCookieName())
 )  {  //put settings value in a static string?
                       usernameCookie = cks[p].getValue();
  -                    if (log.isDebugEnabled()) log.debug("Detected Username 
cookie ["+usernameCookie+"] for "+Url);
  +                    if (log.isDebugEnabled()) log.debug("Detected Username 
cookie ["+usernameCookie+"] for "+url);
                   }
   
                   cookies.addElement(cks[p]);
  -                //if (log.isDebugEnabled()) log.debug("Detected cookie 
["+cks[p].getName()+":"+cks[p].getValue()+"] for "+Url);
  +                //if (log.isDebugEnabled()) log.debug("Detected cookie 
["+cks[p].getName()+":"+cks[p].getValue()+"] for "+url);
   
               }
           }
  @@ -151,11 +153,11 @@
   
   
       public String getUrl() {
  -        return Url;
  +        return url;
       }
   
       public void setUrl(String url) {
  -        Url = url;
  +        this.url = url;
       }
   
       public int getReferenceCount() {
  @@ -212,6 +214,10 @@
           return method;
       }
   
  +    public String getMethodName() {
  +        return method.getName();
  +    }
  +
       public String getContentHash() {
           return contentHash;
       }
  @@ -265,7 +271,7 @@
                   ", hitCount=" + hitCount +
                   ", readCount=" + readCount +
                   ", method=" + method +
  -                ", Url='" + Url + "'" +
  +                ", Url='" + url + "'" +
                   ", referencedObjs=" + (referencedObjs == null ? null : 
Arrays.asList(referencedObjs)) +
                   ", referencedObjsStartIndex=" + referencedObjsStartIndex +
                   ", referencedObjsEndIndex=" + referencedObjsEndIndex +
  
  
  
  Index: EsiServerException.java
  ====================================================================
  package org.jahia.esi.exceptions;
  
  /**
   * Created by IntelliJ IDEA.
   * User: jahia
   * Date: 05-Dec-2005
   * Time: 15:05:32
   * To change this template use File | Settings | File Templates.
   */
  public class EsiServerException extends Exception {
  
  
      public EsiServerException( final String message )
      {
          super( message );
      }
  
      public EsiServerException( final String message, final Throwable cause )
      {
          super( message, cause );
      }
  
  }
  
  
  
  Index: DetailedServerException.java
  ===================================================================
  RCS file: 
/home/cvs/repository/esi_server/src/org/jahia/esi/exceptions/DetailedServerException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DetailedServerException.java      24 Nov 2005 14:28:33 -0000      1.1
  +++ DetailedServerException.java      5 Dec 2005 16:49:01 -0000       1.2
  @@ -9,7 +9,7 @@
    * To change this template use File | Settings | File Templates.
    */
   public class DetailedServerException
  -    extends Exception
  +    extends EsiServerException
   {
       //TODO: implement toString() method
       String errorPageUrlKey = null;
  
  
  
  Index: RedirectException.java
  ===================================================================
  RCS file: 
/home/cvs/repository/esi_server/src/org/jahia/esi/exceptions/RedirectException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RedirectException.java    22 Nov 2005 17:24:49 -0000      1.2
  +++ RedirectException.java    5 Dec 2005 16:49:01 -0000       1.3
  @@ -9,7 +9,7 @@
    * To change this template use File | Settings | File Templates.
    */
   public class RedirectException
  -        extends Exception
  +        extends EsiServerException
   {
       //TODO: implement toString() method
       int StatusCode;
  
  
  
  Index: TransferFailedException.java
  ===================================================================
  RCS file: 
/home/cvs/repository/esi_server/src/org/jahia/esi/exceptions/TransferFailedException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TransferFailedException.java      22 Nov 2005 17:24:49 -0000      1.2
  +++ TransferFailedException.java      5 Dec 2005 16:49:01 -0000       1.3
  @@ -8,7 +8,7 @@
    * To change this template use File | Settings | File Templates.
    */
   public class TransferFailedException
  -    extends Exception
  +    extends EsiServerException
   {
       //TODO: implement toString() method
       int statusCode = -2;
  
  
  
  Index: EsiStats.java
  ===================================================================
  RCS file: 
/home/cvs/repository/esi_server/src/org/jahia/esi/stats/EsiStats.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EsiStats.java     26 Oct 2005 13:45:23 -0000      1.1
  +++ EsiStats.java     5 Dec 2005 16:49:01 -0000       1.2
  @@ -43,6 +43,38 @@
       private long urlCacheHits = 0;
       private long urlCacheMisses = 0;
   
  +    public long getContentCacheHits() {
  +        return contentCacheHits;
  +    }
  +
  +    public void setContentCacheHits(long contentCacheHits) {
  +        this.contentCacheHits = contentCacheHits;
  +    }
  +
  +    public long getContentCacheMisses() {
  +        return contentCacheMisses;
  +    }
  +
  +    public void setContentCacheMisses(long contentCacheMisses) {
  +        this.contentCacheMisses = contentCacheMisses;
  +    }
  +
  +    public long getUrlCacheHits() {
  +        return urlCacheHits;
  +    }
  +
  +    public void setUrlCacheHits(long urlCacheHits) {
  +        this.urlCacheHits = urlCacheHits;
  +    }
  +
  +    public long getUrlCacheMisses() {
  +        return urlCacheMisses;
  +    }
  +
  +    public void setUrlCacheMisses(long urlCacheMisses) {
  +        this.urlCacheMisses = urlCacheMisses;
  +    }
  +
       public void contentCacheHit() {
            contentCacheHits++;
       }
  
  
  
  Index: src.iml
  ===================================================================
  RCS file: /home/cvs/repository/esi_server/src/src.iml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- src.iml   18 Nov 2005 16:29:46 -0000      1.3
  +++ src.iml   5 Dec 2005 16:49:02 -0000       1.4
  @@ -4,6 +4,8 @@
     <component name="NewModuleRootManager">
       <output url="file://$MODULE_DIR$/../dist/tmp/WEB-INF/classes" />
       <exclude-output />
  +    <content url="file://$MODULE_DIR$/../WEB-INF" />
  +    <content url="file://$MODULE_DIR$/../esiadmin" />
       <content url="file://$MODULE_DIR$">
         <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
       </content>
  @@ -234,20 +236,16 @@
       <orderEntry type="module-library">
         <library>
           <CLASSES>
  -          <root url="jar://$MODULE_DIR$/../WEB-INF/lib/dom4j-1.6.1.jar!/" />
  +          <root url="jar://$MODULE_DIR$/../WEB-INF/lib/regexp-1.2.jar!/" />
           </CLASSES>
  -        <JAVADOC>
  -          <root 
url="jar://$MODULE_DIR$/../../dom4j-1.6.1.zip!/dom4j-1.6.1/docs/apidocs" />
  -        </JAVADOC>
  -        <SOURCES>
  -          <root 
url="jar://$MODULE_DIR$/../../dom4j-1.6.1.zip!/dom4j-1.6.1/src" />
  -        </SOURCES>
  +        <JAVADOC />
  +        <SOURCES />
         </library>
       </orderEntry>
       <orderEntry type="module-library">
         <library>
           <CLASSES>
  -          <root url="jar://$MODULE_DIR$/../WEB-INF/lib/regexp-1.2.jar!/" />
  +          <root url="jar://$MODULE_DIR$/../WEB-INF/lib/displaytag-1.0.jar!/" 
/>
           </CLASSES>
           <JAVADOC />
           <SOURCES />
  
  
  
  Index: cachestatus.jsp
  ====================================================================
  
  <%@ include file="inc/header.jsp" %>
  
  
  <%
              CacheStatus cacheStatus = new CacheStatus();
              
this.getServletContext().setAttribute("urlCacheEntries",cacheStatus.getUrlCacheEntries());
  
  %>
  
  
  <br>
  <em>
  <h1>Current State of Cache</h1>
  </em>
  <br>
  <br>
  <br>
  
  <display:table name="applicationScope.urlCacheEntries"
                 defaultsort="1" export="true"
                 pagesize="30"
                 decorator="org.jahia.esi.admin.UrlCacheWrapper"
                 >
  <display:column property="url"
                  title="URL"
                  sortable="true"
                  headerClass="sortable"
                  autolink="true"/>
  
  <display:column property="contentUrl"
                  title="Content"
                  sortable="false"
                  autolink="true"/>
  
  
  <display:column property="updateCount"
                  title="Updates"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="referenceCount"
                  title="Reference Count"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="expirationDelayInSecs"
                  title="Expiration Delay In Secs"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="creationDate"
                  title="Creation Date"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="expirationDateInSecs"
                  title="Expiration Date In Secs"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="timeToLiveInSecs"
                  title="TimeToLive In Secs"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="readCount"
                  title="Read Count"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="hitCount"
                  title="Hit Count"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="methodName"
                  title="Method"
                  sortable="true"
                  headerClass="sortable"
                  />
  
  <display:setProperty name="export.pdf"
                       value="true"/>
  </display:table>
  <br>
  <br>
  <br>
  <a href="index.jsp">Back to Home</a>
  <br>
  <br>
  <%@ include file="inc/footer.jsp" %>
  
  
  
  
  
  
  Index: contentcachestatus.jsp
  ====================================================================
  <%@ page import="javax.servlet.*" %>
  <%@ page import="javax.servlet.http.*" %>
  <%@ page import="java.util.*" %>
  <%@ page import="org.jahia.*" %>
  <!--%@ page import="org.jahia.esi.admin.UrlCacheWrappererer" %-->
  <%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display" %>
  <%@ page import="org.displaytag.sample.*, 
java.util.*,org.displaytag.tags.TableTag"%>
  <%@ page import="org.jahia.esi.admin.CacheStatus"%>
  <%@ page import="org.jahia.esi.Utils"%>
  
  <%@ include file="inc/header.jsp" %>
  
  <%
              CacheStatus cacheStatus = new CacheStatus();
              
this.getServletContext().setAttribute("urlCacheEntries",cacheStatus.getUrlCacheEntries());
  
  %>
  
  
  <br>
  <!-- decorator="org.jahia.esi.admin.UrlCacheWrappererer"> -->
  
  <h1>Current State of Cache</h1>
  <br>
  <br>
  <br>
  <display:table name="applicationScope.urlCacheEntries"
                 defaultsort="1" export="true"
                 pagesize="30"
                 >
  <display:column property="url"
                  title="URL"
                  sortable="true"
                  headerClass="sortable"
                  autolink="true"/>
  
  <display:column property="methodName"
                  title="Method"
                  group="1"
                  sortable="true"
                  headerClass="sortable"
                  />
  <display:column property="creationDate"
                  title="Creation Date"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="updateCount"
                  title="Updates"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="referenceCount"
                  title="Reference Count"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="expirationDelayInSecs"
                  title="expirationDelayInSecs"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="expirationDateInSecs"
                  title="expirationDateInSecs"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="readCount"
                  title="readCount"
                  sortable="true"
                  headerClass="sortable" />
  
  <display:column property="contentUrl"
                  title="Content"
                  sortable="false"
                  autolink="true"/>
  
  <display:setProperty name="export.pdf"
                       value="true"/>
  </display:table>
  <br>
  <%@ include file="inc/footer.jsp" %>
  
  
  
  
  
  Index: index.jsp
  ====================================================================
  
  <%@ include file="inc/header.jsp" %>
  
  
  <br>
  <br>
  <br>
  <em>
  <h1>ESI Server Admin Page</h1>
  </em>
  <br>
  <br>
  <br>
  <h2>General Cache Stats</h2>
  <br>
  <br>
  <%
  
      EsiStats stats = EsiStats.getInstance();
  
      long totalUrlCacheAccesses =  stats.getUrlCacheHits() + 
stats.getUrlCacheMisses();
      long totalContentCacheAccesses =  stats.getContentCacheHits() + 
stats.getContentCacheMisses();
      %>
  
      <br>Number of total url Cache Accesses: <%=totalUrlCacheAccesses%>
      <br>Number of total url Cache Hits: <%=stats.getUrlCacheHits()%> or 
<%=100.0*(float)stats.getUrlCacheHits()/(float)totalUrlCacheAccesses%>%
      <br>Number of total url Cache Misses: <%=stats.getUrlCacheMisses()%> or 
<%=100.0*(float)stats.getUrlCacheMisses()/(float)totalUrlCacheAccesses%>%
      <br>
      <br>
      <br>Number of total Content Cache Accesses: <%=totalContentCacheAccesses%>
      <br>Number of total Content Cache Hits: <%=stats.getContentCacheHits()%> 
or 
<%=100.0*(float)stats.getContentCacheHits()/(float)totalContentCacheAccesses%>%
      <br>Number of total Content Cache Hits: 
<%=stats.getContentCacheMisses()%> or 
<%=100.0*(float)stats.getContentCacheMisses()/(float)totalContentCacheAccesses%>%
  <br>
  <br>
  <br>
  <br>
  <h2>View Cache</h2>
  <br>
  <br>
  <br>
  <a href="cachestatus.jsp">Current State of Cache</a>
  <br>
  <br>
  <br>
  <br>
  <h2>Cache Settings</h2>
  <br>
  <br>
  <%=GeneralSettings.getInstance().toString()%>
  <br>
  <br>
  <br>
  <br>
  <br>
  <%@ include file="inc/footer.jsp" %>
  
  
  Index: screen.css
  ====================================================================
  body{ 
        background-color: #fff; padding:0 0 0 0; margin:0 0 0 0;
  }
  body, input, select, td, textarea{ 
        font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; 
        font-size: 11px;
  }
  h1, h2, h3, h4, h5, h6, p, strong, div, form, acronym, label, table, td, th, 
span, a, hr, code, pre, hr {
        margin:0;
        padding:0;
        font-size: 1em;
        background-repeat:no-repeat;
        list-style-type:none;
  }
  a, a:visited, a:hover { 
        color:#666; text-decoration:none; 
  }
  a:hover {
        text-decoration: underline;
  }
  img{ 
        border:none;
  }
  hr {
        height: 1px;
        color: #000;
        clear:both;
  }
  textarea {
        width:80%;
        height:200px;
  }
  dt {
        font-weight: bold;
  }
  .clear {
        clear: both;
  }
  h1 {
        font-size: 2em;
  }
  h1 a{
        color: #000;
  }
  div#header {
        background-color: #fea;
        border-top: 1px solid #000;
        border-bottom: 1px solid #000;
        padding: 20px 10px 30px 15px;
        margin: 10px 5% 20px 5%;
  }
  div#header ul{
        margin: 10px 0 0 0;
  }
  div#header ul li{
        list-style-type: none;
        float: left;
        padding: 0 10px 0 0;
        font-weight: bold;
  }
  div#header ul li a{
        display: block;
        color: #f00;
        border-left: 1px solid red;
        padding-left: 5px;
  }
  div#header ul li a:hover{
        border-left: 1px solid #000;
  }
  
  h2 {
        font-size: 1.2em;
        margin: 10px 0 10px 0;
  }
  
  h2 {
        font-size: 1.1em;
        margin: 10px 0 5px 0;
  }
  
  p {
        margin: 0 0 10px 0;
  }
  
  acronym {
        border-bottom: 1px dashed #000;
        cursor: help;
  }
  
  div#body {
        margin: 0 5% 20px 5%;
        padding: 20px 20px 20px 20px;
        border: 1px dashed #666;
  }
  
  div#validxhtml {
        float: right;
        background-color: #eee;
        border: 1px dotted #999;
        padding: 2px;
        margin: 5px;
        width:100px;
        text-align: center;
  }
  div#footer {
        border-top: 1px solid #666;
        padding: 5px 5px 5px 5px;
        text-align:right;
  }
  
  div#footer span {
        float: left;
  }
  
  /*.changed {
        background-color: #ee0;
        border: 1px solid #ccc;
        padding: 10px;
        margin: 10px;
  }*/
  ul#stylelist {
        margin:0 0 30px 0;
  }
  
  ul#stylelist li {
        list-style-type: none;
        float:left;
        width:100px;
        border: 1px solid #ccc;
        background-color: #eee;
        padding:2px;
        margin-right: 2px;
  }
  table {
        border: 1px solid #666;
  
        width: 80%;
        margin: 20px 0 20px 0;
  }
  th, td {
        padding: 2px 4px 2px 4px;
        text-align: left;
        vertical-align: top;
  }
  thead tr {
    background-color: #fc0;
  }
  th.sorted {
      background-color: orange;
  }
  th a, th a:visited {
    color: black;
  }
  th a:hover {
    text-decoration: underline;
    color: black;
  }
  th.sorted a, th.sortable a {
        background-position: right;
        display: block;
        width: 100%;
  }
  th.sortable a {
        background-image: url(../img/arrow_off.png);
  }
  th.order1 a {
        background-image: url(../img/arrow_down.png);
  }
  th.order2 a {
        background-image: url(../img/arrow_up.png);
  }
  tr.odd {
    background-color: #fff
  }
  tr.tableRowEven, tr.even {
    background-color: #fea
  }
  
  ul#showsource {
        float: right;
        background-color: #eee;
        border: 1px dotted #999;
        padding: 2px 4px 2px 4px;
        margin: 5px;
        width:100px;
        list-style-type: none;
  }
  
  
  /* test styles */
  table.its thead tr {
    background-color: #69c;
  }
  table.its tr.even {
    background-color: #def;
  }
  
  table.mars thead tr {
    background-color: #9c9;
  }
  table.mars tr.even {
    background-color: #ccb;
  }
  table.mars tr.odd {
    background-color: #eec;
  }
  
  
  table.simple thead tr {
    background-color: #eee;
  }
  table.simple tr.even {
    background-color: #fff;
  }
  table.simple {
        border: 1px solid #ccc;
        border-collapse: collapse;
  }
  table.simple td,table.simple th{
        border: 1px solid #ccc;
  }
  
  table.nocol tbody td,table.nocol tbody th{
        border-left: none;
        border-right: none;
  }
  
  
  
  
  table.report td, table.report th{
        font:         menu;
  }
  table.report th{
        background:   buttonface;
        border-width: 1px;
        border-style: solid;
        border-color: threedhighlight threedshadow threedshadow threedhighlight;
        cursor:       hand;
  }
  table.report idcol {
        background: buttonface;
  }
  
  table.report tr.even{
        background-color: #399;
  }
  table.report tbody {
        height: 100px;
        overflow: auto;
  }
  
  table.report {
        height: 120px;
        overflow: auto;
  }
  
  table.report tbody tr{
        height: 10px;
  }
  
  
  
  
  
  table.mark td.tableCellError {
        background-color: #d00;
        color: #fff;
  }
  
  table.sublist {
        margin: 0 0 0 0;
        width: 100%;
  }
  table.sublist td, table.sublist th {
        width: 50%;
  }
  
  div.exportlinks {
        background-color: #eee;
        border: 1px dotted #999;
        padding: 2px 4px 2px 4px;
        margin: -10px 0 10px 0;
        width: 79%;
  }
  
  span.export {
        padding: 0 4px 1px 20px;
        display:inline; display:inline-block;
        cursor: pointer;
  }
  
  span.excel {
        background-image: url(../img/ico_file_excel.png);
  }
  span.csv {
        background-image: url(../img/ico_file_csv.png);
  }
  span.xml {
        background-image: url(../img/ico_file_xml.png);
  }
  span.pdf {
        background-image: url(../img/ico_file_pdf.png);
  }
  
  span.pagebanner {
        background-color: #eee;
        border: 1px dotted #999;
        padding: 2px 4px 2px 4px;
        width: 79%;
        margin-top: 10px;
        display:block;
        border-bottom: none;
  }
  
  span.pagelinks {
        background-color: #eee;
        border: 1px dotted #999;
        padding: 2px 4px 2px 4px;
        width: 79%;
        display:block;
        border-top: none;
        margin-bottom: -5px;
  }
  
  table.simple td.textRed {color: #b11;}
  
  
  
  Index: arrow_down.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: arrow_off.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: arrow_up.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: ico_file_csv.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: ico_file_excel.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: ico_file_pdf.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: ico_file_xml.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: paginazione.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: paginazione_ahead.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: paginazione_back.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: valid-xhtml10.png
  ===================================================================
        <<Binary file>>
  
  
  
  Index: footer.jsp
  ====================================================================
  <div id="footer">
  
      <em>
          Please send any questions or suggestions to
          <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
      <p><h4>Jahia ESI WebCache Server - version 
<%=Utils.jahiaEsiServerBuildNumber%></h4></p>
        </em>
  
  </div>
  
  </body>
  </html>
  
  
  Index: header.jsp
  ====================================================================
  <%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display" %>
  <%@ page import="javax.servlet.*" %>
  <%@ page import="javax.servlet.http.*" %>
  <%@ page import="java.util.*" %>
  <%@ page import="org.jahia.*" %>
  <%@ page import="org.jahia.esi.admin.UrlCacheWrapper" %>
  <%@ page import="org.displaytag.sample.*, 
java.util.*,org.displaytag.tags.TableTag"%>
  <%@ page import="org.jahia.esi.admin.CacheStatus"%>
  <%@ page import="org.jahia.esi.Utils"%>
  <%@ page import="org.jahia.esi.stats.EsiStats"%>
  <%@ page import="org.jahia.esi.settings.GeneralSettings"%>
  
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
  
  <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
  <head>
      <title>Jahia ESI WebCache Status</title>
      <meta http-equiv="Expires" content="-1" />
      <meta http-equiv="Pragma" content="no-cache" />
      <meta http-equiv="Cache-Control" content="no-cache" />
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
      <link rel="stylesheet" href="css/screen.css" type="text/css" 
media="screen, print" />
  </head>
  <body>
  
  <center><pre>
  
  __       .__    .__                              .__
          |__|____  |  |__ |__|____      ____ _____    ____ |  |__   ____
          |  \__  \ |  |  \|  \__  \   _/ ___\\__  \ _/ ___\|  |  \_/ __ \
          |  |/ __ \|   Y  \  |/ __ \_ \  \___ / __ \\  \___|   Y  \  ___/
      /\__|  (____  /___|  /__(____  /  \___  >____  /\___  >___|  /\___  >
      \______|    \/     \/        \/       \/     \/     \/     \/     \/
  
                       ______ ______________  __ ___________
                      /  ___// __ \_  __ \  \/ // __ \_  __ \
                      \___ \\  ___/|  | \/\   /\  ___/|  | \/
                     /____  >\___  >__|    \_/  \___  >__|
                          \/     \/                 \/
  </pre></center>
  <br>
  <br>
  
  
  
  
  Index: CacheStatus.java
  ====================================================================
  package org.jahia.esi.admin;
  
  import org.jahia.esi.cache.FragmentCache;
  import org.jahia.esi.cache.UrlCacheObject;
  import org.jahia.esi.cache.ContentCacheObject;
  
  import java.util.List;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.Iterator;
  
  /**
   * Created by IntelliJ IDEA.
   * User: jahia
   * Date: 02-Dec-2005
   * Time: 16:18:08
   * To change this template use File | Settings | File Templates.
   */
  public class CacheStatus {
  
      private static org.apache.log4j.Logger log =
              org.apache.log4j.Logger.getLogger(CacheStatus.class);
  
      private FragmentCache fragmentCache;
  
      public CacheStatus() {
          fragmentCache = FragmentCache.getInstance();
      }
  
      public List getUrlCacheEntries() {
          List entries = new ArrayList();
  
          HashMap urlCache = fragmentCache.getUrlCache();
          Iterator iter = urlCache.keySet().iterator();
  
          int total = urlCache.size();
  
          log.info("Total Number of Url Cache Objects: "+total);
  
          int pos = 1;
          while (iter.hasNext())  {
              String urlKey = (String) iter.next();
              UrlCacheObject urlObj = (UrlCacheObject) urlCache.get(urlKey);
              entries.add(urlObj);
          }
  
          return entries;
      }
  
  
      public List getContentCacheEntries() {
          List entries = new ArrayList();
  
          HashMap contentCache = fragmentCache.getContentCache();
          Iterator iter = contentCache.keySet().iterator();
  
          int total = contentCache.size();
  
          log.info("Total Number of Content Cache Objects: "+total);
  
          int pos = 1;
          while (iter.hasNext())  {
              String urlKey = (String) iter.next();
              ContentCacheObject urlObj = (ContentCacheObject) 
contentCache.get(urlKey);
              entries.add(urlObj);
          }
  
          return entries;
      }
  
      public int getContentCacheSize() {
          return fragmentCache.getContentCache().size();
      }
  
      public int getUrlCacheSize() {
          return fragmentCache.getUrlCache().size();
      }
  
  }
  

Reply via email to