Inspect Tile Definitions

2008-09-30 Thread Shelley, Ryan
Hi All,

 

We're using Struts Tiles 1.3.5 in Spring 2.0 on Tomcat 5.5 and Java 1.6.
With Spring, we're loading a view that is a Tile definition.  That Tile
loads several other Tiles respectively.  Some of those sub-Tiles include
global advertising Tiles such as the banner ad, a square ad, a pop-under
ad, etc.  The ad system we are using requires us to make one call to the
ad server to get all of the ads needed for the page.  In our first pass,
we put flags in each ad Tile to indicate that our footer AJAX should
retrieve the ads required by the Tiles inserted.  This works ok, but we
have some technical difficulties with post-render ad positioning that
are causing us to consider alternatives.

 

We were wondering if there is any way for us, in the primary view Tile,
to inspect the Tile definitions that WILL be loaded into the page.  Then
we can simply determine if certain Tiles are present, we can insert the
ads proactively as the page is constructed.

 

Any suggestions?  Thanks!

 

-Ryan Shelley



Re: Inspect Tile Definitions

2008-09-30 Thread Antonio Petrelli
2008/9/30 Shelley, Ryan [EMAIL PROTECTED]:
 We were wondering if there is any way for us, in the primary view Tile,
 to inspect the Tile definitions that WILL be loaded into the page.

I don't know if it's useful, but you could use a Tiles controller to
preprocess your definition:
http://struts.apache.org/1.3.8/apidocs/org/apache/struts/tiles/Controller.html
The ComponentContext parameter has all the attributes that will be
used in the definition.

Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Inspect Tile Definitions

2008-09-30 Thread Shelley, Ryan
Thanks for the prompt response!  We're using Spring Controllers and not
Struts Controllers.  Tiles is the only Struts component we're using.
Unfortunately, we have hundreds of Spring Controllers, and it wouldn't
be feasible to refactor them all to use a separate Controller type.
Thanks for the suggestion!

-Ryan

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Antonio Petrelli
Sent: Tuesday, September 30, 2008 11:30 AM
To: Struts Users Mailing List
Subject: Re: Inspect Tile Definitions

2008/9/30 Shelley, Ryan [EMAIL PROTECTED]:
 We were wondering if there is any way for us, in the primary view
Tile,
 to inspect the Tile definitions that WILL be loaded into the page.

I don't know if it's useful, but you could use a Tiles controller to
preprocess your definition:
http://struts.apache.org/1.3.8/apidocs/org/apache/struts/tiles/Controlle
r.html
The ComponentContext parameter has all the attributes that will be
used in the definition.

Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Inspect Tile Definitions

2008-09-30 Thread Antonio Petrelli
2008/9/30 Shelley, Ryan [EMAIL PROTECTED]:
 Thanks for the prompt response!  We're using Spring Controllers and not
 Struts Controllers.  Tiles is the only Struts component we're using.
 Unfortunately, we have hundreds of Spring Controllers, and it wouldn't
 be feasible to refactor them all to use a separate Controller type.

No wait, Tiles controllers are a totally different concept (in fact
the name was pretty unfortunate, in Tiles 2 we renamed it into
preparer).
The Tiles controller is specified into the XML definition files, for example:

definition name=my.definition page=/my/page.jsp
controllerClass=my.package.MyControllerClass
...
/definition

HTH
Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Inspect Tile Definitions

2008-09-30 Thread Shelley, Ryan
Interesting!  Is there a URL to some documentation or examples or are
there any examples of Tile Controllers in any of the packages?

So in theory, if we put a custom Tile Controller on the primary Tile
definition, that Controller class could inspect down into the Tile tree
for that view and set page-level values that could be accessed when the
JSP is rendered?

-Ryan

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Antonio Petrelli
Sent: Tuesday, September 30, 2008 11:51 AM
To: Struts Users Mailing List
Subject: Re: Inspect Tile Definitions

2008/9/30 Shelley, Ryan [EMAIL PROTECTED]:
 Thanks for the prompt response!  We're using Spring Controllers and
not
 Struts Controllers.  Tiles is the only Struts component we're using.
 Unfortunately, we have hundreds of Spring Controllers, and it wouldn't
 be feasible to refactor them all to use a separate Controller type.

No wait, Tiles controllers are a totally different concept (in fact
the name was pretty unfortunate, in Tiles 2 we renamed it into
preparer).
The Tiles controller is specified into the XML definition files, for
example:

definition name=my.definition page=/my/page.jsp
controllerClass=my.package.MyControllerClass
...
/definition

