Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

Ressources

are linked within the containing article!

Remarks

Excerpt

covering the higher-level client API of the Web-API Gateway, as it is useful for client application developers.

...

bordertrue
Column

Table of Contents

Table of Contents
exclude(Table of Contents|Read on|Another Tutorial|Another Concept Article|Another interesting Tutorial)

There currently are two documented client services:

  • web api gateway - offering a labels layer in order to allow for multi-language applications, offering standard forms used to display object metadata in an appropriate manner - and offering functionality to cope with user settings and associated issues
  • viewer service - offering views for a couple of common file types to be displayed directly in a client application. It is designed allow for easy integration of further viewers in addition to the free ones included already.

The third client service, the user service, is accessed through the web api gateway.

Introduction

Image Removed

The yuuvis core service is considered as a backend for storing billions of objects and being strong in performance as well. To keep this performance all functionalities for a client that offers standard document management functionalities should be served by additional services. The Web-API Gateway Service is beside the User Service and the Viewer Service the main service for the client.

First of all, the service allows configuring the labels of object types and field names that should be shown to the users depending on the language the user has set in the client.

The second feature is to deliver standard forms for each object type and for the situations CREATE and EDIT, and maybe for SEARCH if necessary later on.

There is a Swagger-UI for WEB-API Gateway where the administrator is supported by interfaces to maintain the data manually.

Programmers are getting here the URLs for the endpoints of a PUT or GET call: https://<host>/api-web/swagger-ui.html

Swagger-UI for the WEB-API GatewayImage Removed

Maintenance of localized labels 

The Web-API Gateway offers several endpoints for storing JSON-formatted files that list all labels for the tenant-specific schema as well for the system schema, and for reading all labels for a specific language.

The JSON-format for labels

The following example is a file that lists all system-specific labels for object types and standard attributes. Each technical name begins with a prefix followed colon and the object type name or the field name. The extensions '_label' and '_description' uses the client to display key value.

In the case of object types, the '_description' is used to group them (aka object type group in yuuvis RAD), currently in the smart search control.

In the case of field names, the '_description' is shown below the form field.

Code Block
languagejava
{
  "system:folder_label": "Root folder",
  "system:folder_description" : "01 Across over",
  "system:document_label": "Root document",
  "system:document_description": "01 Across over",
  "system:baseTypeId_label": "Basistype ID",
  "system:objectTypeId_label": "Type",
  "system:secondaryObjectTypeIds_label": "Secundary types",
  "system:parentObjectTypeId_label": "Context type",
  "system:objectId_label": "Object ID",
  "system:parentId_label": "Context ID",
  "system:createdBy_label": "Creator",
  "system:creationDate_label": "Created",
  "system:lastModifiedBy_label": "Editor",
  "system:lastModificationDate_label": "Edited",
  "system:versionNumber_label": "Version",
  "system:tenant_label": "Tenant",
  "system:traceId_label": "Trace ID",
  "system:contentStreamLength_label": "File size",
  "system:contentStreamMimeType_label": "Mimetype",
  "system:contentStreamFileName_label": "Filename",
  "system:contentStreamId_label": "Content ID",
  "system:contentStreamRange_label": "Content range",
  "system:contentStreamRepositoryId_label": "Content Stream Repository",
  "system:digest_label": "Digest",
  "system:archivePath_label": "Archive path",
  "system:rmExpirationDate_label": "Retention date",
  "system:rmStartOfRetention_label": "Retention start",
  "system:rmDestructionDate_label": "Destruction date",
  "system:rmDestructionRetention_label": "Retention",
  "system:parentVersionNumber_label": "Context version",
  "appClient:minidoc_label": "Smallest Document",
  "appClient:minidoc_description": "01 Across over",
  "appClient:clienttitle_label": "Title",
  "appClient:clientdescription_label": "Description",
  "appClient:titledescription_label": "Title & Description"
}

