Hi All

There is another (hidden and undocumented) method

At the top of the class
Include %sqlmgrUtil

And then you have access to a useful macro $$parseString

I find this useful when I need to do some transforms on the csv data rather than just suck the raw data into a class

Code snippit
    set oStream    =##class(%Library.FileCharacterStream).%New()
    set sc                  =oStream.LinkToFile("somefile.csv") 
    if sc'=$$$OK break
    do oStream.Rewind()
    set xDelim=",", xQuote=""""
    while 'oStream.AtEnd()
           set xLine=oStream.ReadLine(10000)
           set xLine=$zstrip(xLine, ">wp")
           set x1=$$parseString(xLine, xDelim, xQuote, .arr)
          ///you now have the individual cells from the csv in the array "arr" 
         ///and you can process/transform them individually

Look in %sqlmgrUtil.inc for the definition


Hi David

I think this is a feature(?) of the way Javascript and the upload work in any browser - running JS or an upload blocks any UI updating

so it's not possible to do easily or at all - I think


Hi Davidson

Please note $zf(-1 is now depreciated as of the most recent releases/patches of Caché

The replacement is $zf(100 - but stressing this will only work on the most recent patches


Hey Herman

Glad to see that you are still around!!!!
Yup it's me - I was not understanding - see my reply above


Hi Demitri

It's me!!!!
I thought javascript was doing something different
if (oJSON.theValue) { write("hello") }

I *thought* that it was evaluating it as a boolean

It's not - the test is showing if it's defined

Learnt something today


Hi Dimitry

But still inconsistent
set x={"TheValue":"123"} write x.TheValue

Does not return a quoted string


Hi Yoav

Re Captcha etc

This folds into something that I am looking at for another client

Check out https://developers.google.com/recaptcha/docs/verify

Essentially you need to change the client web page and the server (what are you using? ZEN/CSP or what) to call into an api to check what the user has entered

= =

But there are other alternatives - Google "better than Captcha"



Hi Yoav

What I would look at is creating a Caché class method that does most of the work

In %SYS you can do things like

List all Users

&sql(declare c1 cursor for
select ID into :xID from Security.Users

And to open the user object

set oUser=##class(Security.Users).%OpenId(<the_id>)
And then the properties you need to update for two factor are oUser.PhoneProvider and oUser.PhoneNumber

= =

Access management would be by roles - again this is available from oUser.Roles
and the related class is Security.Roles

= =

Don't know about Captcha - but this would be client side - not serer side

Hope this helps

No not intentional!

Everybody is good at some things and poor at others - and one thing I just *know* I am poor at is proof reading - I see what should be there rather than what actually *is* there