Package it.eng.spago.base

Examples of it.eng.spago.base.SourceBean


    logger.debug("IN");

    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
   
    // get the module response
    SourceBean moduleResponse = (SourceBean)responseContainer.getServiceResponse().getAttribute("DetailObjMetadataModule");
   
    // if the module response is null throws an error and return the name of the errors publisher
    if(moduleResponse==null) {
      logger.error("Module response null");
      EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 10 );
      errorHandler.addError(error);     
      return "error";
    }
   
    // if there are errors and they are only validation errors return the name for the detail publisher
    if(!errorHandler.isOK()) {
      if(GeneralUtilities.isErrorHandlerContainingOnlyValidationError(errorHandler)) {
        logger.info("Publish: detailMetadata"  );
        return "detailObjMetadata";
      }
    }
   
    // if there are some errors into the errorHandler (not validation errors), return the name for the errors publisher
    if(!errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
      return new String("error");
    }

        Object loop = moduleResponse.getAttribute("loopback");
        if (loop != null) {
          logger.info("Publish: detailObjMetadataLoop"  );
          logger.debug("OUT");
          return "detailObjMetadataLoop";
    } else {
View Full Code Here


    logger.debug("IN");
    res = result;
    categories=new HashMap();
    datasetMap=new DatasetMap();

    SourceBean sbRows=SourceBean.fromXMLString(res);
    List listAtts=sbRows.getAttributeAsList("ROW");

    // run all categories (one for each row)
    categoriesNumber=0;

    datasetMap.getDatasets().put("line", new DefaultCategoryDataset());

    boolean first=true;

    for (Iterator iterator = listAtts.iterator(); iterator.hasNext();) {
      SourceBean category = (SourceBean) iterator.next();
      List atts=category.getContainedAttributes();

      HashMap series=new LinkedHashMap();
      HashMap additionalValues=new LinkedHashMap();
      String catValue="";
View Full Code Here

   * @return The current SpagoBI version
   */
  public String getCurrentVersion() {
    logger.debug("IN");
    ConfigSingleton conf = ConfigSingleton.getInstance();
    SourceBean curVerSB = (SourceBean) conf.getAttribute("IMPORTEXPORT.CURRENTVERSION");
    String curVer = (String) curVerSB.getAttribute("version");
    logger.debug("OUT");
    return curVer;
  }
View Full Code Here

   */
  public   String defineJob(String xmlRequest) {
    StringBuffer servreponse = new StringBuffer();
    try{
      Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
      SourceBean request = SourceBean.fromXMLString(xmlRequest);
      servreponse.append("<EXECUTION_OUTCOME ");
      // READ REQUEST
      String jobName = (String)request.getAttribute("jobName");
      String jobgroupName = (String)request.getAttribute("jobGroupName");
      if(jobgroupName==null)
        jobgroupName = Scheduler.DEFAULT_GROUP;
      String jobDescription = (String)request.getAttribute("jobDescription");
      if(jobDescription==null)
        jobDescription = "";
      String jobRequestRecoveryStr = (String)request.getAttribute("jobRequestRecovery");
      boolean jobRequestRecovery = false;
      if((jobRequestRecoveryStr!=null) && (jobRequestRecoveryStr.trim().equalsIgnoreCase("true")))
        jobRequestRecovery = true;
      SourceBean jobParameters = (SourceBean)request.getAttribute("PARAMETERS");
      // transform parameters sourcebean into JobDataMap structure and set it into the jobDetail
      JobDataMap jdm = getJobDataMap(jobParameters);
      // get the job class
      String jobClassName = (String)request.getAttribute("jobClass");
      Class jobClass = null;
View Full Code Here

      Iterator iterParSb = paramsSB.iterator();
      while(iterParSb.hasNext()) {
          SourceBeanAttribute paramSBA = (SourceBeanAttribute)iterParSb.next();
          String nameAttr = (String)paramSBA.getKey();
          if(nameAttr.equalsIgnoreCase("PARAMETER")) {
            SourceBean paramSB = (SourceBean)paramSBA.getValue();
            String name = (String)paramSB.getAttribute("name");
            String value = (String)paramSB.getAttribute("value");
            jdm.put(name, value);
          }
      }
    }
    return jdm;
View Full Code Here

    // map that associates document labels and DOcument Containers (containing informations)
    Map<String, DocumentContainer> documents=new LinkedHashMap<String, DocumentContainer>();

    SpagoBIRequestContainer requestContainer=getSpagoBIRequestContainer();
    SourceBean sb=requestContainer.getRequest();
   
    // Recover currentParametersConfiguration
    Map<String, CurrentConfigurationDocComp> currentConfigurationsMap=new HashMap<String, CurrentConfigurationDocComp>();

    // if only one metadata style is wrong use default table style (ignore table positions)
    boolean defaultStyle=false;

    Map styles=docCompConf.getLstDivStyle();
    //Map docsMap=docCompConf.getDocumentsMap();
    Iterator iteratorStyles=styles.keySet().iterator();
    for (Iterator iterator = docCompConf.getDocumentsArray().iterator(); iterator.hasNext();) {
      Document doc = (Document) iterator.next();
      String label=doc.getSbiObjLabel();
      logger.debug("Document "+label);     
      // recover style informations
      String styleLab=(String)iteratorStyles.next();
      String styleString=(String)styles.get(styleLab);
      if(styleString==null)styleString="";
      MetadataStyle metadataStyle=MetadataStyle.getMetadataStyle(label,styleString.toString(), docCompConf);
      if(defaultStyle==false){
        defaultStyle=(metadataStyle == null) ? true : false;
      }
     
      DocumentContainer documentContainer=new DocumentContainer();
      documentContainer.setStyle(metadataStyle);
      documents.put(label, documentContainer);

      // get its parameters configuration
      logger.debug("Get parametrs configuration for document "+label);     
      Object urlO=sb.getAttribute("TRACE_PAR_"+label);
      if(urlO!=null){
        String url=urlO.toString();
        CurrentConfigurationDocComp ccdc=new CurrentConfigurationDocComp(label);
        ccdc.fillParsFromUrl(url);
        currentConfigurationsMap.put(label, ccdc);

      }
     
      // get its svg (for highcharts document because they're created only by the client-side)
      logger.debug("Get svg content for the highchart "+label);     
      String svg =  (sb.getAttribute("SVG_"+label) != null)?sb.getAttribute("SVG_"+label).toString():null;
      if(svg != null){
        CurrentConfigurationDocComp ccdc = new CurrentConfigurationDocComp(label);
        Map<String,Object> svgChartPar = new HashMap<String,Object>();
        svgChartPar.put("SVG_"+label, svg);
        ccdc.setParameters(svgChartPar);
View Full Code Here

   * @param profile the user's profile
   *
   * @return A chart that displays a value as a dial.
   */
  private void defineDataParameters(SourceBean content, BIObject obj, IEngUserProfile profile) throws Exception {
    SourceBean dataSB = (SourceBean) content.getAttribute("DATA");
      List dataAttrsList = dataSB.getContainedSourceBeanAttributes();
      Iterator dataAttrsIter = dataAttrsList.iterator();
     
      if(obj.getDataSetId()!=null){
        String dataSetId=obj.getDataSetId().toString();
        dataParameters.put("datasetid", dataSetId);
      }
      while (dataAttrsIter.hasNext()) {
      SourceBeanAttribute paramSBA = (SourceBeanAttribute) dataAttrsIter.next();
      SourceBean param = (SourceBean) paramSBA.getValue();
      String nameParam = (String) param.getAttribute("name");
      String valueParam = (String) param.getAttribute("value");
 
      dataParameters.put(nameParam, valueParam);
      }
     
      // puts the document id
View Full Code Here

   * @return A chart that displays a value as a dial.
   */
  private void defineLinkParameters(SourceBean content, SourceBean serviceRequest) throws Exception {
    logger.debug("IN");
   
    SourceBean drillSB = (SourceBean)content.getAttribute("DRILL");
    String drillLabel="";
    Map tmpDrillParameters= new LinkedHashMap();
   
    if(drillSB!=null){
      String lab=(String)drillSB.getAttribute("document");
      if(lab!=null) drillLabel=lab;
      else{
        logger.info("Drill label not found");
      }

      List parameters =drillSB.getAttributeAsList("PARAM");
      if(parameters!=null){
        for (Iterator iterator = parameters.iterator(); iterator.hasNext();) {
          SourceBean att = (SourceBean) iterator.next();
          String name=(String)att.getAttribute("name");
          String type=(String)att.getAttribute("type");
          String value=replaceParsInString((String)att.getAttribute("value"));

          //looking for the parameter before into the request, then into data parameters.
          //if the value is a dataset value it leaves the tag field $F{...}. The swf file will replace the value.
          if (!value.startsWith("$F{")){
            String reqValue = (String)serviceRequest.getAttribute(name);
View Full Code Here

 
  // utils
 
  public String getProperty(String propertName) {
    String propertyValue = null;   
    SourceBean sourceBeanConf;
   
    Assert.assertNotNull( getConfigSourceBean(), "Impossible to parse engine-config.xml file");
   
    sourceBeanConf = (SourceBean) getConfigSourceBean().getAttribute( propertName);
    if(sourceBeanConf != null) {
      propertyValue  = (String) sourceBeanConf.getCharacters();
      logger.debug("Configuration attribute [" + propertName + "] is equals to: [" + propertyValue + "]");
    }
   
    return propertyValue;   
  }
View Full Code Here

    String documentId = obj.getId().toString();
    logger.debug("Loaded documentId:" + documentId);   
    ModelInstanceNode mI = null;
    try {
      // **************get the template*****************   
      SourceBean content = getTemplate(documentId);
      logger.debug("Got the template.");

      // Date for which we want to see the KpiValues
      this.dateOfKPI = new Date();
      this.parametersObject = readParameters(obj.getBiObjectParameters());
      addBIParameterDescriptions(obj, this.parametersObject);
     
      if(!parametersObject.containsKey("ParKpiDate")){
        String dateForDataset = getDateForDataset(dateOfKPI)
        parametersObject.put("ParKpiDate", dateForDataset);
      }
      logger.debug("Got the date for which the KpiValues have to be calculated. Date:" + this.dateOfKPI);

      // **************take informations on the modelInstance and its KpiValues*****************
      String modelNodeInstance = (String) content.getAttribute("model_node_instance");
      logger.info("ModelNodeInstance : " + modelNodeInstance);

      if (modelNodeInstance == null) {
        logger.error("The modelNodeInstance specified in the template is null");
        throw new EMFUserError(EMFErrorSeverity.ERROR, "10106", messageBundle);
      }
      String periodInstanceID = (String) content.getAttribute("periodicity_id");
      logger.debug("PeriodInstanceID : " + (periodInstanceID!=null ? periodInstanceID : "null"));

      if (periodInstanceID == null) {
        logger.debug("No periodInstID specified will use default one");
      }else{
View Full Code Here

TOP

Related Classes of it.eng.spago.base.SourceBean

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.