Updating Template Content in SAS Java Application Projects

Introduction

Most of the template content found in migrated SAS Java projects will have new warnings because of the updated compiler in Eclipse 3.6. These warnings can be fixed manually for the following templates:
  • Java client for executing a SAS Stored Process template
  • SAS Information Delivery Portal Editable Portlet
  • SAS Information Delivery Portal Information Map Fixed Portlet
  • SAS Information Delivery Portal Information Map Runtime Portlet

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

With the release of the version 4.3 SAS middle tier applications, the Java client for executing a SAS Stored Process template now requires separate credentials for deploying SAS Foundation Services and running the stored process. 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 Continue.
  3. In the old package, open StoredProcessDriver.java, 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 will be 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, then right-click on either file and select Compare Withthen selectEach Other.
  16. (Optional) Delete the old, renamed package.

Update the Content of a SAS Information Delivery Portal Editable Portlet Template

The content for the SAS Information Delivery Portal Editable Portlet template was updated to use the com.sas.portal.Logger class instead of the now-deprecated SAS Foundation Services LoggerInterface. Although the LoggerInterface will work in SAS 9.3, Eclipse will display warnings and you might need to remove the LoggerInterface in the future.
To avoid the warnings and the use of deprecated code, recreate the project using the AppDev Studio 3.41 template. To recreate the Editable Portlet, follow these steps:
  1. If you want to reuse the current Editable Portlet project name for the new project, rename the current project by right-clicking the project in the Project Explorer and selecting Refactorthen selectRename.
  2. From Eclipse, select Filethen selectNewthen selectOther.
  3. Expand the SAS AppDev Studio folder.
  4. Select SAS Java Project, and then click Next.
  5. Enter the name for the project and click Next.
  6. Enable Add Template Content, expand the SAS Information Delivery Portal Portlet category, and select SAS Information Delivery Portal Editable Portlet. Click Next.
  7. Update the default values to match the portlet that you are trying to recreate and click Finish.
  8. 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 a navigator view, then right-click on either file and select Compare Withthen selectEach Other.

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

Portlets created from templates that use the Information Map content must be updated to remove the use of the SAS Visual Data Explorer. This can be accomplished with a simple code replacement. For each Java Project containing a portlet based on Information Maps, follow these steps:
  1. Select the Java Project containing the Information Map based portlet in the Project Explorer, Package Explorer, or Navigator view.
  2. Select Searchthen selectFile in the main menu.
  3. In the Search dialog box, enter VisualDataExplorer in the Contains text field.
  4. Enter *.java in the File name patterns field.
  5. Select Enclosing projects for the Scope, and click OK to perform the search.
  6. The string VisualDataExplorer will be found in two locations in Display.java. Double click the second search result to take you to that location in the file.
  7. In Display.java, replace the following lines:
    VisualDataExplorer vde = new VisualDataExplorer(sessionContext, mapName);
    DataSelection dataSelection = (DataSelection) vde.getDataModel();
    
    if (!vde.isOLAP()) {
    with the lines
    IntelligentQueryMetadataService queryService =
    (IntelligentQueryMetadataService)IntelligentQueryMetadataServiceFactory.newService();
    InformationMap informationMap = 
        queryService.getInformationMap(sessionContext, new PathUrl(mapName));
    DataSelection dataSelection = 
        DataSelectionFactory.newSampleDataSelection(informationMap, null);
    
    if (!informationMap.getStructure().isOLAP()) {
  8. Right-click in the Display.java file and select Sourcethen selectOrganize Imports to remove the import for the VisualDataExplorer and add imports needed by the new code.
  9. Save and close the file.