# Generic document viewer

The Generic Document Viewer can display documents from any database, it supports most document formats and image formats.

### Basic data

**Internal name** - unique string to identify this portlet.\
**Portlet title** - title of the portlet, does not have to be unique.\
&#x20;

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-u3__fXjJMNAYXWzZ2%2F-M-u4hRRaZMX1azpeUr7%2Fhelp_root_clients_portal_portlets_GenericDocumentViewer_Basic.png?alt=media\&token=b09251ed-1808-43f2-b3c4-6f25ffddde9c)

### Auto refresh

&#x20;Auto Refresh enables the portlet to refresh the data every SS:second.&#x20;

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-u3__fXjJMNAYXWzZ2%2F-M-u4kZ7CDSZi6afo7Ut%2Fhelp_root_clients_portal_portlets_GenericDocumentViewer_autorefresh.png?alt=media\&token=4406cb2f-14a1-4aa3-bcee-3b71e20acd34)

### Query configuration

Query Configuration enables the portlet to execute specified queries towards the chosen database connector.

* **Database connector** - Select which connector that the query will execute against.
* **Your query** - Text field where queries can be written
* **Data column name** - Select in which column the document data is stored.
* **Mime type column name** - Select in which column the mime type of the document is stored.
* **File name column** -Instead of mime type column name, choose this for formats such as ".jpg, .gif, .txt".
* **Default mime type** - Also an alternative if all documents share the same mime type one can define it here.

**Mime types are defined in the following format:** e.g *"application/pdf"*&#x20;

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-u3__fXjJMNAYXWzZ2%2F-M-u4nKSJ5wokHJ_sY8t%2Fhelp_root_clients_portal_portlets_GenericDocumentViewer_query.png?alt=media\&token=e175030b-3587-4763-83bd-db283a2982cb)

### Commands

Commands enables the portlet to listen for events sent by other portlets to execute specified commands. **The portlet will listen to the following commands**

* onRefresh
* onRowSelected
* onGenericTreeNodeSelection

**The portlet will listen to the following portlets** *Specify which portlet the commands above will trigger from*. The portlets that appears will be shown with their unique internal name.&#x20;

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-u3__fXjJMNAYXWzZ2%2F-M-u4qIgBw2aw46xkIGw%2Fhelp_root_clients_portal_portlets_GenericDocumentViewer_commands.png?alt=media\&token=eafa2c9e-6cad-40ef-9592-3bee8000ad4d)
