Eduard Lebedyuk · Mar 14, 2016 go to post

And you need to do this why? I mean what is the end goal?

To show user some menu when they open Terminal?

Yes.

You can specify "Startup Tag^Routine" for this purpose:

Awesome. Didn't knew that it aplied only to terminal devices.

Eduard Lebedyuk · Mar 12, 2016 go to post

Hi. About your second question, you can easily extend Caché ObjectScript, to do it. Wouldn't recommend it for use in production, but why not add some syntax sugar on you dev instance?

Create %ZLANGC00 mac routine with the following code:

 ; %ZLANGC00
 ; custom commands for ObjectScript
 ; http://docs.intersystems.com/cache20141/csp/docbook/DocBook.UI.Page.cls?KEY=GSTU_customize
  Quit  

/// Execute Query and display the results
/// Call like this:
/// zsql "SELECT TOP 10 Name FROM Sample.Person"
ZSQL(Query)
  #Dim ResultSet As %SQL.StatementResult
  Set ResultSet = ##class(%SQL.Statement).%ExecDirect(, Query)
  Do ResultSet.%Display()
  Quit

Save and compile it and then you can execute sql in a terminal like this:

zsql "SELECT TOP 10 Name FROM Sample.Person"

It would display something like this:

SAMPLES>zsql "SELECT TOP 10 Name FROM Sample.Person"
Name
Adam,Wolfgang F.
Adams,Phil H.
Ahmed,Edward V.
Ahmed,Michael O.
Ahmed,Patrick O.
Allen,Zelda P.
Alton,Samantha F.
Bach,Buzz E.
Bach,Fred X.
Bach,Patrick Y.
 
10 Rows(s) Affected

That said I myself prefer executing SQL queries in SMP because you don't need to type them there (drag&drop from the left panel or copy&paste from the code) - it's very convenient.

Eduard Lebedyuk · Mar 11, 2016 go to post

Yes, but if direct global iteration is used, the speed would probably be higher then sql.

Eduard Lebedyuk · Mar 11, 2016 go to post

The fastest query-like interface is %SQL.CustomResultSet. You need  to write your owl logic, though.

It can be called like this:

Set resultset= ##class(Package.YourCustomQueryRS).%New()
While resultset.%Next() {
   Write resultset.Id,!
}
Eduard Lebedyuk · Mar 8, 2016 go to post

I don't think dropdown menu items support key property. Maybe you can use id property for your purposes instead?

Eduard Lebedyuk · Mar 7, 2016 go to post

Looks quite interesting. Are there any planned release date? Would there be an option to write your own checks?

Eduard Lebedyuk · Mar 7, 2016 go to post

Is there any way to set environmental variables before calling $zf?

For example I want to add something to PATH, but if I do it in an actual $zf call it would be a lot longer and hard to read. So is there any way to set environmental variables for current process from Cache?

Eduard Lebedyuk · Mar 7, 2016 go to post

2016.2 Studio does not seem to have package delete button.

Just delete all contents in a package and it would disappear.  Or execute this query:

DELETE FROM %Dictionary.ClassDefinition WHERE Name %STARTSWITH 'package'

To upload images click on this button (on the WYSIWYG editor):

Eduard Lebedyuk · Mar 5, 2016 go to post

InterSystems University Outreach Program (Russia). Each developer has his's own machine with his own Caché/Ensemble instance. We use Git source control system and there are several Studio integration plugins we offer, but mainly Cache-tort-git. Changes are commited to a central GitHub repository preferably via pull-requests (see GitHub workflow). Changes from GitHub repository are automatically pulled to a production server(s) with Cache GitHub Continuous Integration tool.

Eduard Lebedyuk · Mar 3, 2016 go to post

Also ##Expression macro preprocessor command can be masked and distributed along several macros (which in turn can be distributed across several inc files). For example consider the following class:

Class Utils.Macro Extends %RegisteredObject
{

/// do ##class(Utils.Macro).Test()
ClassMethod Test()
{
    #define Tab #
    #define Indent $$$Tab$$$Tab
    #define Start Expre
    #define End ssion($$$Call)
    #define Call ##class(Utils.Macro).GenerateNewClassObject(%classname)
    #define All $$$Indent $$$Start$$$End
    set b=$$$All
}

ClassMethod GenerateNewClassObject(cls As %String)
{
    zw
    // custom logic depending on class may be implemented
    q "##class("_cls_").%New()"
}

}

