Package it.eng.spago.security

Examples of it.eng.spago.security.IEngUserProfile


    newDsConfig.setLabel(dataset.getLabel());
    newDsConfig.setName(dataset.getName());
    newDsConfig.setDescription(dataset.getDescription());
    SbiCommonInfo i = new SbiCommonInfo();
    IEngUserProfile profile = (IEngUserProfile)session.getPermanentContainer().getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    String userid = "biadmin";
    if(profile!=null){
      userid =(String) profile.getUserUniqueIdentifier();
    }
    i.setTimeIn(new Date());
    i.setUserIn(userid);
    i.setSbiVersionIn(SbiCommonInfo.SBI_VERSION);
    newDsConfig.setCommonInfo(i);
View Full Code Here


      existingDataset.setDescription(exportedDataset.getDescription());
      existingDataset.setLabel(exportedDataset.getLabel());
      existingDataset.setName(exportedDataset.getName());     
      existingDataset.setDescription(exportedDataset.getDescription());
      SbiCommonInfo i = new SbiCommonInfo();
      IEngUserProfile profile = (IEngUserProfile)session.getPermanentContainer().getAttribute(IEngUserProfile.ENG_USER_PROFILE);
      String userid = "biadmin";
      if(profile!=null){
        userid =(String) profile.getUserUniqueIdentifier();
      }
      i.setTimeIn(new Date());
      i.setUserIn(userid);
      i.setSbiVersionIn(SbiCommonInfo.SBI_VERSION);
      existingDataset.setCommonInfo(i);
View Full Code Here

      if (transformer != null) {
        dsnewHistory.setTransformer(transformer);

      }
      SbiCommonInfo i = new SbiCommonInfo();
      IEngUserProfile profile = (IEngUserProfile)session.getPermanentContainer().getAttribute(IEngUserProfile.ENG_USER_PROFILE);
      String userid = "biadmin";
      if(profile!=null){
        userid =(String) profile.getUserUniqueIdentifier();
      }
     
      dsnewHistory.setUserIn(userid);
      dsnewHistory.setTimeIn(new Date());
      dsnewHistory.setSbiVersionIn(SbiCommonInfo.SBI_VERSION);
View Full Code Here

          logger.debug("documentId From Session:"+documentId);
      }
      logger.debug("documentId:"+documentId);
     
      //get userprofile
      IEngUserProfile profile = (IEngUserProfile) session.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
      logger.debug("profile from session: " + profile);
     
      // AUDIT UPDATE
      String auditId = request.getParameter("SPAGOBI_AUDIT_ID");
      AuditAccessUtils auditAccessUtils = (AuditAccessUtils) request.getSession().getAttribute("SPAGOBI_AUDIT_UTILS");
      if (auditAccessUtils != null)
          auditAccessUtils.updateAudit(session,(String) profile.getUserUniqueIdentifier(), auditId, new Long(System
            .currentTimeMillis()), null, "EXECUTION_STARTED", null, null);
     
     
      //read connection from request 
      String requestConnectionName = (String) request.getParameter(CONNECTION_NAME);
      if (requestConnectionName==null) logger.debug("requestConnectionName is NULL");
      else logger.debug("requestConnectionName:"+requestConnectionName);
     
      Connection con = null;
      String query= null;

      SpagoBiDataSet dataset = getDataSet(requestConnectionName, session, profile, documentId);
      if (dataset == null) {
          logger.debug("No dataset query associated to this document");
          logger.debug("Try to get datasource");
          con = getConnection(requestConnectionName,session,profile,documentId);
          if(con == null){
            logger.error("Document "+documentId+" has no dataset query neither datasource associated!");
            // AUDIT UPDATE
            if (auditAccessUtils != null)
          auditAccessUtils.updateAudit(session,(String) profile.getUserUniqueIdentifier(), auditId, null, new Long(System
            .currentTimeMillis()), "EXECUTION_FAILED", "No connection available", null);
            return;
          } else{
            //get the request query parameter name
            query = (String) request.getParameter(QUERY);
           
          }        
      } else{
        //get query
        query = dataset.getQuery();
        try {
        con = dataset.getDataSource().readConnection(dataset.getDataSource().getSchemaAttribute());
      } catch (Exception e) {
        logger.error("Unable to get connection", e);
          if (auditAccessUtils != null)
          auditAccessUtils.updateAudit(session,(String) profile.getUserUniqueIdentifier(), auditId, null, new Long(System
            .currentTimeMillis()), "EXECUTION_FAILED", e.getMessage(), null);
          return;
      }     
       
      }  
      //call dao to execute query
      try {
        //gets request parameters to execute query
        HashMap<String, String> parameters = cleanParameters(request);
       
      String xmlResult = QueryExecutor.executeQuery(con, query, parameters);

      byte[] xsl = getDocumentXSL(requestConnectionName, session, profile, documentId);

        byte[] html = Transformation.tarnsformXSLT(xmlResult, xsl);

        String outputType = "html";
        response.setContentType("text/html");
      response.getOutputStream().write(html);

        response.getOutputStream().flush();
       

    } catch (Exception e1) {
      logger.error("Unable to output result", e1);
        if (auditAccessUtils != null)
        auditAccessUtils.updateAudit(session,(String) profile.getUserUniqueIdentifier(), auditId, null, new Long(System
          .currentTimeMillis()), "EXECUTION_FAILED", e1.getMessage(), null);
        return;
    }

      logger.debug("OUT");
