Package it.eng.spagobi.commons

Examples of it.eng.spagobi.commons.SingletonConfig


   * Checks if is portlet running.
   *
   * @return true, if is portlet running
   */
  public static boolean isPortletRunning() {
    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");
      return false;
    }
    if( !sbiMode.equalsIgnoreCase("WEB")){
View Full Code Here


   */
  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
View Full Code Here

   * Returns true if the SSO is enabled (SPAGOBI_SSO.ACTIVE in spagobi_SSO.xml equals true ignoring the case), false otherwise
   * @return true if the SSO is enabled (SPAGOBI_SSO.ACTIVE in spagobi_SSO.xml equals true ignoring the case), false otherwise
   */
  public static boolean isSSOEnabled() {
    boolean toReturn;
    SingletonConfig config = SingletonConfig.getInstance();
    String active = config.getConfigValue("SPAGOBI_SSO.ACTIVE");
    logger.debug("active SSO: " + active);
    if (active != null && active.equalsIgnoreCase("true") ){
      toReturn = true;
    } else {
      toReturn = false
View Full Code Here

    logger.debug("IN");
    if (SPAGOBI_HOST == null) {
      String tmp = null;
      try {
        logger.debug("Trying to recover SpagoBiHost from ConfigSingleton");
        SingletonConfig spagoConfig = SingletonConfig.getInstance();
        String sbTmp = spagoConfig.getConfigValue("SPAGOBI.SPAGOBI_HOST_JNDI");
        if (sbTmp != null) {
          tmp = readJndiResource(sbTmp);
        }
        if (tmp == null) {
          logger.debug("SPAGOBI_HOST not set, using the default value ");
View Full Code Here

  public static Locale getStartingDefaultLocale() {
    logger.debug("IN");
    String country = null;
    String language = null;
    Locale locale = null;
    SingletonConfig config = SingletonConfig.getInstance();
    String languageConfig = config.getConfigValue("SPAGOBI.LANGUAGE_SUPPORTED.LANGUAGE.default");
    if (languageConfig != null ) {
      language = languageConfig.substring(0, 2);
      country = languageConfig.substring(3);
      if ((country == null) || country.trim().equals("") || (language == null) || language.trim().equals("")) {
        logger.warn("Problem reading locale");
View Full Code Here

  public static int getTemplateMaxSize() {
    logger.debug("IN");
    int toReturn = MAX_DEFAULT_TEMPLATE_SIZE;
    try {
      SingletonConfig serverConfig = SingletonConfig.getInstance();
      String maxSizeStr = serverConfig.getConfigValue("SPAGOBI.TEMPLATE_MAX_SIZE");
      if (maxSizeStr != null) {
        logger.debug("Configuration found for max template size: " + maxSizeStr);
        Integer maxSizeInt = new Integer(maxSizeStr);
        toReturn = maxSizeInt.intValue();
      } else {
View Full Code Here

  public static String getSpagoBiContext() {
    logger.debug("IN");
    String path = "";
    try {
      logger.debug("Trying to recover spagobi context from ConfigSingleton");
      SingletonConfig spagoConfig = SingletonConfig.getInstance();
      path = spagoConfig.getConfigValue("SPAGOBI.SPAGOBI_CONTEXT");
      if (path==null){
        logger.debug("SPAGOBI_CONTEXT not set, using the default value ");
        path="/SpagoBI";
      }
      logger.debug("SPAGOBI_CONTEXT: " + path);
View Full Code Here

  public static String getSessionExpiredURL() {
    logger.debug("IN");
    String sessionExpiredUrl = null;
    try {
      logger.debug("Trying to recover SpagoBI session expired url from ConfigSingleton");
      SingletonConfig spagoConfig = SingletonConfig.getInstance();
      sessionExpiredUrl = spagoConfig.getConfigValue("SPAGOBI.SESSION_EXPIRED_URL");
    } catch (Exception e) {
      logger.error("Error while recovering SpagoBI session expired url", e);
    }
    logger.debug("OUT: SpagoBI session expired url is " + sessionExpiredUrl);
    return sessionExpiredUrl;
View Full Code Here

            logger.debug((new StringBuilder("Using default locale ")).append(locale).append(".").toString());
        } else
        if(StringUtilities.isEmpty(locale.getCountry()))
        {
            logger.warn((new StringBuilder("Request locale ")).append(locale).append(" not contain the country value. The one specified in configuration will be used").toString());
            SingletonConfig spagobiConfig = SingletonConfig.getInstance();

            String country = GeneralUtilities.getCountry(locale.getLanguage());
            locale = new Locale(locale.getLanguage(), country);
        }
        logger.debug((new StringBuilder("OUT-locale:")).append(locale == null ? "null" : locale.toString()).toString());
View Full Code Here

        response.setAttribute("TYPE_ORDER", currentTypOrder);
    }

    int numRows = 10;
    try {
        SingletonConfig spagoconfig = SingletonConfig.getInstance();
        String lookupnumRows = spagoconfig.getConfigValue("SPAGOBI.LOOKUP.numberRows");
        if (lookupnumRows != null) {
      numRows = Integer.parseInt(lookupnumRows);
        }
    } catch (Exception e) {
        numRows = 10;
View Full Code Here

TOP

Related Classes of it.eng.spagobi.commons.SingletonConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.