go to post Timothy Leavitt · Nov 16, 2020 re: "creative minds" - been there, done that, should probably put it on the Open Exchange at some point... ;)
go to post Timothy Leavitt · Nov 16, 2020 From my experience, foreign keys are really underrated/underused among ObjectScript developers. With relationships you don't need to worry about them, but really any time you have an object-valued property (not a relationship) there should almost certainly be a foreign key defined on it. (Same thing goes of course for non-object references to uniquely identifying fields in other tables.)
go to post Timothy Leavitt · Oct 19, 2020 Neat - I'm looking at EnsLogViewer and it seems like the "MultiType" class query is a good example of this. https://github.com/intersystems-ru/EnsLogViewer/blob/master/EnsPortal/Ev...
go to post Timothy Leavitt · Oct 16, 2020 I'm currently looking in to this and hope to have it fixed in short order. Thank you for letting us know. We apologize for the inconvenience and will let you know once the issue has been addressed.
go to post Timothy Leavitt · Oct 16, 2020 @Azezur Rahman - I'd appreciate if you could confirm that everything is working properly for you now.
go to post Timothy Leavitt · Oct 16, 2020 This issue has been resolved. Thank you again for notifying us.
go to post Timothy Leavitt · Oct 1, 2020 Code Snippets do part of the job; for other things (e.g., SOAP Wizard), see @Patrick Newton 's comment on https://github.com/intersystems-community/vscode-objectscript/issues/325 - there is planned support for these.
go to post Timothy Leavitt · Sep 21, 2020 I already use this approach as much as possible, both for the applications I develop and my Open Exchange projects. It makes it easy to trace from test to tested unit, and (in the community package manager world) it avoids collisions between different packages all trying to use the same unit test package. I strongly agree with Evgeny's recommendation.
go to post Timothy Leavitt · Sep 10, 2020 @Olga Zavrazhnova , it looks like we have a bad link at https://community.intersystems.com/post/global-masters-advocate-hub-star... (leading to the certificate error shown). @Kevin Johnson see https://intersystems.influitive.com/users/sign_in instead of the link in that article
go to post Timothy Leavitt · Aug 31, 2020 FYI, we're looking to add automatic OpenAPI generation to https://github.com/intersystems/apps-rest at some point in the reasonably-near future. (We had an intern work on it over the summer, and are just kicking the tires on it a bit on our own REST models/APIs before unleashing it on the world.)
go to post Timothy Leavitt · Aug 25, 2020 I'm intrigued to hear about expression indices - sounds really cool. Without those, another option is just to have a separate class/table. Suppose the key to the AR array is the address type (Home, Office, etc.); then you could have: Class Sample.Person1 Extends (%Persistent, %Populate) { Property Name As %String; Relationship Addresses As Sample.PersonAddress [ Cardinality = children, Inverse = Person ]; } Class Sample.PersonAddress Extends (%Persistent, %Populate) { Relationship Person As Sample.Person1 [ Cardinality = parent, Inverse = Addresses ]; Property Type As %String; Property Address As Sample.Address; } Sample.PersonAddress then can have whatever plain old normal indices you want (except bitmap indices - if you want those, make it one-to-many instead of parent/child). Generally: any time you add an array property - especially an array of objects - it's worth stepping back and thinking about whether it should just be its own full-blown class/table.
go to post Timothy Leavitt · Aug 25, 2020 I'll add, a query on this might look like: select distinct Person->ID, Person->Name from Sample.PersonAddress where Address_State = 'RI' and Type = 'Home' Note the "arrow syntax" for implicit joins.
go to post Timothy Leavitt · Aug 12, 2020 @Richard Schilke , you should be able to share a session by specifying the same CSP session cookie path for your REST web application and the web application(s) through which your Zen pages are accessed. Alternatively, you could assign the web applications the same GroupById in their web application configuration. You likely also need to configure your REST handler class (your subclass of AppS.REST.Handler) to use CSP sessions (from your earlier description, I assumed you had). This is done by overriding the UseSession class parameter and setting it to 1 (instead of the default 0). To reference header data in the UserInfo classmethod, you should just be able to use %request (an instance of %CSP.Request) and %response (an instance of %CSP.Response) as appropriate for request/response headers.
go to post Timothy Leavitt · Aug 12, 2020 @Richard Schilke - great! We have support for filtering/sorting on the collection endpoints already, though perhaps not fully documented. Pagination is a challenge from a REST standpoint but I'd love to add support for it (perhaps in conjunction with "advanced search") at some point. I'm certainly open to ideas on the implementation there. :) Users are the best, because if you don't have them, it's all just pointlessly academic. ;)
go to post Timothy Leavitt · Aug 12, 2020 @Richard Schilke - on further review, it's an issue with the Action map. See my response in https://github.com/intersystems/apps-rest/issues/7 (and thank you for filing the issue!). I'll still create a new release soon to pick up the projection bug you found. Regarding headers - you can reference %request anywhere in the REST model classes, it just breaks abstraction a bit. (And for the sake of unit testing, it would be good to behave reasonably if %request happens not to be defined, unless your planning on using Forgery or equivalent.) Regarding sessions - yes, you can share a session with a Zen application via a common session cookie path or using GroupById. You can reference this as needed as well, though I'd recommend wrapping any %session (or even %request) dependencies in the user context object that gets passed to CheckPermissions().
go to post Timothy Leavitt · Aug 12, 2020 @Richard Schilke I'm planning to address it tomorrow or Friday. Keep an eye out for the next AppS.REST release on the Open Exchange - I'll reply again here too. (This will also include a fix for the other issue you reported; I've already merged a PR for that.)
go to post Timothy Leavitt · Aug 11, 2020 On IRIS there's $zu(209,code) - e.g.: USER>w $zu(209,3) <3> The system cannot find the path specified. In IRIS 2020.1+ you don't need the $zu: USER>w $System.Util.GetOSErrorText(3) <3> The system cannot find the path specified. AFAIK there's no Caché/Ensemble equivalent. (Or maybe this is in newer Caché/Ensemble versions.)
go to post Timothy Leavitt · Aug 11, 2020 Ack - I meant Caché/Ensemble. Clarified; thanks, and thanks for pointing out that it does work on Caché 2018.1.2.
go to post Timothy Leavitt · Aug 10, 2020 Thanks for posting - I'm taking a look now. This issue is starting to ring a bell; I think this looks like a bug we fixed in another branch internally to my team. (I've had reconciling the GitHub branch and our internal branch on my list for some time - I'll try to at least get this fix in, soon.) Re: customizing mappings of relationship/object properties, see https://docs.intersystems.com/healthconnectlatest/csp/docbook/Doc.View.cls?KEY=GJSON_adaptor#GJSON_adaptor_xdata_define - this is doable in %JSON.Adaptor mapping XData blocks via the Mapping attribute for an object-valued property included in the mapping.