Arbortext Publishing Engine Programmer's Guide > The Arbortext Publishing Engine Sub-Process > Writing Arbortext PE アプリケーションs in JavaScript
Writing Arbortext PE アプリケーションs in JavaScript
An Arbortext Publishing Engine JavaScript application is a subroutine function which takes two parameters, a Java request object and a Java response object. The Arbortext PE サブプロセス uses the Rhino JavaScript package to make Java objects accessible to JavaScript programs. Essentially, this means that JavasScript Arbortext Publishing Engine applications run in the same programming environment as Arbortext Publishing Engine Java applications. For more information on making Java available to JavaScript using LiveConnect, refer to the Calling Java from JavaSctipt section of the Programmer's Reference.
The Arbortext PE Request Manager processes requests for Arbortext Publishing Engine JavaScript applications by passing requests with the f query parameter with the value javascript to the request function com.arbortext.e3.FunctionJavascript. The request function allocates an Arbortext PE サブプロセス and passes the request to the Arbortext PE アプリケーション Context (described in The Arbortext PE サブプロセス Application Context). The Arbortext PE アプリケーション Context creates the request and response objects. Then, it directs the Arbortext PE サブプロセス JavaScript interpreter to evaluate the function specified in the function parameter of the HTTP request. The function must be defined in a .js file in a custom\init directory or in a .js file in custom\scripts which is loaded from custom\init. The returned value for the JavaScript function is ignored because the data must be transmitted to the client in the response object.
A JavaScript Arbortext PE アプリケーション can access information about the request and set information to be returned as part of the response using the same interface as an Arbortext PE アプリケーション written in Java. Unlike a Java Arbortext PE アプリケーション, a JavaScript Arbortext PE アプリケーション has no initialization or termination component.
これは役に立ちましたか?