Update of 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-web/src/main/java/org/xdoclet/plugin/web
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12122/plugin-web/src/main/java/org/xdoclet/plugin/web

Modified Files:
        WebPlugin.java WebPlugin.jelly 
Log Message:
XDP-160: Changes for Maven2, address issues with mergedir not being found.

Index: WebPlugin.java
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-web/src/main/java/org/xdoclet/plugin/web/WebPlugin.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** WebPlugin.java      4 Dec 2005 18:25:16 -0000       1.23
--- WebPlugin.java      19 Jan 2006 23:49:23 -0000      1.24
***************
*** 16,19 ****
--- 16,20 ----
  import java.util.HashMap;
  import java.util.Map;
+ import java.io.File;
  
  /**
***************
*** 55,59 ****
      private WebUtils webUtils;
      private String servletversion = WebUtils.SERVLET_23;
!     protected String mergedir;
  
      public WebPlugin(JellyTemplateEngine jellyTemplateEngine, 
QDoxCapableMetadataProvider metadataProvider, WriterMapper writerMapper) {
--- 56,60 ----
      private WebUtils webUtils;
      private String servletversion = WebUtils.SERVLET_23;
!     protected File mergeDir;
  
      public WebPlugin(JellyTemplateEngine jellyTemplateEngine, 
QDoxCapableMetadataProvider metadataProvider, WriterMapper writerMapper) {
***************
*** 171,180 ****
      }
  
!     public String getMergedir() {
!         return mergedir;
      }
  
!     public void setMergedir(String mergedir) {
!         this.mergedir = mergedir;
      }
  }
--- 172,204 ----
      }
  
!     /**
!      * Setter for mergeDir property
!      *
!      * @param mergeDir The value for the property
!      */
!     public void setMergedir(File mergeDir) {
!         this.mergeDir = mergeDir;
      }
  
!     /**
!      * Utility method called from jelly script to resolve a mergeFile 
reference
!      *
!      * @param mergeFile The mergeFile to look for
!      *
!      * @return A File for mergeFile
!      */
!     public File getMergeFile(String mergeFile) {
!         if ((mergeFile != null) && (mergeDir != null) && 
mergeDir.isDirectory()) {
!             // The listing of mergeDir's files avoid possibly security issues 
in path resolving (paranoid?)
!             File[] files = mergeDir.listFiles();
! 
!             for (int i = 0; i < files.length; i++) {
!                 if (mergeFile.trim().equals(files[i].getName())) {
!                     return files[i];
!                 }
!             }
!         }
! 
!         return null;
      }
  }

Index: WebPlugin.jelly
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-web/src/main/java/org/xdoclet/plugin/web/WebPlugin.jelly,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** WebPlugin.jelly     19 Jan 2006 05:35:27 -0000      1.20
--- WebPlugin.jelly     19 Jan 2006 23:49:23 -0000      1.21
***************
*** 66,70 ****
              </filter>
          </j:forEach>
!         <x:merge file="${plugin.mergedir}/filters.xml"/>
  
          <!-- filter-mappings -->
--- 66,77 ----
              </filter>
          </j:forEach>
!         <j:choose>
!             <j:when test="${plugin.getMergeFile('filters.xml').exists()}">
!                 <j:import file="${plugin.getMergeFile('filters.xml').path}" 
inherit="true"/>
!             </j:when>
!             <j:otherwise>
!                 <jxml:comment trim="false">To add filters that you have 
deployment descriptor info for, add a file to your XDoclet merge directory 
called filters.xml that contains the <filter></filter> markup for those 
beans.</jxml:comment>
!             </j:otherwise>
!         </j:choose>
  
          <!-- filter-mappings -->
***************
*** 78,82 ****
              </j:forEach>
          </j:forEach>
!         <x:merge file="${plugin.mergedir}/filter-mappings.xml"/>
  
          <!-- listeners -->
--- 85,96 ----
              </j:forEach>
          </j:forEach>
!         <j:choose>
!             <j:when 
test="${plugin.getMergeFile('filter-mappings.xml').exists()}">
!                 <j:import 
file="${plugin.getMergeFile('filter-mappings.xml').path}" inherit="true"/>
!             </j:when>
!             <j:otherwise>
!                 <jxml:comment trim="false">To add filters that you have 
deployment descriptor info for, add a file to your XDoclet merge directory 
called filter-mappings.xml that contains the 
<filter-mappings></filter-mappings> markup for those beans.</jxml:comment>
!             </j:otherwise>
!         </j:choose>
  
          <!-- listeners -->
***************
*** 122,126 ****
              </servlet>
          </j:forEach>
!         <x:merge file="${plugin.mergedir}/servlets.xml"/>
  
          <!-- servlet-mappings -->
--- 136,147 ----
              </servlet>
          </j:forEach>
!         <j:choose>
!             <j:when test="${plugin.getMergeFile('servlets.xml').exists()}">
!                 <j:import file="${plugin.getMergeFile('servlets.xml').path}" 
inherit="true"/>
!             </j:when>
!             <j:otherwise>
!                 <jxml:comment trim="false">To add filters that you have 
deployment descriptor info for, add a file to your XDoclet merge directory 
called servlets.xml that contains the <servlet></servlet> markup for those 
beans.</jxml:comment>
!             </j:otherwise>
!         </j:choose>
  
          <!-- servlet-mappings -->
***************
*** 133,137 ****
              </j:forEach>
          </j:forEach>
!         <x:merge file="${plugin.mergedir}/servlet-mappings.xml"/>
  
          <!-- resource env references -->
--- 154,165 ----
              </j:forEach>
          </j:forEach>
!         <j:choose>
!             <j:when 
test="${plugin.getMergeFile('servlet-mappings.xml').exists()}">
!                 <j:import 
file="${plugin.getMergeFile('servlet-mappings.xml').path}" inherit="true"/>
!             </j:when>
!             <j:otherwise>
!                 <jxml:comment trim="false">To add filters that you have 
deployment descriptor info for, add a file to your XDoclet merge directory 
called servlet-mappings.xml that contains the 
<servlet-mappings></servlet-mappings> markup for those beans.</jxml:comment>
!             </j:otherwise>
!         </j:choose>
  
          <!-- resource env references -->
***************
*** 172,176 ****
              </j:forEach>
          </j:forEach>
!         <x:merge file="${plugin.mergedir}/web-security.xml"/>
  
          <!-- env entries -->
--- 200,211 ----
              </j:forEach>
          </j:forEach>
!         <j:choose>
!             <j:when 
test="${plugin.getMergeFile('web-security.xml').exists()}">
!                 <j:import 
file="${plugin.getMergeFile('web-security.xml').path}" inherit="true"/>
!             </j:when>
!             <j:otherwise>
!                 <jxml:comment trim="false">To add filters that you have 
deployment descriptor info for, add a file to your XDoclet merge directory 
called web-security.xml that contains the <web-security></web-security> markup 
for those beans.</jxml:comment>
!             </j:otherwise>
!         </j:choose>
  
          <!-- env entries -->



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
xdoclet-plugins-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits

Reply via email to