Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

BellaDati can import data and files from Amazon S3.


Files metadata are saved to the data set and files can be saved to the BellaDati Media gallery.

Connecting to S3

From Data Source Connectors page select S3.


Connection parameters


Provide your unique Account key

Provide your unique Account secret

Choose AWS region what has your bucket is assigned to

Provide with your Bucket name

You can select time interval Modified from-to. If data were modified in this time interval, they will be used in import

You can also use relative timing with Max file age in minutes old.

Row prefix regex defines according to what format, should rows be downloaded. For example "\.json$" will search for all files that ends with .json

Column file patterns defines according to what format, should columns be downloaded. Each column regex should be on new line. For example ^A.*\.json$ and ^B.*\.json$. This will download jsons starting with A on first column, and starting with B on second column.

S3 Functions

  • String getS3Text() - Gets file
  • String getS3Text(int columnIndex) - Gets file from selected column
  • JSONElement getS3JSON() - Gets json file
  • JSONElement getS3JSON(int columnIndex) - Gets json file from selected column
  • String saveS3MediaFile() - Gets picture and stores it to dataset, returns mediaId
  • String saveS3MediaFile(boolean skipIfExists) - Gets picture and stores it to media gallery, returns mediaId. With true parameter can skip already downloaded file
  • String saveS3MediaFile(int columnIndex, boolean skipIfExists) - Gets picture from selected column and stores it to media gallery, returns mediaId. With true parameter can skip already downloaded file
  • connectS3(String accountKey, String accountSecret, String region, String bucketName, Closure closure) - connects to S3 and sets the "client" as property to the closure
  • iterateS3Objects(S3Client client, String bucketName, Closure closure) - iterates objects in S3 and sets "client" and "object" as properties to the closure
  • deleteS3Object(S3Client client, String bucketName, String key)
  • deleteS3Object(S3Client client, String bucketName, S3Object object)

Example - Load data from JSON file stored in S3

Data returned from S3

S3 connector loads the list of JSON files based on the connection parameters

Getting data from loaded JSON files

In order to get the new data from the related JSON files, add a new column to the Import settings. And define the following transformation script:

Code Block
getS3JSON(1)

This script will load JSON data from the related file.

Loading data from selected JSON element

For saving the data from the loaded JSON element, there should be created a new column in the import settings. The element value will be loaded by using the following transformation script (this script will load the value from JSON element "camera_id"):

Code Block
getS3JSON(1).get("camera_id")


Sv translation
languageja

BellaDatiは、Amazon S3からデータを取り込むことができます。

ファイルのメタデータはデータセットに保存され、ファイルはBellaDati Mediaギャラリーに保存することができます。

S3への接続

データソースコネクタページから[S3]を選択します


接続パラメータ


アカウントキーを入力してください

アカウントシークレットを入力してください

バケットが割り当てられているAWSリージョンを選択します

バケット名を入力してください

Modified from-toの時間間隔を選択することができます。 この時間間隔の間にデータが変更された場合、インポートに使用されます。

また、Max file age in minutes oldで相対的なタイミングを使用することも可能です

行頭の正規表現は、どのような形式で行をダウンロードするかを定義します。例えば、" \.json$" は、.json で終わるすべてのファイルを検索します

カラムファイルのパターンは、カラムがどのような形式でダウンロードされるかを定義します。各カラムの正規表現は改行する必要があります。例えば、^A.*︎.json$ と ^B.*︎.json$ です。この場合、1列目はAから始まるjsonをダウンロードし、2列目はBから始まるjsonをダウンロードします。

S3機能

  • String getS3Text() - ファイル取得します
  • String getS3Text(int columnIndex) - 選択された列からファイルを取得します。
  • JSONElement getS3JSON() - jsonファイルを取得します
  • JSONElement getS3JSON(int columnIndex) - 選択されたカラムからjsonファイルを取得します。
  • String saveS3MediaFile() - 画像を取得してデータセットに格納し、mediaIdを返します。
  • String saveS3MediaFile(boolean skipIfExists) - 画像を取得し、それをメディアギャラリーに保存し、mediaIdを返す。trueパラメータを使用すると、既にダウンロードされたファイルをスキップすることができます。
  • String saveS3MediaFile(int columnIndex, boolean skipIfExists) - 選択されたカラムから画像を取得し、それをメディアギャラリーに格納します。trueパラメータを使用すると、既にダウンロードされたファイルをスキップすることができます。
  • connectS3(String accountKey, String accountSecret, String region, String bucketName, Closure closure) - S3に接続し、クロージャにプロパティとして "client "を設定します。
  • iterateS3Objects(S3Client client, String bucketName, Closure closure) - S3内のオブジェクトを繰り返し、"client "と "object "をプロパティとしてクロージャに設定します。
  • deleteS3Object(S3Client client, String bucketName, String key)
  • deleteS3Object(S3Client client, String bucketName, S3Object object)