JavaScript global method: makeSCWebURL

Creates a URL query to the ITSMA Service Management Web tier.

Syntax

makeSCWebURL( Web tier URL, docEngine, table name, query, hash key seed, action);

Arguments

The following arguments are valid for this function:

Argument Data type Required Description
Web tier URL String Yes This argument specifies the fully qualified URL to the Service Management Web tier. This URL must include the http:// protocol syntax as well as the server name or IP address and communications port number.
docEngine String Yes This argument specifies that the query should be handled by the Service Management Document Engine. This argument does not accept any other string value.
table name String Yes This argument specifies the table where the Document Engine should query for records.
query String Yes This argument specifies the Service Management query you want to use to search for records. You must URI encode the query string to prevent special characters from invalidating the URL.
hash key seed String No This argument specifies an optional string you want to use to create a unique hash key. The hash key seed does not appear in the final URL produced.
action String Not applicable This argument cannot be used. By default, the URL query always performs a search operation.

Return values

A string containing a URL query to the Service Management web tier.

Description

This method creates a URL query to the Service Management web tier. It does not convert any special characters in the URL (such as spaces or quotation marks) to the character code equivalent in URI format. You can use the encodeURIComponent method to convert any special characters in the URL.

Example

This example does the following:

  • Creates a URL query to the Service Management Web tier
  • Converts any special characters in the URL to valid URI format

This example requires the following sample data:

  • The URL to Service Management Web tier
  • A valid Service Management table name (for example, incidents)
  • A valid Service Management query against the table (for example, incident.id="SD1001")
function createURLquery( table, query)
{

 var url;
 var webtier;
 var webserver;
 var doceng;
 var hashkey;
 var action;

 print( "Parameters: table="
        + table +
        "query='"
        + query + "'");
 print( "Converting special characters in query to valid URI format..." );
 queryURI = encodeURIComponent( query );
 print( "Converted: old query='"
        + query +
        "' new query='"
        + queryURI +
        "'" );

 webserver = "http://pdoref02/sc/index.do";
 doceng = "docEngine";
 hashkey = "";
 action = "";
 webtier = makeSCWebURL( webserver,
           doceng,
           table,
           queryURI,
           hashkey,
           action, "abc");
 url=encodeURIComponent(webtier);
 print( "Creating URL from information provided..." );
 print( "The value of webtier is:\n" + webtier );
 print( "The value of url is:\n" + url );
 return url;
}

var tablename = "incidents"
var SCquery = "incident.id=\"SD1001\""

createURLquery( tablename, SCquery);