Nikita Savchenko · Jun 30, 2016 go to post

Thanks, Fabio!

Good to know about SPOOL device. Thank you! However, this method touches ^SPOOL global. Being set before the call, ^SPOOL global changes it's value, which is not secure for my needs.

P.S. Recently, Stuart gave me a complete answer. Thanks for your help!

Nikita Savchenko · Nov 2, 2016 go to post

Wow, thanks, I thought that this routine will just be executed before the terminal session start and then the normal terminal session will happen.

Do you know is it possible to achieve this behavior? Thank you!

Nikita Savchenko · Nov 7, 2016 go to post

Hello Bernd,

Yes, I did:

ClassMethod Logout() As %Status
{
write "Bye, " _ $Username _ "!"
do %session.%SaveData()
set %session.EndSession = 1
do %session.Logout(1)
quit $$$OK
}

I tried %SaveData as documentation says as well, and this doesn't result as expected neither.

Nikita Savchenko · Nov 7, 2016 go to post

I did log in exactly as I described:

When I come to the /playground/index page at first, Caché meets me with an authentication window, asking to enter my username and a password.

The output of the log is the next:

You're logged in as _SYSTEM
SessionId = xH9mWezT2o, NewSession = 1

Thank you!

Nikita Savchenko · Nov 7, 2016 go to post

Thanks to Bernd, I finally found that this is not a Caché sessions unexpected behavior, the reason is in the browser's basic authentication cache.

To clear the browser's cache, here is one "dirty" solution for this: stackoverflow (and probably the only solution). The JavaScript function sends the wrong login/password authentication request to the server, and it results as 401 Unauthorized error. And this forces browser to clear its cache.

Nikita Savchenko · Dec 10, 2016 go to post

Stefan,

I think it makes sense to edit this article a bit and replace all "dying" system methods with their working analogues, e.g. .$toJSON() -> .%ToJSON(), etc. Do we ready to do so in terms of transition back to no system methods?

This article has a good search engine ranking and I usually use information from here.

Thanks!

Nikita Savchenko · Jan 3, 2017 go to post

Hello Kevin!

It's all about setting up the /terminal web application. Go to the Management Portal -> System Administration -> Security -> Applications -> Web Applications, then choose /terminal web application.

There you can specify the required resource for this web application:

For example, you can specify %Development resource, which means that any users that do not have the access to this resource will not be able to log in to WebTerminal.

As _SYSTEM user has this access, you can create a custom resource, for example, WebTerminal, and create a role WebTerminal which provides the access to this resource, and then set up this role to the web application and assign this role only to those users you want to have access to WebTerminal.

Please, feel free to ask if you need more details about setting up roles and resources.

Thanks for the good question!

And a question to community: I think creating WebTerminal role/resource programmatically during the WebTerminal installation makes sense, does it? As well as adding some documentation on setup/use/roles/etc.

Nikita Savchenko · Jan 3, 2017 go to post

Kevin,

Please see my answer below and tell me if it helps.

Try using the browser's incognito mode or reinstalling WebTerminal if you need to log in from scratch.

Nikita Savchenko · Jan 3, 2017 go to post

Hello Sebastian!

I am glad to hear you like WebTerminal. I do as much as possible to make it even better.

For now, WebTerminal may still have some escape sequences not implemented, and there is one issue that may also cause old "dinosaur" application to work in a little bit different way. If you find the reason causing the terminal application not to work as expected, please, feel free to describe this in the GitHub's issues section.

Nikita Savchenko · Jan 3, 2017 go to post

Thanks for hint, Edward, but how can I start using it? open 3564 use 3564 write ##class(%Library.Device).GetType() close 3564 command throws <NOTOPEN> exception.

Nikita Savchenko · Jan 19, 2017 go to post

Hello Mark, thank you!

I did a little fast research and found that it is possible to make the behavior of printing long output similar to the standard Caché terminal (just to make terminal scroll and scroll through the text until the output stops). But how do you think, does it makes sense to replace this "freezing" behavior with always-scrolling output? In both cases, the output is not readable (normally readable). Maybe it makes more sense to display a floating message like "Output in progress..." when WebTerminal freezes for more than 1 second?

