Documente Academic
Documente Profesional
Documente Cultură
This documentation and related computer software program (hereinafter referred to as "Documentation") is for the end user's informational purposes only and is subject to change or withdrawal by ADC Austin, Inc. ("ADC") at any time. Documentation may not be copied, transferred, reproduced, disclosed, or duplicated, in whole or in part, without the prior written consent of ADC. Documentation is proprietary information of ADC and protected by the copyright laws of the United States and international treaties. Notwithstanding the foregoing, licensed users may print a reasonable number of copies of Documentation for their own internal use, provided that all ADC copyright notices and legends are affixed to each reproduced copy. Only authorized employees, consultants, or agents of the user who are bound by the confidentiality provisions of the license for the software are permitted to have access to such copies. To the extent permitted by applicable law, ADC provides Documentation "as is" without warranty of any kind, including without limitation, any implied warranties of merchantability, fitness for a particular purpose or noninfringement. In no event will ADC be liable to the end user or any third party for any loss or damage, direct or indirect, from the use of Documentation, including without limitation, lost profits, business interruption, goodwill, or lost data, even if ADC is advised of the possibility of such loss or damage. The use of any product referenced in Documentation and Documentation is governed by the end user's applicable license agreements. The manufacturer of Documentation is ADC Austin, Inc. 2008 ADC Austin, Inc. All trademarks, trade names, service marks, and logos referenced herein belong to their respective companies.
WebClient v1.4r1
Table of Contents
Chapter 1: Introduction Overview Current Limitations Using the Live Installer Chapter 2: Installation and Configuration Step 1: Verify Requirements Step 2: Installation Step 3: Configuring Apache Tomcat in Eclipse Step 4: Plex Model Configuration Plex v5.5 Model Configuration Plex v6.0 Model Configuration Step 5: Eclipse Project Configuration Create a New Dynamic Web Project Step 6: Setup Eclipse Environment to Enable the Compile of CA Plex-generated JAVA (PlexBuild) PlexBuild for Plex v5.5 PlexBuild for Plex v6.0 Step 7: PlexBuild Configuration Chapter 3: Deploying WebClient with J2eeProxy Introduction to J2eeProxy Create a New Servlet Configure J2eeProxy.prop Installing Javascript Resources Calling WebClient Applications from an External Application Configuring Session Timeout in Apache Tomcat Chapter 4: Deploying WebClient with Websydian Express for Windows/iSeries Introduction to WebClient Relay Service Pack WAR Files for Relay Service Import and Configure Web WAR modules in the Web Tools Project Configure RelayService.prop Generate and Build WebClient Business Process (Only Applies for Websydian Express v2.0) Web Module Deployment on Tomcat Server Create WebClient Business Process WebClient Business Process for Websydian Express v2.0 Create WebClient Business Process for Websydian Express v2.1 Run Websydian Express with WebClient Application 7 7 7 7 8 8 10 12 14 15 15 16 20 23 23 29 34 36 36 36 40 42 44 46 47 47 47 50 55 56 57 60 60 63 66
Page 3
WebClient v1.4r1
Chapter 5: Deploying WebClient with Websydian Express for Java Introduction to the Websydian Express Proxy (WxpProxy) Import and Configure Web WAR modules Configure ob600usr.properties Configure J2eeProxy.prop Web Module Deployment on Tomcat Server Creating the WebClient Business Process Running the Web Application Chapter 6: Customizing WebClient Attach point Bean controls Control action Control context Control name property Control reference Control template Default attach points for controls Name identifier Output path Page template Physical event Property modifier Root template Source Template generation Chapter 7: Troubleshooting What do I do if I get ''[PLEX0040] Location definition for WXPCOURSE55 is not complete. Attempting local function call.'' What do I do if I get the following error on Eclipse: Project PlexBuild is missing required library: 'C:\Eclipse\plugins\org.apache.ant_1.6.5\lib\ant.jar'. The project cannot be build until build path error are resolved". What do I do if I get "[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket"? What do I do if I get "[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt"? What do I do if I get "Party: Error creating socket (java.net.ConnectException: Connection refused: connect)"? What if my WebPlexBuild plugin does not show up on Plugin details in Eclipse? What do I do if I get "javax.servlet.ServletException: m_bStreamHandlerSet" error? Appendix A: Template Commands
69 69 70 74 75 75 77 79 82 82 82 82 83 84 84 84 85 85 86 86 86 87 87 88 88 90 90 90
90 91 91 91 92 93
Page 4
WebClient v1.4r1
-- comment ALERTS Action ActionArg AttachPoint ButtonGroup ButtonValue CheckedValue DataType DecLength Edit EditNameID EditProperty Embed EnableAction Event FOCUS FindControl GridEnd If IgnoreActions ImplName Length NameID OptSelected OptText OutTo Owner Owner Panel Param Parent Property Render Site State This This This Title
93 93 93 93 93 94 94 94 94 95 95 95 95 95 96 97 98 98 98 98 99 99 99 99 100 100 100 100 100 101 101 101 101 101 101 102 102 102 102 102
Page 5
WebClient v1.4r1
Type UncheckedValue Visible WsRes getVar(String var) jsonColVis jsonCols jsonImplNames jsonOptions jsonRows jsonSelected jsonValues processAction(String actionName [, Object arg] ) setVar(String var, Object val) value Appendix B: JDBC Driver Configuration Configuring and Using SQL Server 2000 Creating an ODBC Connection for SQL Server 2000 Configuring the SQL Server 2000 JDBC Driver in Eclipse Configuring and Using SQL Server 2005 Creating an ODBC Connection for SQL Server 2005 Configuring the SQL Server 2005 JDBC Driver in Eclipse
102 103 103 103 103 103 104 104 104 104 104 104 105 105 105 106 106 106 107 110 110 111
Page 6
WebClient v1.4r1
Chapter 1: Introduction
Chapter 1: Introduction
Overview
WebClient is an extension to the CA Plex development environment. It allows CA Plex-developed Java GUI applications to be deployed as web applications with minimal modifications. In order to use WebClient to deploy an application, you must: Have an application that is configured for and operational as a Plex Java client/server application Have a Java EE-compliant web application server Build and deploy the application using the Eclipse development environment WebClient consists of two principal components: A template generator which runs during the generate and build process. For each Plex GUI panel, a file is generated which contains the HTML and Javascript code needed to display the panel as a web page. The generated templates can be customized to alter the look and feel, implement new controls, and provide additional functionality to the panels. A servlet that is loaded into the Java EE application server at runtime. The servlet loads the Plex-generated Java application's class files and allows them to communication to and from the web user using the generated templates.
Current Limitations
WebClient is currently not able to produce a web version of every Plex Java application. There are limitations related to the web environment. In order for WebClient to work, your application must: Only use panels of type Dialog and Child Panel. Not attempt to interact directly with the local filesystem or computer. Not use Java beans or ActiveX controls unless they have been adapted with a custom WebClient template. (See Bean controls for more information.)
Page 7
WebClient v1.4r1
All system requirements necessary to install CA Plex 5.5 SP1 are also required. Microsoft Visual Studio.NET is not required for WebClient. Be sure to apply the CA Plex latest patches (PTF) before you start WebClient for Plex. http://supportconnectw.ca.com/public/cool/plex/downloads/plex55sp1/plex55sp1-solpatch.asp Java Java JDK 1.5 or higher is required.
A JRE may also be used. However, be aware that the character set support file charsets.jar is not installed by default on a JRE. If this file is not present, you
Page 8
WebClient v1.4r1
Eclipse Web Tools Platform (WTP) Eclipse 3.2 or higher. Eclipse WTP All-In-One Packages can be downloaded from http://download.eclipse.org/webtools/downloads/ It will be a zip file without automatic installer. Extract Eclipse zip file to your root directory. For Eclipse Europa (version 3.3) or later, you need to copy org.apache.jakarta_log4j plugin to your eclipse/plugins folder. The plugin is included as part of the WebClient distribution. Database Engine A database engine is required to run WebClient. If you do not have one installed, we recommend installing SQL Server 2005. It can be downloaded from http://www.microsoft.com/Sqlserver/2005/en/us/express.aspx. Websydian Express v2.0 or v2.1 for Windows (optional) Contact Websydian Support at support@websydian.com for information on how to obtain Websydian Express. Note If you do not already have Eclipse installed, you may elect to use the WebClient Live Installer. This will install Eclipse with WebClient already installed and configured.
Page 9
WebClient v1.4r1
Step 2: Installation
Web Client for Plex can be downloaded from http://connect.adcaustin.com/wwc/. You need to be a registered user to download the plugin. Web Client for Plex package include PlexBuild.zip contains eclipse project to build Plex functions WebsydianWebClient Deployment.zip contains WebsydianWebClient project folder, javascript and images folders WebsydianWebClient Sample60.zip contains wxpcourse CA Plex v6.0 sample model WebsydianWebClient Sample55.zip contains wxpcourse CA Plex v5.5 sample model WebsydianWebClient Development.zip contains the WebClientBuild plugin for Eclipse, WEBCLIENT group model WebsydianWebClient Doc.zip contains user guide, tutorial guide, installation guide, J2eeProxy.prop sample file, and RelayService.prop sample file. express20_win_update.zip contains a patch necessary to use with Websydian Express 2.0. If you have Websydian Express 2.1, you don't need this patch. If you want to use the WebClient Live Installer, you may also download it as well. WebClient LiveInstall.exe complete Eclipse installer with WebClient If you use the WebClient Live Installer, most of the configuration will be done for you, and you should skip ahead to Step 7: PlexBuild Configuration. Note If you are using Websydian Express 2.0, unpack the contents of express20_win_update.zip to your Websydian Express installation folder.
A plugin, called WebClientBuild, needs to be installed into Eclipse. If you have a previous version of WebClientBuild, delete it from your Eclipse plugins folder. Copy com.adcaustin.webclient.WebClientBuild to your Eclipse plugins folder. To confirm that you have the correct plugin, open Help About Eclipse SDK Click Plug-in Details button Sort by Plug-in ID.
Page 10
WebClient v1.4r1
Page 11
WebClient v1.4r1
If you already see the server that you want to use, then you can skip ahead to Step 4: Plex Model Configuration. If not, then proceed with the following instructions. Instructions These instructions will guide you through setting up an Apache Tomcat 5.5 server on Eclipse. Start the Eclipse WTP workbench. Open Window Preferences Server Installed Runtimes to create a Tomcat installed runtime. Click on Add to open the New Server Runtime dialog, and then select your runtime under Apache (Apache Tomcat v5.5 in this example).
Page 12
WebClient v1.4r1
Note
Ensure the selected JRE is a full JDK and is of a version that will satisfy Apache Tomcat (this scenario was written using SUN JDK 1.6.0_02). If necessary, you can click on Installed JREs to add JDKs to Eclipse. Click Finish. Go to Window Show View Servers. Right-click the server window Select New Server. Select Apache Tomcat v5.5 Server Click Next.
Page 13
WebClient v1.4r1
Instructions
The actions described in this document must be performed the first time you use the WebClient patterns in CA Plex 5.5SP1 and 6.0 models. The first thing to do is to add WebClient group model to the host group model of your application. This action is performed once per group model in the same way as adding any other library models to a host model. The Web Client library may be added during creation of a group model together with the CA Plex Pattern libraries and other library models needed by the model, or they can be added to an existing CA Plex group model. Once WebClient library is added to the group model and a local model has been defined, the objects in Websydian Web Client library models must be extracted to the local model. All Plex functions with panel should inherit from WEBCLIENT/~WebShell before generation. The FNC is ~WebShell should be the first triple in the pattern inheritance. Webclient only support dialog window type for tabstrip/frameproperty. If the function has FNC is ACTIVE/TabStrip, the function should inherit from FNC is WEBCLIENT/~TabStrip directly. If the function has FNC is UISTYLE/FrameProperty, the function should inherit from FNC is WEBCLIENT/~FrameProperty directly. To display web messages in web page, a plex function should inherit from WebMessages in WebUI. For example: XXX is a FNC WebMessages WebMessages is a WEBCLIENT/~WebUI WebMessages impl name NME WebMessages In the inheritance path for a WebClient function, the root template(WebShell) must precede page templates(WebMessages) for WebMessages to work. The Plex function should have triple inheritance path in the following order. For example: XXX is a FNC WEBCLIENT/~WebShell XXX is a FNC WebMessages
Page 14
WebClient v1.4r1
Page 15
WebClient v1.4r1
A Dynamic Web Application project, which represents the WAR file that is to be deployed to the application server. It contains the WebClient JAR files and static resources such as Javascript and CSS files. A Java EE Utility project, which contains the generated Plex Java source code, resource files, and generated web templates. Instructions We will first create a new Java EE Utility Project in Eclipse. Open File New Project. Select Java Project. Click Next >
A wizard will be displayed. The wizard is used to configure Java project. Any name is allowed but consider using a name that is self-explanatory. In this example, we use Plex60Project. For Project Layout, select Create separate source and output folders. Click Next >
Page 16
WebClient v1.4r1
Open Libraries tab. Click on Add External Jars to add ObRun.jar and pvAll.jar. ObRun.jar can usually be found in C:\Program Files\CA\AllFusion Plex r5.5\ObJava\Lib or C:\Program Files\CA\AllFusion Plex r6.0\ObJava\Lib. pvAll.jar can usually be found in C:\Program Files\CA\AllFusion Plex r5.5\CLASS550\PatternLibs\ACTIVE\Beans or C:\Program Files\CA\AllFusion Plex r6.0\class600\PatternLibs\ACTIVE\Beans. Click Finish.
Page 17
WebClient v1.4r1
Import obXXXclient.properties file into the Java Project. Right click on src folder Plex60Project project. Select Import File System Next > Go to ObJava directory under CA Plex folder and select ob550client.properties or ob600client.properties and click Finish.
Page 18
WebClient v1.4r1
Open obXXXclient.properties with Text Editor. The file is configured differently depending on what driver and data source you are using. It determines which database and port to connect to. The example below is using SUN JDBC driver.
Environment.Default.Driver=sun.jdbc.odbc.JdbcOdbcDriver Environment.Default.DataSource=jdbc:odbc:webclient Environment.Default.User=username Environment.Default.Password=password Environment.Default.Resources= Environment.Default.ImagePath=
The resources and imagepath above should be left blank. Save the changes before continuing.
Page 19
WebClient v1.4r1
A wizard will be displayed. The wizard is mainly used to configure Dynamic Web Project. Any name is allowed but consider using a name that is self-explanatory. For this example, the project name is Plex60Web. A Target Runtime needs to be specified. This example is using Apache Tomcat. Click Finish.
Page 20
WebClient v1.4r1
Click Yes to open J2EE perspective. Right-click on the web project, select Properties. Click on J2EE Module Dependencies Click OK Check WebsydianWebClient and Plex60Project
Add Websydian Web Client jar files. Click Add JARs Select all jar files from WebsydianWebClient folder Click OK.
Page 21
WebClient v1.4r1
Add Plex Runtime and pvAll jar files. Click Add External JARs Browse to CA Plex ObJava\lib folder Add ObRun.jar. Click Add External JARs Browse to CA Plex class600\PatternLibs\ACTIVE\beans Add pvAll.jar. Click Apply Click OK. Your Project Explorer should look like below.
Page 22
WebClient v1.4r1
Step 6: Setup Eclipse Environment to Enable the Compile of CA Plex-generated JAVA (PlexBuild)
PlexBuild is an Eclipse project that contains an Apache Ant script to move Plex Java source code into Eclipse for compilation. Ant allows Eclipse to create and run Ant buildfiles from the Eclipse workbench. On the classpath tab of the Ant Runtime preference page, additional classes defining tasks and types can be added to the Ant classpath. Because the Java generation paths are different for Plex v5.5 vs Plex v6.0 and above, please consult the following sections depending on your Plex version.
Import wizard will be displayed. Select archive file and click the associated Browse to locate PlexBuild.zip in your WebClient downloaded files. Under Projects, select PlexBuild. Click Finish to start the import.
Page 23
WebClient v1.4r1
If you see the following message: Project PlexBuild is missing required library: C:\Eclipse\plugins\org.apache.ant_1.6.5\lib\ant.jar. The project cannot be build until build path error are resolved please refer to Troubleshooting. To modify the Ant classpath globally, open Window Preferences. Expand ANT Select Runtime. Select Global Entries and click Add JARS... Expand PlexBuild Select the antlr.jar and PlexBuild.jar files. Click OK.
Page 24
WebClient v1.4r1
Create a new task that will move Plex source from Plex gen directory to Eclipse workspace. Select the Tasks tab and click Add Task... Enter movePlexSource
Page 25
WebClient v1.4r1
for the name and select PlexBuild.jar in the Location dropdown. Expand the tree view and Select MoveFilesAntTask.class, click OK.
Click Apply to save. Open the Properties tab and click Add Property... Enter "plex.workspace_loc" for the Name and "${workspace_loc}" for the Value Click OK.
Click Apply Click OK. To modify and create an ANT classpath for launch configuration, go to Run External Tools External Tools. In the External Tools window, click Ant Build and press the New button to create a configuration of a selected type. Name the new configuration PlexBuild. Set the Buildfile to ${workspace_loc:/PlexBuild/BuildConfig/build.xml} and Base Directory to ${workspace_loc:/PlexBuild/BuildConfig}.
Page 26
WebClient v1.4r1
Click Apply to save. Open the Refresh tab. Check on Refresh Resources upon Completion. The ANT task does not trigger the Eclipse workspace listeners so you have to force a refresh for Eclipse to see the new and changed files. Note If your workspace is small, refresh entire workspace is recommended. If it is a large workspace, you may want to limit it. Just be sure you have the resource you want refreshed selected, or you can manually refresh it.
Page 27
WebClient v1.4r1
Click Apply to save. Open the Build tab. Uncheck Build before launch.
Click Apply to save. Open Targets tab. Check movePlexSource and moveresources [default] as targets to execute.
Click Apply to save Click Run to run PlexBuild. You should see on your console that the functions are successfully built and moved to your project source folder.
Page 28
WebClient v1.4r1
Import wizard will be displayed. Select archive file and click the associated Browse to locate PlexBuild.zip in your WebClient downloaded files. Under Projects, select PlexBuild. Click Finish to start the import.
Page 29
WebClient v1.4r1
To modify Ant classpath globally, open Window Preferences. Expand ANT Select Runtime. Open the Properties tab and click Add Property... Enter "plex.workspace_loc" for the Name and "${workspace_loc}" for the Value Click OK.
Click Apply Click OK. To modify and create an ANT classpath for launch configuration, go to Run External Tools External Tools. In the External Tools window, click Ant Build and press the "New" button to create a configuration of a selected type.
Page 30
WebClient v1.4r1
Name the new configuration PlexBuild. Set the Buildfile to ${workspace_loc:/PlexBuild/BuildConfig/build.xml} and Base Directory to ${workspace_loc:/PlexBuild/BuildConfig}.
Click Apply to save Open the Refresh tab. Check on Refresh Resources upon Completion. Please note that if your workspace is small, refreshing the entire workspace is recommended. If it is a large workspace, you may want to limit it. Just be sure you have the resource you want refreshed selected, or you can manually refresh it. The ANT task does not trigger the Eclipse workspace listeners so you have to force a refresh for Eclipse to see the new and changed files.
Page 31
WebClient v1.4r1
Click Apply to save. Open the Build tab. Uncheck Build before launch.
Click Apply to save. Open Targets tab. Check movePlex60Source as targets to execute.
Page 32
WebClient v1.4r1
Click Apply to save Click Run to run PlexBuild. You should see on your console that the functions are successfully built and moved to your project source folder.
Page 33
WebClient v1.4r1
Instructions
Under the PlexBuild project, locate the file build.properties. Modify build.properties according to the Java project and Plex gen directory information. Expand PlexBuild Expand BuildConfig Select the build.properties file. Right-click and choose Open With Text Editor. In the build.properties view, find the line plex.import.project_name=xxxx. Edit the line to read plex.import.project_name=Plex60Project. This should be the name of the Eclipse project that is to contain the generated Java sources; it is not the name of the project that contains the ANT scripts.
Find the line plex.gen.root=XXX. Edit the line to read plex.gen.root=(your gen directory). Note that forward slashes will be used, instead of backward slashes.
Page 34
WebClient v1.4r1
Page 35
WebClient v1.4r1
Page 36
WebClient v1.4r1
Import the J2eeProxy-sample.prop file from WebClient downloaded files (WebClient-Doc.zip). Expand Plex60Web WebContent. Right-click WEB-INF Select Import Select File System Next >
Browse to your Websydian installation folder and check J2eeProxy.prop file or WebClient download folder and look for J2eeProxy-sample.prop. Click
Page 37
WebClient v1.4r1
Finish. Note that the name of this file is case sensitive when deployed in the WAR file (under WEB-INF). The name should be renamed to J2eeProxy.prop.
Import WebsydianWebClient project to your Eclipse workspace. WebsydianWebClient creates WebClient Web-generated templates based on CA Plex panel properties and WebClient system templates files. Right-click Plex60Project folder Select Build Path Configure Build Path Open Projects tab. Click Add button Check Websydian Web Client Click OK.
Open Libraries tab. Click Add JARs... Expand WebsydianWebClient project and select WebClientCommon.jar Page 38
WebClient v1.4r1
Click OK.
Right-click Plex60Project Select Enable Websydian Web Client for Plex. WebGenTemplates folder will be automatically created under Plex60Project folder. The console should display "Generating Web templates" with no error message.
Page 39
WebClient v1.4r1
Configure J2eeProxy.prop
In the file J2eeProxy.prop, located in the WEB-INF folder under WebContent of your Dynamic Web Project, change the properties parameters as follows. websydianserver.ipaddr: specifies the ipaddress for websydian server. For example: websydianserver.ipaddr=192.168.0.14 or computername websydianserver.tcpport: specifies the port for websydian server. For example: websydianserver.tcpport=11200 servlet.service: Name of the Application Service to use (Application Service Name). For example: servlet.service=Plex60Web servlet.log.level: The granularity of the log messages. Legal values are: TRACE, INFO, WARN, ERROR, FATAL.TRACE should only be used when debugging and in test environments. In a production environment use WARN or ERROR. For example: servlet.log.level: INFO servlet.log.file: specifies the path and the name of the log file. For example: servlet.log.file: C:/webclient.log webclient.entry: <package name>.<Plex function implementation name>. The entry point to the Web Application; i.e., the initial function to be called when a new session is created. Specify the full name of the class including package names. For example: webclient.entry=WXPCOURSEPNL.WXfF webclient.entry.timeout: The entry point that is called if a session has timed out on the server and the user attempts to resume the session. For example:WXPCOURSE55.sesstimeout webclient.entry.url.<path>: The entry point that is associated with a specific url. The url is determined by taking the components after the word "url", and changing dots to forward slashes (/). For example:webclient.entry.url.pub.item=com.foo.bar causes the relative url /pub/item to launch the function com.foo.bar. Wildcards are allowed and are specified with an asterisk(*). For example:webclient.entry.url.api.*=com.foo.api.* causes the relative url /api/myfunc to launch the function com.foo.api.myfunc. In both cases, the url specified is relative to the url-pattern in the servlet-mapping of the servlet in the web.xml file. The url-pattern must end with "/*" in order for this to work. For example, if the url-pattern is /webclient/*, then the url mappings above
Page 40
WebClient v1.4r1
will be relative to /webclient (e.g., /webclient/pub/item and /webclient/api/myfunc) servlet.errorpage.url: specifies a relative URL to an error page within the context of the WAR file where the Relay Service is deployed. On errors the Relay Service will then call this error page which then is responsible of generating a response to the user. The error page have to be placed within the scope of the WAR-file where / (slash) indicates the root of the WAR-file. For example: servlet.errorpage.url: /Plex60Web/js/error.jsp resurl.com.adcaustin.webclient: URL reference for JavaScript resource and style sheet (CSS). For example: resurl.com.adcaustin.webclient=/Plex60Web Define.WSACTION: /<DynamicWebProject>/<ServletName>. URL reference for servlet. For example: Define.WSACTION=/Plex60Web/WebClientServlet servlet.statistics.level: Set this option to cause the servlet to gather some runtime statistics on called functions. The valid levels are as follows: 1 = Collect data on called functions grouped by function type and function name. The number of times each function is called as well as its inclusive run time. After each request, a report is logged to the servlet log at the INFO log level. For example: servlet.statistics.level=1 Save changes.
Page 41
WebClient v1.4r1
Create a folder for Javascript files. Right-click the WebContent folder of your web project Select New Folder Enter js for the new folder name. Import javascript files from WebClientDojo folder. Right-click js folder Select Import Select File System Browse to your directory that contains javascript folder Click Finish. Create a new folder for image files. Right-click WebContent folder Select New Folder Enter images for the new folder name. Import image files from deployment resource folder. Right-click images folder Select Import Select File System Browse to your directory that contains images folder Click Finish.
Create a new folder named css for css files. Your Package Explorer should look like below.
Page 42
WebClient v1.4r1
Start Websydian Express Server. Click the Windows Start menu and select All Programs Websydian Websydian Express v2.0 for Windows Start Websydian Express. Right-click Plex60Web Select Run As Run on Server. Choose an existing server Click Next > Make sure Plex60Web is on configured projects column Click Finish.
Page 43
WebClient v1.4r1
Page 44
WebClient v1.4r1
In the WebClient documentation folder, there exists a sample custom servlet, called deeplink.java, which will help you create a servlet that sends parameters to a Plex function. Copy and paste the code from deeplink.java to the newly created servlet. Change the package name to deeplink.
The parameters are passed to WebClient using an XML format. Locate the variable plexXML in the source code; this contains the XML data that is sent. Modify the input variable name and field name to match those expected by the WXwF function.
final String plexXML = "<PlexFunction xmlns=\"http://adcaustin.com/ws-plex/1.0\"> <InputVariables Name=\"Input\"><Field Name=\"ItemID\">"+ encodeToXML(myVariable) + "</Field></InputVariables> </PlexFunction>";
Modify webclient URL from final String webclientURL = "/webclient/test"; to final String webclientURL = "/WebClientServlet/InsertItem";
Page 45
WebClient v1.4r1
Now the InsertItem servlet will forward its requests to the WebClient servlet. Save changes. The last change that needs to be made is the servlet mapping. It needs to have the characters /* at the end to match against any parameter that is passed in the URL. Open web.xml and change deeplink servlet mapping to <url-pattern>/InsertItem/*</url-pattern> Save changes. Build the web project and publish to the server. To call the function, open a web browser and enter the following URL. http://localhost:8080/Plex60Web/InsertItem/001 URL format: http://<host>/<Context Root>/<Servlet Mapping>/<parameter>
The code above will set the session to time out in 30 minutes. Save changes. Open J2eeProxy.prop and find webclient.entry.timeout. Specify the name of the function that you want to display when the session is timed out. Save changes.
Page 46
Note
The RelayService is not suitable for deploying with Websydian Express where Websydian Express runs on a Java application server directly. For this mode, see Deploying WebClient with Websydian Express for Java.
Instructions
These instructions will guide you setting up WebClient for Relay Service
Page 47
Enter basic relay service servlet information and click Next >
Page 48
Copy webservercomponent.prop and rename it to RelayService.prop in \Websydian\Express v2.0 for Windows\Web Server Component. Please verify that RelayService.prop is in the right case as Apache Tomcat is case sensitive.
Page 49
Import and Configure Web WAR modules in the Web Tools Project
From the J2EE Perspective, go to Open Window Open Perspective Other Select J2EE or Java EE and click OK.
Right-click on the Project Explorer window. Select Import WAR File. Browse to the location where your WAR file is located (Websydian Express installation folder). Keep your default project name and choose Apache Tomcat as target runtime. Then click Next >
Page 50
Open WebContent/WEB-INF/web.xml with text editor Change "com.websydian.pka.servlet.RelayService" to "com.adcaustin.webclient.relayservice.WebClientRelayService" between <servlet-class></servlet-class>
Delete "C:/Program Files/Websydian/Express v2.0 for Windows/Web Server Component/webservercomponent.prop" between <param-value></param-value>. Save changes.
Right-click on WEB-INF under WebContent and select Import. Import File System and click Next >
Page 51
Select RelayService.prop in\Websydian\Express v2.0 for Windows\Web Server Component and click Finish.
Add web library dependency. Add WebsydianWebClient and Plex60Project projects to the web project J2EE Module Dependencies to associate Java projects to the web library project. Right-click express20 project. Select Build Path Configure Build Path Open J2EE Module Dependencies Check WebsydianWebClient and Plex60Project.
Page 52
Add WebsydianWebClient jar files. Click Add JARs Expand WebsydianWebClient Select all jars Click OK.
Add ObRun.jar and pvAll.jar. Click Add External JARs Browse to CA Plex ObJava\lib folder Add ObRun.jar. Click Add External JARs Browse to CA Plex class600\PatternLibs\ACTIVE\beans or class550\PatternLibs\ACTIVE\beans Add pvAll.jar.
Page 53
Click Apply Click OK. Your Project Explorer should look like below.
Page 54
Configure RelayService.prop
Open RelayService.prop and add the parameter below at the end of the file.
servlet.webclient.signatureencoding=ISO-8859-1
Save changes.
Page 55
Generate and Build WebClient Business Process (Only Applies for Websydian Express v2.0)
Skip this step if you have Websydian Express v2.1 Open the WebPlexWin.mdl model. Go to Tools Generate and Build Build Generate and Build Options System Definitions Select System Name Click Properties. In 32-bit C++ Build Check Use pre-built libraries. For example: Libraries: C:\ProgramFiles\Websydian\Websydianv6.0\Development\Express\Win\websyd.lib; C:\ProgramFiles\Websydian\Websydianv6.0\Development\Express\Win\wsexpress.lib; C:\Program Files\CA\AllFusion Plex r5.5\CLASS550\PatternLibs\obpt32.lib Header Directories: C:\Program Files\Websydian\Websydian v6.0\Development\include Generate and build WebPlexProcessEntryPoint function. Copy WPWebPlx.dll, WPWebPlx.pnl, WCSNDHDR.dll and from release folder to C:\ProgramFiles\Websydian\Express v2.0 forWindows\Application Service\WebsydianExpress. Copy the file EXPRESS.INI then rename it to WSEXPRSS.INI in C:\Program Files\Websydian\Express v2.0 for Windows\Application Service. Open settings.cmd Change the line "set APP_NAME" to: set APP_NAME=WSEXPRSS. Run the script file "_SQLScripts\WSPRPVP_Table.sql" against database named WebsydianExpress20 in SQL Server Management Studio or Enterprise Manager.
Page 56
Select Tomcat v5.5 server Click Next > Add express20 project to configured projects column Click Finish.
Page 57
Start Tomcat server. Right-click the Tomcat server Select Start. Start Websydian Express server. Click the Windows Start menu and select All Programs Websydian Websydian Express v2.0 for Windows Start Websydian Express. Right-click on express20 project and select Run As Run on Server. Select Tomcat server and click Next >
Add the project from available projects column to configured projects column and click Finish.
Page 58
Page 59
Create a new business process. Expand Content loader Click Business Processes. Click +Insert. Enter the following business process information. Name: webclient Program name: WPWebPlx Description: webclient Check Create Default Presentation
Page 60
Find the business process created above Select Presentations. Click +Insert to create a new presentation for the business process. You can enter any value for the Name (just remember it for later use) but keep the Template suffix and Template override name empty. Click Properties for the newly created presentation and define the following properties for the presentation: WCENTRY: <Package Name>.<Plex Function Implementation Name>. It contains the class name for the Plex functions that should be executed by the web client runtime. For example: Property Name: WCENTRY. Value: WXPCourse2.WXuF WCURL: /<endpath>. The endpath of the URL. Any name is allowed. This is used by the web client servlet so it knows that it should execute the above Plex function instead of redirecting control to the application service. For example: Property Name: WCURL. Value: /webclient. Click Done.
Expand Site structure menu Click Site Structure. Expand Main Frameset Click Menu Menu Loader Click +Add. Select Create new site element Click Next => Select webclient. Enter the following basic business process information. Menu item text: java Alignment: Left Sequence: 10
Page 61
Click Next => Add Administrator to the assigned roles column Click Finish. Expand Templates Select Folders Click +Insert to create a new folder. Enter the following information for the new folder and click +Insert.
Click Folder Lists Click Update for Admin folder list Click Next => Click +Add to add com.adcaustin.webclient folder to the folder list Click Select com.adcaustin.webclient folder.
Click Finish. Create a new folder named com.adcaustin.webclient in C:\Program Files\Websydian\Express v2.0 for Windows\Application Service\html. Create a new file named webclient.HTM in the new folder. This new file should be named according to the value of <endpath> in WCURL property. Expand Welcome Click Logout- > Click Logout again. Page 62
Page 63
Add properties information. WCENTRY: <Package Name>.<Plex Function Implementation Name>. It contains the class name for the Plex functions that should be executed by the web client runtime. For example: Property Name: WCENTRY. Value: WXPCOURSE60.WXs4F WCURL: /<endpath>. The endpath of the URL. This is used by the web client servlet so it knows that it should execute the above Plex function instead of redirecting control to the application service. For example: Property Name: WCURL. Value: /webclient. Click Done.
Expand Site structure menu Click Site Structure. Expand Main Frameset Select Menu Menu Loader Click +Add. Select "Create new site element" Click Next => Select the new presentation.
Enter the following basic business process information. Menu item text: java Alignment: Left Sequence: 10 Display in frame: Main
Page 64
Click Next => Add Administrator to the assigned roles column Click Finish. Expand Templates Select Folders Click +Insert to create a new folder. Enter the following information for the new folder and click +Insert.
Click Folder Lists Click Update for Admin folder list Click Next => Click +Add to add com.adcaustin.webclient folder to the folder list Click Select com.adcaustin.webclient folder.
Click Finish. Expand Welcome Click Logout- > Click Logout again. Create a new folder named com.adcaustin.webclient in C:\Program Files\Websydian\Express v2.1 for Windows for Plex 5.5\Application Service\html or C:\Program Files\Websydian\Express v2.1 for Windows for Plex 6.0\Application Service\html Create a new file named webclient.HTM in the new folder. This new file should be named according to the value of <endpath> in WCURL property. Expand Welcome Click Logout- > Click Logout again.
Page 65
Create a new folder for image files. Right-click WebContent folder Select New Folder Enter images for the new folder name. Right-click images folder Select Import Select File System Browse to your directory that contains images folder Click Finish.
Page 66
Create a new folder named css for css files. Open a web browser. Type the following url http://localhost:8080/express20/site/basicsite Login information: User: WSADMIN Password: ADMIN Your browser should look like below.
Click java. The web client application should now be launched in the main frame.
Page 67
If your images file does not show on the browser, restart Apache Tomcat server.
Page 68
WebClient v1.4r1
Instructions
The following instructions will guide you through the configuration and deployment of WxpProxy for a WebClient application.
Import the WebsydianWebClient project to your Eclipse workspace. Go to File Import and select General Existing Projects into Workspace. Click Next >. Import wizard will be displayed. Select archive file and click the associated Browse... to locate WebsydianWebClient.zip in your WebClient downloaded files. Under Projects, select WebsydianWebClient. Click Finish to start the import. Right-click your Plex Java Project Select Build Path Configure Build Path Open projects tab. Click Add... button Check WebsydianWebClient Click OK.
Open Libraries tab. Click Add JARs.... Expand WebsydianWebClient and select WebClientCommon. Click OK.
Page 69
WebClient v1.4r1
Right-click on your Plex Java Project Select Enable Websydian Web Client for Plex. WebGenTemplates folder will be automatically created under your project folder. Refresh your project if it does not show WebGenTemplates folder. The console should display "Generating Web templates" with no error message.
Page 70
WebClient v1.4r1
Right-click on the Project Explorer window. Select Import WAR File. Browse to the location where your WAR file is located (Websydian Express Installation folder). Keep your default project name and choose Apache Tomcat as target runtime. Then click Next >
Page 71
WebClient v1.4r1
Open WebContent/WEB-INF/web.xml with Text Editor Change "com.websydian.pka.servlet.J2eeProxy" to "com.adcaustin.webclient.servlet.WxpProxy" between <servlet-class></servlet-class>
Right-click express21java project. Select Build Path Configure Build Path Open J2EE Module Dependencies Check WebsydianWebClient and your Plex Java Project.
Page 72
WebClient v1.4r1
Add WebsydianWebClient jar files. Click Add JARs... Expand WebsydianWebClient. Add asm.jar, asm-analysis.jar, asm-commons.jar, asm-tree.jar, asm-util.jar, commons-httpclient.jar, WebClientCommon.jar and WxpServletProxy.jar. Click OK. Add express21java jar files. Click Add External JARs... Browse to Websydian\Express v2.1 for Java\webcontainer\WEB-INF\lib folder Add all jar files. Add pvall.jar file. Click Add External JARs... Browse to CA Plex class600\PatternLibs\ACTIVE\beans Add pvAll.jar.
Page 73
WebClient v1.4r1
Click Apply Click OK. Your Project Explorer should look like below.
Configure ob600usr.properties
Expand express21java project Expand Java Resources: src folder Open ob600usr.properties file with Text Editor. The file is configured differently depending on what driver and data source you are using. The example below is using JTDS JDBC Driver.
WebClient v1.4r1
Configure J2eeProxy.prop
Expand express21java project Expand WebContent folder Expand WEB-INF folder Open J2eeProxy.prop and add the parameter below at the end of the file.
websydianserver.log.level=TRACE websydianserver.log.file=C:/Program Files/Websydian/Express v2.1 for Java/logs/websydia websydianserver.licensefilepath=C:/Program Files/Websydian/Express v2.1 for Java/licens servlet.log.level=ERROR servlet.log.file=C:/Program Files/Websydian/Express v2.1 for Java/logs/J2eeProxy.log servlet.plex.eventdispatchername=com.websydian.express.client.WSDispaJ servlet.service=J2EEPROXY servlet.websydianserver.wrap=TRUE websydianserver.ipaddr=localhost websydianserver.tcpport=0 servlet.plex.propertyfilename= servlet.plex.session.timeout=-1 servlet.plex.function.init=com.websydian.express.client.WSSVLINI servlet.plex.function.destroy=com.websydian.express.client.WSSVLDST servlet.plex.propertyfilename=this_value_is_not_used servlet.plex.session.timeout=-1 servlet.plex.function.init=com.websydian.express.client.WSSVLINI servlet.plex.function.destroy=com.websydian.express.client.WSSVLDST # Define standard runtime for Websydian Express for Java servlet.plex.runtime.express.appclass=ObRun.ObFunction.ObUserApp servlet.plex.runtime.express.propertyfilename= servlet.plex.runtime.express.allocation=PerServlet, 500, unlimited servlet.plex.runtime.express.environmentname= servlet.plex.runtime.express.packages=com.websydian.express # User-defined runtime servlet.plex.runtime.user.appclass=com.adcaustin.webclient.WxpWebClientApp servlet.plex.runtime.user.propertyfilename= servlet.plex.runtime.user.allocation=PerFrame, 1, 1 servlet.plex.runtime.user.environmentname= servlet.plex.runtime.user.packages=* # The search order to use when mapping a function to a runtime servlet.plex.runtime.order=express, user
Save changes.
Page 75
WebClient v1.4r1
Select Tomcat v6.0 server Click Next > Add express21java project to configured projects column Click Finish.
Start Tomcat server. Right-click the tomcat server Select Start. Right-click on express21java project and select Run As Run on Server. Select Tomcat server and click Next >
Page 76
WebClient v1.4r1
Click Finish. Go to http://localhost:8080/express21java/site/basicsite/admin Log in to the admin site to setup the basicsite. Login information.
Create a new business process. Expand Content loader Click Business Processes. Click +Insert. Enter the following business process information. Page 77
WebClient v1.4r1
Name: Employee Program name: WXs4F Description: Employee Check Create Default Presentation.
Expand Site structure menu Click Site Structure. Expand Main Frameset Click Menu - Menu Loader Click +Add. Select "Create new site element" Click Next => Select Employee. Enter the following basic business process information. Menu item text: Employee Alignment: Left Sequence: 10 Display in frame: Main
Click Next => Add Administrator to the assigned roles column Click Finish. Expand Templates Select Folders Click +Insert to create a new folder. Enter the following information for the new folder and click +Insert. Description: com.adcaustin.webclient Template path relative to root: com.adcaustin.webclient URL reference for resources: /express21java
Page 78
WebClient v1.4r1
Click Folder Lists Click Update for Admin folder list Click Next => Click +Add to add com.adcaustin.webclient folder to the folder list Click Select com.adcaustin.webclient folder.
Click +Finish. Create a new folder named com.adcaustin.webclient in C:\Program Files\Websydian\Express v2.1 for Java\html. Expand Welcome Click Logout- > Click Logout.
Page 79
WebClient v1.4r1
Create a new folder for images. Right-click WebContent folder Select New Folder Enter images for the new folder name. Import image files from deployment resource folder. Select Import Select File System Browse to your directory that contains images folder Click Finish.
Page 80
WebClient v1.4r1
Click on Employee link. The web client application should now be launched in the main frame.
If your images file does not show on the browser, restart Apache Tomcat server.
Page 81
WebClient v1.4r1
Bean controls
Some controls are implemented in Plex as a Java Bean control. Although Java Beans cannot be loaded in WebClient, their functionality can be emulated through the use of a custom template and customized source code objects in Plex. The name property of the bean control is the default name of template that is used (without the .ctrl extension.) In the source code objects, variables in the control may be created using names which you define. The methods that do this are called setVar and getVar and they are located in the class WebBeanData. The source code objects may also call the method processAction to send a control action to the template. In the bean control's template, the variables may be retrieved using the /(!Var) control command. If the bean control sends a value to the server as a request parameter, the data in the parameter is taken to be a JSON object, and bean's variables are updated with the keys and values of that object. Example See DojoTab.ctrl in the distribution for an example of a tab control implemented in Javascript.
Control action
If the value of a control changes, the rendering on the web browser needs to be updated. WebClient supports this two different ways. In the first method, page refresh, when the value of a control changes, the web browser is instructed to reload the page from the server. This will cause the template to be re-evaluated and the user will see the new data. This is the default method that is used to update the display. In order to avoid page reloads, a second method is supported. In this method, called action updates, the page is not reloaded. Instead, the server sends back commands corresponding to only the changes that have occurred. These are called actions. An Page 82
WebClient v1.4r1
action has a name and an optional argument. Each action is expanded into a block of Javascript code that is then used to incrementally update the screen. In order to use action updates with a control, the desired actions must be enabled for that control. This is accomplished by using the /(!EnableAction) template command within the control template for that control. The names of the actions that are going to be handled by the template are specified as parameters to that command. Then the /(!Action) command can be used to specifiy that commands that should be expanded when that action occurs. Ordinarily, the /(!Action) command is placed within an attach point that is within a Javascript output path. The following actions are defined: SetValue sent when the value of a field has been changed. SetState sent when the state of the control has been changed. SetFocus sent when the control is to be given focus. Refresh sent to a panel or site control when the panel needs to be refreshed. The argument is the panel control. Alert sent when a Dialog Message or Status Message has been sent to the panel. Enquiry sent when an Enquiry Message has been sent to the panel. Load sent to a site control when the child panel has been loaded. The argument is the panel control. Hide sent to a site control when the child panel has been hidden. Show sent to a site control when the child panel has been shown. Grid.Insert sent to a grid when a row has been inserted. The argument is the row. Grid.Clear sent to a grid when the grid has been cleared. Grid.Remove sent to a grid when a row has been removed. The argument is the row. Grid.Update sent to a grid when a row has been updated. The argument is the row.
Page 83
WebClient v1.4r1
Control context
When the template generator is in a control context, it is expanding a template for a specific control. This means it is possible to use control commands to access that control. The template generator is automatically in a control context when it is expanding a control template. It is also in a control context when expanding the /(FOCUS) command.
Control reference
Certain template commands are not intended to expand to text, but rather are used to refer to a control to which another command is addressed. The next parameter of the command is taken to be the next command to be applied. Any control with a control name can be used as a control reference, by giving the control name as a command. In addition, there are special template commands which are useful as control references. Example If you have a control named Grid1 and wish to access its size, you can may write /(!Grid1:Size). Here, Grid1 is functioning as a control reference command. If you have a column heading control and need the NameID of the corresponding edit control, you can write /(!Edit:!NameID). /(!Edit) is a control reference command.
Control template
A control template is used to produce HTML and Javascript for a control that is on a Plex panel. A control template is expanded and placed in the attach point that is associated with the control via the control name property. The default control template that is used is in a file that is named by taking the type for of the control and prefixing it by Web. The extension that is used is .ctrl. For example, the default control template used for edit fields is WebEdit.ctrl. These control files are normally located in the SysTemplates folder.
Page 84
WebClient v1.4r1
To override and specify a specific control template that is to be used for a control, specify the template= parameter in the control name property for that control. The value of this parameter will be suffixed with the extension .ctrl and used instead of the default control template. Example If you have a custom template called ToggleButton.ctrl and wish to use this template for a check box control, you may set the control name parameter template=ToggleButton.
Name identifier
If a Plex panel contains child panels, the control name of a control, as given by /(!Name), may not uniquely identify a control in the web browser. This is because even though the control is unique within a page, it still may appear in multiple child panels and create duplicates.
Page 85
WebClient v1.4r1
To resolve this issue, use the /(!NameID) command to generate a unique name identifier. This name will be prefixed by both the site's control name and the child panel's name. This name is suitable for use an identifier in the web browser's DOM.
Output path
WebClient can send a response back to the client of several different types. The output path is a parameter that determines what type of response is sent. In addition, some response formats can include hierarchical data. The output path can be used to index into that data. The main output paths supported are: html the response mime-type is text/html. The contents are escaped according to HTML rules. json the response mime-type is application/json. The contents are encoded as a valid JSON expression. For the json output type, a hierarchical naming scheme is possible. After the json component, which must be the top-level component in the path, a dot-separated path may be placed. The components of this path are created as JSON sub-objects in the JSON path. Example Suppose a response is created with the command /(!OutTo:json.x.y.z)abc/(!OutTo). If this response is returned to a web browser and loaded as a JSON expression and assigned to the variable t, then t.x.y.z == "abc".
Page template
A page template is an optional template that is expanded during the template generation process. A page template can place data into attach points that are defined by either the root template or another page template. See Also: Template generation
Physical event
The Plex physical events which may be handled in WebClient are: Pressed Load Grid Double Click Select Mouse Down Mouse Move Mouse Up
Page 86
WebClient v1.4r1
Gained Focus Lost Focus Changed Updated Select Menu Query Close Modified See Also /(!Event)
Property modifier
A property modifier is an optional parameter which may be placed after the property name parameter in a /(!Property) command. The following property modifiers are available: x for a property value which is a coordinate in the format x y, expands to x. y for a property value which is a coordinate in the format x y, expands to y. hexcolor for a property value which is a color in the format r g b, expands to the color in HTML #rrggbb notation. htmlaccel for a property value which uses the & character to indicate that the next character is to be underlined, converts this notation to HTML using the <u> tag. htmlbr for a property value which uses the ^ character to indicate a line break, converts this notation to HTML using the <br> tag. nbspifempty if the property value is blank or consists only of spaces, expands to instead. Otherwise, leaves the value as is. html marks that the value is to be treated as HTML source. js marks that the value is to be treated as JavaScript source.
Root template
Page 87
WebClient v1.4r1
The root template is first template that is expanded during the template generation process. The default root template is called WebShell-root.wcli. It expands to the basic HTML and Javascript templates where all other template data is placed, via page templates and control templates. See Also: Template generation
Source
Text that is expanded into the template can be of two types, source or data. By default, any text that is placed into a template at run-time is considered data. When text is considered data, it cannot contain markup commands such as HTML tags or Javascript expressions. If the data contains any special characters that would have meaning to the HTML or Javascript parser, such as angle brackets, ampersands, or quote markers, they will be automatically escaped appropriately for those parsers. Specifically, if text is handled as data, and the output path is set to an HTML fragment, the characters less-than, greater-than, and ampersand are escaped with entity references. For example, <foo> is encoded as <foo> If text is handled as data, and the output path is a Javascript fragment, the text is encoded as a valid Javascript string literal constant. This includes all quotation marks automatically. For example, abc"def is encoded as "abc\"def". If you have some text that is to be expanded at run-time and interpreted as an actual HTML tag or Javascript expression, with escaping, you must inform WebClient to handle it as source. This can be accomplished with a property modifier parameter on the property command.
Template generation
When generating a template for a panel, WebClient first attempts to locate a root template. The root template is a template available in the classpath such that the following two conditions are met: The name of the file consists of the implementation name of a function followed by -root.wcli. That function is in the inheritance path of the panel function being generated. When there are two or more such functions in the inheritance path, the lowest (closest to the generated function) one takes precedence. If no root templates are available, template generation aborts with an error. WebClient loads the root template, then it searches for page templates which may occur in the inheritance path between the generated function and the root template function. The following must be true for a valid page template: The name of the template file consists of the implementation name of a function followed by -page.wcli. That function is in the inheritance path of the panel function being generated, and is lower than the root template that is in use. The page templates are applied in order starting from the page template closest to the root template, and ending with the template closest to the panel function. Page templates are optional.
Page 88
WebClient v1.4r1
Finally, WebClient automatically generates a template for the panel function itself. This file does not need to be supplied by the user and is named by taking the implementation name of the panel function and appending -panelgen.wcli. This file is obtained by automatically expanding all of the control templates in the panel. The following figure illustrates the process:
FUNC1-root.wcli
FUNC2-page.wcli
FUNC3-page.wcli
FUNC4-page.wcli
LEAF-panelgen.wcli
Page 89
WebClient v1.4r1
Chapter 7: Troubleshooting
Chapter 7: Troubleshooting
What do I do if I get ''[PLEX0040] Location definition for WXPCOURSE55 is not complete. Attempting local function call.''
This message is caused by a missing Plex system definition. The error can be resolved as follows: Open ob550client.properties. Add the following settings under #Remote Function Calls.
Save ob550client.properties.
What do I do if I get the following error on Eclipse: Project PlexBuild is missing required library: 'C:\Eclipse\plugins\org.apache.ant_1.6.5\lib\ant.jar'. The project cannot be build until build path error are resolved".
This error is called by the incorrect path to the jar file ant.jar. Right-click on PlexBuild project. Select Properties, and then click on the Libraries tab. Remove ant.jar C:\Eclipse\plugins\org.apache.ant_1.6.5\lib\ant.jar. Click Add External JARs... Browse to your Eclipse installation folder, then into plugins\org.apache.ant. Select ant.jar.
Page 90
WebClient v1.4r1
Chapter 7: Troubleshooting
Select TCP/IP Click Properties The default port is 1433 Click OK Click Apply Click OK.
Change the port number if you still have the error message.
What do I do if I get "[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt"?
This can be solved by enabling the Multiple Access Result Sets feature in SQL2005. To enable this you must use an ODBC source with a 'SQL Native Client' driver. You can set it up with same parameters as a SQL Server connection from ODBC Data Source Administrator. In your obXXXclient.properties file, locate the data source definition and add the string ";MARS_Connection=yes" to your DataSource, e.g.
Environment.Default.Driver=sun.jdbc.odbc.JdbcOdbcDriver Environment.Default.DataSource=jdbc:odbc:IPDUGnative;MARS_Connection=yes
What do I do if I get "Party: Error creating socket (java.net.ConnectException: Connection refused: connect)"?
This can be solved by restarting the Websydian Server.
Page 91
WebClient v1.4r1
Chapter 7: Troubleshooting
Page 92
WebClient v1.4r1
ALERTS
Synopsis /(ALERTS) ... /(ALERTS)
Description
The contents of the data inside the /(ALERTS) block is expanded once for every outstanding alert message associated with the panel. The details of each message can be retrieved within the block by using the /(AlertMsg), /(AlertType), and /(AlertFdbk) commands.
Action
Synopsis /(!Action:[[control action]]) ... /(!Action)
Description
Allows a template to handle control actions. The action must have been previously enabled with the /(!EnableAction) command. The data inside of the /(!Action) command is expanded for every action of that type which has been sent to the command. For an example, see the entry for /(!EnableAction).
ActionArg
Synopsis Description /(!ActionArg) The command is valid within the body of an /(!Action) command. When specified, it expands to the argument of the control action being processed, if any. The value of the argument depends on the type of action. For more information, see the documentation specific for the control action.
Page 93
WebClient v1.4r1
AttachPoint
Synopsis /(!AttachPoint:name=[[attach point]] [ :inlinetemplate ] [ :sep=separator] [ :args...]) [ ... inline template data ... /(!AttachPoint) ]
Description
Defines an attach point in the current template where future templates may populate. The attach point is identified by the given name. The /(!AttachPoint) command expands to an empty string; however, the position is marked and when future templates invoke the attach point, their output will be placed at that position. The attach point is invoked by using a command with the same name as the attach point. If the inlinetemplate flag is set, the AttachPoint command accepts a block, and this block is expanded as a template whenever the attach point is used. If the inlinetemplate flag is not present, the AttachPoint command must not have a block. If the sep parameter is specified, it specifies text that is used as a separator between invocations of the attach point. The separator text is placed in between every invocation. Any other parameters that are specified become default arguments for the templates attached to the attach point.
ButtonGroup
Synopsis Description /(!ButtonGroup) Expands to the control name of the current button group. The button group is the control name that is associated with the current group of radio buttons.
ButtonValue
Synopsis Description /(!ButtonValue) Expands to the button value of radio buttons.
CheckedValue
Synopsis Description /(!CheckedValue) Expands checked value of the check box field.
Page 94
WebClient v1.4r1
DataType
Synopsis Description /(!DataType) Expands to the data type of the field which is bound to the control. The value will be one of the following: Char FixedDec Long Date Time Object
DecLength
Synopsis Description /(!DecLength) Expands to the design decimal places of the field which is bound to the control.
Edit
Synopsis Description /(!Edit) Restrict: WebColumnHeadingData References the column's associated edit control. This is a control reference command.
EditNameID
Synopsis Description /(!EditNameID) Expands to the fully qualified name identifier of the edit control that is associated with the current control, which must be a Column Heading control.
EditProperty
Synopsis Description /(!EditProperty:[[property name]] [ :[[property modifier]] ] ) Works similarly to /(!Property), except the properties are retrieved from the edit control that is associated with the current control, which must be a Column Heading control.
Page 95
WebClient v1.4r1
Embed
Synopsis /(Embed:output type [:cdata] ) ... /(Embed)
Description
The contents of the Embed block are expanded and encoded with the specified output type. This is used when one output type is embedded in another; for example, JavaScript within HTML, or HTML within JavaScript. The output type can be: html Encodes the output as HTML. js Encodes the output as a Javascript expression. If the flag cdata is specified, and the current output type is HTML, then the current HTML element is assumed to be of type CDATA, and entity encoding is bypassed as is necessary for CDATA elements.
Example
The following illustrates retrieving the value of MyField into a Javascript variable, using a script embedded within an HTML page:
<script type="text/javascript"> /(Embed:js:cdata) var fld_value = /(MyField); ... /(Embed) </script>
The following illustrates generating a snippet of HTML from within a Javascript function:
function my_function() { var html = "<span class='myclass'>" + /(Embed:html)/(MyField)/(Embed) + "</span>"; ... }
Page 96
WebClient v1.4r1
EnableAction
Synopsis Description /(!EnableAction:[[control action]] [ ,[[control action]]... ]) When specified for a control, indicates that the template will handle the given control actions. Any number of actions may be specified, separated by commas. Once an action is enabled, the runtime will not automatically refresh the page when an action of that type is processed. Instead, it will enqueue the action to a list associated with the control. The template must then expand the action list by using the /(!Action) command. The following example shows how a read-only field can change its value without refreshing the screen.
/(!-- The field is mapped as an HTML SPAN element.) <span id="/(!NameID)"> /(!This) </span> /(!-- Indicate that when the SetValue control action is processed, we will handle it here.) /(!EnableAction:SetValue) /(!-- Place Javascript code inside of the JS attach point to perform the update.) /(!JS) /(!-- The code in the following block will be run as Javascript when the value of the control is changed.) /(!Action:SetValue) document.getElementById("/(!NameID)").innerText = /(!This); /(!Action) /(!JS)
Example
Page 97
WebClient v1.4r1
Event
Synopsis Description Example /(!Event:phys=[[physical event]]) If the given physical event is mapped on this control, expands to its mapped event number. Otherwise, expands to the empty string. The following template will expand differently depending on whether or not the Pressed event is mapped to the current control.
/(!If:/(!Event:phys=Pressed)) The pressed event is mapped /(!Else) The pressed event is not mapped /(!If)
FOCUS
Synopsis /(FOCUS) ... /(FOCUS)
Description
The contents of the data inside the /(FOCUS) block is expanded once for each control on the panel that has received initial focus. The block is expanded with a valid control context for each focused control.
FindControl
Synopsis Description /(!FindControl: [[control id]]) This control reference command yields the control of the panel that has the specified Plex control ID. The control ID is a numeric value that is assigned by the Plex panel generator. It is unstable (changes with every generation) and is included in certain control properties, which is why you may need this command.
GridEnd
Synopsis Description /(!GridEnd) Expands to Y if the Plex program has executed Set Grid End On for this grid. Otherwise, expands to nothing.
Page 98
WebClient v1.4r1
If
Synopsis /(!If:value) ... [ /(!Else) ] ... /(!If) /(!If:value1=value2) ... [ /(!Else) ] ... /(!If)
Description
This command performs a comparison. It has two forms. In the first form, the contents of the /(!If) block are expanded if value expands to a non-empty string. In the second form, the contents are expanded if value1 is equal to value2. In both forms, an optional /(!Else) clause may be specified. The /(!Else) block is terminated by the /(!If) command terminator; it does not have its own terminator.
IgnoreActions
Synopsis Description /(!IgnoreActions) When specified for a control, causes the control to ignore any control actions that are sent to it. This command always expands to the empty string. This is useful for a template which does not respond to actions, to prevent the screen from refreshing.
ImplName
Synopsis Description /(!ImplName) Expands to the implementation name of the field which is bound to the control.
Length
Synopsis Description /(!Length) Expands to the design length of the field which is bound to the control.
Page 99
WebClient v1.4r1
NameID
Synopsis Description /(!NameID) Expands to the fully qualified name identifier of the current control. The NameID is unique even when child panels are used. (The control name itself in such a situation need not be unique.)
OptSelected
Synopsis Description /(!OptSelected:[[option]]) Expands to Y if the option selected is the one indicated.
OptText
Synopsis Description /(!OptText) Returns the text of the current option of a combobox. This command is valid within the /(!This) command block of a combobox control.
OutTo
Synopsis /(OutTo:[[output path]]) .... /(OutTo)
Description
The contents of the OutTo block are placed into the response stream at the specified output path. The OutTo command itself expands to nothing; all data is placed in the path.
Owner
Synopsis Description /(!Owner) Returns the owning panel.
Owner
Synopsis /(!Owner)
Page 100
WebClient v1.4r1
Description
References the panel that owns the current control. This is a control reference command.
Panel
Synopsis Description /(!Panel) This control reference command refers to the panel control. This is the root element of the control hierarchy.
Param
Synopsis Description /(!Param:[[parameter name]]) Expands to the value of the given parameter in the current template. If the current template is a control template, the parameter may be a control name parameter. If the current template is an inline template, the parameter may be a parameter specified in the inline template invocation.
Parent
Synopsis Description /(!Parent) References the parent of the control in the control hierarchy. This is a control reference command.
Property
Synopsis Description /(!Property:[[property name]] [ :[[property modifier]] ] ) Expands to the value of the specified property of the current control. If the property is not defined, expands to the empty string. An optional property modifier may be specified.
Render
Synopsis Description /(!Render:[[output path]] [ :args... ] ) Performs rendering of the current panel, and sends the result of rendering the panel to the specified output path. If any optional arguments are specified, they are carried over as request parameters and may be retrieved with the /(!Req) command.
Page 101
WebClient v1.4r1
Site
Synopsis Description /(!Site) Expands to the panel object that is loaded in the current site control.
State
Synopsis Description /(!State) Expands to the current control's state value, as an integer.
This
Synopsis Description /(!This) ... /(!This) Expands to the contents of the block, repeated once for every option in the combo box control.
This
Synopsis Description /(!This) ... /(!This) Expands the contents of the command block once for every grid row in the grid.
This
Synopsis Description /(!This) Expands to the value of the current control. This command also works as a control reference, referring to the current control. The behavior of this command depends on which type of control is being used. See the control-specific documentation for details.
Title
Synopsis Description /(!Title) Expands to the title of the current panel.
Page 102
WebClient v1.4r1
Type
Synopsis Description /(!Type) Returns the type of the current control. This is the value from the Type property in the panelresource file.
UncheckedValue
Synopsis Description /(!UncheckedValue) Expands unchecked value of the check box field.
Visible
Synopsis Description /(!Visible) Expands to Y if the current panel is visible. Otherwise, expands to nothing.
WsRes
Synopsis Description /(!WsRes) At runtime, expands to the web resources path that associated with the web library id of the current template. The web library id is defined by the project containing the template; that id is then mapped to a URL resource path by a runtime-specific configuration mechanism. The following HTML image element refers to an image which is located in the images directory under the current project's web resources path:
<img src="/(!WsRes)/images/myimage.png"></img>
Example
getVar(String var)
Synopsis Description getVar(String var) Retrieves the value of the specified bean variable in the current control.
Page 103
WebClient v1.4r1
jsonColVis
Synopsis Description /(!jsonColVis) Returns a list of the visibilities of each column on the grid, as a Javascript array. Each element is either true if the column is visible, or false if it is not.
jsonCols
Synopsis Description /(!jsonCols) Returns a list of the names of the columns of the grid, as a Javascript array.
jsonImplNames
Synopsis Description /(!jsonImplNames) Returns a list of the implementation names of the column fields of the grid, as a Javascript Array.
jsonOptions
Synopsis Description /(!jsonOptions) Returns a list of the names of the options in the combo box, as a Javascript list.
jsonRows
Synopsis Description /(!jsonRows) Returns the contents of the grid as a two dimensional array. The outer dimension is rows, the inner dimensions is columns.
jsonSelected
Synopsis Description /(!jsonSelected) Returns a list of row numbers in the grid that are selected. The rows are numbered started from zero.
Page 104
WebClient v1.4r1
jsonValues
Synopsis Description /(!jsonValues) Returns a list of the values of the options in the combo box control, as a Javascript list.
value
Synopsis Description /(!value) Expands to the text value of the option that is currently selected.
Page 105
WebClient v1.4r1
Page 106
WebClient v1.4r1
Change the default database to your database name Click Next >
Click Finish Click Test Data Source... It should display TESTS COMPLETED SUCCESSFULLY
Page 107
WebClient v1.4r1
Add the JDBC driver on the Java Project. Right-click on the java project Select Properties Open Java Build Path Click Add External JARs... Add msutil.jar, msbase.jar, and mssqlserver.jar Click Apply Click OK.
Add the JDBC driver in on the Dynamic Web Project. Right-click on the dynamic web project Select Properties Open J2EE Module Dependencies Click Add External JARs... Add msutil.jar, msbase.jar, and mssqlserver.jar Click Apply Click OK.
Page 108
WebClient v1.4r1
Page 109
WebClient v1.4r1
Change the default database to your database name Click Next >
Page 110
WebClient v1.4r1
Click Finish Click Test Data Source... It should display TESTS COMPLETED SUCCESSFULLY
Add the JDBC driver on the Java Project. Right-click on the java project Select Properties Open Java Build Path Click Add External JARs... Add sqljdbc.jar Click Apply Click OK.
Page 111
WebClient v1.4r1
Add the JDBC driver in on the Dynamic Web Project. Right-click on the dynamic web project Select Properties Open J2EE Module Dependencies Click Add External JARs... Add sqljdbc.jar Click Apply Click OK.
Page 112