Skip to end of banner
Go to start of banner

Setup CRM.COM and plugin projects in your IDE

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 25 Next »

Welcome to CRM.COM plugin development! The following guide provides instructions to setup your development environment and create the plugin projects using CRM.COM Plugin SDK.


What does this section cover?

Prerequisites

In order to start developing plugins from CRM.COM, you will need the following:

  • Oracle Java SE Development Kit 8 (JDK)
  • Eclipse IDE
  • Maven
  • Wildfly Application Server 10.1 or later
  • The CRM.COM Enterprise Archive (.ear file) - Provided by CRM.COM
  • The CRM.COM Plugin SDK - Provided by CRM.COM

Step-By-Step Guide

  1. Open Eclipse IDE and import the .ear file into your workspace.

     Importing .ear file

  2. Extract CRM.COM Plugin SDK to a location in your filesystem where Wildfly Application Server has permission. 
  3. Set the CRM_HOME system variable in Wildfly's configuration file to the location the SDK was extracted.
  4. Create your plugin projects
  5. Register your plugins by updating the plugins.xml file.


Mpconfig Properties File

mpconfig.properties file should be placed in the same directory as your custom project(s). This file is used to define the organisation database each custom project will run on.

To achieve that, you must use the following structure: <organisation_name>=<custom_project_directory_name>

Note that you should use the organisation(data source) name as defined on your Websphere/Wildfly server. Only one custom project per organisation can be defined.


mpconfig.properties
organisation1=custom1
organisation2=custom2

Plugins XML File

From R13 onwards you are advised to use plugins.xml instead of mpconfig.properties file. Just as mpconfig.properties file, plugins.xml file is used to define the organisation database each custom project will run on and should be placed in the same directory as your custom project(s). 

This file gives you the ability to define more than one custom project per organisation database.

Note that you should use the organisation(data source) name as defined on your Websphere/Wildfly server. For a full list of plugins file attributes, go to Plugins File Documentation.


plugins.xml
<pluginconfig>
	<plugins>
		<plugin>
			<name>switch</name>
			<description>Switch Provisioning Provider Plugin</description>
			<enabled>true</enabled>
			<vendor>CRM.COM</vendor>
			<version>1.0.0</version>
			<organisations>
				<organisationid>SUBSCRIPTIONS_DB</organisationid>
				<organisationid>ADMIN_DB</organisationid>
			</organisations>
		</plugin>
		<plugin>
			<name>kounta</name>
			<description>Kounta Point Of Sale System Plugin</description>
			<enabled>true</enabled>
			<vendor>CRM.COM</vendor>
			<version>1.0.0</version>
			<organisations>
				<organisationid>REWARDS_DB</organisationid>
				<organisationid>ADMIN_DB</organisationid>
			</organisations>
		</plugin>
	</plugins>
</pluginconfig>

Cache Properties File

From R13 onwards Hibernate second-level caching is used for the most of CRM.COM configuration entities. To enable this functionality you have to create cache.properties file and place it in the same directory as your custom project(s).


cache.properties
#enable/disable caching - true/false
enabled=true

#multicast address | multicast host name
multicastGroupAddress=224.0.0.251

#Multicast port
multicastGroupPort=4446
         
#0-255
#0 is restricted to the same host
#1 is restricted to the same subnet
#32 is restricted to the same site
#64 is restricted to the same region
#128 is restricted to the same continent
#255 is unrestricted
#The default value in Java is 1, which propagates to the same subnet. Change the timeToLive property to restrict or expand propagation.
timeToLive=1

#the hostname or IP of the interface to be used for sending and receiving multicast packets 
hostName=cyn1lnx007

#Mandatory - the port the listener listens on.
port=40001

#Optional - the number of seconds client sockets will wait when sending messages to this listener until they give up. By default this is 2000ms.
socketTimeoutMillis=2000

CRM.COM Java Projects

The CRM.COM .ear consists of 3 main Java projects, Crm.war, CrmAPI.war and CrmEJB.jar.

For each one of these projects, there is a corresponding custom Java project available in sample projects.

Depending on the custom to be implemented, the corresponding custom project should be modified.

Crm.war

This project includes all the files and code required to implement the View layer such as:

  • Summary pages ( WebContent/pages/summary/ )
  • Data Entry pages ( WebContent/pages/dataEntry/ )
  • Search pages ( WebContent/pages/search/ ,  WebContent/pages/trees/ for tree-search pages)
  • Reports ( WebContent/reports )
  • Printouts ( WebContent/printouts )
  • Dashboard components ( WebContent/pages/dashboards )

A detailed explanation of the view layer can be found at Developing the View layer.

In addition, this project includes all the metadata required for the application to function correctly.

  • Application metadata
  • Module metadata
  • Menu options metadata
  • Entity metadata
  • Entity fields metadata
  • Variable metadata
  • Label translations to specific languages

CrmAPI.war

This project includes all the code required to implement the CRM.COM Web API, that is, all the controller classes and Java classes required to parse the data in Web API requests and construct the data included in Web API response.

CrmEJB.jar

This project includes all files and code required to implement the Model and Controller layer. 

More specifically, this project includes the Data object classes, the Business object classes, the UI (User interface) and process flow controllers.

A detailed explanation of the model layer can be found at Developing the Model layer, and a detailed explanation of the controller layer can be found at Developing the Controller layer.

  • No labels