Template for cloud-ready DMS extensions

Template for cloud-ready DMS extensions

Product line

Standard

|

Expert

Operating mode

CLOUD ABO

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 05.11.2019
Machine translated
Updated: 22.04.2022 | Sample template is available as of 6.5.0.16 as built-in code.

With Vertec 6.3 cloud-ready DMS interfaces were introduced. These DMS extensions are of the type “DMS”. An example, which is supplied and maintained by us is the SharePoint Online DMS interface.

There is a sample template that shows what you need to implement to create a workable DMS extension.

  • From Vertec 6.3.0.15 as DmsExampleExtension.py in the Extensions folder in your Vertec installation directory.
  • Starting with Vertec 6.5.0.16, you can Register extension an extension in Vertec in the folder Settings > Extensions and use it as an extension ID DmsExampleExtension.DmsExampleExtension Specify.

A DMS extension can also be used in addition to a normal file system. This is done via a prefix, which you can define yourself – the paths are then e.g. of the format Dropbox:\meine Dateien\....

It is not possible to use several DMS extensions or several document libraries in parallel. One installed DMS extension is supported, which connects to a document library.

Vertec dms extensions and path prefixes

A path prefix can be defined (e.g. MyPrefix:). For this prefix there is a corresponding DMS extension, which handles the file operations of the corresponding paths.

If a prefix changes or if there is no extension for it, an error is thrown during the corresponding operations.

Insert a new prefix

The following steps must be taken to implement a new prefix:

  1. Select a prefix that does not exist yet, e.g. MyNewPrefix:
  2. Implement a new DMSMyNewPrefix.py Extension
  3. Using paths with MyNewPrefix:\... in Vertec

In Vertec, you can start with this prefix to specify the file location:

MyNewPrefix:\customers\DemoInc\invoice337.pdf

Vertec does not attempt to validate the path itself. As soon as it starts with a prefix, all file handling is handled by the corresponding DMS extension.

A valid prefix:

  • contains only uppercase or lowercase letters
  • is at least two symbols long (because, for example, C:\ is a Windows path)
  • is a maximum of 20 symbols
  • is always followed by a colon : and a backslash \

Implement Extensions

class DmsExampleExtension(VertecExtension):

A Vertec DMS extension must define the following class methods (vertecFilePath is always a path of the form SharePoint:\dir1\dir2\file.txt or MyDmsExt:\dir3\dir4\someOtherFile.docx):

def DirectoryExists(self, vertecFilePath):

Should return True or False, depending on whether the specified directory exists.

def DirectoryCreate(self, vertecFilePath):

Should create the specified directory. If not possible, throw an exception with an error message. This method should also create the parent directories.

No return value.

def DirectoryOpen(self, vertecFilePath):

Should open the specified directory in a useful variant, e.g. in a browser view.

No return value.

def DocumentExists(self, vertecFilePath):

Should return True or False, depending on whether the specified document exists.

def DocumentOpen(self, vertecFilePath):

Should open the specified document in a useful variant, e.g. in a browser view.

No return value.

def StoreDocument(self, content, vertecFilePath, activity):

Vertec has created an in-memory file to be saved in the DMS.

  • content: In-memory byte array containing the contents of the file.
  • vertecFilePath: the destination file path
  • aktivitaet: provides a context for carrying metadata.

No return value.