diff --git a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod
index ef9204af00dbc0ea99833c35901e3c1ec61ad178..93d6528d6c0a10d8be8120d6b5928436f71899a7 100644
--- a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod
+++ b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod
@@ -18,8 +18,8 @@
       <title>Description</title>
     </entityField>
     <entityField>
-      <name>DOCUMENTMANAGEMENTID</name>
-      <valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documentmanagementid/valueProcess.js</valueProcess>
+      <name>DOCUMENTTEMPLATEID</name>
+      <valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documenttemplateid/valueProcess.js</valueProcess>
     </entityField>
     <entityField>
       <name>DATE_NEW</name>
@@ -52,6 +52,29 @@
       <name>BINDATA</name>
       <contentType>FILE</contentType>
     </entityField>
+    <entityConsumer>
+      <name>Documents</name>
+      <fieldType>DEPENDENCY_OUT</fieldType>
+      <dependency>
+        <name>dependency</name>
+        <entityName>Document_entity</entityName>
+        <fieldName>Documents</fieldName>
+      </dependency>
+      <children>
+        <entityParameter>
+          <name>AssignmentTable_param</name>
+          <valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js</valueProcess>
+        </entityParameter>
+        <entityParameter>
+          <name>AssignmentRowId_param</name>
+          <valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js</valueProcess>
+        </entityParameter>
+        <entityParameter>
+          <name>AssignmentName_param</name>
+          <valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documents/children/assignmentname_param/valueProcess.js</valueProcess>
+        </entityParameter>
+      </children>
+    </entityConsumer>
   </entityFields>
   <recordContainers>
     <dbRecordContainer>
@@ -80,10 +103,6 @@
           <name>DESCRIPTION.value</name>
           <recordfield>DOCUMENTTEMPLATE.DESCRIPTION</recordfield>
         </dbRecordFieldMapping>
-        <dbRecordFieldMapping>
-          <name>DOCUMENTMANAGEMENTID.value</name>
-          <recordfield>DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID</recordfield>
-        </dbRecordFieldMapping>
         <dbRecordFieldMapping>
           <name>LANGUAGE_documentmanagement.value</name>
           <recordfield>DOCUMENTTEMPLATE.LANGUAGE</recordfield>
@@ -104,6 +123,10 @@
           <name>USER_NEW.value</name>
           <recordfield>DOCUMENTTEMPLATE.USER_NEW</recordfield>
         </dbRecordFieldMapping>
+        <dbRecordFieldMapping>
+          <name>DOCUMENTTEMPLATEID.value</name>
+          <recordfield>DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID</recordfield>
+        </dbRecordFieldMapping>
       </recordFieldMappings>
     </dbRecordContainer>
   </recordContainers>
diff --git a/entity/DocumentTemplate_entity/entityfields/documents/children/assignmentname_param/valueProcess.js b/entity/DocumentTemplate_entity/entityfields/documents/children/assignmentname_param/valueProcess.js
new file mode 100644
index 0000000000000000000000000000000000000000..6429dbcc1ac80330962ba43cb085a71d46871c52
--- /dev/null
+++ b/entity/DocumentTemplate_entity/entityfields/documents/children/assignmentname_param/valueProcess.js
@@ -0,0 +1,4 @@
+import("system.vars");
+import("system.result");
+
+result.string("DOCUMENT");
\ No newline at end of file
diff --git a/entity/DocumentTemplate_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js b/entity/DocumentTemplate_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js
new file mode 100644
index 0000000000000000000000000000000000000000..8664993b9e558e2315aca8e89fb11698b5a6b2bf
--- /dev/null
+++ b/entity/DocumentTemplate_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js
@@ -0,0 +1,4 @@
+import("system.vars");
+import("system.result");
+
+result.string(vars.get("$field.DOCUMENTTEMPLATEID"));
\ No newline at end of file
diff --git a/entity/DocumentTemplate_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js b/entity/DocumentTemplate_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js
new file mode 100644
index 0000000000000000000000000000000000000000..4fccd6bbf06c0613f12b6dd668116698fada04e4
--- /dev/null
+++ b/entity/DocumentTemplate_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js
@@ -0,0 +1,2 @@
+import("system.result");
+result.string("DOCUMENTTEMPLATE");
\ No newline at end of file
diff --git a/entity/DocumentTemplate_entity/entityfields/documentmanagementid/valueProcess.js b/entity/DocumentTemplate_entity/entityfields/documenttemplateid/valueProcess.js
similarity index 100%
rename from entity/DocumentTemplate_entity/entityfields/documentmanagementid/valueProcess.js
rename to entity/DocumentTemplate_entity/entityfields/documenttemplateid/valueProcess.js
diff --git a/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js b/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js
index 3fd4cd15c835cf2c322f93d5690fb55e116d86a4..022971321398bf77b98f8fee04597f5b36b13377 100644
--- a/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js
+++ b/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js
@@ -1,7 +1,10 @@
 import("system.vars");
