Page 1 of 1

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

PostPosted:Wed Feb 06, 2019 4:17 pm
by OpaHeinz
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

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

PostPosted:Thu Feb 07, 2019 3:11 pm
by dferguson
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

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

PostPosted:Thu Feb 07, 2019 4:42 pm
by OpaHeinz
Hello dferguson

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