A Question about VL & Web Data Access

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
User avatar
lawingo
Posts: 58
Joined: Fri Dec 04, 2015 6:41 am

A Question about VL & Web Data Access

Post by lawingo » Fri May 22, 2020 1:29 am

All of our development thus far has been VL. Every file I create has a corresponding "Shared Routine" Reusable part that contains all the Routines to Fetch, Add, Update, Delete all data for that particular file in one single object. This "Shared Routine" has method routines that receive the parameters needed and then typically calls a server function which processes and returns the info needed. Every program creates, uses, and destroys these objects as needed. I believe that is standard setup??

Now I'm wanting to create some VL Web Pages that interact with these same objects. All of "Shared Routine" RPs were set up as Target Platform: "Windows/IBM i/Linux". I see I can change the Target Platform to "All Platforms" which breaks any Check,Delete, Insert, etc. I'm ok with that if there is a better way of setting it up so both Web & VL can access it.

I want to have 1 Shared Routine that both Web & VL can use in harmony without having to code in a Server Function and again in a Server Module. For example, if I want to return a data set on Employees, I shouldn't have to code the select logic twice: 1 for VL, & 1 for VL Web.

Does anyone have a fancy way of managing this ?

Fingers Crossed,
Chad Lawing
Sherrill Furniture

atostaine
Posts: 526
Joined: Wed Jan 20, 2016 7:38 am

Re: A Question about VL & Web Data Access

Post by atostaine » Fri May 22, 2020 2:00 am

lawingo wrote:
Fri May 22, 2020 1:29 am
All of our development thus far has been VL. Every file I create has a corresponding "Shared Routine" Reusable part that contains all the Routines to Fetch, Add, Update, Delete all data for that particular file in one single object. This "Shared Routine" has method routines that receive the parameters needed and then typically calls a server function which processes and returns the info needed. Every program creates, uses, and destroys these objects as needed. I believe that is standard setup??

Now I'm wanting to create some VL Web Pages that interact with these same objects. All of "Shared Routine" RPs were set up as Target Platform: "Windows/IBM i/Linux". I see I can change the Target Platform to "All Platforms" which breaks any Check,Delete, Insert, etc. I'm ok with that if there is a better way of setting it up so both Web & VL can access it.

I want to have 1 Shared Routine that both Web & VL can use in harmony without having to code in a Server Function and again in a Server Module. For example, if I want to return a data set on Employees, I shouldn't have to code the select logic twice: 1 for VL, & 1 for VL Web.

Does anyone have a fancy way of managing this ?

Fingers Crossed,
Chad Lawing
Sherrill Furniture
I had asked this a long while back and got an answer about using FUNCTIONs that either call another function or a server function, depending on platform. I think dingoateme responded. I gave up before I got it to work very well.

I'm very interested in this topic, the idea that RDMLX works anywhere isn't completely true.

Server functions can call your functions, but you would have to code the server function to at least pass the same parameters, EXCHANGE them into the function and return the values.
Art Tostaine

jyoung
Posts: 687
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: A Question about VL & Web Data Access

Post by jyoung » Fri May 22, 2020 5:13 am

We do VLWeb and VLF-One only.

Use a lot of Functions to share functionality across different things, but you cannot call them from VLWeb.
So you end up having to have a Server Module to act as a "Proxy" and as Art mentioned you have to "exchange" them to the function. Took me a little bit to grok this and then you have lists that work differently. The Lists work out ok, as you can pass them to a Function (note these are not the PRIM_LIST objects).

When we went down this path it worked out ok, in hindsight I think it abuses the Functions and the limitations of the Function Identifiers (shorter length) and Process Restrictions ( only so many Function in a Process) makes them somewhat frustrating to work with.

Not really helpful I know, but I don't know of an elegant solution. :(

Joe

Side note:
I really wish a Server Module to map to Component or a Collection Component instead of only being able to map to Fields. This would allow using a Component Model instead of Fields which would then allow me to convert the Functions into a Resuable Part without all the plumbing code.

User avatar
lawingo
Posts: 58
Joined: Fri Dec 04, 2015 6:41 am

Re: A Question about VL & Web Data Access

Post by lawingo » Tue May 26, 2020 2:46 am

That's what I figured. Thanks for the feedback!

Best,
Chad

Post Reply