Adding, Editing, and Removing Page Templates

Add a Page Template

A page template is a specific implementation of a page definition. Page templates enable an administrator to define which pages new users see the first time they log on to the portal. Page templates are always associated with a group that is defined in SAS metadata.
For more information about page templates, see Page Templates .
Before you can create a page template and associate it with a group, you must create a permissions tree in SAS metadata for the group. To verify that a permissions tree exists, or to create one, see Managing Portal Permission Trees in Metadata .
There are two ways to create a page template and add it to the portal:
  • In the portal, create a page template from an existing page.
    When you create a page template in the portal, the portal adds the page template's metadata to the metadata repository.
    Here is a summary of the steps that are required to create and share a page template. For complete instructions, see the online Help that is provided with the portal:
    1. Log on to the portal as the group content administrator for the group.
    2. Create a page in the portal, and add the contents that are appropriate for the page.
    3. Use the Options menu to convert the page to a template.
    4. When you convert the page to a template, you can share the template with a group that is defined in SAS metadata. For details about sharing portal content in general, see Sharing Content in the Portal .
  • Create a page template by running a SAS program.
    To edit and run a SAS program that creates a page template and adds the template metadata to the SAS metadata repository, follow these steps:
    1. Modify the SAS program LoadPageTemplateExample.sas, which is located in SAS-configuration-directory \Lev1\Web\Applications\SASPortal4.3\sasJobs directory. In the LoadPageTemplateExample.sas file, specify the appropriate variables for your page template.
    2. After you have modified LoadPageTemplateExample.sas, save your changes and run the program. After you run the program, a page is created for each user who is a member of the specified group.
