IT Eye
Resolution problem using Qlikview Analyzer Java Client
When using Qlikview Analyzer Java Client with Qlikview files which are built and used on a high resolution (for example 1920 by 1200). The application in the browser is shown in a smaller resolution so it doesn’t fill the whole screen which results in an ugly scrollbar. When using the Internet Explorer plugin everything looks fine but I prefer to have the freedom of choosing another browser. The following solution will fix the problem:
On your QVServer machine go to C:\Program Files\QlikView\Server\QvClients\QvJava and right click open in notepad the opendoc.htm and find the line html += ” width=’1000′ height=’700′>”; . This is where the browser height & width settings are set for the java client. you can change it to something like html += ” width=’99%’ height=’720′>”;
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | BI technology, Uncategorized
Oracle Application Testing Suite
Oracle Application Testing Suite
In July my colleague announced the release of version 8.30. Oracle has made some improvements and the Suite has reached version 8.40, A good time to check what this tool really can do.
Installing the software is not difficult, although I experienced some problems during installation. Make sure you have the correct files downloaded before starting. From JBoss download the zip version as you can see in the following screenshot. The installation is explicitly asking for the zip version. It can’t handle the TAR.bz2 version.
Oracle Application Testing Suite (downloadable from http://www.oracle.com/ )
Application Server: JBoss 4.0.2 (downloadable from http://www.jboss.org/ )
I started within 30 minutes with creating my first Functional Test in Oracle Application Testing Suite. The Suite supplies you with tools to monitor the development of the application. Bugs can be registered and connected to the requirements and test scripts (manual and automatic). This way you have an overview of effects from the reported issues.
This tool gives in a nice way an overview that helps with managing development of a web application. Although I have experienced some problems during installation and the generation of graphs in the web based application is not working yet. I would recommend using this tool when developing a web application.
Product url: Oracle Application Testing Suite
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Application Server, Internet, Oracle, SOA suite
Onderscheidende rol van IT-Eye ten opzichte van andere Qlikview partners
Nieuwsgierig naar de onderscheidende rol van IT-Eye ten opzichte van andere Qlikview partners ben ik op onderzoek uitgegaan met de vraag wat de unieke toegevoegde waarde is die IT-Eye als Qlikview partner kan leveren. Er kan worden gesteld dat de focus van de Qlikview partners is onder te verdelen in grofweg vier categorieën:
• Een focus op een specifieke branche met totaal oplossingen (retail, logistiek)
• Het leveren van algemene ICT oplossingen waaronder Business Intelligence
• De core business op een ander ICT vlak (bijvoorbeeld CRM) met BI als ondersteunende oplossing
• Licentieverkopers
Wat direct opvalt, is dat IT-Eye als één van de weinige partners Business Intelligence als core business heeft. Organisaties intelligenter maken door een betere informatievoorziening wat zorgt voor besluitvorming op basis van rationele gronden. De juiste informatie, op het juiste moment, op de juiste plek. Qlikview is in dit perspectief een revolutionaire enabler die een agile ontwikkeling mogelijk maakt. En dat is waar huidige, snel veranderende omgevingen om vragen.
Door de specialistische kennis over het gehele spectrum van het vakgebied Business Intelligence en de praktijk ervaring in vele branches mag IT-Eye oprecht zeggen verstand te hebben van de business en haar informatievraagstukken. Qlikview kan door deze specialistische kennis en praktijkervaring perfect als sluitende of aanvullende oplossing worden ingezet.
Door de combinatie van bovengenoemde factoren kan IT-Eye zich als organisatie onderscheiden en een stuk toegevoegde waarde leveren ten opzichte van haar concurrentie. Immers, door de combinatie van praktijkervaring, “in-depth†kennis van BI en de juiste tools worden oplossingen bereikt die daadwerkelijk toegevoegde waarde aan de business leveren.
Permalink | One comment | del.icio.us | Technorati | digg | dzone | StumbleUpon | BI solutions
Document BPEL code
Writing a documentation about the software that is made is important. But why should we document the code in a separate document. We know Javadoc standard to document java code and pldoc for generating documentation from PL/SQL code. In those cases you need to document your code in a pre defined way to let the tool generate correct documentation pages.
BPEL stores the documentation in the code using the annotation tags. This makes it easy to find the documentation area’s in the code. The next step is extracting this information from the BPEL. With xslt we can transform the bpel.xml file into a HTML file. Below you find a sample of a xslt file.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:bre="http://xmlns.oracle.com/BPELDocSample">
<xsl:template match="/tns:process">
<xsl:element name="html">
<xsl:element name="head">
<xsl:element name="link">
<xsl:attribute name="rel">stylesheet</xsl:attribute>
<xsl:attribute name="type">text/css</xsl:attribute>
<xsl:attribute name="href">bpel-flow-doc.css</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="body">
<xsl:element name="div">
<xsl:attribute name="class">process</xsl:attribute>
<xsl:value-of select="@name"/>
<xsl:apply-templates />
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="tns:sequence">
<xsl:variable name="sequenceID"><xsl:value-of select="generate-id(.)"/></xsl:variable>
<xsl:element name="div">
<xsl:attribute name="id"><xsl:value-of select="$sequenceID"/></xsl:attribute>
<xsl:attribute name="class">sequence</xsl:attribute>
<xsl:element name="p">
<xsl:value-of select="@name"/>
</xsl:element>
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<xsl:template match="tns:scope">
<xsl:variable name="scopeID"><xsl:value-of select="generate-id(.)"/></xsl:variable>
<xsl:element name="div">
<xsl:attribute name="class">scope</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="$scopeID"/></xsl:attribute>
<xsl:element name="p">
<xsl:attribute name="class">scope</xsl:attribute>
<xsl:value-of select="@name"/>
</xsl:element>
<xsl:apply-templates />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
In this example the sequences and scopes in the BPEL file are transformed into a html file. Expand the xslt file to get the information that you want to see in your HTML. For example: used partner links, Variables etc. Style the html file using CSS and you have a nice html page displaying what you want to see of the BPEL process.
To process the xslt file I made a ANT target. Connecting this to our nightly build the documentation of the process is generated on the moment that the code is compiled.
<!--
===========================================================
== doc-gen
===========================================================
-->
<target name="doc-gen">
<xslt force="true"
in="${basedir}/bpel/${process.name}.bpel"
style="${bpel.documentatie.flow.xsl}"
out="${process.name}.html"/>
<echo level="info">
doc-gen for ${basedir}/bpel/${process.name}.bpel
</echo>
</target>
Useful links:
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | SOA suite
Devoxx: Surprised by JavaFX
Day three of Devoxx was the best day so far: a very good presentation by Stefan Tilkov on REST patterns and anti-patterns. After reading some discussions on REST, especially some comments by Roy Fielding, i was curious to know what the correct way of applying REST was. Turns out i was close in my applications but i’ll need to add links between resources. Anyway, excellent presentation by Stefan. You can find his presentation on his blog: Devoxx 08 talk.
The day started with a surprise: JavaFX looks better than expected. I was impressed by nine videos running at the same time, and the fact that you can simply drag an applet from the browser and run it as a desktop application. Data binding certainly is an improvement over swing, so i can imagine using JavaFX for all things that you would normally use swing for; not just for creating RIAs. Also, the plugin for Adobe Photoshop and Adobe Illustrator seems usefull. All RIAs framework vendors seem to agree on the fact that look and feel is very important for RIAs, and that the graphic designers should be included in the development process.
And that is Oracle ADFs biggest disadvantage: limited skinning options. The ADF demo was pretty impressive: A very rich web application without coding java. You have to wonder though what oracle is doing here. A room full of Java coders, and oracle’s message basically is: we dont need you anymore. Not a good message in the current economy, with everybody already afraid of their jobs…
Another interesting talk was the talk about Spring DM: the OSGi based Spring Application server. Now that almost all application servers are moving to OSGi, it seems that OSGi will have a big impact on application developers. It offers a whole new perspective on SOA: all the benefits of services, but without the distracting WS-* standards.
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Ajax, RIA, Java, Open Source, SOA technology, Web services, web2.0
Waarom renderen we de view laag eigenlijk nog op de server?
Yesterday i did a presentation at JFall about JQuery and Grails: Why are we still generating the view layer on the server?. I’ve had some requests for more information, here’s a small list:
- The presentation: Client-Server 2.0
- What is Client-Server 2.0?
- JQuery howto: an accordion menu component
- Client-Server 2.0 enables disconnected applications
- Client-Server 2.0
- Creating charts using jquery flot and some grails
- Using JQuery autocomplete with grails and json
Permalink | 6 comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Ajax, RIA, Internet, J2EE, Java, Open Source, XHTML, CSS, web2.0
Some seam and glassfish links
We’re currently working on a Seam project. Would preferably be able to also deploy on Glassfish. Here are some interesting links i found:
- Seam 2.1 and Glassfish
- Chapter 39. Seam on GlassFish application server
- Managing the dependencies of a seam-gen project with Ivy
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Uncategorized
SCD2 with Pentaho Data Integration
One of the features I like in Pentaho Data Integration (version 3.1.0) is the “dimension lookup/update” transformation step to implement a Slowly Changing Dimension type II.
It works quite easy and saves a lot of work. I worked out a small example to illustrate how it works: just an Excel file to populate a dimension table.
The complete transformation from Excel file to dimension table only takes two transformation steps.
The Excel file has the following columns:
- klantnummer (customer number)
- voornaam (first name)
- achternaam (last name)
- woonplaats (city)
- geboortejaar (year of birth)
- geslacht (gender)
- type (type)
The dimension table DIM_KLANT (customer dimension) has the following properties:
As you can see, it has some additional columns compared to the Excel file:
- technical_key
- start_date
- end_date
- version
I skip the first transformation step and go straight to the second one.
Here is how this transformation step is configured:
And here is how it works.
We start with the following data file (Excel).
After running the transformation, the dimension table contains the following data.
As you can see, all records are inserted and have version number 1. Also does every inserted record have a (default) start date and end date. And, of course, a technical key.
Now we change the data in the Excel file.
Let’s modify Ineke’s year of birth (from 2000 in 2001). We also add Janneke, Klaas and Laura.
Run the transformation again. The data in the dimension table should now look like this:
As you can see, Ineke has a new record in the dimension with version number 2. Her (previous) record with version number 1 now has an updated end date. New records are also added for Janneke, Klaas and Laura. All with version number 1 and with a technical key.
Finally, let’s make some changes to the data. We modify the dates of birth for Ineke, Janneke, Klaas and Laura.
After running the transformation, we expect 4 new records to be added to the dimension table. Janneke, Klaas and Laura should get records with version number 2. Ineke shoud get a new record with version number 3. All previous versions of those records should get an updated end date.
This is what the dimension table now looks like.
Here ends this small example. The functionality of the transformation step “dimension lookup/update” works quite nice and easy. It also saves a lot of work compared to programming this functionality yourselves.
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | BI technology, Open Source
Javaposse interviews Ted Farrell on Oracle Tools
Just posted on The Java Posse: a podcast interview with Ted Farrell and Duncan Mills about the Oracle Java Tools. Download it here: Java Posse #212 - Oracle Developer Tools Interview.
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Oracle
REST webservice in Jdeveloper with the JAX-WS RI
download the binary for the jaxws (JAX-WS RI 2.1.4) reference implementation library
execute the jar : java -jar JAXWS2.1.4-20080502.jar
In Jdeveloper follow the next steps
- Create a new Application : JAXWSRest (No Template)
- Create a new Project : HelloWorldRestService
Edit the project properties > Libraries > Add Library
Add a new User Library : jaxws-ri
And add the libraries from the ‘jaxws-ri\lib\’-directory

Add a new java-class : HelloWorldImpl
[code]
package nl.iteye;
import javax.annotation.Resource;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.ws.BindingType;
import javax.xml.ws.Provider;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.WebServiceProvider;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.http.HTTPBinding;
import javax.xml.ws.http.HTTPException;
import java.io.ByteArrayInputStream;
import java.util.StringTokenizer;
@WebServiceProvider
@BindingType(value=HTTPBinding.HTTP_BINDING)
public class HelloWorldImpl implements Provider {
@Resource(type=Object.class)
protected WebServiceContext wsContext;
public Source invoke(Source source) {
try {
MessageContext mc = wsContext.getMessageContext();
String query = (String)mc.get(MessageContext.QUERY_STRING);
String path = (String)mc.get(MessageContext.PATH_INFO);
System.out.println(”Query String = “+query);
System.out.println(”PathInfo = “+path);
if (query != null && query.contains(”name=”)) {
return createSource(query);
} else if (path != null && path.contains(”/name”)) {
return createSource(path);
} else {
throw new HTTPException(404);
}
} catch(Exception e) {
e.printStackTrace();
throw new HTTPException(500);
}
}
private Source createSource(String str) {
StringTokenizer st = new StringTokenizer(str, “name=&/”);
String name = st.nextToken();
String body =
“”
+”Hello ” + name
+”“;
Source source = new StreamSource(
new ByteArrayInputStream(body.getBytes()));
return source;
}
}
[/code]
With annotations we define the WebServiceProvider and which binding we want to use for the service (http binding).
The Provider interface let us implement the T invoke(T p1) { } method.
This method will get the context. From the context it will get the url by which our service is invoked.
The createSource helper-method will get the the value of the parameter from the url (parameter ‘name’) and return the xml response back.
Add a new J2EE Deployment Descriptor
File > New > Deployment Descriptors > J2EE Deployment Descriptor Wizard > web.xml > 2.4
Use this for the web.xml
[code]
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
restful
restful
JAX-WS endpoint - restful
restful
restful-sayhello
com.sun.xml.ws.transport.http.servlet.WSServlet
1
restful-sayhello
/sayhello/*
60
[/code]
Here we map the url /helloworld to the WSServlet class of jaxws implementation.
In the WEB-INF directory create a new file : sun-jaxws.xml
[code]
xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime"
version="2.0">
name="restful-addnumbers"
implementation="nl.iteye.HelloWorldImpl"
url-pattern="/sayhello/*" />
[/code]
In here we will map the call to the service ’sayHello’ to our package ‘nl.iteye.HelloWorldImpl’.
Finally we need a deployment profile.
File > New > Deployment Profiles > WAR File > MyHelloWorldRestApp
In General set ‘Specify J2EE Web Context Root’ to MyHelloWorldRestApp
In File Groups > WEB-INF/lib > Contributors, select jaxws-ri (or the name you gave your user library)
We ready for testing.
Deploy the service to the application server
To test the service we can use and url of the format :
[code]
http://:////
[/code]
For me it would be :
http://localhost:8888/MyHelloWorldRestApp/sayhello/name/Eric
So we use the pattern sayhello in the url, this will do the call to our HelloWorldImpl class, and call the invoke-method.
This will return a piece of xml.
And the output in our browser is :
[code]
Hello Eric
[/code]
Permalink | 4 comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Uncategorized
IT-eye - JDeveloper 11 is available for download…
But due to javascript errors i can’t download it. Not sure what is causing this, maybe some javascript files that don’t get through the firewall? Or maybe some simple javascript coding errors. Is it my browser, is it the page? Try it here: JDeveloper 11g download.
Permalink | One comment | del.icio.us | Technorati | digg | dzone | StumbleUpon | Oracle, JDeveloper
IT-eye - Web 2.0 redefined
This week Tim O’Reilly wrote a post called Why Dell.com (was) More Enterprise 2.0 Than Dell IdeaStorm, in which he states his current definition of web 2.0:
I define Web 2.0 as the design of systems that harness network effects to get better the more people use them, or more colloquially, as “harnessing collective intelligence.”
This is exactly the point i made in my Web 2.0 Enterprise 2.0 presentation The real meaning of web 2.0 for your business. The internet allows companies to take advantage of all the knowledge in the world, and businesses can improve their level of service by using this knowledge.
The example i used was amazon.com. By using their customers, and the collective intelligence of their customers, amazon.com has created a store that’s better than real-world stores, because they really help their customers pick the right product. No longer is an internet store better because it’s always open, and it doesn’t require you to travel. Now it’s also better because customers are better informed to choose the right product.
If i am in a real-world store, i miss amazon.com because i need the information that’s only available on amazon.com. And now with the mobile web becoming mature, amazon.com is able to compete with physical stores right inside these stores.
Your customers, and the knowledge of your customers, become an essential part of the level of service you can provide as a company. This is the profound impact of the internet on businesses.
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Internet, web2.0
IT-eye - jQuery also to be added to Oracle Apex
Just learned from a comment by Gary to my previous post JQuery becoming essential knowledge for web developers that jQuery is also going to be used in Oracle Apex to add AJAX functionality. Marc Lancaster has a bit more info in his blog: Oracle OpenWorld - done and dusted. Good new for Apex users. I wonder how easy it is to create REST/JSON services using Apex/plsql.
Permalink | 3 comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Oracle, Internet, XHTML, CSS, Ajax, RIA, SOA solutions
IT-eye - JQuery becoming essential knowledge for web developers
Recently i’ve blogged quite a bit about jQuery (Jquery howto: an accordion menu component, Creating charts using jQuery flot and some Grails, Using jQuery autocomplete with Grails and json). To say that i’m impressed is an understatement. It has completely changed my mind about the need for browser plugin technologies like Flex, Silverlight and JavaFX, although browser support for multimedia applications still has some catching up to do. jQuery makes AJAX pretty easy, Javascript extremely powerful, hides a lot of the browser differences, and has a large number of components.
JQuery was already used by a large number of websites and companies, but now Microsoft has announced that it’s going to include jQuery in Visual Studio. (Scott Hanselman has an example using jQuery with ASP.NET) Also, Nokia is including jQuery in all phones that use their WebKit based Web run-time. Here’s John Resigs blog entry about these announcements: jQuery, Microsoft, and Nokia. Also a bit more info on Ajaxian
Seems like jQuery is becoming essential knowledge for web developers.
Permalink | 4 comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Internet, Ajax, RIA
IT-eye - Client Server 2.0 enables disconnected applications
Last year when Google released Gears with support for offline caching of web resources i doubted it’s usefulness. Why would i want to cache something that’s dynamically generated on the server? The file would probably be out of date by the time it was needed. However, this all changes in the Client Server 2.0 architecture.
When all User Interface files you download from the server are static, there’s no problem caching them offline. They will be up to date when you need them in the future, because they are static. All the dynamic parts are handled by the javascript code. if you combine this with a small offline set of data, stored in a database in the browser, suddenly you have a useful disconnected application model.
Ofcourse, this is not a new idea. Gmail and Google Reader have been offering this for some time already. But like many people, i had a hard time seeing that serverside generated user interfaces (html) aren’t really needed anymore. At all. No more jsp or jsf. (Unless you need search-engine indexable content). But when you let go of the idea that you need to dynamically generate anything at all on an application server, suddenly offline caching becomes a very interesting concept.
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Internet, XHTML, CSS, Web services, Ajax, RIA, SOA solutions, Technology
IT-eye - What is Client Server 2.0?
Client Server 2.0 is the next logical step that started with AJAX and RIA. It is Client Server but based on open standards: html, javascript, css and services. The client is completely responsible for creating the user interface. All dynamic parts are generated using javascript in the browser. Applications servers will serve static html, javascript, and css. But more importantly, they will host the services used by the javascript clients. So the main role of application servers in this model is to act as SOA containers.
The following image illustrates the position of Client Server 2.0 with respect to other application architectures. The eighties saw the move from terminal applications to client server applications, enabling users to take advantage of the increased power of their pc’s. The nineties saw the rise of html applications, taking advantage of open standards, enabling everybody to easily use applications everywhere. And now we’re again at a point where we can take full advantage of the power of the client workstation, but with the added benefit of using open standards, so everybody, anywhere can easily use them.
The following image illustrates the overall Client Server 2.0 architecture. You need a server that can host the static javascript, css and html files. Then you have a browser where the actual client is running. Javascript will be used to update the user interface as needed. And you have SOA containers that host the services used by the client application.
I’ve created some applications using the technology stack illustrated in the next image, and have been very impressed with the productivity you can achieve this way. JQuery hides most of the browser differences, and makes most javascript tasks very easy. There are also a lot of existing JQuery plugins available, from complex datagrids, to charting, to maps integration. Creating custom JQuery/javascript components is also a lot simpler than creating components that works partly on the server and partly on the client. Huge difference with for example JSF. And finally Grails is a very productive framework for creating RESTfull JSON services.
So, there you have it: Client Server 2.0 - Standards based browser applications, without a web-framework on an application server, talking to services hosted by SOA containers.
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | software development, Internet, XHTML, CSS, J2EE, Web services, Ajax, RIA, Technology, SOA Patterns
IT-eye - Client-server 2.0 is taking off
Some weeks ago i wrote a post suggesting the name client server 2.0 for browser applications which are completely generated in the browser using static javascript, html and css. No more html generation on an application server. I think this is the logical next step after RIA. Application server will turn into SOA containers, hosting all the services called by the javascript application. More info here: What is Client Server 2.0?.
Seems like Matthew Quinlan also thinks Client Server 2.0 is the right name for this architecture: How to Architect Next-Generation Web Applications.
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Internet, XHTML, CSS, Web services, Ajax, RIA
IT-eye - Jquery howto: an annimated accordion menu component
Creating UI components using JQuery is surprisingly easy, especially when you’re used to JSF. Here’s a simple example that illustrates how to create a semantically correct annimated accordion menu. The result will look like the following image. When you click on a category the menu items below it will be displayed or hidden.
The html code to implement the menu is just a semantically correct unordered list of items and subitems like in the following example:
<div id="mainMenu">
<ul>
<li>Kandidaat
<ul>
<li>
<a href="#" id="openInvoerKandidaatForm">Invoeren Kandidaat</a>
</li>
<li>
<a href="#" id="openMutatieKandidaatForm">Mutatie Kandidaat</a>
</li>
<li>
<a href="#" id="openReactieKandidaatForm">Reactie Kandidaat</a>
</li>
<li>
<a href="#" id="openVervolgreactieKandidaatForm">Vervolgreactie Kandidaat</a>
</li>
<li>
<a href="#" id="openVerwijderenKandidaatForm">Verwijderen Kandidaat</a>
</li>
</ul>
</li>
<li>Woning
<ul>
<li>
<a href="#" id="openInvoerWoningForm">Invoeren Woningen</a>
</li>
<li>
<a href="#" id="openAanbiedenWoningForm">Aanbieden Woning</a>
</li>
</ul>
</li>
...
</div>
A JQuery components is basically just a javascript file that you include in your html page. Inside the javascript file i defined a function called accordion which can be applied to html tags ($.fn.accordion). The accordion function adds a click event handler for every list item which has child list items (this.find(”li:has(ul)”). The event handler toggles (hides and displays) the child unordered list whenever the user clicks on the parent list item. I’ve also added a slow parameter, which annimates the hiding and displaying.
The accordion menu also adds an event handler to all child list items, to prevent the click event from bubling up to the parent list item, otherwise the menu items would also be hidden and displayed when selecting a child list item.
(function($){
$.fn.accordion = function(){
this.find("li:has(ul)").click(function(){
$(this).children().toggle("slow");
});
this.find("li ul li").click(function(event){
event.stopPropagation();
});
}
})(jQuery);
To add our jquery component to an html page we need to include the jquery javascript file, our component javascript file, and some javascript which will initialize all the javascript extensions to our page after it is loaded (app.js).
<script src="js/jquery-1.2.6.js" type="text/javascript"></script> <script src="js/jquery.ako.accordion.js" type="text/javascript"></script> <script src="js/app.js" type="text/javascript"></script>
To turn the unordered list into an accordion menu we need to apply the component to the list after the page has been loaded:
$(document).ready(function(){
$("#mainMenu ul").accordion();
});
That’s it. Mind you, this is a stateless accordion menu, so whenever the user reloads the page the menu is drawn in it’s initial state, so in this state it works best with single page html applications. You could make the menu stateful by adding some ajax calls to the component to save the state to the server.
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | XHTML, CSS, Ajax, RIA
IT-eye - JaValid 1.1 released
JaValid 1.1 has been released and can be downloaded from here (for detailed information see: http://www.javalid.org).
What is JaValid?
JaValid is an annotation-based validation framework, which allows you to annotate your Java objects to introduce validation. JaValid can be used in any type of Java application (standalone application, web application etc). The framework currently provides full integration with the Spring Framework, Java Server Faces, Facelets, and any database. The framework can be extended easily, by means of extensions, and allows you to add your own validation constraints in addition to the ones shipping with the framework.
The most important things added/changed to the 1.1 release are:
* Extensions, you can add your own extension to JaValid now. This allows you to add any type of validation needed (e.g. webservices)
* Database extension. This is a new extension and allows you to check constraints in the database (e.g. check if a name already exists)
* Added optional JavalidValidationCallbackHandler when calling validateObject(), which allows you to customize validation before/after validation.
* Added plural annotations. All existing and new annotations have a plural form now (e.g. @MinLengths (values={@MinLenght(..),@MinLength})
* Added @DateCheck annotation
* JSF validator tag now also supports field validation ()
Any feedback on the new release is welcome, enjoy!
Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Java, J2SE, Open Source

















