Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.10
    • Fix Version/s: 2.1.12
    • Component/s: - Build System: Ant
    • Labels:
      None
    • Urgency:
      Normal
    • Other Info:
      Patch available
    • Affects version (Component):
      Cocoon Core
    • Fix version (Component):
      Cocoon Core

      Description

      The build process carefully adds each of the standard files in the webapp directory. New applications are not included in the build process. The improvement copies the entire directory. I did not notice any files needing to be excluded; any such files could be excluded from the fileset.

      webapp-build.xml
      CURRENT CODE:
          <copy file="${webapp}/welcome.xml" tofile="${build.webapp}/welcome.xml" filtering="on"/>
          <copy file="${webapp}/not-found.xml" tofile="${build.webapp}/not-found.xml" filtering="on"/>
          <copy file="${webapp}/welcome.xslt" tofile="${build.webapp}/welcome.xslt" filtering="on"/>
          <copy file="${webapp}/sitemap.xmap" tofile="${build.webapp}/sitemap.xmap"/>

          <!-- generate sitemap entries
          <sitemap-components sitemap="${build.webapp}/sitemap.xmap" source="${java}"/>
          -->

          <copy todir="${build.webapp}/stylesheets" filtering="on">
            <fileset dir="${webapp}/stylesheets">
              <include name="**/*.xslt"/>
            </fileset>
          </copy>

          <copy todir="${build.webapp}/resources" filtering="off">
            <fileset dir="${webapp}/resources"/>
          </copy>

          <copy todir="${build.webapp}/WEB-INF" filtering="on">
            <fileset dir="${webapp}/WEB-INF">
              <include name="entities/**"/>
              <include name="classes/**"/>
              <include name="*.x*"/>
              <include name="properties/**"/>
            </fileset>
          </copy>

      REPLACE WITH:
       <copy todir="${build.webapp}" filtering="on">
          <fileset dir="${webapp}"/>
        </copy>

        Activity

        solprovider created issue -
        Hide
        solprovider added a comment -
        Committed 20021224 version 606743 for 2.1.11.

        Uncertain if 2.2 can be similarly improved because 2.2 changes how applications are deployed by requiring use of blocks with Maven. Just copying files no longer creates usable applications -- parental configuration required.
        Show
        solprovider added a comment - Committed 20021224 version 606743 for 2.1.11. Uncertain if 2.2 can be similarly improved because 2.2 changes how applications are deployed by requiring use of blocks with Maven. Just copying files no longer creates usable applications -- parental configuration required.
        solprovider made changes -
        Field Original Value New Value
        Fix Version/s 2.1.11-dev (Current SVN) [ 12312231 ]
        Fix version (Component) Parent values: Cocoon Core(10227).
        Affects version (Component) Parent values: Cocoon Core(10151).
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        solprovider added a comment -
        The commit was reverted due to concerns about filtering damaging binary files.
        Show
        solprovider added a comment - The commit was reverted due to concerns about filtering damaging binary files.
        solprovider made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Hide
        solprovider added a comment -
        This version copies the directory with filtering="off", then overwrites the files requiring filtering="on"

        FILE: webapp-build.xml
        REPLACE WITH:
         <copy todir="${build.webapp}" filtering="off">
            <fileset dir="${webapp}"/>
          </copy>

            <copy file="${webapp}/welcome.xml" tofile="${build.webapp}/welcome.xml" filtering="on" overwrite="true"/>
            <copy file="${webapp}/not-found.xml" tofile="${build.webapp}/not-found.xml" filtering="on" overwrite="true"/>
            <copy file="${webapp}/welcome.xslt" tofile="${build.webapp}/welcome.xslt" filtering="on" overwrite="true"/>
            <copy file="${webapp}/sitemap.xmap" tofile="${build.webapp}/sitemap.xmap" overwrite="true"/>

        <copy todir="${build.webapp}/stylesheets" filtering="on" overwrite="true">
              <fileset dir="${webapp}/stylesheets">
                <include name="**/*.xslt"/>
              </fileset>
            </copy>

        <copy todir="${build.webapp}/WEB-INF" filtering="on" overwrite="true">
              <fileset dir="${webapp}/WEB-INF">
                <include name="entities/**"/>
                <include name="classes/**"/>
                <include name="*.x*"/>
                <include name="properties/**"/>
              </fileset>
            </copy>
        Show
        solprovider added a comment - This version copies the directory with filtering="off", then overwrites the files requiring filtering="on" FILE: webapp-build.xml REPLACE WITH:  <copy todir="${build.webapp}" filtering="off">     <fileset dir="${webapp}"/>   </copy>     <copy file="${webapp}/welcome.xml" tofile="${build.webapp}/welcome.xml" filtering="on" overwrite="true"/>     <copy file="${webapp}/not-found.xml" tofile="${build.webapp}/not-found.xml" filtering="on" overwrite="true"/>     <copy file="${webapp}/welcome.xslt" tofile="${build.webapp}/welcome.xslt" filtering="on" overwrite="true"/>     <copy file="${webapp}/sitemap.xmap" tofile="${build.webapp}/sitemap.xmap" overwrite="true"/> <copy todir="${build.webapp}/stylesheets" filtering="on" overwrite="true">       <fileset dir="${webapp}/stylesheets">         <include name="**/*.xslt"/>       </fileset>     </copy> <copy todir="${build.webapp}/WEB-INF" filtering="on" overwrite="true">       <fileset dir="${webapp}/WEB-INF">         <include name="entities/**"/>         <include name="classes/**"/>         <include name="*.x*"/>         <include name="properties/**"/>       </fileset>     </copy>
        Hide
        solprovider added a comment -
        Vadim Gritsenko suggested on the Dev ML to use <exclude>s in the "copy all" and remove overwrite=true. Using 'overwrite' is bad design, doubles the work of the build script, and adds work and time to the "do-nothing" build.
        Show
        solprovider added a comment - Vadim Gritsenko suggested on the Dev ML to use <exclude>s in the "copy all" and remove overwrite=true. Using 'overwrite' is bad design, doubles the work of the build script, and adds work and time to the "do-nothing" build.
        Hide
        solprovider added a comment -
        This version excludes the filtered files from the unfiltered copy to avoid overwriting.

        FILE: tools/targets/webapp-build.xml
           <copy todir="${build.webapp}" filtering="off">
              <fileset dir="${webapp}" excludes="welcome.xml,not-found.xml,welcome.xslt,sitemap.xmap,stylesheets/**/*.xslt,WEB-INF/entities/**,WEB-INF/classes/**,WEB-INF/*.x*,WEB-INF/properties/**"/>
           </copy>
           <copy file="${webapp}/welcome.xml" tofile="${build.webapp}/welcome.xml" filtering="on"/>
           <copy file="${webapp}/not-found.xml" tofile="${build.webapp}/not-found.xml" filtering="on"/>
           <copy file="${webapp}/welcome.xslt" tofile="${build.webapp}/welcome.xslt" filtering="on"/>
           <copy file="${webapp}/sitemap.xmap" tofile="${build.webapp}/sitemap.xmap"/>
           <copy todir="${build.webapp}/stylesheets" filtering="on">
              <fileset dir="${webapp}/stylesheets">
                 <include name="**/*.xslt"/>
              </fileset>
           </copy>
           <copy todir="${build.webapp}/WEB-INF" filtering="on">
              <fileset dir="${webapp}/WEB-INF">
                 <include name="entities/**"/>
                 <include name="classes/**"/>
                 <include name="*.x*"/>
                 <include name="properties/**"/>
              </fileset>
           </copy>
        Show
        solprovider added a comment - This version excludes the filtered files from the unfiltered copy to avoid overwriting. FILE: tools/targets/webapp-build.xml    <copy todir="${build.webapp}" filtering="off">       <fileset dir="${webapp}" excludes="welcome.xml,not-found.xml,welcome.xslt,sitemap.xmap,stylesheets/**/*.xslt,WEB-INF/entities/**,WEB-INF/classes/**,WEB-INF/*.x*,WEB-INF/properties/**"/>    </copy>    <copy file="${webapp}/welcome.xml" tofile="${build.webapp}/welcome.xml" filtering="on"/>    <copy file="${webapp}/not-found.xml" tofile="${build.webapp}/not-found.xml" filtering="on"/>    <copy file="${webapp}/welcome.xslt" tofile="${build.webapp}/welcome.xslt" filtering="on"/>    <copy file="${webapp}/sitemap.xmap" tofile="${build.webapp}/sitemap.xmap"/>    <copy todir="${build.webapp}/stylesheets" filtering="on">       <fileset dir="${webapp}/stylesheets">          <include name="**/*.xslt"/>       </fileset>    </copy>    <copy todir="${build.webapp}/WEB-INF" filtering="on">       <fileset dir="${webapp}/WEB-INF">          <include name="entities/**"/>          <include name="classes/**"/>          <include name="*.x*"/>          <include name="properties/**"/>       </fileset>    </copy>
        Hide
        Carsten Ziegeler added a comment -
        This patch copies too much as the samples and the test-suite directory should not always be copied. I applied a patch which hopefully fixes this problem. Please cross-check and close the bug.
        Show
        Carsten Ziegeler added a comment - This patch copies too much as the samples and the test-suite directory should not always be copied. I applied a patch which hopefully fixes this problem. Please cross-check and close the bug.
        Hide
        solprovider added a comment -
        Tested successfully:
        1. Create new directory in src/webapp.
        2. Add "Hello World" application to new directory.
        3. Build and run Cocoon.
        4. Browse to http://127.0.0.1:8888/{newdirectory}/ (Final slash is required due to different issue.)
        5. See Hello World.

        Thank you Carsten. The new code is cleaner than the original and my proposals.

        Applications not requiring Java compilation can be created in src/webapp; the standard build will include the applications.
        Show
        solprovider added a comment - Tested successfully: 1. Create new directory in src/webapp. 2. Add "Hello World" application to new directory. 3. Build and run Cocoon. 4. Browse to http://127.0.0.1:8888/ {newdirectory}/ (Final slash is required due to different issue.) 5. See Hello World. Thank you Carsten. The new code is cleaner than the original and my proposals. Applications not requiring Java compilation can be created in src/webapp; the standard build will include the applications.
        solprovider made changes -
        Fix Version/s 2.1.12-dev (Current SVN) [ 12312903 ]
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Closed [ 6 ]
        Fix Version/s 2.1.11 [ 12312231 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            solprovider
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development