Jani Hurskainen · Oct 30, 2024 go to post

Yeah, figured it out. The path have to point to either an empty existing directory or to an non-existing directory.

zpm:IPMTEST1>package -verbose -only -path /home/irisowner/module-package/ osex-ipm-hello

[IPMTEST1|osex-ipm-hello]       Package START
Exporting 'OSEX.ipm.hello.Hello.cls' to '/home/irisowner/module-package/src/OSEX/ipm/hello/Hello.cls'
Exported to /home/irisowner/module-package/module.xml
Module exported to:
        /home/irisowner/module-package/

Module package generated:
        /home/irisowner/module-package.tgz

However I see the following problems:

It's undocumented the name of the package is derived from the directory name.

The created directory structure is not cleaned after successful run.

The tar package contains unnecessary directories:

$ tar zvtf module-package.tgz
drwxr-xr-x 0/0               0 2024-10-30 07:51 module-package
drwxrwxr-x 0/0               0 2024-10-30 07:51 src//src
drwxrwxr-x 0/0               0 2024-10-30 07:51 src/OSEX//OSEX
drwxrwxr-x 0/0               0 2024-10-30 07:51 src/OSEX/ipm//ipm
drwxrwxr-x 0/0               0 2024-10-30 07:51 src/OSEX/ipm/hello//hello
-rwxr-xr-x 0/0             111 2024-10-30 07:51 src/OSEX/ipm/hello//Hello.cls
-rwxr-xr-x 0/0             494 2024-10-30 07:51 module.xml

I'm expecting only src/OSEX/ipm/hello directory.

Jani Hurskainen · Oct 30, 2024 go to post

No luck, do I have to sign in to YouTube?

This is a private video. Please sign in to verify that you may see it.

In fact The Global Summit 2024 YouTube playlist says: "46 unavailable videos are hidden".

Jani Hurskainen · Oct 30, 2024 go to post

The $system.OBJ.Export documentation doesn't mention LUT. However there is a vague statement:

Each of the items must have a type determined by an extension selected from the following list of basic types, additional types are supported under the abstract routine interface, so this list is not exhaustive.

Is LUT one of those additional types? What is that abstract routine interface? Why it is not possible to list those additional types here too?

Just for the record the types mentioned in the documentation at the moment of writing:

  • CLS - Classes
  • CSP - Server Pages
  • CSR - Rule files
  • MAC - Macro routines
  • INT - Non-macro routines
  • BAS - Basic routines
  • INC - Include files
  • GBL - Globals
  • PRJ - Projects
  • OBJ - Compiled object code
  • PKG - Package definitions
Jani Hurskainen · Oct 28, 2024 go to post

The version command also complains about something but is not providing too much details. I'm assuming the problem have to be related to the local repository:

zpm:IPMTEST1>version

%SYS>     zpm          0.7.3
IPMTEST1> zpm-registry 1.3.2
https://pm.community.intersystems.com - 1.0.6
ERROR! Registry server not available.
zpm:IPMTEST1>
Jani Hurskainen · Aug 27, 2024 go to post

This is ObjectScript only. The other unit testing framework is in-house developed non-public xUnit like unit testing framework. It was developed before %UnitTest exists and I'm just wondering would it be possible to use TestCoverage with it. Unfortunately my ObjectScript skills are still lacking so it's a bit hard for me to figure that out from the code. The long term goal might be to try to adjust these two things to work together.

Jani Hurskainen · Aug 27, 2024 go to post

i was inspired by your post as I have an idea to use ObjectScript code to control WireMock during unit testing. So I checked the documentation of  Ens.Util.Pipe to notice it's not much help for me :(

So let's ask from community AI: https://community.intersystems.com/ask-dc-ai?question_id=242465

how i can use Ens.Util.Pipe to run a command line program?

I got answer that seems to do the job (I don't know, I haven't tried it yet, but bookmarked) but it doesn't help me with the Ens.Util.Pipe class.

