application.open
Purpose:
Launch a target resource - a URL or a file attachment (EPC resource) - on a new tab in the users browser
Sample Usage:
import host from '@elliemae/em-ssf-guest'
...
let resource = {
target: {
entityId: "{{EPC_RESOURCE_ID}}",
entityType: "urn:elli:skydrive"
}
}
// Or - if you just want to navigate to a public URL
// let resource = {
// target: "{{URL_FOR_TARGET_RESOURCE}}"
// }
async function openModal(resource) {
try {
const applicationObject = await host.getObject('application')
const success = await applicationObject.open(resource)
console.log(success)
} catch (error) {
console.log({error})
}
}
open(resource)
import host from '@elliemae/em-ssf-guest'
...
let resource = {
target: {
entityId: "{{EPC_RESOURCE_ID}}",
entityType: "urn:elli:skydrive"
}
}
// Or - if you just want to navigate to a public URL
// let resource = {
// target: "{{URL_FOR_TARGET_RESOURCE}}"
// }
host.getObject('application')
.then(
(applicationObject) => {
applicationObject.open(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 a new tab in the users browser. 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:
Navigates user to a new tab on their browser, 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