+import("system.db");
 import("Document_lib");
 
 if(vars.get("$field.BINDATA") != "")
 {
-    DocumentUtil.writeDocumentToDrive(vars.get("$field.BINDATA"), vars.get("$field.DOCUMENTMANAGEMENTID"));
+    DocumentUtil.uploadDocument("DOCUMENTTEMPLATE", "DOCUMENT", vars.get("$field.DOCUMENTTEMPLATEID"), "", 
+                                vars.get("$field.BINDATA"), vars.get("$field.DOCUMENTTEMPLATEID"), 
+                                "", "", "_____SYSTEMALIAS", true);
 }
\ No newline at end of file
diff --git a/entity/Document_entity/Document_entity.aod b/entity/Document_entity/Document_entity.aod
index 4bb45b3cd473c23a3cc221322868635832677022..bba4e47a4e5e6bf77cebf034adf42e7d7ec94fc0 100644
--- a/entity/Document_entity/Document_entity.aod
+++ b/entity/Document_entity/Document_entity.aod
@@ -186,6 +186,12 @@
           <fieldName>Documents</fieldName>
           <isConsumer v="false" />
         </entityDependency>
+        <entityDependency>
+          <name>51e40901-0132-45d3-b87d-69161cbc9fbd</name>
+          <entityName>DocumentTemplate_entity</entityName>
+          <fieldName>Documents</fieldName>
+          <isConsumer v="false" />
+        </entityDependency>
       </dependencies>
       <children>
         <entityParameter>
diff --git a/entity/Document_entity/recordcontainers/jdito/onInsert.js b/entity/Document_entity/recordcontainers/jdito/onInsert.js
index 2654a171563317095fb786d8cb233d3853431055..f1e24138159a841475cb7bda77336f88531f6d4d 100644
--- a/entity/Document_entity/recordcontainers/jdito/onInsert.js
+++ b/entity/Document_entity/recordcontainers/jdito/onInsert.js
@@ -5,17 +5,17 @@ import("Document_lib");
 var assignmentTable = vars.get("$param.AssignmentTable_param");
 var assignmentName = vars.get("$param.AssignmentName_param");
 var assignmentRowId = vars.get("$param.AssignmentRowId_param");
-var bindata = DocumentUtil.getBindataFromUpload(vars.get("$field.BINDATA_UPLOAD"));
+var uploadValue = vars.get("$field.BINDATA_UPLOAD");
 var filename = vars.get("$field.NAME");
 var description = vars.get("$field.DESCRIPTION");
 var alias = db.getCurrentAlias();
 
