Thank you for being a valued client of CM First Group. If you have any technical issues or concerns, please open a ticket on support.cmfirstgroup.com, email CM First technical support at support@cmfirstgroup.com or call us on our 24/7 customer hotline at +1 (512) 623-7586.

Follow

Overview of Workspace Setup

After you have the software requirements installed, below are the steps that you have to perform to setup your workspace for CM WebClient from scratch. Each step will be discussed in details when you click on the link.

Install WebClient Builder Plugin

Copy com.adcaustin.webclient. WebClientPlugin-1.8.x.jar to eclipse\dropins folder.

To confirm that WebClient Plugin builder is installed correctly.
Go to HelpAbout Eclipse → Click on Installation Details → Sort Plug-in Id column in ascending order.

 

back to top

Configure Apache Tomcat in Eclipse

a. Create a Tomcat installed runtime.

WindowPreferencesServerInstalled Runtimes → Click on Add... → Select Apache Tomcat v6.0 under Apache → Click Next > → Browse to your Apache Tomcat installation directory.

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.

b. Start Tomcat server.

WindowShow ViewServers → Right-click on the server window → Select NewServer → Select ApacheTomcat v6.0 server → Click Finish → Right-click on the server → Click Start.

back to top

Create a New Java Project

Introduction

A Java project contains the generated Plex Java source code, resource files and generated web templates.

Instructions

a. FileNewOther... → Expand Java folder → Select Java Project → Click Next >

b. Enter your project name in the project name field → Select Use default JRE (currently ‘jre6’) → click Finish.

 

c. Create a new resource folder named PlexResource.
Right-click on your java project → Select New → Select Source Folder → Enter PlexResource as the folder name → Click Finish.

back to top

Import PlexBuild project

Introduction

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.

Instructions

  1. FileImport... → Expand General folder → Select Existing Projects into Workspace → Click Next >
  2. If you have the project in a file directory, use Select root directory. If you have the project in a zip file format, use Select archive file. Browse to your directory and click Finish.

back to top

Setup PlexBuild Run Configuration

  1. Modify Ant classpath globally
    WindowPreferencesExpand Ant → Select Runtime → Open the Properties tab → Click Add Property...

  2. Enter plex.workspace_loc in the Name field and ${workspace_loc} in the Value field → Click OK.

  3. Create an ANT classpath for launch configuration.
    • Run → External Tools → External Tools Configuration... → Select Ant Build → Press the new button.
    • 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.
    • Click Apply to save.
    • Open the Build tab → Uncheck Build before launch.
    • Click Apply to save.
    • Open Targets tab → Check move Plex60Source and moveresources[default] as targets to execute.

    • Click Apply to save.

back to top

Configure build.properties File in PlexBuild project

  1. Expand PlexBuild project → Expand BuildConfig folder → Right-click on build.properties file and select open with Text Editor.

  2. Find the line plex.import.project_name=XXX. Edit the line so that plex.import.project_name=

  3. Find the line plex.gen.root=XXX. Edit the line so that plex.gen.root=

    Note that forward slashes will be used instead of backward slashes.

  4. Save the file.

back to top

Generate your Plex functions. Do not build.

back to top

How to Run PlexBuild in Eclipse

  1. Go to RunExternal ToolsExternal Tools Configuration...
  2. Click Run.
    You should see on your console that the functions are successfully built and moved to your project source folder.
  3. The next time you run PlexBuild, you can click on  icon shown below.

back to top

Import WebClient project

  1. FileImport... → Expand General folder → Select Existing Projects into Workspace → Click Next >

  2. If you have the project in a file directory, use Select root directory. If you have the project in a zip file format, use Select archive file. Browse to your directory and click Finish.

 

back to top

Configure Java Project

  1. Right-click on your java project → Select Properties → Select Java Build Path → Open Libraries tab → Click Add Library...

  2. Select WebClient Component → Click Next > → Check WebClient → Click Finish.

  3. Import obclient.properties to your java project souce folder \src folder.
    FileImport → Expand General folder → Select File System → Click Next > → Browse to ObJava directory under CA Plex folder and select obclient.properties → Click Finish.
    If you have tab functions, you also need to add pvAll.jar in your java project build path.
  4. Right-click on your java project → Select Properties → Select Java Build Path → Open Libraries tab → Click Add External JARs... → Browse to CA Plex browse to C:\Documents and Settings\All Users\Documents\CA\Plex\ver\classver\PatternLibs\ACTIVE\Beans for Plex ver
  5. Click Finish.

back to top

Configure obclient.properties

Note: CM WebClient date and time format works based on browser locale instead of obclient.properties date and time format.

  1. Open obclient.properties with Text Editor.
    Right-click on obclient.properties → Select Open With → Select 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

  2. Save the changes.

back to top

Generate WebClient Templates

  1. Right-click on your java project → Select WebClientEnable Template Builder.
    WebGenTemplates folder will be automatically created under your java project. You will be prompted to enter your genlicense.lic. Click on Use Trial or enter your license file and click Finish.

    The console should display “Generating Web templates” with no error message.
  2. You should have WebGenTemplates folder created under your java project.

Note: If there is no web template generated, check if there is a PlexResource folder created. If there is, make sure PlexResource is a source folder and there are .panelresource and .resource files associated to the function name.

back to top

Create a New Dynamic Web Project

Introduction