Note, that in this example full-text search for ##Expression would yield nothing.

In here GenerateNewClassObject method would be executed on Utils.Macro class compilation. because $$$All macro would be evaluated to:

##Expression(##class(Utils.Macro).GenerateNewClassObject(%classname)

Which in turn would be evaluated on the last line:  set b=$$$All where GenerateNewClassObject would be called by ##Expression command.

So I guess don't compile Caché ObjectScript from untrusted sources at all or check carefully what you compile.

Eduard Lebedyuk · Mar 3, 2016 go to post

And for any macro definitions which contain ##Expression, ##Function, #Execute and ##SafeExpression.  Also #If, #IfDef, #IfNDef conditions (any Caché ObjectScript expression) are evaluated at compile time.

Eduard Lebedyuk · Mar 2, 2016 go to post

ClassMethod way to set a language for a session is:

Do ##class(%MessageDictionary).SetSessionLanguage(lang)

The interesting case would be $$$Text("englishtext") macros getting compiled on a new instance under a session in other language. Under these conditions the ^CacheMsg global would be written with "englishtext" values under session language. Which would be set as a default language for this domain (Messages in $$$Text are presumed to be written in domain default language, unless specified otherwise).

To prevent that set domain default language or change  session language before the compilation.

As far as I remember importing message dictionary does not set default language for the domain itself.

Eduard Lebedyuk · Feb 26, 2016 go to post

I stand somewhat corrected

do $System.Process.Terminate()

In %ZSTART(or ZAUTHENTICATE for that matter) does solve my problem. Seems like overkill, though. Really wanted just to return status.

Eduard Lebedyuk · Feb 26, 2016 go to post

Exactly, what I want is two-factor authorisation but with my own authentication infrastructure for a second factor.

Eduard Lebedyuk · Feb 26, 2016 go to post

Additional check is calling external device to provide rfid/biometric/whatever authentication on the user logged in to provide additional security level. Yes, application approach seems to be better.

Eduard Lebedyuk · Feb 24, 2016 go to post

I need to perform additional check during Cache user authorization. Is there any way to do that?

Eduard Lebedyuk · Feb 24, 2016 go to post

How much does a standart 1-2cpu/1GB RAM/32Gb SSD virtual server with linux distro costs per month? I was unable to find it on their website.

Eduard Lebedyuk · Feb 23, 2016 go to post

Great!

RSS feed by tag works in Thunderbird. Main RSS feed still shows as invalid.

Some thoughts about email integration:

  1. Replace the icon with a simple envelope icon - which  is more recognizable. I can easily recognize the first three icons, but the last one I incorrectly accociate with msn logo
  2. After clicking on a "share via email bullton" I'm being redirected to a new page where I can send a message from communityportal@intersystems.com. I think you  can raise convertion by using a simple mailto link (so default mail client pops up with a predefined topic and message instead of the new page) - so the person sharing the post can share from his own email account.
Eduard Lebedyuk · Feb 21, 2016 go to post

1. They must be granted to either application or user

2. Only resources of Service, Application and User type could be used there. %DB are database resources

3. SMP -> Menu -> View Roles -> Choose the role "webapp-admin" -> General Tab -> Priveleges -> Add -> choose the resoure -> OK -> Save

Repeat for webapp-user

4. Like this:

Parameter RESOURCE = "ResourceName1:Permission,ResourceName2,ResourceName3:Permission";

Where Permission is one of: READ, WRITE, USE

If Permission is skipped (see ResourceName2) then USE permission is checked.

Eduard Lebedyuk · Feb 19, 2016 go to post

Here's an aggregation rss feed which combines the Community Portal RSS and InterSystems StackOverFlow RSS tags. It's available here and works with Thunderbird.

Eduard Lebedyuk · Feb 19, 2016 go to post

Have you thought about uploading this projects on GitHub?

UPD. Nevermind, seen your message about GitHub in another topic.