Hint: The key-value pairs "appClient:clienttitle_label" and "appClient:clientdescription_label" are used in the header of the object details and as rows in all result lists. The technical names are configured in the appClient-Schema (see below). The secondary object type 'clientdefaults' must be referenced in each object type that should be handled in the client.

Convention: In the case of object types the _description is currently used for a grouping in the object type selection dialog that is offered for the smart search control as well as in the create object state. This way of configuring a grouping will be replaced by another configuration. We recommend to use digits in front of the object type group as can be seen here:

Image Removed

This is the schema for appClient with the definition of clienttitle and clientdescription:

Code Block
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<schema xmlns="http://optimal-systems.org/ns/dmscloud/schema/v5.0/">
	<propertyStringDefinition>
        <id>clienttitle</id>
        <propertyType>string</propertyType>
        <cardinality>single</cardinality>
        <required>true</required>
        <maxLength>200</maxLength>
    </propertyStringDefinition>
    <propertyStringDefinition>
		<id>clientdescription</id>
		<propertyType>string</propertyType>
		<cardinality>single</cardinality>
		<required>true</required>
		<maxLength>200</maxLength>
	</propertyStringDefinition>
	<typeDocumentDefinition>
		<id>minidoc</id>
		<baseId>system:document</baseId>
		<contentStreamAllowed>required</contentStreamAllowed>
		<secondaryObjectTypeId>clientdefaults</secondaryObjectTypeId>
	</typeDocumentDefinition>
	<typeSecondaryDefinition>
		<id>clientdefaults</id>
		<description>contains title and description fields mainly for mixed resultlist and object header</description>
		<baseId>system:secondary</baseId>
		<propertyReference>clienttitle</propertyReference>
		<propertyReference>clientdescription</propertyReference>
	</typeSecondaryDefinition>
</schema>

Save tenant-specific labels

Open the admin-controller and then the click onto the URL ../admin/resources/text/{locale} to open the maintenance form.

Copy the JSON-formatted data into the input field resource and type the DIN value for the corresponding language, e.g. de for Deutsch, and en for English.

Save the data with a click onto 'Try it out'. Observe whether the data could be saved as described in the response message area.

Save system-specific labels

Open the system-controller and then the click onto the URL ../system/resources/text/{locale} to open the maintenance form.

Copy the JSON-formatted data into the input field resource and type the DIN value for the corresponding language, e.g. de for Deutsch, and en for English.

Save the data with a click onto 'Try it out'. Observe whether the data could be saved as described in the response message area.

Read all labels

Open the resource-controller and then the click onto the URL  ../resources/textto open the maintenance form.

Type the DIN value for the corresponding language, e.g. de for Deutsch, and en for English.

Click onto 'Try it out' and see all key-value pairs for labels and descriptions in Response Body.

Maintenance of forms

Beginning with version Summer 2020 (aka 2.2) it is possible to store custom form in JSON-format.

The following code shows a form example:

Code Block
{
    "name": "appPersonalfile:pfpersonalfile",
    "situation": "EDIT",
    "script": "scope.model['appPersonalfile:pfname'].onchange=writetitle; scope.model['appPersonalfile:pffirstname'].onchange=writetitle; scope.model['appPersonalfile:pfclass'].onchange=writedescription; function writetitle(){scope.model['appClient:clienttitle'].value = scope.model['appPersonalfile:pfname'].value + ', ' + scope.model['appPersonalfile:pffirstname'].value;}; function writedescription(){scope.model['appClient:clientdescription'].value = scope.model['appPersonalfile:pfclass'].value}",
    "layout": {
        "align": "column"
    },
    "elements": [
        {
            "type": "o2mGroup",
            "name": "core",
            "layout": {
                "align": "row"
            },
            "elements": [
                {
                    "type": "o2mGroupStack",
                    "layout": {
                        "align": "row"
                    },
                    "elements": [
                        {
                            "type": "o2mGroup", 
                            "name": "appPersonalfile:data", 
                            "layout": {
                                "align": "column"
                            },
                            "elements": [
                                {
                                    "name": "appPersonalfile:pfname",
                                },
                                {
                                    "name": "appPersonalfile:pffirstname",
                                },
                                {
                                    "name": "appPersonalfile:pfclass",
                                },
                                {
                                    "name": "appPersonalfile:pfentrydate",
                                }
                            ]
                        },
                        {
                            "type": "o2mGroup",
                            "name": "appClient:titledescription",
                            "layout": {
                                "align": "column"
                            },
                            "elements": [
                                {
                                    "readonly": true,
                                    "name": "appClient:clienttitle",
                                },
                                {
                                    "readonly": true,
                                    "name": "appClient:clientdescription",
                                }
                            ]
                        }
                    ]
                }                    
            ]
        }
    ]
}