A Dynamic Web Project contains JSP (Java Server Pages) files, HTML files, servlets, and Plex runtime JAR files. The web project is then deployed on Apache Tomcat to be viewed on a browser. To avoid any unexpected issue, we recommend that a new server is created in the workspace before creating a new web project.

Instructions

  1. FileNewOther... → Expand Web folder → Select Dynamic Web Project → click Next >

  2. Enter your web project name in the project name field → Select target runtime server → Dynamic web module version should be set to 2.4 → Click Finish.



    Expand your web project/WebContent/WEB-INF folder to make sure that there is web.xml file created.

back to top

Configure Build Path for the New Web Project

Select Deployment Assembly on Properties window → Click Add... → Select Project → Click Next > → Select your java project → Click Finish. If you have any additional jar files that are required for deployment, you need to add them in Deployment Assembly.

back to top

Create a New Servlet in Web Project

Introduction

WebClientServlet is a method of deploying the CM WebClient architecture. It consists of a servlet, called WebClientServlet, which launches your WebClient Plex application within a servlet container, and a configuration file, called WebClient.properties, which contains settings for the servlet.

In this mode, a single Plex function is the top-level component of your web application, known as the entry point. Consequentially, WebClientServlet is not suitable when you wish to launch a Plex function as a Business Process in Websydian Express. If you are using Websydian Express, see chapters Deploying CM WebClient with Websydian Express for Java.

Instructions

  1. Right-click on your web project → Select New → Servlet → Check “Use an existing Servlet class or JSP” → Select WebClientServlet → Click OK.



  2. Click Finish in Create Servlet window.

    Note: If WebClientServlet is not showing up on your servlet list, add WebClient project in the Deployment Assembly under your web project.

    Right-click on your web project → select Properties → select Deployment Assembly → Click Add... button → select Project → select WebClient project → click Finish.

For WebClient multi session servlet implementation, select WebClientMultiSessionServlet.

        

back to top

Create a New Listener in WebClient Servlet

Instructions

  1. Right-click on your web project → Select NewListener → Check “Use existing listener class” → Select WebSessionListener → Click OK.



  2. Click Finish in Create Listener window.

back to top

Add Plex Images to the Web Project

  1. Create an images folder under WebProject/WebContent folder.

  2. Copy/Import all images files in the images folder.

Note: Keep in mind that CM WebClient is case-sensitive. Make sure that your Plex panel properties and your image filename is a match.

back to top

Run WebClient in Eclipse

  1. Right-click on your tomcat server in the server tab → Select Publish.

  2. After it is finished publishing → select Start.

  3. Open your browser and go to http://localhost:8080//

To find your context root, right-click on your web project → select Properties → Select Web Project Settings.

To find your servlet name, expand your web project → expand WebContent folder → expand WEB-INF folder → open your web.xml with Text Editor

When you first deploy the application, you should see a page that let you download WebClient.properties. If it gives an error that says “Unable to validate WebClient license”, use this link http://127.0.0.1:8080//

Click on WebClient.properties and save the file in your java or web project source file.

back to top

Configure WebClient.properties

  1. In the file WebClient.properties, located in the src folder of either your Java Project or your Dynamic Web Project, change the properties parameters as follows.

    licensingserver.ipaddr
    The ipaddress of the machine where the licensing server is started. Only uncomment this property if you have WebClient licensing server installed.
    For example:
    licensingserver.ipaddr=localhost

    licensingserver.tcpport
    The TCP port on which licensing server listens. Only uncomment this property if you have WebClient licensing server installed. The default port is 65000.
    For example:
    licensingserver.tcpport=65000

    licensingserver.licensefile
    If there is no valid license file, this property must be commented. CM WebClient will automatically activate 10-user developer license. If there is a license file, then specifies the complete file system path to the license file(license.lic)
    For example:
    licensingserver.licensefile=C\:/Program Files\WebClient/license.lic

    log4j.logger.com.adcaustin.WebClient
    The granularity of the log messages. Legal values are: DEBUG, INFO,
    WARN, ERROR, FATAL. DEBUG should only be used when
    debugging and in test environments. In a production environment use
    WARN or ERROR.
    For example:
    log4j.logger.com.adcaustin.WebClient=INFO, WebClientServlet

    log4j.appender. WebClientServlet.file
    specifies the path and the name of the log file.
    For example:
    log4j.appender.WebClientServlet.file=C:/WebClient.log

    webclient.entry : .
    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=WXPCOURSE60.WXuF

    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:
    webclient.entry.timeout=WXPCOURSE60.sesstimeout

    webclient.entry.url.
    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 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 servlet is deployed. On errors the servlet 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=/myWebProject/error.jsp

    resurl.plex.imageresources
    URL reference for where the image resources as referenced by Plex are kept. This URL should contain a folder named images.
    For example:
    resurl.plex.imageresources=/myWebProject

    Define.WSACTION
    //. URL reference for servlet.
    For example:
    Define.WSACTION=/myWebProject/WebClientServlet

    Define.WCTHEME
    Set WebClient theme to either claro or tundra. This property is optional. If it is not set, the default value is set to tundra.
    For example:
    Define.WCTHEME=claro

    servlet.statistics.level
    Set this option to cause the servlet to gather some runtime statistics on called functions. This feature only works when calling AS/400 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

  2. Save changes.
  3. Republish and restart your web server. Reload the page. You may need to close the browser and relaunch the app

back to top

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk