cacheobjectscript-udl a good idea!
I have updated Cogs which makes 37 UDL repo's and counting.
I will get in contact with the Linguist team to see how realistic it is to implement UDL with these numbers...
- Log in to post comments
cacheobjectscript-udl a good idea!
I have updated Cogs which makes 37 UDL repo's and counting.
I will get in contact with the Linguist team to see how realistic it is to implement UDL with these numbers...
Thanks Benjamin.
OnFORME added.
SourceForge link does not work directly from here, but works fine from the main http://onforme.sourceforge.net/ link (odd since they are the same).
Well done everyone, looks like you are all doing really well. I missed a few days and struggling to find the time to catch up now. Maybe boxing day :)
Hi Jacques,
A word of caution.
The server() method requires a little finesse to ensure a good user experience.
What you might not realise is that the server() method bakes a call to the browsers XMLHttpRequest object with a synchronous flag. This will block the main browser process until the response message is returned.
You can simulate a 1 second delay with a hang in the class method...
When you now click on the check box notice that it does not change its state, not until the response comes back. To the end user this is really bad. They will think it did not work and will click it again. This will normally result in a second request and the checkbox going back to its original state. The user now starts clicking maniacally causing one long UI freeze.
Ideally you want the checkbox to immediately show as checked, to do this you need to debounce the server() call and let the browser do a much needed re-paint. You can do this with a window setTimeout...
You will now see the check box change immediately.
Thats gives the user some instant feedback, but it wont fully stop them from still clicking on the checkbox. Ideally you want to prevent them from doing it again until the first request has finished.
We can half solve this by disabling the checkbox, like so...
However, you will notice that click events are still bubbling up to the re-enabled check box. This is because the event is pending and bubbles up after the check box has been re-enabled, hence why it then gets processed. It means that we also need to debounce this re-enablement to allow the click event to be processed and ignored.
This is almost done, the last thing I would do would be to set a fixed width on select box so it doesn't cause a UI re-layout / flicker with different sized contents. And then for good measure have a temp loading message in the first option...
There are alternatives that would avoid needing to do this, I will put something together...
Sean.
I was only half right, %DisplayFormatted does not return a value so it would cause a COMMAND error, but Robert correctly pointed out its happening on a different line, I must have green colour blindness today.
On second glance zMessageHandler is a generated method, so as Robert mentioned, you will need to return a status code from your CheckResults method to stop the COMMAND error in the first instance.
It's important to bubble up any errors or a final status OK value from your operation methods so that they are caught and reported correctly in the Ensemble logs, otherwise you will have silent errors and not know where things failed, as in this instance.
For every step in your code where a status is returned you should check the status and immediately quit if its an error, e.g.
if $$$ISERR(sc) quit sc
Where sc is the status code, or you can use the $$$QuitOnError macro.
Can you paste all of your code...
Looks like a couple of issues, I can't see where you are saving the document.
Its a 5 minutes hack, but here is an example of what I might do...
Hi Keven,
I don't have an answer. From experience deleting the old class should be enough and the new name should have then just worked.
Out of interest are you using Studio or Atelier?
Can you paste the code that you are using
Hi Keven,
The compilation is failing for the unit tests which I have included in the src folder, but thought I had removed from the main build file. I was planning on a new push so I will tidy that up. For now you can ignore those particular errors, the main Cogs.JsonClass will not be effected.
If you are on a new version of Caché then you should check to see if $ZCVT supports JSON, if you are currently rolling your own JSON and just want to escape it then just do...
$zcvt(string,"O","JSON")
Or if you are targeting old and new then you can call the base EscapeJSON method on Cogs which compiles by version to $ZCVT or its own escape method, you can call that with...
##class(Cogs.Lib.Json.Base).EscapeJSON(string)
I would imagin if you are working with QEWD then you might be shuffling lots of data around in globals / arrays.
In this instance you might not want to use the Cogs JSON Class as you will end up having to shim in a whole new set of classes.
The new Cogs push does have more options now, ability to work with globals and arrays and legacy classes (without extending them).
There are also the Zen utilities that might help, again these are only in the more recent versions of Caché.
Sean.
In terms of docs, there is a page here that you can read, its in the git docs folder...
https://github.com/SeanConnelly/Cogs/blob/master/docs/Json/JsonClass.md
If you are planning on using the new REST classes in Caché then you might also be interested in some Cogs additions that are not too far off. These include a REST mapping generator with automatic Swagger / OpenAPI documentation generation.
I'll see if I can push it up this weekend. It's actually been developed and unit tested for some time, but I have been sitting on the documentation ![]()
The Swagger generators will be in a later release but not far off...
Looks to be there in 2017.1 as well...
How about using ServerSideRedirect ?
It will be the name of the global... ^CacheTempGlobal
Global export import seems like a good strategy.
I was just looking at your SQL again, do you have all of the lookup values in one single global node? If this is the case then that would explain why the transaction log was getting full up.
What you should really do is split the data out into many global entries...
E.g.
^Lookup("UK")="United Kingdom"
^Lookup("USA")="United States"
^Lookup("ESP")="Spain"
^Lookup("ITA")="Italy"
Making the key (or keys depending on your data) unique and easy to check for duplicates on those key(s).
Then, when you make updates to the global, only the node that changes will be committed to the transaction log, which will have a tiny overall impact.
You won't need a package name for the global name, this is just a naming convention for globals that are auto named by the %Persistent class.
If you provide your own global name then it can be anything you want, so for the transitory data just call it something like...
^CacheTempDedup
I think there is probably an easier way to solve the dedup problem by passing the log file twice and recording the line numbers of interest into a temporary global, you can then skip all the early duplication and minimise the transaction writes.
This is a 2 min bash but it should give you a general idea of how to do that...
kill ^CacheTempDedupSeen
kill ^CacheTempDedupLine
set lineNo=1
set file=##class(%File).%New("file.txt")
do file.Open("R")
set data=file.ReadLine
while file.AtEnd=0 {
set code=$piece(data,",",1) //e.g
if $data(^CacheTempDedupSeen(code)) kill ^CacheTempDedupLine(^CacheTempDedupSeen(code))
set ^CacheTempDedupSeen(code)=lineNo
set ^CacheTempDedupLine(lineNo)=code
set data=file.ReadLine
set lineNo=lineNo+1
}
do file.Rewind()
set lineNo=1
set data=file.ReadLine
while file.AtEnd=0 {
if $data(^CacheTempDedupLine(lineNo)) {
//this data is the last in the log for its code type, update the persistent class directly
}
set data=file.ReadLine
set lineNo=lineNo+1
}
It's not a bad question, but the short answer is not in a single line of code.
Take a look at this post, it might give you a few ideas if you just wanted a Dynamic Object...
Ahh, just re-read your question, I think your asking how to change the settings label?
You will need to change the language lookup value, take a look at...
^CacheMsg("EnsColumns","en")
Right, probably because the settings are not in the reg to read.
In which case, the OP question asked for the registry path, which would be...
Computer\HKEY_USERS\(your HKEY user value here)\Software\InterSystems\Cache Studio\Settings\Editor
Set the value of "Hover" to Hex 0.
Hi Wouter,
I'm not looking at any HL7 documentation at the moment, but I think \X0D\ is the valid escape sequence. The X denotes that this is one or more hex characters and the 0D is hex for carriage return. The value 00D would not be a valid hex value.
Thanks Evgeny, probably sounds about right.
I would hazard a guess then that upwards of 0.1% of developers worldwide use Caché in one shape or form.
It's interesting to compare that to the last stackoverflow survey...
https://insights.stackoverflow.com/survey/2018/#technology-databases
especially since some of those at the bottom of the list are developed on top of Hadoop, opens up some ideas for what could be possible on top of the IRIS Hadoop platform.
On a side note, how about an annual DC survey? Would give some fascinating insights.
>s x=##class(Foo.Bananas).%New()
>s x.BIOID=291
>zw ^CODE
>s x.AKI=1
>zw ^CODE
^CODE("TNO","BIO",291,"AKI")=1
>s x.AKI=""
>zw ^CODE
>s x.AKI=0
>zw ^CODE
^CODE("TNO","BIO",291,"AKI")=0No, the internal code will call AKISet when you assign a value to the AKI property. I bashed this out as a registered object, probably had a singleton pattern going on in my mind. On reflection it would be a really bad idea to mix this with a persistent object.
If you really want to wrap legacy data with persistent objects then do it the right way...
https://community.intersystems.com/post/art-mapping-globals-classes-1-3
You can set up ^CODE("TNO","BIO",{BIOID},"AKI") as the storage structure for the AKI property value. For any new objects, it doesn't matter if you assign "1", "0" or "" to that property, it will always create the storage location with one of those three values. The state will never be broken.
There is no point moving to persistent objects if there is legacy code that is bypassing it. It would be an all or nothing solution, everything uses the persistent object or not at all. In which case, when you come to deploy the object and legacy updates, you just need to run a small utility that will add in missing "AKI" nodes with an empty string value.
This would be a much more maintainable approach in the long run, and you will get all the benefits of SQL as well.
Hi Evgeny,
Community and Express licensing for InterSystems IRIS sounds very interesting. Do you have any more information on this?
Sean.
Hi Sansa,
If you are getting back an empty string (I suspect not null) then you should be able to use the GetError method to investigate the problem. This is from the class method comments...
If the function fails, it returns "". The actual session error status can be returned by a call to the GetError method. Examples: s Status=##Class(%SYS.LDAP).SearchExts(LD,BaseDN,$$$LDAPSCOPESUBTREE,Filter,Attributes,0,"","",2,ServerTimeout,.SearchResult) i Status'=$$$LDAPSUCCESS q Status s Entry=##Class(%SYS.LDAP).FirstEntry(LD,SearchResult) s Status=##Class(%SYS.LDAP).GetError(LD) i Status'=$$$LDAPSUCCESS q Status s ValueList=##Class(%SYS.LDAP).GetValues(LD,Entry,"sAMAccountname") i ValueList="" q ##Class(%SYS.LDAP).GetError(LD) w !,"sAMAccountname="_$li(ValueList,1)
It's certainly worth looking at the class documentation for this...
https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls
From experience LDAP can be tricky to get working, and even harder to help diagnose without having all the information at hand. It's analogous to posting the question, my car won't start, whats the problem. It can be 101 things, so you will need to narrow down the error and provide as much information as you can if you are still stuck.
Sean.
Thanks Robert, I didn't realise indirection itself would work on an object property, far too obvious now, lol.
typing too fast, should have pointed out the -1 was for reference to trim at the other end
you can get a full list of these type of functions here...
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_FUNCTIONS
and a bit more information specifically on working with strings here...
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_strings
If you can't / don't want to fix the source schema then you can always copy values from the target, assuming it does have a schema.
So for instance your would do a set on...
target.{PID:PhoneNumberHome(1)}
And give it the value...
target.{PID:PhoneNumberHome(1).phonenumber1}
This will replace the entire target field with just the target phone number.
These are paths from a 2.4 specification. You will need to figure out the paths that are specific to your schema. Try these steps...
1. Create a set on PID:13.1
2. Cut the path from the property box
3. Delete that set
4. Create a set on PID:13 (not PID:13.1)
5. Paste in the path you cut into the value box
I was just thinking, if you are on a schema before 2.4 then you might not have sub fields to do this.
In which case here is a quick hack, set the value to...
$Piece(target.{PID:PhoneNumberHome(1)},"^",1)
Long term its better to customise your schema's.