englishteeth.co.uk

… the weblog of Ian “English Teeth” Robinson
  • rss
  • Home

Grails on an existing database revisited

August 20, 2008 | 12:24 pm

Some time ago I looked at what was necessary to have Grails work on an existing database rather than the green field scenario painted in most examples.

It seemed straight forward enough, but beyond curiosity, I didn’t have anything I was particularly trying to achieve, so I moved along.

Yesterday, once again messing around with grails, I found something I couldn’t seem to achieve via gorm.

Basically, I couldn’t define the column mapping for an embedded class (where instead of mapping classes onto separate tables a class can be “embedded” within the current table).

I had hoped it would be a straight forward as defining the column mappings in the embedded class definition, but unfortunately not. Any mappings appear to be ignored.

I tried in the embedding class. No. I even experimented with the embedded property, but that was a long shot I didn’t expect to work anyway.

It would seem I will have to define the mapping in the old fashioned hibernate configuration file way.

One useful thing I did find in this frustrating experiment is that the configuration setting …
dataSource {
logSql = "true"
}

… provides a more readable format than …
hibernate {
show_sql = "true"
}

Not a total loss then!

Comments
1 Comment »
Categories
development
Tags
db, gorm, grails, hibernate, sql
Comments rss Comments rss
Trackback Trackback

Scrollable tables, CSS and fetaures of IE6

August 18, 2008 | 11:05 am

I couldn’t leave this alone. A colleague was wrestling with some css to have a number scrollable tables within a larger scrolling area hold their column headers in place.

There were the plenty resources out there that nearly provided the solution, but each step had a draw back.

Did I mention that the target was IE6?

This post got us most of the way there.

Unfortunately, scrolling a table caused the header to bounce around horribly. Which through a bit of trial and error turned out to be caused by setting the background colour of the scrolling div containing the table. (Obvious! How didn’t I see that one straight off?)

Next there was the scroll bars.

overflow: scroll;

Causes both scrollbars to be always visible. Disabled if they don’t do anything,but always there.

overflow: auto;

Causes just the necessary scrollbar to show.

This was preferable for tables which were only ever going to have vertical scrolling. Unfortunately, when the table only had a couple of rows, there was a scrollbar sized gap on the right.

The fix for that…

div.scrollTableContainer table {
width: expression(offsetParent.clientWidth+"px");
}

A bit of javascript, dug up from here, to set the width to the visible width.

But these shorter tables also left blank space below them and as found before, we could not set the colour of this space without the horrible jumpy headers!

Searching around, if became apparent very quickly that css flickering in IE6 was a common problem with possible solutions.

  • No more IE6 background flicker
  • Fixing the abominable

But not quite… everything I found addressed the issues of images flickering, but although the causes of the flicker were the same, the jumping header as a side effect was not.

So, in order to have the desired colour while maintaining…

background-color: transparent;
background-repeat: repeat;

…was to add a small background gif of the desired colour.

No. Jumping headers are back! Seems that there is another IE6 bug whereby the the default background attachment is not implemented correctly.

background-image: url(colour.gif);
background-attachment: fixed;

Should handle that.

So in summary, we needed a bit of Scrolling HTML Table with Fixed Header, followed by a touch of No more IE6 background flicker and topped off with Everything you could possibly want to know about CSS Background Properties, including default values, browser support, targeting the DOM, and what to look for in CSS3.

Not much then.

Next time, I’ll mind my own business.

Comments
3 Comments »
Categories
development
Tags
css, html, java script
Comments rss Comments rss
Trackback Trackback

Selenium RC in the build

August 11, 2008 | 4:19 pm

I had to rediscover a bit of lost knowledge last Friday, namely integrating Selenium RC into a set of integration tests. Pretty straight forward really, but I thought I’d better record it for the next time I can’t remember how to start and stop the server from ant.

<project name="Selenium RC Server">

	<target name="start_selenium_rc" description="Start the Selenium RC server">
		<java
			jar="selenium-server.jar"
			fork="true" failonerror="true">
			<arg value="-Port" />
			<arg value="4440" />
			<arg value="-forcedBrowserMode" />
			<arg value="*iehta" />
		</java>
	</target>

	<target name="stop_selenium_rc" description="Stop the Selenium RC server">
		<get taskname="selenium-shutdown"
			src="http://localhost:4440/selenium-server/driver/?cmd=shutDown"
			dest="junit_report/result.txt" ignoreerrors="true" />
	</target>

