Downloading Enterprise Graphics

Enterprise graphics are downloaded to the mobile device using the Common.service.drawing.Drawing.retrieveSvgFromServer function.

The plan type information is maintained in the active_plantypes table. This table has 2 fields each for the view, label data source and highlight datasource that will be applied to the SVG drawing.

The retrieveSvgFromServer function calls the DrawingService.highlightSvgDrawing which uses the plan type definition in the active_plantypes table to add the specified information to the base SVG file. Though the client side JavaScript adds events to the SVG file, it does not impact how the drawing is rendered.

When a user invokes the Download Floor Plan action on the mobile device the following occurs:

  1. The device calls DrawingSvgService and provides the floor id and the plan type
  2. The DrawingSvgService generates an SVG file based on the plan type parameters
  3. The device stores the SVG data on the mobile device file system or in the device database. The storage location depends on the value of the StoreMobilDocsAndPlansInDeviceDb application parameter.

The SVG highlight service is designed to use either the active_plantypes table or client-passed highlight parameters to apply highlighting.

Example :

The Common.service.drawing.Drawing.retrieveSvgFromServer function retrieves the SVG drawing from the server for the given primary key value and data source values

An example of retrieving a floor plan using the highlight parameters.


var highlightParameters = [ { 'view_file': "ab-eq-survey-eqauditxrm.axvw", 'hs_ds': "abEqSurveyEqauditxRmHighlight", 'label_ds': 'abEqSurveyEqauditxRmLabel', 'label_clr': 'gray', 'label_ht': '0.90' } ], primaryKey = {bl_id:'HQ', fl_id:'15'}; Common.service.Session.start() .then(function() { return Common.service.drawing.Drawing.retrieveSvgFromServer(primaryKey, null, highlightParameters); }) .then(function(svgData) { // svgData contains the SVG drawing // Do something with the SVG data ... return Promise.resolve(); }) .then(function() { return Common.service.Session.end(); }) .then(null, function(error) { // Handle errors and clean up... Ext.Msg.alert('', error); return Promise.resolve(); }) .done();