Caché

Syndicate content 118 

Hello, I am writing some cache code that will pick up a PDF file, Base64 encode the contents and then send on to a third party system within a Long String (via their API). I have been testing this and discovered that the PDFs do not open within the supplier system (I get an error saying that it hasn't been decoded correctly). I wanted to prove that the issue does not lie with the way that I have Base64 encoded it within Ensemble, and therefore as a test wanted to Encode the PDF stream, then decode the stream and write out to a new file. Unfortunately after my code has created the file locally, when I go to open the file in Adobe, I get the same error message. Therefore I am trying to work out if I have not Encoded it properly, or have not Decoded it properly (or both!). Below is a code snippet of how I am performing this test within a BPL code block; ~~~ //context.streamPDF is a %StreamGlobalBinary containing the PDF stream.

Last answer 2 June 2017 Last comment 2 June 2017
0   0 6
1869

views

0

rating

I need to guarantee that a parent AND child rows has been inserted successfully before any other process is able to read ANY of the data.

What is the proper way to prevent DIRTY reads?  Per the Intersystem's documentation I should be able to use 'START TRANSACTION ISOLATION LEVEL READ COMMITTED'.  I have attempted to use these commands in embedded and dynamic SQL calls to no avail.

I have to be able to insert the data via JDBC calls, but legacy Caché (.MAC) may be reading the data, and if the data is read to quickly, I could have processing errors, as all the child rows have not been inserted.

Per the code below, every time I insert the new record my process fails.  I have also added break points and am able to view via the Global and via xDBC clients

Last answer 2 June 2017 Last comment 2 June 2017
0   0 0
361

views

0

rating

Hi!

I have a question:

I create a Operation REST API , when I call to my client trough this REST API, my cliente returns list of object in JSON, like that:

[
    {
    "Center" : "aaaaaaaaaa",
    "Nif" : "00000000T",
    "NumberCenter" : "00000000",
    "Name" : "ppppp",
    },
    {
    "Center" : "aaaaaaaaaa",
    "Nif" : "00000000T",
    "NumberCenter" : "00000000",
    "Name" : "ppppp",
    },
    {
    "Center" : "aaaaaaaaaa",
    "Nif" : "00000000T",
    "NumberCenter" : "00000000",
    "Name" : "ppppp",
    }
]

On the other hand, I have in my Ensemble, Two class:

Class A --> lisf of class B

Class B --> Center, Nif,NumberCenter, Name

I need to iterate over JSON and capture de information a put this in my object A

I have been investigating... And I found a approximation that i want to do...

First of all, I want to iterate over JSON and capture de informatio

Last answer 1 June 2017 Last comment 2 June 2017
0   0 4
403

views

0

rating

I'm doing a REST service. A method has as body parameter a JSON corresponding to a class A.

In my production I have class A so that I retrieve the parameters using a dynamic object, such that:

Set body = ##class(%DynamicObject).%FromJSON(%request.Content)
Set myObjectA = ##class(A).%New()
Set myObjectA.Id = body.Id
Set myObjectA.Name = body.Name
Set myObjectA.Date = body.Date
Set myObjectA.Salary = body.Salary

I would like to know if I can avoid doing the manual mapping, doing a casting, since I am sure that FromJSON will return a class A. Something like this:

Set myObjectA = ##class(A).%FromJSON(%request.Content)

 

Any suggestions? Thanks.

Last answer 1 June 2017 Last comment 2 June 2017
0   0 0
402

views

0

rating

I'm aware of two ways to get list of files in a dir:

set dir = "C:\temp\"
set rs = ##class(%File).FileSetFunc(dir, , , 1)
do rs.%Display()

and:

set dir = "C:\temp\"
set file=$ZSEARCH(dir_"*")
while file'="" {
   write !,file
   set file=$ZSEARCH("")
}

Yet they bot return only files and directories in a current directory, but not files in subdirectories.

I suppose I call one of these recursively, but maybe there's a better solution?

Last answer 1 June 2017 Last comment 27 May 2017
+ 1   0 7
1164

views

+ 1

rating

Hi,

Cache Studio's inspector window can show me a Cache class's properties,methods parameters, XDATA blocks, Triggers, Foreign Keys, Queries and more, in a table in the Inspector window. Additionally, for properties, where the property accepts parameters, these parameters are listed together with possible value choices.

Last answer 31 May 2017 Last comment 1 June 2017
0   0 1
282

views

0

rating

Is there any methods/ways through which will get to know whether any of the Unit Test cases is/are failing in the Terminal with status as either 0 or False in case of Failure & 1 or Ture in case of Test Passes (we are getting an url of the csp page with the report which has the passed failed status) as we need to send this failure status to Jenkins for the Build to Fail (where in we have acheived this part in making the build failure/success based on  harcoded boolean)

