go to post Peter Cooper · Feb 26, 2019 Hi AllThere is another (hidden and undocumented) methodAt the top of the classInclude %sqlmgrUtilAnd then you have access to a useful macro $$parseStringI find this useful when I need to do some transforms on the csv data rather than just suck the raw data into a classCode 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 definitionPeter
go to post Peter Cooper · Jun 22, 2018 Hi DavidI think this is a feature(?) of the way Javascript and the upload work in any browser - running JS or an upload blocks any UI updatingso it's not possible to do easily or at all - I thinkPeter
go to post Peter Cooper · Jun 22, 2018 Hi DavidsonPlease 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 patchesPeter
go to post Peter Cooper · May 20, 2018 Hey HermanGlad to see that you are still around!!!!Yup it's me - I was not understanding - see my reply abovePeter
go to post Peter Cooper · May 20, 2018 Hi DemitriIt's me!!!!I thought javascript was doing something differentif (oJSON.theValue) { write("hello") }I *thought* that it was evaluating it as a booleanIt's not - the test is showing if it's definedSo.....Learnt something todayThanksPeter
go to post Peter Cooper · May 20, 2018 Hi DimitryBut still inconsistentegset x={"TheValue":"123"} write x.TheValueDoes not return a quoted stringPeter
go to post Peter Cooper · May 17, 2018 Hi YoavRe Captcha etcThis folds into something that I am looking at for another clientCheck out https://developers.google.com/recaptcha/docs/verifyEssentially 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"HTHPeter
go to post Peter Cooper · May 17, 2018 Hi YoavWhat I would look at is creating a Caché class method that does most of the workIn %SYS you can do things likeList all Users&sql(declare c1 cursor forselect ID into :xID from Security.Users....And to open the user objectset 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.Rolesand the related class is Security.Roles= =Don't know about Captcha - but this would be client side - not serer sideHope this helpsPeter
go to post Peter Cooper · May 12, 2018 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* thereThanks!Peter
go to post Peter Cooper · May 11, 2018 Thanks again EduardJust one point it's Angular2 not AngularJS - I think AngularJS could be delivered by CSP but I doubt that it would be the best way to deliver Angular2 Or so I believe - it's one of the things on my list to look at with Angular 2Peter
go to post Peter Cooper · May 11, 2018 Hi EduardFood for thought !!!!It's just that it's always been the way I have done it in ZEN for around 11 years - started off with "small" result sets and just carried on doing it that wayIt's great to be challenged - Thank you!!!= =BTW I like the look of the way that you include source code in your postsDo you care to share how you create the posts with the grey box around them - do you create/edit with the online editor or some other tool?Peter
go to post Peter Cooper · May 11, 2018 Oh forgot this one......Maintaining State between client calls...I can think of a real world case where some sort of state between the client and the server is a good idea...Consider a huge database where we need to query and produce the equivalent of the ZEN tablepane that displays rows of data with filtering and sorting functionalityI can see there are a number of widgets available for different frameworks where the whole result set is shipped to the client and filtering/sorting is done there.However there are cases were....We want the query to be run once on the serverWe do not want to ship the whole resultset (too big there could be 100,000's rows) to the client and do pagination/sorting/filtering thereSo the client component needs to get the data page by page from the server - and any filtering/sorting is done thereThis is just how the ZEN tablepane works using ^CacheTemp(xxx to stash the dataHence we are maintaining a state between the client and serverUnless you can suggest a better alternative that does not require state to be maintainedAt the moment this is the only use case that I can think of where maintaining state is a useful thing Peter
go to post Peter Cooper · May 11, 2018 Hi EduardI had already seen your second comment elsewhere - but thanks for the additional detailed comment - most useful.Just some quick thoughts......All brokers effectively have Parameter UseSession = 1;But the default value in %CSP.REST is Parameter UseSession As BOOLEAN = 0;So the developer has to remember to override this every time (or sub-class) Use same GroupById I have seen this but have no understanding of what it's for - searching the docs only brings up a reference in the automatic deployment section only with no descriptionIf you have any more information on it's purpose please share Sharing the session between the CSP/ZEN app and Rest calls is a great featureBut if it's a third party app then there is no CSP/ZEN app - the use case I have in mind is a 3rd party web developer is creating a complex shop system that needs to communicate with CachéI have no idea or interest in what technology they are using and it may be that their programming language does not easily support cookies so the CSPCHD (the session cookie) does not get passed.I am thinking that in this case the authentication needs to be passed with each Rest call - not an issue(or use OAUTH which I know little about) On securityYes SQL security for sure - but there are traps here in the management of that security - I don't want a huge overhead in having to manage multiple roles each with it's own SQL security profile.And anyway it does not help if the Rest application is accessing the database via the object projection rather than SQLAs always, there are many options/scenarios my aim is not to give a definitive answer but to share my experience as a real world developer and how I implement thingsPeter
go to post Peter Cooper · May 11, 2018 Hi DarrenI remember an Intersystems Global Summit (or DEVCon and it was called back then) around 10 years ago where ISC did a presentation (Robert Nagle) on a project where they got MIT to develop the same business app using open source and Caché.It was big data where they were monitoring and capturing real-time data from solar energy installations (from small to large)The project never fully completed but the indications were that the closed Caché outperformed open source on all metrics.Interesting to see what's changed!Just wish I had a copy of the presentationPeter
go to post Peter Cooper · May 11, 2018 Hi Jeff and welcome aboardIf you want more (private) feedback please email me directPeter
go to post Peter Cooper · May 10, 2018 Hi GuilhermeCheck out the docs - go to documentation and search for Zen LocalizationThis allows multi-lingual localization Peter
go to post Peter Cooper · Mar 19, 2018 Hi EvgenySource control library is not mine - It was a commercial product created by GlobalWare - saddly did not make it commercially and the company went defunct a few years ago.But...The main owner of the company now works for ISC in Boston wrc - Jorma Sunamo by name - maybe you should contact him direct (jorma.sunamo@intersystems.com) to discuss.Peter
go to post Peter Cooper · Mar 18, 2018 Hey EduardThis I understand and I use this at the moment in my ZEN appsBut...Anne needs a JSON restful method of getting a logon and get a session token - only consuming a single license slot.*NOT* a HTML web page to logon that a CSP logon delivers - this is not what she is looking for.As she said, you could pass CacheUsername and CachePassword as a URL parameter - but this don't work - if it fails Cahché delivers a HTML page - not what is required for a restful logon. The display/content should be in control of the client UI - not delivering a CSP HTML pageI'm sorry if I seem to be dismissive of your answer - but the web is moving on and we can no longer rely on the "old" way of doing things.Peter
go to post Peter Cooper · Mar 18, 2018 Hi AnneLooks like we are on the same journey - have a look here on what I have so far= =I have no real answer to the logon issue - I think the "correct" solution is for Intersystems to provide a restful logon service to provide this functionality that can be accessed without being already logged on.One possibility that I can think of that *may* work (have not tried it *yet*) ....create a separate CSP web site that has no restrictions on logging on - with a single restful service "logon" - in can be in the same namespace but with a different dispatch class.The COS then performs a $System.Security.Login("username", "password") and returns success or fail - and sets up the session tokenI can see that there may be issues with CORS - but I don't understand this topic yet :}= =As an aside....I have been working with Caché for (too) may years and their security model/features is hidden away, difficult and subject to change.I can understand this - they need to protect their commercial interests - eg it is technically possible for a minimal license (5 users) to support 1,000's of end user clients - clearly not commercially sensible.Peter