application.openModal
Purpose:
Launch a target resource - a URL or a file attachment (EPC resource) - in the host applications native document viewer
Sample Usage:
import host from '@elliemae/em-ssf-guest'
...
let resource = {
target: {
entityId: "{{EPC_RESOURCE_ID}}",
entityType: "urn:elli:skydrive"
}
}
// Or, let resource = "{{URL_FOR_TARGET_RESOURCE}}"
async function openModal(resource) {
try {
const applicationObject = await host.getObject('application')
const success = await applicationObject.openModal(resource)
console.log(success)
} catch (error) {
console.log({error})
}
}
openModal(resource)
import host from '@elliemae/em-ssf-guest'
...
let resource = {
target: {
entityId: "{{EPC_RESOURCE_ID}}",
entityType: "urn:elli:skydrive"
}
}
// Or, let resource = "{{URL_FOR_TARGET_RESOURCE}}"
host.getObject('application')
.then(
(applicationObject) => {
applicationObject.openModal(resource)
.then(
(success) => {
console.log(success)
}
}
)
.catch(
(error) => {
console.log({error})
}
)
}
)
.catch(
(error) => {
console.log({error})
}
)
Interface:
Input:
Type: Object
An object containing a reference to the target resource to be launched in the host applications modal document viewer. The target may refer to an accessible resource on the internet (a URL), or to an EPC resource object. If referring to an EPC resource object received in a transaction request, or relayed back in a transaction response, map the objects id field to the entityId field as illustrated above.
Attribute | Description |
|---|---|
`$.target`
|
Can either be a The next two attributes are only required if you are passing a reference to an EPC |
`$.target.entityId`
|
Needed if trying to launch an EPC |
`$.target.entityType`
|
Needed if trying to launch an EPC |
Renders:
The host applications document viewer, displaying the specified target resource.
Returns:
Type: Promise
==> Resolved
String
"success"
==> Rejected
An error is raised, containing a message attribute with details on the error that occurred
{
message: "{{ERROR_DETAILS}}"
}
Updated about 24 hours ago

