Updating Template Content in SAS Web Application Projects That Use SAS Foundation Services

Recreate the Local Foundation Services Deployment Descriptor

If your project uses Local Foundation Services, you must recreate the ADS Local Services deployment descriptor in your SAS 9.3 metadata. Follow these steps:
  1. Open SAS Management Console and use sasadm@saspw to connect to the SAS Metadata Server for the SAS BI installation that you are developing against.
  2. Select the Plug-ins tab.
  3. In the Environment Management folder, expand Foundation Services Manager.
  4. Right-click SASWIPServices9.3 Local Services, and then select Duplicate Service Deployment.
  5. Enter a name for the service deployment that is appropriate for your Web application (for example, SASAppDevStudio3.4 Local Services).
  6. Click OK to create the service deployment and then exit the SAS Management Console.

Update the Context Listener Template Content

Regardless of the type of SAS Foundation Service used, update the FoundationServicesContextListener class in the project by re-applying the appropriate SAS Foundation Services Support template.
Before you start the update, you need to know whether the listener deploys Foundation Services that are local, remote, or both. You can determine the type of deployment by examining the web.xml file in the project. If a <context-param> named local.sas.foundation.services exists, then Local Foundation Services are being deployed. If a <context-param> named remote.sas.foundation.services exists, the Remote Foundation Services are being deployed.
Perform the following steps to update the FoundationServicesContextListener class in the project:
  1. From Eclipse, select Filethen selectNewthen selectOther.
  2. Expand the SAS AppDev Studio folder, select Add Template Content to Project, and then click Next.
  3. In the Project field, select the project to update.
  4. In the Templates tree, expand SAS Java Web Application and then SAS Foundation Services Support.
  5. If the Web application that you are migrating deploys only local SAS Foundation Services, select Context Listener For Local Services.
    If the Web application deploys only SAS Remote Services, select Context Listener for Remote Services.
    If the Web application deploys both local and remote services, select Context Listener for Remote and Local Services.
  6. Click Next.
  7. Click Next to accept the default Template Configuration Parameters.
  8. When the Template Wizard fails to display the SAS BI Server Profile for the old, invalid multicast address and port, a new profile called Auto-created Profile is generated. This generated SAS BI Server Profile contains the stored multicast address and port and the defaults for all remaining settings.
    When AppDev Studio attempts to acquire the BI Server information for an Auto-created Profile, click Cancel, or allow the acquisition to fail. Failure takes approximately 20 seconds.
  9. Select a valid BI Server Profile.
  10. If an ADS Local Services deployment descriptor was created but was not named SASAppDevStudio3.4 Local Services, click Advanced. In the Local Services Deployment section, select Other, click Browse, select the service deployment descriptor that you created earlier, and then click OK.
  11. If the SAS Metadata Server for the BI installation is running, you can click Test Configuration to verify that the service deployment or deployments can be read from the metadata server.
  12. Click Finish.
In addition to updating the FoundationServicesContextListener.java file, you must also update the launchParameters.txt file to match the launch parameters of your test Server. For example, the ADS Apache Tomcat v6.0 at localhost server created in the New Workspace Setup cheatsheet.

Remove the Content from an Information Map Viewer Servlet (uses SAS Visual Data Explorer and SAS FS) Template

Because the SAS Visual Data Explorer is no longer available in SAS 9.3, content from the Information Map Viewer Servlet (uses SAS Visual Data Explorer and SAS WIP) template must be removed from your project. Follow these steps:
  1. In the Project Explorer, expand the Java Resources folder, the src folder, and then the folder(s) that represent the package(s) where the servlets for the Information Map Viewer Servlet template were placed. The default folder is servlets.
  2. In the WEB-INF folder, right-click the web.xml file, and open it with a Text Editor or XML Editor.
  3. Select Searchthen selectFile in the main menu.
  4. In the Search dialog box, enter VisualDataExplorerServlet in the Contains text field.
  5. Enter *.java in the File name patterns field.
  6. Select Enclosing projects for the Scope and click OK to perform the search.
    All occurrences of the VisualDataExplorerServlet string are displayed. The string will appear twice in any servlet produced by the Information Map Viewer Servlet (uses SAS Visual Data Explorer and SAS FS) template.
    For each servlet Java file that appears in the Search view, perform the following steps:
    1. In the web.xml file, delete the <servlet> element whose <servlet-name> is the servletBaseName. Also delete all of its children.
    2. Also in the web.xml file, delete the <servlet-mapping> element whose <servlet-name> is the servletBaseName. Also delete all of its children.
    3. In the WebContent folder, delete both the servlet JSP file (<servletBaseName>Viewer.jsp), and the servlet Java file (<servletBaseName>ControllerServlet.java).
    Remove any other servlets not identified in the search. Save and close the web.xml file.

