Adding Content to the Portal |
Overview of Adding WebDAV Graph Portlets |
A WebDAV graph portlet creates and displays a line graph, a bar chart, or a pie chart of data that is stored in a WebDAV repository. After you add properly formatted XML data files to the WebDAV repository, you can create and share WebDAV graph portlets that provide particular views of those data files. All portal users can create their own WebDAV graph portlets.
The following steps explain how to create XML data files and add them to the WebDAV repository, and how to create and share WebDAV graph portlets.
Step 1: Prepare the Data Set That You Want to Graph |
Developers in your organization must provide a valid SAS data set to use for the WebDAV graph. The developer should understand your organization's data models and should have SAS programming experience.
Often, you can use a SAS data set without any modifications. Other times, you might want to subset a SAS data set, or perform summary statistics. In general, the simpler the data (more processing that is completed by using the SAS programming language), the easier it is to display a graph in the SAS Information Delivery Portal. For storage and performance reasons, it is preferable to presummarize a large data set (one that has 5000 or more entries). In addition, a summary report is very appropriate for achieving a dashboard effect that enables users to see important information at a glance.
Step 2: Create an XML File and Add It to WebDAV |
The SAS Information Delivery Portal provides a macro that creates a properly formatted XML file from your SAS data set, and adds the XML file to the WebDAV repository. The XML file uses the standard SAS Report Model format that is used by other SAS applications, such as SAS Web Report Studio. The macro provides additional formats and labels that the WebDAV graph portlet requires in order to generate a graph.
To create and add the XML file, follow these steps:
Create a SAS program that invokes the publishToWebDAV macro. The macro file is located in the SAS-configuration-directory \Lev1\Web\Applications\SASPortal4.3\sasJobs directory.
In your SAS program, when you invoke publishToWebDAV , you must pass a set of arguments that specify the name of the SAS data set, the WebDAV location, and the credentials that are required to write to that location. The publishToWebDAV syntax is described after these steps.
Save and run the SAS program.
If there are any DBCS characters in the parameters (for example, davloc) the publishToWebDAV macro must run in a language-specific SAS environment. Another option is to save the SAS program in UTF-8 format, and use the Batch Submit with SAS 9.2 (UTF8) program to run the job.
The publishToWebDAV macro creates an XML file named data.xml in the WebDAV location that you specified.
Note: If you later update the SAS data set, you must run the macro again to re-create the data.xml file in order to see those updates in WebDAV graph portlets.
Here is the syntax for the publishToWebDAV macro:
%publishToWebDAV (sasdsn, davloc, userid, passwd)
All parameters are required in order to create and publish the XML file. Here are descriptions of the parameters:
Here is a sample SAS program that includes and invokes the publishToWebDAV macro:
%include 'publishToWebDAV.sas'; %publishToWebDAV('sashelp.class', 'http://localhost:8080/SASContentServer/repository/default/sasdav/graph1/ClassData', 'sasadm@saspw', '{sasenc}E19F24391F7B576C45200E543F0B37B4');
Step 3: Create and Share a WebDAV Graph Portlet |
After you have successfully completed Step 2, you can create and share a WebDAV graph portlet.
Here is a summary of the steps that are required to create and share a WebDAV graph portlet. For complete instructions, see the online Help that is provided with the SAS Information Delivery Portal:
Verify that a permissions tree folder exists for the group with which you want to share the portlet. If necessary, create a permissions tree folder. For more information, see Managing Portal Permission Trees in Metadata.
Log on to the portal as a group content administrator (in order to share the portlet with the respective group).
Create the WebDAV graph portlet. You can create a new portlet and add it to a page, create a new portlet independently of a page, or add an existing portlet to a page.
Edit the contents of the portlet in order to specify the location of the XML data file and other properties. You can specify the following properties:
the type of graph or chart that is to be created (line graph, bar chart, or pie chart).
the size of the graph or chart (small, medium, or large).
a title and a description.
the data variables that are used for the horizontal and the vertical axes. You can also specify a subcategory variable to provide more detail for the horizontal axis.
a statistic that is to be calculated based on the response variable (the variable that is used for the vertical axis). If you do not choose a statistic from the list that is provided, Sum is used as the default statistic.
a link to detailed information. If you want the portlet to display a link to other information, such as a SAS report or a stored process, enter the path for the link. The target file can be stored in SAS metadata or in the portal's WebDAV repository.
Create the path for a link for a metadata-based object (all objects except files and WebDAV packages):
METASERVER/+Products/SAS Intelligence Platform/Samples+/+Sample:Hello World
The following example illustrates a location in metadata for the file SAS_Email_Message.html:
WebDAV/Templates/notification/en
Adding the two items results in WEBDAV/Templates/notification/en/SAS_Email_Message.html.
Note: To determine the path, you can search for the file in the portal. (To find a WebDAV file, search on the Files category.) The path is displayed in the search results.
If you share the WebDAV graph portlet with a group of users, make sure that the group has permissions to access the target file.
For complete descriptions of the preceding properties, see the online Help that is provided with the portal.
Edit the properties of the portlet in order to share the portlet with a group of portal users. When you share the portlet with a group, only members of that group can access the portlet.
Note: In order to view the graph, group members must have read permissions for the XML file that you created on the WebDAV server.
If you have added XML data files to the WebDAV server, all portal users can create WebDAV graph portlets and add those portlets to their pages by using the portal Customize menu. The group content administrators can use the portal Customize menu to create portlets. In either case, only users who are authorized as an administrator for a group can share a portlet with the group or edit a shared portlet.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.