I haven't posted here in a while, but I just wanted to share my impression of the service you get at Apple Stores - well, at least the one in Scotland ;-)
ABSOLUTELY FANTASTIC!
I took my MacBook in for repair at 11am (and was seen before my appointment at 11:20). They quickly tested the laptop and confirmed my diagnosis - totally screwed videocard. They waived any cost for repairing it, despite it being 2 months out of warranty.
They had the part and the repair facility instore so I paid for the express option, and about 3 hours later I got a phone call saying it was fixed and ready to pick up, with a replaced system board. And they even gave the whole machine a clean :-)
So, two trips to Glasgow later, I'm back with a fixed machine.
Monday, 3 November 2008
Friday, 7 September 2007
Storing your messages in a database
I just wrote about using a database to store your message bundle.
This was on the new Hibernate/Seam blog based on Seam's wiki - and it was lovely to use - nice wiki markup language, and the interactive preview is very cool and useful!
Thanks Christian, you've done a superb job (you can even resize the textedit area) - now I just want smiley support ;)
This was on the new Hibernate/Seam blog based on Seam's wiki - and it was lovely to use - nice wiki markup language, and the interactive preview is very cool and useful!
Thanks Christian, you've done a superb job (you can even resize the textedit area) - now I just want smiley support ;)
Monday, 25 June 2007
Porting the Seam JSF controls to A4J's CDK
Why?
First, some background - as I wrote back in March:
One of the big issues currently is that it needs soooo much wiring - to write a tag you write the component class, add it to faces-config.xml (with all its properties), add it to your.taglib.xml, write a Tag class (with all it's properties) and add it to your tld (with all its properties),. You then have to write your state saving manually, and make each property read both a static and EL resolvable variable.
Most component sets use some sort of code generation (e.g. the Trinidad build plugin, the Ajax4jsf CDK) - given that Ajax4jsf is now part of the JBoss.org stable, the Ajax4jsf CDK was an obvious choice.
What?
It gives you:
faces-config.xmltaglib.xml(for facelets)- the tld and all Tag files for JSP
- allows you to declare stub JavaBean methods on
UIComponents (generating the EL lookup code and a state saving implementation as necessary) - supports JSF
Validators andConverters (with stub methods) - allows you to build renderers from templates, rather than programmatically
All you have to is write one, simple, xml configuration file, the abstract
UIComponent, and the declarative renderer if needed!How?
The CDK documentation is still being worked up, but in the meantime the wiki page talks you through getting a CDK project setup. I'm going to talk about building the Seam UI using the CDK, so its probably a good idea to grab Seam from CVS or a recent nightly, and follow along :)
I used the maven archetype to setup the
ui directory, and generated a sample component with it. We did extensive hacking on the pom to get it running nicely in Seam, I suggest you go with the generated one!I'm going to walk through the
<s:selectDate /> control here, and use it to illustrate how you would go about creating your own component./ui/src/main/config/component/selectDate.xmlThe key to the whole CDK, this file allows you to specify the stub
UIComponent, the renderer to use, whether to generate the JSP/facelets tag files, and any properties your component should have.
<component>
<name>org.jboss.seam.ui.SelectDate</name>
<family>org.jboss.seam.ui.SelectDate</family>
First, we specify the component name and family, as you always do in JSF
<classname>
org.jboss.seam.ui.component.html.HtmlSelectDate
</classname>
<superclass>
org.jboss.seam.ui.component.UISelectDate
</superclass>
Let's step back for a moment here, and look at how the CDK works. One of the main problems with code generation tools is their inflexibility - the CDK gets around this by allowing you to create abstract base classes (specified using the
<superclass /> element). Any methods you declare abstract will be fleshed out (in the concrete sub class), but non-abstract methods won't be. Here we've created the abstract superclass (see below), and the CDK generates the implementation, adding in the properties specified here.<description>
<![CDATA[The Seam selectDate control is...]]>
</description>
The description elements (here, and below, on properties) get scattered liberally across the generated code, meaning that the javadoc/taglibdoc and faces-config/tld (for tooling) all have the correct comments.
<renderer generate="false">
<name>
org.jboss.seam.ui.SelectDateRenderer
</name>
<classname>
org.jboss.seam.ui.renderkit.SelectDateRendererBase
</classname>
</renderer>
We then specify the renderer (for now we aren't using the template-based renderers, as they depend on ajax4jsf at runtime - a dependency we didn't want to put into Seam - we are working to fix this!) - again, we have the name, as used in JSF. You'll notice we've specified
generate="false" on the <renderer> - this tells the CDK not to generate a renderer - and it knows which one to use through the <classname>. You can use generate="false" on <component>, <renderer>, and <tag> to achieve the same effect.<tag>
<name>selectDate</name>
<classname>
org.jboss.seam.ui.taglib.SelectDateTag
</classname>
<superclass>
org.jboss.seam.ui.util.cdk.UIComponentTagBase
</superclass>
</tag>
Then the tag - we tell it the tag name (what you write on the page), the JSP tag class to use (remember, this is generated), and the (standard) base class to use - the one that the CDK suggests is appropriate. To avoid the runtime dependency on ajax4jsf, we're using a slightly different base class for Seam UI.
ui_component_attributes;
&html_style_attributes;
<property transient="true">
<name>endYear</name>
<classname>int</classname>
<description></description>
<defaultvalue>-1</defaultvalue>
</property>
Finally, we tell the CDK what properties this component has (this allows it to fill in the getters/setters with EL lookups, provide state saving, put comments in the right place...). The CDK has a number of built-in lists of standard properties (e.g.
&html_style_attributes; contains properties for both style and styleClass). Here we use transient="true", which tells the CDK not to generate state saving code for this property - other useful attributes are el="false" - disable EL for this property - and elonly="true" - only only allow EL for this property./ui/src/main/java/org.jboss.seam.ui.component.UISelectDatepublic abstract class UISelectDate
extends UIComponentBase {
public abstract int getEndYear();
public abstract void setEndYear(int endYear);
...
}
I've truncated the class, but you get the idea - we put in abstract methods for the properties we need to access in code (i.e. the renderer), otherwise, the CDK will generate the methods for you.
/ui/src/main/java/org.jboss.seam.ui.renderkit.SelectDateRendererBasepublic class SelectDateRendererBase
extends RendererBase {
protected void doEncodeBegin(
ResponseWriter writer,
FacesContext context,
UIComponent component)
throws IOException {
Again, this is a very truncated version of the class - but the rest is standard. Note that we are using
doEncodeBegin (which has doEncodeEnd, doEncodeChildren counterparts), rather than encodeBegin - firstly this passes in the ResponseWriter as an argument, saving you a line of code, and, more importantly, the method is only called if rendered="true" (n.b. super.encodeBegin() always gets called).Where? When
You then run
mvn install (which Seam wraps up in an ant target), and you've got your generated component!Well, that completes the tour of the CDK for now - I'll try to blog about declarative renderers when we add that in.
Wednesday, 13 June 2007
Seam 1.3 ALPHA
We just released a new version of Seam - oops, that took a while! I wanted to highlight what I think are the best bits:
- JBoss-el and JBoss AS 4.2.0.GA - we've swapped out the old EL enhancements (which were essentially a hack on the existing RI) for the new JBoss EL, which also supports parameterised value bindings and projection. Also, we've upgraded Seam to JSF 1.2 RI, as we now have a GA version of JBoss AS which supports it ootb
- Groovy support - with the new annotation support in Groovy you can write Seam components in groovy, compile them using
groovycand use them in your project. We've gone one step further and allowed you just copy your .groovy into your deployed project and have them hotdeployed. - An example showing Trinidad, Ajax4jsf, RichFaces and Seam working well together
- An initial release of the wiki written using Seam - it's not finished, but it's already the nicest wiki I've used - amazingly customisable, lots of neat AJAX effects...
- Charting support
- A whole host of dispatchers - so now you can schedule asynchronous methods using something other than the EJB3 timer
- And finally, loads and loads of bugfixes (we closed over 180 issues in this release!)
Monday, 11 June 2007
Chile highlights (part 2)
See also part 1.
| Next morning we got up at 4am to see the impressive El Tatio geysers at sunrise, and bathe in the thermal pools there | |
| In the afternoon we visited the Salar de Atacama, and saw the flamingos feeding and flying | |
| and a gorgeous sunset. | |
| Next morning I started my 4 day tour of the Salar de Uyuni and the Bolivian altiplano in the southwest of Bolivia. The first day consisted of crossing into Bolivia, and a long jeep trip to Uyuni, where, the following day, I started the 2.5 day to San Pedro de Atacama. First stop was a the train cemetery, where the Bolivians have been parking their old trains for years. | |
| The Salar de Uyuni, a massive salt flat, was very smooth, and looked just like a frozen lake. | |
| It allowed for some pretty impressive perspective photos too ;) | |
| The Bolivian altiplano was stunning, full of multi-coloured volcanoes and frozen lakes | |
![]() | |
| We got up at 5am on the last morning to visit some geysers, followed by a visit to a thermal pool, which, once you were in, was very warm. To be able to sit back and watch the sun rise over a frozen lake framed by volcanoes was unique! | |
| After the cold of the Bolivian altiplano, returning to San Pedro was bliss! | |
| That night, I caught the bus to Arica, about 10 hours north. Having spent a couple of days lazing on the beach, Kathryn and I, on my last day, did a tour to the spectacular Parque Nacional Lauca. Here we are starting our ascent, looking back at the receding coastal fog | |
![]() | |
| Common to the whole of northern Chile are the wild Vicuña (in the picture), and their domesticated relatives the Llama. | |
| Vizcacha are around the size of a rabbit, but part of the chinchilla family. | |
| The volcanoes Pomerape and Parinacota dominated the view for much of the day | |
Chile holiday (part 1)
I very quickly got bored with blogging about my trip whilst I was a way, so here's a retrospective instead :) You can see all the photos or just the highlights.
| We started off in Pucon, on the shores of Lago Villarica | |
from where we did a day trip to Lago Carburga. | |
| From there we moved on to Valdivia, a centre of German immigration to Chile | |
| and then to Chiloe, a fair sized island, a small distance off the cost. All in all the south of Chile at in their autumn is a rainy place, so we quickly abandoned it for the sunny, dry northern parts! | |
| Valparaiso was our next stop. Valparaiso is a coastal city, close to Santiago - it has a narrow flat section by the water, and quick rises up on steep hills on which there are cable cars to get up and down. | |
| The city was a riot of colour and probably my favourite town/city in Chile. I did an afternoon trip to the nearby beach town of Concon, where I saw Pelicans (which made my day, probably because of the this was my favourite Roald Dahlbook). | |
| Our next stop was La Serana - we didn't spend much time in the town, but quickly headed up the Pisco Elqui valley, and made a night trip to the Mamalluca observatory, where we got a superb introduction to astronomy, and to look through a variety of telescopes to see the moon, Jupiter, the rings of Saturn, nebulae and galaxies. | |
| The next day we went to the Humboldt Penguin reserve, where we saw a pod of around 80 dolphins | |
| a large colony of sea lions, with their pups, | |
| and, of course, the penguins. | |
| From La Serena we went to the Parque Nacional Pan de Azucar, via the desert town of Chanaral, and impressively uninviting place! | |
| However camping by this deserted and spectacular beach, going to sleep with the sound of the Pacific Ocean breaking just metres away made up for all of that! | |
| Next stop on our journey north was San Pedro de Atacama, where we visited the Valle de la Muertes (The Valley of Death) - the locals misheard Valle de la Martes (Valley of Mars)!; | |
| followed by a visit to see the sunset over the Salar de Atacama, and the Valle de la Luna |
Friday, 18 May 2007
Chile - Santiago to Pucon
We took off from Heathrow on Monday evening, changing flights in Madrid and landing in Chile at about 8am. As we were coming over the Andes we encountered some turbulence - some people ended up hitting the cabin roof!
Santiago was an odd place, a mix of European shopping streets and a stinky river. The highlight was the fish market
, where we had a "pailla marisco" - a seafood soup.
We caught the overnight bus to Pucon - a pretty upmarket town catering to adventure sports. We caught a bus up to a nearby lake (Lago Carburgar), with deserted beaches (it's late autumn here) and came back via Los Ojos de Carburga - a pretty impressive series of waterfalls and deep pools.
Subscribe to:
Posts (Atom)


