You can use a JavaScript Builder file to
deploy differential extensions created using the Extensibility Workbench. You cannot use this
procedure to deploy override extensions created using the Designer Workbench.
About this task
A JSB can be used if the base screen is launched through a JSB or through a JSB that uses a JavaScript library to render screens.
Note: UNIX/Linux file paths are used in the following procedure.
Procedure
- Install the application and build a WAR file for it.
- Deploy the WAR file on the server in the exploded format.
- Start the application server by passing the following
argument:
- Make sure that the changes made using the Extensibility
Workbench have all the Java™
files generated and saved.
- In the INSTALL_DIR/extensions folder of your installation directory,
create the following subdirectory:
application package name/webpages
- In the webpages subdirectory, replicate the directory structure
of the screen that you want to extend (relative to your deployment)
and copy in all of the script files generated by the Extensibility
Workbench.
For example, if you extend the Manage Flight Route screen (which uses the file path
application package name/flightRoute), you would copy all of the extension Java files into the
INSTALL_DIR/extensions/application package
name/webpages/application package name/flightRoute directory.
- Create a new JSB file in the same folder to launch these newly generated files. The
ExtensionJSFile_overlays.js files should be included before the
corresponding ExtensionJSFile.js files. You can use the JSB template of the Code Template
Generator to create the code for this file. You would have to paste the code into the new
file.
Sample code for
JSB:
?xml version="1.0" encoding="utf-8"?
project name="scuiIDE"
author="Your Company"
target name="flight_route"
!-- The name attribute in target is used to uniquely identify
this JSB in the application. It serves as its identifier.--
file="/extn/stk/flightRoute/test-all.js"
loadAfter="flightService"
!-- The loadAfter attribute in target is used to specify the
javascript library after which the current JSB should be rendered.--
allowDynamicLoad="true"
debug="True"
shorthand="False"
shorthand-list=""
include name="/extn/stk/flightRoute/test_overlays.js"/
include name="/extn/stk/flightRoute/test.js"/
/target
/project
- Create a new servlet to register the new JSB file. The
extn folder should be prefixed for LoadJSLibraryXml and loadIncrementalMashupExtnXml
calls.
Sample code for creating the servlet:
package jsbCreator;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import
com.sterlingcommerce.ui.web.framework.helpers.SCUIJSLibraryHelper;
import
com.sterlingcommerce.ui.web.framework.helpers.SCUIMashupHelper;
public class CreateServlet extends HttpServlet {
private static final long serialVersionUID =
4693417985837892469L;
public synchronized void init(final ServletConfig config)
throws ServletException {
//loads the JSB specified at the path
SCUIJSLibraryHelper.loadJSLibraryXml
("extn/stk/flightRoute/test.jsb", config.getServletContext());
//loads the mashup XML specified at the path
SCUIMashupHelper.loadIncrementalMashupExtnXml
("/extn/stk/flightRoute/test_mashup.xml", config.getServletContext());
}
}
- Package the servlet into a JAR file.
- Update the web.xml file with your customizations.
- Relaunch the application to display the extended changes.
The changes will appear overlaid on the base screen.