This guide will demonstrate how to create a bundle of classes and configuration files to use the HR-CRM application. A sample
application can be obtain via SVN using
svn co http://hr-crm.svn.sourceforge.net/viewvc/hr-crm/trunk/config-impl config-impl
Our first task is to download HR-CRM application. Open a web browser and download the application. You will then see the list of available releases. Click on the latest version, and you will be directed to the HR-CRM release download page. Now download the 'binary distribution' *.zip or *.tar.gz archive compatible with your operating system.
To go through this tutorial you need to install maven
2.0.7 or higher and
MySQL
5.1 or higher.
The tutorial has the following steps>
Because HR-CRM is application which provides access to legacy databases, you need a database to connect to.
Download
the sql script and execute it in your MySQL database.
Now it is the time to define and implent the domain model.
NOTE:
Your domain classes must have this names:
After the domain model is ready for use you need to implement adaptors. Unfortunately the application can not be smart enough
to see common objects and its properties between your domain model and XSD objects. One of the motivation for this sollutions
was once again the lagacy databases. Many of them are not defined in english.
Example of the adaptor classes can be seen here:
The last thing to provide in the project is the configuration file called: application.properties
.
NOTE:
You must use exactly this name.
This file is separated in 5 parts:
hrcrm.database.driver = com.mysql.jdbc.Driver hrcrm.database.url = jdbc\:mysql\://localhost\:3306/hrcrm hrcrm.database.username = root hrcrm.database.password = root
hrcrm.authentication.username = username hrcrm.authentication.password = password
hrcrm.address.adaptor = at.ac.tuwien.vitalab.hrcrm.adaptor.AddressAdaptorImpl hrcrm.address.bo = at.ac.tuwien.vitalab.hrcrm.bo.Address hrcrm.address.sql.createAddress = INSERT INTO ADDRESS (ADDRESS_ID, STREET, COUNTRY, CITY) VALUES (#id#, #street#, #country#, #town#) hrcrm.address.sql.retrieveAddressById = SELECT ADDRESS_ID as id, STREET, COUNTRY, CITY as town FROM ADDRESS WHERE ADDRESS_ID = #id# hrcrm.address.sql.retrieveAllAddresses = SELECT ADDRESS_ID as id, STREET, COUNTRY, CITY as town FROM ADDRESS hrcrm.address.sql.updateAddressById = UPDATE ADDRESS SET STREET = #street#, COUNTRY = #country#, CITY = #town# WHERE ADDRESS_ID = #id# hrcrm.address.sql.deleteAddressById = DELETE FROM ADDRESS WHERE ADDRESS_ID = #id#
hrcrm.name.adaptor = at.ac.tuwien.vitalab.hrcrm.adaptor.NameAdaptorImpl hrcrm.name.bo = at.ac.tuwien.vitalab.hrcrm.bo.Name hrcrm.name.sql.createName = INSERT INTO NAME (NAME_ID, FIRST_NAME, LAST_NAME, AGE) VALUES (#id#, #firstName#, #lastName#, #age#) hrcrm.name.sql.retrieveNameById = SELECT NAME_ID as id, FIRST_NAME as firstName, LAST_NAME as lastName, AGE FROM NAME WHERE NAME_ID = #id# hrcrm.name.sql.retrieveAllNames = SELECT NAME_ID as id, FIRST_NAME as firstName, LAST_NAME as lastName, AGE FROM NAME hrcrm.name.sql.updateNameById = UPDATE NAME SET FIRST_NAME = #firstName#, LAST_NAME = #lastName#, AGE = #age# WHERE NAME_ID = #id# hrcrm.name.sql.deleteNameById = DELETE FROM NAME WHERE NAME_ID = #id#
hrcrm.party.adaptor = at.ac.tuwien.vitalab.hrcrm.adaptor.PartyAdaptorImpl hrcrm.party.bo = at.ac.tuwien.vitalab.hrcrm.bo.Party hrcrm.party.sql.createParty = INSERT INTO PARTY (PARTY_ID, status, href) VALUES (#partyId#, #status#, #href#) hrcrm.party.sql.retrievePartyById = SELECT PARTY_ID as partyId, status, href FROM PARTY WHERE PARTY_ID = #partyId# hrcrm.party.sql.retrieveAllParties = SELECT PARTY_ID as partyId, status, href FROM PARTY hrcrm.party.sql.updatePartyById = UPDATE PARTY SET status = #status#, href = #href# WHERE PARTY_ID = #partyId# hrcrm.party.sql.deletePartyById = DELETE FROM PARTY WHERE PARTY_ID = #partyId# hrcrm.party.sql.addNameToPartyById = UPDATE NAME SET FK_PARTY_ID = #partyId# WHERE NAME_ID = #nameId# hrcrm.party.sql.addAddressToPartyById = UPDATE ADDRESS SET FK_PARTY_ID = #partyId# WHERE ADDRESS_ID = #addressId#
hrcrm.party.sql.deletePartyById = DELETE FROM PARTY WHERE PARTY_ID = #partyId#
If you successfully create the jar go to your JBOSS_HOME folder, navigate to the deploy folder and create a new folder called HR-CRM.
In this folder paste: