Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

Sunday, 28 February 2010

Beginning Java EE 6. Hand Holding Learning Trail Part 2. (JSF 2.0, Maven, Glassfish, Primefaces)

In the previous session we setup the skeleton of our simplea application.
In this installation, we will add a bit of Layout to the user interface before the next major atticle which
wil takle centralising Access control and security.

NB
This is only to beautify the look and feel. We will look at 'componentising' and taking advantage of
facelets in a future session. I actually dont feel easy just leaving it as this but in order not to be distracted
we will stay with this for now.

Lets get Rolling.


This is a continuation of a series. Please read the previous post to get a feel of what we are up to from here


TASK 1


Integrating 960 CSS framework.

As you may know, programmers are normally very bad at design and I am no exception. The 960 css framework is a grid framework that
allows you to position containers(divs) and other objects on your page very easily without having to worry about advanced CSS

It is a production ready open source CSS framework. Read More about it from here
So we will use that for our simplea application. I am hoping to create composite components for the 960 framework
later in this series.
OK, here we go.

1. In the src\main\webapp folder (this is a relative to the simplea folder), create

another folder called css.

2. Download the Zip version of 960 grid framework from here

3. Extract the ziped file into a folder.

4. In the code\css folder, copy the file 960.css and reset.css to the css folder created in step 1.

5. In the same folder ie code\css, create a file called styles.css

Enter the following in that file


6. Open the index.xhtml file created in the previous session and enter this



7. Create a package:

First cd into C:\home directory

Run setenv.bat

type setenv.bat and hit the enter key

Then cd into

then type


Now Start Glasfish by typing

then type


make sure previous version is uninstalled by typing

then type

then browse to

to see the application

You can now shutdown glassfish by typing

That brings us of the end of today's seesion.

Coming Up

Login and security in JSF 2.0. Stay tuned

Wednesday, 25 March 2009

How to setup your HOMEs quickly

Given the hyper jargon world we live in today, we all have to make everything scalable. So here I am going to share how I build my development environment on the fly to allow me to use different versions of libraries for individual projects.

Create a Home directory

Mine is

C:\home

Create a windows bat. I am not a Linux guru so cant help a lot there
C:\home\aribaenv.bat
This is specific to aribaweb development

In it I have this entries


@echo off
REM 
REM SETTING UP LOCAL ENVIRONMENT VARIABLES

set PATH=.

REM sets base directories
set ROOT=c:\home
set APPS=%ROOT%\apps_dev

REM java 1,6.10
set JAVA_HOME=%APPS%\java\jdk\1.6u10
set PATH=%PATH%;%JAVA_HOME%\bin

set AW_HOME=%APPS%\ariba\aribaweb-5.0RC2
set PATH=%PATH%;%AW_HOME%\bin

set ANT_HOME=% AW_HOME %\tools\ant
set PATH=%PATH%;%ANT_HOME%\bin

set JODA_HOME=%APPS%\joda\joda-1.5.2

set PROMPT=(ariba).$P$G 
 
You can have  a lot more HOMES as is the pattern in today’s java world. My ant is pointing to the ant that comes with Aribaweb. I can make it point anywhere with a valid ant installation

With the PROMPT command, I have a new environment specific to the current instance of the command prompt. I can have as many of this without affecting each other.
I can switch versions of software for each project setup. Its just a matter of duplicating this and making the necessary changes.