go to post Timothy Leavitt · Jun 7, 2023 Hi - I'd recommend looking at https://github.com/intersystems/git-source-control and watching a few of these videos: https://www.youtube.com/watch?v=elVQEU9MitE&pp=ygUuZ2l0IHNocmFlZCBkZXZlb... https://www.youtube.com/watch?v=Fh0uyC9owyE&pp=ygUuZ2l0IHNocmFlZCBkZXZlb... https://www.youtube.com/watch?v=QIb2ksEXdHk&pp=ygUuZ2l0IHNocmFlZCBkZXZlb...
go to post Timothy Leavitt · May 31, 2023 I've always wanted my Zen tablePane (T-Pain, as we call them for short) to be able to use autotune. So glad this is finally possible in 2022.1. Brings me back to the golden days in the late '00s where we did lots of things that seemed really cool at the time and feel kind of silly now.
go to post Timothy Leavitt · May 16, 2023 Solution was ultimately to just use a class and the CSPURL parameter. (Context: https://github.com/intersystems/git-source-control/pull/255 )
go to post Timothy Leavitt · May 16, 2023 I'll add to this, we use the same "embedded" source control behavior across Studio and VSCode for my team within InterSystems, and haven't had issues. @Richard Filoramo , one question re: TrackWare - do you know offhand which "Actions" and "Other Studio actions" it uses in the UserAction method from %Studio.Extension.Base (see class reference)? There are some limitations/differences between VSCode and Studio but they're on things we see as either less common or undesirable to support from VSCode. One such case we've previously deemed "undesirable" is Action = 3, "Run an EXE on the client. The Target is the name of an executable file on the client machine. It is the responsibility of the customer to ensure this EXE is installed in a suitable location." Your statement that your source control system is written in ObjectScript and Delphi makes me think this might matter to you. More generally, @Brett Saviano , there may be other aspects of complete support for the interface defined in %Studio.Extension.Base to consider.
go to post Timothy Leavitt · May 15, 2023 @Evgeny Shvarov I have a detailed writeup here (although Dmitry already hit the important point re: IPM): https://community.intersystems.com/post/unit-tests-and-test-coverage-obj... A few other notes: Unit test class instances have a property (..Manager) that refers to the %UnitTest.Manager instance, and may be helpful for referencing the folder from which unit tests were loaded (e.g., to load additional supporting data or do file comparisons without assuming an absolute path) or "user parameters" / "user fields" that were passed in the call to run tests (e.g., to support running a subset of tests defined in unit test code). Sure, you could do the same thing with PPGs or % variables, but using OO features is much better. I'll also often write unit tests that do setup in OnBeforeAllTests and cleanup in %OnClose, so that even if something goes very horribly wrong it'll have the best chance of actually running. Properties of the unit test are useful to store state relevant to this setup - the initial $TLevel (although that should always be 0), device settings, global configuration flags, etc.
go to post Timothy Leavitt · May 12, 2023 @Michael Breen - is a 10 on the scale of 1-10 "super crazy hard" or "super crazy easy"?
go to post Timothy Leavitt · May 10, 2023 This is a much cleaner option, of course. :) (I have other constraints that led me to not go this route in the first place.)
go to post Timothy Leavitt · May 10, 2023 On the other hand, if you use: classmethod="##(+$Piece($STACK($STACK-3,"PLACE"),"+",2)<10)##" Then it'll happily compile instance methods, and your successor and someone in the WRC will have probably a good laugh when your application randomly breaks in 2-10 years.
go to post Timothy Leavitt · May 10, 2023 Turns out that it's as simple as putting classmethod="0" in your <script> tag... and then getting a helpful error message on compilation that you can't actually do that in a CSP page. 😂
go to post Timothy Leavitt · May 10, 2023 That's a fair question. In my specific case, I'm trying to write a tag-based CSP page that extends %CSP.WebSocket, which involves overriding instance methods.
go to post Timothy Leavitt · May 1, 2023 https://stackoverflow.com/questions/72917224/ls-l-in-docker-shows-questi... has better info and I was able to work around the issue in question by doing something I don't want to admit to doing. (Ultimately the root cause is old infrastructure where I'm deploying the container.)
go to post Timothy Leavitt · May 1, 2023 I'm running a container based on intersystemsdc/iris-community:latest. Was able to get into the filesystem and found weird ??????s in permissions, similar to https://stackoverflow.com/questions/52195175/strange-file-permission-in-... - I'm going to try rebuilding and if that doesn't work try restarting the docker service on the host where things aren't working.
go to post Timothy Leavitt · May 1, 2023 The full log I get (running without -d) is exactly the same as above.
go to post Timothy Leavitt · Apr 24, 2023 Hi @Michael Davidovich - it's been a while! Here's a quick sample for how I'd do this: Class Mike.Demo.REST Extends %CSP.REST { /// This method gets called prior to dispatch of the request. Put any common code here /// that you want to be executed for EVERY request. If pContinue is set to 0, the /// request will NOT be dispatched according to the UrlMap. In this case it's the /// responsibility of the user to return a response. ClassMethod OnPreDispatch(pUrl As %String, pMethod As %String, ByRef pContinue As %Boolean) As %Status { #dim %request As %CSP.Request Set pContinue = 0 Set version = %request.GetCgiEnv("HTTP_X_API_VERSION","unspecified; use X-API-VERSION header") Set class = $Case(+version, 1:"Mike.Demo.v1", 2:"Mike.Demo.v2", :"") If (class = "") { Set error = $$$ERROR($$$GeneralError,$$$FormatText("Invalid API version: %1",version)) // Shoud be HTTP 400, but you probably want to report this differently/better. Do ..ReportHttpStatusCode(..#HTTP400BADREQUEST,error) Quit $$$OK } Quit $classmethod(class,"DispatchRequest",pUrl,pMethod,1) } } Class Mike.Demo.v1 Extends %CSP.REST { Parameter VERSION = 1; XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ] { <Routes> <Route Url="/version" Method="GET" Call="GetVersion" /> </Routes> } ClassMethod GetVersion() As %Status { Write {"version":(..#VERSION)}.%ToJSON() Quit $$$OK } } Class Mike.Demo.v2 Extends Mike.Demo.v1 { Parameter VERSION = 2; XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ] { <Routes> <Route Url="/version" Method="GET" Call="GetVersion" /> </Routes> } }
go to post Timothy Leavitt · Apr 19, 2023 I'll add - this is particularly helpful in conjunction with localization and used heavily in IRIS' own localization of e.g. error messages.
go to post Timothy Leavitt · Apr 19, 2023 The standard approach for this in ObjectScript is the $$$FormatText macro - for example: Class Demo.Text { ClassMethod Sample() { Write $$$FormatText("Watch out %1, it's a %2!","Superman","large pizza made of Kryptonite") } } Results in: d ##class(Demo.Text).Sample() Watch out Superman, it's a large pizza made of Kryptonite!
go to post Timothy Leavitt · Apr 13, 2023 This is exactly why my quick-and-dirty approach didn't (seem to?) work in a first quick attempt. ExportToStream/LoadStream it is! (for context, this is moving class definitions over in conjunction with changing routine mappings)
go to post Timothy Leavitt · Apr 12, 2023 Set source = "NAMESPACE1" Set target = "NAMESPACE2" Kill ^|target|oddDEF(classname) Merge ^|target|oddDEF(classname) = ^|source|oddDEF(classname) New $Namespace Set $Namespace = target $$$ThrowOnError($System.OBJ.Compile(classname,"ck")) EDIT: Don't do this. Everybody should ignore me and do what @Chad Severtson said instead.
go to post Timothy Leavitt · Apr 7, 2023 You can use parameters on the return type. For example: Class DC.Demo.SqlProcCollation { ClassMethod Test() As %String [ SqlProc ] { return "Abe Lincoln" } ClassMethod Test2() As %String(COLLATION="SQLUPPER") [ SqlProc ] { return "Abe Lincoln" } } Given that: select DC_Demo.SqlProcCollation_Test(),DC_Demo.SqlProcCollation_Test2() where DC_Demo.SqlProcCollation_Test() = 'ABE LINCOLN' Returns no results select DC_Demo.SqlProcCollation_Test(),DC_Demo.SqlProcCollation_Test2() where DC_Demo.SqlProcCollation_Test2() = 'ABE LINCOLN' Returns 1 row