You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-dev@incubator.apache.org by Si...@DMR.CA on 2006/08/11 18:58:18 UTC
[Proposal] Remove bad usage of assert
Hello,
While converting Trinidad to Java 5, I found two places where assert is
used in what I consider a bad way, here's one example of such case:
public void setCurrentRowSpan(int rowSpan)
{
boolean assertEnabled = false;
assert assertEnabled = true;
if (rowSpan < 0)
{
// preform a reset
_currRowSpan = 1;
_currSpanRow = 0;
if (assertEnabled)
{
// make sure prev operation was get:
assert (_currentRowSpanState == 2);
_currentRowSpanState = 0; // indicate that we have reset the
rowspan
}
}
else
{
if (rowSpan > _currRowSpan)
_currRowSpan = rowSpan;
if (assertEnabled)
{
// make sure that the previous operation was a set or reset:
assert (_currentRowSpanState <= 1);
// indicate that we have set the rowSpan:
_currentRowSpanState = 1;
}
}
}
The lines I dislike are assert assertEnabled = true; folowed by the 'if'
later. This kind of usage, althoguh it emulates #ifdef __DEBUG is not
really as clean. The goal of assert is to have no performance overhaul
when disabled. However, with the above example, even when disabled, the
assert will still add one variable on the stack and evaluate an additional
'if'. So my suggestion is to completely remove such kind of code (only 2
places) and forbid it as a coding convention.
Regards,
Simon Lessard
Fujitsu Consulting
Re: ADFFACES-85
Posted by Si...@DMR.CA.
Sure!
Simon Lessard
Fujitsu Consulting
"Adam Winer" <aw...@gmail.com>
2006-08-14 12:05
Please respond to adffaces-dev
To: adffaces-dev@incubator.apache.org
cc:
Subject: Re: ADFFACES-85
Ah, looks like it is done. Could you do two things?
- Close the issue with this solution
- Start a skinning how-to Wiki page, also including this solution?
Thanks!
This reminds me: I need to check internally (at Oracle) whether some
of the other ideas we had for changing up output to improve
skinnability (esp. of the input components) made it in to the
Trinidad codebase or not, and if not see about getting some proposals
brought forward for them.
-- Adam Winer
On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> Hello,
>
> I retested this issue using latest build, and the behavior is different
> from old ADF Faces. Basically you can add input field spacing using
> something like the following
>
> af|panelFormLayout::label-cell
> {
> padding-top: 10px;
> vertical-align: top;
> }
>
> af|panelFormLayout::content-cell
> {
> padding-top: 8px;
> }
>
> Should the issue be closed, or a new selector for rows inside panel form
> would still be desirable?
>
>
> Regards,
>
> Simon Lessard
> Fujitsu Consulting
>
Re: ADFFACES-85
Posted by Adam Winer <aw...@gmail.com>.
Ah, looks like it is done. Could you do two things?
- Close the issue with this solution
- Start a skinning how-to Wiki page, also including this solution?
Thanks!
This reminds me: I need to check internally (at Oracle) whether some
of the other ideas we had for changing up output to improve
skinnability (esp. of the input components) made it in to the
Trinidad codebase or not, and if not see about getting some proposals
brought forward for them.
-- Adam Winer
On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> Hello,
>
> I retested this issue using latest build, and the behavior is different
> from old ADF Faces. Basically you can add input field spacing using
> something like the following
>
> af|panelFormLayout::label-cell
> {
> padding-top: 10px;
> vertical-align: top;
> }
>
> af|panelFormLayout::content-cell
> {
> padding-top: 8px;
> }
>
> Should the issue be closed, or a new selector for rows inside panel form
> would still be desirable?
>
>
> Regards,
>
> Simon Lessard
> Fujitsu Consulting
>
ADFFACES-85
Posted by Si...@DMR.CA.
Hello,
I retested this issue using latest build, and the behavior is different
from old ADF Faces. Basically you can add input field spacing using
something like the following
af|panelFormLayout::label-cell
{
padding-top: 10px;
vertical-align: top;
}
af|panelFormLayout::content-cell
{
padding-top: 8px;
}
Should the issue be closed, or a new selector for rows inside panel form
would still be desirable?
Regards,
Simon Lessard
Fujitsu Consulting
Re: [Issue] Compilation error as of 2006-08-14 8h29 a.m. EST
Posted by Si...@DMR.CA.
Hmmmm,
I actually did an update this morning before trying to compile. I'm dumb,
but not that much... yet. Continuum also flag a compilation error btw. My
teammate also have the compilation error. I already patched my local
version using two replace all in files though.
Regards,
Simon Lessard
Fujitsu Consulting
"Craig McClanahan" <cr...@apache.org>
Sent by: craigmcc@gmail.com
2006-08-14 10:51
Please respond to adffaces-dev
To: adffaces-dev@incubator.apache.org
cc:
Subject: Re: [Issue] Compilation error as of 2006-08-14
8h29 a.m. EST
On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
>
> Hello,
>
> Compilation of current Trinidad version fails because of tearDown and
> setUp method overriding. Should I look into it or another patch for test
> classes is already on the way?
I checked in a patch for this on Saturday, and it compiles for me. You'll
need the latest source code to deal with this.
Regards,
>
> Simon Lessard
> Fujitsu Consulting
>
Craig
Re: Re: [Issue] Compilation error as of 2006-08-14 8h29 a.m. EST
Posted by Matthias Wessendorf <ma...@apache.org>.
yeah,
I am not sure why you have to do that. In my old company we had
lot's of issues with that (maven1). So, if something *should* be different...
I kill something in the repo ...
On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> Killing shale directory did the trick for me.
>
>
> Thanks,
>
> Simon Lessard
> Fujitsu Consulting
>
>
>
>
>
> "Matthias Wessendorf" <ma...@apache.org>
> Sent by: mwessendorf@gmail.com
> 2006-08-14 15:22
> Please respond to adffaces-dev
>
> To: adffaces-dev@incubator.apache.org
> cc:
> Subject: Re: Re: [Issue] Compilation error as of 2006-08-14
> 8h29 a.m. EST
>
>
> It worked for me.
>
> kill your org.apache.shale folder in the m2_repo
>
> the correct JAR is public
>
>
> On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> > On 8/14/06, Adam Winer <aw...@gmail.com> wrote:
> > >
> > > Is the latest Shale code out on the snapshot repository?
> >
> >
> > Yes, in the Apache snapshot repository (version 1.0.3-SNAPSHOT is
> updated by
> > the nightly builds).
> >
> > -- Adam
> >
> >
> > Craig
> >
> > On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> > > > On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> > > > >
> > > > > Hello,
> > > > >
> > > > > Compilation of current Trinidad version fails because of tearDown
> and
> > > > > setUp method overriding. Should I look into it or another patch
> for
> > > test
> > > > > classes is already on the way?
> > > >
> > > >
> > > > I checked in a patch for this on Saturday, and it compiles for
> > > me. You'll
> > > > need the latest source code to deal with this.
> > > >
> > > > Regards,
> > > > >
> > > > > Simon Lessard
> > > > > Fujitsu Consulting
> > > > >
> > > >
> > > >
> > > > Craig
> > > >
> > > >
> > >
> >
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>
>
>
--
Matthias Wessendorf
further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com
Re: Re: [Issue] Compilation error as of 2006-08-14 8h29 a.m. EST
Posted by Adam Winer <aw...@gmail.com>.
My understanding is that:
- Maven 1 checked for newer versions of snapshots every build.
- Maven 2 checks, by default, once a day, but can be forced
to check explicitly (I don't know how, though).
There's a -U option on Maven 2 to forcibly download new
versions, but that applies to *everything* not just snapshots,
so you'll download new versions of any plugin or report you use,
etc., which can be destabilizing.
-- Adam
On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
>
> On 8/14/06, Matthias Wessendorf <ma...@apache.org> wrote:
> >
> > It worked for me.
> >
> > kill your org.apache.shale folder in the m2_repo
> >
> > the correct JAR is public
>
>
> Hmm ... does that not imply that Maven's "timestamp based" checks for
> downloading later snapshots is not working? The JAR in question is still
> "
> 1.0.3-SNAPSHOT" but I understood Maven treated snapshots specially and
> checked for updates automatically.
>
> Craig
>
> On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> > > On 8/14/06, Adam Winer <aw...@gmail.com> wrote:
> > > >
> > > > Is the latest Shale code out on the snapshot repository?
> > >
> > >
> > > Yes, in the Apache snapshot repository (version 1.0.3-SNAPSHOT is
> > updated by
> > > the nightly builds).
> > >
> > > -- Adam
> > >
> > >
> > > Craig
> > >
> > > On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> > > > > On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> > > > > >
> > > > > > Hello,
> > > > > >
> > > > > > Compilation of current Trinidad version fails because of
> tearDown
> > and
> > > > > > setUp method overriding. Should I look into it or another patch
> > for
> > > > test
> > > > > > classes is already on the way?
> > > > >
> > > > >
> > > > > I checked in a patch for this on Saturday, and it compiles for
> > > > me. You'll
> > > > > need the latest source code to deal with this.
> > > > >
> > > > > Regards,
> > > > > >
> > > > > > Simon Lessard
> > > > > > Fujitsu Consulting
> > > > > >
> > > > >
> > > > >
> > > > > Craig
> > > > >
> > > > >
> > > >
> > >
> > >
> >
> >
> > --
> > Matthias Wessendorf
> >
> > further stuff:
> > blog: http://jroller.com/page/mwessendorf
> > mail: mwessendorf-at-gmail-dot-com
> >
>
>
Re: Re: [Issue] Compilation error as of 2006-08-14 8h29 a.m. EST
Posted by Craig McClanahan <cr...@apache.org>.
On 8/14/06, Matthias Wessendorf <ma...@apache.org> wrote:
>
> It worked for me.
>
> kill your org.apache.shale folder in the m2_repo
>
> the correct JAR is public
Hmm ... does that not imply that Maven's "timestamp based" checks for
downloading later snapshots is not working? The JAR in question is still "
1.0.3-SNAPSHOT" but I understood Maven treated snapshots specially and
checked for updates automatically.
Craig
On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> > On 8/14/06, Adam Winer <aw...@gmail.com> wrote:
> > >
> > > Is the latest Shale code out on the snapshot repository?
> >
> >
> > Yes, in the Apache snapshot repository (version 1.0.3-SNAPSHOT is
> updated by
> > the nightly builds).
> >
> > -- Adam
> >
> >
> > Craig
> >
> > On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> > > > On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> > > > >
> > > > > Hello,
> > > > >
> > > > > Compilation of current Trinidad version fails because of tearDown
> and
> > > > > setUp method overriding. Should I look into it or another patch
> for
> > > test
> > > > > classes is already on the way?
> > > >
> > > >
> > > > I checked in a patch for this on Saturday, and it compiles for
> > > me. You'll
> > > > need the latest source code to deal with this.
> > > >
> > > > Regards,
> > > > >
> > > > > Simon Lessard
> > > > > Fujitsu Consulting
> > > > >
> > > >
> > > >
> > > > Craig
> > > >
> > > >
> > >
> >
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>
Re: Re: [Issue] Compilation error as of 2006-08-14 8h29 a.m. EST
Posted by Si...@DMR.CA.
Killing shale directory did the trick for me.
Thanks,
Simon Lessard
Fujitsu Consulting
"Matthias Wessendorf" <ma...@apache.org>
Sent by: mwessendorf@gmail.com
2006-08-14 15:22
Please respond to adffaces-dev
To: adffaces-dev@incubator.apache.org
cc:
Subject: Re: Re: [Issue] Compilation error as of 2006-08-14
8h29 a.m. EST
It worked for me.
kill your org.apache.shale folder in the m2_repo
the correct JAR is public
On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> On 8/14/06, Adam Winer <aw...@gmail.com> wrote:
> >
> > Is the latest Shale code out on the snapshot repository?
>
>
> Yes, in the Apache snapshot repository (version 1.0.3-SNAPSHOT is
updated by
> the nightly builds).
>
> -- Adam
>
>
> Craig
>
> On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> > > On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> > > >
> > > > Hello,
> > > >
> > > > Compilation of current Trinidad version fails because of tearDown
and
> > > > setUp method overriding. Should I look into it or another patch
for
> > test
> > > > classes is already on the way?
> > >
> > >
> > > I checked in a patch for this on Saturday, and it compiles for
> > me. You'll
> > > need the latest source code to deal with this.
> > >
> > > Regards,
> > > >
> > > > Simon Lessard
> > > > Fujitsu Consulting
> > > >
> > >
> > >
> > > Craig
> > >
> > >
> >
>
>
--
Matthias Wessendorf
further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com
Re: Re: [Issue] Compilation error as of 2006-08-14 8h29 a.m. EST
Posted by Matthias Wessendorf <ma...@apache.org>.
It worked for me.
kill your org.apache.shale folder in the m2_repo
the correct JAR is public
On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> On 8/14/06, Adam Winer <aw...@gmail.com> wrote:
> >
> > Is the latest Shale code out on the snapshot repository?
>
>
> Yes, in the Apache snapshot repository (version 1.0.3-SNAPSHOT is updated by
> the nightly builds).
>
> -- Adam
>
>
> Craig
>
> On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> > > On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> > > >
> > > > Hello,
> > > >
> > > > Compilation of current Trinidad version fails because of tearDown and
> > > > setUp method overriding. Should I look into it or another patch for
> > test
> > > > classes is already on the way?
> > >
> > >
> > > I checked in a patch for this on Saturday, and it compiles for
> > me. You'll
> > > need the latest source code to deal with this.
> > >
> > > Regards,
> > > >
> > > > Simon Lessard
> > > > Fujitsu Consulting
> > > >
> > >
> > >
> > > Craig
> > >
> > >
> >
>
>
--
Matthias Wessendorf
further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com
Re: Re: [Issue] Compilation error as of 2006-08-14 8h29 a.m. EST
Posted by Craig McClanahan <cr...@apache.org>.
On 8/14/06, Adam Winer <aw...@gmail.com> wrote:
>
> Is the latest Shale code out on the snapshot repository?
Yes, in the Apache snapshot repository (version 1.0.3-SNAPSHOT is updated by
the nightly builds).
-- Adam
Craig
On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> > On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> > >
> > > Hello,
> > >
> > > Compilation of current Trinidad version fails because of tearDown and
> > > setUp method overriding. Should I look into it or another patch for
> test
> > > classes is already on the way?
> >
> >
> > I checked in a patch for this on Saturday, and it compiles for
> me. You'll
> > need the latest source code to deal with this.
> >
> > Regards,
> > >
> > > Simon Lessard
> > > Fujitsu Consulting
> > >
> >
> >
> > Craig
> >
> >
>
Re: Re: [Issue] Compilation error as of 2006-08-14 8h29 a.m. EST
Posted by Adam Winer <aw...@gmail.com>.
Is the latest Shale code out on the snapshot repository?
-- Adam
On 8/14/06, Craig McClanahan <cr...@apache.org> wrote:
> On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> >
> > Hello,
> >
> > Compilation of current Trinidad version fails because of tearDown and
> > setUp method overriding. Should I look into it or another patch for test
> > classes is already on the way?
>
>
> I checked in a patch for this on Saturday, and it compiles for me. You'll
> need the latest source code to deal with this.
>
> Regards,
> >
> > Simon Lessard
> > Fujitsu Consulting
> >
>
>
> Craig
>
>
Re: [Issue] Compilation error as of 2006-08-14 8h29 a.m. EST
Posted by Craig McClanahan <cr...@apache.org>.
On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
>
> Hello,
>
> Compilation of current Trinidad version fails because of tearDown and
> setUp method overriding. Should I look into it or another patch for test
> classes is already on the way?
I checked in a patch for this on Saturday, and it compiles for me. You'll
need the latest source code to deal with this.
Regards,
>
> Simon Lessard
> Fujitsu Consulting
>
Craig
Re: [Proposal] Skin: Convert url values to context relative path
only when enclosed in url( )
Posted by Jeanne Waldman <je...@oracle.com>.
+1 to Convert url(); anything other than than this syntax gets dropped
and logged with a warning
Adam Winer wrote:
> The spec - http://www.w3.org/TR/CSS21/syndata.html#value-def-uri -
> seems clear that url() is required (though quotes are not required).
> I'd favor an option #3:
> - Convert url(); anything other than than this syntax gets dropped
> and logged with a warning
>
> But we should talk about the manner of URL conversion here; IMO,
> the rules should be:
>
> - URLs beginning with a slash get prefixed with the context root
> (like other such URLs in JSF)
> - URLs beginning with two slashes get trimmed to a single slash
> (special Trinidad URL rule, already used in Trinidad components)
> - Relative URLs get interpreted as relative to the original .css file,
> and converted so that they are still valid references to the
> desired file.
> - Other URLs (e.g., URLs with server names) are left alone.
>
> So, if the context path is MyApp, and the skin is
> at MyApp/skins/mySkin/skin.css
>
> url('http://foo/my.gif') -> http://foo/my.gif
> url('/my.gif') -> /MyApp/my.gif
> url('//images/my.gif') -> /images/my.gif
> url('images/my.gif') -> /MyApp/skins/mySkin/images/my.gif
> url('../../images/my.gif') -> /MyApp/images/my.gif
>
> -- Adam
>
>
>
> On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
>
>> Hello all,
>>
>> I provided a patch for ADFFACES-121. However, I'm not totally satisfied
>> with it.
>>
>> Before the patch, the code was only converting the urls of
>> background-image property when placed inside url( ). My patch
>> converts all
>> values inside url( ) as well as background-image property value when not
>> placed inside url( ). For instance:
>>
>> Skin:
>>
>> background: url('images/myGif.gif');
>> background: images/myGif.gif;
>> background-image: url('images/myGif.gif');
>> background-image: images/myGif.gif;
>>
>>
>> Result with "MyApp" context root:
>>
>> background: url('/MyApp/skins/mySkin/images/myGif.gif');
>> background: images/myGif.gif;
>> background-image: url('/MyApp/skins/mySkin/images/myGif.gif');
>> background-image: /MyApp/skins/mySkin/images/myGif.gif;
>>
>>
>> It's a kind of inconsistency that could mix the user I think. I
>> therefore
>> see two possibilities:
>> 1. Convert only but all values specified inside url( ), leaving others
>> unchanged.
>> 2. Make sure the hard coded list of property names allowing property
>> values is exhaustive and document it accordingly.
>>
>>
>> Which one would be better? My vote goes to 1. since it will be easier to
>> document and maintain.
>>
>>
>> Regards,
>>
>> Simon Lessard
>> Fujitsu Consulting
>>
>
Re: [Proposal] Skin: Convert url values to context relative path only when
enclosed in url( )
Posted by Si...@DMR.CA.
+1 for option #3. I also like the 4 rules, so +1 for those as well.
Simon Lessard
Fujitsu Consulting
"Adam Winer" <aw...@gmail.com>
2006-08-14 12:01
Please respond to adffaces-dev
To: adffaces-dev@incubator.apache.org
cc:
Subject: Re: [Proposal] Skin: Convert url values to context
relative path only when enclosed in url( )
The spec - http://www.w3.org/TR/CSS21/syndata.html#value-def-uri -
seems clear that url() is required (though quotes are not required).
I'd favor an option #3:
- Convert url(); anything other than than this syntax gets dropped
and logged with a warning
But we should talk about the manner of URL conversion here; IMO,
the rules should be:
- URLs beginning with a slash get prefixed with the context root
(like other such URLs in JSF)
- URLs beginning with two slashes get trimmed to a single slash
(special Trinidad URL rule, already used in Trinidad components)
- Relative URLs get interpreted as relative to the original .css file,
and converted so that they are still valid references to the
desired file.
- Other URLs (e.g., URLs with server names) are left alone.
So, if the context path is MyApp, and the skin is
at MyApp/skins/mySkin/skin.css
url('http://foo/my.gif') -> http://foo/my.gif
url('/my.gif') -> /MyApp/my.gif
url('//images/my.gif') -> /images/my.gif
url('images/my.gif') -> /MyApp/skins/mySkin/images/my.gif
url('../../images/my.gif') -> /MyApp/images/my.gif
-- Adam
On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> Hello all,
>
> I provided a patch for ADFFACES-121. However, I'm not totally satisfied
> with it.
>
> Before the patch, the code was only converting the urls of
> background-image property when placed inside url( ). My patch converts
all
> values inside url( ) as well as background-image property value when not
> placed inside url( ). For instance:
>
> Skin:
>
> background: url('images/myGif.gif');
> background: images/myGif.gif;
> background-image: url('images/myGif.gif');
> background-image: images/myGif.gif;
>
>
> Result with "MyApp" context root:
>
> background: url('/MyApp/skins/mySkin/images/myGif.gif');
> background: images/myGif.gif;
> background-image: url('/MyApp/skins/mySkin/images/myGif.gif');
> background-image: /MyApp/skins/mySkin/images/myGif.gif;
>
>
> It's a kind of inconsistency that could mix the user I think. I
therefore
> see two possibilities:
> 1. Convert only but all values specified inside url( ), leaving others
> unchanged.
> 2. Make sure the hard coded list of property names allowing property
> values is exhaustive and document it accordingly.
>
>
> Which one would be better? My vote goes to 1. since it will be easier to
> document and maintain.
>
>
> Regards,
>
> Simon Lessard
> Fujitsu Consulting
>
Re: [Proposal] Skin: Convert url values to context relative path only when enclosed in url( )
Posted by Adam Winer <aw...@gmail.com>.
The spec - http://www.w3.org/TR/CSS21/syndata.html#value-def-uri -
seems clear that url() is required (though quotes are not required).
I'd favor an option #3:
- Convert url(); anything other than than this syntax gets dropped
and logged with a warning
But we should talk about the manner of URL conversion here; IMO,
the rules should be:
- URLs beginning with a slash get prefixed with the context root
(like other such URLs in JSF)
- URLs beginning with two slashes get trimmed to a single slash
(special Trinidad URL rule, already used in Trinidad components)
- Relative URLs get interpreted as relative to the original .css file,
and converted so that they are still valid references to the
desired file.
- Other URLs (e.g., URLs with server names) are left alone.
So, if the context path is MyApp, and the skin is
at MyApp/skins/mySkin/skin.css
url('http://foo/my.gif') -> http://foo/my.gif
url('/my.gif') -> /MyApp/my.gif
url('//images/my.gif') -> /images/my.gif
url('images/my.gif') -> /MyApp/skins/mySkin/images/my.gif
url('../../images/my.gif') -> /MyApp/images/my.gif
-- Adam
On 8/14/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> Hello all,
>
> I provided a patch for ADFFACES-121. However, I'm not totally satisfied
> with it.
>
> Before the patch, the code was only converting the urls of
> background-image property when placed inside url( ). My patch converts all
> values inside url( ) as well as background-image property value when not
> placed inside url( ). For instance:
>
> Skin:
>
> background: url('images/myGif.gif');
> background: images/myGif.gif;
> background-image: url('images/myGif.gif');
> background-image: images/myGif.gif;
>
>
> Result with "MyApp" context root:
>
> background: url('/MyApp/skins/mySkin/images/myGif.gif');
> background: images/myGif.gif;
> background-image: url('/MyApp/skins/mySkin/images/myGif.gif');
> background-image: /MyApp/skins/mySkin/images/myGif.gif;
>
>
> It's a kind of inconsistency that could mix the user I think. I therefore
> see two possibilities:
> 1. Convert only but all values specified inside url( ), leaving others
> unchanged.
> 2. Make sure the hard coded list of property names allowing property
> values is exhaustive and document it accordingly.
>
>
> Which one would be better? My vote goes to 1. since it will be easier to
> document and maintain.
>
>
> Regards,
>
> Simon Lessard
> Fujitsu Consulting
>
[Proposal] Skin: Convert url values to context relative path only when
enclosed in url( )
Posted by Si...@DMR.CA.
Hello all,
I provided a patch for ADFFACES-121. However, I'm not totally satisfied
with it.
Before the patch, the code was only converting the urls of
background-image property when placed inside url( ). My patch converts all
values inside url( ) as well as background-image property value when not
placed inside url( ). For instance:
Skin:
background: url('images/myGif.gif');
background: images/myGif.gif;
background-image: url('images/myGif.gif');
background-image: images/myGif.gif;
Result with "MyApp" context root:
background: url('/MyApp/skins/mySkin/images/myGif.gif');
background: images/myGif.gif;
background-image: url('/MyApp/skins/mySkin/images/myGif.gif');
background-image: /MyApp/skins/mySkin/images/myGif.gif;
It's a kind of inconsistency that could mix the user I think. I therefore
see two possibilities:
1. Convert only but all values specified inside url( ), leaving others
unchanged.
2. Make sure the hard coded list of property names allowing property
values is exhaustive and document it accordingly.
Which one would be better? My vote goes to 1. since it will be easier to
document and maintain.
Regards,
Simon Lessard
Fujitsu Consulting
[Issue] Compilation error as of 2006-08-14 8h29 a.m. EST
Posted by Si...@DMR.CA.
Hello,
Compilation of current Trinidad version fails because of tearDown and
setUp method overriding. Should I look into it or another patch for test
classes is already on the way?
Regards,
Simon Lessard
Fujitsu Consulting
Re: [Proposal] Refactors constant interfaces
Posted by Mike Kienenberger <mk...@gmail.com>.
On 8/11/06, Adam Winer <aw...@gmail.com> wrote:
> I'm +0 on having XhtmlElements or XhtmlAttributes constants.
> I've just never felt the urge to type XhtmlElements.TABLE_DATA
> instead of just "td". String constants aren't *always* evil; for
> things that are well known and universal knowledge (like HTML
> element names) there's little gained (and much ease-of-development
> lost) in pushing the names into constants. People can use 'em if
> they want, but I'd be -1 on requiring their use.
The one benefit I'd see to using a constant is that you detect typos
at compile type rather than at some point later during runtime.
Re: [Proposal] Refactors constant interfaces
Posted by Adam Winer <aw...@gmail.com>.
A definite +1 to no more implementing of interfaces (already the
practice for XhtmlConstants, if not XhtmlLafConstants). I'd
also like to see constants that are referenced by code in
renderkit.core.xhtml moved out of XhtmlLafConstants or
UIConstants and out to XhtmlConstants. But -1 to any sort
of a wholesale move, since a lot of the stuff in UIConstants and
XhtmlLafConstants are just obsolete.
I'm +0 on having XhtmlElements or XhtmlAttributes constants.
I've just never felt the urge to type XhtmlElements.TABLE_DATA
instead of just "td". String constants aren't *always* evil; for
things that are well known and universal knowledge (like HTML
element names) there's little gained (and much ease-of-development
lost) in pushing the names into constants. People can use 'em if
they want, but I'd be -1 on requiring their use.
-1 to using the names of Trinidad component attribute names,
facets, or attribute values; these constants exist directly on the
generated components (or should), so it's unnecessary to
define extra constants. Most common JSF attribute names - like
"value" and "required" - are also unnecessary, as a cast to
ValueHolder or EditableValueHolder is usually a better approach
than using the names.
-- Adam
On 8/11/06, Simon_Lessard@dmr.ca <Si...@dmr.ca> wrote:
> Heya all,
>
> I got another possible maintenance task I would like to discuss about.
> Currently, most constants are concentrated in 2 interfaces located in ui
> package structure, namely
> org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafConstants
> and org.apache.myfaces.trinidadinternal.ui.UIConstants.
>
> Considering those package are doomed, I think it would be a nice and not
> so complicated task to start moving all the constants those two classes
> contain in a better one no longer located under those directories. Also, I
> think it would be better to use non-instanciable classes rather than
> interface so that it's impossible to implements/extends them for easy
> access to the constants. This would increase the complexity of the
> refactoring but in the end I believe it would make the code easier to
> read.
>
> Of course, this could be done in 2 different tasks, first moving the
> constants to new interfaces and make
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlConstants
> extends them to keep backward compatibility with the old structure, then
> changing interfaces to classes one by one to reduce impact.
>
> Anyway, the main question I see about it is what kind of structure should
> be used. Personally I would like to see something like:
>
> - SkinSelectors containing all and only skin selectors used by Trinidad
> (cannot of course include selectors of user made components).
> - XhtmlElements containing all valid xhtml tags.
> - XhtmlAttributes containing all valid xhtml attributes.
> - XhtmlAttributeValues containing all valid predefined attributes values
> ("middle", "left", "right", etc.)
> - JsfAttributes containing most common jsf component attributes
> ("required", "value", "title", etc.)
> - TrinidadAttributes containing most common Trinidad component attributes
> ("partialTriggers", "showRequired", "inlineStyle", etc.)
> - TrinidadFacets containing most common Trinidad component facets ("help",
> "nodeStamp", "branding", etc.)
>
>
> Regards,
>
> Simon Lessard
> Fujitsu Consulting
>
[Proposal] Refactors constant interfaces
Posted by Si...@DMR.CA.
Heya all,
I got another possible maintenance task I would like to discuss about.
Currently, most constants are concentrated in 2 interfaces located in ui
package structure, namely
org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafConstants
and org.apache.myfaces.trinidadinternal.ui.UIConstants.
Considering those package are doomed, I think it would be a nice and not
so complicated task to start moving all the constants those two classes
contain in a better one no longer located under those directories. Also, I
think it would be better to use non-instanciable classes rather than
interface so that it's impossible to implements/extends them for easy
access to the constants. This would increase the complexity of the
refactoring but in the end I believe it would make the code easier to
read.
Of course, this could be done in 2 different tasks, first moving the
constants to new interfaces and make
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlConstants
extends them to keep backward compatibility with the old structure, then
changing interfaces to classes one by one to reduce impact.
Anyway, the main question I see about it is what kind of structure should
be used. Personally I would like to see something like:
- SkinSelectors containing all and only skin selectors used by Trinidad
(cannot of course include selectors of user made components).
- XhtmlElements containing all valid xhtml tags.
- XhtmlAttributes containing all valid xhtml attributes.
- XhtmlAttributeValues containing all valid predefined attributes values
("middle", "left", "right", etc.)
- JsfAttributes containing most common jsf component attributes
("required", "value", "title", etc.)
- TrinidadAttributes containing most common Trinidad component attributes
("partialTriggers", "showRequired", "inlineStyle", etc.)
- TrinidadFacets containing most common Trinidad component facets ("help",
"nodeStamp", "branding", etc.)
Regards,
Simon Lessard
Fujitsu Consulting
[Question] LegacyValueBinding replacement
Posted by Si...@DMR.CA.
Hello,
Anyone knows what is the new class to use instead of LegacyValueBinding
and LegacyMethodBinding? Those are causing 11 of the 44 warnings I have
left in Eclipse and I would really like to get rid of them.
Thanks,
Simon Lessard
Fujitsu Consulting