Would be glad to hear your opinion, thanks!

Nikita Savchenko · Jan 20, 2017 go to post

Mark,

Good point on the output issue. I was thinking to make non-freezing output during the development but postponed this idea in favor of synchronous output (which is freezing browser until all the content renders). I will take this into account in future versions of WebTerminal.

CTRL-C for now works as a default combination for copying text. Unfortunately, after reading documentation a lot, I am still having no idea how to implement interrupt in WebTerminal. Technically speaking, I need to send the interrupt signal to a jobbed process somehow, but continue to execute it from, for example, some label in the COS code. Any help here is appreciated!

To track the interrupt enhancement, I have created this issue.

Nikita Savchenko · Jan 20, 2017 go to post

Good news! Today we figured out how to implement Ctrl+C interrupts in WebTerminal. Thanks to Mark for pointing on this.

Now WebTerminal will prompt you to update to version 4.1.2, which includes Ctrl+C interrupts implementation. See the related docs: when there is any selection, Ctrl+C will work as a normal text copying. But when there is no text selected, Ctrl+C will work as an interrupt.

Mark, I need a bit more time to implement non-freezing long output behavior, but it is in my list now and will be implemented soon. Thanks for your comments!

Nikita Savchenko · Jan 22, 2017 go to post

Of course, Javier! Thank you for your interest and attention on this project.

If you application is open-sourced (or if you can share it with me), then it would be easier for me to figure out which escape sequences are missing. If not, you would need to find out what happens and which parts of your application is not supported by WebTerminal.

Regarding to F1-F12 keys support, I already have the way of implementing it, so please create the issue here to track the progress. For other things, like "graphic characters are not displayed", "it doesn't allow to draw boxes or lines" I need more detailed technical description, including possible code which doesn't work in WebTerminal, but does work in Caché TERM.

Feel free to submit your requests to our GitHub project issue tracker, this helps to create an even better project!

Thanks!

Nikita Savchenko · Jan 23, 2017 go to post

Thank you very much for this brilliant note!

I have fixed the Caché version requirements. The thing is, starting from WebTerminal version 3, it uses %CSP.REST classes, which support starts from Caché 2014.1. Earlier versions of WebTerminal (1-2) can be still used with Caché 2013.1.

The docs are updated now. Thanks!

Nikita Savchenko · Jan 26, 2017 go to post

Thank you Mike for yet another awesome point!

From the WebTerminal v3 I did occasionally dropped ^X364 mnemonics support... Now it's restored! Please update to the latest version of WebTerminal (4.2.0) and confirm here that escape sequences work properly for you.

Thanks!

Nikita Savchenko · Feb 3, 2017 go to post

Steffen,

All the software in the world is not protected against human mistakes... Especially if it's the user interfacing software, Mac, Windows, doesn't matter: they all have bugs.

Once you find thing that brakes something, please, do not complain about the open-source packages like here: just submit the bug report to the project.  If the bug is critical like this one, it will be fixed in days, if not in hours.

The reason was just in /ClassExplorer web app setup: it was set up as namespace default application by default, and the URL SOAP Wizard used in studio were incorrect.

The fixed version of ClassExplorer is here, please update it or just change "Namespace Default" to false in /ClassExplorer web application.

Thanks!

Nikita Savchenko · Feb 3, 2017 go to post

Timur,

The package manager is the most-wanted tool for sure, thanks for sharing the ideas. I want to add some mine ones, mostly from my long experience of using npm.

My projects are all shipped as XMLs (ClassExplorer, WebTerminal, VisualEditor, etc), so the container for the package should be XML. At least, that's the easiest solution what we have for now.

Dependencies. I think all the dependencies for Caché should be strictly = to some package version, as my experience says me that if you miss 4 month of development, you may miss deprecated methods you are using in a package that was deleted for the latest version of the package.

