Hot Air Balloon in Melaka, Malaysia

Come fly with us in Melaka, the world heritage city. Now at Dataran Pahlawan, Melaka, Malaysia.

http://www.aeronazballoons.com

Now Aeronaz Balloons is using OMNI, a JSR168 compliant Portal.

Malaysian Hindu Temple Directory – myhindutemples.com

Listing of Hindu Worship Places  in Malaysia – A Database Project
 
 After 52 years of Independence, the actual number of Hindu places of worship (temples, shrines, etc) in Malaysia are not known. Different groups, from politicians to NGOs, offer different figures ranging from 10,000 to 20,000; researchers from State governments, MIC, MHS and other NGOs have undertaken data-collection projects at various times for this purpose, but there is still no composite available.Without availability of such data, it has proven difficult to develop strategies on the future of Hindu places of worship in Malaysia, especially on matters related to the defending against demolitions of Hindu places of worship.As such, the Temple Committee of the Malaysia Hindu Sangam (MHS), as the committee under the national Hindu body that coordinates the interests and activities of temples in the context of looking out for the needs of Hindus in Malaysia has now initiated a community-based nationwide project to collect data on Hindu places of worship in the country.  To develop a truly comprehensive database, we invite ALL Hindus in Malaysia, (including NGOs) to participate in this initiative ? all one would have to do is to visit this website: www.myhindutemples.com and complete a survey online after interviewing the person in charge at the temple that is to be included in the database. We believe that a web-based platform will be able to achieve what previous initiatives could not, particularly so due to the renewed strength many of us have gained from recent events.

This is how we seek your assistance, if you wish to volunteer :

1.      Volunteer intending to complete the survey goes to the website and places the cursor on the Temple Database tab.

2.      Placing the cursor on the tab releases a drop-down menu, from which the volunteer is to select Registration Form ? Hardcopy.

3.      This should bring the volunteer to a page where the form is available for download. Following the instructions on the page, the volunteer can download the form, print it, and visit the temple at the appropriate time to interview the person-in-charge. Considering the value of this project, it would be both practical and understandable to request a little verification on the spot for some of the information requested.

4.      Upon getting the complete details, the volunteer can then return to the computer and select the Registration Form ? Online option to key in the details online immediately. The volunteer may wish to download and read the Guide to Completing the Form before doing so.

5.      Once these details are keyed in, please give us 3 -5 working days before checking the Approved Temples Listing to confirm whether the record keyed in has accepted by the system. Get back to the website again.

We thank you once again for your kindness, support and participation. AUM.

Adding resources to a portlet meaning

First step is creating a POJO that has the following fields

Resouce file name – The values for this field will be “test.txt, baby.jpg, video.flv”. This field is compulsory, meaning you must validate.
Resource descrption – The values for this field will be “nice pic”. This field is optional, meaning no need to validate. User may leave it blank
Resource type – This field is used by the developer in the programming. When the user upload a resource the program identifies its type and update this field automatically. The values for this field will be 

  • “Image” if the file type is jpeg, jpg, png, gif
  • “Audio” if the file type is mp3
  • “video” if the file type is flv
  • “Document” if the file type is txt, zip and all other

Second step is creating the services

Third step is creating the portlets

And the final step is creating the View Manager Portlet. While doing the view manager portlet retrieve the resources and display them, order by Resource Types. Meaning all Images listed first, followed by Audio files, then Video Files and finally other Documents.

First step – Persistence in OMNI Portal

Every application requires lookup(s). In computing terms “Lookup” is an array of data, eventually that will be used by most of the applications. One good example is list of Countries. Let us create necessary POJI and POJO classes. A simple country object requires country id and country name. Country Id is normally used a primary key to identify and pick the specific country. Let us create our Country POJI.

package com.omni.services.country;
public interface Country {
     public String getCountryId();
     public void setCountryId(String countryId);
     public String getCountryName();
     public void setCountryName(String countryName);
}

Let us start creating Country POJO which is the implementation of Country POJI

package com.omni.services.country.impl;
import com.omni.services.country.Country;
import java.io.*;
public class CountryImpl implements Country, Serializable {
         private String countryId = “”;
         private String countryName = “”;
         public String getCountryId() {
                   return countryId;
         }
         public void setCountryId(String countryId) {
                   this.countryId = countryId;
         }
         public String getCountryName() {
                  return countryName;
         }
         public void setCountryName_en(String countryName_en) {
                 this.countryName_en = countryName_en;
         }
}

