Eduard Lebedyuk · Feb 7, 2021 go to post
  1. Is your postgresql in the same docker-compose?
  2. Please post your dockerfile for jgw (or link your repo).
  3. I'd also give chmod +777 on postgresql-42.2.18.jar during build jic
Eduard Lebedyuk · Feb 6, 2021 go to post

What do you want to achieve?

All audit changes are valid by themselves. For example if I have access to the codebase I can modify it however I want and it would be a valid action. If I delete the code it would be a valid action still, just malicious.

If, on the other hand, the codebase has some classes which I'm allowed to modify and some I'm not (so modifying them would be an invalid action), that should be resolved on the roles stage (by separating the code into two different databases and giving me write access only to the one db I should be able to modify).

Essentially, user should be allowed to perform only valid actions and audit exists to check for malicious actions.

Using audit for additional validity checks is not recommended because audit does not serve this purpose.

Eduard Lebedyuk · Feb 1, 2021 go to post

The recordings will be made available to all registrants on Friday this week.

Uwe Hering (uwe.hering at intersystems dot com) can send you the video files for subtitling / editing - please send him an email.

Eduard Lebedyuk · Jan 27, 2021 go to post

When you need to switch into a new namespace for some work:

  1. Extract this work into a separate method (or methods)
  2. At the beginning of the root method switch namespaces like this:
new $namespace
set $namespace = "yourNS"

This way when you leave the method, namespace would be automatically reverted to a previous one.

Eduard Lebedyuk · Jan 26, 2021 go to post

On Windows execute:

<iris>\bin\irisdb -s <iris>\mgr

where <iris> is a root of an InterSystems IRIS installation.

Eduard Lebedyuk · Jan 16, 2021 go to post

Great answer, but I'd like to add that there are two distinct cases for working with XDatas:

  1. Where XData itself is an object of work (for example generating a part of WSDL spec and saving it in a class XData).
  2. Where XData is just a container for miscellaneous data (for example a template with placeholders).

The code above works for the first case, but for the second case it might be preferable to create an independent copy of an XData stream so that no locking happens - this prevents XData object access/modification errors, especially in Dev environments. Furthermore objectless way of getting XData contents would be faster.

I usually use this method to get streams if my XData work falls into the second category:

ClassMethod getClassXData(className, xdataName) As %Stream.Object
{
    set stream = ##class(%Stream.TmpCharacter).%New()
    for i=1:1:$$$comMemberKeyGet(className,$$$cCLASSxdata,xdataName,$$$cXDATAdata) {
        do stream.WriteLine($$$comMemberArrayGet(className,$$$cCLASSxdata,xdataName,$$$cXDATAdata,i))
    }
    quit stream
}

This code can be further improved for most use cases by replacing a stream with a string.

Eduard Lebedyuk · Jan 5, 2021 go to post

I used %iFind.Highlight as shown in the docs for highlight function.

Even went to sources and checked if it was a generator maybe - it was not, so I stopped my search for more index-specific option.

Switching to [package name].[table name]_[index name]Highlight() now.

Also how can[package name].[table name]_[index name]Find()  and  ...Rank() be used?

Eduard Lebedyuk · Jan 5, 2021 go to post

Thank you!

That's exactly what I need. I knew about iKnow relational mappings, but not iFind ones.

If you want to count any kind of match, your highlight trick is probably the nicest way to get at it.

The problem with this approach is:

  • It actually reindexes the source again which takes time
  • It does not seem to be aware of the index so index parameters would be missed as only INDEXOPTION can be passed.
Eduard Lebedyuk · Jan 5, 2021 go to post

Went with:

SELECT
    SUM($LENGTH(%iFind.Highlight(Text, :name), '<b>')-1)
FROM Post
WHERE %ID %FIND search_index("TextIndex",:name)

Assumes plaintext.