



      <?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://java.sun.com/JSP/Page" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/JSP/Page jspxml.xsd"><directive.include file="header.jsp"/><directive.include file="doInitPage.jsp"/><directive.page import="com.schneider_electric.ebase.jspdoc.split.*"/><scriptlet> 
/*
    This programm is part of JspDoc package 

    com.schneider_electric.ebase.jspdoc    

    Copyright (C) 2001  Gilbert Brault
    Copyright (C) 2001  Schneider Electric
    Copyright (C) 2001  Schneider Electric eB@SE (ebusiness at Schneider-Electric)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2.1 of the License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    contact information:
    Gilbert Brault
    Schneider-Electric
    knexsis project
    245, rtes des lucioles
    bp 147 
    F-06903 Sophia-Antipolis Cedex
    gilbert.brault@modicon.com
*/
/**
&lt;doc&gt;
&lt;name&gt;directory2.jsp&lt;/name&gt;
&lt;category&gt;JspDoc&lt;/category&gt;
&lt;summary&gt;List all jsp files with category and summary&lt;/summary&gt;
&lt;history&gt;&lt;date&gt;10/08/01 us&lt;/date&gt; Gilbert Brault 
&lt;action&gt; creation&lt;/action&gt;
&lt;/history&gt;
&lt;history&gt;&lt;date&gt;10/25/01 us&lt;/date&gt; Gilbert Brault 
&lt;action&gt; adapted pharos:foreach switch itCounter to Integer (was int before)&lt;/action&gt;
&lt;/history&gt;
&lt;outline&gt;
&lt;ul&gt;
&lt;li&gt;if refresh set or new session, list all jsp files of the server and parse them&lt;/li&gt;
&lt;li&gt;List files according to the following criteria
&lt;ul&gt;
&lt;li&gt;creation order (item #) column&lt;/li&gt;
&lt;li&gt;file name (no case sensitive)&lt;/li&gt;
&lt;li&gt;category of processing&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/outline&gt;
&lt;todo&gt;
&lt;ul&gt;
&lt;li&gt;display modification date and allow ordering by dates&lt;/li&gt;
&lt;/ul&gt;
&lt;/todo&gt;
&lt;copyright&gt;Schneider-Electric 2001&lt;/copyright&gt;
&lt;/doc&gt;
*/ 

</scriptlet><scriptlet>
   /* Open a jsp file and tries some jspdoc stuff */
   ServletContext servletContext = pageContext.getServletContext();

   </scriptlet><text>&lt;link rel=&apos;stylesheet&apos; href=&apos;channel.css&apos;&gt;
   </text><text>&lt;table border=&apos;0&apos; width=&apos;98%&apos;&gt;
   </text><text>&lt;tr&gt;
   </text><text>&lt;td&gt;
      </text><text>&lt;H1&gt;</text><text>JSP Directory summary</text><text>&lt;/H1&gt;
   </text><text>&lt;/td&gt;
   </text><text>&lt;td&gt;</text><text>&lt;/td&gt;</text><text>&lt;td&gt;</text><text>&lt;/td&gt;
   </text><text>&lt;/tr&gt;
   </text><text>&lt;tr&gt;
   </text><text>&lt;td&gt;</text><expression> servletContext.getRealPath(&quot;/&quot;) </expression><text/><text>&lt;/td&gt;
   </text><text>&lt;td&gt;</text><text>&lt;a href=&quot;directoryjsp2.jsp?refresh=true&quot;&gt;</text><text>refresh</text><text>&lt;/a&gt;</text><text>&lt;/td&gt;</text><text>&lt;td&gt;</text><text>&lt;/td&gt;
   </text><text>&lt;/tr&gt;
   </text><text>&lt;/table&gt;
</text><scriptlet>
   ArrayList jspDirectory;
   ServletContext context = getServletContext();
   PharosDir pharosDir = (PharosDir)context.getAttribute(&quot;pharosDir&quot;);
   if ( (pharosDir == null) || (request.getParameter(&quot;refresh&quot;)!=null) ){
     pharosDir = new PharosDir();
     pharosDir.load(servletContext.getRealPath(&quot;/&quot;));
     context.setAttribute(&quot;pharosDir&quot;,pharosDir);
   }
   PharosDoc pharosDoc = new PharosDoc();
   jspDirectory = pharosDir.getJspDirectory();
   String sort = request.getParameter(&quot;sort&quot;);
   if (sort==null) sort =&quot;&quot;;
   int cas = 0;
   TreeSet itListByName=null;
   TreeSet itListByCategory = null;
   if (sort.toLowerCase().equals(&quot;Name&quot;.toLowerCase()))
      { cas=1;
        itListByName = pharosDir.orderedByName();
      }
   if (sort.toLowerCase().equals(&quot;Category&quot;.toLowerCase()))
      { cas=2;
        itListByCategory = pharosDir.orderedByCategory();
      }
   Collection itJspEntryList= (Collection)jspDirectory;
   if (cas==1) itJspEntryList= (Collection)itListByName;
   if (cas==2) itJspEntryList= (Collection)itListByCategory;


      </scriptlet><text>&lt;table border=&apos;0&apos; width=&apos;98%&apos;&gt;
           </text><text>&lt;tr class=&quot;listHeader&quot;&gt;
           </text><text>&lt;td&gt;</text><text>&lt;a href=&quot;directoryjsp2.jsp&quot;&gt;</text><text>item</text><text>&lt;/a&gt;</text><text>&lt;/td&gt;
           </text><text>&lt;td&gt;</text><text>&lt;a href=&quot;directoryjsp2.jsp?sort=Name&quot;&gt;</text><text>file</text><text>&lt;/a&gt;</text><text>&lt;/td&gt;
           </text><text>&lt;td&gt;</text><text>&lt;a href=&quot;directoryjsp2.jsp?sort=Category&quot;&gt;</text><text>category</text><text>&lt;/a&gt;</text><text>&lt;/td&gt;
           </text><text>&lt;td&gt;</text><text>summary</text><text>&lt;/td&gt;  
           </text><text>&lt;/tr&gt;
</text><scriptlet>  int itCounter = 0;
    for(Iterator it = itJspEntryList.iterator(); it.hasNext(); ){
           String itJspEntry[] =  (String[]) it.next();
           itCounter++;

</scriptlet><text>&lt;tr class=&quot;</text><expression> ((itCounter % 2)==0)?&quot;listOddRow&quot;:&quot;listEvenRow&quot; </expression><text>&quot;&gt;
  </text><text>&lt;td width=&quot;5%&quot;&gt;</text><expression> itJspEntry[0] </expression><text/><text>&lt;/td&gt;
  </text><text>&lt;td width=&quot;10%&quot;&gt;</text><expression> pharosDoc.hyperlink(&quot;documentjsp.jsp?name=&quot;,&quot;\&quot;&quot;+itJspEntry[1]+&quot;\&quot;&quot;,false) </expression><text/><text>&lt;/td&gt;
  </text><text>&lt;td width=&quot;10%&quot;&gt;</text><expression> itJspEntry[2] </expression><text/><text>&lt;/td&gt;
  </text><text>&lt;td width=&quot;75%&quot;&gt;</text><expression> pharosDoc.normalize(itJspEntry[3]) </expression><text/><text>&lt;/td&gt;
 </text><text>&lt;/tr&gt;
</text><scriptlet> } 
</scriptlet><directive.include file="footer.jsp"/></root>

