Package it.eng.spago.error

Examples of it.eng.spago.error.EMFUserError


      logger.error("Error while loading all metadata ", he);

      if (tx != null)
        tx.rollback();

      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);

    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();       
      }
View Full Code Here


      SbiDomains dataType = (SbiDomains) criteria.uniqueResult();

      if (dataType == null){
        logger.error("The Domain with value_id= "+aObjMetadata.getDataType()+" does not exist.");
        throw new EMFUserError(EMFErrorSeverity.ERROR, 1035);
      }
     
      SbiObjMetadata hibMeta = (SbiObjMetadata)aSession.load(SbiObjMetadata.class, aObjMetadata.getObjMetaId());
      hibMeta.setLabel(aObjMetadata.getLabel());
      hibMeta.setName(aObjMetadata.getName());
      hibMeta.setDescription(aObjMetadata.getDescription());
      hibMeta.setDataType(dataType);
      updateSbiCommonInfo4Update(hibMeta);
      tx.commit();
    } catch (HibernateException he) {
      logException(he);
      if (tx != null)
        tx.rollback();
      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();
      }
      logger.debug("OUT");
View Full Code Here

      SbiDomains dataType = (SbiDomains) criteria.uniqueResult();

      if (dataType == null){
        logger.error("The Domain with value_id= "+aObjMetadata.getDataType()+" does not exist.");
        throw new EMFUserError(EMFErrorSeverity.ERROR, 1035);
      }
      Date now = new Date();
      // store the object note
      SbiObjMetadata hibMeta = new SbiObjMetadata();
      hibMeta.setLabel(aObjMetadata.getLabel());
      hibMeta.setName(aObjMetadata.getName());
      hibMeta.setDescription(aObjMetadata.getDescription());
      hibMeta.setDataType(dataType);
      hibMeta.setCreationDate(now);
      updateSbiCommonInfo4Insert(hibMeta);
      aSession.save(hibMeta);
      tx.commit();
    } catch (HibernateException he) {
      logException(he);
      if (tx != null)
        tx.rollback();
      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();
      }
      logger.debug("OUT");
View Full Code Here

      logger.error("Error while erasing the metadata with id " + ((aObjMetadata == null)?"":String.valueOf(aObjMetadata.getObjMetaId())), he);

      if (tx != null)
        tx.rollback();

      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);

    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();
        logger.debug("OUT");
View Full Code Here

      logger.error("Error while getting the objects associated with the metadata with id " + id, he);

      if (tx != null)
        tx.rollback();

      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);

    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();
      }
View Full Code Here

      logger.error("Error while getting the engines associated with the data source with id " + id, he);

      if (tx != null)
        tx.rollback();

      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);

    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();
      }
