Skip to content

OpenDocument

Enable the app user to open a file at a specified location with a selected third party application.

The properties defined in Action are also applicable to this action.

OpenDocument Properties

Property Type Required Default
MimeType enum Optional "image/jpeg"
Path string Required
_Type const Required

MimeType

Specify the MIME type of the target document, only needed when opening document via OData Media direct binding on OData Service that doesn't support media content type annotation (@odata.mediaContentType).

For more information, see this. This value is required if the value of media content type annotation is not a valid Mime Type.

  • type: enum
  • default: "image/jpeg"

The value of this property must be equal to one of the known values below.

MimeType Known Values

Value Description
image/jpeg
image/png
image/gif
video/mp4
audio/mpeg
text/plain
text/html
application/pdf

Path

Path to the location of the file. Value can be: Prefixed with res:// (file is embedded in the main bundle); A full path (file is located in the application's sandbox system); Https url (http not supported)

  • type: string

_Type

  • type: const

The value of this property must be equal to:

"Action.Type.OpenDocument"

Action Result

Refer to the MDK Guide to understand what an action result is.

The success ActionResult of this action is an empty string. The failure ActionResult is an error message.


Examples

// OpenDocument.action
{
    "Path": "/path/to/document.pdf",
    "_Type": "Action.Type.OpenDocument"
}

{
    "Path": "res://document.pdf",
    "_Type": "Action.Type.OpenDocument"
}

{
    "Path": "https://some.externalserver.xyz/images/someimage.jpg",
    "_Type": "Action.Type.OpenDocument"
}
// OpenDocument for OData Media
{
    "Path": "/MyMDKApp/Services/MyOData.service/Products(1)/$value",
    "_Type": "Action.Type.OpenDocument"
}

{
    "Path": "/MyMDKApp/Services/MyOData.service/Products(1)/$value",
    "MimeType": "application/pdf",
    "_Type": "Action.Type.OpenDocument"
}

{
    "Path": "/MyMDKApp/Services/MyOData.service/{@odata.readLink}/$value",
    "MimeType": "{MimeType}",
    "_Type": "Action.Type.OpenDocument"
}

// OpenDocument for OData Stream
{
    "Path": "/MyMDKApp/Services/MyOData.service/Products(1)/Document",
    "_Type": "Action.Type.OpenDocument"
}

{
    "Path": "/MyMDKApp/Services/MyOData.service/Products(1)/Document",
    "MimeType": "application/pdf",
    "_Type": "Action.Type.OpenDocument"
}

{
    "Path": "/MyMDKApp/Services/MyOData.service/{@odata.readLink}/Document",
    "MimeType": "{MimeType}",
    "_Type": "Action.Type.OpenDocument"
}