The key breakpoint here is, for example, if the package A uses package's C version 0.0.1, and package B uses package's C version 0.1.0 (which behaves differently and is not back-and-forth compatible!), how do we resolve the:

1. ClassName

2. ClassVersion to use

And I bet there is no "perfect" solution here... It sounds like we should always develop at least back-compatible package versions.

Tool.

I have tried installing CPM. It worked! But resulted with some errors during the import:

Загрузка файла Z:\temp\CPM\t\depends\C\manifest.xml как xml

ERROR #6301 Строка: 1 Смещение: 11 no declaration found for element 'Manifest' while processing Z:\temp\CPM\t\depends\C\manifest.xml at line 1 offset 11

ERROR #6301 Строка: 1 Смещение: 11 Непохоже на файл экспорта Cache, невозможно импортировать.

Then I tried to install WebTerminal from the CPM shell by doing cpm install intersystems-ru~webterminal from WebTerminal. It ended with successful class compilation and then neither WebTerminal or CPM were working (do ^CPM just says "building the indices for the first time" and exits). Other packages were also installed with some errors regarding to their class compilation issues. I know that this is a very-very early version, and I would be happy once this will get resolved.

Partly-installed packages doesn't seem to include metadata class. Does it supposed to be?

Thanks for development, keep going!

Cache for Windows (x86-64) 2017.2 (Build 543U) Fri Nov 4 2016 01:11:15 EDT

Nikita Savchenko · Mar 13, 2017 go to post

That's strange, WebTerminal should successfully install from the first attempt, if there were no errors during installation.  Hope this won't occur again :)

Nikita Savchenko · Mar 17, 2017 go to post

Hello!

WebTerminal does not support arrow keys literally until we solve this. Any known and unknown ways to change $ZA and $ZB variable values programmatically are more than welcome.

Thanks!

Nikita Savchenko · Mar 24, 2017 go to post

Cool article Edward! Nevertheless I have a little note here.

According to my experience working on a huge code base, logging with macros may turn to a big pain as soon as you decide to change (add, etc) arguments to your macro, or in other words, change the macro code.

We had an application full of logging macros with something like you mentioned:

#define LogFatal(%message)        $$$LogEvent("FATAL", %message)

And at some point the logging mechanism became working improperly and we needed to change it (yuh, this logger used TCP connections and some other stuff to behave like "universal" logger in the application). But simply changing the macros code was not the case: we needed to recompile everything (as macros is compile-time code generator)! Every class on live system which used this macro. This was not successful (even on test environment) for the reasons I don't remember to be honest. What we did instead is... We spent a few days replacing all the macro code to simple class method calls like do ##class(Logger.Log).Warn(whatever). With this approach, when you change the Warn method and recompile, everything is applied immediately.

The pros I see for using macros to class methods is the thing that you can type around 15 less characters for logging, and optionally have some compile-time expressions about the logged class using macros. But the cons here is using macros itself... I believe the similar approach can be done with class methods and with the help of $stack variable.

Any comments on this? Thanks!

Nikita Savchenko · Mar 30, 2017 go to post

Hilarious! I spent a half of my day for this issue, and it turned out that

set %response.CharSet = "utf-8"

Was the only problem which needed to be deleted. Thank you so much Fabian!

Nikita Savchenko · Apr 21, 2017 go to post

Sean,

As for Caché web based IDE you may be interested in my Caché Visual Editor project. It allows to perform almost any edits over Caché ObjectScript classes. If you will be interested, we can continue working on this project.

Nikita Savchenko · Apr 22, 2017 go to post

Hi Evgeny!

Could you please create an issue on GitHub describing:

1. Did it happen before/with prevoius versions, symptoms;

2. Closing status and overal pooling time of the closing socket;

3. Which type of connection and Caché you use (https?);

4. The WebSockets frames dump will also be extremely useful (take a screenshot from Developer Tools -> Network -> Select "WS" and click on WebSockets channel -> Click "Frames".