View Full Code Here

      BIObject obj = DAOFactory.getBIObjectDAO().loadBIObjectForExecutionByIdAndRole(objId, executionRole);
      if (obj == null){
        logger.error("Cannot obtain engine url. Document with label " + objLabel +" doesn't exist into database.");   
        List l = new ArrayList();
        l.add(objLabel);
        throw new EMFUserError(EMFErrorSeverity.ERROR, "1005", l, messageBundle);
      }
      Engine engine = obj.getEngine();
      // GET THE TYPE OF ENGINE (INTERNAL / EXTERNAL) AND THE SUITABLE BIOBJECT TYPES
      Domain engineType = null;
      Domain compatibleBiobjType = null;
      try {
        engineType = DAOFactory.getDomainDAO().loadDomainById(engine.getEngineTypeId());
        compatibleBiobjType = DAOFactory.getDomainDAO().loadDomainById(engine.getBiobjTypeId());
      } catch (EMFUserError error) {
        logger.error("Error retrieving document's engine information", error);
        return "1009|";
      } catch (Exception error) {
        logger.error("Error retrieving document's engine information", error);
        return "1009|";
      }

      String compatibleBiobjTypeCd = compatibleBiobjType.getValueCd();
      String biobjTypeCd = obj.getBiObjectTypeCode();

      // CHECK IF THE BIOBJECT IS COMPATIBLE WITH THE TYPES SUITABLE FOR THE ENGINE
      if (!compatibleBiobjTypeCd.equalsIgnoreCase(biobjTypeCd)) {
        // the engine document type and the biobject type are not compatible
        logger.error("Engine cannot execute input document type: " +
            "the engine " + engine.getName() + " can execute '" + compatibleBiobjTypeCd + "' type documents " +
            "while the input document is a '" + biobjTypeCd + "'.");
        Vector params = new Vector();
        params.add(engine.getName());
        params.add(compatibleBiobjTypeCd);
        params.add(biobjTypeCd);
        //errorHandler.addError(new EMFUserError(EMFErrorSeverity.ERROR, 2002, params));
        return "2002|";
      }

      // IF USER CAN'T EXECUTE THE OBJECT RETURN
      if (!ObjectsAccessVerifier.canSee(obj, profile)) return "1010|";

      //get object configuration
      DocumentCompositionConfiguration docConfig = null;
      docConfig = (DocumentCompositionConfiguration)contextManager.get("docConfig");

      Document document = null;
      //get correct document configuration
      List lstDoc = docConfig.getLabelsArray();
      boolean foundDoc = false;
      for (int i = 0; i < lstDoc.size(); i++){
        document = (Document)docConfig.getDocument((String)lstDoc.get(i));
        if (document != null){
          if (!obj.getLabel().equalsIgnoreCase(document.getSbiObjLabel()))
            continue;
          else{
            foundDoc = true;
            break;
          }
        }
      }
      if (!foundDoc){
        List l = new ArrayList();
        l.add(obj.getLabel());
        EMFUserError userError = new EMFUserError(EMFErrorSeverity.ERROR, 1079, l);
        logger.error("The object with label " + obj.getLabel() + " hasn't got a document into template" );
        return "1002|";
      }

      String className = obj.getEngine().getClassName();
View Full Code Here

    try{
      ObjTemplate template = DAOFactory.getObjTemplateDAO().getBIObjectActiveTemplate(getObj().getId());
      if(template==null) throw new Exception("Active Template null");
      contentBytes = template.getContent();
      if(contentBytes==null) {
        EMFUserError userError = new EMFUserError(EMFErrorSeverity.ERROR, 2007);
        userError.setBundle("messages");
        throw userError;
      }

      String contentStr = new String();
     
View Full Code Here

    String message = (String) serviceRequest.getAttribute("MESSAGEDET");
    TracerSingleton.log(SpagoBIConstants.NAME_MODULE, TracerSingleton.DEBUG,  "begin of detail Map modify/visualization service with message =" + message);
   
    try {
      if (message == null) {
        EMFUserError userError = new EMFUserError(EMFErrorSeverity.ERROR, 101);       
        TracerSingleton.log(SpagoBIConstants.NAME_MODULE, TracerSingleton.DEBUG,  "The message parameter is null");
        throw userError;
      }
      if (message.trim().equalsIgnoreCase(SpagoBIConstants.DETAIL_INS) ||
        message.trim().equalsIgnoreCase( SpagoBIConstants.DETAIL_MOD)){ 
View Full Code Here

    response.setAttribute("mapObj", map);
  } catch (Exception ex) {
    TracerSingleton.log(SpagoBIConstants.NAME_MODULE, TracerSingleton.MAJOR, "Cannot fill response container" + ex.getLocalizedMessage())
    HashMap params = new HashMap();
    params.put(AdmintoolsConstants.PAGE, ListMapsModule.MODULE_PAGE);
    throw new EMFUserError(EMFErrorSeverity.ERROR, 5011, new Vector(), params);
  }
}
View Full Code Here

TOP

Related Classes of it.eng.spago.error.EMFUserError

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.