View Full Code Here

    logger.debug("Start processing a new request...");
   
    // USER PROFILE
    HttpSession session = request.getSession();
    IEngUserProfile profile = (IEngUserProfile) session.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    String documentId = (String) request.getParameter("document");
    //String userId = (String) ((UserProfile)profile).getUserId();
    String userId = (String) profile.getUserUniqueIdentifier();

    logger.debug("userId=" + userId);
    logger.debug("documentId=" + documentId);

    // AUDIT UPDATE
View Full Code Here

 

  private InputStream getTemplateContent(HttpServletRequest servletRequest,ServletContext servletContext) throws IOException {
    logger.debug("IN");
    HttpSession session = servletRequest.getSession();
    IEngUserProfile profile = (IEngUserProfile) session.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    String documentId = (String) servletRequest.getParameter("document");
    String userId = (String) profile.getUserUniqueIdentifier();
    //String userId = (String)((UserProfile) profile).getUserId();
    logger.debug("userId=" + userId);
    logger.debug("documentId=" + documentId);

    ContentServiceProxy contentProxy = new ContentServiceProxy(userId, servletRequest.getSession());
View Full Code Here

  }

  protected void runReport(HttpServletRequest request, HttpServletResponse response) throws Exception {
    logger.debug("IN");
    HttpSession session = request.getSession();
    IEngUserProfile profile = (IEngUserProfile) session.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    String userId = (String) profile.getUserUniqueIdentifier();
    logger.debug("userId="+userId);
    String documentId = (String) request.getParameter("document");
    logger.debug("documentId=" + documentId);

    ServletContext servletContext = getServletContext();
    this.birtReportEngine = BirtEngine.getBirtEngine(request, servletContext);
    IReportRunnable design = null;
    InputStream is = getTemplateContent(request,servletContext);
    logger.debug( "runReport(): template document retrieved.");
    // Open the report design
    design = birtReportEngine.openReportDesign(is);
   
    Map params = new HashMap();
    Enumeration enumer = request.getParameterNames();
    String parName = null;
    String parValue = null;
    logger.debug("Reading request parameters...");
    while (enumer.hasMoreElements()) {
        parName = (String) enumer.nextElement();
        parValue = request.getParameter(parName);
        addParToParMap(params, parName, parValue);
        logger.debug("Read parameter [" + parName + "] with value ["+ parValue + "] from request");
    }
    logger.debug("Request parameters read sucesfully" + params);
   
    SsoServiceInterface proxyService = SsoServiceFactory.createProxyService();
    String token = proxyService.readTicket(session);
   
    String kpiUrl = EnginConf.getInstance().getSpagoBiServerUrl()+"/publicjsp/kpiValueXml.jsp?SECURITY_TOKEN="+token+"&USERID="+userId;
    //String kpiUrl = EnginConf.getInstance().getSpagoBiServerUrl()+"/testXml.jsp?"+"USERID="+userId;
   
    Locale locale = null;
   
    String language=null;
    String country=null;
   
    String languageOverride = request.getParameter("LanguageOverride");
    if (languageOverride != null){
      language = languageOverride;
    }else{
      language=request.getParameter("SBI_LANGUAGE");
    }
    String countryOverride = request.getParameter("CountryOverride");
    if (countryOverride != null){
      country = countryOverride;
    }else{
      country=request.getParameter("SBI_COUNTRY");
    }
   
   
    if(language!=null && country!=null){
      locale=new Locale(language,country,"");
    }
    else{
      locale=Locale.ENGLISH;
    }
    String outputFormat = request.getParameter("outputType");   
    logger.debug("outputType -- [" + outputFormat + "]");
   
    logger.debug( "runReport(): report design opened successfully.");
    // Create task to run and render the report,
    IRunAndRenderTask task = birtReportEngine.createRunAndRenderTask(design);
    task.setLocale(locale);
    logger.debug( "runReport(): RunAndRenderTask created successfully.");
    // Set parameters for the report
    Map reportParams = findReportParams(request, design);

    String requestConnectionName = (String) request.getParameter(CONNECTION_NAME);
    logger.debug("requestConnectionName:" + requestConnectionName);
    IDataSource ds = findDataSource(request.getSession(), userId, documentId,requestConnectionName);
    if (ds != null) {
      logger.debug("DataSource founded.");
   
      if (ds.checkIsJndi() ) {
       
        if (ds.checkIsMultiSchema()){
          String schema=null;
          try {
              String attrname=ds.getSchemaAttribute();
              if (attrname!=null) schema = (String)profile.getUserAttribute(attrname);           
          } catch (EMFInternalError e) {
            logger.error("Cannot retrive ENTE", e);
          }
          reportParams.put("connectionName", ds.getJndi()+schema);
        }else{
View Full Code Here

      mimeType = MimeUtils.getMimeType(imageFileName);
     
    } else {
      // USER PROFILE
      session = request.getSession();
      IEngUserProfile profile = (IEngUserProfile) session.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
      userId = (String) profile.getUserUniqueIdentifier();
      logger.debug("userId=" + userId);
      Map allParams = request.getParameterMap();
      fis = executeEngineChart(allParams);
      // chart is a PNG fine
      mimeType = MimeUtils.getMimeType("chart.png");
View Full Code Here

    logger.debug("IN");
    Monitor monitor =MonitorFactory.start("JasperReportRunner.service");
    documentId=(String)servletRequest.getParameter("document");

    HttpSession session=servletRequest.getSession();
    IEngUserProfile profile=(IEngUserProfile)session.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    userId=(String)((UserProfile)profile).getUserId();
    userUniqueIdentifier=(String)profile.getUserUniqueIdentifier();

    logger.debug("Read user data from the request. userId="+userId+". DocumentId="+documentId);

    String resourcePath=EnginConf.getInstance().getResourcePath()+"/img/";
    String entity=(String)parameters.get(SpagoBIConstants.SBI_ENTITY);
View Full Code Here

      url = getDefaultConfig();
    else
      url = pageContext.getServletContext().getResource(config);

    HttpSession session = context.getRequest().getSession();
    IEngUserProfile profile = (IEngUserProfile) session.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
   
    String filers=(String)session.getAttribute("filters");
   
    MondrianModel mm = MondrianModelFactory.instance(filers,url, cfg, profile);
   
View Full Code Here

TOP

Related Classes of it.eng.spago.security.IEngUserProfile

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.