You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Joseph P Wroblewski <Jo...@notes.ntrs.com> on 2005/11/08 23:29:14 UTC

Modifying HtmlInputCalendar component - trying to mimic how myfaces packages resources with components

I am modifying the HtmlInputCalendar component in Tomahawk.

To do this, I created a new class that is a cut-and-paste of
HtmlInputCalendar
with the specific changes I needed.  Also modified the
HtmlInputCalendarRenderer
and HtmlInputCalendarTag classes in a similar way.  This part works fine.

Since HtmlInputCalendar uses several resources (images, CSS files,
JavaScript files),
I would like to use the same scheme myfaces uses to include these resources
right
inside the component. To get this to work, I had to create my own servlet
listener
and create my own version of the AddResource class.  Things are working
here as well.

What I end up with is all of the new classes mentioned above in my own
package --
including a new AddResource class (also in my own package).

My concern is that my verison of AddResource still uses myfaces packages
like
org.apache.myfaces.renderkit.

Is the org.apache.myfaces.renderkit package meant for public consumption?
Am
I creating a maintenance headache for myself since this myfaces package
could change in future releases?

Thanks,
Joe Wroblewski


Re: Non-MyFaces classes using AddResource

Posted by Martin Marinschek <ma...@gmail.com>.
That was Mathias I think.

Mathias, any information on this?

regards,

Martin

On 11/8/05, Simon Kitching <sk...@obsidium.com> wrote:
> Joseph P Wroblewski wrote:
> > I am modifying the HtmlInputCalendar component in Tomahawk.
> >
> > To do this, I created a new class that is a cut-and-paste of
> > HtmlInputCalendar
> > with the specific changes I needed.  Also modified the
> > HtmlInputCalendarRenderer
> > and HtmlInputCalendarTag classes in a similar way.  This part works fine.
> >
> > Since HtmlInputCalendar uses several resources (images, CSS files,
> > JavaScript files),
> > I would like to use the same scheme myfaces uses to include these resources
> > right
> > inside the component. To get this to work, I had to create my own servlet
> > listener
> > and create my own version of the AddResource class.  Things are working
> > here as well.
> >
> > What I end up with is all of the new classes mentioned above in my own
> > package --
> > including a new AddResource class (also in my own package).
> >
> > My concern is that my verison of AddResource still uses myfaces packages
> > like
> > org.apache.myfaces.renderkit.
> >
> > Is the org.apache.myfaces.renderkit package meant for public consumption?
> > Am
> > I creating a maintenance headache for myself since this myfaces package
> > could change in future releases?
>
> I believe that in the last few weeks changes were made to the
> AddResource class to explicitly allow non-myfaces classes to serve
> resources from their jar-files.
>
> Unfortunately there isn't any documentation on this, and I've been
> wondering how to use this myself. You might want to have a look back
> through the last few weeks worth of commits to AddResource, and search
> the email archives.
>
> I do remember mention of having to define a listener in the web.xml to
> pre-register something with the AddResource class for security reasons
> before non-myfaces classes could use AddResource functionality.
>
> Or maybe the author of this feature could speak up and describe how it's
> meant to be used? I'd be happy to write up appropriate javadocs..
>
> Regards,
>
> Simon
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Non-MyFaces classes using AddResource

Posted by Mathias Brökelmann <mb...@googlemail.com>.
I started writing some doc into the wiki:
http://wiki.apache.org/myfaces/External_Resources
hope that this will help a little bit.

A custom component (don´t have to be a myfaces component) just need to
supply a ResourceHandler instance and a ResourceLoader class to serve
a resource. AddResource provides a lot of methods to add a resource by
giving a ResourceHandler instance where ever a component needs some.

