How To...

How To...

1. Group Model

Q: How do I change WebClient group model from licensed version to non-licensed version?

 A: a. Login to your group model and remove the old WebClient group model and add the new WebClient group model from your library list.

     b. Extract a new local model.

Important Note: If you get error messages during this operation, please contact CM First support for guidance.

Q: Do I have to upgrade WebClient group model to the new version?

 A: No, you don't have to. You may choose to upgrade only if you need the new WebClient pattern.

2. Installation


Q: Web template generator shows error like generateTemplate([B, com.adcaustin.util.AFile). What should I do?

 A: You need to install WebClient 1.8 project and make sure that you have the same WebClientBuilderPlugin installed in your Eclipse plugin.

Q: Subclipse does not work in Eclipse installed from WebClientLiveInstall. What should I do?

 A: WebClientLiveInstall is not designed for WebClient development purpose. If you are setting up WebClient development environment, you should build your environment from scratch. Subclipse will work with official eclipse installation.

Q: How do I upgrade from WebClient 1.6 to WebClient 1.8?

A: a. Before you start installing WebClient 1.8, you will need to close your eclipse.

     b. Go to your Eclipse/plugins folder, delete the old com.adcaustin.webclient.WebClientPlugin-1.6.jar and copy the new com.cmfirstgroup.webclient.WebClientPlugin-1.8.jar to the folder. Note: if you are using Eclipse Juno, the builder plugin has to be copied to Eclipse/dropins folder.

     c. Start your Eclipse.

     d. Close your existing WebClient project, right-click on the project and select Delete.

     e. Close your Eclipse.

      f. Go to your workspace directory using Windows Explorer and delete WebClient folder from your workspace.

     g. Start your Eclipse.

     h. Go to the Eclipse menu: File → Import → Expand General folder → Select Existing Projects into Workspace → click Next > → Check Select archive file and browse to where you download WebClient-1.8.zip → Click Finish.

     i. There should be an Eclipse window prompting you to enter your license. Please copy your generator ID and open a ticket on our support website to request for your new generator license. If you have purchased Advanced Controls, please mention it in the ticket. All customers are entitled to 30-day free trial license. New licenses will be issued within 2-3 business days.

     j. To get started with WebClient 1.8, you can use the trial version.

     Please note that the upgrade procedures will not work with Eclipse that you installed from WebClientLive. 

Q: What should I do if I get "The WebClient i+ plugin must be v1.8 or above to use this version of WebClient." error in the console when I generate a web template?

A: You need to delete the old WebClient Plugin from Eclipse/plugins folder and replace it with the latest WebClientPlugin builder.

Q: How do I apply WebClient generator license?

A: Create a license folder anywhere you want. Copy both adclsdt.dat and genlicense.lic to the new folder. Browse to the license folder if prompted in Eclipse to enter your license.

Q: How do I apply WebClient ISV server license file?

A: Send a support request for ISV server license on our support website and provide the gen ID, licensee name and issuer name in the ticket description. Click here on how to get the generator id. After you receive the license.lic from our support team, you can apply the server license by setting the license file path in the WebClient.properties file.

licensingserver.licensefile=<path to the license.lic file with forward slashes>

For example:

licensingserver.licensefile=C:/WebclientLicense/developer.lic

Note: if you have a # in front of the property, remove it to enable the property.

3. Configuration


Q: How do I check if my web projects are published on my Tomcat server?

 A: Check your Tomcat project folder in your <workspace directory>\.<server path>\<deploy path>\<context path>\WEB-INF\lib.

      Server path is usually set to  .metadata\.plugins\org.eclipse.wst.server.core\tmp0.

      Deploy path is usually set to  wtpwebapps.

      Context path is usually set to the name of your web project.

Q: How do I set the locale correctly for Firefox and Safari browser?

 A: Create a page template, for example: locale-page.wcli on your custom template project. In your locale-page.wcli file, it should have something like the following.

/(!djConfig)
  locale:'fi-fi',
/(!djConfig)

       Above is the example for setting locale in Finnish. Remember to add a new triple in your function to apply the new page template.

       myFunction is a FNC ~WebShell                                                customPage is a FNC ~WebUI

       myFunction is a FNC customPage                                             customPage impl name locale

Q: How do I run my application in Java Swing using eclipse?

 A: Go to Run → Run Configurations… → Select Java Application → Click New launch configuration.

      In the Main tab window, browse and select your java project (the project that has your java source files). For the main class, search for ObRun.ObPanel.ObLaunch and click Apply.

      Open Arguments tab window → In the Program arguments field, enter your function entry point in the format of <package name>.<function implementation name>  “Path= “ → Click Apply → Click Run.

      For example: WXPCOURSE60.WXuF “Path= “

Q: How do I enable GZIP compression on my Tomcat server?

 A: Edit file /conf/server.xml and add to the HTTP Connector configuration like below.

compression="on" 
compressionMinSize="2048" 
noCompressionUserAgents="gozilla, traviata" 
compressableMimeType="text/html,text/xml,application/json"

An example of an HTTP Connector configuration with compression enabled could be:

<Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" 
               compression="on" 
         compressionMinSize="2048" 
         noCompressionUserAgents="gozilla, traviata" 
         compressableMimeType="text/html,text/xml"/>

Q: How do I remove an existing genlicense file setting from Eclipse workspace?

 A:Go to your Eclipse directory -> Confiuration folder -> .settings folder and delete com.cmfirsttech.webclient file.

4. Web Controls / Web Templates

Q: How do I use DojoTimePicker.ctrl?

 A: Set the control name of the time edit field to <control name>:MainArea:template=DojoTimePicker:default.

Q: How do I use WebAccordionTree.ctrl?

 A: Add TreeView pattern from WebClient advanced control as you would for WebTreeView. The Java bean class in the panel properties should be set to WebAccordionTree.

Q: How do I use WebFilteringSelect.ctrl?

 A: WebFilteringSelect.ctrl is similar to WebCombo.ctrl except that user may enter more than one character in the input field. Set the control name of the combo box to <control name>:MainArea:template=WebFilteringSelect:escapChar=3:default.

        escapChar can be customized to any number you like. The number represents how many character you enter before the combo box display the list based on the character you enter.

Q: How do I use WebGridExport.ctrl?

 A: WebGridExport is used to export a grid to a CSV file format. First, you need to upgrade to the latest WebClient group model. Second, you need to add WebExportGrid to your function inheritance path.

Q: How do I use WebGridFilter.ctrl?

 A: WebGridFilter.ctrl is used to filter the data of a grid based on one of its column values. To use this control you will need to create two fields: one combo field and one edit field. Set the control name of the combo box to <controlname>:<attachpoint>:template=WebGridFilter:GridId=Grid1P:TextId=filterContains:default.

GridId should be set to the control name of the grid. TextId should be set to the control name of edit field.

The edit field control name should be set to filterContains:<attachpoint>. The control name should match the TextId in the combo box.

At runtime the combo box will list all the avaliable columns in the grid, the data of the grid will be filtered according to the text you enter in the edit field and the selected column in the combo box.

Q: How do I use WebURLGrid.ctrl?

 A: WebURLGrid.ctrl is a prototype control that is used to convert data in the grid column to a URL with the text "Link". The control name of the column heading will need to be set to <control name>:Grid1P.ColumnsArea:template=WebURLGrid:<ColumnsHeadingText>

Q: How do I use LiteralHTML.ctrl?

 A: LiteralHTML.ctrl is used to run hard-coded HTML that  is entered in the Plex panel text property. The control name of the field should be set to <controlname>:MainArea:template=LiteralHTML:default.

Q: How do I enable column toggling in grid?

 A: The control name of the grid should be set to Grid1P:MainArea:ColumnToggling=Yes:default.

Q: How do I use WebLogMessages-page.wcli?

 A: WebLogMessages should not be used in combination with WebMessages. Create a new function in your Plex local model like follows.

     WebLogMsg is a FNC WebShell.

     WebLogMsg impl name NME WebLogMessages.

Q: How do I control authentication to my IBM i?

 A: See this link http://www.caplexwebclient.cmfirstgroup.com/?p=589

Q: How do I user WebLinkButton.ctrl

  1. Add the “WebLinkButton.ctrl” template to your custom templates project in Eclipse.
  2. Configure the control name of the field that will contain the URL using this syntax <Control Name>:<Attach Point>:template=WebLinkButton:label=<The label of the push button>:default , see the following images as an example:




3. Set the value of your field with a valid URL, for example in this test case we will open the default Google main page:



Q:How to externalize the ObClient.properties and WebClient.properties files?

A: ObClient.properties: To externalize this file you can use the webclient.plex.propertyfilename entry in your WebClient.properties file to define the location of the ObClient.properties, example:

webclient.plex.propertyfilename=C: /Properties /obclient.properties

WebClient.properties: To externalize this file you must configure the web.xml file of your Web project to add a new parameter called webclient.proppath and the value will be the path to your WebClient.propertiesfile, you can do this either using a init-param tag or a context-param tag, example:

  • Using Init-param:
<init-param>
<param-name>webclient.proppath</param-name>
<param-value>C: /Properties /WebClient.properties</param-value>
</init-param>
  •  Using Context-param:
<context-param>
<param-name>webclient.proppath</param-name>
  <param-value>C: /Properties /WebClient.properties</param-value>
</context-param> 

5. Troubleshooting

Q: What should I do if my Tomcat server does not publish anything?

 A: Try removing your web project from your Tomcat server and publish and then add the web project back to the server and republish.

Q: I am not able to connect to AS/400 in WebClient or I am getting java.io.UnsupportedEncodingException: Cp037. What should I do?

 A: Make sure that your function works in Java Swing. If it is not working in Java Swing, check if your Eclipse is using the correct JDK version. You should be using JDK 1.6 or higher.

Q: What should I do if I am getting a java.lang.NullPointerException when generating the web template?

 A: If you are using PlexResource folder to store your Plex .panelresource or .resource files, the PlexResource folder should set as a source folder. To set your PlexResource folder as a source folder:

  1. Right-click on your java project and select Properties.
  2. In the Source tab, click add folder and add the PlexResource folder to the source.

Q: What should I do if I am getting a java.lang.NullPointerException on the web page?

A: There are several things that may have caused this error. It could be that you are missing server functions or a JAR file.  First, check the entry point in webclient.properties if it is correct. Second, check the servlet log. The servlet log folder can be found in WebClient.properties. Third, if there is no additional information on the log, we recommend that you run your application in Java Swing (See how do I run my application in Java Swing using Eclipse).

Q: How to avoid running multiple WebClient applications in different browser tabs?

A: A web application has no way of knowing if any windows are open with the same session ID, so this situation can't be always avoided. However, the following recommendations will suffice in practice.

1. Do not have the users bookmark the WebClient servlet directly. Instead, launch the application from a menu or a portal page.

2. When launching the WebClient application, use a targeted anchor window reference to avoid opening the servlet in multiple windows/tabs at the same time, and also to disable the back button. More information: http://graphcomp.com/info/specs/target.html

3. For additional protection, define a Plex right-click context menu. The user will not see the "Open link in new tab" option, and the developer can provide the user more appropriate actions to take.

Again, this will not bullet-proof the case where the curious user is going into the address bar and copy/pasting the URL, or doing other kinds of experimentation. However, in practice, this should handle the normal uses of the application.

Q: What should I do if I am getting SEVERE: Exception loading sessions from persistent storage 

java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.adcaustin.webclient.servletproxy.CallWebClientFunction

Caused by: java.io.NotSerializableException: com.adcaustin.webclient.servletproxy.CallWebClientFunction?

A: For Tomcat 6: locate the relevant Context element in either server.xml or in the context descriptor and declare the no-op session manager.

<Context .. >
  <Manager pathname="" />
</manager></context>

For Tomcat 7, turn off this feature in Tomcat by uncommenting the following in your webapp's context.xml

 <Manager pathname="" />

Q: What should I do if I am getting For input string: ""  java.lang.NumberFormatException: For input string: ""?

A: Two items to check in Plex panel properties.

  • Make sure all of the toolbar buttons are associated with menu items in the panel properties.
  • Check the right-click context menu that is referenced but not generated, for example because it is Exist No.

Q: What should I do if I am getting ERROR handleException() java.lang.ArrayIndexOutOfBoundsException: 1 
Caused by: java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 1
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 
in the log file?

A: That means the function that you are calling requires an input parameter.

Q: What should I do if I am getting error "Unable to validate license" after upgrading WebClient?

A: Restarting Eclipse would usually fix the issue.

Q: What should I do if I the PopUp functions cannot be moved around the screen?

A: The movement of the PopUp functions depends of the size of the BODY element from the document and if these values are not defined then the PopUp functions will not move, the default styles of WebClient do not include CSS code to define the BODY size, so you must be sure to add CSS code for the BODY element in your custom CSS file, if you don't know how to achieve this, please try these steps:

-Create a custom CSS file for your application(see the following article How to Customize CM WebClient StyleSheet)

-Add the following CSS code to your custom CSS file:

html {
  height: 100%;
  width: 100%;
}
body{
  height: 100%;
  width: 100%;
}
body form {
  height: 100%;
  width: 100%;
}

Q: What should I do if I get problems while installing a new WebClient License?

A: After the release of WebClient 1.8.5 there have appeared some problems with the license, here are some common things to check in order to solve these issues(Be sure to remove any previous license you had, if you not know how to achieve this you can see the following article "How do I remove an existing genlicense file setting from Eclipse workspace"):

  • Make sure your workspace is pointing to the correct JDK version
  • Check the WebClient builder plugin for Eclipse: Since the release of WebClient 1.8.5 you must use the com.cmfirstgroup.webclient.WebClientPlugin-1.8.5.jar plugin. you can find this file in the following link Download WebClient 1.8.5
  • Change the ObRun.jar version used in the WebClient project: If you are generating from a Plex version greater than Plex 7.1 then you must change the ObRun.jar file from WebClient with the ObRun.jar file from your current Plex version, follow these steps in order to change this file and apply the license:
    • Delete your WebClient project and then add it again to your workspace like you were updating the WebClient version(follow the steps from this guide "How to update a WorkSpace to a new WebClient release - Version")
    • Copy the correct version of the ObRun.jar file to your WebClient project
    • Restart Eclipse
    • Clean all your projects
    • Add the the license (Do not add the license until you have finished all the previous steps)
  • If after following these steps you still have issues, please create a new environment and apply the license

6. WebClient i+ Mobile

Q: Where do I download WebClient i+ Mobile?

 A: WebClient i+ Mobile is free to download at http://code.google.com/p/webclient-mobile-for-ca-plex/.  

Q: What should I do if I need some support for WebClient i+ Mobile?

 A: For more information about WebClient i+ Mobile support, please contact John Rhodes.

Q: How to get started in WebClient i+ Mobile?

 A: All functions have to inherit from ~WebShell just like standard WebClient. All field control names have to be set in Plex panel properties.

How to set it up in Eclipse workspace:

  1. Install WebClient 1.8 plugin builder in Eclipse/plugins folder.
  2. Create a new workspace for WebClient Mobile.
  3. Create a java project for Plex application source code.
  4. Import WebClient 1.8 to the workspace.
  5. Create a dynamic web project for deployment.
  6. Create a WebClient Servlet under dynamic web project.
  7. Add WebClient i+ to the Java project libraries. Go to  java project build path, open libraries tab, click on Add Library…button, select WebClient Component, click Next>, select  WebClient i+ project and click Finish.
  8. Check out WebClient Mobile from google code to the workspace. Check out url https://github.com/cmfirstgroup/webclient-mobile-for-ca-plex.git/branches/branch1.0
    By default, the checkout folder is named webclient-mobile-for-ca-plex.
  9. Create links folder for css and js folders under the dynamic web project/WebContent directory. The css folder should be linked to E:\WebClientMobileDev\webclient-mobile-for-ca-plex\res\css. The js folder should be linked to E:\WebClientMobileDev\webclient-mobile-for-ca-plex\res\js.
  10. Add WebClient mobile to the java project libraries. Go to java project build path, open libraries tab, click on Add Library…button, select WebClient Component, click Next >, select WebClient mobile and click Finish.
  11. Configure webclient.properties. Add the following property in the file.
resurl.com.cmfirsttech.webclientmobile=<web context>

Q: How to set control name in Plex panel properties?

A: By default, you need to set control name to all of edit fields in order to set the control name to the label fields. Please see below for examples.

To display Address edit and label fields, set the control name of the edit field to

myAddress

The control name of label field should be set to

myAddressLbl:myAddress.Label.

Another way to specify the label of the field is to set the control name of the edit field as follows.

myAddress:MainArea:label=Address

You do not need to specify the control template for edit, password, combo, multilineedit, and checkbox fields. If you choose to specify a control template used or customize a WebClient i+ Mobile control, you will need to specify the area after the control name.

To display a date field with a date picker, set the control name of the edit field to

myDate:MainArea:template=DatePicker

To display numeric field with spinner control, set the control name of the edit field to

myNumber:MainArea:template=WebSpinnerEdit

If you choose to modify the width of label, set the control name of the label field to

myAddress:myAddress.Label:width=70%.

By default, the width is set to 40%.

To position edit fields in a fieldset, set the control name of the edit field to

myAddress:MainArea:fielset=Info

To position two edit fields on the same row, set the control name of the first edit field to

myPrice

set the control name of the second edit field to

myTotal:myPrice.Extra

To specify a decimal point for a numeric field, set the control name of the edit field to

myPrice:decimal=2

There are two ways to modify the height of multiline edit control.

1. If you choose to modify the rows of multiline edit field, set the control name of the edit field to

myAddress:MainArea:maxRows=10

2. If you choose to automatically size the height of the control, set the control name of the edit field to

myAddress:MainArea:autoExpand

To position button on the toolbar area, set the control name of the button to

Next:ToolbarArea:ui=confirm-round:align=right

For details on ui options to use, please check Sencha Touch 1.1 documentation.

To set control name for grid by grouping based on the first column of the grid, set the control name to

Grid1P:FullscreenArea:grouped=true:indexBar=false

7. Miscellaneous

Q: What can I do to improve the performance of my web page?

A: Enabling GZIP compression on the web server increases the response time from the server because the response is first compressed and then send to the client.

Q: How do I reset WebClient developer license file path?

A: Delete com.cmfirsttech.webclient.prefs file from eclipse installation dir/configuration/.settings folder.

Q: Is it possible to override WebClient.properties file path?

A: Yes, it is. You can set the WebClient.properties file path in the web.xml of your server by adding the following context parameter. The param-name is webclient.proppath and the param-value should be set to the file path.

<context-param>
  <param-name>webclient.proppath</param-name>
  <param-value>C:\Temp\WebClient.properties</param-value>
</context-param>

See Tomcat Documentation on setting context parameter. https://tomcat.apache.org/tomcat-8.0-doc/config/context.html#contextparameters

Q: How do I exclude Java classes or packages from WebClient processing?

A:This feature is for advanced developer only. You can specify multiple class or package names using userclassexceptionlist property in WebClient.properties file. For example:

userclassexceptionlist = com.mycustompackage,org.Customclass

We do not support wildcard.

Q: How do I use the Loader widget?

A:The Loader widget is used to indicate when some XML HTTP REQUEST is going on via topics, to implement this you must create a custom page template that include the following:

-The call to the Loader class: dojo.require("dojox.widget.Loader");

-A div element that uses the Loader class: <div dojoType="dojox.widget.Loader"></div>

Here is a simple example of a custom template that implements this Loader widget:

/(!JSInit:once)
dojo.require("dojox.widget.Loader");
/(!JSInit)

/(!MainArea)
<div dojoType="dojox.widget.Loader"></div>
/(!AttachPoint:name=MainArea)
/(!MainArea)

Q: What are the non-supported items in WebClient?

A:   CM WebClient Compatibility Matrix and SysTemplate Support

  • Not attempt to interact directly with the local file system 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.)
  • Be generated using a supported version of CA Plex. Please check CA Plex compatibility version from CA website. 

    https://support.ca.com/us/product-information/ca-plex.html?d=t&type=Knowledge?d=t&type=Knowledge

  • Only use panels of a supported type (currently Dialog, Child Panel, and Top Application).
  • Note that Top Application type has a limited support. It can function as a child in a child site.
  • Detail popup window cannot call WebShell window.

