Page 1 of 1

Adding Folder thru Scripts

PostPosted:Thu Aug 09, 2018 3:53 am
by dyjol
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');

Re: Adding Folder thru Scripts

PostPosted:Fri Aug 10, 2018 11:09 am
by lnovoa
Hi!,

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.

Re: Adding Folder thru Scripts

PostPosted:Sat Aug 11, 2018 10:05 am
by jllort
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.