コード例 #1
0
ファイル: TestSOvfs.php プロジェクト: HaakonME/porticoestate
 private function removeDummyVfsFile()
 {
     $sovfs = new sovfs_impl();
     $sovfs->setFilename($this->vfsFileName);
     $sovfs->setSubModule($this->vfsSubModule);
     $sovfs->removeFileFromVfs();
 }
コード例 #2
0
 public function getFacilityManagementXmlByModelId($modelId = null)
 {
     $GLOBALS['phpgw_info']['flags']['noheader'] = true;
     $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
     $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
     header("Content-type: application/xml");
     $restUrl = $this->bimconverterUrl;
     if ($modelId == null) {
         $modelId = (int) phpgw::get_var("modelId");
     }
     //echo "ModelId is:".$modelId;
     $bobimmodel = new bobimmodel_impl();
     $sovfs = new sovfs_impl();
     $sovfs->setSubModule(self::$virtualFileSystemPath);
     $bobimmodel->setVfsObject($sovfs);
     $sobimmodel = new sobimmodel_impl($this->db);
     $sobimmodel->setModelId($modelId);
     $bobimmodel->setSobimmodel($sobimmodel);
     $sobimmodelinformation = new sobimmodelinformation_impl($this->db, $modelId);
     try {
         if ($bobimmodel->checkBimModelIsUsed()) {
             throw new Exception("Model is already in use!");
         }
         $ifcFileWithRealPath = $bobimmodel->getIfcFileNameWithRealPath();
         $xmlResult = $this->getFacilityManagementXmlFromIfc($ifcFileWithRealPath);
         $bobimitem = new bobimitem_impl();
         $bobimitem->setSobimmodelinformation($sobimmodelinformation);
         $bobimitem->setIfcXml($xmlResult);
         $bobimitem->setSobimitem(new sobimitem_impl($this->db));
         $bobimitem->setSobimtype(new sobimtype_impl($this->db));
         $bobimitem->loadIfcItemsIntoDatabase();
         $result = array();
         $result["result"] = 1;
         $result["error"] = "";
         echo json_encode($result);
     } catch (NoResponseException $e) {
         $result = array();
         $result["result"] = 0;
         $result["error"] = "Could not connect to BIM converter rest service!";
         $result["Exception"] = $e;
         echo json_encode($result);
     } catch (Exception $e) {
         $result = array();
         $result["result"] = 0;
         $result["error"] = "General error!\nMessage: " . $e->getMessage();
         echo json_encode($result);
     }
 }
コード例 #3
0
 public function testRemoveUploadedIfcModel()
 {
     $bobimmodel = new bobimmodel_impl();
     //init dependancies
     $sovfs = new sovfs_impl($this->vfsFileName, null, $this->vfsSubModule);
     $vls_db_id = $sovfs->retrieveVfsFileId();
     $sobimmodel = new sobimmodel_impl($this->db);
     $sobimmodel->setModelName($this->modelName);
     $sobimmodel->setVfsdatabaseid($vls_db_id);
     $bobimmodel->setVfsObject($sovfs);
     $bobimmodel->setSobimmodel($sobimmodel);
     $this->assertTrue($bobimmodel->removeIfcModel());
 }