Package it.eng.spagobi.tools.objmetadata.dao

Examples of it.eng.spagobi.tools.objmetadata.dao.IObjMetadataDAO


      RequestContainer reqCont = getRequestContainer();
      SessionContainer sessCont = reqCont.getSessionContainer();
      SessionContainer permSess = sessCont.getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
      
      IObjMetadataDAO dao=DAOFactory.getObjMetadataDAO();
      dao.setUserProfile(profile);
     
      ObjMetadata metaNew = recoverObjMetadataDetails(serviceRequest);
     
      EMFErrorHandler errorHandler = getErrorHandler();
      
      // if there are some validation errors into the errorHandler does not write into DB
      Collection errors = errorHandler.getErrors();
      if (errors != null && errors.size() > 0) {
        Iterator iterator = errors.iterator();
        while (iterator.hasNext()) {
          Object error = iterator.next();
          if (error instanceof EMFValidationError) {
            serviceResponse.setAttribute("metaObj", metaNew);
            serviceResponse.setAttribute("modality", mod);
            return;
          }
        }
      }
     
      if (mod.equalsIgnoreCase(SpagoBIConstants.DETAIL_INS)) {     
        //if a ds with the same label not exists on db ok else error
        if (dao.loadObjMetadataByLabel(metaNew.getLabel()) != null){
          HashMap params = new HashMap();
          params.put(AdmintoolsConstants.PAGE, ListObjMetadataModule.MODULE_PAGE);
          EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 13004, new Vector(), params );
          getErrorHandler().addError(error);
          return;
        }      

        dao.insertObjMetadata(metaNew);
       
        ObjMetadata tmpMeta = dao.loadObjMetadataByLabel(metaNew.getLabel());
        metaNew.setObjMetaId(tmpMeta.getObjMetaId());
        mod = SpagoBIConstants.DETAIL_MOD;
      } else {       
        //update metadata
        dao.modifyObjMetadata(metaNew);     
     
      IDomainDAO domaindao = DAOFactory.getDomainDAO();
      List dataTypes = domaindao.loadListDomainsByType("OBJMETA_DATA_TYPE");
      serviceResponse.setAttribute(OBJMETA_DATA_TYPE, dataTypes);
     
View Full Code Here


  @Override
  public void doService() {
    logger.debug("IN");
    try {
      JSONArray toReturn = new JSONArray();
      IObjMetadataDAO metadataDAO = DAOFactory.getObjMetadataDAO();
      List results = metadataDAO.loadAllObjMetadata();
      ArrayList objects = new ArrayList();
      for (int i = 0; i < results.size(); i++) {
        // look for binary content mimetype
        ObjMetadata metadata = (ObjMetadata)results.get(i);     
        objects.add(metadata);
View Full Code Here

  private static void indexDocs() throws Exception {
    logger.debug("IN");
    ByteArrayInputStream bais = null;
    try{
      //loads all metadata
      IObjMetadataDAO metadataDAO = DAOFactory.getObjMetadataDAO();
      List<ObjMetadata> metadatas = metadataDAO.loadAllObjMetadata();

      //call dao to get biobjects to index
      List<BIObject> biobjects = DAOFactory.getBIObjectDAO().loadAllBIObjects();
      if(biobjects != null){       
        for(int k=0; k<biobjects.size(); k++){
View Full Code Here

TOP

Related Classes of it.eng.spagobi.tools.objmetadata.dao.IObjMetadataDAO

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.