### Configure systemd Service for ApplinX Server - Linux Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=installing-applinx-server Configuration for a systemd service unit to manage the ApplinX server on Linux. This file defines how the service starts and stops, including environment setup and script execution. Ensure 'ExecStart' and 'ExecStop' parameters reflect the correct installation path. ```systemd # ----------------------------------------------------------------------------- # # Software AG ApplinX Server # # Copyright (c) 2014-2023 Software AG, Darmstadt, Germany and/or Software AG # USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates # and/or their licensors. # Use, reproduction, transfer, publication or disclosure is prohibited except # as specifically provided for in your License Agreement with Software AG. # ----------------------------------------------------------------------------- # sag1applinx.service [Unit] Description=Software AG ApplinX Server After=multi-user.target [Service] Type=forking RemainAfterExit=yes Restart=no User=sag ExecStart=/bin/bash -c ". /opt/webmethods/suite_10-11_OCT2021/ApplinX/apxenv && cd $APPLINX_ROOT/bin && ./startup.sh" ExecStop=/bin/bash -c ". /opt/webmethods/suite_10-11_OCT2021/ApplinX/apxenv && cd $APPLINX_ROOT/bin && ./shutdown.sh" [Install] WantedBy=multi-user.target ``` -------------------------------- ### Start ApplinX Server - Windows Batch Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=installing-applinx-server This batch file is used to start the ApplinX server on Windows. It is located in the ApplinX installation's bin folder. ```batch startup.bat ``` -------------------------------- ### Implementing onHostKeysComplete for Advanced Customization (.NET Example) Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-general-application-customization This C# code example shows how to implement the `onHostKeysComplete` method within a `UserHostKeysTagTransform` class for .NET applications. It includes functionality to add links, iterate through host key tags, modify link text, and remove tags based on specific conditions. ```C# public override void onHostKeysComplete(GXITableTag hostKeysTableTag, GXIScreen screen) { /* base.onHostKeysComplete(hostKeysTableTag, screen); //add link addLink("Host help", "gx_SubmitKey('[pf1]')"); //get all tags GXITag[] tags = getHostKeysTags(); //loop on controls in hostKeys array foreach (GXITag tag in tags) { if (tag is GXILinkTag) // or GXIButtonTag or GXHtmlString (for type="template") { //get link GXILinkTag link = (GXILinkTag)tag; // change control text if (link.getText().IndexOf("Prev") >= 0) { link.setText("Previous"); } //remove control if (link.getText().IndexOf("Pagedn") >= 0) { ``` -------------------------------- ### Start Natural Application Script (apx.sh) - Shell Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=installing-natural-linux-cloud The apx.sh shell script is used to start a Natural session. It extracts arguments for IP address, client ID, parameters, and custom values, then invokes the Natural APX executable. It handles Natural Data Transfer settings. ```shell #!/bin/sh # Extract the arguments IP_ADDR=$1 CLIENT_ID=$2 PARAMETERS=$3 CUSTOM=$4 # Trace #PT_TRACELEV=i6000 #SAGTMP=$HOME/tmp #export PT_TRACELEV #export SAGTMP # Natural Data Transfer NSWUCI_FD=$UNIUCI_FD export NSWUCI_FD # $NATDIR/$NATVERS/bin/natapx parm=$PARAMETERS etid=$$ >/dev/null 2>&1 ``` -------------------------------- ### Implementing onHostKeysComplete for Advanced Customization (JSP Example) Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-general-application-customization This Java code example demonstrates the implementation of the `onHostKeysComplete` method within a `UserHostKeysTagTransform` class for JSP applications. It shows how to add new links, retrieve existing host key tags, modify their text, and remove specific tags programmatically. ```Java public void onHostKeysComplete(GXITableTag hostKeysTableTag, GXIScreen screen) { super.onHostKeysComplete(hostKeysTableTag, screen); /* // add link addLink("Host help","gx_SubmitKey('[pf1]')"); //get all tags GXITag[] tags = getHostKeysTags(); for (int index=0; index= 0){ link.setText("Previous"); } //remove tag if (link.getText().indexOf("Pagedn") >= 0){ removeTag(link); } } } */ } ``` -------------------------------- ### Start Service Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=applinx-administrative-web-services-api Starts a specified connection pool within an application. Requires username, password, application name, service name, and optionally a folder name. Returns a boolean indicating success or failure. ```Java StartServiceResponse startService(StartServiceRequest request) ``` -------------------------------- ### StartService API Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=applinx-administrative-web-services-api Starts a specified connection pool. Requires user credentials, application name, service name, and optionally a folder name. ```APIDOC ## POST /api/applinx/startService ### Description Starts the connection pool specified in the request. Returns a response object indicating success or failure. ### Method POST ### Endpoint `/api/applinx/startService` ### Parameters #### Request Body - **username** (String) - Required - The name of the user who has the relevant permissions to access ApplinX Server. - **password** (String) - Required - The user's password. - **appName** (String) - Required - The name of the application on ApplinX Server. - **serviceName** (String) - Required - The name of the connection pool. - **folderName** (String) - Optional - The name of the folder where the connection pool is located. By default, this is the root folder. ### Request Example ```json { "username": "api_user", "password": "api_password", "appName": "MyApplication", "serviceName": "ConnectionPool1", "folderName": "Connections/Pools" } ``` ### Response #### Success Response (200) - **isSuccessful** (boolean) - Returns true or false, to indicate the success or failure of the action. #### Response Example ```json { "isSuccessful": true } ``` ``` -------------------------------- ### Migrate All ApplinX Applications After Installation (Batch/Shell) Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=installing-upgrading-migrating-fixes This script is used to migrate all ApplinX applications after the new server version has been installed. It requires the installation path of the previous version and the new installation path as input arguments. ```batch migrate_ApplinX_server.bat "c:\ApplinX52" "c:\webmethods\ApplinX" ``` ```shell migrate_ApplinX_server.sh "/opt/ApplinX52" "/opt/webmethods/ApplinX" ``` -------------------------------- ### ApplinX Procedure JSON Input/Output Example Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=application-working-json-files This example demonstrates the structure of a JSON file used to define input parameters and assertions for an ApplinX procedure. It shows how to specify user credentials, structured data for inputs, and expected values for assertions. ```json { "inputs": { "Code":"cu" "Password":"demoy2" "UserId":"demo02" "structure1": { "Birthday": "Customer_ID": "First_Name": "Last_Name": "Sex": "TotalPoliciesAmount": "Type": } } "Assertions": { "Firstname":"Charles "House_Number":"12 "Lastname":"Chappell "Mobile": "Municipal_Code": "Nationality_Long":"British" "Nationality_Short":"UK" "Occupation_Long":"Actor" "Occupation_Short":"81177" "PO_Box": "Person_Sex>M } } ``` -------------------------------- ### Start/Stop ApplinX Daemon (Shell) Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=installing-natural-linux-cloud Commands to start and stop the APX daemon, which is responsible for accepting new sessions. The daemon must be started on a service/port that is not currently in use. This functionality is available via a shell script. ```shell apxsrvd.sh servicename start apxsrvd.sh servicename stop apxsrvd.sh portnumber start apxsrvd.sh portnumber stop ``` -------------------------------- ### JSP Host Keys Component Example Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-server-side-api-javanet Example of using the gx_host:hostKeys custom tag in JSP to render host keys. It demonstrates vertical display, template key type, and custom CSS class, with dynamic image sourcing based on the action. ```JSP ``` -------------------------------- ### Start ApplinX Server - Linux Shell Script Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=installing-applinx-server This shell script is used to start the ApplinX server on Linux environments. It is located in the ApplinX installation directory. ```shell startup.sh ``` -------------------------------- ### Java Client Structure Example Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=application-procedure-groups-used-as-service-providers Illustrates the structure of a generated Java procedure client, showing how namespaces in ApplinX map to Java packages and class organization. ```java Package TestNamespace Public Class TestService { Public method A Public method B } ``` -------------------------------- ### .NET Client Structure Example Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=application-procedure-groups-used-as-service-providers Demonstrates the structure of a generated .NET (C#) procedure client, highlighting how namespaces and classes are organized within a single file. ```csharp Namespace TestNamespace { Public class TestService { Public method A Public method B } } Namespace BusinessEntityNamespace { Public class MyBusinessEntity { Public field A Public field B } } ``` -------------------------------- ### Invoking ApplinX Procedure via REST API Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=application-procedure-groups-used-as-service-providers Illustrates a sample REST URL for invoking an ApplinX procedure. This example uses a GET request with a flat input parameter. Complex or structured inputs are not directly supported via GET. ```text http://localhost:2380/wsstack/services/SOADemo.DEMOINS/GetCustomerByID?Select_Customer_ID=27 ``` -------------------------------- ### Natural-IO Application Scripts (Shell) Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=installing-natural-linux-cloud A list of shell scripts provided for the Natural-IO protocol, which enables SSL connections to a Natural Linux host without third-party components. These scripts are used for starting the Natural application, starting/stopping the daemon, and configuring environment settings. ```shell # nwo.sh: Shell script to start the Natural application. # nwosrvd.sh: Shell script to start and to stop the daemon. # nwosrvd.conf: Contains configuration parameters for authentication and localization. # nwoenv: Default environment script file for bash. # nwoenv.csh: Default environment script file for C shell. ``` -------------------------------- ### Configure ApplinX Redirector Servlet in web.xml Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-printlet-servlet-redirector-applinx This snippet shows how to configure the ApplinX Redirector Servlet by uncommenting a listener and adding context parameters to the web.xml file. The GXServerURL parameter must be updated to point to the ApplinX server. This setup is crucial for enabling the redirector functionality when the ApplinX and Web servers are on separate machines. ```xml com.sabratec.util.net.redirector.http.servlet.GXRedirectorServletSessionListener GXServerURL applinx://localhost:2323 ApplinX server URL ``` -------------------------------- ### Developing with Procedure Client API in C# Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=application-procedure-groups-used-as-service-providers Provides a C# code example demonstrating how to create and use procedure client API classes to execute an ApplinX procedure, including setting input, calling the procedure, and processing the response. ```csharp ProcedureRequest request = new ProcedureRequest (); BusinessEntityClassName InputObject = new BusinessEntityClassName(); InputObject.Attribute1 = Value1; InputObject.Attribute2 = Value2; request.InputAttribute = InputObject; ServiceClass service = new ServiceClass(); ResponseClass Response = service.Procedure(request) ForEach (string str in Response.Output) { Console.Out.Writeln(str); } ``` -------------------------------- ### Migrate all ApplinX applications via batch file Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=applinx-batch-automation-utilities This batch command migrates all ApplinX applications from a previous installation to the current version. It requires specifying the installation paths of both the old and new ApplinX versions. This is useful during upgrades or after a new server installation. ```batch migrate_ApplinX_server.bat "c:\ApplinX52" "c:\webmethods\ApplinX" ``` ```shell migrate_ApplinX_server.sh "/opt/applinx/old" "/opt/applinx/current" ``` -------------------------------- ### Configuration File Example (apxsrvd.conf) - INI Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=installing-natural-linux-cloud Configuration snippet for apxsrvd.conf, showing sections for UserExits, PasswdArguments, and PasswdMessages. This file provides parameters for the APX daemon, including user exit definitions and password handling messages. ```ini [UserExits] ; UserExit1=/FS/sag/nat/apxexuex/userexit1/libapxuserexit1.so [PasswdArguments] Parameters= [PasswdMessages] EnterOldPassword=Enter existing login password: NewPassword=New Password: ReEnterNewPassword=Re-enter new Password: PasswordSuccessful=passwd: password successfully changed for* ``` -------------------------------- ### Global Function Example - JavaScript Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-client-side-javascript An example of a global JavaScript function that can be placed in userExits.js. This function, globalOnLoad, is executed when a page loads and demonstrates how to access page tags and activate page-specific functions. ```javascript function globalOnLoad(gx_event){ // use win. to access the page tags // for example: win.document.GX_form var win = gx_event.window; // activate page scope function if exits activateIfExists(gx_event,gx_event.window.pageOnLoad); ......... } ``` -------------------------------- ### .NET Host Keys Component Example Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-server-side-api-javanet Example of using the gx:GXHostKeysControl server control in .NET to render host keys. It shows vertical display, template key type, and custom class attribute. ```.NET ``` -------------------------------- ### ApplinX External Web Service Creation Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=application-procedures This guide outlines the steps to create an external web service in ApplinX. It involves selecting the application, navigating through the File menu to create a new External Web Service, and configuring its source using a WSDL URL or file. ```text 1. Select the relevant application. 2. In the File menu select New > Entity > External Web Service. 3. The External Web Service wizard is displayed. 4. Enter a name and click Next. 5. The Web Service Source screen is displayed. 6. Select whether to use a WSDL URL. 7. When relevant, enter the WSDL URL or select a file name. 8. Click Finish. The External Web Service is displayed in the Editor area. ``` -------------------------------- ### Print Host Screen Capture with JavaScript Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-emulation-behavior-tasks Allows users to print a snapshot of the current host screen by executing a JavaScript function. This action opens a pop-up window displaying the screen without any transformations. To implement, add a button or link to the application's Master page that calls the gx_printScreen() function. ```html ``` -------------------------------- ### Example Input Parameters for Debugging Procedures Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=application-procedures This snippet demonstrates the format for providing input parameters when debugging an ApplinX procedure. It shows how to specify values for user-defined parameters, with notes on how empty or deleted values are handled. ```xml true demo5 ``` -------------------------------- ### Change Next Form Before Loading Page (JSP, .NET) Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-server-side-api-javanet These snippets show how to change the next page to be loaded using `e.nextForm`. The JSP example sets the next form to 'SCREEN_B.jsp' when the current screen is 'SCREEN_A'. The .NET example achieves the same using 'SCREEN_B.aspx'. ```JSP public void gx_changeNextForm(GXIHostPageContext gx_context,GXChangeNextFormEvent event)throws GXGeneralException{ if (gx_context.getGXSession().getScreen().getName.equals("SCREEN_A")){ event.setNextForm("SCREEN_B.jsp"); } } ``` ```.NET protected override void OnInit(EventArgs e){ this.gx_changeNextForm += new GXChangeNextFormEventHandler(user_changeNextForm); } protected void user_changeNextForm(object sender,GXChangeNextFormEventArgs e){ if (gx_session.getScreen().getName == "SCREEN_A"){ e.nextForm = "SCREEN_B.aspx"; } } ``` -------------------------------- ### JavaScript Example for Navigation Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-general-application-customization This example illustrates how to set a hidden field with a desired screen name and invoke a server-side function to navigate to that screen in an ApplinX web application. This is typically used in conjunction with navigation menus to directly access host application screens. ```javascript /* Example in template.jsp or template.master.cs */ // Setting a hidden field with the desired screen name document.getElementById('hiddenScreenName').value = 'DesiredScreenName'; // Invoking the server-side function to perform navigation // This would be triggered by a menu click event // Example: beforePaneMenuBtn_Click(); ``` ```csharp /* Example server-side function in template.master.cs */ protected void beforePaneMenuBtn_Click(object sender, EventArgs e) { string screenName = Request.Form["hiddenScreenName"]; if (!string.IsNullOrEmpty(screenName)) { // Logic to navigate to the specified screen using GXBasicContext or similar // Example: GXBasicContext.NavigateToScreen(screenName); } } ``` -------------------------------- ### Handle Keyboard Mapping Configuration Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-client-side-javascript Configuration snippet for defining specific keyboard key mappings within an XML file. This example shows how to map the Enter key on the numeric keypad to a target function, demonstrating a way to handle distinct key inputs. ```xml ``` -------------------------------- ### Post-fill Form Fields (JSP, .NET) Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-server-side-api-javanet These snippets show how to override field data received from the host screen after `gx_fillForm()` has been executed. The JSP example sets 'CustomerID' tag content from a session attribute, and the .NET example assigns the session's 'CustomerID' to the 'CustomerID' text control. ```JSP public void gx_postFillForm(GXIHostPageContext gx_context)throws GXGeneralException{ gx_context.getTagsAccesor().setTagContent("CustomerID",gx_context.getSession.getAttribute("CustomerID")); } ``` ```.NET protected override void OnInit(EventArgs e){ this.gx_postFillForm +=new EventHandler(user_postFillForm); } protected void user_postFillForm(object sender,EventArgs e){ CustomerID.Text = Session["CustomerID"]; } ``` -------------------------------- ### Pre-fill Form Fields (JSP, .NET) Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-server-side-api-javanet These code snippets demonstrate how to pre-fill form fields before `gx_fillForm()` is called. The JSP example sets the 'UserNameTitle' tag content using a session attribute, while the .NET example assigns the session's 'UserName' value to the 'UserNameTitle' text control. ```JSP public void gx_preFillForm(GXIHostPageContext gx_context)throws GXGeneralException{ gx_context.getTagsAccesor().setTagContent("UserNameTitle",gx_context.getSession.getAttribute("UserName")); } ``` ```.NET protected override void OnInit(EventArgs e){ this.gx_preFillForm +=new EventHandler(user_preFillForm); } protected void user_preFillForm(object sender,EventArgs e){ UserNameTitle.Text = Session["UserName"]; } ``` -------------------------------- ### Handling Input Parameters for ApplinX Web Services Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=application-procedure-groups-used-as-service-providers Demonstrates the XML structure for passing input parameters to ApplinX web services. Shows how empty or deleted values are handled, using default values when available or ApplinX defaults if not. ```xml true demo5 ``` -------------------------------- ### Instant Component Source: https://www.ibm.com/docs/en/applinx/11.1.0/index_topic=frameworks-server-side-api-javanet Displays the ApplinX instant HTML page. Configuration can be modified in `GXInstantLogicContext` (.NET) or `GXInstantLogicWebForm` (JSP). ```APIDOC ## Instant Component ### Description Use this control to display the ApplinX instant HTML page. It is included in `instant.aspx/jsp` and generated pages for screen groups. The instant configuration can be modified within the framework in the `GXInstantLogicContext` class (JSP) or `GXInstantLogicWebForm` class (.NET). Refer to the ApplinX API Specification for Javadoc details. ### Configuration For configuration options, see the `com.sabratec.applinx.presentation.GXRenderConfig` class in the ApplinX Development API Javadoc. ```