Autolaunching a Contextless Action - tsgrp/HPI GitHub Wiki

OCMS has a route that allows an external application to auto-launch any contextless action configured for the application.

Recommendations for configuring this Bulk Upload Contextless Action

In admin, you can configure the modal to do a number of things. It is recommended that your modal is configured like the following:

  • modalSize: Extra Large - this configuration allows the modal to use up most of the page
  • keyboard: Disallow - this configuration prevents the modal from being closed with the ESC key
  • modalBackdrop: Static - this configuration prevents clicking outside the modal and closing it

Setting up the syntax of the URL

To access the header action, the url must look like this: {applicationRootURL}/{applicationRoot}/contextlessAction/{actionId}

Info on using Autolaunch specifically for Bulk Upload

URL Format

  • To launch the action: {applicationRootURL}/{applicationRoot}/contextlessAction/BulkUpload
  • To preselect the object type: {applicationRootURL}/{applicationRoot}/contextlessAction/BulkUpload?objectType={objectTypeId}
  • To configure properties:

{applicationRootURL}/ocms/contextlessAction/BulkUpload?oc_property[]={propertyIdToConfigure}~:~{propertyValue}

If your property has multiple values, continue to add values beginning with :. e.g. oc_property[]={propertyIdToConfigure}~:~{propertyValue}~:~{anotherPropertyValue}

In order to continue to add multiple properties, place an & at the end of your last property and start again. e.g. oc_property[]={propertyIdToConfigure}~:~{propertyValue}~:~{anotherPropertyValue}&oc_property[]={secondPropertyIdToConfigure}~:~{secondPropertyValue}and so on...

Some examples

  1. Picking the object type and one oc_property:http://localhost:9000/ocms/contextlessAction/bulkUpload?objectType=engDemo_drawing&oc_property[]=objectName~:~docname

  2. Multiple properties (one with two values) configured with an object type picked:http://localhost:9000/ocms/contextlessAction/bulkUpload?objectType=engDemo_drawing&oc_property[]=objectName~:~123456789&oc_property[]=folderTags~:~tag1~:~tag2

Something to note:

In the URL, some characters like spaces, [] and : might be rewritten with ASCII Encoding. Therefore, the URL can look like: ...&oc_property%5B%5D=insuranceDemo_claimantName~%3A~theClaimName

URL Restrictions

Depending on the browser, the amount of characters in a URL are limited. Therefore, if you have a lot of properties to configure, take note of the maximum size. On average, you should be able to configure ~35 properties.

  • Internet Explorer: 2047 chars
  • Chrome: ~7500 chars