Adding Custom Functionality to the Admin App

From version 2.2.6.0 the Admin App allows you to define custom panels and custom buttons in defined areas, to allow you to extend the Admin App by adding your own administration functionality outside the standard Admin App.

Adding Panels

There are two types of custom panels that can be added. One type is set in the Custom Section of the Administration Application, the other type allows you to set them in the other sections (e.g. "products", "orders" etc).

In total there are 20 custom panels that display a predefined URL in a frame. The 10 URLs that are used for the Custom Panels in the Custom Section of the Administration Application are defined in the Configuration>>Custom Panel Config section of the Admin App. The 10 URLs for the "floating" Custom Panels are defined in the konakartadmin_gwt.properties file in "File-Based Configuration".

More details on how to configure the "floating" Custom Panels can be found in the konakartadmin_gwt.properties file.

In all cases the labels of the panels can be changed by editing the message catalog. The panel links can be rendered visible / invisible by configuring the role based security. The session id of the logged in user is appended to the URL so that the custom application can control security using the Admin Engine API. The string appended to each url is similar to the following, except that the session id will be random:

sess=6596bd465a824bb9cdfa6080af07e02f

With the Business and Enterprise Editions a few extra parameters are added:

  • langId - Currently selected display language Id
  • panelName - Name of the panel
  • userId - Id of the logged in Admin User
  • storeId - Id of the current store
  • mode - Engine mode
  • cush - Customers Shared
  • prsh - Products Shared
  • cash - Categories Shared

An example for the Enterprise version is:

  • sess=6596bd465a824bb9cdfa6080af07e02f
  • &langId=1
  • &panelName=kk_panel_customE
  • &userId=2
  • &storeId=storeX
  • &mode=2
  • &cush=true
  • &prsh=true
  • &cash=false

You can also add your own parameters to the URLs that you define. For example:

http://www.mycustom.com/custom1.action?parm1=abc

Each custom panel may have its own online help. The text for the online help is defined in the file AdminHelpMessages.properties under the keys, help.customPanel1 to help.customPanel10.

You can set the height of the custom panel frame to suit your needs by specifying a number of pixels (e.g. 700px). In the Business and Enterprise Editions you can configure the width and height of each panel individually in the konakartadmin_gwt.properties file.

Adding Custom Configuration Panel

A "User Defined" panel is available to use for maintaining custom or user defined configuration parameters that are specific to your own store system.

All you need to do is to insert configuration parameters into the configurations table in your KonaKart database in configuration group 31 and they will appear automatially on the User Defined Configurations panel of the Administration Application.

As a guide to inserting configuration parameters refer to the values already in the configuratons table and or take a look at the konakart_demo.sql file (under the database directory in your KonaKart installation) for many example SQL statements for creating configuration parameters.

Adding Buttons

The buttons will call pre-defined urls and will normally pass some parameters to allow you to check security and/or operate on selected objects. The button labels are defined in the Configuration>>Admin App Configuration section of the Admin App and the buttons remain invisible until the button labels are set with some text. The buttons and parameters available are in the following panels:

  • Customer Panel

    • id - the customer id
    • sess - the session id of the admin user

  • Returned Products Panel

    • order_return_id - id of the OrderReturn object
    • order_id - id of the Order object
    • total_inc_tax - total amount of the Order
    • sess - session id
    • tx_id - gateway transaction

Adding A Custom Application - Insert Product Wizard

The Enterprise version of KK contains an Insert Product Wizard to illustrate an example of how a custom panel may be used to provide functionality directly tailored for your unique business requirements. The wizard consists of a separate application which can be found in the konakartadmin_app directory under webapps.

It’s a simple application that allows you to insert a product in four easy wizard driven steps. This example was chosen because the Insert / Edit Product panel of the KonaKart Admin App can be rather daunting for non-technical users since it allows you to configure all aspects of a product. Most customers don’t use all of the product features and many desire a very simple insert product panel that can be used by non-technical staff and that displays only the required attributes.

The application uses the same Struts2 / JSP technology used by the storefront application. In reality all of the functionality is displayed by a single JSP called InsertProduct.jsp which displays the wizard. There are no page refreshes. The wizard tabs are populated using AJAX calls and the form validation uses jquery validate. The wizard steps are:

  • Insert product details

  • Select a manufacturer

  • Select one or more categories

  • Select the product images

The controlling JavaScript is in a file called kk.admin.js in the script directory.

The example should provide a good starting point for you to build your own custom panel implementing whatever functionality your business requires.