Eduard Lebedyuk · Jul 11, 2020 go to post

The idea of document DBs is as follows. You always have constraints on data: what fields are there, what datatypes are there and so on. In the case of a relational DB the constraints are checked and enforced on a database side - you define a required timestamp field once and when you request the data back, hundred times out of a hundred, you get back a valid timestamp field.

On the one hand this is good - separation of concerns and all that, on the other hand what if your application data requirements change often? Or what if you need to store data for several versions of your application at once? In that case maintaining a constraints on a db side becomes cumbersome.

Document databases are created to work in this type of situations. On a DBMS side you now only enforce the existence of collection, id key and maybe some required properties if you're 100% sure they are always available. Everything else is optional and entirely the concern of the application. Document, after all can have any number of fields or don't have them at all. And it is application job to make sense of it.

In your case the schema is extremely stable - the standard defining RSS was aproven in 2005 and, frankly, not likely to change, ever. It is as one may say feature complete.

Using XSD schema you can easily generate the classes  in InterSystems IRIS and import your RSS data into them.

Eduard Lebedyuk · Jul 10, 2020 go to post

Any particular reason you want to use DocDB and not relational tables?

Send http request to get the feed and %XML.Reader to parse it into individual objects.

Use BS/BO to automate sending http requests.

Eduard Lebedyuk · Jul 10, 2020 go to post

I'm not really sure about the use case.

PDF is a publish format (used to present documents and make sure that they look the same everywhere).

RTF is a simple editing format.

Generally, you can easily convert edit formats into publish formats, but reverse action is impossible.

Furthermore, PDF is far more feature rich than RTF so not all PDF features could be converted into corresponding RTF features.

What are you trying to do?

Eduard Lebedyuk · Jul 8, 2020 go to post

Is it because I'm using the backported %ZJSON from Robert in Caché?

Likely. Ran your code and got:

{"int":12,"bool":true,"str":"TEST"}

Consider upgrading to InterSystems IRIS!

Eduard Lebedyuk · Jul 8, 2020 go to post

Please add a code sample to demonstrate your issue.

Here's my simple class:

Class test.json Extends (%RegisteredObject, %JSON.Adaptor)
{

Property int As %Integer [ InitialExpression = 4 ];

/// do ##class(test.json).test()
ClassMethod test()
{
    set obj = ..%New()
    set sc = obj.%JSONExport()
}

}

And in the terminal I get the expected output:

do ##class(test.json).test()
{"int":4}
Eduard Lebedyuk · Jul 7, 2020 go to post

To know how a particular DTL action translates into ObjectScript:

  1. Open DTL class in Studio
  2. Press Ctrl+Shift+V OR See Other Code Button
  3. Check Transform method - it contains ObjectScript implementation for the DTL
Eduard Lebedyuk · Jul 7, 2020 go to post

From the docs

If a class has DependsOn=ClassA, it is redundant for it to have CompileAfter=ClassA
as well.

so I always use DependsOn.

Eduard Lebedyuk · Jul 7, 2020 go to post

As Ens.StreamContainer has a OriginalFilename property you can use that in your custom BO by specifying a subfolder ob request (so OriginalFilename  = /subfolderA/name.txt).

I would try to avoid the mixing of:

  • technical issue - outputting file into one of the several subfolders based on a filename
  • business issue - determining which subfolder to output file to based on extracurricular conditions

Operation/adapter should solve only one type of issues, either technical or business.

Eduard Lebedyuk · Jul 7, 2020 go to post

Compiler does build dependency tree. If you encounter some kind of the issue where your classes are not compiled in a correct order you might open a WRC ticket.

Use DependsOn keyword to provide hints to compiler.

Eduard Lebedyuk · Jul 6, 2020 go to post

It might sufficient to put your code just into a CODE Block of a BP generated with the wizard.

If you need to execute raw ObjectScript from BPL add assign activity and set status variable to the value of your classmethod. No need to add a code block.

Still, BP without BPL are quite easy to implement, here's the guide.

Eduard Lebedyuk · Jul 2, 2020 go to post

What's your file I/O default?

zn "%SYS"
do ^NLS
Choose 4) Display loaded settings
Choose 3) Display system defaults for I/O tables

Here's what I got:

-------------- System defaults for I/O tables --------------
 
Table               Name
-----------------   ---------------
Process             RAW
Cache Terminal      UTF8
Other terminal      UTF8
File                UTF8
Magtape             UTF8
TCP/IP              RAW
System call         RAW
Printer             CP1251
Eduard Lebedyuk · Jul 2, 2020 go to post
  1. Shut down InterSystems IRIS on Machine 1.
  2. Copy IRIS.DAT from Machine 1 to Machine 2
  3. Mount IRIS.DAT to InterSystems IRIS on Machine 2.
Eduard Lebedyuk · Jul 2, 2020 go to post

Great news about ARM support.

As tagged image can be provided with several architectures (example with 4) is there a reason why we separate the tags into community and community-arm?

Eduard Lebedyuk · Jun 29, 2020 go to post

Get property parameter by global access:

/// Get property param
/// w ##class().GetPropertyParam("Form.Test.Simple", "Name", "MAXLEN")
ClassMethod GetPropertyParam(class As %Dictionary.CacheClassname = "", property As %String = "", param As %String = "") As %String [ CodeMode = expression ]
{
$$$comMemberArrayGet(class, $$$cCLASSproperty, property, $$$cPROPparameter, param)
}
Eduard Lebedyuk · Jun 29, 2020 go to post

You can send the request directly from a service to operation.

Your BP must implement the following methods to work:

  • OnRequest
  • OnResponse

As both methods are missing from your BP it does not work.

Eduard Lebedyuk · Jun 28, 2020 go to post

If it's a File Stream you can set TranslateTable property to your charset before reading.

Otherwise you can use $zcvt function to convert strings.

Here's an example of iterating encodings for $zcvt to determine a correct encoding.

If you are interested in encoding internals use zzdump to check hexdumps.

If your encoding is region specific don't forget to set your locale.

Eduard Lebedyuk · Jun 28, 2020 go to post

Persistent classes:

SELECT Name
FROM %Dictionary.ClassDefinition_SubclassOf('%Persistent')

List properties and relationships (if you need subset - filter by parent - it's a class):

SELECT
parent,  Name, Cardinality, Collection, Id, _Identity,  Relationship, Type
FROM %Dictionary.CompiledProperty

Foreign keys:

SELECT
parent, Name, Properties, ReferencedClass, ReferencedKey
FROM %Dictionary.ForeignKeyDefinition

For everything %Dictionary.Compiled* - includes defined and inherited values, Definitions include only items defined in a current class.

Eduard Lebedyuk · Jun 26, 2020 go to post

You need to remove these lines from Login method.

  1. Copy paste Login method into your broker from %CSP.REST.
  2. Remove the line.
  3. Compile.
Eduard Lebedyuk · Jun 26, 2020 go to post

Redefine Login method in you broker and remove:

#; We want Basic authentication
Do %response.SetHeader("WWW-Authenticate","Basic")
Eduard Lebedyuk · Jun 26, 2020 go to post

Curenlty active setting value (so System Default Setting in your case) should be returned.

I was unable to reproduce the issue on Cache for Windows (x86-64) 2016.1.4 (Build 104_6U) Wed May 22 2019 12:23:59 EDT.

Have you updated your production?

Check that your production definition does not contain old settings.