Dmitry Maslennikov · Feb 12, 2016 go to post

Ok then, how to manage to get it worked with REST in Caché. For example. My application uses REST dispatch class for csp application. This class returns static files from disk in development, or from XData in production. And then I need to use WebSocket as well, but all requests catch by REST class. And in REST route map, i want to have path '/websocket', and send it to my WebSocket class.

Dmitry Maslennikov · Feb 12, 2016 go to post

As you may already know, tables in Caché is a classes. And Class defintion stores in %Dictionary Package.

SELECT * FROM %Dictionary.PropertyDefinition where parent='Sample.Person'

Dmitry Maslennikov · Feb 15, 2016 go to post

Well, we got very exciting feature.

But how about some more methods for arrays, such as:  $unshift, $pop, $shift, $concat, $join, $slice ?

It would be very helpful.

And as we have $listbuilds in Caché, I want to easily convert it to json array like below

set array = ([]).$from($lb(1,2,3))

do array.$toJSON()

[1, 2, 3]

 

Dmitry Maslennikov · Feb 15, 2016 go to post

I just have found that $system.OBJ.Load() supports loading in an UDL format. And found $system.OBJ.ExportUDL() which can export classes and routines in UDL format. So, it means that we can easily organize work in Studio and in Atelier at the same time. What we should, it is to export all files in Studio hook at the same manner as it doing Atelier.

With this new possiblility, will be much easier to migrate from Studio to Atelier.

Thanks.

Dmitry Maslennikov · Feb 15, 2016 go to post

Cache for Windows (x86-64) 2016.2 (Build 595U) Wed Feb 10 2016 19:12:54 EST

Action `Delete` in context menu by project items, no works after first use.

 

Deleting three thousands of items at once leads to Atelier does not respond. In project folder nothing changes. And all that time CPU in ~70% and about 2Gb memory

Dmitry Maslennikov · Feb 15, 2016 go to post

When macrocomment appeared in the same line with continue, next line will be marked as an error

for i=1:1:10 {

  continue:condition ##; comment

  set a=1

}

Interesting example I've found in Ens.Util.Time
                GoTo $Case(spec

                ,"a":getWeekdayAbbrev

                ,"A":getWeekdayFull

                ,"b":getMonthAbbrev

                ,"Z":getTimezoneName

                ,:getX)


 

Dmitry Maslennikov · Feb 16, 2016 go to post

You can calculate such property on a class side, something like this. Index by CitizenRef and RelocationDate, and method which looking for the next date, and returns true if nothing found.

