You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kheldar666 <ma...@liber-mundi.org> on 2007/08/16 00:03:52 UTC

[T5] Skin feature

Hi everybody,

I know that the 'multiple skin/layout' discution is something frequently
discussed here, an most of the time the answer is "Use CSS my son". Well
that's indeed probably the best answer, but in some case it's not.

For instance, I'm building a site where people that uses the site can
participate by providing new skins/layout. Unfortunatly they are not all
XHTML/CSS gods. In fact most of them use the old HTML 4 way... I can
encourage them to deliver valid "XML" templates but not really more.

Well so I studied a bit Tapestry's code to look how the "skin/layout'
feature could be done knowing that tapestry still have to use 'Static'
templates.

Couldn't it be possible to implement the skin feature by 'extending' the
same idea as for the template localisation ?

For the moment, Tapestry -in
ComponentTemplateSourceImpl.locateTemplateResource() -gets the baseResource
for a given model (Page or Component) then it look's for a localized version
of the same template.

Supposing we have a kind of SkinManager in Session (so that each use can
display it's own selected skin) I wonder if it is difficult to insert a step
where the locateTemplateResource function looks into a special directory (
let's say into .skins - like there is .components and .pages dirs).

Exemple :

Let say that my user choose the "bluesteel" skin (info recorded in the
SkinManager) and I would like to display a simple component called myComp.

First Tapestry gets the baseTemplate from : 

${tapestryRoot}/components/myComp.html

then it try to look if there is teh component's template here

${tapestryRoot}/skins/bluesteel/components/myComp.html

finaly it tries to find the localized version from the "bluesteel" dir

If Tapestry does not find a Skinned template then it falls back to default
template

So ? Is it a good idea ? A bad one ? Maybe it causes performances issues
that I'm not aware off ? 

Should I change my nickname and hide ? :)

I hope that it will help a bit.

Cheer,

Martin


-- 
View this message in context: http://www.nabble.com/-T5--Skin-feature-tf4276008.html#a12171332
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: [T4.1] Two beginner questions (Pageconfig / AJAX)

Posted by Jesse Kuhnert <jk...@gmail.com>.
For the directory stuff I think people like to plug in their own
SpecificationResolver implementations (I think there are many in the
wiki) - but I've been wanting to add at least two additional
parameters to the .application file similar to the package classes for
where to find stuff under WEB-INF.

Right now (4.1.2 or later) it will also look for templates using
various component class + package names if it has to.  ie:

com.company.components.CustomComponent

would be (in the worst case) searched for under:

/WEB-INF/CustomComponent.html
/WEB-INF/components/CustomComponent.html
/WEB-INF/components/company/CusomComponent.html

I'm not sure if this has been done for pages yet though... (guess I
should do that)

As for ajax stuff - you can find a lot of information by reading up here:

http://tapestry.apache.org/tapestry4.1/ajax/index.html

For a prototype specific example see:

http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/scriptaculous/

On 8/16/07, Michael Wölm <mi...@net-m.de> wrote:
> Hi guys,
>
> after a simple basic test application, I decided to use Tapestry now for
> a real-used office application.
> I have one small and one general bigger question, hoping you can help me.
>
> The first question is about configurating directory informations for
> pages. In the .application-file I can setup where to search for the
> .class files by default. But what is with the pages itself? I can
> declare each page or component seperately and his directory-path, but no
> default.
> Especially if I have my pages in /WEB-INF/pages and my components in
> /WEB-INF/comps, is it possible to set these paths as default?
>
> The second question is about AJAX. I have used the AJAX-concept much in
> PHP <-> JS[ with Prototype(/Behaviour)].
> The tapestry-dev-page gives information how to change an Insertion-Field
> via AJAX. But if I want to change a complete div-component by link, that
> could especially a seperate tapestry-component (Like Ajax.Update() in
> Prototype.js). Is this possible with tapestry itself or do I need the
> tacos-extension? Is there an example source available how to do this or
> could anybody give me some initial "How-To"-information? Example: If a
> user chooses in selection-field account mmustermann, the
> tapestry-component accountdata should reload with all informations of
> mmustermann.
>
> Thanks + Regards,
> Michael Wölm
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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


[T4.1] Two beginner questions (Pageconfig / AJAX)

Posted by Michael Wölm <mi...@net-m.de>.
Hi guys,

after a simple basic test application, I decided to use Tapestry now for 
a real-used office application.
I have one small and one general bigger question, hoping you can help me.

The first question is about configurating directory informations for 
pages. In the .application-file I can setup where to search for the 
.class files by default. But what is with the pages itself? I can 
declare each page or component seperately and his directory-path, but no 
default.
Especially if I have my pages in /WEB-INF/pages and my components in 
/WEB-INF/comps, is it possible to set these paths as default?

The second question is about AJAX. I have used the AJAX-concept much in 
PHP <-> JS[ with Prototype(/Behaviour)].
The tapestry-dev-page gives information how to change an Insertion-Field 
via AJAX. But if I want to change a complete div-component by link, that 
could especially a seperate tapestry-component (Like Ajax.Update() in 
Prototype.js). Is this possible with tapestry itself or do I need the 
tacos-extension? Is there an example source available how to do this or 
could anybody give me some initial "How-To"-information? Example: If a 
user chooses in selection-field account mmustermann, the 
tapestry-component accountdata should reload with all informations of 
mmustermann.

Thanks + Regards,
Michael Wölm


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