1. CUSTOM
T U E S D AY 3 R D A P R I L 2 0 1 8 , P R O V I D E N C E ( R I ) U S A
PLUG-INS
2. WHY PLUG-IN IS NEEDED?
softserv.iawareim.com
Aware IM is a powerful software system that allows users to configure
web based applications. The beauty of AwareIM is that there are certain
avenues or opportunities where Aware IM’s capabilities can be
extended/enhanced:-
A Java plug-in comes in handy when the user wants to implement:-
1. Any functionality that is difficult to configure using configuration
tool.
2. Complex mathematical algorithms not supported by configuration
tool.
3. Interaction with a non-standard hardware/software not supported
by configuration tool out-of-the-box.
4. Interacting with 3rd party applications through RESTful APIs
3. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #1 – Database Extensions
Use Case: - When a CRUD operation needs more efficiency in terms of processing and the time
it takes for operations on the DB.
Problem: - Traditional AwareIM CRUD operations slow down and could take good amount of
time if the operations are repetitive in nature.
Solution: - A Good solution would be to utilize the power of Stored Procedures.
Stored Procedures on a Database can be called directly from within AwareIM
Stats: -
*(Follow Bruce Lomasky’s Session for more information)
Input Process Output
DB credentials
1. DB connectivity
2. Fetch data
Processed data
S No Operation Time In AIM Time in SP
1 Select 20K from 2M - Insert (20K)
objects
4 hrs 1 Hr
2 Select 50K from 2M – Update Attribute
of those 50K objects.
12 hrs 2.5 Hrs
4. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #2 – Aware IM, Java & Database
Use Case: - When a CRUD operation needs more efficiency along with some intermediate
operations/ analysis (Some business rules for processing the data).
Problem: - Calling SP from AwareIM and switching between AIM/SP to-and-fro has some
overheads and it slows down and could take good amount of time if the operations are repetitive
in nature.
Solution: - The solution can be optimized by calling Stored Procedures through a Java Plugin and
implementing the processing rules in Java, returning the data in Processed form back to AwareIM.
Stats: -
Input Process Output
DB credentials
1. DB connectivity
2. Fetch data
Processed data
S No Operation Time In AIM SP in AIM SP In
JAVA
1 Select 20K from 2M - Insert
(20K) objects
4 hrs 1 Hr 15 Min.
2 Select 50K from 2M – Update
Attribute of those 50K
objects.
12 hrs 2.5 Hrs 50 Min.
5. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #2 – Aware IM, Java & Database …
Prerequisites: - Prior knowledge of AwareIM, Java and Database is required for this approach.
Connectivity: - Database can be connected by two ways:
1. BAS Props file – Fetch DB credentials from BAS Props file directly in JAVA and use them.
2. Host DB credentials anywhere in the system (Preferably System Settings) and access it in
JAVA.
• Calls the Java
plugin
• Sends the criteria
data to the plugin
via an AIM Object
• Receives the
criteria,
• Builds the SQL,
• Call to DB.
• Receive Results,
• Process Results,
• Populate AIM
Object
• Send Object back
to AIM
AwareIM
DB
JAVA
7. PLUG-IN / EXTENSIONS (EXAMPLE)
softserv.iawareim.com
Google Map Marker
Goal: To Display customized marker colours on google map and customized mouse hover text
Limitation: Aware IM returns only First Name and Last Name.
Solution: Plug-in is needed for rest of the fields like:-
1. Colour
2. Direction changes
3. Shortest/Longest routes
8. PLUG-IN / EXTENSIONS (EXAMPLE)
softserv.iawareim.com
More Info – Google Map Marker
• This plug-in is written in Java and works at server side.
• It takes input from AwareIM BOs for Geo Codes (Longitude/Latitude) & User Defined
Marker Color.
• It then displays locations on Google Map with corresponding marker color.
• It also takes data input from a BO attribute and displays it as text on mouse hover the
location.
• Google Maps JavaScript API ver 3.26 is used for this plug-in.
• It is not limited to only marker color or mouse hover text but can be enhanced for more
functions supported by the API.
• Implementation is seamless and quick and compatible with all AwareIM versions.
Live Demo: You can browse the sample app online @ Google Map Marker
Username: test
Password: test
Aware IM Verion/Build: Works with all versions
9. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #3 – Aware IM & Java
Use Case: - When you require some custom business logics to be implemented on any AwareIM
object which looks difficult to be achieved in Aware IM. (Some business rules for processing the
data).
Problem: - There are certain business operations on the Data which are either not entirely
possible through AwareIM alone or are not efficient enough. Eg. – If you need to modify some
attribute based on some calls to APIs/ Database operations.
Solution: - The solution can be optimized by taking the code into Java, running the Aware IM
rule/HQL query is passed in Java code, process the data, modify the object as per the need and
return the modified object back to Aware IM.
10. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #3 – Aware IM & Java…
Prerequisites: - Prior knowledge of AwareIM and Java is required for this approach.
Data Flow: - Data Flows between AwareIM and JAVA Plugin as below:
• Calls the Java
plugin
• Sends the criteria
data to the plugin
via an AIM Object
• Receives the
criteria,
• Process Results,
• Modified AIM
Object
• Send Object back
to AIM
AwareIM JAVA
11. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #3 – Aware IM & Java…
Code Snippet: -
12. PLUG-IN / EXTENSIONS (EXAMPLE)
softserv.iawareim.com
Great Circle Distance Calculator
Goal: To Calculate great circle distance between two locations using HAVERSINE formula
Limitation: Aware IM does not have a way to do complex mathematical calculations required in
HAVERSINE formulae.
Solution: Plug-in is needed for such complex calculation
• Calls the Java plugin
• Sends the Object
with below
Attributes:
• Lat.
• Long.
• Distance
• Receives the Object,
• Calculates Distance Using
Haversine formulae
• Populates Distance
Attribute of the Object
• Send Object back to AIM
AwareIM JAVA
13. PLUG-IN / EXTENSIONS (EXAMPLE)
softserv.iawareim.com
Code Snippet - Great Circle Distance Calculator
14. PLUG-IN / EXTENSIONS (EXAMPLE)
softserv.iawareim.com
More Info – Great Circle Distance Calculator
• This plug-in is written in Java and works at server side.
• It takes following inputs from AwareIM:
• Longitude, Latitude of first point
• Longitude, Latitude of second point
• It returns back the great circle distance in kms. to a BO.
• There are no APIs used but HAVERSINE mathematical formula is implemented.
• Implementation is seamless and quick
Live Demo: You can browse the sample app online @ Distance Calculator
Username: test
Password: test
Aware IM Verion/Build: Works with all versions
15. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #4 – Consume APIs in Aware IM
Use Case: - When we need to fetch data from external sources and utilize that in our AwareIM
Application.
Problem: - Prior to 8.1, AwareIM had no means to fetch data from external sources. Even with
AwareIM 8.1, there are some limitations which might compel us to move to this approach.
Solution: - The solution can be to consume the 3rd party REST APIs within Java and have the Java
code return an AwareIM object back as result.
16. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #4 – Consume APIs in Aware IM
Prerequisites: - Prior knowledge of AwareIM, Java is required for this approach.
Data Flow: - Data Flows between AwareIM and JAVA Plugin as below:
• Calls the Java
plugin
• Sends the criteria
data to the plugin
via an AIM Object
• Receives the criteria,
• Builds the REST APIs
Request
• Calls the REST APIs
AwareIM
JAVA
• Receive REST API Response
• Create JSON Arrays/Objects
• Map them to AIM Object
• Return AIM Object back
JAVA
REST APIs
17. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #4 – Consume APIs in Aware IM
Sample Code:
18. PLUG-IN / EXTENSIONS (EXAMPLE)
softserv.iawareim.com
Runtime message broadcaster (using Pusher services):
Goal: Add bi-directional communication to your apps, Bind UI interactions to events that are
triggered from any client or server
Limitation: Prior to AIM 8.1, 3rd Party REST APIs could not be called from within Aware IM.
Solution: A Java Plug-in is needed for which would: -
Send the REST API Request to 3rd Party Server.
Perform the intended Action or Return the intended Response.
Populate the APIM Object with response and return it back to AwareIM.
19. PLUG-IN / EXTENSIONS (MORE EXAMPLES)
softserv.iawareim.com
Calendly
Calendly supports webhooks which allows to receive Calendly appointment data in real-time at a
specified URL when a Calendly event is scheduled or cancelled.
Create calendar
invite
• Start Time
• End Time
• Event Name
• Location
• Description
Data captured via
unique User ID
Create calendar invite
in Appointment
object
• Start Time
• End Time
• Event Name
• Location
• Description
Data captured via
unique User ID
Calendly Webhooks API Aware IM API Aware IM
20. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #5 – Aware IM Advanced Script
Use Case: - When we need to enhance AwareIM features to incorporate certain JavaScript APIs to
improve the functionality set of AwareIM or to modify the behaviour of inherent AwareIM UI.
Problem: - There are a lot of times when we need features and functionalities which are inherently
not available with AwareIM. Example – Enhancing feature set of Google Maps, QR code and
Barcode Scanning etc.
Solution: - All such problems have a JavaScript library/API available for us to utilize and consume.
With a very minimal configuration or just about no configuration, we can add such scripts to
Advanced Scripts configuration of AwareIM and utilize the power of such libraries within AwareIM.
*(Covered in Previous Session on April 2nd, 2018)
21. TYPES OF PLUG-IN / EXTENSIONS
softserv.iawareim.com
Option #4 – Aware IM Advanced Script
Sample Code:
23. OTHER IMPLEMENTATIONS
softserv.iawareim.com
1. Zimbra Integration: Use of webhooks to send and receive calendar invites from
Appointments
2. Twilio : Send/receive Text messages or make/receive voice calls
3. Google Web Speech API : Add speech recognition on Aware IM web pages
4. Text Local : Send/receive Text messages using APIs
5. Twitter : Fetch profile photograph on the basis of email id
6. Simplified PDF Reports : Fetch data from database via Stored Procedure and convert to PDF
file
7. ABN lookup : Look up feature on the basis of ABN, Business Name, Trading Name or Legal
Name
8. High charts : Charts like 3D chart, Heat Map, Scatter chart, Bubble chart, Combinations chart
etc