2005/11/8, Simon Kitching <sk...@obsidium.com>:
> Joseph P Wroblewski wrote:
> > I am modifying the HtmlInputCalendar component in Tomahawk.
> >
> > To do this, I created a new class that is a cut-and-paste of
> > HtmlInputCalendar
> > with the specific changes I needed.  Also modified the
> > HtmlInputCalendarRenderer
> > and HtmlInputCalendarTag classes in a similar way.  This part works fine.
> >
> > Since HtmlInputCalendar uses several resources (images, CSS files,
> > JavaScript files),
> > I would like to use the same scheme myfaces uses to include these resources
> > right
> > inside the component. To get this to work, I had to create my own servlet
> > listener
> > and create my own version of the AddResource class.  Things are working
> > here as well.
> >
> > What I end up with is all of the new classes mentioned above in my own
> > package --
> > including a new AddResource class (also in my own package).
> >
> > My concern is that my verison of AddResource still uses myfaces packages
> > like
> > org.apache.myfaces.renderkit.
> >
> > Is the org.apache.myfaces.renderkit package meant for public consumption?
> > Am
> > I creating a maintenance headache for myself since this myfaces package
> > could change in future releases?
>
> I believe that in the last few weeks changes were made to the
> AddResource class to explicitly allow non-myfaces classes to serve
> resources from their jar-files.
>
> Unfortunately there isn't any documentation on this, and I've been
> wondering how to use this myself. You might want to have a look back
> through the last few weeks worth of commits to AddResource, and search
> the email archives.
>
> I do remember mention of having to define a listener in the web.xml to
> pre-register something with the AddResource class for security reasons
> before non-myfaces classes could use AddResource functionality.
>
> Or maybe the author of this feature could speak up and describe how it's
> meant to be used? I'd be happy to write up appropriate javadocs..
>
> Regards,
>
> Simon
>
>


--
Mathias

Re: Non-MyFaces classes using AddResource

Posted by Simon Kitching <sk...@obsidium.com>.
Joseph P Wroblewski wrote:
> I am modifying the HtmlInputCalendar component in Tomahawk.
> 
> To do this, I created a new class that is a cut-and-paste of
> HtmlInputCalendar
> with the specific changes I needed.  Also modified the
> HtmlInputCalendarRenderer
> and HtmlInputCalendarTag classes in a similar way.  This part works fine.
> 
> Since HtmlInputCalendar uses several resources (images, CSS files,
> JavaScript files),
> I would like to use the same scheme myfaces uses to include these resources
> right
> inside the component. To get this to work, I had to create my own servlet
> listener
> and create my own version of the AddResource class.  Things are working
> here as well.
> 
> What I end up with is all of the new classes mentioned above in my own
> package --
> including a new AddResource class (also in my own package).
> 
> My concern is that my verison of AddResource still uses myfaces packages
> like
> org.apache.myfaces.renderkit.
> 
> Is the org.apache.myfaces.renderkit package meant for public consumption?
> Am
> I creating a maintenance headache for myself since this myfaces package
> could change in future releases?

I believe that in the last few weeks changes were made to the 
AddResource class to explicitly allow non-myfaces classes to serve 
resources from their jar-files.

Unfortunately there isn't any documentation on this, and I've been 
wondering how to use this myself. You might want to have a look back 
through the last few weeks worth of commits to AddResource, and search 
the email archives.

I do remember mention of having to define a listener in the web.xml to 
pre-register something with the AddResource class for security reasons 
before non-myfaces classes could use AddResource functionality.

Or maybe the author of this feature could speak up and describe how it's 
meant to be used? I'd be happy to write up appropriate javadocs..

Regards,

Simon


Re: Modifying HtmlInputCalendar component - trying to mimic how myfaces packages resources with components

Posted by Martin Marinschek <ma...@gmail.com>.
Why did you need to factor out AddResource?

Is it due to the fact that AddResource throws a security related
exception when it is asked to serve component resource out of the
MyFaces packages?

There is an open bug-issue on that, so we might be able to fix that at
some point in time.

regards,

Martin

On 11/8/05, Joseph P Wroblewski <Jo...@notes.ntrs.com> wrote:
>
> I am modifying the HtmlInputCalendar component in Tomahawk.
>
> To do this, I created a new class that is a cut-and-paste of
> HtmlInputCalendar
> with the specific changes I needed.  Also modified the
> HtmlInputCalendarRenderer
> and HtmlInputCalendarTag classes in a similar way.  This part works fine.
>
> Since HtmlInputCalendar uses several resources (images, CSS files,
> JavaScript files),
> I would like to use the same scheme myfaces uses to include these resources
> right
> inside the component. To get this to work, I had to create my own servlet
> listener
> and create my own version of the AddResource class.  Things are working
> here as well.
>
> What I end up with is all of the new classes mentioned above in my own
> package --
> including a new AddResource class (also in my own package).
>
> My concern is that my verison of AddResource still uses myfaces packages
> like
> org.apache.myfaces.renderkit.
>
> Is the org.apache.myfaces.renderkit package meant for public consumption?
> Am
> I creating a maintenance headache for myself since this myfaces package
> could change in future releases?
>
> Thanks,
> Joe Wroblewski
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces