Package it.eng.spago.base

Examples of it.eng.spago.base.SourceBean


    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 );
      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)) {"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) {
"Publish: detailObjMetadataLoop"  );
          return "detailObjMetadataLoop";
    } else {
View Full Code Here

    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)

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

    boolean first=true;

    for (Iterator iterator = listAtts.iterator(); iterator.hasNext();) {
      SourceBean category = (SourceBean);
      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() {
    ConfigSingleton conf = ConfigSingleton.getInstance();
    SourceBean curVerSB = (SourceBean) conf.getAttribute("IMPORTEXPORT.CURRENTVERSION");
    String curVer = (String) curVerSB.getAttribute("version");
    return curVer;
View Full Code Here

  public   String defineJob(String xmlRequest) {
    StringBuffer servreponse = new StringBuffer();
      Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
      SourceBean request = SourceBean.fromXMLString(xmlRequest);
      servreponse.append("<EXECUTION_OUTCOME ");
      String jobName = (String)request.getAttribute("jobName");
      String jobgroupName = (String)request.getAttribute("jobGroupName");
        jobgroupName = Scheduler.DEFAULT_GROUP;
      String jobDescription = (String)request.getAttribute("jobDescription");
        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);
          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);
      String label=doc.getSbiObjLabel();
      logger.debug("Document "+label);     
      // recover style informations
      String styleLab=(String);
      String styleString=(String)styles.get(styleLab);
      MetadataStyle metadataStyle=MetadataStyle.getMetadataStyle(label,styleString.toString(), docCompConf);
        defaultStyle=(metadataStyle == null) ? true : false;
      DocumentContainer documentContainer=new DocumentContainer();
      documents.put(label, documentContainer);

      // get its parameters configuration
      logger.debug("Get parametrs configuration for document "+label);     
      Object urlO=sb.getAttribute("TRACE_PAR_"+label);
        String url=urlO.toString();
        CurrentConfigurationDocComp ccdc=new CurrentConfigurationDocComp(label);
        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);
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();
        String dataSetId=obj.getDataSetId().toString();
        dataParameters.put("datasetid", dataSetId);
      while (dataAttrsIter.hasNext()) {
      SourceBeanAttribute paramSBA = (SourceBeanAttribute);
      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 {
    SourceBean drillSB = (SourceBean)content.getAttribute("DRILL");
    String drillLabel="";
    Map tmpDrillParameters= new LinkedHashMap();
      String lab=(String)drillSB.getAttribute("document");
      if(lab!=null) drillLabel=lab;
      else{"Drill label not found");

      List parameters =drillSB.getAttributeAsList("PARAM");
        for (Iterator iterator = parameters.iterator(); iterator.hasNext();) {
          SourceBean att = (SourceBean);
          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);
        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");"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");
View Full Code Here


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