Developers Knowledge Base

Mobile and field solutions function as an extension of the overall enterprise, and include the ability to access, create, review and update geospatial data and asset information in real-time in the field.
Showing results for 
Search instead for 
Do you mean 

How to configure attribute of type blob

by Technical Evangelist on ‎07-06-2017 11:54 PM - edited on ‎09-13-2017 12:31 AM by Technical Evangelist (707 Views)

Blob attributes

 

Attribute form in both Mobile MapWorks Essentials and Advantage apps support blob attribute values. By blob attribute value we understand any binary data, currently: photo, video, signature and attachment.

In MMW Essentials read only blob attributes are available.

In MMW Advantage read and write blob attributes are available.

 

System overview

Screen Shot 2017-07-07 at 08.52.26.png

MMW retrieves blob related data from two sources:

  • Blob service allows to get and store blob files
  • WFS or DB are used to get and store the blob metadata. Blob metadata is all the infromation necessary to retrieve a blob.

 

Read blob 

App communicates with WFS/DB to get a blob metadata. Using the metadata it retrieves blob via a blob service.

 

Create blob

Application creates blob and corresponding blob metadata. Blob metadata is saved via WFS/DB.  Blob binary data is saved via a blob service.

 

Update blob

App communicates with WFS/DB to get a blob metadata and with a blob service to get a blob. Blob and its metadata are updated. Updated blob metadata is saved via WFS/DB.  Updated blob binary data is saved via a blob service. 

 

System setup

In order to make the system work three steps must be accomplished:

  1. Blob service is setup
  2. WFS Feature class is setup
  3. MMW configuration is created

How to setup blob service?

How to setup blob service

 

How to setup WFS Feature class?

Blob metadata is a text, that's why WFS/DB sources that will store blob metadata must contain a feature class with an attribute of type text.

 

How to create MMW configuration?

Assuming you already have a wfs or db feature source description configured (wfsFeatureType or dbFeatureType ) and the feature source configuration has at least one text attribute defined. In order to add blob attribute you must create a new feature source description with "blob" type. The blob feature source description must point to your existing feature source description. Description of blob attributes are in "attributesMetadata" property. Blob attributes name must match the corresponding WFS attribute names. The dataset definition which pointed the wfs feature source description must point the blob feature source description.

 

Note

  • Blob attributes definition must contains url property that points to blob service
  • Blob attributes metadata supports four types of attributes definition: "photo", "video", "signature" and "attachment"
    • Photo attribute supported content types are "image/jpeg" and "image/png"
    • Video attribute supported content type is "video/mp4"
    • Signature attribute content type must be "image/svg+xml"
    • Attachment atribute supported content types are "application/pdf", "application/msword", "application/vnd.ms-excel" and "image/tiff"

 

Example below presents how to create blob feature source description that points to wfsFeatureType feature source description with photo and signature attributes.

 

 

"featureSourceDescriptions":[  
    {  
        "id":"hydrantWfsBlobFsdId",
        "name":"blob",
        "type":"blob",
        "source":"hydrantWfsFsdId",
        "featureTypeMetadata":{  
            "crudPermissions":{  
                "isCreatePermitted":true,
                "isUpdatePermitted":true,
                "isDeletePermitted":true
            },
            "attributesMetadata":{  
                "photo":{  
                    "title":"Photo",
                    "type":"photo",
                    "contentType":"image/jpeg",
                    "serviceUrl":"http://111.111.111.111/BlobService",
                    "isReadOnly":false
                },
                "video":{
                    "title":"Video",
                    "type":"video",
                    "contentType":"video/mp4",
                    "service":"http://111.111.111.111/BlobService",
                    "isReadOnly":false
                },
                "signature":{  
                    "title":"Signature",
                    "type":"signature",
                    "contentType":"image/svg+xml",
                    "serviceUrl":"http://111.111.111.111/BlobService",
                    "isReadOnly":false
                },
                "attachment":{  
                    "title":"Attachment",
                    "type":"attachment",
                    "contentType":"application/pdf",
                    "serviceUrl":"http://111.111.111.111/BlobService",
                    "isReadOnly":false
                }
            }
        }
    },
    {  
        "id":"hydrantWfsFsdId",
        "type":"wfsFeatureType",
        "typeName":{  
            "localName":"TempHydrant",
            "namespace":"http://www.intergraph.com/geomedia/gml"
        },
        "primaryKeyFieldName":"FH_ID",
        "featurePrefix":"gmgml",
        "service":"hcwaWfsServiceId",
        "geometryFieldName":"Geometry",
        "geometryType":"Point",
        "featureTypeMetadata":{  
            "crudPermissions":{  
                "isCreatePermitted":true,
                "isUpdatePermitted":true,
                "isDeletePermitted":true
            },
            "attributesMetadata":{  
                "id":{  
                    "title":"Id",
                    "type":"number",
                    "isReadOnly":true
                },
                "photo":{  
                    "title":"Photo",
                    "type":"text",
                    "isReadOnly":false
                },
                "video":{  
                    "title":"Video",
                    "type":"text",
                    "isReadOnly":false
                },
                "signature":{  
                    "title":"Signature",
                    "type":"text",
                    "isReadOnly":false
                },
                "attachment":{  
                    "title":"Attachment",
                    "type":"text",
                    "isReadOnly":false
                }
            }
        }
    }
]

 

Full configuration sample

Sample configuration with blob attributes configured

Overview