Show TOC

Background documentationComponent com.sap.portal.appintegrator.sap.Generic Locate this document in the navigation structure

 

The com.sap.portal.appintegrator.sap.Generic component, included in the com.sap.portal.appintegrator.sap portal application, is the preferred component for integrating any HTTP-based Web application.

Note Note

The Web application is called directly by the client (isolation-level URL). Since the portal does not serve as a content proxy, the Web application has to be accessible from the client computer, which means that the firewall has to grant a direct connection from the client browser to the application.

End of the note.
iView/Component Parameters
  • Application Parameters (Property ID:ApplicationParameter)

    Defines the name-value pair parameters that are passed to the application.

    Example: appParam1=value1&appParam2=value2

    Multiple name-value pairs have to be separated with the ampersand character (&).

  • Show Debug Screen (Property ID:DebugMode)

    In debug mode, setting this parameter to true, returns a screen with debugging output before launching the application. Setting it to false disables debugging mode.

  • ID (Property ID:Id)

    Defines the name-value pair parameters that are passed to the application. It is used as placeholder and can be useful to define settings for delta links and iView templates.

  • Theme Subset (Property ID:LAF)

    Defines the theme (look and feel) subset (for example,. ur (unified rendering), controls).

  • URL Template Fragment for Single Sign-On (SSO2) (Property ID:SSO2Template)

    Defines a template that is used for the Authentication SSO parameter, if the system defines logon with SAP Logon Tickets.

    This property is resolved during runtime and its result is stored in the Authentication variable. The Authentication expression can be used inside the URL template to pass the SSO2 ticket to the Web application. For example, the template property Request.SSO2Ticket fills the Authentication variable with the SSO2 ticket.

    See the Single Sign-on description later in this document for more details.

  • System (Property ID:System)

    Name of the system alias.

  • URL Template (Property ID:URLTemplate)

    Defines a template that is processed by the template processor in order to generate the application URL. The URL template includes expressions placed in <...> that are evaluated at runtime. For example, the URL template http://myserver?language=<Request.Language> is resolved to http://myserver?language=en if the user language is English.

    See the Template Processor description later in this document for more details..

  • URL Template Fragment for User Mapping (Property ID:UserMappingTemplate)

    Defines a template that is used in the <Authentication> SSO parameter when the system defines logon with user mapping. See the Template Processor description later in this document for more details.

  • HTTP Request Method (Property ID: RequestMethod)

    Defines which HTTP request method (GET or POST) to use in the redirect. For SSO with user mapping, the default is POST. POST is also used if the parameter list is longer than 1024 characters.

Template Processor

The template processor parses a template (for example, URLTemplate for the com.sap.portal.appintegrator.sap.Generic component) and replaces the tag expressions that match the context names, with values stored in contexts.

Definitions
  • Template

    A template is a string containing text and tags.

    Example: This is a template with a simple <tag>.

  • Tag

    A tag is a variable expression followed by an optional modifier sequence in angle brackets.

    Example: Enclose tags always in <angle.brackets>

  • Tag expression

    A tag expression (or variable expression) is a set of variables separated by dots.

    Example: <tag.expression.with.multiple.variables>

  • Context

    A context is a data structure that stores name-value pairs, similar to java.util.Hashtable. Contexts can be nested.

  • Variable

    A variable is an identifier that matches entries in the context. If a variable name equals a context entry name, the tag is replaced with the value of the context entry.

    Example: <context1.variable1> is replaced with the value of variable1 in context1.

  • Modifier sequence

    A modifier sequence contains one or more modifiers in square brackets separated by blanks. Modifiers are applied to the result of the processed expression in the order they appear.

    Example: This is a template with <modified.tag[URL_ENCODE UPPERCASE]>

  • Substitute

    A substitute of a tag expression is the result of a processed/substituted tag expression.

    Example: <User.Name> is the tag expression and Blair Pascal is the substitute.

Use of Templates

Nested contexts are accessed with tag expressions. The variables in the tag expression specify the path in the context tree, for example, <x.y>. If a variable does not match a context, the tag is replaced by an empty string.

Processed tag expressions can be automatically URL-encoded using the URL_ENCODE modifier.

For example: <this.will.be.Urlencoded[URL_ENCODE]>

The slash (/) character is used as an escape character in templates. When you put a slash before an angle bracket, it is not treated as a tag.

For example: Find car: Mileage /< 50000 and Year />

Example Example

  1. <Protocol>://<HostAddress>:<Port>/some/path?user=<User.Name[UPR_CASE]>&
      url= <HomeServer.url[URL_ENCODE UPPERCASE]>
End of the code.

The question mark (?) marks the parameter section in an HTTP/S URL.

Resolution of Expressions

We have the following expressions:

  • Expressions with Variables

    Expressions with variables have the format <x>. They are resolved by a custom provider, the request and the iView profile, in this order, in two iterations. The first iteration looks for the variable name, for example, "x", and the second iteration looks for the default variable name, for example, "x.default".

  • Expressions Using a Context

    Expressions using a context, like <x.y>, offer data retrieval from data providers such as the system landscape or user management. With a context, it is possible to access a specific property. This could be necessary to overcome the resolution rules.

    Example:

    The same property exists in the profile and in the request. In order to access this property from the profile, you have to explicitly access the property with the name <Profile.property>. Accessing it with name <property> only, would return the property from the request. The resolution of expressions can be performed either indirectly or directly:

    • Directly

      If the context is known, an expression like <User.UserID> is resolved directly.

    • Indirectly

      An expression like <System.url> is resolved indirectly since the name for the system is not known. It has to be retrieved from the iView profile first before the system landscape can be accessed.