Update Content for a Report Viewer Servlet (uses SAS Web Report Viewer and SAS FS) Template

Because the SAS Visual Data Explorer and the Information Map Viewer Servlet template are no longer available, the ability to display a selected SAS Information Map is now provided by the Report Viewer Servlet (uses SAS Web Report Viewer and SAS FS) template.
Both SAS Web Report Viewer and SAS Web Report Studio can display reports that are generated from an Information Map. However, these generated reports do not support all the features of the now-deprecated SAS Visual Data Explorer, nor do SAS Web Report Viewer and SAS Web Report Studio always deal with Information Map features in the same way. For example, if you generate a report from an Information Map with a filter that uses a prompt, SAS Web Report Viewer and Web Report Studio handle the prompt differently. To achieve equivalent functionality, a new report must be created based on the Information Map. Similarly, because Data Explorations cannot be displayed by SAS Web Report Viewer or SAS Web Report Viewer Studio, a new report is required.
To manually update all the Report Viewer Servlet templates in your project to display Information Maps without reapplying a template, follow these steps:
  1. In the Project Explorer, expand the project to update, and then the WebContent and WEB-INF folders.
  2. In the WEB-INF folder, right-click the web.xml file, and open it with a Text Editor or XML Editor.
  3. Select Searchthen selectFile in the main menu.
  4. In the Contains text field, enter:
    filterList.add("Report");
  5. In the File name patterns field, enter *.java.
  6. For the Scope, select Enclosing projects and then click OK to perform the search.
    For each occurrence of filterList.add("Report"); in the Search view, perform the following steps:
    1. From the main menu, select Navigatethen selectNext Match. This will open the Java file in an editor and take you to the line where the text was found.
    2. Above the filterList.add("Report"); line add a new line:
      filterList.add("InformationMap");
    3. Save and close the file.
    4. In the web.xml file, find the <servlet> declaration whose name matches the Java file that you just edited.
    5. Update each <init-param> value to what is appropriate for the target SAS EBI installation. The viewer parameter should be in the form of
      http://<ebi_host>:<ebi_port>/<context>/logonAndRender.do
      The <context> is either SASWebReportStudio or SASWebReportViewer, depending on which is in the SAS EBI installation.
Rebuild the project if it is not building automatically.

Update the Java Files for a SAS Stored Process Servlet (uses SAS FS) Template

This process updates the StoredProcessConnection.java and StoredProcessFacade.java files for the SAS Stored Process Servlet template that uses Foundation Services. If you are using the Web Infrastructure Platform, see Update the Java Files for a SAS Stored Process Servlet (uses SAS WIP) Template.
There are two ways to update these Java files, which are produced by the SAS Stored Process Servlet (uses SAS FS) template. The first way is to add a new stored process template to the project. The addition of the template updates the Java files automatically.
The second way, documented here, is to copy the Java files from a new, temporary project that uses SAS Foundation Services and then insert them into the migrated project. Follow these steps to create the temporary project and add the stored process template:
  1. Select Filethen selectNewthen selectOther, expand Web, and select Dynamic Web Project. Then click Next.
  2. Enter a name for this temporary project.
  3. Change the Dynamic web module version to 2.4, and the Configuration to SAS 9.3 Java Components Configuration. Click Finish.
  4. Select Filethen selectNewthen selectOther, expand SAS AppDev Studio, and select Add Template Content to Project. Click Next.
  5. For Project, ensure that the Dynamic Web Project you just created is selected.
  6. For the Template, expand SAS Java Web Application, and SAS Web Application Examples , and then select SAS Stored Process Servlet (uses SAS FS). Click Next.
  7. Click Next. Select a BI Server Profile. Click Next again.
    The BI Server Remote Services for this profile must be running.
  8. If not already connected to a BI Server, click the Change button and log on.
  9. Click the Change button in the Stored Process section, and select a stored process. Click OK, and then Finish.
To copy the StoredProcessConnection.java and StoredProcessFacade.java files, follow these steps:
  1. In the Project Explorer view for the new temporary project, expand Java Resources, src, and support.storedprocess.
  2. Expand the same items in the project being migrated.
  3. Select both the StoredProcessConnection.java and StoredProcessFacade.java files in the source project, and then right-click and select Copy.
  4. In the migrated project, right-click on the support.storedprocess package, and select Paste.
  5. When prompted to confirm overwriting, click Yes to All.
    If either of the files in the migrated project are open in editors, switch to those editors and select Filethen selectSave.
    The Java files are now updated.
  6. Delete the temporary project.
Stored process servlets in the project being migrated will contain new generics warnings. These warnings can be suppressed by changing each of the @SuppressWarnings found in the Java file to @SuppressWarnings({“unchecked”, "rawtypes"}). You can also review how the warnings were addressed in the stored process servlet in a new project and make the same change in the migrated project.