SOLVED: How to move a imported file in aspecific folder based on metadata

OpenKM has many interesting features, but requires some configuration process to show its full potential.
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
OpaHeinz
Junior Boarder
Junior Boarder
Posts: 31
Joined: Tue Jan 29, 2019 11:31 am

SOLVED: How to move a imported file in aspecific folder based on metadata

Post by OpaHeinz » Wed Feb 06, 2019 4:17 pm

Just to explain situation

I imported a lot of files into a OneKM-folder called "import"
after import I assign each file its metadata.

I wish that a nightly(crontab) script scans the import folder and based on the assigned meta-data moves the imported files into its own/special "taxonomy folder"
If there is no metadata assigned, then the file should still stay in the "import"-folder
Any idea/ experience for such a requirement would be wonderfull!

Thank you in advance
rgds
Heinz
Last edited by OpaHeinz on Thu Feb 07, 2019 4:43 pm, edited 1 time in total.

dferguson
Expert Boarder
Expert Boarder
Posts: 120
Joined: Thu May 18, 2017 12:48 pm

Re: How to move a imported file in aspecific folder based on metadata

Post by dferguson » Thu Feb 07, 2019 3:11 pm

You write a SQL query to select all items in the "import" folder based on metadata;

Code: Select all

select NBS_UUID from OKM_NODE_BASE inner join OKM_NODE_PROPERTY on OKM_NODE_BASE.NBS_UUID = OKM_NODE_PROPERTY.NPG_NODE 
where OKM_NODE_BASE.NBS_PARENT = 'parent folder UUID' and OKM_NODE_PROPERTY.NPG_GROUP = 'okp:your.metadata'
Then you can do an update to change the NBS.PARENT to the new parent folder UUID.
Some documentation on the database...
https://docs.openkm.com/kcenter/view/ok ... ption.html

However, why don't you do an automation that validates based on metadata and then moves after metadata is applied?

https://docs.openkm.com/kcenter/view/ok ... ation.html

OpaHeinz
Junior Boarder
Junior Boarder
Posts: 31
Joined: Tue Jan 29, 2019 11:31 am

Re: How to move a imported file in aspecific folder based on metadata

Post by OpaHeinz » Thu Feb 07, 2019 4:42 pm

Hello dferguson

Super!
thank you very much. That is still what I searched for.
This will still help to find my solution!
rds OpaHeinz

Post Reply