go to post Herman Slagman · Jun 27, 2022 Yes, it can, ECP seems to be compatible between IRIS and Ensemble (or Cache)We will use it for migration to IRIS too, first add an IRIS ASync member to the mirror and then later promote it.We only have done this in a test scenario, so no guarantee ;-) Herman
go to post Herman Slagman · Mar 14, 2022 The only way you could accomplish this is by watching the journal files, there would be journals like "Set Global" and "Kill Global"
go to post Herman Slagman · Dec 20, 2021 This seems to work: Method %OnNew(InitVal As %String) As %Status{Do ..HTMLZIPDoc.%LocationSet("c:\temp\zips")Return $$$OK}
go to post Herman Slagman · Dec 10, 2021 Open the ClassDefinition: Set ClassDef=##class(%Dictionalry.ClassDefinition).%OpenId(ClassName)Add the Parameter Set Parm=##class(%Dictionary.ParameterDefinition).%New(ClassName_":"_ParameterName)Set Parm.Default=ParameterValueDo ClassDef.Parameters.Insert(Parm) Find the desired method in ClassDef.Methods collection by MethDef.NameUse the MethDef.Implementation stream to manipulate the codeCompile the class.
go to post Herman Slagman · Dec 7, 2021 I don't know if this is the case, but be sure not to output anything before setting Content-Type or HTTP status.In my case it was a debug Write statement that wrote directly to the current TCP stream.Because of IO redirect when something is written to the stream (the HTTP body) first the headers must be written and those are at that time the default values.
go to post Herman Slagman · Nov 5, 2021 But it's not about the front-end, you can use any you like.The power of CSP is in the back-end: hybrid server-side rendering, seamless integration with Classes, #server/#call.If you are developing an InterSystems-only web application, not using CSP would be foolish.You can still use Bootstrap, Tailwind, etc for the UI sugar, but for data integration and routing there's no match.
go to post Herman Slagman · Aug 5, 2021 Did you put a space (or a tab) at the beginning of the line ?<tab>Write "xxx"
go to post Herman Slagman · May 26, 2021 You'll have to put the Try-Catch construct at the same dot-level: If 1 Do . Try { . Write a=b . } Catch e { . ZWrite e . }
go to post Herman Slagman · Feb 17, 2021 ClassMethod CreateApplication() As %Status [ CodeMode = objectgenerator ]{Set $ZTrap="Error"Set sc=$$$OKWrite !,"Creating Mitz API",!Set Here=$NamespaceSet URL="/mitz"Set $Namespace="%SYS"If ##class(Security.Applications).Exists(URL) {Write "Mitz API already exists",!} Else {Set Props("Name")=URLSet Props("NameSpace")=HereSet Props("Description")="Mitz notificatie API endpoint"Set Props("AutheEnabled")=64Set Props("DispatchClass")="LSP.Mitz.API"Set Props("MatchRoles")=":%All"Set Props("Type")=2 ; CSP AppSet sc=##class(Security.Applications).Create(URL,.Props)}Set $Namespace=HereReturn scErrorSet $ZTrap=""If $Data(Here) Set $Namespace=HereReturn $$$ERROR($$$GeneralError,"ErrorTrap: "_$ZError)}
go to post Herman Slagman · Oct 12, 2019 About RESTfull... /search isn't really RESTfull, REST works on Resources (e.g. /persons or /orders) To query Resources you use GET (with parameters) But this is all very 'religious'. To use POST for a complex query is IMO defendable, but then I would do that on a Resource. You should have a look at the OData (Oasis) specification: https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata
go to post Herman Slagman · Sep 19, 2018 The Write obj.%ToJSON() writes to the TCP stream of the HTTP Response, the headers are written before the body.You' have to call the ReportHttpStatusCode first (which is nothing more then: Set %response.Status=HttpStatus) and then write the body.
go to post Herman Slagman · Nov 10, 2017 As I recall Character-type streams always translate to Unicode.You could try a Binary stream, which does not do any translationHTH
go to post Herman Slagman · Oct 5, 2017 Recently we've found out that Cache is getting stricter with regards to it's TCP licensing.To be recognized as a SOAP message, it needs to have a SOAPACTION header and proper SOAP Envelopes.After we had fixed that, license consumption went back to normal.HTH
go to post Herman Slagman · Sep 18, 2017 What version of Cache are you running ? We had a similar issue with %Open, it was a bug: there was a leak in $ZE variable, which was fixed by change DLP3616 - Object Storage - complete object initialization when %LoadData fails. The change now reset $ZE="" on start of %LoadData method. 2016.2.1 (Build 803_0_16949U) Maybe it is related
go to post Herman Slagman · Jul 11, 2017 Do ##class(%Dictionary.ClassDefinition).%DeleteId("Test.Class") Set ClassDef=##class(%Dictionary.ClassDefinition).%New() Set ClassDef.Name="Test.Class" Set ClassDef.Super="%Persistent" Set ClassDef.ProcedureBlock=1 Set MethDef=##class(%Dictionary.MethodDefinition).%New() Set MethDef.Name="Name" Set MethDef.ReturnType="%String" ; Uncomment for ClassMethod ; Set MethDef.ClassMethod=1 Set MethDef.FormalSpec="First:%Boolean,Second:%String=""Default""" Do MethDef.Implementation.WriteLine($Char(9)_"If First Return 1") Do MethDef.Implementation.WriteLine($Char(9)_"Return Second") Set MethDef.parent=ClassDef Do ClassDef.Methods.Insert(MethDef) Do ClassDef.%Save()
go to post Herman Slagman · Jul 9, 2017 Will you be able to use the Atelier REST services ?%Api.Atelier.v1.GetDoc
go to post Herman Slagman · Jun 14, 2017 You can use XSLT to do this: ClassMethod Run(){ Set XML=##class(%Dictionary.CompiledXData).%OpenId(..%ClassName(1)_"||XML").Data Set XSLT=##class(%Dictionary.CompiledXData).%OpenId(..%ClassName(1)_"||XSLT").Data Set sc = ##class(%XML.XSLT.Transformer).TransformStream(XML, XSLT, .Result,, .Params,) Do Result.OutputToDevice()}XData XML{<?xml version="1.0" encoding="UTF-8" ?><SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'> <SOAP-ENV:Header><SomeCustomHeader/> </SOAP-ENV:Header> <SOAP-ENV:Body><SomeCustomBody/></SOAP-ENV:Body></SOAP-ENV:Envelope>}XData XSLT {<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template></xsl:stylesheet>}