This is the result the user can observe in the client. The names (see in the code above) are exchanged by the Web-API Gateway with respect to the language the user has set for the client.

Image RemovedImage Removed

In the future, a designer will allow modeling the forms in a graphical manner.

Save tenant-specific forms

Open the admin-controller and then the click onto the URL ../admin/form/{type}?situation={situation} to open the maintenance form.

Copy the JSON-formatted data into the input field 'form', write the object type name (e.g. tenKolibri:personalfile) into field type, and type CREATE or EDIT into the field situation.

Save the data with a click onto 'Try it out'. Observe whether the data could be saved as described in the response message area. 

The form will be vaildated.

Get tenant-specific forms

Open the admin-controller and then the click onto the URL ../admin/form/{type}?situation={situation} to open the maintenance form.

Copy the JSON-formatted data into the input field 'form', write the object type name (e.g. tenKolibri:personalfile) into field type, and type CREATE or EDIT into the field situation.

Get the raw data without enriched properties with a click onto 'Try it out'. 

Save system- and app-specific forms

Open the system-controller and then the click onto the URL ../system/form/{type}?situation={situation} to open the maintenance form.

Copy the JSON-formatted data into the input field 'form', write the object type name (e.g. appPersonalfile:personalfile) into field type, and type CREATE or EDIT into the field situation.

Save the data with a click onto 'Try it out'. Observe whether the data could be saved as described in the response message area.

The form will be vaildated.

Get system-and app-specific forms

Open the admin-controller and then the click onto the URL ../system/form/{type}?situation={situation} to open the maintenance form.

Copy the JSON-formatted data into the input field 'form', write the object type name (e.g. appPersonalfile:personalfile) into field type, and type CREATE or EDIT into the field situation.

Get the raw data without enriched properties with a click onto 'Try it out'. 

Read forms

Open the dms-controller and then the click onto the URL  ../dms/form/{type}?situation={situation}to open the maintenance form.

Type the DIN value for the corresponding acceptance-language, e.g. de for Deutsch, and en for English, write the object type name (e.g. appPersonalfile:personalfile) into field type, and type CREATE or EDIT into the field situation.

Click onto 'Try it out' and see all key-value pairs for labels and descriptions in Response Body.

Introduction

Main part(s)

Subsection(s)

Code Block
languagejava
titleFor Loop in Java (brief, concise title)
linenumberstrue
for (int i = 0; i < 10; i++)
{
	System.out.println("Hello World " + i);
}

Summary

...

iconfalse

Read on

...

Column
width25%

Another Tutorial

Brief summary of the article linked.

Column
width25%

Another Concept Article

Brief summary of the article linked.

...

width25%

Another interesting Tutorial

...


Page Properties
hiddentrue
idDONE

Product Version
Report Notepublished, language check outstanding
AssigneeKolibri

Resources & Remarks

https://wiki.optimal-systems.de/display/devkolibri/yuuvis+Momentum+-+Flex+Viewer+Service

There is description for extending the viewer service mentioned to be existing in git (ask Jürgen) - however, the link is missing. Get that documentation and cast it into a tutorial article linked to this viewer service concept article!

