Package it.eng.spago.base

Examples of it.eng.spago.base.SourceBean


    List attributes = new ArrayList();
    ConfigSingleton config = ConfigSingleton.getInstance();
    List sb_attributes = config.getAttributeAsList("AUTHORIZATIONS.ENTITIES.ATTRIBUTES.ATTRIBUTE");
    Iterator iter_sb_attributes = sb_attributes.iterator();
    while(iter_sb_attributes.hasNext()) {
      SourceBean attributeSB = (SourceBean)iter_sb_attributes.next();
      String attribute = (String)attributeSB.getAttribute("name");
      logger.debug("ADD: attribute="+attribute);
      attributes.add(attribute);
    }
    logger.debug("OUT");
    return attributes;
View Full Code Here


        byte[] byteContent = null;
        try {
          BASE64Decoder bASE64Decoder = new BASE64Decoder();
          byteContent = bASE64Decoder.decodeBuffer(templateContent.getContent());
          String xmlSourceBean = new String(byteContent);
          SourceBean sb =SourceBean.fromXMLString(xmlSourceBean);
          template = new JPaloEngineTemplate(sb);   
         
          if(template == null){
              if(documentId != null && profile != null){
                jpaloUrl += ",spagobiusr=\""+(String)profile.getUserUniqueIdentifier()+"\"";       
View Full Code Here

    this.language = language;
    this.context = context;
  }   
 
  public void load(SourceBean template) throws TemplateParseException {
    SourceBean jobSB;
   
    Assert.assertNotNull(template, "Input parameter [template] cannot be null");
   
    jobSB = (SourceBean)template.getAttribute("JOB");
    Assert.assertNotNull(jobSB, "template cannot be null");
   
    name = (String)jobSB.getAttribute("jobName");
    if(name == null) {
      throw new TemplateParseException(template, "Missing Talend project name in document template");
    }
  
    project = (String)jobSB.getAttribute("project");
    if(project == null) {
      throw new TemplateParseException(template, "Missing Talend project name in document template");
    }
   
    language = (String)jobSB.getAttribute("language");
    if(language == null) {
      throw new TalendEngineException("Missing Talend job language in document template");
    }
   
    context = (String)jobSB.getAttribute("context");
     
      version = jobSB.getAttribute("version") != null? (String)jobSB.getAttribute("version"): "0.1";     
  }
View Full Code Here

        } catch (Exception e) {
        logger.error("Error while recovering template content: \n" , e);
        throw new EMFUserError(EMFErrorSeverity.ERROR, "1002", messageBundle);
        }
        // get bytes of template and transform them into a SourceBean
        SourceBean content = null;
        try {
        String contentStr = new String(contentBytes);
        content = SourceBean.fromXMLString(contentStr);
        } catch (Exception e) {
        logger.error("Error while converting the Template bytes into a SourceBean object");
        throw new EMFUserError(EMFErrorSeverity.ERROR, "1003", messageBundle);
        }
        // get information from the conf SourceBean and pass them into the
        // response
        String movie = (String) content.getAttribute("movie");
        String width = (String) content.getAttribute("DIMENSION.width");
        String height = (String) content.getAttribute("DIMENSION.height");
 
        String dataurl = (String) content.getAttribute("DATA.url");
       
        // get all the parameters for data url
        dataParameters = new LinkedHashMap();
        confParameters = new LinkedHashMap();
        drillParameters = new LinkedHashMap();
       
        SessionContainer session = requestContainer.getSessionContainer();
        IEngUserProfile profile = (IEngUserProfile) session.getPermanentContainer().getAttribute(
          IEngUserProfile.ENG_USER_PROFILE);
       
        SourceBean serviceRequest=requestContainer.getServiceRequest();
       
       // get all the parameters for dash configuration       
        defineDataParameters(content, obj, profile);
        defineConfParameters(content, profile);
        defineLinkParameters(content, serviceRequest);
View Full Code Here

    boolean isDsConfDefined = false;
    String confDataset = "";
 
    // get all the parameters for dash configuration
      confParameters = new LinkedHashMap();
      SourceBean confSB = (SourceBean) content.getAttribute("CONF");
      List confAttrsList = confSB.getContainedSourceBeanAttributes();
      Iterator confAttrsIter = confAttrsList.iterator();
      while (confAttrsIter.hasNext()) {
      SourceBeanAttribute paramSBA = (SourceBeanAttribute) confAttrsIter.next();
      SourceBean param = (SourceBean) paramSBA.getValue();
      String nameParam = (String) param.getAttribute("name");
      String valueParam = replaceParsInString((String) param.getAttribute("value"))
     
      confParameters.put(nameParam, valueParam);
      }   
      //defines if configuration is by dataset
      if(confParameters.get("confdataset")!=null && !(((String)confParameters.get("confdataset")).equalsIgnoreCase("") )){ 
      confDataset=(String)confParameters.get("confdataset");
      isDsConfDefined=true;
    }
    else {
      isDsConfDefined=false;
    }
      //if the configuration is by dataset reading it and compiles attributes with its values.
    if(isDsConfDefined){
      logger.debug("configuration defined in dataset "+confDataset);
     
      String parameters=DataSetAccessFunctions.getDataSetResultFromLabel(profile, confDataset, dataParameters);
      SourceBean sourceBeanResult=null;
      try {
        sourceBeanResult = SourceBean.fromXMLString(parameters);
      } catch (SourceBeanException e) {
        logger.error("error in reading configuration lov");
        throw new Exception("error in reading configuration lov");
      }
      confParameters = new LinkedHashMap();
      SourceBean sbRow=(SourceBean)sourceBeanResult.getAttribute("ROW");
      confParameters.put("minValue", (String)sbRow.getAttribute("minValue"));
      confParameters.put("maxValue", (String)sbRow.getAttribute("maxValue"));
      confParameters.put("lowValue", (String)sbRow.getAttribute("lowValue"));
      confParameters.put("highValue", (String)sbRow.getAttribute("highValue"));
      confParameters.put("refreshRate", (String)sbRow.getAttribute("refreshRate"));
      confParameters.put("multichart", (String)sbRow.getAttribute("multichart"));
      confParameters.put("numCharts", (String)sbRow.getAttribute("numCharts"));
      confParameters.put("orientation_multichart", (String)sbRow.getAttribute("orientation_multichart"));
      //defining title and legend variables     
      confParameters.put("displayTitleBar", (String)sbRow.getAttribute("displayTitleBar"));
      confParameters.put("title", replaceParsInString((String)sbRow.getAttribute("title")));
      confParameters.put("colorTitle", (String)sbRow.getAttribute("colorTitle"));
      confParameters.put("sizeTitle", (String)sbRow.getAttribute("sizeTitle"));
      confParameters.put("fontTitle", (String)sbRow.getAttribute("fontTitle"));
      confParameters.put("colocolorTitleSerierTitle", (String)sbRow.getAttribute("colorTitleSerie"));
      confParameters.put("sizeTitleSerie", (String)sbRow.getAttribute("sizeTitleSerie"));
      confParameters.put("fontTitleSerie", (String)sbRow.getAttribute("fontTitleSerie"));
      confParameters.put("legend", (String)sbRow.getAttribute("legend"));
     
      String strNeedles = (String)sbRow.getAttribute("numNeedles");
      confParameters.put("numNeedles",strNeedles);
      int numNeedles = 0;
      try{
        numNeedles = Integer.parseInt(strNeedles);
      }catch(Exception e){
        logger.error("error in reading configuration dataset. Number of needles is invalid." );
        throw new Exception("error in reading configuration dataset. Number of needles is invalid.");
      }
     
      for (int i=0 ; i < numNeedles; i++){       
        confParameters.put("colorNeedle"+(i+1), (String)sbRow.getAttribute("colorNeedle"+(i+1)));
        confParameters.put("value"+(i+1), (String)sbRow.getAttribute("value"+(i+1)));
      }
    }
    else
      logger.debug("Configuration set in template");
   
View Full Code Here

    return h;
  }
 
  private String deserializeParsListJSONArray(JSONArray parsListJSON) throws JSONException, SourceBeanException{
    String toReturn = "";
    SourceBean sb = new SourceBean("PARAMETERSLIST")
    SourceBean sb1 = new SourceBean("ROWS");
   
    for(int i=0; i< parsListJSON.length(); i++){
      JSONObject obj = (JSONObject)parsListJSON.get(i);
      String name = obj.getString("name")
      String type = obj.getString("type")
      SourceBean b = new SourceBean("ROW");
      b.setAttribute("NAME", name);
      b.setAttribute("TYPE", type);
      sb1.setAttribute(b)
   
    sb.setAttribute(sb1);
    toReturn = sb.toXML(false);
    return toReturn;
View Full Code Here

   * @param file the file
   * @param modalityName the modality name
   */
  public QbeXMLModelAccessModality(File file, String modalityName) {
    try {     
      SourceBean modalitiesSB = SourceBean.fromXMLStream(
          new InputSource(new FileInputStream(file)));
      modalitySB = getModalitySBByName(modalitiesSB, modalityName);
      initRecursiveFiltering(modalitySB);
      entityAccessModalityMap = buildEntityAccessModalityMap(modalitySB);
    } catch (SourceBeanException e) {
View Full Code Here

   * @param modalityName the modality name
   *
   * @return the modality sb by name
   */
  private SourceBean getModalitySBByName(SourceBean modalitiesSB, String modalityName) {
    SourceBean modalitySB = null;
    if(modalityName != null) {
      modalitySB = (SourceBean)modalitiesSB.getFilteredSourceBeanAttribute(TAG_MODALITY, "name", modalityName)
        
    } else {
      List modalities = modalitySB.getAttributeAsList(TAG_MODALITY);
      if(modalities != null && modalities.size() > 0) {
        modalitySB = (SourceBean)modalities.get(0);
      }
    }
    return modalitySB;
View Full Code Here

   */
  private Map buildEntityAccessModalityMap(SourceBean modalitySB) {
    Map map = new HashMap();
   
    List entities =  modalitySB.getAttributeAsList(TAG_ENTITY);
    SourceBean entitySB;
    EntityAccessModalitty entityAccessModality;
    for(int i = 0; i < entities.size(); i++) {
      entitySB = (SourceBean)entities.get(i);
      String entityName = (String)entitySB.getAttribute("name");
      String accessibleStr = (String)entitySB.getAttribute("accessible");
      boolean accessibleFlg = accessibleStr == null? true: accessibleStr.equalsIgnoreCase("TRUE");
      entityAccessModality = new EntityAccessModalitty(entityName, accessibleFlg);
     
      // get filed accessibility constraints
      List fields = entitySB.getAttributeAsList(TAG_FIELDS + "." + TAG_FIELD);
      SourceBean fieldSB;
      for(int j = 0; j < fields.size(); j++) {
        fieldSB = (SourceBean)fields.get(j);
        String fieldName = (String)fieldSB.getAttribute("name");
        String accesible = (String)fieldSB.getAttribute("accessible");
        if(accesible.equalsIgnoreCase("FALSE")) {
          entityAccessModality.setFieldUnaccessible(fieldName);
        }       
      }
      // get entity filter conditions
      List filters = entitySB.getAttributeAsList(TAG_FILTERS + "." + TAG_FILTER);
      SourceBean filterSB;
      for(int j = 0; j < filters.size(); j++) {
        filterSB = (SourceBean)filters.get(j);
        String filterCondition = filterSB.getCharacters();
        entityAccessModality.addFilterConditions(filterCondition);
               
      }
      map.put(entityAccessModality.getName(), entityAccessModality);
    }
View Full Code Here

      if(!l.isEmpty()){
          Iterator it = l.iterator();
          while(it.hasNext()){
            SbiDistributionListsObjects temp = (SbiDistributionListsObjects)it.next();
            String xmlstr = temp.getXml();
            SourceBean sb = SourceBean.fromXMLString(xmlstr);
            String trigName = (String)sb.getAttribute("triggerName");
            if (trigName != null && trigName.equals(triggername)){
              hibDistributionListsObjects = temp;
              aSession.delete(hibDistributionListsObjects);
            }
          }     
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.