Examples of SbiAttribute


Examples of it.eng.spagobi.profiling.bean.SbiAttribute

    //gets attributes from database
    try {
      List<SbiAttribute> sbiAttributes = DAOFactory.getSbiAttributeDAO().loadSbiAttributes();
      Iterator it = sbiAttributes.iterator();
      while(it.hasNext()) {
        SbiAttribute attribute = (SbiAttribute)it.next();

        attributes.add(attribute.getAttributeName());
      }
    } catch (EMFUserError e) {
      logger.error(e.getMessage(), e);
    }
View Full Code Here

Examples of it.eng.spagobi.profiling.bean.SbiAttribute

      //hashmap to use during
      HashMap< String, Integer> attributesLookup = new HashMap< String, Integer> ();
      for (int i=0; i<defaultAttributes.size();i++) {
          SourceBean attribute = (SourceBean) defaultAttributes.get(i);
         
          SbiAttribute sbiAttribute = new SbiAttribute();
          String attrName = (String) attribute.getAttribute("name");
         
          SbiAttribute existingAttribute = attrDAO.loadSbiAttributeByName(attrName);
          if(existingAttribute == null){
            sbiAttribute.setAttributeName(attrName);
            String attrDescr = (String) attribute.getAttribute("description");
            sbiAttribute.setDescription(attrDescr);         
           
            try
              Integer id = attrDAO.saveSbiAttribute(sbiAttribute);
              attributesLookup.put(attrName, id);
          } catch (EMFUserError e) {
            logger.error(e.getMessage(), e);
         
          }else{
            attributesLookup.put(attrName, existingAttribute.getAttributeId());
          }
       
      }
     
      List defaultRoles = _config.getAttributeAsList("DEFAULT_ROLES.ROLE");
View Full Code Here

Examples of it.eng.spagobi.profiling.bean.SbiAttribute

                  writeBackToClient( new JSONSuccess(attributesResponseSuccessJSON) );
                  return;
                }
              }
           
              SbiAttribute attribute = new SbiAttribute();
              if(description!=null){
                attribute.setDescription(description);
              }
              if(name!=null){
                attribute.setAttributeName(name);
              }
              boolean isNewAttrForRes = true;
              if(idStr!=null && !idStr.equals("")){
                Integer attributeId = new Integer(idStr);
                attribute.setAttributeId(attributeId.intValue());
                isNewAttrForRes = false;
              }
              Integer attrID = attrDao.saveOrUpdateSbiAttribute(attribute);
              logger.debug("Attribute updated");

              ArrayList<SbiAttribute> attributes = new ArrayList<SbiAttribute> ();
              attribute.setAttributeId(attrID);
              attributes.add(attribute);
             
              getAttributesListAdded(locale,attributes,isNewAttrForRes, attrID);

            }
View Full Code Here

Examples of it.eng.spagobi.profiling.bean.SbiAttribute

    if( !(o instanceof SbiAttribute) ) {
      throw new SerializationException("AttributeJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
    }
   
    try {
      SbiAttribute sbiAttribute = (SbiAttribute)o;
      result = new JSONObject();
      result.put(ID, sbiAttribute.getAttributeId());
      result.put(NAME, sbiAttribute.getAttributeName());
      result.put(DESCRIPTION, sbiAttribute.getDescription() );     
    } catch (Throwable t) {
      throw new SerializationException("An error occurred while serializing object: " + o, t);
    } finally {
     
    }
View Full Code Here

Examples of it.eng.spagobi.profiling.bean.SbiAttribute

    Transaction tx = null;
    Integer idToReturn = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiAttribute hibAttribute = attribute;
      int id = attribute.getAttributeId();
      if(id!=0){
        hibAttribute = (SbiAttribute)aSession.load(SbiAttribute.class,  attribute.getAttributeId());
        String name = attribute.getAttributeName();
        String description = attribute.getDescription();
        if(name!=null){
          hibAttribute.setAttributeName(name);
        }
        if(description!=null){
          hibAttribute.setDescription(description);
        }
      }
      Integer idAttrPassed = attribute.getAttributeId();
      if(idAttrPassed != null && !String.valueOf(idAttrPassed.intValue()).equals("")){
        updateSbiCommonInfo4Insert(hibAttribute);
View Full Code Here

Examples of it.eng.spagobi.profiling.bean.SbiAttribute

  }

  public SbiAttribute loadSbiAttributeByName(String name) throws EMFUserError {
    logger.debug("IN");
    SbiAttribute toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

Examples of it.eng.spagobi.profiling.bean.SbiAttribute

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiAttribute attrToDelete =(SbiAttribute)aSession.load(SbiAttribute.class, id);
      aSession.delete(attrToDelete);
      tx.commit();
    } catch (HibernateException he) {
      logger.error(he.getMessage(), he);
      if (tx != null)
View Full Code Here

Examples of it.eng.spagobi.profiling.bean.SbiAttribute

      JSONArray attrsJSON = new JSONArray();
      //attrsJSON.put("attributes");

      while(itAttrs.hasNext()){
        JSONObject jsonAttr = new JSONObject();
        SbiAttribute attr =(SbiAttribute)itAttrs.next();
        Integer userAttrID = attr.getAttributeId();
        jsonAttr.put("name", attr.getAttributeName());
        jsonAttr.put("id", userAttrID);
        if(userAttributes.containsKey(userAttrID)){
          HashMap<String, String> nameAndValueAttr = userAttributes.get(userAttrID);       
          String attrName= nameAndValueAttr.keySet().iterator().next();//unique value
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.