Here are descriptions of the variables that are in LoadPageTemplateExample.sas:
options metaserver=“host”
Specify the host name of the SAS Metadata Server. Use the value of the iomsrv.metadatasrv.host property in the configuration file located in the SAS-configuration-directory\Lev1\Utilities directory. For example: localhost machine machine.mycompany.com
metaport=port
Specify the port number of the SAS Metadata Server. This value is a number between 0 and 65536. Use the value of the iomsrv.metadatasrv.port property in the configuration file located in the SAS-configuration-directory \Lev1\Utilities folder.
metauser=“user ID”
Specify the user ID to use to connect to the SAS Metadata Server; this user ID is typically the sastrust user (default, sastrust@saspw).
metapass=“password”
Specify the password for the metauser. Make sure that this file is secure, or delete the file when you are finished. This file contains the password for the SAS Trusted User.
metarepository=“repository”;
Specify the name of the SAS Metadata Repository in which your portal metadata is stored, followed by a semicolon (;). Use the value of the oma.repository.foundation.name property in the configuration file located in SAS-configuration-directory\Lev1\Utilities directory.
%let repositoryName=“Foundation”;
%let groupName=SAS Group;
Specify the group that you want to add the data to, followed by a semicolon (;). This group must be the same as the group that you verified or created in Step 1 in this topic. Before you can run LoadPageTemplateExample.sas, the group permissions trees must be created in the SAS Metadata Repository.
%let pageName=Page Template Name;
Specify the name of the page template that you want to create, followed by a semicolon (;).
%let pageDescription=page template description;
Specify the description of the page template that you want to create, followed by a semicolon (;).
%let shareType=Default | Sticky;
Specify whether the page is Persistent or Default, followed by a semicolon (;).
Default
Default user or group pages are automatically added to the portal of the user, or of all users in a group. The users can later remove the page.
Sticky
Persistent group pages are automatically added to the user's portal, or all users in the group. Users cannot remove the page.
%let profile=DESKTOP_PROFILE;
Do not change this value. (This metadata exists in order to allow for future expansion. Currently, only desktop profiles are supported.)
%let role=DefaultRole;
Do not change this value. (This metadata exists in order to allow for future multiple roles. Currently, only the default role is supported.)
%let pageRank=pageRank;
Specify the page rank that you want for this page template, followed by a semicolon (;). All pages that are created from this page template have this page rank.
Pages are ordered in the portal by rank from lowest to highest. Pages with equal rank are listed in the order in which they were created. Portal users can choose to override page ranks by explicitly defining the order of pages.
data pageTemplate;
Specifies the SAS data set that defines the data values for the page template contents.
Do not modify the section between the "data pageTemplate" line and the "cards4" line, which describes the data in the data set. The data between the "cards4" line and the ";;;;" line describes each portlet (1 per line) that you want to place on the page template. The line is formatted as a comma-separated value (CSV) line, and each column denotes a different value for the portlet. For example, the following lines create four portlets, with two portlets in each column on the page: 1,1,Bookmarks,Bookmarks portlet Description,Bookmarks template 1,2,Alerts,Alerts portlet Description,Alerts template 2,1,My Links,Description of portlet,Collection template 2,2,Welcome,Welcome portlet Description,Welcome template ;;;;
Specify the information for each portlet as follows:
columnNum
Specify the column number in which to place the portlet on the page. Each page in the portal can have up to three columns.
portletPos
Specify the position of the portlet within the column. The portlets are positioned in ascending order from top (lowest number) to bottom (highest number).
portletName
Specify the name of the portlet to add. This is the name that identifies the portlet on the page. If a portlet already exists with the same portletName, the existing portlet is used, and a new portlet is not created. This field cannot contain a comma.
portletDescription
Specify the description of the portlet to add. This field cannot contain a comma.
prototypeName
Specify the name of the prototype that was created when the portlet was deployed. The prototype is the name of the portlet's template. Here are examples of pre-defined prototype names: Alerts template Bookmarks template Collection template WebDAVContent template PersonalRepositoryNavigator template PubChannelSubscriptions template ReportsNavigator template ResultsNavigator template StoredProcessNavigator template TreeNavigator template WebDAVNavigator template WebDAVGraph portlet DisplayURL portlet Welcome template
The template name for custom portlets is "<portletName> template". This field cannot contain a comma.
data properties;
Specify the SAS data set that defines any additional data properties that are needed by the portlets. This variable enables you to add default starting data to template portlets.
If there are no additional data properties for any portlets, delete the section between the “cards4;” and “;;;;” lines.
Do not modify the section between the "data properties" line and the "cards4" line, which describes the data in the data set as follows: data properties; length colPos $80 propName $80 propValue $80; infile cards4 delimiter=','; input colPos propName propValue; cards4;
The data between the “cards4” line and “;;;;” lines describes each property (one per line) that you want to define. The line is formatted as CSV, and each column denotes a portion of the property definition. For example, the following lines create four properties, one for the first portlet in the first column and three for the first portlet in the second column. 1_1,Name0,DefaultValue 0 2_1,MyCollectionPortletPropertyName1,DefaultValue 1 2_1,MyCollectionPortletPropertyName2,DefaultValue 2 2_1,MyCollectionPortletPropertyName3,DefaultValue 3 ;;;;
Specify the information for each property as follows:
colPos
Specify the column and position of the portlet to which you are adding this property. The format is <column>_<position>.
propName
Specify the name of the property to add. This field cannot contain a comma.
propValue
Specify the value of the property to add. This field cannot contain a comma.
data collectionData;
Specify the SAS data set that defines any collection or bookmark links to add to collection or Bookmarks portlets.
If no links are required for any of the portlets, delete the section between the “cards4” and “;;;;” lines.
Do not modify the section between the “data collectionData” line and the “cards4” line, which describes the data in the data set as follows: data collectionData; length colPos $80 dataType $80 searchStr $80; infile cards4 delimiter=','; input colPos dataType searchStr; cards4;
The data between the “cards4” line and the “;;;;” line describes each link (one per line) that you want to add to Collection or Bookmarks portlets. The line is formatted as CSV, and each column denotes a portion of the link definition. For example, the following lines create three links, one for the first portlet in the first column and two for the first portlet in the second column. 1_1,Document,@Name='SAS' 2_1,Document,@Name='CNN' 2_1,Document,@Name='CNNSI' ;;;;
Specify the information for each link as follows:
colPos
Specify the column and position of the portlet to which you are adding this link. The format is <column>_<position>.
dataType
Specify the metadata type of the data object to be added to the collection or Bookmarks portlet. Acceptable values include the metadata types for any object that can be added to a collection portlet. Here are the supported object types (available in a portal search) along with the metadata dataType for each:
Types of Metadata for Supported Object Types
Object Type Metadata
dataType
Application
Document
Link
Document
Package **
ArchiveFile
Portlet
PSPortlet
Publication Channel
ITChannel
Information Map
Transformation
SAS Report
Transformation
SAS Stored Process
ClassifierMap
Syndication Channel
Document
** A publication package must be stored in SAS metadata in order to be referenced in the page template. The package cannot be stored in WebDAV.
searchStr
Specify a XMLSelect string that uniquely locates the data to add to the collection or Bookmarks portlet. The XMLSelect string is in the form @Name='name', where 'name' corresponds to the Name metadata attribute for the object.
If the data is not found, this program continues executing, ignores this entry, and prints a WARNING to the log.

Edit or Remove a Page That Was Created from a Page Template