-if(bindata != '' && filename != ''){
+if(uploadValue != '' && filename != ''){
     var keyword = '';
     if(vars.get("$field.IS_MAIN_DOCUMENT") == '1') {
         keyword = 'MAINDOCUMENT';
     }
-    
-    db.insertBinary(assignmentTable, assignmentName, assignmentRowId, "", 
-        bindata, filename, description, keyword, alias);
 }
+
+DocumentUtil.uploadDocument(assignmentTable, assignmentName, assignmentRowId, "", 
+                            uploadValue, filename, description, keyword, alias, false);
\ No newline at end of file
diff --git a/neonContext/DocumentTemplate/DocumentTemplate.aod b/neonContext/DocumentTemplate/DocumentTemplate.aod
index f081dc77e90ac0f3a299766c92c6c1e9f91a4472..55b03cf8553583fbec08a2805dca2e93e4d92f51 100644
--- a/neonContext/DocumentTemplate/DocumentTemplate.aod
+++ b/neonContext/DocumentTemplate/DocumentTemplate.aod
@@ -6,6 +6,7 @@
   <icon>VAADIN:FILE_FONT</icon>
   <filterview>DocumentTemplateFilter_view</filterview>
   <editview>DocumentTemplateEdit_view</editview>
+  <preview>DocumentTemplatePreview_view</preview>
   <entity>DocumentTemplate_entity</entity>
   <references>
     <neonViewReference>
@@ -16,5 +17,9 @@
       <name>d49f9ade-9f33-4996-8482-d2520f6cb8db</name>
       <view>DocumentTemplateEdit_view</view>
     </neonViewReference>
+    <neonViewReference>
+      <name>c67fc6df-2511-4ddf-8638-cec8591fc9dc</name>
+      <view>DocumentTemplatePreview_view</view>
+    </neonViewReference>
   </references>
 </neonContext>
diff --git a/neonView/DocumentList_view/DocumentList_view.aod b/neonView/DocumentList_view/DocumentList_view.aod
index d82e31df5478a41698efbbabce79fd9e0c184491..f30173a18cacbf304378700c3dbc32edc67bdaa0 100644
--- a/neonView/DocumentList_view/DocumentList_view.aod
+++ b/neonView/DocumentList_view/DocumentList_view.aod
@@ -16,6 +16,7 @@
       <iconField>ICON</iconField>
       <entryAction>downloadSingleFileAction</entryAction>
       <entityField>#ENTITY</entityField>
+      <title>Documents</title>
     </actionListViewTemplate>
   </children>
 </neonView>
diff --git a/neonView/DocumentTemplatePreview_view/DocumentTemplatePreview_view.aod b/neonView/DocumentTemplatePreview_view/DocumentTemplatePreview_view.aod
new file mode 100644
index 0000000000000000000000000000000000000000..f26d857567cdc5e7064b5aae6d0f8f51a200c9e0
--- /dev/null
+++ b/neonView/DocumentTemplatePreview_view/DocumentTemplatePreview_view.aod
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
+  <name>DocumentTemplatePreview_view</name>
+  <majorModelMode>DISTRIBUTED</majorModelMode>
+  <layout>
+    <boxLayout>
+      <name>layout</name>
+    </boxLayout>
+  </layout>
+  <children>
+    <cardViewTemplate>
+      <name>Card</name>
+      <titleField>NAME</titleField>
+      <subtitleField>TYPE</subtitleField>
+      <entityField>#ENTITY</entityField>
+      <title>Document Template</title>
+    </cardViewTemplate>
+    <neonViewReference>
+      <name>772fc07a-a25b-48b1-acc4-ffd599e13def</name>
+      <entityField>Documents</entityField>
+      <view>DocumentList_view</view>
+    </neonViewReference>
+  </children>
+</neonView>
diff --git a/process/Document_lib/process.js b/process/Document_lib/process.js
index 63d334b6ae0fd04ebebd4e377a9ccd0a2df0b697..71caa73d96d1d84dcc64313266cb30bdb7444478 100644
--- a/process/Document_lib/process.js
+++ b/process/Document_lib/process.js
@@ -19,6 +19,41 @@ var path = vars.get("$sys.serverhome") + "/binaryfiles/"
 function DocumentUtil(){    
 }
 
+/**
+ * Utility function to write Files. 
+ * Via parameter pWriteBlobToDrive function decides writing file to drive or in database
+ * 
+ * @param {String} pAssignmentTable req Information for ASYS_BINARIES insert
+ * @param {String} pAssignmentName req Information for ASYS_BINARIES insert
+ * @param {String} pAssignmentRowId req Information for ASYS_BINARIES insert
+ * @param {String} pParentId opt Information for ASYS_BINARIES insert
+ * @param {String} pUploadValue req The value of an uploadcomponent contains filename + filedata separated by a semicolon e.g. "file1.jpg;base64data"
+ * @param {String} pFilename req Information for ASYS_BINARIES insert and the filename when write to drive
+ * @param {String} pDescription req Information for ASYS_BINARIES insert
+ * @param {String} pKeyword req Information for ASYS_BINARIES insert
+ * @param {String} pAlias req Information for ASYS_BINARIES insert
+ * @param {String} pWriteBlobToDrive req choose writing file to database or to drive (only the blob-value)
+ * 
+ */
+DocumentUtil.uploadDocument = function(pAssignmentTable, pAssignmentName, pAssignmentRowId, pParentId, pUploadValue, 
+                                       pFilename, pDescription, pKeyword, pAlias, pWriteBlobToDrive)
+{
+    var bindata = "";
+    
+    if(pWriteBlobToDrive != null && pWriteBlobToDrive == true)
+    {
+        DocumentUtil.writeDocumentToDrive(pUploadValue, pFilename);
+    }
+    else
+    {
+        bindata = DocumentUtil.getBindataFromUpload(pUploadValue);
+    }
+    
+    //Allways insert into ASYS_BINARIES for Meta-Data
+    db.insertBinary(pAssignmentTable, pAssignmentName, pAssignmentRowId, pParentId, 
+                    bindata, pFilename, pDescription, pKeyword, pAlias);
+}
+
 /**
  * Utility function to download all selected documents. 
  * Selected documents will be checked with $local.uids. 
@@ -87,15 +122,11 @@ DocumentUtil.deleteCurrentDocument = function() {
  */
 DocumentUtil.writeDocumentToDrive = function(pUploadValue, pFileName) 
 {
-    let filename;
+    let filename = DocumentUtil.getFilenameFromUpload(pUploadValue);
     
     if(pFileName != null && pFileName != "")
     {
-        filename = pFileName;
-    }
-    else
-    {
-        filename = DocumentUtil.getFilenameFromUpload(pUploadValue);
+        filename = pFileName + "." + DocumentUtil.getFileExtensionFromUpload(filename);
     }
     let bindata  = DocumentUtil.getBindataFromUpload(pUploadValue);
     fileIO.storeData(path + filename, bindata, util.DATA_BINARY, false);
@@ -117,6 +148,20 @@ DocumentUtil.getFilenameFromUpload = function(pUploadValue) {
         return '';
 }
 
+/**
+ * Utility function to retrieve the fileextension from an uploadcomponent value.
+ * 
+ * @param {String} pFileName filename with extension, f.e.: myFile.today.txt
+ * @return {String} the filename extension
+ */
+DocumentUtil.getFileExtensionFromUpload = function(pFileName) {
+    var res = pFileName.split(".");
+    if(res.length > 0)
+        return res[res.length-1];
+    else
+        return '';
+}
+
 /**
  * Utility function to retrieve the filedata from an uploadcomponent value.
  * The value of an uploadcomponent contains filename + filedata separated by