Re: How to include html page

Posted by oceatoon on
URL: http://ofbiz.116.s1.nabble.com/How-to-include-html-page-tp141499p141504.html

Hi Dhilip
It seems all you have to do is to put an .ftl file type on your
policie.htmshould be
policie.ftl even though you have html in it.

Sometimes I found it usefull to use the freemarker <#include
"header_navhaut.ftl">    which includes this peice of html code inside an
ftl page.

hope this helps
Regards
Tibor


On 8/23/06, Vinay Agarwal <[hidden email]> wrote:

>
> Dhilip,
>
> FTL files are superset of HTML. To include a pure HTML page, you would
> need
> to create a screen widget (like all other screens) where you include your
> html page with the following tags
> <platform-specific><html><html-template
>
> location="component://xyz/somedir/somedir/somefile.html"/></html></platform-
> specific>
>
> You can find many examples if you search for "<platform-specific>" in the
> project's xml files.
>
> Regards,
> Vinay Agarwal
>
>
> -----Original Message-----
> From: dhilip kumar [mailto:[hidden email]]
> Sent: Wednesday, August 23, 2006 3:59 AM
> To: [hidden email]
> Subject: Re: How to include html page
>
>
>   Hi Scott
>
>   Actually i want to load the html page, say, "policies.htm" to be
> displayed
> in main page thru "controller.xml".
>
>   For that, in the controller.xml, request-map uri is given like this,
>
>   <request-map uri="policy">
>   <security https="false" auth="false"/>
>   <response name="success" type="view" value="policy"/>
>   </request-map>
>
>   For the view map, the following is given,
>
>   <view-map name="privacypolicy" type="screen"
> page="component://ecommerce/widget/CommonScreens.xml#privacypolicy"/>
>
>   In the CommonScreens.xml, the following given
>
>   <screen name="policy">
>   <section>
>   <actions>
>   <set field="leftbarScreenName" value="leftbar"/>
>   <set field="rightbarScreenName" value="rightbar"/>
>   <set field="MainColumnStyle" value="center"/>
>   <set field="title-property" value="PageTitleMain"/>
>   <set field="headerItem" value="main"/>
>   <set field="randomSurveyGroup" value="testSurveyGroup"/>
>
>
>
>   </actions>
>   <widgets>
>   <decorator-screen name="main-decorator"
> location="${parameters.mainDecoratorLocation}">
>   <decorator-section name="body">
>   <platform-specific>
>   <html><html-template
> location="component://ecommerce/webapp/ecommerce/policies.htm"/></html>
>   </platform-specific>
>   </decorator-section>
>   </decorator-screen>
>   </widgets>
>   </section>
>   </screen>
>
>
>   The "policy " link is in the header. So in the header.ftl, i have given
> like this "
>   <td width="5%" class="headerButtonRight"><a
> href="<@ofbizUrl>privacypolicy</@ofbizUrl>"
> class="headerbuttontext">Policy</a> ".
>
>   I have tried with keeping the "policy.htm" file in the "/images/"
> folder.
> It also gives the same error.
>
>   Thanks and regards
>
>   Dhilip
>
>
>
> Scott Gray <[hidden email]> wrote:
>   Could you show us how you are trying to load the page?
>
> dhilip kumar wrote:
> > Thanks Amit. I have all the handlers in "controler.xml". Still i am
> getting the same error.
> >
> > Dhilip
> >
> > Amit Shinde wrote:
> > Dilip,
> > This might be due to the handlers that need to be included in the
> > controller file. At the top of the controller.xml file, check whether
> > you are missing any of these handlers. You probably dont have the "http"
> > handler. After including them, restart the server again.
> >
> >
> >
> > class="org.ofbiz.webapp.event.JavaEventHandler"/>
> > class="org.ofbiz.webapp.event.SOAPEventHandler"/>
> > class="org.ofbiz.webapp.event.ServiceEventHandler"/>
> > class="org.ofbiz.webapp.event.SimpleEventHandler"/>
> >
> >
> > class="org.ofbiz.webapp.ftl.FreeMarkerViewHandler"/>
> > class="org.ofbiz.webapp.view.JspViewHandler"/>
> > class="org.ofbiz.widget.screen.ScreenWidgetViewHandler"/>
> > class="org.ofbiz.webapp.view.HttpViewHandler"/>
> > class="org.ofbiz.webapp.view.DataVisionViewHandler"/>
> > class="org.ofbiz.webapp.view.JasperReportsPdfViewHandler"/>
> > class="org.ofbiz.webapp.view.JasperReportsXmlViewHandler"/>
> > class="org.ofbiz.widget.screen.ScreenFopPdfViewHandler"/>
> >
> >
> > Hope this helps.
> >
> > Amit Shinde
> >
> >
> > -----Original Message-----
> > From: dhilip kumar [mailto:[hidden email]]
> > Sent: Wednesday, August 23, 2006 3:44 PM
> > To: users
> > Subject: How to include html page
> >
> >
> > Hi
> >
> > I would like to include "html" page in the main page(thru the
> > controller), instead of "ftl" page. But i am getting the folowing
> > error,
> >
> > "org.xml.sax.SAXParseException: The markup in the document following
> > the root element must be well-formed."
> >
> > Could anyone please help me?
> >
> > Thanks in advance
> >
> >
> >
> >
> >
> > ---------------------------------
> > Stay in the know. Pulse on the new Yahoo.com. Check it out.
> >
> >
> >
> >
> > ---------------------------------
> > Get your email and more, right on the new Yahoo.com
> >
>
>
>
>
> ---------------------------------
> How low will we go? Check out Yahoo! Messenger's low  PC-to-Phone call
> rates.
>
>