Velocity
  1. Velocity
  2. VELOCITY-190

[PATCH] Anakia Custom Context Support

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Component/s: Anakia
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      This update allows the customization of the velocity context in addition to the
      default $project context.

      For example the user can now do:

      <anakia ...>
      <context name="myContext" file="myCustomContext.xml">
      <context ...>
      </anakia>

      Files Changed Are (there are two new files):

      /build/testcases.xml
      /src/java/org/apache/velocity/anakia/AnakiaTask.java
      /src/java/org/apache/velocity/test/AnakiaTestCase.java
      /test/anakia/compare/index.context.html (new)
      /test/anakia/results/index.context.html (new)
      /test/anakia/xdocs/stylesheets/site_contexts.vsl

        Activity

        Hide
        Peter Ryan added a comment -

        Created an attachment (id=7171)
        patch file that contains modified AnakiaTask.java and supporting files

        Show
        Peter Ryan added a comment - Created an attachment (id=7171) patch file that contains modified AnakiaTask.java and supporting files
        Hide
        Will Glass-Husain added a comment -

        Hi – I know this is an old RFE. But we're working through some of the
        backlog. If you (or someone else) writes a unit test to confirm this works,
        and runs "ant test" to makes sure nothing breaks, I'll commit the change.

        Also, the patch is pretty verbose. Please run it on the latest copy of
        Velocity (from svn) if possible so that their are a minimum of changes.
        Thanks...

        Show
        Will Glass-Husain added a comment - Hi – I know this is an old RFE. But we're working through some of the backlog. If you (or someone else) writes a unit test to confirm this works, and runs "ant test" to makes sure nothing breaks, I'll commit the change. Also, the patch is pretty verbose. Please run it on the latest copy of Velocity (from svn) if possible so that their are a minimum of changes. Thanks...
        Hide
        Peter Ryan added a comment -

        the patch (it is too verbose) does have unit tests. i'll create an updated patch
        and attach it.

        Show
        Peter Ryan added a comment - the patch (it is too verbose) does have unit tests. i'll create an updated patch and attach it.
        Hide
        Peter Ryan added a comment -

        Created an attachment (id=13778)
        anakia custom context patch for svn head Dec 17 2004

        this patch was created from the subversion trunk. anakia ant task can now be
        configured with custom user contexts beyond the base project

        example:

        <anakia ...>
        <context name="myContext" file="myContext.xml">
        </anakia>

        the file is a path built from the base directory of anakia

        Show
        Peter Ryan added a comment - Created an attachment (id=13778) anakia custom context patch for svn head Dec 17 2004 this patch was created from the subversion trunk. anakia ant task can now be configured with custom user contexts beyond the base project example: <anakia ...> <context name="myContext" file="myContext.xml"> </anakia> the file is a path built from the base directory of anakia
        Hide
        Will Glass-Husain added a comment -

        Seems to be missing the file: site_contexts.vsl. Once we receive this file,
        if the tests work I'll go ahead and commit.

        Also, just as a comment.. be sure to follow the coding guidelines at
        http://jakarta.apache.org/velocity/code-standards.html

        No need to change the patch here (I've edited it), but just wanted to mention
        it for future reference.

        Again, thanks for the submission!

        Show
        Will Glass-Husain added a comment - Seems to be missing the file: site_contexts.vsl. Once we receive this file, if the tests work I'll go ahead and commit. Also, just as a comment.. be sure to follow the coding guidelines at http://jakarta.apache.org/velocity/code-standards.html No need to change the patch here (I've edited it), but just wanted to mention it for future reference. Again, thanks for the submission!
        Hide
        Peter Ryan added a comment -

        Created an attachment (id=14003)
        site contexts vsl

        I am not sure why patch did not pick this up.
        It belongs in:
        test\anakia\xdocs\stylesheets

        Show
        Peter Ryan added a comment - Created an attachment (id=14003) site contexts vsl I am not sure why patch did not pick this up. It belongs in: test\anakia\xdocs\stylesheets
        Hide
        Will Glass-Husain added a comment -

        thanks. turns out also need customContext.xml.

        Looks like any newly created files didn't get included in the patch.

        Show
        Will Glass-Husain added a comment - thanks. turns out also need customContext.xml. Looks like any newly created files didn't get included in the patch.
        Hide
        Peter Ryan added a comment -

        Created an attachment (id=14014)
        missing file from patch

        Show
        Peter Ryan added a comment - Created an attachment (id=14014) missing file from patch
        Hide
        Will Glass-Husain added a comment -

        Is there supposed to be a file test/compare/index.context.html? Not in the
        patch.

        Can you please double-check to see if there are any other missing files?
        Again, any new files created appear to be missing.

        Thanks. Look forward to getting this working - it seems a neat extension to
        anakia.

        Show
        Will Glass-Husain added a comment - Is there supposed to be a file test/compare/index.context.html? Not in the patch. Can you please double-check to see if there are any other missing files? Again, any new files created appear to be missing. Thanks. Look forward to getting this working - it seems a neat extension to anakia.
        Hide
        Peter Ryan added a comment -

        Created an attachment (id=14015)
        comparison file for custom context test

        i am sorry about all of these missing files...i don't think there are any other
        files.

        Show
        Peter Ryan added a comment - Created an attachment (id=14015) comparison file for custom context test i am sorry about all of these missing files...i don't think there are any other files.
        Hide
        Will Glass-Husain added a comment -

        Not a big deal. A learning for next time - it's tricky to get diff to include
        new files - sometimes it's better to zip them up separately.

        We're almost there, but not quite. Ant test fails for me (with both forms of
        the anakia task). it's close, but the line breaks are different.

        Looking at this, your patch deleted "xdocs/index.xml". I thought this was a
        mistake, and put it back. Now, I'm suspecting that you are using a slightly
        different version of index.xml that changes the line breaks. Can you attach
        the version of index.xml that you are using?

        Thanks.

        Show
        Will Glass-Husain added a comment - Not a big deal. A learning for next time - it's tricky to get diff to include new files - sometimes it's better to zip them up separately. We're almost there, but not quite. Ant test fails for me (with both forms of the anakia task). it's close, but the line breaks are different. Looking at this, your patch deleted "xdocs/index.xml". I thought this was a mistake, and put it back. Now, I'm suspecting that you are using a slightly different version of index.xml that changes the line breaks. Can you attach the version of index.xml that you are using? Thanks.
        Hide
        Peter Ryan added a comment -

        Created an attachment (id=14017)
        working file for anakia custom context tast

        Show
        Peter Ryan added a comment - Created an attachment (id=14017) working file for anakia custom context tast
        Hide
        Will Glass-Husain added a comment -

        Great! Works fine. Would you be interested in also doing an edit on the
        Anakia docs? A couple of extra lines would do it. (whenever possible, it's
        nice to update the code and the docs simultaneously). The file is
        anakia.xml. (Remember to give yourself credit in the last paragraph). If you
        have time to edit the docs, I'll commit all the pieces ASAP.

        Show
        Will Glass-Husain added a comment - Great! Works fine. Would you be interested in also doing an edit on the Anakia docs? A couple of extra lines would do it. (whenever possible, it's nice to update the code and the docs simultaneously). The file is anakia.xml. (Remember to give yourself credit in the last paragraph). If you have time to edit the docs, I'll commit all the pieces ASAP.
        Hide
        Peter Ryan added a comment -

        Created an attachment (id=14018)
        updated anakia documentation

        i didn't have the jakarta-site2 project checked out so i used maven
        xdoc:transform to test the doc. if there are any compatibility issues between
        the maven velocity template and the jakarta velocity template then let me know
        and i will do a more robust test but i don't think there will be much of an
        issue.

        Show
        Peter Ryan added a comment - Created an attachment (id=14018) updated anakia documentation i didn't have the jakarta-site2 project checked out so i used maven xdoc:transform to test the doc. if there are any compatibility issues between the maven velocity template and the jakarta velocity template then let me know and i will do a more robust test but i don't think there will be much of an issue.
        Hide
        Will Glass-Husain added a comment -

        Patch applied. Docs look great. Thanks for your help in writing the patch and
        the docs. Subversion Revision 125377 and 125378. Enjoy.

        Show
        Will Glass-Husain added a comment - Patch applied. Docs look great. Thanks for your help in writing the patch and the docs. Subversion Revision 125377 and 125378. Enjoy.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development