iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 21
0

相信有做過開源專案的人,跟我一樣看到這個名字時有種會心一笑的感覺,這真的很像Git Hub。

跟傳統數據資料庫不同,Data Hub並不是一個中心資料庫,而是資料庫的資料庫,在Mendix上數據會有以下的生命週期:

https://ithelp.ithome.com.tw/upload/images/20201005/20129530qBG4IKASYQ.png

數據可能來自不同的應用程式、儀器,或者原本的資料庫,這些數據透過API傳到Data Hub後,就會自動被納入Data Hub的Catalog搜尋範圍(這時要記得設定好隱私唷~),之後就可以讓公司裡其他應用程式使用。

Data Hub Catalog用法

在Data Hub首頁可以輕鬆地搜尋到需要的數據

https://ithelp.ithome.com.tw/upload/images/20201005/20129530dz8FhlfdNr.png

但搜尋數據不難,要怎麼樣將在地的資訊上傳雲端或從雲端下載才是棘手的地方。還記得之前提過的建資料庫嗎?在創建好實體(Entity)架構後(不記得怎麼建Entity的人,看這篇),我們接著就能來上傳/引入數據資料了!

上傳應用程式的數據資料

首先,在module的資料夾中創建一個名叫API的新資料夾
接著,在實體(entity)上按滑鼠右鍵,點選Expose as OData resource
https://ithelp.ithome.com.tw/upload/images/20201005/201295304dPDFzWgDY.png

在API資料夾中建立一份新資料
https://ithelp.ithome.com.tw/upload/images/20201005/20129530bHY33HuWF6.jpg

詳細檢查欲上傳的資料是否正確
https://ithelp.ithome.com.tw/upload/images/20201005/201295307ADnia5TgA.png

確認後就可以到API資料夾中的OData Service資料中查看

在雲端發布

點選在雲端上Run的圖示
https://ithelp.ithome.com.tw/upload/images/20201005/2012953028lU77fwTX.png

接著便可以在應用程式中開始輸入資料,而這些輸入的數據將會自動更新在共享的資料中

Virtual Entities 用法

如果有開啟Data Hub功能的話,Data Hub 列表會自動陳列在Mendix Studio Pro右手邊,如果沒看到也可以到View清單裡找尋。

https://ithelp.ithome.com.tw/upload/images/20201005/20129530qr9bnojBmP.png

https://ithelp.ithome.com.tw/upload/images/20201005/20129530RAuDeFU4Pw.png

在這個表單上可以找尋需要的數據關鍵字,找到後便可以直接拖曳到domain module裡使用。

https://ithelp.ithome.com.tw/upload/images/20201005/20129530NdsXUPEwcZ.png

https://ithelp.ithome.com.tw/upload/images/20201005/20129530XfuMgpot6J.png

https://ithelp.ithome.com.tw/upload/images/20201005/20129530y244AhQ6Q1.png

總結,Data Hub還有許多功能可以研究,有興趣的人可以看這篇官方文件


上一篇
數據資料這麼多!要怎麼使用阿?試用Data Hub看看(上)
下一篇
資料一把抓~淺談OQL( Object Query Language)
系列文
Mendix從入門到了解,工程師和業務都要知道低代碼平台是什麼30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言