Let's try another way: https://community.intersystems.com/ask-dc-ai?question_id=242514

show me an example how to use RunCommand class method of Ens.Util.Pipe class

This is beyond my current knowledge. Please ask the Developer Community for further assistance.

So in this case the AI tool is not yet a magical replacement for missing/lacking documentation :(

Jani Hurskainen · May 17, 2024 go to post

What I'm missing here as all I get is SQL Error [7001] [07001]: Parameter list mismatch. ?

OSEX>zw ^foo
^foo(1)="one"
^foo(2)="two"
CALL %Library.Global_Find('OSEX','^foo','1')
-- returns error:
-- SQL Error [7001] [07001]: Parameter list mismatch.
Jani Hurskainen · Apr 8, 2024 go to post

AFAICS the documentation says nothing about the relationship between OriginalFilename property and %f specifier.

Jani Hurskainen · Apr 8, 2024 go to post

Argh. Ens.StreamContainer#StreamSet silently overwrites OriginalFilename property.

Filename (%f) is empty:

// in is a character stream

#dim exportRequest = ##class(Ens.StreamContainer).%New()
set exportRequest.OriginalFilename = "foo"
set status = exportRequest.StreamSet(in)


Filename (%f) is "foo":

// in is a character stream

#dim exportRequest = ##class(Ens.StreamContainer).%New()
set status = exportRequest.StreamSet(in)
set exportRequest.OriginalFilename = "foo"
Jani Hurskainen · Mar 4, 2024 go to post

Based on the hint from @Stephen Canzano I figured out the following examples that seems to do the job:

/// How to programmatically access External-Service Registry:
/// https://docs.intersystems.com/irisforhealth20221/csp/docbook/DocBook.UI.Page.cls?KEY=EESB_registry_admin#EESB_registry_admin_external
Class OSEX.Ex.ExternalServiceRegistry Extends %RegisteredObject
{

/// list services
ClassMethod Ex1()
{
	#dim services // md
	do ##class(Ens.ServiceRegistry.External.API).ListServices(.services)
	
	#dim id as %Integer = $order(services(""))
	while (id '= "" ) {
		#dim val as %DynamicObject = {}.%FromJSON($get(services(id)))
		
		write "--------------------",!
		write "#"_id_" Name: "_val.Name,!
		write "#"_id_" Domain: "_val.Domain,!
		write "#"_id_" Version: "_val.Version,!
		write "#"_id_" exists: "_##class(Ens.ServiceRegistry.External.API).ExistsService(val.Name,val.Domain,val.Version),!
		write "#"_id_" json: "_val.%ToJSON(),!
		
		set id = $order(services(id))
	}
	
	//zw services
}

/// add/modify service
ClassMethod Ex2()
{
	#dim service = ##class(%ZEN.proxyObject).%New()
	set service.Name = "Foo Service"
	set service.Domain = "OSEX"
	set service.Version = "1"
	set service.Endpoint = "http://localhost:8080/foo"
	set service.Protocol = "REST"
	set service.ResponseStyle = "Sync"
	set service.Stage = "Live"
	
	zw service
	
	#dim status as %Status = ##class(Ens.ServiceRegistry.External.API).SaveService(service)
	zw status
	
	set service.Name = "Bar Service"
	set service.Endpoint = "http://localhost:8080/bar"

	zw ##class(Ens.ServiceRegistry.External.API).SaveService(service)
}

/// delete service
ClassMethod Ex3()
{
	#dim pid as %String = "Foo Service||OSEX||1"
	#dim status as %String = ##class(Ens.ServiceRegistry.External.API).DeleteService(pid)
	zw status
}

}
Jani Hurskainen · Nov 7, 2023 go to post

About your second point: If you are new to git I recommend studying a git tutorial to get the basics and terminology right. When you know how git works most of those menu options will become self-evident as they match standard git operations. The internet  has plenty of git material but one "authoritative" source and a good starting point is https://git-scm.com/book/en/v2