Texen
  1. Texen
  2. TEXEN-2 Provide class to be called from command-line to translate any file with special suffix.
  3. TEXEN-7

Need a standard Velocity class for doing macro preprocessing for various files (XML, HTML, scripts, source files..)

    Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      WindowsXP

      Description

      Need to have standard class to do macro preprocessing of various files, source code..etc.

      Hi! I raised this issue before but I think I did not express myself correctly. I was misunderstood. So I am attempting a second time. I am rephrasing my thoughts here.

      As you know, there are many files that use Velocity type, macro preprocessing. To name a few: HTML, XML, programming language source-code...etc. With the use of XML as configuration file, I find that having a standard macro preprocessor like Velocity would be most useful.

      When a user does preprocessing, he/she often has a library of macros (Velocity *.vm files). These macros can be located in different file directories. This is a very useful and powerful feature for the user. It avoids time-wasting, repetitive typing.

      My suggestion is that Velocity provides a single and standard class for doing macro preprocessing. The class will be callable from the command-line. It should be easy to implement. The class will take a list of directory locations where it can find macros that are being called. Furthermore, it will have two parameters for source and destination directory locations. The source directory is the location of source files. The destination directory will be the destination of the result file. The source and destination directories can be the same.

      I suggest using the following convention: The standard class will transform any file that end with given suffix(es). For instance; every file that ends with suffix *.velocity or *.vm will be processed and transformed to a file with its suffix only.

      MyFile.html.velocity >>> MyFile.html
      MyFile.xml.vm >>> MyFile.xml
      MyFile.python.velocity >>> MyFile.python

      The important thing here is that the suffixes that are searched for should also be a parameter as to allow full freedom for the user. In other words, the user can specify suffixes *.macro or *.textmacro instead of *.velocity or/and *.vm.

      This simple standard class will go a long way to make Velocity more standard and generally usable. Velocity will not only be a powerful Java library, it will also be a powerful text processor. Many programmers and users will be encouraged to use it because it is standard and for general purpose. This standard class should be readily available in the Velocity jar file without any Java programming.

      As an extension to this standard Velocity class, you can have an ANT task that will do the exact same thing for those who like to use ANT.

        Activity

        Colbert Philippe created issue -
        Henning Schmiedehausen made changes -
        Field Original Value New Value
        Component/s Build [ 12310212 ]
        Henning Schmiedehausen made changes -
        Component/s Engine [ 12311337 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Nathan Bubna made changes -
        Component/s Engine [ 12311337 ]
        Component/s Texen [ 12310216 ]
        Henning Schmiedehausen made changes -
        Component/s Texen [ 12310216 ]
        Project Velocity [ 12310104 ] Texen [ 12310651 ]
        Key VELOCITY-442 TEXEN-7
        Affects Version/s 1.4 [ 12310249 ]

          People

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

            Dates

            • Created:
              Updated:

              Development