GIS Integration: Implementing the Custom Mapviewer

This appendix covers the following topics:

Implementing the Custom Mapviewer

This appendix covers the various setups and implementation steps required to integrate a Custom mapviewer for GIS integration. The information is applicable only for Oracle EBS Release 12.1.1 and above, for Enterprise Asset Management and Oracle Asset Tracking products.

GIS Integration - Implementing Custom Mapviewer

GIS Integration for Oracle EBS, EAM and OAT is available with Google Maps (Release 12.1.1) and with ESRI Maps (Release 12.1.3). However, the application provides an open architecture towards plugging in a custom web based HTML map viewer which can also be used for displaying assets and work orders (work order info will be available with 12.1.3 or higher versions only) on a map in the Asset Map page or Work Map page. The setup and implementation details required are documented in this appendix.

1. Setup Required to Render a Custom Map

To integrate the custom mapviewer, the following profile values must be set as indicated:

  1. CSI: Mapviewer Name: This should be set to 'Custom

  2. CSI: Customized Mapviewer Class: This value should contain the fully qualified name of the Java Class used to implement the customized mapviewer, for example, 'oracle.apps.csi.gis.custom.CustomisedMapviewer'.

    The details of implementing this java class are discussed below.

2. Class Structure of the Customized Class

This section describes a typical implementation to customize any web-based HTML mapviewer. Please go through the comments marked in bold in the example to understand how the passed object and the base Class methods can be reused.

The customized mapviewer class should extend the MapContentPreparer class and implement the interface MapContentDesign. This should be done because the mandatory method renderMap should have an implementation in the custom class.

In 12.1.1, we passed information required for rendering asset information in EAM and instance information in OAT.

In 12.1.3, we added support, using which customer can render work order information on the map.

package oracle.apps.csi.custom;

//Lists the necessary imports required.

import java.util.ArrayList;

import java.util.Comparator;

import java.util.Iterator;

import oracle.apps.csi.gis.webui.MapDetails;

//WoMapDetails and OpDetails is available 12.1.3 onwards only

import oracle.apps.csi.gis.webui.WOMapDetails;

import oracle.apps.csi.gis.webui.OpDetails;

import oracle.apps.csi.gis.webui.MapContentDesign;

import oracle.apps.csi.gis.webui.MapContentPreparer;

import oracle.apps.fnd.framework.webui.OAPageContext;

//Mandatorily need to extend MapContentPreparer and MapContentDesign

public class CustomisedMapviewer extends MapContentPreparer implements MapContentDesign

