You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vjeran Marcinko <vj...@tis.hr> on 2004/08/21 07:17:18 UTC

.script automatic loading?

Hi.

I am total newbie considering Tapestry and JavaScripts, but just want to
clear something that I noticed -
Are *.script files always supose to be loaded and executed manually inside
some component's renderComponent() method, or there is a way that Tapestry
detects that let's say component Foo has Foo.script present in WEB-INF and
automaticaly loads it similar to it's Foo.html template ?

Thing is that whenever I see overriding renderComponent() method I get
goosebumps, 'cause I consider that a bit of "for-the-expersts-only" way of
developing ....

Cheers,
Vjeran


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Visit object and a "configuration" object

Posted by sa...@women-at-work.org.
Hey guys!

I want to do java based webengine that can be configured
with xml/property files and to every domain name that points
to the tapestry application, the corresponding configuration files
will be read.

For instance domain name "aaaa.com" will be in English 
and the title will be "aaa.com - some english text" and the layout will
be different than for the french version.

To do that i was thinking of having a configuration object similiar to the
visit object that is only read once when the tapestry application is
started.

My questions:

1. is should not implement serializable ? i am not sure
2. within the BasePage i will read the configuration files for the
corresponding domains ?

I am confused and dont know a good solution and best practice.....

It will be one tapestry application and different configurations
corresponding to different domain names. the configurations are not
like visit objects and are not different for every user. they are only
different for every "user/domain group"


Any ideas? Or have you dont anything similiar yet?


Cheers!





---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: .script automatic loading?

Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
No, Tapestry does not automatically load your scripts. You'll have to load
them manually in your renderComponent method.

[snippet]
  if (null == script)
  {
      IResourceLocation irl;
      irl = getSpecification().getLocation().getResourceLocation();
      irl = irl.getRelativeLocation("MyScript.script");
      script = cycle.getEngine().getScriptSource().getScript(irl);
  }

  Body body = Body.get(cycle);
  Map symbols = new HashMap();
  script.execute(cycle, body, symbols);
[/snippet]

But you can also use the @Script component:

  http://jakarta.apache.org/tapestry/doc/ComponentReference/Script.html

It comes in handy at times.

Hope this helps.

-Filip S. Adamsen

-----Original Message-----
From: Vjeran Marcinko [mailto:vjeran@tis.hr] 
Sent: Saturday, August 21, 2004 7:17 AM
To: tapestry-user@jakarta.apache.org
Subject: .script automatic loading?

Hi.

I am total newbie considering Tapestry and JavaScripts, but just want to
clear something that I noticed -
Are *.script files always supose to be loaded and executed manually inside
some component's renderComponent() method, or there is a way that Tapestry
detects that let's say component Foo has Foo.script present in WEB-INF and
automaticaly loads it similar to it's Foo.html template ?

Thing is that whenever I see overriding renderComponent() method I get
goosebumps, 'cause I consider that a bit of "for-the-expersts-only" way of
developing ....

Cheers,
Vjeran


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org