The link pointing to the "freely available" viewer components, also meant to be in git, is also inoperable or not accessible to anyone outside of team kolibri... → grab and integrate that info.

Supported filetypes look nicer when in tables:

Audio

Used component: By default audio files are natively played by the Browser with HTML5 Audio. (that is a subject of the HTML5 Audio specification).

Default component: Used component.
Mimetype: mpeg, mp3, ogg, wav
All played files are streamed to prevent unnecessary data downloads. The autoplay is set to false.

The API description lacks information...

These sentences are somewhat confusing and should be checked with the PO:
Additionaly, non mandatory parameters are provided (corresponding to the client settings)

  • bla
  • bla

Additionally provided parameters will be passed to the custom viewer. (I believe this should read: any further parameters provided will be passed to the custom viewer)


Place links for further reading at the bottom (api-gateway, functional extension - client side, architecture, a still-to-be-written customization tutorial)

A tutorial, describing how to integrate the viewer service into an Angular application ist missing.


Modification History

NameDateProduct VersionAction
Antje08 FEB 20212.4New page properties macro.
Antje17 FEB 20222022 Springdiacritics in search terms in pdf preview


Introduction

The yuuvis® Momentum viewer service offers to display several common file types directly within a yuuvis® Momentum client application. It serves within the yuuvis® Momentum reference client and can readily be integrated in a custom client. It is designed allow for easy integration of further viewers in addition to the free ones included already.

This article is intended for administrators who want to know about the supported file types so they can decide whether to let the viewer service be extended for not supported ones.


Section
bordertrue


Column

Table of Contents

Table of Contents
exclude(Table of Contents|Read on|Another Tutorial|Another Concept Article|Another interesting Tutorial)


Supported Types

All of the following formats are supported by the viewer service. Some others like Microsoft Office files including MSG-formated e-mails are supported by the rendition service provided that it is installed and running.

For unsupported file types, the viewer service sends a notification and a download link, allowing for the content to be downloaded and viewed by an external application.

Audio

Used component: By default, audio files are natively played by the browser with HTML5 audio (that is a subject of the HTML5 Audio specification).

Default component: Used component.

Mimetype: mpeg, mp3, ogg, wav

All played files are streamed to prevent unnecessary data downloads. The autoplay is set to false.

Image

Used component: Custom Angular Application with angular-x-image-viewer plug-in.

Default component: By default, the supported mimeTypes are rendered in the standard HTML img tag.

Mimetypes: jpeg, gif, png, svg, bmp, ico

Not supported file types are by default offered as a download.

Image (tiff/tif)

Used component: Native image rendering as base64 encoded.

Default component: By default, the supported mimeTypes are rendered in the standard HTML img tag.

Mimetypes: tiff, tif

JSON

Used component: Custom Angular application with ngx-json-viewer plugin.

Default component: Used component.

Mimetype: application/json 

E-Mails

Used component: eml files are parsed by mailparser, msg files are parsed by custom parser inspired by (msgreader)

Default component: Used component.

Mimetypes : message/rfc822 (eml), beginning with 2021 Winter Alpha2: application/vnd.ms-outlook (msg)

Markdown (text/markdown)

Used component: Custom React application with markdown-to-jsx plug-in. / Custom Angular application withshowdown plug-in.

Default component: Used component.

Mimetypesx-web-markdownmarkdown

Open Document Format

The ODFs are currently resolved as application/zip. The viewer analyses all such mime types additionally and reacts in this case on the file extension that must be provided.

Used component: Files are parsed and rendered with https://webodf.org/

Default component: Used component.

File extension: odt, ods, odp

Mimetypes: application/zip (as resolved by yuuvis core service)

Text (text/plain)

Used component: By default, plain text is natively rendered by the Browser.

Default component: Used component.

Mimetypesplain

XML(text/xml)

Used component: By default xml is natively rendered as text by the Browser.

Default component: Used component.

Mimetypes: xml

PDF

Used component: PDF.js which is a Mozilla project.

Default component: Used component.

