Package it.eng.spagobi.commons.utilities.messages

Examples of it.eng.spagobi.commons.utilities.messages.MessageBuilder


    } catch (EMFUserError e1) {
      logger.error(e1.getMessage(), e1);
      throw new SpagoBIServiceException(SERVICE_NAME,  "Error occurred");
    }
    HttpServletRequest httpRequest = getHttpRequest();
    MessageBuilder m = new MessageBuilder();
    Locale locale = m.getLocale(httpRequest);
   
    String serviceType = this.getAttributeAsString(MESSAGE_DET)
    logger.debug("Service type "+serviceType);
   
    if(serviceType != null && serviceType.equals(UDP_LIST)){
View Full Code Here


      if (dataParameters.get("model_title") != null
          && !(((String) dataParameters.get("model_title")).equalsIgnoreCase(""))) {
        String fil = (String) dataParameters.get("model_title");
        if (fil!=null) model_title = fil;
      }else{
        MessageBuilder msgBuild=new MessageBuilder();
        model_title = msgBuild.getMessage("sbi.kpi.modelLineTitle", locale);         
      }
      this.confMap.put("model_title", model_title);

      if (dataParameters.get("kpi_title") != null) {
        String fil = (String) dataParameters.get("kpi_title");
View Full Code Here

   * @param e
   * @return
   */
  public SpagoBIEngineServiceException getWrappedException(String serviceName,  Throwable e) {
    SpagoBIServiceException serviceException = null;
    MessageBuilder msgBuild = new MessageBuilder();
    Locale locale = null
    RequestContainer requestContainer=RequestContainer.getRequestContainer();
    if(requestContainer!=null){
      SessionContainer permSess=requestContainer.getSessionContainer().getPermanentContainer();
      String lang=(String)permSess.getAttribute(SpagoBIConstants.AF_LANGUAGE);
      String country=(String)permSess.getAttribute(SpagoBIConstants.AF_COUNTRY);
      if(lang!=null && country!=null){
        locale=new Locale(lang,country,"");
      }
    }else{
      locale = GeneralUtilities.getDefaultLocale()
    }
   
    if(e instanceof SpagoBIServiceException) {
      // this mean that the service have catched the exception nicely
      serviceException = (SpagoBIServiceException)e;
      String sms = serviceException.getMessage();
      sms = msgBuild.getMessage(sms, locale)
      serviceException = new SpagoBIServiceException(serviceName, sms, e);
    } else {
      // otherwise an unpredicted exception has been raised.  
     
      // This is the last line of defense against exceptions. Bytheway all exceptions that are catched
      // only here for the first time can be considered as bugs in the exception handling mechanism. When
      // such an exception is raised the code in the service should be fixed in order to catch it before and add some meaningfull
      // informations on what have caused it.
      Throwable rootException = e;
      while(rootException.getCause() != null) {
        rootException = rootException.getCause();
      }
      String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
      str = msgBuild.getMessage(str, locale)
      String message = "An unpredicted error occurred while executing service."
               + "\nThe root cause of the error is: " + str;
     
      serviceException = new SpagoBIServiceException(serviceName, message, e);
     
View Full Code Here

                    if(ObjectsAccessVerifier.checkProfileVisibility(obj, profile))
                      objects.add(obj);
                }
      }
      HttpServletRequest httpRequest = getHttpRequest();
      MessageBuilder m = new MessageBuilder();
      Locale locale = m.getLocale(httpRequest);
      JSONArray documentsJSON = (JSONArray)SerializerFactory.getSerializer("application/json").serialize( objects ,locale);
      Collection func = profile.getFunctionalities();
     
      if(func.contains("SeeMetadataFunctionality")){
        JSONObject showmetadataAction = new JSONObject();
View Full Code Here

        }else{
          folders = lfDao.loadUserFunctionalities(new Integer(nodeId), false, profile)
        }
      }
      HttpServletRequest httpRequest = getHttpRequest();
      MessageBuilder m = new MessageBuilder();
      Locale locale = m.getLocale(httpRequest);
      JSONArray jsonFTree = new JSONArray();
      jsonFTree = (JSONArray)SerializerFactory.getSerializer("application/json").serialize( folders,locale );

      try {
        writeBackToClient( new JSONSuccesscreateNode(jsonFTree) ) ) ;
View Full Code Here

   
    try {
      GetParametersForExecutionAction.ParameterForExecution parameter = (GetParametersForExecutionAction.ParameterForExecution)o;
      result = new JSONObject();
      result.put("id", parameter.getId() );
      MessageBuilder msgBuild=new MessageBuilder();
      String label=msgBuild.getUserMessage(parameter.getLabel(),null, locale);
      result.put("label",label);
      result.put("type", parameter.getParType() );
      result.put("selectionType", parameter.getSelectionType() );
      result.put("typeCode", parameter.getTypeCode() );
      result.put("mandatory", parameter.isMandatory() );
View Full Code Here

       
        parametersForExecution.add( new ParameterForExecution(biparam) );
      }
    }
    HttpServletRequest httpRequest = getHttpRequest();
    MessageBuilder m = new MessageBuilder();
    Locale locale = m.getLocale(httpRequest);
    JSONArray parametersJSON = null;
    try {
      parametersJSON = (JSONArray)SerializerFactory.getSerializer("application/json").serialize( parametersForExecution,locale );
    } catch (SerializationException e) {
      e.printStackTrace();
View Full Code Here

          String path=MenuUtilities.getMenuPath(menuElem);
          if (menuElem.getLevel().intValue() == 1){
            JSONObject temp = new JSONObject();
            temp.put(NAME, "menu"+i);
            temp.put(ID, menuElem.getMenuId());
            MessageBuilder msgBuild=new MessageBuilder();
            String text = "";
            if (!menuElem.isAdminsMenu() || !menuElem.getName().startsWith("#"))
              text = msgBuild.getUserMessage(menuElem.getName(),null, locale);
            else{             
              if (menuElem.getName().startsWith("#")){       
                String titleCode = menuElem.getName().substring(1);                 
                text = msgBuild.getMessage(titleCode, locale);               
              } else {
                text = menuElem.getName();
              }
            }
            temp.put(TEXT, text);
View Full Code Here

    for (int j=0; j<children.size(); j++){
      Menu childElem = (Menu)children.get(j)
      JSONObject  temp2 = new JSONObject();

      temp2.put(ID, new Double(Math.random()).toString());
      MessageBuilder msgBuild=new MessageBuilder();
      String text = "";
      if (!childElem.isAdminsMenu() || !childElem.getName().startsWith("#"))
        text = msgBuild.getUserMessage(childElem.getName(),null, locale);
      else{             
        if (childElem.getName().startsWith("#")){       
          String titleCode = childElem.getName().substring(1);                 
          text = msgBuild.getMessage(titleCode, locale);               
        } else {
          text = childElem.getName();
        }
      }
      //String text = msgBuild.getUserMessage(childElem.getName(),null, locale);
View Full Code Here

        functionalities = DAOFactory.getLowFunctionalityDAO()
          .loadParentFunctionalities(Integer.valueOf(functID), (rootFolderID==null?null:Integer.valueOf(rootFolderID)) )
      }
     
      HttpServletRequest httpRequest = getHttpRequest();
      MessageBuilder m = new MessageBuilder();
      Locale locale = m.getLocale(httpRequest);
      JSONArray foldersJSON = (JSONArray)SerializerFactory.getSerializer("application/json").serialize( functionalities,locale );
     
      try {
        writeBackToClient( new JSONSuccesscreateJSONResponse(foldersJSON) ) ) ;
      } catch (IOException e) {
View Full Code Here

TOP

Related Classes of it.eng.spagobi.commons.utilities.messages.MessageBuilder

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.