go to post Eduard Lebedyuk · Apr 9, 2018 Right. Forgot about it. You can use ghostscript, here's how. In your case command would probably look like this: Parameter COMMAND = "%1 -dBATCH -dNOPAUSE -sDEVICE=txtwrite -sOutputFile=%2 %3"; ClassMethod pdf2txt(pdf, txt) As %Status { set cmd = $$$FormatText(..#COMMAND, ..getGS(), txt, pdf) return ..execute(cmd) } /// Get gs binary ClassMethod getGS() { if $$$isWINDOWS { set gs = "gswin64c" } else { set gs = "gs" } return gs } Execute method code. Also note, that PDF can contain only images instead of text. in that case you'd need OCR.
go to post Eduard Lebedyuk · Apr 9, 2018 You can convert Doc/PDF into plaintext using LibreOffice and read that from Cache. Here's an article on working with LibreOffice from Cache.
go to post Eduard Lebedyuk · Apr 7, 2018 Yes, to skip exporting storage you need to specify compilation flag: /skipstorage=1 Description Name: /skipstorage Description: In class Export, if true do not export storage definition. Type: logical Default Value: 0 You can set it: System-wideAs a Namespace defaultFor Atelier only: Project -> Compile Configuration System and namespace defaults could be set via: Set sc = $System.OBJ.SetQualifiers(qualifiers, system)
go to post Eduard Lebedyuk · Apr 6, 2018 If you want to enable/disable/modify several ensemble hosts, it's better to update them without updating production first and after that update production. Maybe your error is caused by racing production updates. Also add longer timeout on production update. set sc = ##class(Ens.Director).EnableConfigItem("Item1", 1, 0) write:'sc $System.Status.GetErrorText(sc) set sc = ##class(Ens.Director).EnableConfigItem("Item2", 1, 0) write:'sc $System.Status.GetErrorText(sc) set sc = ##class(Ens.Director).UpdateProduction(60) write:'sc $System.Status.GetErrorText(sc)
go to post Eduard Lebedyuk · Apr 6, 2018 Definitely, try Stay Connected = 5 so the connection would drop five seconds after data transfer.
go to post Eduard Lebedyuk · Apr 6, 2018 Hello. Mount remote drive as a folder on your local disk (C or D).UPD. Please stop spamming the same question in multiple comments. If you want discussion, you can start ask a new question and @mention users.
go to post Eduard Lebedyuk · Apr 5, 2018 $translate would be better here write $translate("12 500", " ") To remove everything except numbers use $zstrip: write $zstrip("12 500", "*E'N")
go to post Eduard Lebedyuk · Apr 4, 2018 kill ^ISCSOAP But check ^ISCSOAP("LogFile") first and delete that file too.
go to post Eduard Lebedyuk · Apr 3, 2018 If you want to compare two in-memory objects, you can use method generators, there are several related articles and discussions on that:Exploring Code Generation with Caché Method Generators Generic way to test if all the propertiers of an object are nullCheap object hashing?Simple comparator on GiitHib - note that it's a runtime comparator, therefore slow. Better solution would be method generators.If you're comparing objects of different classes you need to find their common ancestor class and compare using that.If you're comparing stored objects you can calculate hashes and compare that.All in all it's a very complex topic and you need to determine what requirements do you have:Streams?Lists? Arrays? Position change?Loops/relationships strategyHow many levels to compare?Different classes? Do they have common superclass?Do you need to compare dynamic objects/objects from unrelated classes?And design your comparator based on that.Here's a simple hasher on GitHub.
go to post Eduard Lebedyuk · Apr 3, 2018 What about discussion?In my practice issues often include:discussion about implementation strategyreferences to other issuescross-references to commitstest hintsstart/due dates & time spentmilestonescurrent statusassigned person(s)Issues help to collect all this information and make it available later.
go to post Eduard Lebedyuk · Apr 2, 2018 That works only for CSP context and CSP pages. You can write a wrapper I suppose, but I think it would be easier to just write your own querybuilder code: ClassMethod Link(server = "www.example.com") { try { set cspContext = $data(%request) if 'cspContext { set %request = {} // ##class(%CSP.Request).%New() set %response = ##class(%CSP.Response).%New() set %session = {} //##class(%CSP.Session).%New(-1,0) } set query("param") = 1 set page = "/abcd.csp" set url = ##class(%CSP.Page).Link(page,.query) set url = $replace(url, page, server) write url kill:'cspContext %request,%response,%session } catch { kill:'$g(cspContext) %request,%response,%session } } With querybuilder: ClassMethod Link(server = "www.example.com") { set query("param") = 1 set data = "" set param = $order(query(""),1,value) while (param'="") { set data=data _ $lb($$$URLENCODE(param)_"="_$$$URLENCODE(value)) set param = $order(query(param),1,value) } write server _ "?" _ $lts(data, "&") }
go to post Eduard Lebedyuk · Mar 28, 2018 You're doing two separate operations: Syncing the dataSyncing the cube They can both be system tasks with one task dependent on other or even one task altogether. If you're using persistent objects to store data you can specify DSTIME: Parameter DSTIME = "AUTO"; and ^OBJ.DSTIME would be maintained automatically. UPD. Read your other comment. DSTIME is relevant only for syncing. It does not affect full build behaviour.
go to post Eduard Lebedyuk · Mar 24, 2018 You can change user password in System Management Portal -> Menu -> Users.Note that if you installed Cache under minimal security it may be easier just reinstall Cache with Normal/Locked Down security.
go to post Eduard Lebedyuk · Mar 22, 2018 For higher performance it's better to keep the data in InterSystems platform and sync it with remote db periodically.To download the data via xDBC you have two main approaches:Interoperability (Ensemble) SQL inbound adapter"Raw" access via %SQLGatewayConnection or %Net.Remote.Java.JDBCGatewayInteroperability approach is better as it solves most problems and user should just enter the query, etc. "Raw" can be faster and allows for fine-tuning.Now, to keep data synced there are several approaches available:If source table has UpdatedOn field, track it and get rows updated only after last sync.Journals: some databases provide parsable journals, use them to determine which rows changed in relevant tables.Triggers: sometimes source table has triggers (i.e. Audit) which while do not provide explicit UpdatedOn field nonetheless can be used to determine row update time.Hashing: hash incoming data and save the hash, update the row only if hash changed.If you can modify source database - add UpdatedOn field, it's the best6 solution.Linked tables allow you not to store data permanently, but the cube would be rebuilt each time. With other approaches syncing cube is enough.Also check this guide on DeepSee Data Connectors.