Mimetypes: application/pdf

The ranging support provided by PDF.js is supported by the Web-API Gateway as well.


Note
titleSearch Term Highlighting

The full-text search provided by yuuvis® Momentum is insensitive to diacritics whereas the VIEWER service's PDF preview is sensitive to diacritics. Thus, the found search term is not highlighted in the preview if it differs from the entered search term in diacritics.

Video

Used component:  By default video files are natively played by the browser with HTML5 Video (that is a subject of the HTML5 Video specification).

Default component: Used component.

Mimetypes: mpeg, mp4, ogg, webm

All played files are streamed to prevent unnecessary data downloads. The autoplay is set to false.

Zip

Used component: Native string rendering

Default component: Used component.

Mimetype: x-zip-compressed, zip

The content of the zip container is read and the name and paths are printed out.

Customizing

The viewer service can be extended as described in this section.

Localization

The viewer service offers a few strings with information for your users. You can change these or add some more language strings by setting them up in the translation section of the plugin file that can be uploaded for use in the client.

Code Block
titleSetting the localization strings in the plugin file of the client
{ 
  "translations": {
    "en": {
       "yuv.viewer.not.authorized": "Not authorized to preview file.",
       "yuv.viewer.not.found": "File not found.",
       "yuv.viewer.not.supported": "Format not supported.",
       "yuv.viewer.not.supported.download.content": "Unable to display format. You can click this link to download the file."
    },
    "de": {
       "yuv.viewer.not.authorized": "Fehlende Authorisierung zur Anzeige der Datei.",
       "yuv.viewer.not.found": "Datei nicht gefunden.",
       "yuv.viewer.not.supported": "Dieses Format ist nicht unterstützt.",
       "yuv.viewer.not.supported.download.content": "Dieses Format kann nicht angezeigt werden. Ein Klick auf den Link lädt die Datei herunter."
    }
  }
}

For more information about the plugin capabilities see this documentation: Extending Clients with Plug-ins

Extending the Viewer Service

Note

Please note that this feature is currently for internal use only!

For a description about how to extend the viewer service, see the readme here: GitLab

Outlook: We are working on a new customizing concept that allows us to extend the viewer service with additional components with building and deploying the viewer service itself.

The Viewer Service API

For the viewer to process a request, a path pointing to the file to be displayed must be accessible. The mimeType or size may be omitted here if provided in the Request Header.

Code Block
languagejava
titlepath parameters
linenumberstrue
URL/?path={pathToTheFile}&mimeType={mimeType}&size={fileSize}
  • path: the direct path from where the file can be loaded (required)
  • mimeType: the file's mimeType (If not provided, the service tries to get it from request headers. If also not available there, an error page is shown.)
  • fileSize: the size of the file (If not provided, the service tries to get it from request headers. If also not available there, an error page is shown.)

Custom Viewer Configuration

The viewer service can be extended by adding a few lines to its configuration.

Code Block
languagejava
titleextending the configuration
linenumberstrue
[
  {
    "mimeType": "text/x-web-markdown",
    "fileExtension": ["md"]
    "viewer": "{pathtoapplicationindex.html}?path=${path}#locale=${locale}&direction=${direction}&theme=${theme}&accentColor=${accentColor}"
  }
]
  • mimeType may also be a string Array, containing multiple mime types
  • file extension is not mandatory. Provide only if mimeType is ambiguous.


Additionally, non-mandatory parameters are provided (corresponding to the client settings)

  • darkMode: boolean = sets class dark to the body (default = false).
  • direction: string = sets the document direction to the body (default = „LTR“).
  • accentColor: string = sets the accent color as css variable to the html tag (default = „“).
  • local: string = sets the document locale to the html tag (default = „en-US“).
  • fileExtension: string =  if mimeType is ambiguous, provides a more clear file specification.

Additionally, the provided parameters will be passed to the custom viewer.

Summary

You were provided with an overview of the file types supported by the viewer service and its concept of extensibility.