Is Closure a spelling mistake? Do you mean Clojure (https://clojure.org/) instead?
- Log in to post comments
Is Closure a spelling mistake? Do you mean Clojure (https://clojure.org/) instead?
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
Is UserErrors a magic string that somehow connects the message dictionary with $system.Status?
I don't see the string mentioned in https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GSTRLOC_msgdict nor anywhere in the documentation.
I was able to google https://community.intersystems.com/post/registering-new-error-code-and-error-message that seems identical to this post.
Sounds like a perfect case for XSLT that is a special purpose language for transforming XML documents. See Performing XSLT Transformations to get started with XSLT In IRIS.
In my setup no such class exists. The correct class seems to be Ens.ServiceRegistry.External.API. API-class seems to be a mixed bag of public programming interface methods and private implementation ([Internal] methods).
Based on the hint from @Stephen.CanzanoI 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_externalClass OSEX.Ex.ExternalServiceRegistry Extends%RegisteredObject
{
/// list servicesClassMethod Ex1()
{
#dim services // mddo##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 serviceClassMethod 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 serviceClassMethod Ex3()
{
#dim pid as%String = "Foo Service||OSEX||1"#dim status as%String = ##class(Ens.ServiceRegistry.External.API).DeleteService(pid)
zw status
}
}
Yes that works, but I don't think the documentation agrees. https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic… says:
The %f specifier if present will be replaced with the name of the document's original source filename (stripped of certain characters in target filenames - see CharacterSetToRemove)
If I can't set "the name of the document's original source filename" then IMO the documentation is wrong.
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"AFAICS the documentation says nothing about the relationship between OriginalFilename property and %f specifier.
Relevant documentation for reference:
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…
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.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 :(
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.
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>
🤦♂️Yes, now works fine, thanks!
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
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".
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.tgzHowever 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.
I made an issue: https://github.com/intersystems/ipm/issues/606
Just noticed https://github.com/intersystems/ipm/pull/541 that is bringing in OCI support.
I know nothing about OCI/ORAS except what I just read from here: https://oras.land/docs/
Do I conclude correctly this will enable Nexus/Artifactory support?
Nexus is not listed in https://oras.land/adopters/ but OCI support is mentioned e.g. here: https://www.sonatype.com/blog/sonatype-nexus-repository-as-a-container-…
I had a look into the IPM source code and I guess the correct places where the testing action happens are:
However I got a quite confused how I would be able to inject my own Processor.UnitTest and/or UnitTest.Manager there and what are those pParams that are passes everywhere.
Now I have this kind of workaround:
<!-- unit testing workaround -->
<Invoke Phase="Test" Class="Company.UnitTest.IPM" Method="Load" CheckStatus="true">
<Arg>${root}/test</Arg>
</Invoke>
<Invoke Phase="Test" Class="Company.UnitTest.IPM" Method="RunTestPackage" CheckStatus="true">
<Arg>CompanyTests</Arg>
</Invoke>
<Invoke Phase="Unconfigure" Class="%SYSTEM.OBJ" Method="DeletePackage" CheckStatus="true">
<Arg>CompanyTests</Arg>
</Invoke>The amount of boilerplate is tolerable.
Test cases are located in ${root}/test.
Company.UnitTest.IPM is just an IPM "compatible" facade for our framework.
Now I can run test -o my-company-module. This has been working fine so far, fingers crossed there is no nasty surprises just waiting around the corner ...
Thanks for asking - I have not yet solved this (I have prioritized other things).
The overall work flow is clear but I'm struggling with this step on self-hosted remote registry:
repo -n local -r -url http://localhost:52773/registry/ -user test -pass PassWord42
How do I configure the authentication? I.e. how do I know the values for -user and -pass? AFAIK this is explained nowhere.
A side note for the community registry:
I recall I have seen the instructions how to self-register to the community registry (probably written by you 😉) but I didn't saved the link and now I can't find it anymore.
I'm expecting the front page at:
https://pm.community.intersystems.com/
would have clear description and instructions in the the similar way than the official (?) registry:
Unfortunately the company doesn't have open-source culture (yet) so the answer is no.
However I have got an assignment a while ago to argument why the company should open-source software components. So if you or anyone where here have good arguments please share 😉 I do have my own list of arguments already but more the merrier!
I finally figured this out with a help of a colleague! I just had to create a user that I can use for authentication in publish operation. AFAICS now everything works as expected.
The difference in authentication of zpm-registry's /package and /packages paths confused me untiI I read the source code.
Essentially my problem here was this was the first time I run into these web applications and IRIS authentication model.
So the conclusion is the compiler doesn't have tail-call elimination.
I'm not sure if there is other options too but how about to convert the dates into strings? In select use to_char() and in insert use to_date():
select
-- date to string with to_char()
to_char(current_date, 'YYYY-MM-DD') as date1,
-- string to date with to_date
to_date('2024-11-14','YYYY-MM-DD') as date2Related: how do I configure locale with CPF? I didn't find an option. Currently we are running:
do ##class(Config.NLS.Locales).Install("finw")
set ^SYS("NLS", "Config", "Collation")="Finnish3"with iris terminal.