How to find Path of each document using sql

We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
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.
Post Reply
mamad
Expert Boarder
Expert Boarder
Posts: 140
Joined: Mon Jun 25, 2018 5:13 am

How to find Path of each document using sql

Post by mamad »

Hi guys

I want to build a view of documents which contains their name,uuid and path (my database is mysql 5.5)
I don't know why NBS_PATH is empty for each node at OKM_NDOE_BASE table and i think i have to build the path by myself based on the NBS_UUID and NBS_PARENT of each node.

I have written an stored procedure which find the path of each document based on its uuid but as i need a view , i cant use it.
Is there any way to build this view in mysql 5.5 ?

(im using openkm 6.3 community edition)
jllort
Moderator
Moderator
Posts: 11399
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: How to find Path of each document using sql

Post by jllort »

Because store path in the database is a bad idea and by default we have it disabled. If you want to enable you have a configuration parameter named store.node.path ( https://docs.openkm.com/kcenter/view/ok ... eters.html )

Reason why not use it? well imagine you have a folder named /okm:root/test into what you have 50K files and nodes into, that means you have 50K database records what starts with /okm:root/test -> when you rename the folder to /okm:root/test to /okm:root/test_renamed must change 50K nodes, it means not only a database change ( simple update ) it means lucene indexes update and for it the application must follow the 50K records from API and rename it. At the end it means a lot of time for updating all the related nodes because a simple rename
mamad
Expert Boarder
Expert Boarder
Posts: 140
Joined: Mon Jun 25, 2018 5:13 am

Re: How to find Path of each document using sql

Post by mamad »

Your reason convinced me completely !
Thanks a lot
Post Reply