Páginas filhas
  • Image Repository in the database

How to set the image repository in the database, and how to differentiate the repository by table

Product:

Microsiga Protheus

Versions:

11 and 12

Step by step:

Image repository in the database:

There is a configuration that allows the classification of images by aliases or all tables and allows the parameterization of the type of storage (Database or SIGAADV.BMD).
With the link of an image with a Protheus table, it is possible to display the image only for Protheus entries that use the table.
When using many images, it is best to use the Database storage option to find images faster.
When the user is registering a product and is adding the photo of this product, the repository is presented with the images related to the SB1 table, making the selection of the related image easier. Therefore, when registering a user, the images will not be displayed because they are linked to SB1. What defines it is the way the parameter MV_REPOSIT is configured, as described below.

The parameter will only serve to segment the use of the images in each module.

MV_REPOSIT = 1 - Generic treatment, that is, regardless of from which module the user has accessed the Product Registration, etc., and added the image, it will also appear in any module that has the same access routine.

MV_REPOSIT = 2 - Individual treatment, that is, if the user has included an image in the Product Register through the Inventory/Cost Module, the image will only be displayed in the Inventory/Cost Module.


For the images to be handled directly in the Database, in the PROTHEUS_REPOSIT table, create the key below within the Environment Session of the appserver.ini file of the Application Server that the user accesses:

[Ambiente]
SourcePath=C:\TOTVS 12\Microsiga\protheus\apo\
RootPath=C:\TOTVS 12\Microsiga\protheus_data
StartPath=\system\
...
RepositInDataBase=1

With this key, the treatment of the images will happen in the Database. However, if you already have an Image Repository, you must run the import routine to transfer the images to the database. 

To import, once you include the line in the appserver.ini file, follow the steps below:

1. Access Configurator > Environment > Records > Image Repository

2. Click Import


3. Select the SIGAADV.BMD file where your images are and click Confirm


4. Images will be imported from your file to the database

Images larger than 1MB will not be uploaded.

Files related to image repository:

• *.BMI: File where the repository index is stored.
• *.BMR: File where the Memo of the repository is stored.
• *.BMD: File itself (as if it were a dbf).

Important:

- When the MV_REPOSIT parameter is enabled, the SIGAADV files remain intact.

- When you move the image repository from the local files to the database, the images remain in the SIGAADV.BMD file. The files are only copied to the database when using the Import routine, as explained earlier.

- The images are saved in the PROTHEUS_REPOSIT table in the Database.