1. David Peace (Powersoft)
  2. PowerBuilder
  3. Wednesday, 13 May 2020 09:24 AM UTC

Hi Guys

Is there anyway to exportJson and include all the DW definition syntax like getfullstate can? What I'm trying to do is pass DW data and structure through to an application that does not know anything about the DW definition and does not have the details of the dataobject 'd_test' in it's library set. I want to be able to dynamically create the details of a datastore then process the exportedJson stuff.

Thanks

David

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 13 May 2020 16:21 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi David;

  There is no equivalent to that in the JSON world. The "JSONPackage" object can package one or more DWO's Data Buffers in JSON format but not the DWO Syntax itself. AFAIK, this would need to be an enhancement request.

  You Could still use the LibraryExport at run time to get the DWO source. Then pass that to the 2nd App. However, I suspect that you would need to use the Encode64 feature for that.

Regards ... Chris

Comment
  1. David Peace (Powersoft)
  2. Thursday, 14 May 2020 08:08 AM UTC
I suppose that what is really needed is to be able to extract the DB layer of the DW not all the UI parts, typically when passing DW data and stuff around you are looking specifically at the DB access layer not the UI. Food for thought on the Appeon R&D bench.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 15 May 2020 00:44 AM UTC
  2. PowerBuilder
  3. # 1

Just out of curiosity, I feel like I'm missing something:

Wouldn't it be as simple as doing GetFullState() and pass the blob variable somehow to the other application, where you could do a SetFullState()? (Roland mentioned this somehow). You then have and definition and data.

Or is the problem that you can't pass a blob? If not, maybe encode it as a Encode64-string (as suggested by Chris)?

Why the need for the export of source code? You could pass the dw_1.Describe("Datawindow.Syntax") and assign it to a dw control with a dummy dataobject.

regards

Comment
  1. David Peace (Powersoft)
  2. Friday, 15 May 2020 07:06 AM UTC
Hi Miguel

All of these are valid solutions and doable. I set off witht he thought to use the new Json import & export facilities as these are quite neat and a small message set. The only weakness in the JSON Export is not extracting the DB layer components too, and obviously the JSON Import would need to use these to create the dw first. If this were possible then the JSON functions would be very usefull indeed.



Currently I'm just playing with ideas as part of our R&D strategy, looking for better ways to do things now we have better tools.

Thank you everyone for their contributions to the knowledge pot :)

Cheers

David
  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 15 May 2020 07:11 AM UTC
Hi David,

Thank you for clearing that up!
  1. Helpful
  1. Ricardo Jasso
  2. Friday, 15 May 2020 14:01 PM UTC
I would leave ExportJson as it is now to not overcomplicate it and create a new funcion called ExportSchemaJson that could extract the DB layer and put it in a JSON string. If needed, call the schema function first and then the data function second.
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Thursday, 14 May 2020 23:55 PM UTC
  2. PowerBuilder
  3. # 2

David -

   If your DW is relatively simple, you can pass the SQL, along with the FILTER and SORT values and create your new DS using those values.


Olan

Comment
  1. David Peace (Powersoft)
  2. Friday, 15 May 2020 07:02 AM UTC
Hi Olan

The problem with passing the SQL is that the client is not connected to a DB so in quite a lot of cases the SQL returned is PBSQL not true SQL and that cannot be used to create a DW.



Cheers

David
  1. Helpful
  1. Olan Knight
  2. Friday, 15 May 2020 13:06 PM UTC
That would make it quite difficult to get the data you need! :)
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 13 May 2020 18:35 PM UTC
  2. PowerBuilder
  3. # 3

Like Chris said, you can use LibraryExport to get the syntax and ExportJSON to get the data.

In my testing, GetFullState/SetFullState is actually faster than using ExportJSON & ImportJSON. That was with a resultset of 11 rows and about 10 columns.

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.