Hi, all.
I have CSP application and it needs to get and process data from ajax request with json-content. JSON can be very big.
In this case:
TRY
{
Set RequestObj = ##class(%Object).$fromJSON(%request.Content.Read())
} CATCH(Exception) {
Set Status=Exception.AsStatus()
}
I get just part of getting JSON and validate error in $fromJSON.
If I try to read it all in cycle:
TRY
{
While (%request.Content.AtEnd = 0) {
Set Data=Data_%request.Content.Read()
}
Set RequestObj = ##class(%Object).$fromJSON(Data)
} CATCH(Exception) {
Set Status=Exception.AsStatus()
}
I get
Let's imagine I have a global like this:
^Users(12, "SETTINGS", "IsAllowed") = 1
^Users(41, "SETTINGS", "IsAllowed") = 0
^Users(52, "SETTINGS", "IsAllowed") = 1
Now I would like to check for each user whether they are allowed, therefore I'd need to iterate through the Global. How to do that? It seems that I can't use $Order here like such:
For {
S FF=$O(^Users(FF,"SETTINGS","isAllowed"))
Q:$L(FF)
W "User ",FF," is allowed",!
}
Is there any other way of doing this?
Dear Sir ,
how to i run csp file . sometime csp file runs as at a time appear "Error #670: could not attach to target".How to solve it. Thank you
Is there an out-of-the-box or accepted standard method for loading up mappings between different code sets and then referencing these mappings (both directions) from DTL? First thought was the built in Lookup() and corresponding data tables but these only work in one direction (key -> value) and not the reverse. Obviously I can build my own classes to support a two way mapping but am wondering if there's a standard way of achieving this. The mapping should contain the code and display name from each of the code sets and allow mapping based on either code or display name.
Thanks
August 24, 2016 – Alert: Database Compaction
This is an addendum to the Alert published on October 14, 2015 – Alert: Database Defragmentation.
That alert indicated that the database defragmentation utility in 2014.1 and higher, on all platforms except OpenVMS, could cause database degradation and the correction JO2871 is available to clients upon request and would be included in future releases. The correction was included in 2015.1.3, 2015.2.2 and 2016.1.
Hi All,Now I installed the Cache 5.0 that terminal is not open can any one know the default username and password for Cache 5.0
Hello, guys.
I need to find all web files, get their content in UDL format and to be able to export them. And, vice versa, to be able to import them in udl format.
I know that they are located in CSP folder. However, is there any way to do this using COS functions?
Hello community!
Is there any method/property/way in Caché to obtain something like unique identifier for installed Caché system? The idea is to get the identifier that will differ on any other installation/machine/etc, but will forever remain the same for the current installation, even if $zv changes (in case of update) or any data is removed from the database.
Hi -
I have 3 classes: "Class A" has a property X, "Class B" has a property which is a Class A, and I have a "Class C" which has a property of a Class B.
Class A definition
Class USER.ClassA Extends %Persistent
{
Property Propx as %String;
}
Class B definition
Class USER.ClassB Extends %Persistent
{
Property Record as USER.ClassA;
}
Class C defintion (which is where I'm having my problem)
Class USER.ClassC Extends %Persistent
{
Property BRecord As USER.ClassB;
Property ARecord As USER.ClassA [ Calculated, SqlComputeCode = { ????? }, SqlComputed ];
Method ARecordGet() as USER.ClassA
{
quit .
write "5apples" + "7 orange" //Ans :12
Values are string , why add numeric value . its an error or correct . please tell me.
I ran %GSIZE and my ^cacheStream global is very large. How do I go about
1. Evaluating what data is in the global.
2. Clean it up.
Thanks!
Has anyone configured Zen Reports/FOP to support png images? If you have, could you please share the library that you used, the configuration required, and whether it was worth it (vs converting images to one of the natively supported formats)?
Hello,
I am working on a Rest Service that should accept a particular content type. How and where can I set the value?
I have tried setting the value %response.ContentType by overriding Page method OnPreHttp() but from what I see this method never got executed.
Thanks
Raghu
I try it with the COLLATE instruction, but doesn't work.
Any ideas ?
Tkanks.
Hi,
We are trying to implement a client side data provider as a component (ZEN) that will use JQuery to do rest calls to a desired URL, in this case, a %CSP.Rest service implemented by ourselves.
This component will be used within our application that is authenticated with a correct user configured on Caché management portal and therefore using one license unit. As we are using a Ajax call from client side this connection creates a new session that will use a new license.
Hi all,
For custormer support reasons we would like to know if its possible to activate some kind of flag or see/redirect wich is the code (lines) being executed when some misterious problems appear.
Is there any way to view the stack of execution code on a deployed code environment? Is there any other equivalent way to track the execution stack for a certain period of time?
Best regards
Is there an API I can call to determine the size of a routine in a CACHE.DAT file so that I don't have to directly reference the ^ROUTINE global?
Given the following data type:
<DataType name='TN' description='telephone number'>
<DataSubType piece='1' description='telephone number'/>
</DataType>
What is the point in setting a
NewBie's Corner Session 17 New command
Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.
New command
The New command limits a variable's scope or range of use. In theory the New command is simple, in reality the New command is powerful and needs to be respected and understood. In Caché ObjectScript and MUMPS an entire chapter is devoted to it.
We have an incoming ADT adapter and the ACK MODE is set to IMMEDIATE. This is what the docs say:
An inbound ACK shows up as a square in the visual trace. These do not. How can I view them?
Please Explain "$h"
Did some searching online with no luck. In Studio, is it possible to add comments to .HL7 schema files? For instance
//or maybe this is
<MessageStructure name='ACK' definition='MSH~MSA~[~ERR~]'/>
Difference Between Macro and routine?
I wrote a macro in studio. Its how to run with Terminal.
do macro name ^filename is correct are not
what are the difference between Deepsee and Ensemble , and how to access the ensemple .Please Tell me
Sir, please give a sample program for cache with database . It is useful for my individual learning.
Can anyone explain me how to create a dynamic session in CSP?
Process-private Globals can be used as a data global in storage definition. That way, each process can have its own objects for the class with ppg storage. For example lets define a pool, which can:
- add elements to a pool (ignoring duplicates)
- check if an element exists in the pool
Here's the class:
/// Stores unique identifiers
Class Utils.Pool Extends %Persistent
{
Property Value As %String;
Index IDKEY On Value [ IdKey, PrimaryKey, Unique ];
Method %OnNew(Value As %String = "") As %Status [ Private, ServerOnly = 1 ]
{
Set .I am learning cache in beginning level . But confused .Give an idea for how to i learn cache easily and improve programming level
We want to isolate the storage of our CCDAs from our HL7 V2 data, but keep them under the same namespace. From my understanding, I should create a new database then store those classes related to CCDAs in that database. Is this the correct approach?