Index CitizenRelocation On (CitizenRef, RelocationDate);Property IsLastKnownRecord As %Boolean [ Calculated, SqlComputeCode = {set {*}=##class({%%CLASSNAME}).IsLastKnownRecordCheck({CitizenRef}, {RelocationDate})}, SqlComputed ];Method IsLastKnownRecordGet() As %Boolean{quit ..IsLastKnownRecordCheck(i%CitizenRef, i%RelocationDate)}ClassMethod IsLastKnownRecordCheck(CitizenRef As %Integer, RelocationDate As %Date) As %Boolean [ CodeMode = objectgenerator ]{set storagename="Default"set storageInd=%class.Storages.FindObjectId(%classname_"||"_storagename)set storage=%class.Storages.GetAt(storageInd)set indexLocation=storage.IndexLocationset indexLocation=$name(@indexLocation@("CitizenRelocation"))do %code.WriteLine($c(9)_"quit $order(@($name("_indexLocation_"))@(CitizenRef, RelocationDate))=""""")quit $$$OK}

And result you can see below

Dmitry Maslennikov · Feb 16, 2016 go to post

Cool markdown, is nearly here.
Well, but it is not so clear, that Disable rich-text, means markdown.

But there are some errors, in markdown.

~~strikethrough~~, >! spolier    does not work at all,

A [link](http://example.com). shows as  

When I press Preview button, in editing new post, after reload, editor opens in rich-mode and brakes all my markdown. And I think we need preview button, or live preview for markdown in comments.

Dmitry Maslennikov · Feb 16, 2016 go to post

Interesting highlighting error, such code fails all lines of code below

set $p(@$na(^tmp("test")),",",1)="val"
Dmitry Maslennikov · Feb 17, 2016 go to post

There are some ways to concat values in a cloumn in Caché: CONCAT and STRING.

CONCAT concatenates two strings to return a concatenated string. You can perform exactly the same operation using the concatenate operator (||).

STRING converts one or more strings to the STRING format, and then concatenates these strings into a single string. No case transformation is performed.

Dmitry Maslennikov · Feb 18, 2016 go to post

Yes, it is possible, but you should be ready to change it after all updates of Caché

Read about it in documentation  - Localizations

In first you should export current localization 

DO ##class(%Library.MessageDictionary).ExportDomainList("messages_sqlcode_en.xml","%SqlCode","en")

here %SqlCode, it as a domain for Sql Codes. And any language which you want to change.

then you can change any text in this xml, and should keep all off tags with their Id attribute, if you delete some tag, you will loose their localization. And then you can import your new localization. As it system localization, you have to allow writing to CACHELIB database.

do ##class(%MessageDictionary).Import("messages_sqlcode_new_en.xml")

You have to remember that it is a system localization, and InterSystems can change it, add or remove anything here, and in every new version, you should follow theri changes.

Or much simple way, it just set new value directly to  the global.

USER>set ^%qCacheMsg("%SqlCode","en","SqlCode139") = "TEST Concurrency failure on update: row versions not the same"
 
USER>Write $SYSTEM.SQL.SQLCODE(-139)
TEST Concurrency failure on update: row versions not the same
Dmitry Maslennikov · Feb 24, 2016 go to post

Hi Kenneth,

I've been working in company where we develop WEB-based ECM application. It's a quite big one, and very flexible.  We do not use CSP-files at all, only CSP-classes, no Zen. And some my own projects on Caché, also in WEB. I will not recommend to use CSP-files, or Zen. I can't say anything about Zen Mojo, just because when I last time saw it, it was not so better then Zen, now with Native JSON it may be better.  I'll recommend CSP-classes, REST and webservices.

CSP-Pages. It may be usefull, with all of their tags and stores with files. But unfortunately  all of this files, may some time confuse developer, because in any way developer should know is it compiled or not, when some files were changed, it may looks like nothing changed.  And at the end anyway it compiles to CSP-classes. 

ZEN. With ZEN, you get some ready components. In the same time, your application became too big, even if it not, and have just one page. It generate js/css files, and you should care about that files, while you deploy app to production. Data transfered from server to client side, contains waste js code.

With CSP-classess, I have flexibility, and can generate different parts of page in very different parts of code. I have much more possibilities to control how I generate HTML, receive and response requests. But I still generate html-code in Caché.

As well we have more than 1MB CSS and JS files. For me it is not so comfortably to edit that files in Studio. For HTML in classes I can use embedded &html<>. JS and CSS files I'm editing in Sublime Text. 

But I'm sure that in modern time application should be SPA, all html should be in static files, and server should speak only in JSON, with a REST and wevservices. And in all my last web-projects, I'm using this way.  Static HTML, JS, CSS files, with a Gulp I transform all sperate JS and CSS files to one, implement that files to HTML. And for production version I put all that files in one Class. In this case I can send one XML file which contains full application.  For example CacheBlocksExplorer

Dmitry Maslennikov · Feb 25, 2016 go to post

You may call RunTest with /noload parameter, but you still have to set a valid directory  as a value in ^UnitTestRoot

Set ^UnitTestRoot = "C:\UnitTests"Do ##class(%UnitTest.Manager).RunTest("mytests:MyPackage.Tests", "/noload/nodelete")

Or so, here you can specify: suit, class and method if you want

Do ##class(%UnitTest.Manager).DebugRunTestCase("mytests","MyPackage.Tests","","")

This call does not load any classes from any directories nor does it delete any classes from Caché. And executes the tests contained in MyPackage.Tests. The optional third argument is for specifying an individual test method within the test class to execute.

If you think, that really need some new language in Caché. You can add with some limitiations, if Studio already can highlight that language. Now you can do it only in Studio, Atelier does not support it. I've already wrote a short post about something like you want. And about javascript-like language which can be executed on server side, because compiles into COS, yet in russian, and it will be transleted in english some time later. In that my article, I used as an example code

// hello
console.log('Hello World!');

var name='';
read('What is your name? ', name);
println('Hello ' + name + '!');

which compiles to

;generated at 2014-05-18 20:06:36
    Write "Hello World!",!
    new name
    set name = ""
    read "What is your name? ", name,!
    Write "Hello "_ name _"!",!

Post names as iKnow +Atelier, and I guess it means server side language, not client side. That's why I offered this variant.

Since Atelier now has a client side folder, for edited files, you can't just edit server's files.
You should copy such classes or routines to the project before, by menu Copy to project. In dialog you should choose already existed project, and after Finish button, that files will be available for edit.

It's not completely right, after migrating to 2016.2 and later versions. You still can use both Atelier and Studio, even with sources in UDL format. With $system.OBJ.ExportUDL() and $system.OBJ.Load() in Studio Hook you can export and import in UDL format. So, in this case, will be much easier to migrate from Studio to Atelier in a team. But any way you should convert your sources from XML to UDL.

In our company, all developers usess their own installation of Ensemble. We develop web-application, and most of our changes we do on server-side code, and support only one version of Caché. In a team with more then one developer, but on one server much easier to disturb to others developers on this server.  And with a web-based application, you also need to change some static files, such as  JS or CSS, so in this case you can't split changes from different developers if you use any source control system. On his own server developer have a full control on development environment. 

Only in cases, where server uses only to store some data or with so small changes of server's code, and client works via network, possible to work on single server for all developers.

Well, but maybe possible to get COS parser as a separate project. What I see now, that most important errors in Atelier for me now, it is Parsing errors. And such problem not only for Atelier, for any other editors which now available.  And parser as a one of the most difficult parts of editor should be done by InterSystems, they change language. While InterSystems have already opened server's  API, as a chance for any others developers to make their own editor. Next step as I think should be open Parser, or any help in support. I know exactly how difficult to write COS parser, I tried to do it for my NBStudio, and helped in writing SonarQube plugin, and last one my project it is a pygments COS parser used for GitHub. 

And finally I think, to get most support for all future editors, Java-based or JavaScript or even C#, such parser should be written on ANTLR. Now it supports not only java as a platform, JavaScript and C# supported too, and I think this parser would be used for any future editors, and Caché-developers finally gets more then one useful editor.

In Amazon for example as I know, you may use private network with machines without any public IPs, only private static or dynamic address by your own dhcp setver. And in this case I don't see any troubles in using Mirrors in cloud. I think any others cloud prividers have such possibilites. 

Using Gravatar, It is a good idea.

But, I think there is a some problem with it. Most of accounts here uses corporate e-mails, but in any other places we are using our private e-mail, I do so. And I hava gravatar for years, and it uses only my private addresses, and sure most of people here too.

As I know you may only change default background color for document and for status pane, and this color will be different for different servers