* Gets the url builder.
*
* @return the url builder
*/
public static IUrlBuilder getUrlBuilder() {
ApplicationContainer spagoContext = ApplicationContainer.getInstance();
IUrlBuilder urlBuilder = (IUrlBuilder)spagoContext.getAttribute(SpagoBIConstants.URL_BUILDER);
if(urlBuilder==null) {
SingletonConfig spagoconfig = SingletonConfig.getInstance();
// get mode of execution
String sbiMode = (String)spagoconfig.getConfigValue("SPAGOBI.SPAGOBI-MODE.mode");
if (sbiMode==null) {
logger.error("SPAGOBI.SPAGOBI-MODE.mode IS NULL");
sbiMode="WEB";
}
// based on mode get spago object and url builder
if (sbiMode.equalsIgnoreCase("WEB")) {
urlBuilder = new WebUrlBuilder();
} else if (sbiMode.equalsIgnoreCase("PORTLET")){
urlBuilder = new PortletUrlBuilder();
}
spagoContext.setAttribute(SpagoBIConstants.URL_BUILDER, urlBuilder);
}
return urlBuilder;
}