Package it.eng.spago.base

Examples of it.eng.spago.base.SourceBean


      String looProvider = modVal.getLovProvider();
      // get from the request the type of lov
      ILovDetail lovDetail = LovDetailFactory.getLovFromXML(looProvider);
      IEngUserProfile profile = GeneralUtilities.createNewUserProfile(userIndentifierToBeUsed);
      String result = lovDetail.getLovResult(profile, null, null);
      SourceBean rowsSourceBean = SourceBean.fromXMLString(result);
      List rows = null;
      if(rowsSourceBean != null) {
        rows = rowsSourceBean.getAttributeAsList(DataRow.ROW_TAG);
        if (rows != null && rows.size() != 0) {
          Iterator it = rows.iterator();
          while(it.hasNext()) {
            SourceBean row = (SourceBean) it.next();
            Object value = row.getAttribute(lovDetail.getValueColumnName());
            if (value != null) {
              toReturn.add(value.toString());
            }
          }
        }
View Full Code Here


  }


  private SourceBean getTemplate(String documentId) throws EMFUserError{
    logger.debug("IN");
    SourceBean content = null;
    byte[] contentBytes = null;
    try {
      ObjTemplate template = DAOFactory.getObjTemplateDAO().getBIObjectActiveTemplate(Integer.valueOf(documentId));
      if (template == null) {
        logger.warn("Active Template null.");
View Full Code Here

      Date begD, Date endDate, String datasetLabel,
      Integer modInstId, KpiValue kpiVal) throws EMFUserError, SourceBeanException{
    int length = fields.size();
    String xmlData = null;
    String tempXMLroot = "<XML_DATA></XML_DATA>";
    SourceBean dsValuesXml = SourceBean.fromXMLString(tempXMLroot);
    boolean valueFound = false;
    for(int fieldIndex =0; fieldIndex<length; fieldIndex++){

      IField f = (IField)fields.get(fieldIndex);     
      if (f != null) {
        if (f.getValue() != null) {
          String fieldName = d.getFieldName(fieldIndex);   
          if (fieldName.equalsIgnoreCase("DESCR")){
            String descr = f.getValue().toString();
            kpiValueToReturn.setValueDescr(descr);
            logger.debug("Setted the kpiValue description:"+descr);
          }else if(fieldName.equalsIgnoreCase("END_DATE")){
            String endD = f.getValue().toString();
            String format = "dd/MM/yyyy hh:mm:ss";
            SimpleDateFormat form = new SimpleDateFormat();
            form.applyPattern(format);
            try {
              endDate = form.parse(endD);
            } catch (ParseException e) {
              e.printStackTrace();
            }
            if(endDate!=null && endDate.after(begD)) {        
              kpiValueToReturn.setEndDate(endDate);
              logger.debug("Setted the new EndDate description:"+endD.toString());
            }
          }else if(fieldName.equalsIgnoreCase("VALUE")){
            String fieldValue = f.getValue().toString();
            kpiValueToReturn.setValue(fieldValue);
            logger.debug("Setted the kpiValue value:"+fieldValue);
            valueFound = true;
          }  
          else if(fieldName.equalsIgnoreCase("XML_DATA")){
            xmlData = f.getValue().toString();
            kpiValueToReturn.setValueXml(xmlData);
            logger.debug("Setted the kpiValue xmlData:"+xmlData);
          }  
          else if(fieldName.equalsIgnoreCase(RESOURCE)){
            String fieldValue = f.getValue().toString();
            if (fieldValue!=null){
              Resource rTemp = DAOFactory.getResourceDAO().loadResourcesByNameAndModelInst(fieldValue);
              kpiValueToReturn.setR(rTemp);
              logger.info("Setted the kpiValue Resource with resource name:"+fieldValue);
            }
          }/*else if(fieldName.equalsIgnoreCase("ORG_UNIT_ID")){
            String fieldValue = f.getValue().toString();
            if (fieldValue!=null){
              Resource rTemp = DAOFactory.getResourceDAO().loadResourcesByNameAndModelInst(fieldValue);
              kpiValueToReturn.setR(rTemp);
              logger.info("Setted the kpiValue Resource with resource name:"+fieldValue);
            }
          }*/ else{
            String fieldValue = f.getValue().toString();
            if (fieldValue!=null){
              dsValuesXml.setAttribute(fieldName, fieldValue);
            }
          }
        }
      }
    }
    if(xmlData==null && dsValuesXml!=null){
      xmlData = dsValuesXml.toXML(false);
      kpiValueToReturn.setValueXml(xmlData);
      logger.debug("Setted the kpiValue xmlData:"+xmlData);
    }

    if (kpiValueToReturn == null && valueFound == true){
View Full Code Here

      titleChart = replaceParsInString(titleChart);
      setName(titleChart);
    }

    //Setting title style
    SourceBean styleTitleSB = (SourceBean) content.getAttribute("STYLE_TITLE");
    if (styleTitleSB != null) {
      String fontS = (String) content.getAttribute("STYLE_TITLE.font");
      String sizeS = (String) content.getAttribute("STYLE_TITLE.size");
      String colorS = (String) content.getAttribute("STYLE_TITLE.color");
      try {
        Color color = Color.decode(colorS);
        int size = Integer.valueOf(sizeS).intValue();
        styleTitle = new StyleLabel(fontS, size, color);
      } catch (Exception e) {
        logger.error("Wrong style Title settings, use default");
      }

    } else {
      styleTitle = new StyleLabel("Arial", 16, new Color(255, 0, 0));
    }
    this.confMap.put("styleTitle", styleTitle);

    //Getting SUBTITLE and setting its style
    SourceBean styleSubTitleSB = (SourceBean) content.getAttribute("STYLE_SUBTITLE");
    if (styleSubTitleSB != null) {

      String subTitle = (String) content.getAttribute("STYLE_SUBTITLE.name");
      subTitle = replaceParsInString(subTitle);
      setSubName(subTitle);   
      String fontS = (String) content.getAttribute("STYLE_SUBTITLE.font");
      String sizeS = (String) content.getAttribute("STYLE_SUBTITLE.size");
      String colorS = (String) content.getAttribute("STYLE_SUBTITLE.color");
      try {
        Color color = Color.decode(colorS);
        int size = Integer.valueOf(sizeS).intValue();
        styleSubTitle = new StyleLabel(fontS, size, color);
      } catch (Exception e) {
        logger.error("Wrong style SubTitle settings, use default");
      }
    } else {
      styleSubTitle = new StyleLabel("Arial", 12, new Color(0, 0, 0));
    }
    this.confMap.put("styleSubTitle", styleSubTitle);

    // get all the other template parameters
    try {
      Map dataParameters = new HashMap();
      SourceBean dataSB = (SourceBean) content.getAttribute("CONF");
      List dataAttrsList = dataSB.getContainedSourceBeanAttributes();
      Iterator dataAttrsIter = dataAttrsList.iterator();
      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);
      }

      closed_tree = true;
      if (dataParameters.get("closed_tree") != null
View Full Code Here

    JRExporter exporter = null;
   
    Assert.assertNotNull(format, "Input parameter [format] cennot be null");
   
   
    SourceBean exporterConfig = (SourceBean) getConfigSourceBean().getFilteredSourceBeanAttribute ("EXPORTERS.EXPORTER", "format", format);
    if(exporterConfig != null) {
      String exporterClassName = (String)exporterConfig.getAttribute("class");
      if(exporterClassName != null) {
     
        try {
          exporter = (JRExporter)Class.forName(exporterClassName).newInstance();
        } catch (Throwable t) {
View Full Code Here

    return exporter;
  }
 
  public String getMIMEType(String format) {
    String mimeType = null;
    SourceBean exporterConfig = (SourceBean) getConfigSourceBean().getFilteredSourceBeanAttribute ("EXPORTERS.EXPORTER", "format", format);
    if(exporterConfig != null) {
      mimeType = (String)exporterConfig.getAttribute("mime");
    }
   
    if(mimeType == null) {
      if (format.equalsIgnoreCase("csv")) mimeType = "text/plain";
      else if (format.equalsIgnoreCase("html")) mimeType = "text/html";
View Full Code Here

      logger.debug("No formulas configured.");
      return toReturn;
    }
    Iterator it = formulasList.iterator();
    while (it.hasNext()) {
      SourceBean sb = (SourceBean) it.next();
      if (sb != null) {
        Formula f = null;
        try {
          f = new Formula(sb);
        } catch (Exception e) {
View Full Code Here

  /* (non-Javadoc)
   * @see it.eng.spago.presentation.PublisherDispatcherIFace#getPublisherName(it.eng.spago.base.RequestContainer, it.eng.spago.base.ResponseContainer)
   */
  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    // get the module response
    SourceBean moduleResponse = (SourceBean)responseContainer.getServiceResponse().getAttribute("JobManagementModule");
    // return publisher
    return getPublisherName(requestContainer, responseContainer, moduleResponse);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see it.eng.spago.presentation.PublisherDispatcherIFace#getPublisherName(it.eng.spago.base.RequestContainer, it.eng.spago.base.ResponseContainer)
   */
  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    // get the module response
    SourceBean moduleResponse = (SourceBean)responseContainer.getServiceResponse().getAttribute("LovLookupAjaxModule");
    // return publisher
    return getPublisherName(requestContainer, responseContainer, moduleResponse);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see it.eng.spago.presentation.PublisherDispatcherIFace#getPublisherName(it.eng.spago.base.RequestContainer, it.eng.spago.base.ResponseContainer)
   */
  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    // get the module response
    SourceBean moduleResponse = (SourceBean)responseContainer.getServiceResponse().getAttribute("TriggerManagementModule");
    // return publisher
    return getPublisherName(requestContainer, responseContainer, moduleResponse);
  }
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.