{

public CustomisedMapviewer()

{

}

public String renderMap(OAPageContext pageContext, ArrayList assetList)

{

/*Do configuration check and delegate call to your function to generate HTML content for the installed mapviewer here*

String htmlContent=renderInstalledMap(pageContext,assetList);

return htmlContent;

}

private String renderInstalledMap(OAPageContext pageContext, ArrayList assetOrWOList){

//For 12.1.3 add this additional piece of code to determine if flow is for Assets/Instance or Work //Order.The value returned if context is Asset/Instance is 'asset'.Else the value returned will be //'work'

String context=(String)pageContext.getSessionValueDirect("MapContext");

/*The below if block can be used since 12.1.3, in case customer wants to use both asset/instance as well as work order information. For 12.1.1 and 12.1.2 the assetOrWOList will only contain MapDetails object.*/

if(context.equals(“asset”)){

Comparator compMap=new MapDetails();

/*Use this to sort list in order of latitude,longitude if required .Typical use could be to merge popup details of assets if at same location.*/

Collections.sort(assetOrWOList,compMap);

/*The assetOrWOList contains MapDetails object in this case(for asset).This object contains information about the asset details.The below code snippet is just for illustration.Move this to a method or a separate class for code clarity *

Iterator it=assetOrWOList.iterator();

while(it.hasNext())/

//Get the object and use the getters to prepare your own details

MapDetails mapDetails=(MapDetails)it.next();

//Gets latitude in DD

mapDetails.getLatitude();

//Gets longitude in DD

mapDetails.getLongitude();

//Gets address

mapDetails.getAddress();

//Gets Instance Number(OAT) / Asset number(EAM)

mapDetails.getInstanceNumber();

//Gets Instance Description

mapDetails.getDescriptiveText();

//Gets Serial Number

mapDetails.getSerialNumber();

//Gets Item Name

mapDetails.getConcatenatedSegments();

//Gets Item Description

mapDetails.getItemDescription();

//Gets Owning Department(populated only for EAM)

mapDetails.getOwningDepartment();

//Gets internal instance id

mapDetails.getInstanceId();

//Gets Asset Area(populated only for EAM)

mapDetails.getAssetArea();

//Gets Asset Category(populated only for EAM)

mapDetails.getAssetCategory();

/*(i)Returns 'EAM' for EAM asset and application is used in EAM,

(ii)CSE' for instance which is not an EAM asset(Capital/Rebuildable only) and application is being used from OAT

(iii)'EAM-CSE' for instance which is also an EAM asset(Capital/Rebuildable only) and application is being used from OAT */

mapDetails.getAssetType();

//Gets Degree value for latitude

mapDetails.getDegreesLat();

//Gets Minutes value for latitude

mapDetails.getMinutesLat();

//Gets Seconds value for latitude

mapDetails.getSecondsLat();

//Gets Direction value for latitude (N,S)

mapDetails.getDirectionLat();

//Gets Degree value for longitude

mapDetails.getDegreesLng();

//Gets Minute value for longitude

mapDetails.getMinutesLng();

//Gets Seconds value for longitude

mapDetails.getSecondsLng();

//Gets Direction value for longitude(E,W)

mapDetails.getDirectionLng();

//Gets Organization Id (Only populated for EAM)

mapDetails.getOrgId();

}else{

Comparator compMap=new WOMapDetails();

/*Use this to sort list in order of latitude,longitude if required.

Typical use could be to merge popup details of assets if at same location.*/

Collections.sort(assetOrWOList,compMap);

/*The assetOrWOList contains WOMapDetails object in this case(for work).This object contains information about the work order details.The below code snippet is just for illustration.Move this to a method or a separate class for code clarity */

Iterator it=assetOrWOList.iterator();

while(it.hasNext())

{

//Get the object and use the getters to prepare your own details

WOMapDetails woMapDetails=(WOMapDetails)it.next();

//Gets the wipEntityId(Work Order internal id)

woMapDetails.getWipEntityId();

//Gets the Work Order name

woMapDeails.getWipEntityName();

//Gets latitude in DD format

woMapDetails.getLat();

//Gets longitude in DD format

woMapDetails.getLng();

//Gets asset number associated with the work order

woMapDetails.getInstanceNumber();

//Gets work order description

woMapDetails.getDescription();

//Gets serial number associated with work order

woMapDetails.getSerialNumber();

//Gets asset group associated with work order

woMapDetails.getConcatenatedSegments();

//Gets asset group internal id associated with work order

woMapDetails.getInventoryItemId();

//Gets asset group description associated with work order

woMapDetails.getItemDescription();

//Gets asset owning department

woMapDetails.getAssetOwningDepartment();

//Gets work order owning department

woMapDetails.getWoOwningDepartment();

//Gets user defined status for work order

woMapDetails.getUserDefinedStatus();

//Gets work order system status

woMapDetails.getSystemStatus();

//Gets the degree part of latitude in DMS format

woMapDetails.getDegreesLat();

//Gets the minute part of latitude in DMS format

woMapDetails.getMinutesLat();

//Gets the seconds part of latitude in DMS format

woMapDetails.getSecondsLat();

//Gets the direction part of latitude in DMS format

woMapDetails.getDirectionLat();

//Gets the degree part of longitude in DMS format

woMapDetails.getDegreesLng();

//Gets the minute part of longitude in DMS format

woMapDetails.getMinutesLng();

//Gets the seconds part of longitude in DMS format

woMapDetails.getSecondsLng();

//Gets the direction part of longitude in DMS format

woMapDetails.getDirectionLng();

//Gets the internal id associated with asset number of the work order

woMapDetails.getMaintenanceObjectId();

//Gets operation rows for the work order.The ArrayList returned by the below method contains oracle.apps.csi.gis.webui.OpDetails object.The OpDetails object contains the below info.The variables are self explanatory:

//String opSeq;

//String resourceSeq;

//String departmentCode;

//String departmentId;

//String resourceId;

//String resourceCode;

//String resourceInstanceId;

//String resourceInstanceName;

//oracle.jbo.Domain.Date fromDate;

//oracle.jbo.Domain.Date toDate;

woMapDetails.getOperations();

//Gets if work order is firm

woMapDetails.getFirmFlag();

//Gets the work order owning department internal id

woMapDetails.getWoOwningDepartmentId();

//Gets the maintenance object type of the associated asset number.

woMapDetails.getMaintenanceObjectType();

//Gets the scheduled start date of the work order

woMapDetails.getScheduledStartDate();

//Gets the scheduled end date of the work order

woMapDetails.getScheduledEndDate();

//Gets the PM Schedule Id of the work order

woMapDetails.getPmScheduleId();

//Gets the PM Schedule Name of the work order

woMapDetails.getPmScheduleName();

//Gets the duration of the work order

woMapDetails.getDuration();

}

/*Also the protected methods in MapContentPreparer could be reused. Customer can also override them for their own use. Refer section 3 below.Use the info above and the protected methods to generate HTML content as required by the mapviewer and return it in a java.lang.String object.*/

return "<html><body><h1>some map content</h1></body></html>" ;

3. Protected Methods of Class MapContentPreparer

Method Purpose
protected String loadAssetNumberDetailsLink(OAPageContext pageContext, MapDetails mapDetails) Used to prepare link URL for Asset Number details for EAM. This could be reused in a customized mapviewer implementation.
protected String loadInstanceNumberDetailsLink(OAPageContext pageContext,MapDetails mapDetails) Used to prepare link URL for Instance Number details for OAT. This could be reused in a customized mapviewer implementation.
protected String loadGraphicalDisplayPage(OAPageContext pageContext, MapDetails mapDetails) Used to prepare link URL for Graphical Hierarchy for OAT and EAM. This could be reused in a customized mapviewer implementation.
protected String formatHtmlContent(String unFormattedString) Used to replace quotes symbol with HTML escape sequence. This could be reused in a customized mapviewer implementation.
protected String loadCreateWorkRequest(OAPageContext pageContext,MapDetails mapDetailsEAM) Used to prepare link URL for Create Work Request for EAM. This could be reused in a customized mapviewer implementation.
protected String loadCreateWorkRequest(OAPageContext pageContext,MapDetails mapDetailsEAM) Used to prepare link URL for View Work Request for OAT and EAM. This could be reused in a customized mapviewer implementation.
protected String loadCreateWorkOrder(OAPageContext pageContext, MapDetails mapDetails) Used to prepare link URL for Create Work Order for EAM. This could be reused in a customized mapviewer implementation.
protected String loadViewWorkOrder(OAPageContext pageContext, MapDetails mapDetails) Used to prepare link URL for View Work Order for EAM and OAT. This could be reused in a customized mapviewer implementation.

The methods listed below were introduced in Release 12.1.3 and are not available in prior releases:

Method Purpose
protected String loadAssetNumberDetailsLink(OAPageContext pageContext,WOMapDetails woMapDetails) Used to prepare link URL for Asset Number details for EAM. This could be reused in a customized mapviewer implementation.
protected String loadUpdateWOLink(OAPageContext pageContext,WOMapDetails woMapDetails) Used to prepare link URL for Update Work Order for EAM. This could be reused in a customized mapviewer implementation.
protected String loadDebriefWOLink(OAPageContext pageContext,WOMapDetails woMapDetails) Used to prepare link URL for Debrief Work Order for EAM. This could be reused in a customized mapviewer implementation.
protected String loadAssignEmpLink(OAPageContext pageContext,WOMapDetails woMapDetails) Used to prepare link URL for Assign Employee Page for EAM. This could be reused in a customized mapviewer implementation.