Q: How do I make the grid rows adjust its height according to the text content?

A:Add the following CSS code in your CSS custom file(If you don't know how to add a custom CSS file please follow this guide How to Customize CM WebClient StyleSheet):

.dojoxGrid-cell span{
white-space: normal !important;
}

Q: How to trigger actions automatically when the function loads?

A: In WebClient you cannot execute actions in the initialize subroutine because this subroutine is executed before the page is loaded, if you need the execute an action when the page loads you can achieve that by creating a custom template that execute a physical event in Plex when the page is loaded, then you can add the custom code to trigger the action you need in that event, here is an example of how to do this:

  • Create a custom template that executes an action in Plex when  the page load, for example you can use the following code from our “CustomInitialize.ctrl” template which generates an invisible field that will trigger the modified event for the field that uses this template when the page loads:
/(!JSOnLoad)
/(!AJAXDoEvent:phys=Modified)
/(!JSOnLoad)
 <input type="hidden" name="/(!NameID)" id="/(!NameID)" value="/(!This)">
/(!EnableAction:SetValue,SetState,SetFocus) 
/(!JS)
  /(!Action:SetValue) 
  document.getElementById("/(!NameID)").value=/(!This);
  /(!Action)
/(!JS)
  • Create a field that will use the custom template, see the following example.


  • Add the field to the function and configure its control name to use the template, see the example.


  • Configure the event of the field the will be triggered automatically by the custom template.


  • In the action diagram use the event that you created to add the code you need to execute when the functions loads, in this case we execute the ChangeColumnHeading action for our grid control.


  • Generate the function and test.

 

Q: How to change the grid column heading at runtime?

A: The WebGrid.ctrl has an action that allows you to modify the column heading at runtime, to use this you must follow these steps:

  • Create a new source code called “ChangeColumnHeading” with the following parameters:
    • Number: Index value of the column (Starts from 0).
    • IMPORTANT: WebClient takes the index value of the column as how they come from Plex, in WebClient this index will not be modified even if you move the column from its original position.

    • ShortDescription: New value for column headin
    • GridControlName: Control name value in the Grid.



  • Add the following code to the “ChangeColumnHeading” source code you created:
com.adcaustin.webclient.ctrl.WebObGridData gridctl  = (com.adcaustin.webclient.ctrl.WebObGridData) (Object) ObUserAPI.getControlByName(getFunction(), new ObCharFld("*Current"), &(3:).toString()).getData();         
                org.json.JSONObject values;
                try {
                               values = new org.json.JSONObject();
                               values.put("colIndex", &(1:).toString());
                               values.put("newHeading", &(2:).toString()); } catch (org.json.JSONException ex) {
                               throw new RuntimeException(ex);
                }             
                gridctl.processAction("ChangeColumnHeading", values);
  • To change the column headings at runtime in your functions just call to the“ChangeColumnHeading” source code using the values you need.


  • Generate in Plex and test it in Eclipse. See the following example:



Q: How to Encrypt/Decrypt data?

A: You can generate source codes in Plex to Encrypt/Decrypt the data you need, for example you may want to encrypt the value of a field that will be stored in a cookie so the clients cannot see that value at runtime using the browser console, then you will also need decrypt the value of that cookie anytime you need that value in the server side, here are some examples of source codes that you can use for both cases:

IMPORTANT: The code used in this example only works in Java 8, you may need to modify this code in order to work in other versions of Java

ENCRYPT SOURCE CODE

  • First parameter is the field that contains the text that we want encrypt
  • Second parameter is the key value that will be used to encrypt the data of the first parameter.
  • Third parameter is the field on in which the encrypted text will be stored

import java.security.Key;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;
{
String strData = &(1:).toString();
String strKey = &(2:).toString();
String EncryptedText = "";
MessageDigest sha = null;
try
{
byte[] key = strKey.getBytes("UTF-8");
sha = MessageDigest.getInstance("SHA-1");
key = sha.digest(key);
key = Arrays.copyOf(key, 16);
SecretKeySpec secretKey = new SecretKeySpec(key, "AES");
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
EncryptedText = Base64.getEncoder().encodeToString(cipher.doFinal(strData.getBytes("UTF-8")));
&(3:).fromString(EncryptedText) ;
}
catch (Exception e)
{
System.out.println("Error while encrypting: " + e.toString());
}
}

DECRYPT SOURCE CODE

  • First parameter is the field that contains the text that we want encrypt
  • Second parameter is the key value that will be used to decrypt the data of the first parameter.
  • Third parameter is the field on in which the decrypted text will be stored
{
String strData = &(1:).toString();
String strKey = &(2:).toString();
String DecryptedText = "";
MessageDigest sha = null;
try
{
byte[] key = strKey.getBytes("UTF-8");
sha = MessageDigest.getInstance("SHA-1");
key = sha.digest(key);
key = Arrays.copyOf(key, 16);
SecretKeySpec secretKey = new SecretKeySpec(key, "AES");
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
cipher.init(Cipher.DECRYPT_MODE, secretKey);
DecryptedText = new String(cipher.doFinal(Base64.getDecoder().decode(strData))) ;
&(3:).fromString(DecryptedText);
}
catch (Exception e)
{
System.out.println("Error while encrypting: " + e.toString());
}
}{ String strData = &(1:).toString(); String strKey = "CM1"; String DecryptedText = ""; MessageDigest sha = null; try { byte[] key = strKey.getBytes("UTF-8"); sha = MessageDigest.getInstance("SHA-1"); key = sha.digest(key); key = Arrays.copyOf(key, 16); SecretKeySpec secretKey = new SecretKeySpec(key, "AES"); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING"); cipher.init(Cipher.DECRYPT_MODE, secretKey); DecryptedText = new String(cipher.doFinal(Base64.getDecoder().decode(strData))) ; &(2:).fromString(DecryptedText); } catch (Exception e) { System.out.println("Error while decrypting: " + e.toString()); } }

 Here is an example of how you can implement this in a Plex function:

  • Fields definition




  • Source codes definition





  • Test function: definition


  • Test function: Panel configuration 




  • Test function: Action Diagram




  • Test function at runtime



Q: How to change the character used as "CSV Separator" and "Decimal separator" for the ExportGrid?

A: Follow the next steps:
1. Create a field to specify the file delimiter
2. Create a combo field that has the locale language setting:
The language code should follow the specifications below.
ISO 639 alpha-2 or alpha-3 language code, or registered language subtags up to 8 alpha letters (for future enhancements). When a language has both an alpha-2 code and an alpha-3 code, the alpha-2 code must be used. You can find a full list of valid language codes in the IANA Language Subtag Registry (search for "Type: language"). The language field is case insensitive, but Locale always canonicalizes to lower case.
Well-formed language values have the form [a-zA-Z]{2,8}. Note that this is not the full BCP47 language production, since it excludes extlang. They are not needed since modern three-letter language codes replace them.
 
Example: "en" (English), "ja" (Japanese), "kok" (Konkani), “es” (Spanish)

3. Create a source code named SetGridExportLang



4. In the action diagram, add the source code call



Q: How to implement file viewer in WebClient using Office Web Viewer?

A: Go to this article.

Q: How to implement the WebClient log message console component?

A: The WebClient log message console is a component that shows log messages on a seperate console like window, it can be dragged and it's displayed when clicking the appopriate button or when a new log message is recieved.

     a. You need to install the WebClient-1.8.9-pre13559 version of WebClient or above.
    
     b. Create 2 functions with the following impl names: WebAlert and ConsoleMessage.
     
    
     - The ConsoleMessage function will make reference to the ConsoleMessage-page.wcli template, this creates the console component in the web page, if you're using a menu function to open the rest of your functions, then you can us this template only in the main menu function so any child function can interact with the console component.

     - The WebAlert function makes reference to the WebAlert-page.wcli template, you can use this in any function that will use log message statements to make them appear in the console component.
         
     c. Make your functions inherit from the corresponding base functions created before, example of a function that will create the console and also display log message.
     

     d. Generate your functions and test them, when you open the function's panel a button will appear on the bottom right corner of the screen (that's the button for opening the log message window).
      - Any time you use a log message statement in plex this will be displayed in the new console.




    • Related Articles

    • Building Custom Reports / Diagrams in CM evolveIT

      Please look at the attached file(s)
    • Using Regular Expressions to “Filter the Noise” in CM evolveIT

      Please look at the attached file(s)
    • Clone Detection Web Interface

      Our Clone Detection Summary page provides a % of Clones statistic in a speedometer presentation with a cost calculator below. Enter your estimated cost per line of code for maintenance each year and we will calculate your potential savings when you ...
    • Client/Server Guidelines

      This document is intended to help CM First customers appropriately size CM evolveIT Client and Server hardware and windows configuration for a CM evolveIT installation. A typical CM evolveIT installation would include a Windows server and a CM ...
    • CM evolveIT API Interface

      Overview Information managed in an evolveIT Inventory is available for access by 3rd Party applications via simple messaging architecture and a straightforward data access API. evolveIT provides a Service-Oriented Architecture. “Client” applications ...