You can edit or remove pages that have been created from a page template in the same way that you edit or remove any page. Here are the general rules:
Rules for Editing or Removing Pages Created from the Page Template
Action
Instructions and Rules
Edit a page
Edit a page by using the Options menu in the SAS Information Delivery Portal. For more information, see the online Help that is provided with the portal.
The changes that you make to the page in your portal view have no effect on the pages that have been added to other portal views.
All portal users can edit a page that has been added to their portal views.
For a summary of the types of edits that you can make to a page, see Types of Edits That Can Be Made to a Page.
Remove a page
If the template page has an attribute of DEFAULT, then you can remove the page (created from the template) from your portal view by using the portal Options menu. Note that the page created from a DEFAULT template is not shared. When you remove such a page from your portal view, you do not affect the pages that have been added to other portal views. All portal users can remove a DEFAULT page that has been added to their portal views.
If the template page has an attribute of PERSISTENT, then you cannot remove the page created by this template from your portal view unless you first delete the page template from SAS metadata. For more information, see Delete a Page Template from the Portal.

Edit a Page Template

After you have created a page template, you cannot edit it. However, you can delete the page template, and create a new page template that contains the revised content. Note that when you delete a template page, users lose any changes that they made to the page created by the page template.
Depending on the method that you use to delete a page template, you can choose also to delete any pages that were created from the template. This feature is especially useful during the implementation phase for a new portal. After you create a page template, if you decide that it needs changes, you can delete the page template along with all pages that might have been created in other users' portal views. You can now create a new page template that contains the revised content.
For more information about deleting a page template, see Delete a Page Template from the Portal.

Delete a Page Template from the Portal

You might need to delete a page template if you decide that an existing page template is obsolete or that it needs to be modified. If a page template needs to be modified, you can delete the existing page template, and create a new page template that contains different content. When you delete a page template, you permanently remove the page template from SAS metadata and from the portal environment.
There are two ways to delete a page template:
  • Delete the page template in the portal.
  • Delete a page template by running a SAS program.
When you delete a page template in the portal, the portal removes the page template's metadata from the metadata repository.
Here is a summary of the steps that are required to delete a page template. For complete instructions, see the online Help that is provided with the portal:
  1. Log on to the portal as the group content administrator for the group with which the page template is shared.
  2. In the portal, search for and delete the page template.
  3. When you delete the page template, you can specify whether you also want to delete all of the pages that were created from the template.
When you delete a page template by running a SAS program, you do not remove any pages that were created from the template. After the page template has been removed, any pages that were created from the template remain in portal views, but are no longer associated with a template. If you create a new template, the new template does not affect any pages that were created based on the previous template. As a result, users see a new page along with the original page in their portal views. Users can review the changes that appear in the new page, remove the original page from their portal views, and re-personalize the new page.
To delete a page template by running a SAS program, follow these steps:
  1. Modify the SAS program RemovePageTemplate.sas, which is located in the SAS-configuration-directory\Lev1\Web\Applications\SASPortal4.3\sasJobs directory. In the RemovePageTemplate.sas file, specify the appropriate variables for the page template that you want to remove.
  2. After you have modified RemovePageTemplate.sas, save your changes and run the program.
Here are descriptions of the variables that are in RemovePageTemplate.sas:
options metaserver=“host”
Specify the host name of the SAS Metadata Server. Use the value of the iomsrv.metadatasrv.host property in the configuration file located at SAS-configuration-directory \Lev1\Utilities folder. For example: localhost machine machine.mycompany.com
metaport=port
Specify the port number of the SAS Metadata Server. This value is a number between 0 and 65536. Use the value of the iomsrv.metadatasrv.port property in the configuration file located at SAS-configuration-directory \Lev1\Utilities folder.
metauser=“user ID”
Specify the user ID to use to connect to the SAS Metadata Server; this user ID is typically the SAS Trusted User (sastrust) (default, sastrust@saspw).
metapass=“password”
Specify the password for the metauser. Make sure that this file is secure, or delete the file when you are finished. This file contains the password for the SAS Trusted User.
metarepository=“repository”;
Specify the name of the SAS Metadata Repository in which your portal metadata is stored, followed by a semicolon (;). Use the value of the oma.repository.foundation.name property in the configuration file (located in the SAS-configuration-directory\Lev1\Utilities directory).
%let groupName=SAS Group;
Specify the group that you want to remove the data from, followed by a semicolon (;).
%let pageName=Page Template Name;
Specify the name of the page template that you want to remove, followed by a semicolon (;).
%let shareType=Sticky | Default;
Specify the page type as either is persistent (sticky) or default, followed by a semicolon (;).
%let profile=DESKTOP_PROFILE;
Do not change this value. (This metadata exists in order to allow for future expansion. Currently, only desktop profiles are supported.)
%let role=DefaultRole;
Do not change this value. (This metadata exists in order to allow for future multiple roles. Currently, only the default role is supported.)