Loading ...
Sorry, an error occurred while loading the content.

Re: [Cheetahtemplate-discuss] Webware plugin to automatically compile?

Expand Messages
  • Winston WOLFF
    Thanks to everybody for all the pointers. Attached is my short python program to automatically compile Cheetah templates. I was originally going to write a
    Message 1 of 8 , Sep 3, 2004
    • 0 Attachment
      Thanks to everybody for all the pointers. Attached is my short python
      program to automatically compile Cheetah templates. I was originally
      going to write a Webware plugin, but then I realized that it would only
      compile templates that were queried. That would cause problems because
      templates that were inherrited from would never be queried and thus
      would not be compiled. So my solution was a Python script that polls a
      particular folder for any changes to .tmpl files anywhere below. Any
      changed files are compiled immediately.

      -winston
    • Shannon -jj Behrens
      ... For me, that is a feature. :) ... Yep, that s a tough problem that I faced as well. I got around it by always using a method called aquariumFactory.
      Message 2 of 8 , Sep 3, 2004
      • 0 Attachment
        On Fri, 3 Sep 2004 10:09:28 -0700, Winston WOLFF <stuff2@...> wrote:
        > Thanks to everybody for all the pointers. Attached is my short python
        > program to automatically compile Cheetah templates. I was originally
        > going to write a Webware plugin, but then I realized that it would only
        > compile templates that were queried.

        For me, that is a feature. :)

        > That would cause problems because
        > templates that were inherrited from would never be queried and thus
        > would not be compiled.

        Yep, that's a tough problem that I faced as well. I got around it by
        always using a method called aquariumFactory. aquariumFactory
        precompiles the template and any of its parents, imports it, and
        instantiates it. I also have a method named call that calls
        aquariumFactory and then "executes" the template. Hence, doing an
        "include" of a template is simply:

        $iLib.call("MyTemplate")

        > So my solution was a Python script that polls a
        > particular folder for any changes to .tmpl files anywhere below.

        Polling, unfortunately, wouldn't work so well in the environment I
        work in. I have multiple trees of packages that are in deep
        hierarchies. The number of directories would be prohibitive :-/

        > Any
        > changed files are compiled immediately.

        I assume that you or WebWare also remove stale modules from
        sys.modules and that you don't have to restart the server everytime
        you make a change, right?

        Best Regards,
        -jj

        --
        I am trying out gmail right now. I am forwarding all of my Yahoo mail
        to gmail, so please do not update your address book just yet.


        -------------------------------------------------------
        This SF.Net email is sponsored by BEA Weblogic Workshop
        FREE Java Enterprise J2EE developer tools!
        Get your free copy of BEA WebLogic Workshop 8.1 today.
        http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      • Andreas Poisel
        ... Take a look at http://wiki.w4py.org/usingaaap.html By calling an recipe similar to the one used in Compiling Cheetah Templates to Servlets from the
        Message 3 of 8 , Sep 7, 2004
        • 0 Attachment
          * Winston WOLFF <stuff2@...> [040821 22:50]:
          > I've seen references in the documentation and on this list to an
          > unfinished plugin to WebWare which will compile Cheetah .tmpl files on
          > demand so you don't have to compile them manually during development.
          > I'd like to write such a plugin, so if anybody has this source code, it
          > would help me get a head-start.

          Take a look at http://wiki.w4py.org/usingaaap.html
          By calling an recipe similar to the one used in "Compiling Cheetah
          Templates to Servlets" from the __init__.py file in your main context
          directory, A-A-P will take care for your changed or new templates with
          every AppServer restart.

          --
          Andi


          -------------------------------------------------------
          This SF.Net email is sponsored by BEA Weblogic Workshop
          FREE Java Enterprise J2EE developer tools!
          Get your free copy of BEA WebLogic Workshop 8.1 today.
          http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
          _______________________________________________
          Cheetahtemplate-discuss mailing list
          Cheetahtemplate-discuss@...
          https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
        • Shannon -jj Behrens
          It s still unfortunate to have to restart your server all the time ;) Best Regards, -jj ... This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java
          Message 4 of 8 , Sep 7, 2004
          • 0 Attachment
            It's still unfortunate to have to restart your server all the time ;)

            Best Regards,
            -jj

            On Wed, 8 Sep 2004 01:57:15 +0200, Andreas Poisel <a.poisel@...> wrote:
            > * Winston WOLFF <stuff2@...> [040821 22:50]:
            > > I've seen references in the documentation and on this list to an
            > > unfinished plugin to WebWare which will compile Cheetah .tmpl files on
            > > demand so you don't have to compile them manually during development.
            > > I'd like to write such a plugin, so if anybody has this source code, it
            > > would help me get a head-start.
            >
            > Take a look at http://wiki.w4py.org/usingaaap.html
            > By calling an recipe similar to the one used in "Compiling Cheetah
            > Templates to Servlets" from the __init__.py file in your main context
            > directory, A-A-P will take care for your changed or new templates with
            > every AppServer restart.


            -------------------------------------------------------
            This SF.Net email is sponsored by BEA Weblogic Workshop
            FREE Java Enterprise J2EE developer tools!
            Get your free copy of BEA WebLogic Workshop 8.1 today.
            http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
            _______________________________________________
            Cheetahtemplate-discuss mailing list
            Cheetahtemplate-discuss@...
            https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
          • Andreas Poisel
            ... It s pretty easy to extend WebKit.AutoReloadingAppServer to watch the template files as well. I did a quick and dirty hack with a new AppServer
            Message 5 of 8 , Sep 8, 2004
            • 0 Attachment
              * Shannon -jj Behrens <jjinux@...> [040908 02:50]:
              > It's still unfortunate to have to restart your server all the time ;)

              It's pretty easy to extend WebKit.AutoReloadingAppServer to watch the
              template files as well. I did a quick and dirty hack with a new
              AppServer configuration option specifying a list of directories holding
              cheetah templates. But I doubt that there is a chance to get such an
              option into CVS since it doesn't make sense to restart the AppServer on
              template changes without something like the AAP script.

              --
              Andi


              -------------------------------------------------------
              This SF.Net email is sponsored by BEA Weblogic Workshop
              FREE Java Enterprise J2EE developer tools!
              Get your free copy of BEA WebLogic Workshop 8.1 today.
              http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
              _______________________________________________
              Cheetahtemplate-discuss mailing list
              Cheetahtemplate-discuss@...
              https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
            Your message has been successfully submitted and would be delivered to recipients shortly.