See: Description
Interface | Description |
---|---|
IPlaceholderResolver |
Used by the URL Generator Service to resolve placeholders within URIs.
|
IUriMapper |
Maps between RIDs and uri/uri references.
|
IURLGenerator | Deprecated
as of EP 5.0 SP5, replaced by interface
IURLGeneratorService |
IURLGeneratorService |
Offers methods to get relative or absolute URIs pointing to certain resources
of the CM system like iViews or repositories.
|
IUserManagementRidGenerator |
Generic interface for the generation of user management specific RIDs.
|
Class | Description |
---|---|
DecodedContextURL |
Encapsulates an IPropertyMap containing the variant properties and a java.util.Map containing
the non-variant additional properties of a decoded URL segment that contained variant information
Copyright (c) SAP AG 2001-2005
|
PathKey |
An enumeration of all possible keys which can be used to query the
corresponding path from
IUrlGeneratorService . |
ServletCallParameters | Deprecated
As of EP 5.0 SP4, this interface is no longer in use
|
URLGeneratorServiceFactory |
Service factory for the service of this package.
|
Exception | Description |
---|---|
AlreadyRegisteredException |
Copyright (c) SAP AG
|
Provides a service that returns URLs to access resources in the CM system.
Purpose
Detailed_Concept
Interface_and_Classes
Code_Samples
Configuration
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.
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
Relative URLs are sufficient for creating links
between pages on the same server. This kind of URL is
represented by the IUriReference
interface
Absolute URLs are only necessary for creating links
which point to pages on other servers or which are to be sent
via email. Absolute URLs are represented by the IHierarchicalUri
interface.
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.
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.
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
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 |
Copyright 2018 SAP AG Complete Copyright Notice