Page 1 of 1

SOLVED: Saving script did not work - Error?

Posted: Fri Feb 08, 2019 9:13 am
by OpaHeinz
Hello together

I started to use scripting.
After opening of Administration - scripting, there is still one line code:

Code: Select all

print("Hola, mundo!");
I copied another code snipped in the scripting interface:

Code: Select all

import com.openkm.bean.*;
import com.openkm.util.*;
import com.openkm.api.*;

ContentInfo ci = OKMFolder.getInstance().getContentInfo(null, "/okm:root");
print("Folders: " + ci.getFolders() + "<br/>");
print("Documents: " + ci.getDocuments() + "<br/>");
print("Size: " + FormatUtil.formatSize(ci.getSize()) + "<br/>");
just for testing purposes.
Evaluation works fine

But when I try to click the buttons [save] or [load] then
the entered code get lost and

Code: Select all

print("Hola, mundo!");
is still visible again.
Version 6.3.4

What did I wrong? :(

thank you in advance
rgds Heinz

Re: Saving script did not work - Error?

Posted: Fri Feb 08, 2019 9:43 am
by OpaHeinz
No it is not an error.

I figured out, that I have to enter first a serverpath and a filename into the input field on the left button.
Then saving still works
( I still expected a dialog after click on save button)

Re: SOLVED: Saving script did not work - Error?

Posted: Sat Feb 09, 2019 11:39 am
by jllort
Consider the save button as an experimental feature. When you click on save there's no message and if the file already exists it will be overwritten. A good option from my point of view should be keep scripting stored into OpenKM repository ( some specific folder ) and be able to update, or reuse from there.