Updating Template Content in SAS Java Application Projects

Introduction

The switch from Remote Foundation Services to Local Foundation services affects the following templates for SAS Java projects:
  • Java client for executing a SAS Stored Process template
  • SAS Information Delivery Portal Information Map Runtime Portlet

Update the Content for a Java Client for Executing a SAS Stored Process Template

Switching the Java Client for Executing a SAS Stored Process template from using Remote Foundation Services to Local Foundation Services resulted in a number of files changing. In addition, a JAAS configuration file needs to be added to the project so that the Java application that executes the stored process can be run successfully. The preferred way to update a Java client in SAS Java Applications projects is to re-apply the stored process template and create a new Java client. You can either create a new Java client in a new package, or refactor the original Java client package and then reuse it for the new Java client.
The classes found in the support.storedprocess package are automatically updated when a new Java client is created, and do not need updating. These classes are used by the Stored Process Java clients found in the project.
For each Stored Process Java client in the project, follow these steps to create a new Java client file and then copy your customized code to it:
  1. In the Project Explorer, right-click the existing package (typically console.app) and select Refactorthen selectRename.
    The package typically contains the Java and properties files for the client (StoredProcessDriver.java and StoredProcessDriver.properties).
  2. In the New name field, append .old to the existing package. Click OK and then click Continue.
  3. In the old package, open the StoredProcessDriver.java class, find the STORED_PROCESS_PATH_URL static String, and note the name of the stored process.
    These instructions assume that you want to run the same stored process as in the original client.
  4. From Eclipse, select Filethen selectNewthen selectOther.
  5. Expand the SAS AppDev Studio folder.
  6. Select Add Template Content to Project, and then click Next.
  7. In the Project field, ensure that the project containing the Java client to update is selected.
  8. In the Templates tree, expand SAS Stored Process, select the Java client for executing a SAS Stored Process template, and click Next.
  9. Select the BI Server Profile for the SAS 9.3 BI installation that you want the Java client to run against, and click Next.
  10. Ensure that you are logged in with the correct Connection Profile.
  11. Update the Package name and Class name.
  12. For the Stored Process, click the Change button, select the stored process to execute, and then click OK.
  13. Update any other options and click Finish.
  14. In the new Java file that is automatically opened, update the stored process prompt values. Missing values are marked as errors.
  15. Copy your customizations in the old Java file to the new one.
    To compare files, select both the old and new versions of the Java file in the navigator view, and then right-click on either file and select Compare Withthen selectEach Other.
  16. (Optional) Delete the old, renamed package.
Adding this template creates the jaas.config and launchParameters.txt files in the root of the project. The jaas.config file contains the needed JAAS configuration, and the launchParameters.txt file contains an example of the Java System property that must be defined for the Java application to execute.
If you are working in AppDev Studio 4.4 with maintenance for SAS 9.4, add the JAAS configuration to the run configuration VM arguments.
  1. Right-click StoredProcessDriver.java in the new console.app package.
  2. Select Run Asthen selectRun Configurations.
  3. Select Arguments.
  4. Add the Java VM argument to the VM arguments section and click Apply.

Update the Content of the SAS Information Delivery Portal Information Map Runtime Portlet Template

Switching the SAS Information Delivery Portal Information Map Runtime Portlet template from using Remote Foundation Services to Local Foundation Services requires one simple change.
To update the template:
  1. In the Project Explorer, expand the Java Resources folder, the src folder, and then the package that contains the Initializer.java source file. The default package is infomapruntimeportet.infomap.
  2. Right-click the Initializer.java source file and select Open.
  3. From the main menu, select Editthen selectFind/Replace.
  4. In the Find field, enter REMOTE_USER_CONTEXT. In the Replace with field, enter USER_CONTEXT. Then click Replace All to replace the one occurrence in the file.
  5. Save and close the file.