print function in script

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
mamad
Senior Boarder
Senior Boarder
Posts: 69
Joined: Mon Jun 25, 2018 5:13 am

print function in script

Post by mamad » Sun Jul 29, 2018 4:56 am

hi guys,
when i write

Code: Select all

 print("some thing"); 
in a script and run it using automation, where it print the text entered? i cant find any message box or console inside openkm to see the output
And one more question:
when i use

Code: Select all

 Window.alert("alert"); 
in a script and run it with an automation, nothing happens. why ?

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

Re: print function in script

Post by jllort » Sun Jul 29, 2018 7:58 am

Automation script is executed in the core into another thread that's why you will not see the output in the catalina.log file ( where usually is shown ). I do not suggest using scripting in automation , I suggest working with JAVA classes where you will get full control and you will be able to debug them https://docs.openkm.com/kcenter/view/ok ... ction.html

About Window.alert("alert"); only have sense from GWT classes.

I suggest debug the automation classes with eclipse, if you are not using the development environment also is good idea playing your code first there before working with production, in our download section you have explanation how getting the development environment working https://www.openkm.com/en/download.html

mamad
Senior Boarder
Senior Boarder
Posts: 69
Joined: Mon Jun 25, 2018 5:13 am

Re: print function in script

Post by mamad » Mon Jul 30, 2018 3:49 am

well , thank you

mamad
Senior Boarder
Senior Boarder
Posts: 69
Joined: Mon Jun 25, 2018 5:13 am

Re: print function in script

Post by mamad » Thu Aug 02, 2018 4:02 am

Hi again,
Guys is there any way to print something from non-Gwt classes ? i want it for some debug action.
I mean if i want to print some thing like what we do in java programming by using System.out.println() what i should do ?
For example i create a public class with a constructor inside com.openkm.frontend.client package that has Window.alert("***") code inside its constructor.so inside my java class i create a object from that class (i thought this will create a alert box) but this caused a lot of exceptions when i try to compile project.
is there any way for printing something for some debug purposes ??

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

Re: print function in script

Post by jllort » Fri Aug 03, 2018 6:40 pm

Automation classes will work with OpenKM default log, but for scripting should use the class FileLogger https://docs.openkm.com/kcenter/view/ok ... ogger.html

mamad
Senior Boarder
Senior Boarder
Posts: 69
Joined: Mon Jun 25, 2018 5:13 am

Re: print function in script

Post by mamad » Mon Aug 06, 2018 4:39 am

thank you

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests