Xpages Starter Kit Server.jss - xpages

I have a lot of SSJS codes on many NSF, most of the NSF use the same functions code.
So I tried to make a Library with all the common functions, I'm trying to use the Xpages Starter Kit, because it claims to have SSJS Library Provider and implicit global SSJS.
There theres a Server.jss file that says "//your SSJS library code goes here".
I put some simple code there just to test it, but I couldn't figure out how it works.
print("Hello World");
function hello(){
print("hello");
}
How it works?
I made and install the update site, put the <openntf:canvas/> on a xpage. The canvas tag is created, but nothing seems to happen with the SSJS. Nothing on server console, and if a try to call hello function an error is raised.
How can I access SSJS functions on the library?

The library id - org.openntf.xsp.starter - is defined various places in the Starter Kit. It's also there with "/" instead of "." for some contexts.
Also, double-check the library has been enabled in Xsp Properties for your application.
It's also worth looking at the Domino Debug Plugin on OpenNTF to debug your code directly in Eclipse. Also check the Help > Support > Trace and Help > Support > Log in Domino Designer for any errors for your class.

Related

How to hook the 'send' button in lotus notes client

Due to some reasons, I'm not allowed to touch Domino server but would like to make my plugin be able to modify email content right before it's being sent in client side. All comes up in my mind is to add a listener or somehow to hook the 'send' button of a message, which holds on when being clicked and runs my codes, and then sends the message. Is there anyone knowing about this trick, or any other way to meet the same purpose? Thanks.
BTW: I'm using Lotus Toolkit in Java.
Update:
I found a very similar question here:Lotus Notes - Java UI - Eclipse plugin
But I found Querysend only exists in NotesUIDocument of LotusScript but not Java. Strange.
You have two choices: install a DLL built using the Notes C API on every Notes client computer, or make modifications to the mail template. In the latter case, though, rather than implementing your code in the QuerySend event it probably makes more sense to implement to implement your code directly in the click event of the shared Send action - and that is just Lotus' formula language, so neither LotusScript nor Java is needed.

I want to see automatic code completion and code documentation over webstorm

I am developing a project in node.js in webstorm. I don't see sufficient code completion like in Eclipse + Java. I also don't see any javascript documentation popping up with descriptions of the API - which makes it very hard to code. Please advise.
Being a java guy I am hoping to see functions and variables specific to objects that I am working on, and I don't see that in Webstorm. I guess its mainly because Javascript does not provide type safety like in Java. Is there a general workaround to this?

LiveCode 6 XML library function use

LiveCode 6.x has an XML library with a function revCreateXMLTreeFromFile. When I try to use it, it compiles, but on execution I get a "can't find handler" error. Is there a trick to using the XML library? Or is this a LiveCode bug?
Are you making an app for iOS/Android or for a desktop OS?
You need to make sure that you include the XML external in the standalone. You do this in the standalone settings.
My book Programming LiveCode for the Real Beginner contains two sections on using XML.

Implementing dialogs from resource

I'm currently trying to port an application from owl to vcl.
In my old projekt-file I was able to load dialogs with something like
TBatchAcDialog(TWindow* parent) : TAPDialog(parent, BATCH_DIALOG)
However, using TTaskDialog instead it doesn't support the second argument.
I have found an explanation for the user interface designer that when rightclicking on a menu you can load the first declared menu from a rc-file.
However, I don't really know how to load those dialogs as dialogs in this IDE and linking them to my classes again.
Does anyone of you know about this or could link me to an article about a similar problem? I seem to have failed finding a proper solution although implementing rc-dialogs seems to be a common problem to me.
I'm currently trying to port an application from owl to vcl.
What is your exact goal? To be able to build the application with C++ Builder, or to use VCL instead of OWL?
If you want to use VCL for the dialogs, then you cannot port them, you need to rewrite all the UI from scratch, as VCL is very different from the standard Windows dialogs.
If you want just to build the application with C++ Builder, then you can do so by upgrading to OWLNext - it is an open-source upgrade for the OWL framework and works with the modern compilers like C++ Builder and Visual C++.
You can also use OWLNext for a gradual migration to VCL - as VCL and OWL can co-exist in the same application, so you can migrate your old OWL application to C++ Builder, write any new UI in VCL, and gradually rewrite the old UI in VCL - it might be easier and safer than rewriting the whole application with VCL.
C++Builder does not have any native functionality that wraps resource dialogs in classes. You have to set that up manually in your own code if you need it. Otherwise, just use Win32 API functions like CreateDialog() when working with resource dialogs, or else redesign your UI to make use of VCL TForm windows instead of resource dialogs.
TTaskDialog is not what you think it is. It is just a wrapper for the Win32 API TaskDialogIndirect() function (Vista and later only), which is not related to what you are attempting to accomplish.

C# WinRT component fails in UserControl constructor calling from WinJS

We are building a WinRT application with JavaScript (WinJS) that accesses REST/JSON web services via C# WinRT Component library. In the component library we have a Logon control (much like WebAuthenticationBroker) that allowes us to use ACS logon with our REST services.
Application Layers:
Client (JS)
WinRT component dll (C#)
C# ClassLibrary dll (C#)
UserControl (Xaml/C#, contains WebView)
The problem: When trying to create the logon control, the WinRT throws "HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)" exception (when entering the UserControl's constructor) even if I call it via Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher (recommended in MSDN article I found about WinJS/C++ component).
If I call it from a Xaml/C# client, the code works with or without the Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher.RunAsync().
I've tried to google this and also read all the UserControl, Dispatcher and WinJS documentation but I have not found anything relevant. Is this a known problem and could someone suggest a workaround?
Since I'm a first time poster, please be gentle :-) Any help is extremely welcome!
Xaml-based WinRT controls cannot be used in Javascript-based WinRT projects. You can use any WinRT class library, but not Xaml controls inside them.
If you still want to combine HTML-Javascript with Xaml, I would recommend creating a Xaml-based project, and wrapping your HTML UI in a WebView control.
I wouldn't expect it to be possible to use WinRT/XAML UI in an HTML/WinJS app. You would probably need to use some callbacks to request the UI to be created in a WinJS app/component library instead of the XAML one.

Resources