I need a basic understanding of how to to include progress f

Posted by 10016759 on 19-Jul-2019 20:05

Working on my first Webspeed project and created a printable form. 

I've compiled it using webspeed webtools compiler without errors, and it

runs fine,  Currently, I don't have a single line of webspeed code within my html file, but

now I want to be able to include a progress .i file near my <body> tag like this:

<body>

<!--WSS
{ email.i }
{&out} "<p>cAcctEmail</p>"
-->

And then in my email.html file it would look like this:

 

<!--WSMETA NAME="wsoptions" CONTENT="include" -->
<!--WSS
DEF VAR cAcctEmail AS CHAR NO-UNDO INIT "notyoubutme@hotmail.com"

->

 

We are running OpenEdge Explorer 11.6, but I can't be sure what webspeed version we have.

Bottom line is I can't get this to compile and based on the document I have read here

https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/pdsoe/compiling-web-objects.html

I think I am including the file correctly.  Frankly, the documentation looks a little backwords to me... Why would you want to define a progress variable in the index.html file and set it in the included file?  I'm doing it the other way around, but without success. 

If I get this working, where I am able to include a file with a progress "initialized" variable into my html, if that html file say it hyperlinks to another html file... Will I be able to share or reference those progress variables in the other html file? Is there a way to do this?

Thanks in advance.

 

All Replies

Posted by goo on 22-Jul-2019 15:56

I have been working with many approaches within webspeed, and for me was the most flexible to call webspeed for data using ajax. By splitting between HTML/css/JavaScript and Progress made it easier to understand, less messy and a lot more easy to split the work between coworkers.


Do NOT try mapping, and SpeedScript is ok, but you end up with code difficulty to read. The Ajax approach is also much more up to date coding.

Geir Otto

Sendt fra min iPad

22. jul. 2019 kl. 15:20 skrev 10016759 <bounce-10016759@community.progress.com>:

<ProgressEmailLogo-png_2D00_150x42x2-png> Update from Progress Community
<avatar-png_2D00_70x70x2-png>
10016759

Working on my first Webspeed project and created a printable form. 

I've compiled it using webspeed webtools compiler without errors, and it

runs fine,  Currently, I don't have a single line of webspeed code within my html file, but

now I want to be able to include a progress .i file near my <body> tag like this:

<body>

<!--WSS
{ email.i }
{&out} "<p>cAcctEmail</p>"
-->

And then in my email.html file it would look like this:

 

<!--WSMETA NAME="wsoptions" CONTENT="include" -->
<!--WSS
DEF VAR cAcctEmail AS CHAR NO-UNDO INIT "notyoubutme@hotmail.com"

->

 

We are running OpenEdge Explorer 11.6, but I can't be sure what webspeed version we have.

Bottom line is I can't get this to compile and based on the document I have read here

https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/pdsoe/compiling-web-objects.html

I think I am including the file correctly.  Frankly, the documentation looks a little backwords to me... Why would you want to define a progress variable in the index.html file and set it in the included file?  I'm doing it the other way around, but without success. 

If I get this working, where I am able to include a file with a progress "initialized" variable into my html, if that html file say it hyperlinks to another html file... Will I be able to share or reference those progress variables in the other html file? Is there a way to do this?

Thanks in advance.

 

View online

 

You received this notification because you subscribed to the forum.  To stop receiving updates from only this thread, go here.

Flag this post as spam/abuse.

Posted by Matt Baker on 22-Jul-2019 16:46

You shouldn't be going down the path of mixing any sort of server side logic with HTML. You should be looking to follow the principle of "separation of concerns".  The HTML and its corresponding .css file is for display. Use a the REST Adapter for classic AppServer, or better yet, if you have a PASOE license, create a REST service to serve data. And use javascript with ajax to fetch and process the data.

This is a bit more complicated a setup than WebSpeed, but long term you'll be much happier with the outcome.

Posted by David Cleary on 22-Jul-2019 18:04

Keep in mind that you are going down a deprecated technology path by using SpeedScript. As Matt pointed out, this type of programming has fallen out of favor over the past 20 years and gone to one where UI and data are separate. However, it is the easiest way to create an HTML page with the ABL. Just not maintainable.
 
Dave
 

Posted by egarcia on 22-Jul-2019 18:21

Hello,

> <!--WSMETA NAME="wsoptions" CONTENT="include" -->

The compilation of a .html SpeedScript file (HTML + embedded ABL code) generates a temporary .w file which then compiled into a .r.

The HTML code then is written out using {&OUT}.

This allows for dynamic code that combines HTML and ABL.

When you use the wsoptions / include, you are telling the WebTools to generate a .i file instead of a .w/.r file.

You can use the Compile File option in WebTools to and save the temporary .w file. This .w file includes e4gl.i and has additional code.

If you were to use wsoptions / include with the same .html file. You would see that the .i does not have the extra code.

The idea of the wsoptions / include is that you would have an ABL include file with the HTML code {&OUT}.

As others have said, in modern web development, it is better to separate the UI from the data and generally you would not write SpeedScript files.

You can access the data using AJAX (Asynchronous JavaScript and XML) which nowadays corresponds to async calls to JSON data via REST.

With OpenEdge, you have multiple ways to implement REST access:

- REST support with WebHandlers (available with PASOE starting in 11.6)

- REST support with REST mapping

- REST support with Progress Data Objects (which can be consumed by the JSDO in JavaScript)

I hope this helps.

This thread is closed