SOLVED: Saving script did not work - Error?

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: 32
Joined: Tue Jan 29, 2019 11:31 am

SOLVED: Saving script did not work - Error?

Post by OpaHeinz » Fri Feb 08, 2019 9:13 am

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
Last edited by OpaHeinz on Fri Feb 08, 2019 9:43 am, edited 1 time in total.

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

Re: Saving script did not work - Error?

Post by OpaHeinz » Fri Feb 08, 2019 9:43 am

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)

jllort
Moderator
Moderator
Posts: 10834
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

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

Post by jllort » Sat Feb 09, 2019 11:39 am

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.

Post Reply