You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by Chad Wittrock <Ch...@uni.edu> on 2007/02/02 17:13:17 UTC

Remote stylesheet in adf-faces-skins.xml

Is it possible to specify a remote stylesheet in adf-faces-skins.xml or
does the stylesheet have to be local to your project?

Example:
<?xml version="1.0" encoding="ISO-8859-1"?>

<skins xmlns="http://xmlns.oracle.com/adf/view/faces/skin">
    <skin>
        <id>uni.desktop</id>
        <family>uni</family>
        <render-kit-id>oracle.adf.desktop</render-kit-id>
<style-sheet-name>http://myServer/skins/uni/uniSkin.css</style-sheet-name>
    </skin>
</skins>
-- 
--------------------------------------------------------------------
Chad M. Wittrock (Chad.Wittrock@uni.edu)
Senior Programmer Analyst
University of Northern Iowa
(319) 273-7437


Re: Remote stylesheet in adf-faces-skins.xml

Posted by Jeanne Waldman <je...@oracle.com>.
In StyleSheetNameResolver's _resolveURL, I added the check for http: and 
that fixes it:

  private URL _resolveURL(String name)
  {
    assert ((name != null));

    FacesContext fContext = FacesContext.getCurrentInstance();
    if (fContext != null)
    {
      try
      {
        if (name.startsWith("http:"))
        {
          URL url = new URL(name);
          if (url != null)
            return url;
        }
        else
        {
          String rootName = _getRootName(name);
          URL url = fContext.getExternalContext().getResource(rootName);
          if (url != null)
            return url;
        }
      }
      catch (MalformedURLException e)
      {
        // Eat the MalformedURLException - maybe the name isn't an URL
        ;
      }
    }

I'll go ahead and check this in.

- Jeanne

Adam Winer wrote:
> On 2/6/07, Chad Wittrock <Ch...@uni.edu> wrote:
>> OK, I guess I could have asked this a little better. I have actually
>> tried the example listed below and it does not work. Faces looks for the
>> file within the current application and treats the absolute URL as a
>> relative URL within the application.
>>
>> Does anyone have any suggestions on how to make it work or is this a
>> lost cause?
>
> I'm sure it's going to require a patch.  We'd be happy to
> get one.  Jeanne could, I'm sure, give you a pointer
> to the right bit of code to look at.
>
> -- Adam
>
>>
>> Thanks,
>> Chad
>>
>> On Tue, 2007-02-06 at 10:52 -0800, Jeanne Waldman wrote:
>> > I don't know. You can try it and let us know if it works. :)
>> >
>> > Chad Wittrock wrote:
>> > > Is it possible to specify a remote stylesheet in 
>> adf-faces-skins.xml or
>> > > does the stylesheet have to be local to your project?
>> > >
>> > > Example:
>> > > <?xml version="1.0" encoding="ISO-8859-1"?>
>> > >
>> > > <skins xmlns="http://xmlns.oracle.com/adf/view/faces/skin">
>> > >     <skin>
>> > >         <id>uni.desktop</id>
>> > >         <family>uni</family>
>> > >         <render-kit-id>oracle.adf.desktop</render-kit-id>
>> > > 
>> <style-sheet-name>http://myServer/skins/uni/uniSkin.css</style-sheet-name> 
>>
>> > >     </skin>
>> > > </skins>
>> > >
>> >
>> -- 
>> --------------------------------------------------------------------
>> Chad M. Wittrock (Chad.Wittrock@uni.edu)
>> Senior Programmer Analyst
>> University of Northern Iowa
>> (319) 273-7437
>>
>>
>


Re: Remote stylesheet in adf-faces-skins.xml

Posted by Adam Winer <aw...@gmail.com>.
On 2/6/07, Chad Wittrock <Ch...@uni.edu> wrote:
> OK, I guess I could have asked this a little better. I have actually
> tried the example listed below and it does not work. Faces looks for the
> file within the current application and treats the absolute URL as a
> relative URL within the application.
>
> Does anyone have any suggestions on how to make it work or is this a
> lost cause?

I'm sure it's going to require a patch.  We'd be happy to
get one.  Jeanne could, I'm sure, give you a pointer
to the right bit of code to look at.

-- Adam

>
> Thanks,
> Chad
>
> On Tue, 2007-02-06 at 10:52 -0800, Jeanne Waldman wrote:
> > I don't know. You can try it and let us know if it works. :)
> >
> > Chad Wittrock wrote:
> > > Is it possible to specify a remote stylesheet in adf-faces-skins.xml or
> > > does the stylesheet have to be local to your project?
> > >
> > > Example:
> > > <?xml version="1.0" encoding="ISO-8859-1"?>
> > >
> > > <skins xmlns="http://xmlns.oracle.com/adf/view/faces/skin">
> > >     <skin>
> > >         <id>uni.desktop</id>
> > >         <family>uni</family>
> > >         <render-kit-id>oracle.adf.desktop</render-kit-id>
> > > <style-sheet-name>http://myServer/skins/uni/uniSkin.css</style-sheet-name>
> > >     </skin>
> > > </skins>
> > >
> >
> --
> --------------------------------------------------------------------
> Chad M. Wittrock (Chad.Wittrock@uni.edu)
> Senior Programmer Analyst
> University of Northern Iowa
> (319) 273-7437
>
>

Re: Remote stylesheet in adf-faces-skins.xml

Posted by Chad Wittrock <Ch...@uni.edu>.
OK, I guess I could have asked this a little better. I have actually
tried the example listed below and it does not work. Faces looks for the
file within the current application and treats the absolute URL as a
relative URL within the application.

Does anyone have any suggestions on how to make it work or is this a
lost cause?

Thanks,
Chad

On Tue, 2007-02-06 at 10:52 -0800, Jeanne Waldman wrote:
> I don't know. You can try it and let us know if it works. :)
> 
> Chad Wittrock wrote:
> > Is it possible to specify a remote stylesheet in adf-faces-skins.xml or
> > does the stylesheet have to be local to your project?
> >
> > Example:
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > <skins xmlns="http://xmlns.oracle.com/adf/view/faces/skin">
> >     <skin>
> >         <id>uni.desktop</id>
> >         <family>uni</family>
> >         <render-kit-id>oracle.adf.desktop</render-kit-id>
> > <style-sheet-name>http://myServer/skins/uni/uniSkin.css</style-sheet-name>
> >     </skin>
> > </skins>
> >   
> 
-- 
--------------------------------------------------------------------
Chad M. Wittrock (Chad.Wittrock@uni.edu)
Senior Programmer Analyst
University of Northern Iowa
(319) 273-7437


Re: Remote stylesheet in adf-faces-skins.xml

Posted by Jeanne Waldman <je...@oracle.com>.
I don't know. You can try it and let us know if it works. :)

Chad Wittrock wrote:
> Is it possible to specify a remote stylesheet in adf-faces-skins.xml or
> does the stylesheet have to be local to your project?
>
> Example:
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <skins xmlns="http://xmlns.oracle.com/adf/view/faces/skin">
>     <skin>
>         <id>uni.desktop</id>
>         <family>uni</family>
>         <render-kit-id>oracle.adf.desktop</render-kit-id>
> <style-sheet-name>http://myServer/skins/uni/uniSkin.css</style-sheet-name>
>     </skin>
> </skins>
>