go to post Timothy Leavitt · May 16, 2016 These demos? https://github.com/intersystems?query=isc-iknow
go to post Timothy Leavitt · May 16, 2016 You could map the package containing the class related to that table using a package mapping, and the globals containing the table's data using global mappings.You can see which globals the class uses in its storage definition - since the entire package is mapped, it might make sense to add a global mapping with the package name and a wildcard (*).After taking those steps, you can insert to the table the way you usually would, without any special syntax or using zn/set $namespace.
go to post Timothy Leavitt · May 16, 2016 They track execution time: #define START(%msg) Write %msg Set start = $zh #define END Write ($zh - start)," seconds",!
go to post Timothy Leavitt · May 15, 2016 Nice. I'll add a section comparing the O(n) variations this week.
go to post Timothy Leavitt · May 13, 2016 Interesting. It might be related to the recipient's content then; I didn't see anything about that post, but I did get notified about content (answers) I'd added a while back that had not been changed.
go to post Timothy Leavitt · May 13, 2016 I've seen the same. I got an email that had a bunch of my own answers in it, although I hadn't changed any of them. What threads did you see in that email?
go to post Timothy Leavitt · May 12, 2016 Eduard, that actually does run faster for me than the $ListFromString/$ListNext approach (with the conversion included). Not including the conversion, $ListNext is still faster. (I've updated the Gist to include that example.)
go to post Timothy Leavitt · May 12, 2016 Thank you for pointing out both of those things!I'm not sure why I thought the end condition was evaluated each time. I'll update the post to avoid spreading misinformation.
go to post Timothy Leavitt · May 10, 2016 For what it's worth, I believe $Namespace is new'd before CreateProjection/RemoveProjection are called. At least, I was playing with this yesterday and there weren't any unexpected side effects from not including: new $Namespace in those methods. But it definitely is best practice to do so (in general). One effect of this I noticed yesterday is that if you call $System.OBJ.Compile* for classes in a different namespace in CreateProjection, they're queued to compile in the original namespace rather than the current one. Kind of weird, but perhaps reasonable; you can always JOB the compilation in the different namespace. Maybe there's some other workaround I couldn't find.
go to post Timothy Leavitt · May 9, 2016 This is a great article! One minor detail - MyPackage.Installer (or some other class) needs to declare the projection for the installer class to work as advertised. For example, in MyPackage.Installer itself, you could add: Projection InstallMe As MyPackage.Installer; The examples you referenced on GitHub include this.
go to post Timothy Leavitt · May 5, 2016 I don't think this is currently possible in Atelier. (I was looking for the same feature yesterday and couldn't find it.)Using Eclipse as a Java editor, the override menu option is Source -> Override/Implement Methods...; presumably, the equivalent feature in Atelier would be in the same place, but there's nothing like that in the "Source" menu.
go to post Timothy Leavitt · May 4, 2016 There was a similar question and answer at https://community.intersystems.com/post/how-include-dynaform-custom-task-form-ensemble-workflow that might be helpful.In short, the simplest solution (and possibly the only one) would be to put the Zen page in an <iframe> in a CSP page that EnsLib.Workflow.TaskRequest.%FormTemplate points to.
go to post Timothy Leavitt · Apr 30, 2016 I really would recommend creating a %All namespace (if there isn't already one), via %Installer or something that works similarly.One projects on the intersystems-ru github, Caché Web Terminal, has the same requirement (use from any namespace); this class might be helpful for reference: https://github.com/intersystems-ru/webterminal/blob/master/export/WebTerminal/Installer.xml. It doesn't actually use %Installer, so configuration changes are implemented in COS instead of being generated based on XML, but it works similarly.Particularly, see methods CreateAllNamespace and Map/UnMap. You should be able to adapt these without too much effort. If your code coverage project eventually has a UI, then the web application setup method will be useful too (for simple installation).
go to post Timothy Leavitt · Apr 30, 2016 See the documentation on the special %ALL "namespace".%ALL allows for globals/routines/packages to be mapped to all namespaces. Your %Installer (if you're using one) can check to see if this is set up and create it if not, and add the mappings. You might want to map the packages and perhaps system-wide settings your code uses, but perhaps not any namespace-specific data.
go to post Timothy Leavitt · Apr 27, 2016 That's true.Some developers like to use #dim to declare all the variables they expect to create. In Studio, Tools > Options..., Environment > Class, there's an "Option Explicit" option that will give you warnings if you use a variable that hasn't been #dim'd. (The "Track Variables" option is also very useful.)
go to post Timothy Leavitt · Apr 27, 2016 Sure - although it'd be a property, not a parameter. Looking at utcov.ClassLookup (glad to see it's not %utcov now, by the way), this should work fine for you. Here's a sample: Class Sample.ClassQueryProperty Extends %RegisteredObject { Property SubclassQuery As %SQL.Statement [ InitialExpression = {##class(%SQL.Statement).%New()}, Private, ReadOnly ]; Method %OnNew() As %Status [ Private, ServerOnly = 1 ] { Quit ..SubclassQuery.%PrepareClassQuery("%Dictionary.ClassDefinition","SubclassOf") } Method Demo() { Set tRes = ..SubclassQuery.%Execute("%UnitTest.TestCase") While tRes.%Next(.tSC) { $$$ThrowOnError(tSC) Write tRes.%Get("Name"),! } $$$ThrowOnError(tSC) } } Then: SAMPLES>d ##class(Sample.ClassQueryProperty).%New().Demo() %UnitTest.IKnowRegression %UnitTest.PMMLRegression %UnitTest.SQLDataRegression %UnitTest.SQLRegression %UnitTest.SetBuilder %UnitTest.TSQL %UnitTest.TestCacheScript %UnitTest.TestProduction %UnitTest.TestScript %UnitTest.TestSqlScript Wasabi.Logic.Test.InventoryTest Wasabi.Logic.Test.PricingTest
go to post Timothy Leavitt · Apr 25, 2016 In addition to %IsA (or, similarly, %Extends, which considers multiple inheritance rather than just primary superclasses), the following snippet (slightly modified from an answer I posted on one of your previous questions) may be helpful if you're looking for all of the names of unit test classes: Set tStmt = ##class(%SQL.Statement).%New() $$$ThrowOnError(tStmt.%PrepareClassQuery("%Dictionary.ClassDefinition","SubclassOf")) Set tRes = tStmt.%Execute("%UnitTest.TestCase") While tRes.%Next(.tSC) { $$$ThrowOnError(tSC) //TODO: something with tRes.%Get("Name") } $$$ThrowOnError(tSC) If you're filtering by package - and it looks like https://github.com/litesolutions/cache-utcov/blob/master/src/utcov/ClassLookup.cls does this - then you can supply a second argument to the SubclassOf query with the package name for better performance. (i.e., Set tRes = tStmt.%Execute("%UnitTest.TestCase","Some.Package.Name.")) All of these approaches work recursively. (C extends B, B extends A -> C extends A.)
go to post Timothy Leavitt · Apr 22, 2016 The SVG diagram is loaded in Eclipse's internal browser, which will always be IE for you. The preference you found applies to "external" browsers. Within the internal browser in Eclipse, you can right click and select "view source." When you do so, you should see something like this near the top: <meta http-equiv="X-UA-Compatible" content="IE=9" /> It would be interesting to know what <meta> tag you see, if any. It would also be useful to know the value of the User-Agent header sent by the internal browser. There are several ways to find that; here's one quick option: Open a BPL class in AtelierRun the following code in Terminal: k ^%ISCLOG s ^%ISCLOG = 2 read x s ^%ISCLOG = 0 In Atelier, right click in the BPL class and click the "Open diagram editor" popup menu itemHit enter in Terminal to stop logging. If you then zwrite ^%ISCLOG you should see the user-agent in a $listbuild list near the end of the output. I see: ^%ISCLOG("Data",180,0)=$lb(900,,0,5532241409,"0²!t"_$c(28,16)_"IÎ"_$c(22)_"F40"_$c(133)_"¯4_ài"_$c(156)_"èB_9}%"_$c(144,155,9)_"!`"_$c(135)_"ü",2,"ENSDEMO","001000010000OoTvE12bLJWATFMLUAodU0gK1Z8HvjdbJWLK3M",,0,"en-us","OoTvE12bLJ",2,1,"/csp/ensdemo/",$lb("UnknownUser","%All","%All",64,-559038737),"","","","2016-04-22 13:28:27","2016-04-22 13:28:30","","Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Win64; x64; Trident/6.0)","","",0,"",$lb($lb("%ZEN.SessionEvents","ENSDEMO",)),"","%iscmgtportal:5ykW4kOfOzwr7O8gcok8XQ--",0,"","","","","") (It's awesome how IE says it's Mozilla, for compatibility reasons.)
go to post Timothy Leavitt · Apr 21, 2016 You're really close; the key is using the stream's OID (from %Oid()). Here's a simple example; you can substitute any appropriate file path. Class Demo.DynamicImage Extends %ZEN.Component.page { /// This XML block defines the contents of this page. XData Contents [ XMLNamespace = "http://www.intersystems.com/zen" ] { <page xmlns="http://www.intersystems.com/zen" title=""> <image id="myImage" src="" /> <button onclick="zenPage.ChangeImage(zen('myImage'))" caption="Dynamically Change Image" /> </page> } ClassMethod ChangeImage(pImage As %ZEN.Component.image) [ ZenMethod ] { Set tStream = ##class(%Stream.FileBinary).%New() Do tStream.LinkToFile(##class(%File).ManagerDirectory()_"..\CSP\broker\images\einstein.jpg") Set tOID = ..Encrypt(tStream.%Oid()) Set pImage.src = "%25CSP.StreamServer.cls?STREAMOID="_tOID } } I'm really curious what that image is doing in /csp/broker/...
go to post Timothy Leavitt · Apr 21, 2016 I think this was a caution for anyone changing their username, since it's shared across InterSystems' sites/applications.IIRC you use CCR (Change Control Record). The username change may prevent you from using the version control integration in that application. It might be good to ensure that it's still working, or at least to make a note that if it doesn't work, you'll need to change the username back (and then probably log out and back in again for the change to take effect in CCR).Others may not be impacted as much.