Available Variables

The following variables are available:

  • All properties according to the rules given in iViewParameterName

  • User mapping user. Variable: <MappedUser>

  • User mapping password. Variable: <MappedPassword>

  • Authentication string. Variable: <Authentication>

  • User ID used for accessing applications. Variable: <LogonUserId>

    This variable contains the portal user ID if no user mapping is maintained. If user mapping exists the variable contains <MappedUser>.

Available Contexts

The following contexts are available:

  • IView Context (IView)

    • <IView.ID>: the PCD path of the iView of the current request (or the name of the component context)

    • <IView.Application>: the application name (PAR name) of the current component context

    • <IView.Component>: the name of the current component

    • <IView.PCDUnit>: the current PCD Unit

  • Look and Feel Context (LAF):

    • <LAF.Theme>: the current theme

    • <LAF.BaseUrl>: the base URL of the current theme

    • <LAF.StylesheetUrl>: the fully qualified stylesheet URL

    • <LAF.Version>: the CSS version of the current theme

  • Portal Component Profile Context (Profile) provides information from the iView profile.

    • <Profile.xyz>: the value of the xyz property stored in the profile of the current iView

  • Portal Context (Portal):

    • <Portal.Version>: Portal Runtime version

    • <Portal.RootComponent>: the portal root URL

    • <Portal.BaseURL>: the portal base URL

  • Request Context (Request) provides information from the servlet request:

    • <Request.Locale>: the locale of the PRT request.

    • <Request.Language>: the language of the PRT request.

    • <Request.Version>: the portal version (same as <Portal.Version>)

    • <Request.SSO2Ticket>: the MYSAPSSO2 cookie

    • <Request.Protocol>: the protocol of the PRT request (http or https)

    • <Request.Server>: the server name plus domain of the PRT request (for example, portal.domain.com)

    • <Request.Port>: the port of the PRT request

    • <Request.ServerPort>: the server, domain and port of the PRT request (for example, portal.domain.com:4711)

    • <Request.xyz>: the value of query string parameter xyz

  • System Landscape Context (System) provides all the properties of the system landscape.

    • <System.xyz>: the value of property xyz stored in the system object defined in the System property of the iView

  • User Context (User) provides the user information stored in the user profile:

    • <User.Accessibility>: the accessibility level of the current user.

    • <User.LogonUid>,<User.UserID>: the logon user ID.

    • <User.xyz>: the value of the xyz attribute defined in the user profile.

      (for example, <User.country> is mapped to the country attribute value that is stored in the user profile).

Available UME attributes:

<User.displayname>; <User.uniquename>; <User.firstname>; <User.lastname>; <User.salutation>; <User.jobtitle>; <User.department>; <User.email>;

Available Modifiers

A modifier transforms a template expression. Modifiers are listed behind an expression in square brackets [...] and are separated by spaces. If an expression <a.b> is resolved to the value x, then the expression the <a.b[m1]> is resolved to m1(x) and <a.b[m1 m2 m3]> is resolved to m3(m2(m1(x)).

The following modifiers are available:

  • BASE64

    Performs base64 encoding.

  • HTML_ESCAPE

    Escapes the result so that it can be put in HTML documents.

  • LOWERCASE

    Converts all characters to lower case.

  • MD5

    Performs MD5 encoding.

  • SAP_BOOL

    Converts boolean values to SAP notation (true/1 -> 'X', false/0 -> '').

  • SAP_ITS_NAMESPACE

    Replaces '/' with '-' (used for IACs)

  • TRIM

    Removes all leading and trailing whitespaces.

  • UPPERCASE

    Converts all characters to upper case.

  • URL_DECODE

    Performs url decoding

  • URL_ENCODE

    Performs url encoding

  • PROCESS_RECURSIVE

    Forces recursive resolution of templates. If the result of a template is also a template, another recursive step of template processing is performed.

Single Sign-On

The com.sap.portal.appintegrator.sap.Generic component allows you to perform a Single Sign-On to HTTP Web applications by including the <Authentication> tag in the URL template. Prerequisite is a system with a system definition that includes the following properties:

  • User mapping type, if user mapping is used.

  • Logon method

    The tag <Authentication> returns the result of the <UserMappingTemplate> or the <SSO2Template>.

    UserMappingTemplate:

    For user mapping you can set the UserMappingTemplate as follows:

    • Basic authentication

      <MappedUser>:<MappedPassword>@

      The URLTemplate would then look like this:

      http://<Authentication>protectedserver.com/xyz

      The parameters user and password are application-specific. They need to be retrieved from, for example, the HTML source code of the logon form. The URLTemplate would then look like this:

      http://protectedserver.com/xyz?<Authentication>

    • HTTP form-based login

      user=<MappedUser>&password=<MappedPassword>.

    SSO2Template:

    If you use SAP logon tickets for authentication, you can specify an authentication template in parameter SSO2Template as follows:

    MYSAPSSO2=<Request.SSO2Ticket>