Previous in Contents Next in Contents

MapUrl Method

This method maps a URL to a project.

Syntax

ReplicationServer.MapUrl(URL, Suffix)

Parameters

URL

Destination URL.

Suffix

Set this argument to Empty ("") before calling this method. Content Deployment returns the relative path from the base project directory that maps to the destination URL.

Remarks

The MapURL method finds the first match of a given URL to a Content Deployment project.

Example

The following example retrieves and displays the first project that matches the URL http://www.mymachine.com/.

Option Explicit 
On Error Resume Next

dim ReplServer
set ReplServer = CreateObject("CrsApi.ReplicationServer")
ReplServer.Initialize("")

dim Project
dim Suffix
Suffix = ""

set Project = ReplServer.MapURL("http://www.mymachine.com/", Suffix)

if IsEmpty(Project) then
  Wscript.Echo "No project maps to http://www.mymachine.com/."
else
  Wscript.Echo "Project" & Project.Name & "maps to http://www.mymachine.com/." 
  Wscript.Echo "The suffix is: " & Suffix
end if

'Release objects
set ReplProject = Nothing
set ReplServer  = Nothing

© 1997-2000 Microsoft Corporation. All rights reserved.