| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

Functions
Media Persistence

## Functions

TL_DLL bool | createMediaTable (TeDatabase *db, const string &tname)
TL_DLL bool | createLayerMediaTable (TeDatabase *db, int layerId, const string &tname)
TL_DLL bool | insertMedia (TeDatabase *db, const string &tableName, string &fileName, const string &description, const string &type, bool blob=true)
TL_DLL bool | insertMediaObjLayer (TeDatabase *db, TeLayer *layer, const string &objectId, const string &mediaName, const string &mediaTable)
TL_DLL bool | setDefaultMedia (TeDatabase *db, TeLayer *layer, const string &objectId, const string &mediaName, const string &mediaTable)
TL_DLL bool | updateMediaDescription (TeDatabase *db, const string &mediaName, const string &mediaTable, const string &desc)
TL_DLL bool | insertInfo2Blob (TeDatabase *db, int layerId, const string &tableName, const string &fileName, const string &type)
| Inserts a new general information of a layer or database.
TL_DLL string | getInfoBlob2TemporaryFile (TeDatabase *db, int layerId, const string &tableName, string &type)
| read blob and copy to temporary file

## Detailed Description

A set of functions to manipulate the media data persistence model proposed by TerraLib

## Function Documentation

TL_DLL bool createLayerMediaTable | ( | TeDatabase * | db,
|  | int | layerId,
|  | const string & | tname
| ) |  |

Creates a table to store the association between objects of a layer and its multimedia attributes

Parameters:

  db | pointer do a TerraLib database
  layerId | identifier of the layer that will contain the media
  tname | name of the table to be created

TL_DLL bool createMediaTable | ( | TeDatabase * | db,
|  | const string & | tname
| ) |  |

Creates a table to store multimedia documents

Parameters:

  db | pointer do a TerraLib database
  tname | name of the table to be created

TL_DLL string getInfoBlob2TemporaryFile | ( | TeDatabase * | db,
|  | int | layerId,
|  | const string & | tableName,
|  | string & | type
| ) |  |

read blob and copy to temporary file

TL_DLL bool insertInfo2Blob | ( | TeDatabase * | db,
|  | int | layerId,
|  | const string & | tableName,
|  | const string & | fileName,
|  | const string & | type
| ) |  |

Inserts a new general information of a layer or database.

TL_DLL bool insertMedia | ( | TeDatabase * | db,
|  | const string & | tableName,
|  | string & | fileName,
|  | const string & | description,
|  | const string & | type,
|  | bool | blob = `true`
| ) |  |

Inserts a new media file in a database

Parameters:

  db | pointer do a TerraLib database
  tableName | identifier of the layer that will contain the media
  fileName | name of the file that contains the media
  description | description of the media
  type | type of the media
  blob | flag to indicate that the media should be turned to a blob in the databse

TL_DLL bool insertMediaObjLayer | ( | TeDatabase * | db,
|  | TeLayer * | layer,
|  | const string & | objectId,
|  | const string & | mediaName,
|  | const string & | mediaTable
| ) |  |

Associates a media data to an object of a layer

Parameters:

  db | pointer do a TerraLib database
  layer | layer that contains the object
  objectId | identifier of the object
  mediaName | name of the media
  mediaTable | name of the table tha contains the media

TL_DLL bool setDefaultMedia | ( | TeDatabase * | db,
|  | TeLayer * | layer,
|  | const string & | objectId,
|  | const string & | mediaName,
|  | const string & | mediaTable
| ) |  |

Sets a media as a default media of an object of a layer

Parameters:

  db | pointer do a TerraLib database
  layer | layer that contains the object
  objectId | identifier of the object
  mediaName | name of the media
  mediaTable | name of the table tha contains the media

TL_DLL bool updateMediaDescription | ( | TeDatabase * | db,
|  | const string & | mediaName,
|  | const string & | mediaTable,
|  | const string & | desc
| ) |  |

Updates a media description in a database

Parameters:

  db | pointer do a TerraLib database
  mediaName | name of the media
  mediaTable | name of the table tha contains the media
  desc | description of the media

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines