Wednesday, 10 July 2013

Steps to get IntelliJ working with Liferay portal services

Assumption - Liferay has already been run before with tomcat and everything all set up. Uses Liferay Maven to manage projects.


  1. Download and install IntelliJ (The latest version as of writing is IntelliJ IDEA 12.1.4)
  2. Create a new project and point the project root to the SVN parent folder
  3. In Module settings, type in the name of one of the folder in the SVN parent folder
  4. For existing svn checked-out folders, use 'Import Module...' to add more folder to the IntelliJ project
    1. Use Maven model to import
    2. Tick "Keep project files in" checkbox
  5. For the ones without a proper package, create a new module with the same name and do a 'Import Module...'
  6. For the ones that haven't been check-out from svn, use built-in subversion to check out the folder to a destination folder and 'Import Module'
  7. Select all the modules and do Subversion -> Update Directories
  8. Top left -> Project -> Package - if packages exist here, it means it has been imported to IntelliJ successfully (Automatically import Library Dependencies)


To test that it work:

  • Create a new "workspace" folder - Utilities
  • Create a new file - test.groovy
  • Type "GroupLocalService" and you should have liferay portal services for selection
  • Once selected, it should automatically import the relevant liferay service into the file
  • Do this
    GroupLocalService groupService = GroupLocalServiceUtil.getService();
    groupService.
    Note that the "." at the end is requried
  • and it should have a list of avaiable API for this service.



Thursday, 4 July 2013

Test HTML email format

HTML email renders differently in various email client.

The most annoying of all is Microsoft Outlook 2007 and 2010 (could be more, but cbb to list them all). Why? They bloody use MS Word as their rendering engine!

Anyway, to test the format, try this site:
Puts Mail - http://putsmail.com

Put in your email address
Fix up the subject (optional)
Copy and paste your HTML code
Fire away to your mailbox!

Use the target email client to open up the mail to see the result of the HTML rendering.

Cheers

Thursday, 13 June 2013

HTML 5 form input types

http://sixrevisions.com/html5/new-html5-form-input-types/

Advantage of using HTML 5 form input types is that it is cross-platform enabled with mobile devices.
The mobile keyboard will change according to what input type it is.

HTML 5 input types:

Input TypeDescriptionHTML Markup
dateA control for entering the date.<input type="date">
datetimeDate and time using UTC date and time format<input type="datetime">
datetime-localDate and time according to your local time<input type="datetime-local">
monthMonth and year<input type="month">
timeThe time of day<input type="time">
weekAllows you to pick the week and year.<input type="week">
colorAllows you to enter asimple color value (which is in hexadecimal color notation)<input type="color"">
emailValidates the input using the standard email format<input type="email">
telGives you the ability to validate telephone numbers format against a pattern<input type="tel">
searchSearches a data set (like a <datalist> HTML element)<input type="search">
rangeA slider control for picking a number in between two numbers<input type="range">
numberAccepts numbers only<input type="number">
urlAccepts URLs only<input type="url">

Cheers.

Thursday, 6 June 2013

5 HTML5 Javascript APIs to keep an eye on

http://daker.me/2013/06/5-html5-javascript-apis-to-keep-an-eye-on.html


  1. Battery Status API (very cool!)
  2. Gamepad API (insanely cool!)
  3. Device Orientation API
  4. Geolocation API
  5. Page Visibility API
See examples in the above link.

Text-align: Justify and Responsive Web Design

http://www.barrelny.com/blog/text-align-justify-and-rwd/

Display stuff in grid dynamically (by changing the width of elements, the grid automatically changes) - without floats and calculation.