Last answer 31 May 2017 Last comment 31 May 2017
0   0 5
315

views

0

rating

I need to execute a single csession command which calls a multi-parameter routine, such as ^SECURITY. This will be to do things such as create databases, resources, etc. (see below). When I run the command all at once, I get a PARAMETER error.

[user@host ~]$ csession INSTANCENAME -U %SYS "^SECURITY(4,1,\"testresource\")"
<PARAMETER>SECURITY^SECURITY

Last answer 30 May 2017
0   0 4
0

comments

305

views

0

rating

As Bill has mentioned earlier in his post, we have carefully reviewed the JSON capabilities and made some adjustments to ensure they deliver the best benefit to you. In this post, I am going to describe the modifications in more detail and provide guidance for you to understand the implication for your code base.

Last comment 30 May 2017
+ 11   0 12
2528

views

+ 11

rating

I am inserting rows in a table. This table is appearing in all namespace as I did global mapping. 

So once I run insert command from a method, it insert the rows. When I run the same insert command from other namespace, it replace the existing data in table. 

Insert command is same in all namespace but the data I m inserting is different. 

 

Last answer 30 May 2017
0   0 3
0

comments

233

views

0

rating

InterSystems is pleased to announce the availability of the following maintenance releases:

  • Caché and Ensemble 2017.1.1
  • HealthShare Health Connect v15.021 on core technology 2017.1.1

Caché and Ensemble are available on the same platforms as 2017.1.0, except as noted below

  • The full list of corrections can be found in the release notes.
  • The version number of the kits for these releases is 2017.1.1.111.0
  • Oracle Solaris 10, 11 for SPARC-64 and Oracle Solaris 10, 11 for x86-64 are not yet approved.

HealthShare HealthConnect v15.021 on core technology 2017.1.1.111.

0   0 1
0

comments

253

views

0

rating

Hi!

I'm saving object instance using RestForms.

RESTFormsUI calls %Save() for me, which is great. But I want to set the property CreationDate with the current date for every new record being inserted.

So  object callback implementation seems as a reasonable option. I did the following:

Method %OnBeforeSave(insert as %Boolean) As %Status [ Private, ServerOnly = 1 ] 
{

 if insert s ..CreationDate=$H

 q $$$OK

}

And it works fine.

But Documentation says I'd better use %OnAddToSaveSet()

What are you using for the callbacks in similar cases?

Last answer 26 May 2017 Last comment 26 May 2017
0   0 7
278

views

0

rating

In Cache 2013.1.6.950.1 I have a ZEN dataGrid which works fine except if I use the mouse wheel to scroll through it.

If you use the mouse wheel (rather than the scroll bar) to scroll to the bottom of the grid and then click the checkbox against the bottom row it works the first time however if you then scroll back down the grid with the mouse wheel to the check box and uncheck it the check box will still be checked when you scroll back down to it and it only goes unchecked when you click in it a second time.  It works fine when the scroll bar is used. I have attached the code (cut down to show the problem) with some sample data. This code should be loaded in the USER namespace.

 

 

Last answer 26 May 2017 Last comment 26 May 2017
+ 2   0 3
200

views

+ 2

rating

The Data Platforms department here at InterSystems is gearing up for this year's crop of interns, and I for one am very excited to meet them all next week!

We've got folks from top technical colleges with diverse specialties from hard core engineers to pure computer scientists to mathematicians to business professionals. They come from countries around the world like Vietnam, China, and Finland and they all come with impressive backgrounds. We're sure they will do very well this summer.

Rather than providing a set list of projects this year, Data Platforms interns will be developing their own projects which satisfy a short list of requirements. I can't wait to see what they come up with!

For an idea of what to expect, check out the white paper attached from my group last year who ported Deep Feature Synthesis research done at MIT for SQL platforms to Caché. Sarat Vysyaraju and Ryan St. Pierre did me and all the other mentors who provided guidance proud

+ 6   0 3
0

comments

292

views

+ 6

rating

Hello,

I’m creating a REST API service but I need to convert my object in JSON.

The Class “A” is extended from another Class “B”:

Class message_B Extends Ens.Request
{

Property ClientId As %String(MAXLEN = "");

Property mesagge As %String(MAXLEN = "");

}
Class message_A Extends message_B
{
Property idDate As %String;

Property Datetime As %String;

Property time As %String;

​}

When I use:

set pRequest = ##Class(message_A).%New()
​do ##class(Ens.Util.JSON).ObjectToJSONStream(pRequest, .content)

This convert all properties  (A y B), but I want that only convert properties in A. I mean, in JSON appear all property, incluided ClientId, mesagge, however I want that this varibales not appear in my JSON.

How can i do ?

Last answer 25 May 2017 Last comment 25 May 2017
0   0 3
686

views

0

rating