• Blocking Mime types folder wise

  • He we will discuss about how to make customization and improvement to the OpenKM source code.
He we will discuss about how to make customization and improvement to the OpenKM source code.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #54480  by shihab
 
Hi,

I have a query, I am trying to customize openkm. My aim is to block mime types by folder wise. For example a folder named "folder1" should allow only .docx files and folder "folder2" allow only .pdf files, is there any solution to achieve this scenario.
 #54510  by jllort
 
You must create an Rule with and automation action in PRE at the event CREATE_DOCUMENT -> when uploading the document in PRE ( stage where the document still is not created ) can check the document name and if the extension is not allowed raise an exception.

I share a link to create your action plugin https://docs.openkm.com/kcenter/view/ok ... ction.html
 #54513  by shihab
 
Dear Jllort,

Thanks for the reply,

I gone through the link It is working fine( put the jar file in Tomcat x.y /plugin folder and restart the openkm service)

In my case I think to create a new table AS "OKM_BLOCKED_MIMETYPES" (screen shot attached) with two columns 'document_path' and 'document_type'. When user upload a document compare the path and mimetype with my table values , found any match through exception.

1. document_path -> will capture the path of the directory
2. document_type -> the blocked mime types in to the folder.

Is there any way to debug the code in development server,

In the screen shot I tried with an example of simple folder creation on our development server as a simple java project.

Getting error as shown in the screen shot while create an object of OKMFolder class.
Attachments
OKM_BLOCKED_MIMETYPES.jpg
OKM_BLOCKED_MIMETYPES.jpg (52.54 KiB) Viewed 8248 times
Debug.jpg
Debug.jpg (134.98 KiB) Viewed 8248 times
 #54517  by shihab
 
Hi ,

This below mentioned link is not working, is there any video link available for linux.

Tomcat developing: How do I configure Tomcat to support remote debugging?

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.