Adding Folder thru Scripts

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
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: Thu Aug 09, 2018 3:46 am

Adding Folder thru Scripts

Post by dyjol » Thu Aug 09, 2018 3:53 am

Hi I'm adding folders thru script but I cannot search the folder. Am I missing something?

But if I create a folder thru the user interface, that folder can be search.

For your assistance.

Thank you very much.

Code: Select all

INSERT INTO `OKM_NODE_BASE`  (`NBS_UUID`,  `NBS_AUTHOR`,  `NBS_CONTEXT`,  `NBS_CREATED`,  `NBS_NAME`,  `NBS_PARENT`,  `NBS_PATH`,  `NDC_SCRIPT_CODE`,  `NDC_SCRIPTING`) VALUES('ae331132-239c-4a42-614b-d1cb0a5f6ff8','okmAdmin','okm_root','2018-08-01:00:00:00','test name','fe10130d-5e37-4729-a676-e5ec75bd978d',null,null,'F');	

Insert into `okm_node_folder` (`NFL_DESCRIPTION`,`NBS_UUID`) VALUES ('AALA, AMIE MAGLINAO-001070101201207', 'ae331132-239c-4a42-614b-d1cb0a5f6ff8');	Insert into `okm_node_user_permission` (`NUP_NODE`,`NUP_PERMISSION`,`NUP_USER`) VALUES ('ae331132-239c-4a42-614b-d1cb0a5f6ff8',15,'okmAdmin');		

Insert into `okm_node_role_permission` (`NRP_NODE`,`NRP_PERMISSION`,`NRP_ROLE`) VALUES ('ae331132-239c-4a42-614b-d1cb0a5f6ff8',15,'ROLE_USER');	

Insert into `okm_activity` (`ACT_ID`,`ACT_ACTION`,`ACT_DATE`,`ACT_ITEM`,`ACT_PARAMS`,`ACT_PATH`) VALUES (5,'CREATE_FOLDER','2018-08-06:00:00:00','ae331132-239c-4a42-614b-d1cb0a5f6ff8',null,'/okm:root/test folder/test name');

Expert Boarder
Expert Boarder
Posts: 102
Joined: Tue Mar 27, 2018 8:00 am

Re: Adding Folder thru Scripts

Post by lnovoa » Fri Aug 10, 2018 11:09 am


when you have inserted from the database, go to administration and do rebuild indexes.
When you create from the interface this does it automatically but from the database, as it is logical it does not do it.

Posts: 10347
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain

Re: Adding Folder thru Scripts

Post by jllort » Sat Aug 11, 2018 10:05 am

Very bad practice creating from the database layer, why?

Your queries should be into a single translation, but I repeat is a bad idea.

Should be better to use scripting, can you explain the reason why must be done in this way? some explanation of the problem you are trying to solve is welcome.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests