You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mansour Al Akeel <ma...@gmail.com> on 2013/03/31 08:42:21 UTC

display html from cocoon in wicket

Hello all,

I am working on a small project with wicket. The components in this project
needs to display html generated by docbook-xsl using cocoon 3.0 beta.

I looked around in the documentation for wicket integration, and they seem
to work directly with Cocoon Components.

This is not what I want. I have the blocks I need already defined in
sitemap.xmap(s).
I am able to do something like this in wicket, this is a prototype:

public class ContentsPage extends WebPage {

    public ContentsPage() {
        String reqUrl;
        reqUrl = "http://wiki.apache.org/jackrabbit/IndexingConfiguration";
        Label contents;
        DefaultHttpClient httpclient = new DefaultHttpClient();
        HttpGet httpGet = new HttpGet(reqUrl);
        try {
            HttpResponse response = httpclient.execute(httpGet);
            HttpEntity entity = response.getEntity();
            if (entity != null) {
                String str = EntityUtils.toString(entity);
                contents = new Label("lbl", str);
                contents.setEscapeModelStrings(false);
                add(contents);
            }
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

However, I need an advice about static contents and images. How to deal
with them ?

Thank you in advance.

Re: display html from cocoon in wicket

Posted by Mansour Al Akeel <ma...@gmail.com>.
It's okay, I found what I was looking for.




On Sun, Mar 31, 2013 at 2:42 AM, Mansour Al Akeel <mansour.alakeel@gmail.com
> wrote:

> Hello all,
>
> I am working on a small project with wicket. The components in this
> project needs to display html generated by docbook-xsl using cocoon 3.0
> beta.
>
> I looked around in the documentation for wicket integration, and they seem
> to work directly with Cocoon Components.
>
> This is not what I want. I have the blocks I need already defined in
> sitemap.xmap(s).
> I am able to do something like this in wicket, this is a prototype:
>
> public class ContentsPage extends WebPage {
>
>     public ContentsPage() {
>         String reqUrl;
>         reqUrl = "http://wiki.apache.org/jackrabbit/IndexingConfiguration
> ";
>         Label contents;
>         DefaultHttpClient httpclient = new DefaultHttpClient();
>         HttpGet httpGet = new HttpGet(reqUrl);
>         try {
>             HttpResponse response = httpclient.execute(httpGet);
>             HttpEntity entity = response.getEntity();
>             if (entity != null) {
>                 String str = EntityUtils.toString(entity);
>                 contents = new Label("lbl", str);
>                 contents.setEscapeModelStrings(false);
>                 add(contents);
>             }
>         } catch (ClientProtocolException e) {
>             e.printStackTrace();
>         } catch (IOException e) {
>             e.printStackTrace();
>         }
>     }
> }
>
> However, I need an advice about static contents and images. How to deal
> with them ?
>
> Thank you in advance.
>
>