Submitted by Anonymous (not verified) on Fri, 04/10/2015 - 10:10
Forums

Hi,

The problem is the path of HTML source in RPG had to code the whole path.

In my production machine it doesn't need to and it's still working fine. In my development machine after we change the serial no. and applied the new license key, it doesn't work anymore. This machine was a production machine before. The same program, same setup, same root path - it worked all the time.

Why does it work in my production machine and not in the development machine?

Best regards,

Dicken

Niels Liisberg

Wed, 04/15/2015 - 14:57

Hi Dicken;

The includeTag is relative to path where the IceBreak program is running. So you might run the application in a sub-folder which makes the confusion in production but not in development.

I expect you need to include() / responseWriteTag() to be relative to the server root. Therefore prefix the filename with ./

In your case it will be ./assetinq.html

From the manual:

  • /path/filename.ext     This absolute from the IFS root
  • ./Filename.ext           This is relative to the Server instance root path
  • Filename.ext             This is relative to the browser relative "refer location"

Separating business logic and presentation layer

Markers also make it possible to separate .aspx code and HTML or XML documents. Here are the two steps:

  1. Place all your HTML or XML code in a separate document which can be designed and validated by any HTML or XML editor.
  2. Make a .aspx program which refers to a specific tag in the HTML / XML document at runtime.

Your connection with variables in the final response is through markers.

The syntax is the same as for static include in the presentation layer:

<!--#tag="tagname"-->

Next you referfollowing to that tag from the program by setting markers and finally render the result

by:

ResponseWriteTag('filename' : 'tagname'); Filename:

The file name and path can be absolute or relative for the ResponseWriteTag(Filename :TagName) according to the following

  • /path/filename.ext     This absolute from the IFS root
  • ./Filename.ext           This is relative to the Server instance root path
  • Filename.ext             This is relative to the browser relative "refer location"

Tagname:

The tag name is the location in the file - until next tag or end of file (which comes first)

The special values *FIRST can be used as tag name to refer to the first protion of the file prior to any tags. This is useful when dealing with XML-response files since they can be validated. An XML file can not start with a comment, which the tag looks like from a XML file editor’s perspective.

Example:

The HTML document (let's call it ex01marker1.htm) will contain the following:

<html>
<body>
<h1>Dynamic placing data using markers</h1> <table>
<!--#tag="detail"-->
<tr>

  <td><%$ MyCounter %></td>
  <td><%$ MyTime %></td>
</tr>
<!--#tag="end"-->
</table>
</body>
</html>

The ASPX program is HTML free and only use the SetMarker(variable : value); and theResponseWriteTag(Filename : TagName); build-in function.

<%
d i s 10i 0

/free
ResponseWriteTag('./tutorials/ex01marker1.htm' : '*FIRST'); 

for i = 1 to 1000;

     SetMarker('MyCounter': %char(i));
     SetMarker('MyTime'   : %char(%timestamp));
     ResponseWriteTag('./tutorials/ex01marker1.htm' : 'detail'); 

Endfor;

ResponseWriteTag('./tutorials/ex01marker1.htm' : 'end'); 

return;

%>

Best regards,

Niels Liisberg