go to post Eduard Lebedyuk · Oct 16, 2018 There are far more efficient ways to do that.Move tables you want shared into a separate Namespace with separate Code/Data databases.Map your data and code into original namespace.Verify that it all works as expected. So far it should work as before.Create a mirroring configuration.Add 2 created databases to the mirror configuration.Add second server as a DR mirror.Move databases to a DR mirror and mount them there.(Optional) Create a namespace with 2 mirrored databases.Add desired mappings on a second system.Docs.
go to post Eduard Lebedyuk · Oct 9, 2018 Do you have IMAP available?If not you can use DavMail to convert exchange to POP3 and that's easily consumable from InterSystems IRIS.
go to post Eduard Lebedyuk · Sep 23, 2018 JVM is probably out of memory. Try this.1. Define Excel server at SMP > System > Configuration > Zen Report Excel Servers > Zen Report Excel Server, let's say at port 444442. Start it. Copy OS command. Should be something like: C:\InterSystems\Ensemble\lib\ExcelExporter\runserver.bat -port 44444 -numthreads 5 -loglevel 3 -maxlogfilesize 32000 -logrotationcount 100 -numpingthreads 5 -pingport 44445 2>&1 3. Stop Excel server 4. Execute the command from 2 in OS terminal, but set JVM heap size. See how. 5. In your ZEN report add: Parameter EXCELSERVER = 44444; to use your excel server. 6. Recompile report and try to run it again.
go to post Eduard Lebedyuk · Sep 18, 2018 It's better to use file streams. Set stream = ##class(%Stream.FileCharacter).%New() Set sc = stream.LinkToFile("E:\test\file.txt") Do stream.Write("Some Text") Set sc = stream.%Save()
go to post Eduard Lebedyuk · Sep 18, 2018 To get queues list call: Call EnsPortal.Queues_EnumerateQueues() Or SELECT * FROM EnsPortal.Queues_EnumerateQueues()
go to post Eduard Lebedyuk · Sep 14, 2018 You need to add POST route: Class Rest.UsuarioSvc Extends %CSP.REST { XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ] { <Routes> <Route Url="/Oi/:xpto" Method="GET" Call="Oi"/> <Route Url="/Oi/:xpto" Method="POST" Call="Oi"/> </Routes> } ClassMethod Oi(xpto As %String) As %Status { Set tSC = $$$OK If 'tSC Quit tSC Set tProxy = ##class(%ZEN.proxyObject).%New() Set tProxy.Oi = xpto _ "1234" Set %response.ContentType = "application/json" set %response.Status = 200 Do tProxy.%ToJSON() Quit tSC } }
go to post Eduard Lebedyuk · Sep 14, 2018 I'd try to avoid giving user an ability to enter arbitrary code.1. Offer user a list of predefined operations ( >,<,=,<> or Equals,More, Not Equals,...)2. Get input from user.3. Check that input is actually one option on a list and not something else. 4. Perform the check using IF, for example. ClassMethod main(a As %Integer, b As %Integer, operation As %String(VALUELIST="Equals,Not Equals") = "Equals") As %Boolean { set operationList = $lb("Equals", "Not Equals") throw:'$lf(operationList, operation) ##class(%Exception.General).%New("<INVALID OPERATION>") if operation = "Equals" { set result = (a = b) } elseif operation = "Not Equals" { set result = (a '= b) } else { throw ##class(%Exception.General).%New("<INVALID OPERATION>") } quit result }
go to post Eduard Lebedyuk · Sep 11, 2018 I think I encountered something similar. I added to target class: Class Proxy.Class Extends (%Persistent, %XML.Adaptor) { Parameter XMLIGNOREINVALIDTAG =1; Parameter XMLIGNOREINVALIDATTRIBUTE= 1; ... } And it helped.
go to post Eduard Lebedyuk · Sep 7, 2018 To create one property call: http://127.0.0.1:52773/api/docdb/v1/NamespaceName/db/DBName/propertyName?type=propertyType&path=propertyPath&unique=propertyUnique You'll need one call per property. For your property Ergebniszuf, url would be: http://127.0.0.1:52773/api/docdb/v1/NamespaceName/db/DBName/Ergebniszuf?type=%String&path=Ergebniszuf&unique=0
go to post Eduard Lebedyuk · Sep 6, 2018 Just add empty string as is: ClassMethod Test(val = "") { Set t = ##class(Forerun.Test).%New() Do t.ReviewedBy.Insert(val) $$$THROWONERROR(tSC, t.%Save()) Set id = t.%Id() Set user = "me" &SQL(UPDATE Test.Test SET ReviewedBy = ReviewedBy||$ListBuild(:user) WHERE ID=:id ) If SQLCODE<0 Write "Problem",! Quit }
go to post Eduard Lebedyuk · Sep 6, 2018 Usually response does contain status information in StatusCode and StatusLine properties.You need to change this line Set httpResponse = httpRequest.Post("/sample/", 2) to #dim sc As %Status = $$$OK Set sc = httpRequest.Post("/sample/", 2) Write $System.Status.GetErrorText(sc) As Post method returns status. After debugging you can use write $$$ISERR(sc) macro to check if result of some operation is an error.
go to post Eduard Lebedyuk · Sep 5, 2018 it causes error messages as something in the class is not correct,What error messages?Also try calling zwrite %objlasterror it may contain additional information.
go to post Eduard Lebedyuk · Sep 4, 2018 You can use methods of %Activate.TLEnumerator class to load libraries programmatically.
go to post Eduard Lebedyuk · Sep 3, 2018 Redefine HTTP adapter like this: Class Production.Adapter.HTTPOutboundAdapter Extends EnsLib.HTTP.OutboundAdapter { /// Send a POST to the configured Server, Port and URL, sending form data to the named form variables. Method Post(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) As %Status { quit ..SendFormDataArray(.pHttpResponse, "POST", ..GetRequest(), .pFormVarNames, .pData) } ClassMethod GetRequest() As %Net.HttpRequest { set request = ##class(%Net.HttpRequest).%New() set request.ContentType = "application/json" quit request } } And use it instead of default adapter.
go to post Eduard Lebedyuk · Aug 31, 2018 Try this:1. Write stream to string2. Use $zcvt on string $zcvt(string,"O","UTF8")3. Send this stream to XSLT
go to post Eduard Lebedyuk · Aug 27, 2018 Cache private web server is configured and available by default.If System Management Portal opens then private server works.Here's a good tutorial on developing Angular applications on Caché.
go to post Eduard Lebedyuk · Aug 27, 2018 Please check the output: set result = ##Class(%File).Delete(fileNamewithPath, .status) zw result zw status
go to post Eduard Lebedyuk · Aug 24, 2018 There are several ways to do that. Let's say you have a persistent property Property Problem As %String; That you don't want anyone to see. 1. Make it private: Property Problem As %String [ Private ]; It would not be displayed altogether 2. Add accessor methods: Property Problem As %String; Method ProblemGet() As %String [ ServerOnly = 1 ] { Quit "****" } Method ProblemRealGet() { Quit i%Problem2 } Method ProblemSet(Arg As %String) As %Status [ ServerOnly = 1 ] { Set i%Problem2 = Arg Quit $$$OK } This way default callers would get **** and only your app code can access the real value. 3. Do not project property to XML Property Problem As %String(XMLPROJECTION = "none"); As ensemble message viewer is XML-based it would hide property from it. 4. Create a special datatype. For example MyApp.Datatype.Password datatype returns **** as Display and ODBC values: Class MyApp.Datatype.Password Extends %String { ClassMethod LogicalToDisplay(%val As %String) As %String [ Internal ] { q $case(%val,"":"",:"*****") } ClassMethod LogicalToOdbc(%val As %String) As %String [ Internal ] { q $case(%val,"":"",:"*****") } } To use it: Property Problem As MyApp.Datatypes.Password; 5. Extract the property into a separate class and reference the object of that class. These approaches could be combined.