branaway / japid42

A full feaured Java-based template engine for Play2
57 stars 11 forks source link

Play2- Modular code breaks #1

Open brainwatch opened 12 years ago

brainwatch commented 12 years ago

Hi

I'm using Japid42 with Play2! for creating modular code. Scenario :

  1. I have Login module as a play2 application with its own resources ( js, css, japidviews, etc.)
  2. I have Admin module as a play2 application with its own resources.
  3. I use Login module in Admin module by publishing Login module and adding dependencies in Build.scala.
  4. Login module's route entries are moved to Admin module routes file.
  5. On accessing the Login page from Admin module, I get the following error:

"RuntimeException: renderer class not found: japidviews.Application.index"


But the Login module works fine as a stand alone module.

How this can be resolved ? Is there any Global configuration required to achieve this ?

Thanks -bw

branaway commented 12 years ago

I haven't tested Japid used in such a modular layout. Let me explore it a bit.

branaway commented 12 years ago

Can you zip me a sample project that demos this issue?

branaway commented 12 years ago

Ok I have added support for multi-root japid configuration. Basically the 0.5.4. version allow one to configure multiple roots for Japid scripts, thus enabling using japid in sub-project. the computer-japid sample app in my github demos this.

Here is the new API sample:

JapidRenderer.setTemplateRoot("japidroot", "modules/foo/japidroot");

kushal28 commented 11 years ago

The API function setTemplateRoot() would work only once to set the right root to the template. However, the problem seems to exists if we have multiple modules each having there respective japid root folder and and its relevant files.

branaway commented 11 years ago

@kushal28 Sorry being late, but if you could explain the problem in more detail?