org.olat.core.gui.render
Class URLBuilder

java.lang.Object
  extended by org.olat.core.gui.render.URLBuilder

public class URLBuilder
extends java.lang.Object

Author:
Felix Jost

Constructor Summary
URLBuilder(java.lang.String uriPrefix, java.lang.String windowID, java.lang.String timestampID, WindowBackOfficeImpl wboImpl)
           
 
Method Summary
 void appendTarget(StringOutput sb)
          appends the "target" attribute that is needed for ajax-links.
 void buildJavaScriptBgCommand(StringOutput buf, java.lang.String[] keys, java.lang.String[] values, int mode)
          builds a java script command that executes in background iframe or as document.location.replace depending on the AJAX mode
 void buildJavaScriptBgCommand(StringOutput buf, java.lang.String[] keys, java.lang.String[] values, int mode, boolean useSingleQuotes)
          builds a java script command that executes in background iframe or as document.location.replace depending on the AJAX mode.
 void buildURI(StringOutput buf, java.lang.String[] keys, java.lang.String[] values)
           
 void buildURI(StringOutput buf, java.lang.String[] keys, java.lang.String[] values, int mode)
           
 void buildURI(StringOutput buf, java.lang.String[] keys, java.lang.String[] values, java.lang.String modURI)
           
 void buildURI(StringOutput buf, java.lang.String[] keys, java.lang.String[] values, java.lang.String modURI, int mode)
          builds an uri.
 URLBuilder createCopyFor(Component source)
           
 void setComponentPath(java.lang.String componentPath)
          used for OLAT-1973 only: if in replayable-url-mode for performance testing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLBuilder

public URLBuilder(java.lang.String uriPrefix,
                  java.lang.String windowID,
                  java.lang.String timestampID,
                  WindowBackOfficeImpl wboImpl)
Parameters:
uriPrefix -
windowID -
timestampID -
businessControlPath - may be null
Method Detail

createCopyFor

public URLBuilder createCopyFor(Component source)
Returns:

appendTarget

public void appendTarget(StringOutput sb)
appends the "target" attribute that is needed for ajax-links. the caller has to make sure that this.isAjaxOn() is true.

Parameters:
sb -

buildJavaScriptBgCommand

public void buildJavaScriptBgCommand(StringOutput buf,
                                     java.lang.String[] keys,
                                     java.lang.String[] values,
                                     int mode)
builds a java script command that executes in background iframe or as document.location.replace depending on the AJAX mode

Parameters:
buf - the buffer to write to
keys - the keys
values - the values.
mode -

buildJavaScriptBgCommand

public void buildJavaScriptBgCommand(StringOutput buf,
                                     java.lang.String[] keys,
                                     java.lang.String[] values,
                                     int mode,
                                     boolean useSingleQuotes)
builds a java script command that executes in background iframe or as document.location.replace depending on the AJAX mode. This version also includes safety checks for not breaking other running ajax requests TODO: may only offer one method but check for usage of o_beforeserver first!

Parameters:
buf - the buffer to write to
keys - the keys
values - the values.
mode -
singe - or double quote as string termination

buildURI

public void buildURI(StringOutput buf,
                     java.lang.String[] keys,
                     java.lang.String[] values,
                     java.lang.String modURI,
                     int mode)
builds an uri. neither key nor values may contain the character UserRequest.PARAM_DELIM which is a ":" (colon). in case you think you should transfer a filename using a param, then may be it is better to use a model anyway to avoid having special characters in the url (even though it is utf-8 encoded, but some browsers/webservers do not seem to handle special chars in the url pathinfo part)

Parameters:
buf - the buffer to write to
keys - the keys
values - the values.
modURI -
mode - indicates what kind of link it is (0 normal, 1 into background-iframe, ...)

buildURI

public void buildURI(StringOutput buf,
                     java.lang.String[] keys,
                     java.lang.String[] values,
                     java.lang.String modURI)

buildURI

public void buildURI(StringOutput buf,
                     java.lang.String[] keys,
                     java.lang.String[] values)
Parameters:
buf -
keys -
values -

buildURI

public void buildURI(StringOutput buf,
                     java.lang.String[] keys,
                     java.lang.String[] values,
                     int mode)
Parameters:
buf -
keys -
values -
mode -

setComponentPath

public void setComponentPath(java.lang.String componentPath)
used for OLAT-1973 only: if in replayable-url-mode for performance testing

Parameters:
componentPath - The componentPath to set.