This POJO needs to be mapped with a hibernate mapping file. Following code represents Hibernate mapping file.

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE hibernate-mapping PUBLIC “-//Hibernate/Hibernate Mapping DTD 2.0//EN”  “http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd“>
<hibernate-mapping>
     <class name=”com.omni.services.country.impl.CountryImpl” table=”CountryImpl”>
     <id name=”countryId” column = “countryId” type=”java.lang.String” length=”32″>
                 <generator class=”uuid.hex”/>
     </id>
     <property name=”countryShortDesc” type=”string” column=”countryShortDesc”/>
     <property name=”countryLongDesc” type=”string” column=”countryLongDesc”/>
     </class>
</hibernate-mapping> 

Hibernate mapping documents are straight forward. The <class> element maps a table with corresponding class. The <id> element represents the primary key column, and its associated attribute in the domain object. The <property> elements represent all other attributes available in the domain object

Creating Themes for OMNI Portlets

In OMNI Portal each theme can have more than one template. Template forms the design skeleton for portlets. By default every Theme will have one template for portlets. The file name for that template is “portlet.template”. When the designer decides to override the default portlet template, he can design portlet specific template and name the template as projectname#portletname.template. The steps involved in designing a theme is as follows

  1. Identify the template name - The developer has to tell the designer the project name and the actual portlet name. The naming convention would be projectname#portletname.template
  2. Slicing – Designer starts slicing of graphic image in fireworks
  3. Directory Structure – Create a folder for your workspace. Inside the workspace folder create two folders one for images and another with the name “css”.  For instance lets say we are doing design for RaceManagerPortlet which is under GeneralSetup project, the workspace folder name can be racetemplate and the images folder can be images-race.
  4. Exporting – From fireworks export the image slices as HTML page. Please make sure to place the images inside the images folder created earlier.
  5. Work on Dreamweaver – Open the HTML page in dreamweaver. Convert the table width to 100%. Switch to Coding View and delete the row/column that has spacer.gif file. Now switch back to Design View and manually adjust your table rows and columns.
  6. Creation of CSS File – Now in dreamweaver create a CSS File under css folder. First step is removal of all tr/td tag attributes from the HTML page using css. Second step is replacing of img tag with div tag(s). The main reason why we doing this is to over come the absolute path referrence problem. All path referred in css must be relative path.
  7. Preview of template with CSS – Switch to design mode and view the tempate. Make sure you see what you wanted to see. If you get it what you wanted you are almost done already.
  8. Integration of Template into Portal – Copy the template html page and rename it as template file name (Refer point number 1). Open the template file in notepad and remove the unwanted codes, before the <table ….> tag and after the </table>. Copy this file into OMNI template folder (webapps\omni\themes\brush\default\templates).
  9. Integration of CSS and images – Copy your css file into webapps\omni\themes\brush\default\css folder. Now open the default.css file and import your css file inside the default.css file. Also copy your image folder into webapps\omni\themes\brush\default folder.
  10. Viewing of Template – Start the tomcat login to the portal and enable the portlet that is going to use the template you have designed. Feel the power of template driven portlets.

generalsetup#racemanagerportlet.template

Creating of Plain Old Java Interface – POJI

What is POJI ?

POJI stands for Plain Old Java Interface. POJIs are used to enforce the idea of developing an Application Programming Interface (API). It allows POJO multiple inheritance in Java.

Lets discuss the importance of POJI concept with an example. In a college management portal, “Student” and “Staff” objects are inherited from a “User” Interface. The college management portal has authentication and authorization modules. When a user login to the college management portal the authentication module checks whether the username and password keyed in are valid. Upon successful login the authentication module returns either “Student” or “Staff” object based on username supplied. 

The authorization module retrieves this object from authentication module. At this point the authorization module is not sure whether the object is “Student” or “Staff”. Since both objects are implementation of User interfance, authorization module can retrieve the object as User object. Then the authorization module checks whether the object is instance of “Student” or “Staff” using instanceof keyword in Java.

The above design pattern is also popularly known as “Factory Pattern”.