com.mindoo.xpages2eclipse.tools
Class URLHelper

java.lang.Object
  extended by com.mindoo.xpages2eclipse.tools.URLHelper

public class URLHelper
extends java.lang.Object

Helper class for servlet URL generation on the local Notes Client and on a Domino server


Constructor Summary
URLHelper()
           
 
Method Summary
static java.lang.String getBaseUrl(Database db, java.lang.String servletName)
          The method returns the base URL to access an X2E servlet.
static java.lang.String[] getBaseUrlParts(Database db)
          The method returns the prefix and suffix of the base url to access XLayer servlets
static java.lang.String getRpcUrl(Database db, java.lang.String type)
          Method to build the RPC base URL (ending with a "/")
static boolean isClient()
          Use this method to check whether an XPages application is running locally or on a Domino server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLHelper

public URLHelper()
Method Detail

isClient

public static boolean isClient()
Use this method to check whether an XPages application is running locally or on a Domino server

Returns:
true if we're in the Notes Client

getRpcUrl

public static java.lang.String getRpcUrl(Database db,
                                         java.lang.String type)
Method to build the RPC base URL (ending with a "/")

Parameters:
db - current context database
type - e.g. "js" for JavaScript or "j" for Java
Returns:
relative url, e.g. /x2erpc/-!!path%5Csampledb.nsf/js/

getBaseUrlParts

public static java.lang.String[] getBaseUrlParts(Database db)
                                          throws NotesException,
                                                 java.io.UnsupportedEncodingException
The method returns the prefix and suffix of the base url to access XLayer servlets

Parameters:
db - context database
Returns:
array with prefix and suffix
Throws:
NotesException
java.io.UnsupportedEncodingException

getBaseUrl

public static java.lang.String getBaseUrl(Database db,
                                          java.lang.String servletName)
                                   throws NotesException,
                                          java.io.UnsupportedEncodingException
The method returns the base URL to access an X2E servlet. It calls getBaseUrlParts(Database) internally and concatenates prefix, servlet name and suffix to one string

Parameters:
db - context database
servletName - name of servlet
Returns:
url
Throws:
NotesException
java.io.UnsupportedEncodingException