555 views

Description

When trying to use the GlideJellyRunner class within a scoped application, the following error message appears:
"GlideJellyRunner is not allowed in scoped applications"

Steps to Reproduce

1. Create a scoped application (such as a record producer) that contains a script referencing a script include that utilizes the GlideJellyRunner class. For example:

gs.include("FormInfoHeader");
var fi = new FormInfoHeader();
var s = 'This OCIO Request was opened for you.<br/>';
s += 'The OCIO team will contact you shortly.<br/>';
s += 'You can track status from the <a href="home.do" class="breadcrumb" >Homepage</a> <br/>';
fi.addMessage(s);

2. Inside the globally scoped FormInfoHeader script include, reference the GlideJellyRunner() class:

gs.include("PrototypeServer");

var FormInfoHeader = Class.create();

FormInfoHeader.prototype = {
initialize: function() {
},

addMessage: function(message) {
var jr = new GlideJellyRunner();
jr.setEscaping(false);
jr.setVariable('jvar_text', message);
var m = jr.runFromScript('<g:form_info_header/>');
gs.addInfoMessage(m);
}
};

3. This code will fail with the following error: GlideJellyRunner is not allowed in scoped applications

Workaround

Use a global script include to wrap the unavailable API to make it available within the scoped application.

JellyRunner script include: 

var JellyRunner = Class.create();
JellyRunner.prototype = {
initialize: function() {
},
get: function(jelly) {
var jr = new GlideJellyRunner();
return jr.run(jelly);
},

type: 'JellyRunner'
};

 

Background script using GlideJellyRunner by wrapping it in global script include: 

var jelly = '<?xml version="1.0" encoding="utf-8" ?><j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"><div>Hello World</div></j:jelly>';

var jr = new global.JellyRunner();
gs.info(jr.get(jelly));


Related Problem: PRB656613

Seen In

Fuji Patch 10
Fuji Patch 12 Hot Fix 1
Fuji Patch 13 Hot Fix 1
Fuji Patch 7 Hot Fix 5
Geneva Patch 4

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2016-08-09 05:35:56
Published:2016-07-01