Monday, April 30, 2012

JBoss Tools Browser Simulator Standalone Application Build


What is JBoss Tools Browser Simulator (BrowserSim)?

Browsersim is quick and easy way to test how your web application going to look like on mobile device. Truth be told it cannot be 100% reliable and no a replacement for platform specific emulator.

BrowserSim is available as part of JBoss Tools Project, but there is simpler way to get your hand over it and try if it works for you.

How to configure your environment to get BrowserSim running

  • Windows: 
    • Only 32-bit Eclipse/JBDS is supported; 
    • Apple QuickTime or iTunes must be installed (they contain Apple Application Support which provides WebKit engine for BrowserSim). 
  • Linux: 
    • WebKitGTK 1.2.0 or newer must be installed and available in the library load path. 
    • This should be available on RHEL and Ubuntu by default, if not use your package manager to install libwebkitgtk 
  • Mac OS X 
    • It just works. 

What is required to build BrowserSim standalone application

    Install prerequisites listed below:
  • Java SDK 1.6
  • Apache Maven 3.0.X
  • Subversion client

How to build BrowserSim standalone application with maven

mkdir browsersim
cd browsersim
svn checkout https://svn.jboss.org/repos/jbosstools/workspace/dgolovin/org.jboss.tools.browsersim.app
mvn package -Dmaven.repo.local=.m2 -Declipse.p2.mirrors=false
then depending on used platform it can be started as
./target/products/org.jboss.tools.browsersim/linux/gtk/x86_64/browsersim
./target/products/org.jboss.tools.browsersim/linux/gtk/x86/browsersim
and will show iPhone2 skin by default. Use context menu on window title to:
  • select device
  • rotate your device
  • change settings

Tuesday, April 3, 2012

Forge for DB Reverse Engineering with CRUD (video)

Forge also has a Hibernate Tools plugin that allows it to analyze a database schema and produce JPA entity classes. Then Forge can use its scaffolding feature to generate JSF2 Create, Read, Update and Delete (CRUD) user interfaces.

Forge for DB Reverse Engineering with CRUD from JBoss Developer on Vimeo.

Hibernate Tools for DB Reverse Engineering (video)

Hibernate Tools have been part of JBoss Developer Studio for a long time - now they are integrated with Dali - and you can use Dali's JPA Generate Entities from Tables feature. This video walks you through how to setup the Hibernate Configuration and the JBDC connection to allow for JPA entity generation.

Sakila H2 Database:
https://github.com/maxandersen/sakila-h2

Hibernate Tools for DB Reverse Engineering from JBoss Developer on Vimeo.

Forge Introduction in JBoss Developer Studio 5 (video)

Forge is JBoss's rapid application development tool. A command line based tool that is embedded in JBoss Developer Studio 5. Run a whole script of commands to render a complete application.

Forge Introduction in JBoss Developer Studio 5 from JBoss Developer on Vimeo.

RichFaces 4 for Desktop & Mobile in JBDS 5 (video)

JBoss Central provides an archetype for RichFaces 4, also implementing the "kitchensink" example. RichFaces 4 leverages EE 6's BeanValidation by moving those declarative validation rules from the server down to the client.

RichFaces 4 for Desktop & Mobile in JBDS 5 from JBoss Developer on Vimeo.

JBDS 5 Java EE 6 Web + Arquillian (video)

This demonstration follows #1 that shows installation and Aerogear's POH5 or HTML5 archetype. This demo drills into the Java EE 6 Web Project and Arquillian for automated integration testing.

2. JBDS 5 Java EE 6 Web + Arquillian from JBoss Developer on Vimeo.

JBDS 5 Installation, HTML5, Mobile & OpenShift (Video)

This video walks you through the installation of JBoss Developer Studio 5, uses the JBoss Central HTML5 archetype, introduces the Mobile BrowserSim to demonstrate an application that supports both desktop & mobile UIs and finally uploads it all to OpenShift for testing on real devices.

JBDS 5 Installation, HTML5, Mobile & OpenShift from JBoss Developer on Vimeo.

Friday, March 30, 2012

How to configure Virtio or e1000 1G NIC in Windows XP KVM Guest

By default kvm uses 10/100M NIC. What is good in it windows recognize it out of the box. It means no hassle with drivers and internet connection is available after guest installation is done. Default NIC is fine for browsing but if you need to transfer 0.5G installation for testing into guest OS several times a day it is time pit, because download takes about half an hour.

There are many options to consider:

  • using .iso file and mount it as CDROM,
  • try to use USB device,
  • configure kvm to provide 1G NIC for guest

All options have pros and cons not explained here. At first sight I thought last options is simple, but it took time to figure out right kvm options to get it works and have pretty decent download speed.

It seems simple :) just read what

man kvm

says. Then check what NIC models are supported with

kvm -net nic,model=?

and follow instructions, but there are several tricks to do before you success:

  • 1. You need to find drivers for Virtio or e1000
  • 2. Just using -net nic,model=e1000 in kvm parameters is not gonna work even after driver is installed, because it requires -net user option as well
  • 3. Your CPU should be powerful enough to emulate 1G download for NIC

So lets assume there are Windows XP installation disk iso image at /images/winxp.iso, windows guest installed on your desktop in /guests/winxp.img and it works with usual parameters like

kvm -localtime -m 2047 -soundhw all -boot d -cdrom /images/winxp.iso /guests/winxp.img -vga cirrus -cpu host

First you need to download drivers. Start your Windows guest with default NIC and download Virtio driver ISO image here and e1000 driver installer here using guest OS. After they are downloaded, shutdown your guest and start it with desired NIC. For example to start Windows XP guest in KVM with e1000 NIC use

kvm -localtime -m 2047 -soundhw all -boot d -cdrom /images/winxp.iso /guests/winxp.img -vga cirrus -cpu host -net nic,model=e1000 -net user

Install drivers for e1000 from installer downloaded before and restart windows guest. After that your windows guest should recognize e1000 NIC and show it is in 1G mode. Installation is almost the same for Virtio NIC just rename iso into zip and unpack it somewhere to install.

Hope this article will save some of your time :)

Wednesday, March 28, 2012

Maven Integration for Web Tools Platform Proposal Posted

Maven Integration for Web Tools Platform (m2e-wtp) is finally on its way home and proposed open source project under the Eclipse Maven Integration project.

Give it a hug if you like it here http://www.eclipse.org/forums/index.php/mv/msg/318532/831379/#msg_831379

M2E_WTP is an extension for M2E which makes your life easier when you import Java EE related projects developed with maven in Eclipse. It does all Web Tools platform related configuration for you at import time. It means all projects get configured as Faceted Projects with required facets after import is finished, so you can use it as regular Web Tools project and start Web Development right away without spending time to manual configuration.

Proposal document is located http://www.eclipse.org/proposals/technology.m2e.m2e-wtp/.

JBoss Tools Community announcement https://community.jboss.org/en/tools/blog/2012/03/28/moving-m2e-wtp-project-to-eclipse

Enjoy!