HTH
Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Inspect Tile Definitions

2008-09-30 Thread Antonio Petrelli
2008/9/30 Shelley, Ryan [EMAIL PROTECTED]:
 Interesting!  Is there a URL to some documentation or examples or are
 there any examples of Tile Controllers in any of the packages?

The only thing that I can find is this:
http://www.theserverside.com/tt/articles/article.tss?l=Tiles101

 So in theory, if we put a custom Tile Controller on the primary Tile
 definition, that Controller class could inspect down into the Tile tree
 for that view and set page-level values that could be accessed when the
 JSP is rendered?

Not exactly, it could inspect attributes that you put in, it won't
inspect JSP pages.

Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Inspect Tile Definitions

2008-09-30 Thread Shelley, Ryan
Well, I just need to know if Tile definitions A, B and C are in the
chain of Tiles to be inserted in the particular page render, and if so,
put some variables in the Request or Page scope for the JSP to pick up
during render.

-Ryan

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Antonio Petrelli
Sent: Tuesday, September 30, 2008 12:04 PM
To: Struts Users Mailing List
Subject: Re: Inspect Tile Definitions

2008/9/30 Shelley, Ryan [EMAIL PROTECTED]:
 Interesting!  Is there a URL to some documentation or examples or are
 there any examples of Tile Controllers in any of the packages?

The only thing that I can find is this:
http://www.theserverside.com/tt/articles/article.tss?l=Tiles101

 So in theory, if we put a custom Tile Controller on the primary Tile
 definition, that Controller class could inspect down into the Tile
tree
 for that view and set page-level values that could be accessed when
the
 JSP is rendered?

Not exactly, it could inspect attributes that you put in, it won't
inspect JSP pages.

Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Inspect Tile Definitions

2008-09-30 Thread Shelley, Ryan
When I use ComponentContext and get the attributes in the context, is
there a way to determine that attribute A is a Tile and I can then
drill into that Tile and get a list of its attributes?  Can I do an
instanceof against the Object returned from getAttribute to compare
it to some class that will have getAttribute and getAttributeNames
methods?

-Ryan

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Shelley, Ryan
Sent: Tuesday, September 30, 2008 1:26 PM
To: Struts Users Mailing List
Subject: RE: Inspect Tile Definitions

Well, I just need to know if Tile definitions A, B and C are in the
chain of Tiles to be inserted in the particular page render, and if so,
put some variables in the Request or Page scope for the JSP to pick up
during render.

-Ryan

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Antonio Petrelli
Sent: Tuesday, September 30, 2008 12:04 PM
To: Struts Users Mailing List
Subject: Re: Inspect Tile Definitions

2008/9/30 Shelley, Ryan [EMAIL PROTECTED]:
 Interesting!  Is there a URL to some documentation or examples or are
 there any examples of Tile Controllers in any of the packages?

The only thing that I can find is this:
http://www.theserverside.com/tt/articles/article.tss?l=Tiles101

 So in theory, if we put a custom Tile Controller on the primary Tile
 definition, that Controller class could inspect down into the Tile
tree
 for that view and set page-level values that could be accessed when
the
 JSP is rendered?

Not exactly, it could inspect attributes that you put in, it won't
inspect JSP pages.

Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Inspect Tile Definitions

2008-09-30 Thread Shelley, Ryan
I considered putting the Tile Controller on each Ad Tile that would
collect Ad codes to expose to in the request, which works, except that
each Tile is rendered and flushed to the browser one at a time, so by
the time the last Ad is processed, the header (which contains the Ad
engine code) has already been sent to the browser.  Ideally, we'd be
able to inspect each Tile that WILL be loaded and then put a string of
Ad codes in the request before the page is rendered so the Ad Engine
code in the header will have a complete list of all the Ads to be
rendered on the page.

-Ryan

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Antonio Petrelli
Sent: Tuesday, September 30, 2008 12:04 PM
To: Struts Users Mailing List
Subject: Re: Inspect Tile Definitions

2008/9/30 Shelley, Ryan [EMAIL PROTECTED]:
 Interesting!  Is there a URL to some documentation or examples or are
 there any examples of Tile Controllers in any of the packages?

The only thing that I can find is this:
http://www.theserverside.com/tt/articles/article.tss?l=Tiles101

 So in theory, if we put a custom Tile Controller on the primary Tile
 definition, that Controller class could inspect down into the Tile
tree
 for that view and set page-level values that could be accessed when
the
 JSP is rendered?

Not exactly, it could inspect attributes that you put in, it won't
inspect JSP pages.

Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]