</project>

The forced browser mode is IE for project constraints, but I did have an issue with *iexplore not working due to some proxy error but the experimental “elevated security privilege” browser worked fine.

Not so fine is that the goBack() command does not work in SeleniumRC with “*iehta”.

Comments
No Comments »
Categories
development
Tags
ant, java, selenium, testing
Comments rss Comments rss
Trackback Trackback

Freesat part 2

August 10, 2008 | 4:29 pm

Being the impatient sort, I ordered my BlackGold BGT3540 6in1 DVB-S tuner, even though I haven’t yet installed my satellite system. (Though I have convinced myself that it will work!)

However, I didn’t expect it to turn up the next day. This was quite frustrating since the lack of suitable weather and someone to hold the ladder for me meant there was no way it was going to happen this weekend.

Spurred on though, I spent a couple of hours crawling around the loft routing the cable in readiness. The wind and rain were lashing the other side of the slates, so I was thankful to at least have an indoor task to complete.

My cunning plan to achieve the WAF and keep the cables safe and out of site, I routed them down the cavity surrounding the soil stack running the full height of the house; from vent in the roof to the drains beneath. A little fiddly, but I think worth the effort. My living room set up is in the corner of the room backing on to this space and the stack itself is boxed in the kitchen. Thus allowing my shotgun cable to be ready for the BlackGold in my (recently updated) media center and a third cable for a tuner in the kitchen.

Now as soon as it stops raining, I’ll get up that ladder!

Comments
No Comments »
Categories
miscellaneous
Tags
freesat, mce, satellite
Comments rss Comments rss
Trackback Trackback

Vista Media Center

August 8, 2008 | 11:47 pm

I’ve read numerous posts and articles on Vista and the majority of this seem to summarise that there is no compelling reason to upgrade from XP.

Since I first tried it out, I have been a fan XP Media Center Edition 2005. Despite it’s quirks, it delivers a simple and usable media interface to the living room. I don’t think I would care to go back to normal just TV and having looked at offerings such as Sky+ and Virgin Media Television, I still feel there are things I would rather not compromise. Vista Media Center too, seemed to offer little incentive and too many headache tales of incompatibility and woe.

Yet upgrade I have!

It went really smoothly too. I didn’t even have to take the disks distributed with the motherboard or graphics card out of their sleeves. I installed the TV tuner card drivers and the few bits of software I have on my media center and the job seems done.

I almost think I’ve missed something!

Vista Media Center

First impressions. I’m not sure I like it!

Vista itself seems OK, different enough to be disconcerting but nothing major.
(I’m surprised how long it has taken me to even see this OS)

The differences in VMC though, I’m not too sure…

  • there is too much on the first screen
  • too many menu options, for things I wouldn’t want to use, hanging around
  • navigation is horizontal and vertical
  • pictures are bundled in with video
  • everything seems constrained to the strip across the middle of the screen
  • I don’t know if my wife is going to like it!

But it’s late and it it’s done. I’ll live with it over the weekend and see where we are then.

The screen shot is not my own, its from flickr, because I’m tired and I really can’t be bothered to duplicate the effort.

Comments
No Comments »
Categories
miscellaneous, software
Tags
mce, sky, tv, virgin, vista, vmc, xp
Comments rss Comments rss
Trackback Trackback

« Previous Entries Next Entries »

Author

Ian Robinson is a relatively agile software engineer interested in things both sides of the object relational divide and beyond.

Categories

  • development (35)
  • miscellaneous (20)
  • music (7)
  • software (13)

Blogroll

  • Dan North
  • Dave Astels
  • Dave Wood
  • eirikso.com
  • Matt Raible
  • Object Mentor Blog
  • The Ancient Art of Programming
  • The Wisdom of Ganesh

Tags

active-mq architecture bauhaus blu-ray css db eclipse esb festivals freesat gorm grails groovy hd hd-dvd hibernate java jboss jms junit links mce media center mini music oracle osgi patterns pirsig plugins satellite soa software spring sql struts2 testing themes tools tv web wordpress xml xpath xslt
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox