Skip navigation links
SAP NetWeaver 7.50 SP 13 KMC

Package com.sapportals.wcm.service.urlgenerator

Provides a service that returns URLs to access resources in the CM system.

See: Description

Package com.sapportals.wcm.service.urlgenerator Description

Provides a service that returns URLs to access resources in the CM system.

Package Specification

Purpose
Detailed_Concept
Interface_and_Classes
Code_Samples
Configuration

Purpose

Services, controls and repositories access resources through their URLs. The IURLGeneratorService interface offers methods to create URLs for resources and to build valid URLs from partial information known to calling objects. The service uses information from the configuration of the running CM system to create complete URLs that point to web pages and can, for example, be included in pages or emails.

Detailed Concept

Relative and Absolute URLs

The URLs, which the URL generator service provides, can be relative or absolute. The relative URLs do not contain the protocol and server, for example:
/irj/servlet/prt/portal/prtroot/com.sapportals.km.explorer
The absolute URLs contain the protocol and server, for example: http://myserver.mycompany.de:8080/irj/servlet/prt/portal/prtroot/com.sapportals.km.explorer

It is good practice to use relative URLs as often as possible. Avoid the use of absolute URLs.

Creation of RIDs for Resources Related to Principals

RIDs are URLs within Content Management. They identify a resource within a repository using the repository prefix as the first part of the URL. The prefix represents the path to the root directory of the repository. The following is a RID for the um repository:
/um/Smith
In this RID, um is the repository prefix. See also com.sapportals.wcm.utl.uri.RID.

The URL generator service, assisted by an IUserManagementRidGenerator object, can provide RIDs for resources that are associated with users, roles or groups. These resources are referred to as principal resources and can, for example, be photos of users. When the URL generator service receives a request for the RID of a principal resource, it delegates the task of generating the RID to an object that implements the interface IUserManagementRidGenerator. The object must be registered with the URL generator service to enable the task delegation.

The graphic shows a UserManagementRepository that implements the IUserManagementRidGenerator interface.
At startup of Content Management, the user management repository registers itself with the URL generator service. The service then delegates the task of generating RIDs for principal resources to the UserManagementRidGenerator that is implemented by the user management repository.
Note: Only one user management repository can be registered at a time. Registration requests of other repositories are ignored.

Creation of RIDs for Web Resources

A similar registration process is necessary for CM web repositories. With the help of the URL generator service, the URLs of web sites can be mapped to RIDs of CM web repositories. The URL generator service delegates the task of mapping the URLs to RIDs to an object that implements the interface IUriMapper and which is registered with the URL generator service.

The graphic shows 2 web repository managers that implement the IUriMapper interface.
At startup of Content Management, both web repository managers register themselves with the URL generator service. The service then delegates the task of mapping URLs of web repositories to RIDs to a UriMapper that is implemented by one of the managers. In the diagram below, the first attempt to get a RID fails. The second attempt, using the second web repository manager and IURiMapper object, succeeds.
Note: Several UriMapper objects can be registered with the URL generator service at the same time.

Interface and Classes

The graphic shows the central interfaces of the URL generator service. The class PathKey defines constants that are used as parameters for some methods of the IURLGeneratorService interface.

Code Samples

 IURLGeneratorService ug = (IURLGeneratorService)ResourceFactory
    .getInstance()
    .getServiceFactory()
    .getService(IServiceTypesConst.URLGENERATOR_SERVICE);

 RID rid = <rid of some resource>;
IUriReference uriRef = ug.getResourcePageUri(PathKey.DETAILS_PAGE,
rid,null);
com.sapportals.htmlb.Link link = new Link("detail",
"Details");
link.setReference( uriRef.toExternalForm() );

 RID rid = <rid of some resource>;
IUriReference uriRef = ug.getResourcePageUri(PathKey.DETAILS_PAGE,
rid,null);
IHierarchicalUri uri = ug.createAbsoluteUri(uriRef);
String uriString = uri.toExternalForm();
// put <uriString> into an email

Configuration

The URL generator service can be configured with the parameters shown in the table.
The parameters can be set with the help of the user interface of the Content Management configuration framework.
For more information, see the documentation Administering Content Management.

The parameters in the table that are not required have default values that are used if no value is specified.

Parameter
Required
Description
class yes The class that implements the IURLGeneratorService interface and is used for this system
Applog Download Servlet yes URL to the application log
Applog Path yes URL to a page displaying the application log
Business Card Servlet yes URL to a user's business card (contains a placeholder for the user's ID)
Content Access Path yes URL to put in front of a resource URL to get its content
Default Configuration File yes An XML file that holds information for the WDF. If no XML file is specified in requests to the URL generator, this file will be used instead.
Edit Servlet yes URL to a page for editing XML forms
Explorer Servlet yes URL to the old page used for navigating through repositories and performing actions on resources (e.g. folders, files and links).
Favorite Servlet yes URL to a user's favorites
Host yes Address of the CM web server
Ice Path yes URL to the content exchange servlet, which can handle incoming ICE-packages (@link com.sapportals.wcm.service.ice}
Image Path yes URL for retrieving images
Link List Servlet yes URL to the linked list servlet
List Servlet yes URL to a page displaying a list of XML forms
Navigation Servlet yes URL to the new page used for navigating through repositories and performing actions on resources like folders, files and links.  
New Resource Properties Page yes URL to the new page for displaying details of a resource (e. g. properties).
Preview Servlet yes URL to a page displaying previews of edited XML forms
Resource Properties Page yes URL to the old page for displaying details of a resource (e. g. properties)
Service Servlet yes URL to use when links in emails etc. are used to carry out services (such as approving a document or deleting a subscription)
User Home yes The folder where a user's inbox is located at.
User Mapping Servlet no URL to a page for mapping user identifiers
Viewer yes URL to place in front of a resource URL to display its content
XML Forms Builder yes URL to the XFBuilder of XML forms
XML Forms CSS URL yes URL to the location of CSS files used for XML forms



Skip navigation links
SAP NetWeaver 7.50 SP 13 KMC

Copyright 2018 SAP AG Complete Copyright Notice