go to post Eduard Lebedyuk · Dec 20, 2017 Can you show us your code?To use XML reader you need to call Correlate method, which correlates any specified XML element to class.
go to post Eduard Lebedyuk · Dec 18, 2017 Check %Device class: do ##class(%Device).GetCurrent(,.rows,.columns) zw >columns=80 >rows=24
go to post Eduard Lebedyuk · Dec 16, 2017 Got the same problem, I use SELECT DISTINCT as a workaround.
go to post Eduard Lebedyuk · Dec 15, 2017 This assures that all expressions are valid.More importantly this assures that all expressions were executed.
go to post Eduard Lebedyuk · Dec 15, 2017 You shouldn't create TestCsv.Csv class. CSVTOCLASS method would create the class you specified as a last argument automatically. After that you need to open that new class, it would have an Import method. Call it with your file to actually import data.
go to post Eduard Lebedyuk · Dec 14, 2017 Generally it goes like this: <scope> Do stuff, maybe throw exceptions (or just set status variable to error status) <faulthandlers> <catchall> Process errors. context.%LastError contains your error </catchall> </faulthandlers> </scope> Check docs for these elements, there are several examples available: scopecatchallfaulthandlers Also, check EnsLib.ebXML.Process.MessageSender for example.
go to post Eduard Lebedyuk · Dec 14, 2017 Try set rowtype = "Code VARCHAR(2),Name VARCHAR(9)" set filename = "c:\temp\Country.csv" do ##class(%SQL.Util.Procedures).CSVTOCLASS(2, .rowtype, filename,,,,"Test.CSV") And check new Test.CSV class for import methods.
go to post Eduard Lebedyuk · Dec 12, 2017 You have compilation error(s). That's why one or more methods are not generated, so instead methods in Ens.BusinessOperation gets called. These methods are returning not implemented error. To start with Extends (Ens.BusinessOperation, ) should be: Extends Ens.BusinessOperation You can check which exact method has not been generated in Ensemble Event Log. UPD. [@Rajiv Bhatia] solution is correct, my bad. Should have read your code.
go to post Eduard Lebedyuk · Dec 12, 2017 Automated syncing. I use Phabricator for that but I don't like it.I suppose cron job would be enough. GitLab Enterprise has repo mirroring.
go to post Eduard Lebedyuk · Dec 12, 2017 I feel the whole approach violates the statelessness of a REST architecture?The request itself is stateless. For example session tracking is okay within REST despite the fact that session exists between requests. Here's how I understand violation of REST statelessness: let's say you have a newsfeed API /news and you return news in chunks of 20 elements. Users are authenticated.REST way:GET /news/1 - returns first 20 elementsGET /news/2 - returns elements 21-40etc.Not a REST way:GET /news/next - returns first 20 elementsGET /news/next - returns elements 21-40etc.Now, the second approach violates REST principles because request itself - /news/next does not contain enough information to process it. Server should track how much pages each client received, and which page to return next.To sum up: statelessness in REST means that request itself is enough to determine what do we need to do with it and request does not require pulling any additional information about previous requests from the same client.
go to post Eduard Lebedyuk · Dec 12, 2017 Please consider expanding your question. I'm not sure what do you mean.
go to post Eduard Lebedyuk · Dec 12, 2017 I did not test this approach, but something along these lines can help. The general idea is that SAX parser can validate against the XML schema, and we can use that. 1. Generate schema from your XML enabled classes. 2. Call %XML.Reader:Open method, and provide it with your xml data and schema: #include %occSAX set reader = ##class(%XML.Reader).%New() set reader.SAXSchemaSpec = "/path/to/schema.xsd" // "maybe "file:///path/to/schema.xsd" set reader.SAXFlags = $$$SAXFULLDEFAULT set sc = reader.OpenString("<xml/>") w $System.Status.GetErrorText(sc) 3. sc should contain errors, $$$SAXFULLDEFAULT is defined in %occSAX and contains several possible values: #; ------------------------------------------------------------------------ #; Bit flags for %XML.SAX.Parser feature selection (flags argument) #; ------------------------------------------------------------------------ #; Specify this value if you want to accept the SAX defaults (see below) #; #define SAXDEFAULTS 27 #; Specify this value if you want the SAX defaults plus namespaces prefixes/ #define SAXFULLDEFAULT 95 #; #; Specify this bit if you want the parser to perform validation #; http://xml.org/sax/features/validation #; On: Report all validation errors. (default) #; Off: Do not report validation errors. #define SAXVALIDATION 1 #; #; Specify this bit if you want the parser to recognize namespaces #; http://xml.org/sax/features/namespaces #; On: Perform Namespace processing (default) #; Off: Optionally do not perform Namespace processing #define SAXNAMESPACES 2 #; #; Specify this bit if you want the parser to process namespace prefixes #; http://xml.org/sax/features/namespace-prefixes #; On: Report the original prefixed names and attributes used for Namespace declarations #; Off: Do not report attributes used for Namespace declarations, and optionally do not report original prefixed names (default) #define SAXNAMESPACEPREFIXES 4 #; #; Specify this bit if you want the parser to perform validation dynamically #; http://apache.org/xml/features/validation/dynamic #; On: The parser will validate the document only if a grammar is specified. (http://xml.org/sax/features/validation must be true) (default) #; Off: Validation is determined by the state of the http://xml.org/sax/features/validation feature #define SAXVALIDATIONDYNAMIC 8 #; #; Specify this bit if you want the parser to recognize schemas #; http://apache.org/xml/features/validation/schema #; On: Enable the parser's schema support. (default) #; Off: Disable the parser's schema support. #define SAXVALIDATIONSCHEMA 16 #; Specify this bit if you want the parser to perform full schema checking #; http://apache.org/xml/features/validation/schema-full-checking #; On: Enable full schema constraint checking, including checking which may be time-consuming or memory intensive. Currently, particle unique attribution constraint checking and particle derivation resriction checking are controlled by this option #; Off: Disable full schema constraint checking (default). #define SAXVALIDATIONSCHEMAFULLCHECKING 32 #; http://apache.org/xml/features/validation/cache-grammarFromParse #; On: Cache the grammar in the pool for re-use in subsequent parses #; Off: Do not cache the grammar in the pool (default) #; If set to true, the http://apache.org/xml/features/validation/use-cachedGrammarInParse is also set to true automatically. #define SAXVALIDATIONREUSEGRAMMAR 64 #; Flags to force SAX not to validate but DO recognize namespaces and prefixes #define SAXNOVALIDATION $$$SAXNAMESPACES+$$$SAXNAMESPACEPREFIXES SAXFULLDEFAULT = All flags except SAXVALIDATIONSCHEMAFULLCHECKING. Maybe try change the flags , but defaults seems to do what you need. If you actually try this approach can you please post if it works or not?
go to post Eduard Lebedyuk · Dec 10, 2017 Benjamin's link reads https://sourceforge.net/projects/onforme/ but points to https://sourceforge.net/projects/onforme/%C2%A0