Creation of portlet WAR files

Note that more detailed instructions for Liferay are included in a separate document called LiferayPortletInstallation.pdf under the doc directory of your KonaKart installation.

In order to create the WAR file that can be loaded into a portal, you must first install KonaKart normally and ensure that it is working correctly.

Navigate to the KonaKart\custom directory and run the command .\bin\kkant -p to view the ant targets in the supplied build file.


C:\Program Files\KonaKart\custom>bin\kkant -p
Buildfile: build.xml

Main targets:

 build                           Compiles all the custom code and creates all the jars
 clean                           Clears away everything that's created during a build
 clean_admin_portlet_war         Clears away the admin portlet war
 clean_manifest_file             Clean the MANIFEST file for all jars
 clean_portlet_war               Clears away the portlet war
 clean_torque_classes            Clears away everything that's created during a build of 
                                 the torque classes
 clean_wars                      Clears away all the WARs and EARs
 compile                         Compile the customisable application code
 compile_custom_adminengine      Compile the customisable admin engine code
 compile_custom_engine           Compile the customisable engine code
 compile_modules                 Compile the customisable module code
 compile_utils                   Compile the customisable utils code
 copy_jars                       Copy the konakart custom jars to the lib directories
 create_torque_classes           Process the Custom Schema to produce torque classes
 enableWebServices               Enable Web Services in deployed server
 generate_torque_java            Process the Custom Schema to produce torque java files
 make_admin_liferay_portlet_war  Create the konakartadmin portlet war for Liferay
 make_ear                        Create the konakart EAR
 make_eclipse_project            Create an Eclipse Project for Developing the Storefront
 make_jars                       Create the konakart custom jars
 make_liferay_portlet_war        Create the konakart portlet war for Liferay
 make_manifest_file              Create the MANIFEST file for all jars
 make_ordertotal_module_jar      Create the ordertotal module jar
 make_payment_module_jar         Create the payment module jar
 make_shipping_module_jar        Create the shipping module jar
 make_torque_jar                 Create the konakart custom torque jar
 make_wars                       Create the konakart wars
Default target: build
 

The targets that interest us for building the portlet WAR files are:

For example, in order to create the portlet for LifeRay, you must run the command as shown below:


C:\Program Files\KonaKart\custom>.\bin\ant make_liferay_portlet_war
Buildfile: build.xml

clean_portlet_war:
     [echo] Cleanup portlet WARs...
     [echo] Cleanup portlet WAR staging area...

make_liferay_portlet_war:
    [mkdir] Created dir: C:\Program Files\KonaKart\custom\portlet_war
    [mkdir] Created dir: C:\Program Files\KonaKart\custom\konakart_portlet\stage\konakart
    [mkdir] Created dir: 
    	C:\Program Files\KonaKart\custom\konakart_portlet\stage\konakart\WEB-INF\jsp
     [echo] Lay out the WAR in the staging area
     [echo] Copy (almost) the whole konakart webapp to staging area
     [copy] Copying 383 files to C:\Program Files\KonaKart\custom\konakart_portlet\stage\konakart
     [copy] Copied 35 empty directories to 2 empty directories under 
     	C:\Program Files\KonaKart\custom\konakart_portlet\stage\konakart
     [echo] Copy the jars reqd for the portlet to staging area
     [copy] Copying 2 files to 
     	C:\Program Files\KonaKart\custom\konakart_portlet\stage\konakart\WEB-INF\lib
     [echo] Copy the config files reqd for the portlet to staging area
     [copy] Copying 4 files to 
     	C:\Program Files\KonaKart\custom\konakart_portlet\stage\konakart\WEB-INF
     [echo] Filter the JSPs to staging area for the portlet WAR
     [echo] Filter the web.xml to staging area for the portlet WAR
     [echo] Filter the struts-config.xml to staging area for the portlet WAR
     [echo] Create portlet konakart.war
      [war] Building war: C:\Program Files\KonaKart\custom\portlet_war\konakart.war

BUILD SUCCESSFUL
Total time: 32 seconds

A file called konakart.war is created in the \KonaKart\custom\portlet_war directory. This is the file that you must import into your portal.

Note: