go to post Dmitry Maslennikov · Dec 14, 2017 To set any response header, you should overwrite OnPreHTTP method in your CSP Page class. Class User.Page Extends %CSP.Page { ClassMethod OnPage() As %Status { &html<<html> <head> </head> <body>> ; To do... &html<</body> </html>> Quit $$$OK } /// Event handler for <b>PreHTTP</b> event: this is invoked before /// the HTTP headers for a CSP page have been sent. All changes to the /// <class>%CSP.Response</class> class, such as adding cookies, HTTP headers, /// setting the content type etc. must be made from within the OnPreHTTP() method. /// Also changes to the state of the CSP application such as changing /// %session.EndSession or %session.AppTimeout must be made within the OnPreHTTP() method. /// It is prefered that changes to %session.Preserve are also made in the OnPreHTTP() method /// as this is more efficient, although it is supported in any section of the page. /// Return <b>0</b> to prevent <method>OnPage</method> from being called. ClassMethod OnPreHTTP() As %Boolean [ ServerOnly = 1 ] { Do %response.SetHeader("X-MyHeader", "some info") quit 1 } }
go to post Dmitry Maslennikov · Dec 1, 2017 Why do you use such a strange url? You created the application with your class as Dispatch class. So, in this case, you should call this. http://localhost:57772/USER/REST/Arun where /USER/REST is web application, and everything else is already what should be in a REST. PS. I would not recommend do not use uppercase for web applications
go to post Dmitry Maslennikov · Dec 1, 2017 You can use colon to achieve it <Route Url="/checkUID/:uid/:supplierid/" Method="GET" Call="Some.Other.Class:checkUID"/> With Map tag in UrlMap, you can simply split your big UrlMap by multiple classes
go to post Dmitry Maslennikov · Nov 30, 2017 Something like this, but in %SYS namespace. Documentation %SYS>s props("Database")="SAMPLES",sc=##Class(Config.MapPackages).Create("USER","PackageA",.props)
go to post Dmitry Maslennikov · Nov 28, 2017 After all details, it means, that no reasons to use $lb, or any other ways, it should be as is as a string, but with this length's header. In Cache, we don't have binary strings as do other languages, but what is a byte, it is a symbol for text, so text will be arrays of bytes. write $c(166, 70, 114, 105, 110, 103, 101) ¦Fringe The only thing you should care as already mentioned above is different codepages. Let's try for some example: And try to get the same. USER>set data="TestТест" USER>zzdump data 0000: 0054 0065 0073 0074 0422 0435 0441 0442 TestТест USER>set msg=$zcvt(data,"O","UTF8") ; convert from Unicode USER>set msg=$c(160+$l(msg))_msg ; of course should be changed for bigger text USER>zzdump msg 0000: AC 54 65 73 74 D0 A2 D0 B5 D1 81 D1 82 ¬TestТеÑ.Ñ. and as you can see we got the same result
go to post Dmitry Maslennikov · Nov 27, 2017 What do you mean by overhead from $lb? What is $c(166), some magic number? And why you encode the string as a list of codes, why not keep it as a string?$lb it is also a string, but compressed for some types of values.
go to post Dmitry Maslennikov · Nov 23, 2017 I love Docker way. In Dev environment, when you need only some test data. You can use Docker, with all test data inside the image, just recreate container will clean all previous changes and return the database to state when this image was built. If you later will decide to keep some changes as default for next uses, you can commit this changes to the image.
go to post Dmitry Maslennikov · Nov 11, 2017 To release all LOCK's for your current process, you can use argumentless LOCK command.To rollback all transactions in the current process, you can use TROLLBACK also without any arguments.If you want to control locks outside, you can look at class SYS.Lock in %SYS namespace.To find active locks, you can use either special global ^$LOCK or queries in the class %SYS.LockQueryYou can get transaction level with special variable $tlevel. For other processes, you can use class %SYS.ProcessQuery. To check if the process in a transaction or not. But you can't just rollback transaction inside another process, you can terminate it and transaction will be automatically rollbacked.
go to post Dmitry Maslennikov · Nov 6, 2017 Documentation now looks quite pure about Atelier. As far as I know, Studio does lock for any files which in edit mode, not just opened but after some changes. While Atelier does not. When you save the file in Studio, it does not care what did you have before it just overrides. When Atelier checks if server's version was changed it offers to compare and choose what should be stored on server.
go to post Dmitry Maslennikov · Nov 6, 2017 For best performance, you need index on this property. And request something like this. SELECT Home_City,list(ID) ids FROM sample.person GROUP BY Home_City HAVING count(*)>1 And result will be something like this
go to post Dmitry Maslennikov · Nov 3, 2017 You can remove saved password from windows registryrun regedit.open path HKEY_CURRENT_USER\Software\InterSystems\Cache\Servers\choose serverremove Server Password
go to post Dmitry Maslennikov · Nov 1, 2017 I would recommend instead of mark such object as deleted, with such flag like this. Just "move" it to another table some kind of Trash, when you can store this object as a serialized string for example. In this case object will really disappear from his table and will not be availble with via SQL or any other accesses. But in this Trash, you can have information about deletion data, who deleted and information to restore it.
go to post Dmitry Maslennikov · Oct 27, 2017 To have a possibility to edit files, you have to create a project, and copy existed classes to this project.You can look at this youtube playlist, to get more information about working with Atelier.
go to post Dmitry Maslennikov · Oct 16, 2017 It depends on, how long this string should be, and what do you expect to see there. The simplest way is just generating it with $random. set string="" set length=100 for i=1:1:length set string=string_$char($random(26)+97)
go to post Dmitry Maslennikov · Oct 15, 2017 Almost the same as you do on Windows, or as clean install. Just call ./cinstall And installer will offer to choose instance name, and if you put the same will offer to upgrade it.
go to post Dmitry Maslennikov · Sep 28, 2017 {value1,value2, value3} - is incorrect in JSON In JSON we have objects and arrays, every element in an object has name and value, while an array is a just list of values. So, object in this format. { "name": "value", "name2": "value2" } And array [ "value1", "value2" ] And anyway not sure what you want to do. Look at this article in the documentation about working with JSON in Caché. set arr = ["value1", "value2", "value3"] set iter = arr.%GetIterator() write !,"<switch> my value" while iter.%GetNext(.key, .value) { w !,"<case>",value,"</case>" } w !,"</switch>"
go to post Dmitry Maslennikov · Sep 27, 2017 Abstract class can have Storage definition, which will be the same for properties defined in abstract class for all children.Class marked with NoExtent flag does not have own storage definition and all children should have complete storage definition. And data in all those children will be stored separately.
go to post Dmitry Maslennikov · Sep 26, 2017 Could you add you pwershell script?And if you have some custom script on Caché side, it would be better to look at it as well?
go to post Dmitry Maslennikov · Sep 18, 2017 You can retrieve list of certificates in a way like this ClassMethod SSLConfigs() As %String { new $namespace set $namespace = "%SYS" set rs=##class(Security.SSLConfigs).ListNamesFunc() set result = "" while rs.%Next() { set result = result_$lb(rs.Name) } quit result } And result will be in $lb USER>w $lts(##class(User.Test).SSLConfigs()) Amazon,Google,ISC.FeatureTracker.SSL.Config