Re: Publish Javadoc or big number of Static pages

2014-01-16 Thread phl
Hello, 

Thanks for the tips. It works if I replace Page by WebPage. 

Best regardds
PHL

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Publish-Javadoc-or-big-number-of-Static-pages-tp4663621p4663770.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Publish Javadoc or big number of Static pages

2014-01-14 Thread andre seame
Use the web server to show the static page is a very good idea. As all other 
pages are in generated by wicket, I was only thinking in term of wicket. 

Thanks for the idea.
PHL

> Date: Fri, 10 Jan 2014 15:11:17 -0500
> Subject: Re: Publish Javadoc or big number of Static pages
> From: p...@bors.ws
> To: users@wicket.apache.org
> 
> I'm not following, you want to show 200 static HTML pages in your webapp?
> 
> Your webapp must be running on top of a web server, why not just let the
> web server server the static content?
> What's the dynamic part of those 200 static HTML pages?
> Do you need to authenticate the user first or something before they can
> view the static content?
> 
> 
> On Fri, Jan 10, 2014 at 12:23 PM, andre seame  wrote:
> 
> >
> >
> > Hello,
> >
> >
> >
> > I
> > have a wicket site to manage different points on the project. I receive 200
> > HTML pages for the developer teams. These pages are "javadoc" pages.
> >
> > I
> > add some dynamic pages built over the static pages with wicket. And I will
> > to
> > publish all pages with wicket.
> >
> > As
> > I have static HTML pages and as want to use them immediately, I must use
> > the
> > Frame HTML mechanism.
> >
> > So
> > I will have a page with a left part: the menu or the list of pages, and on
> > the
> > right part (in another frame) the associated page.
> >
> > So
> > I am using the
> > http://www.wicket-library.com/wicket-examples/frames/ examples. This
> > works, but I have 2 problems:
> >
> > -
> > I have to created 200 page.java/page.class, one per static pages!
> >
> > -
> > I have to modify the code (creating a new page.java/page.class) if there
> > is a
> > new static page.
> >
> >
> >
> > So
> > what is the easiest way to manage this problem?
> >
> >
> >
> > May
> > be an idea is to say to wicket:  just for
> > this time, the associated html page to genericsaticpage.class is
> > staticpage1.html. Of course for another link, the associated html page to
> > genericsaticpage.class will be staticpage2.html.
> >
> >
> >
> > I
> > can also image to have staticpage.html : ... > wicket:id="The body will be read from the static
> > page">. In this case, I will lost the css or the javascript
> > code that may be included in the original static page.
> >
> >
> >
> > Thanks
> > for any pointers or suggestion.
> >
> >
  

Re: Publish Javadoc or big number of Static pages

2014-01-10 Thread Steve
Actually here's a slightly better example using PageParameters instead. 
This will allow you to mount it using:
WebApplication.get().mountPage("/static", StaticPage.class);

Also demonstrates that you can inject your own wicket tags into the
markup before returning it leaving the original markup file untouched.


public class StaticPage extends WebPage implements
IMarkupResourceStreamProvider, IMarkupCacheKeyProvider {

private String staticPageFilename;

public StaticPage(PageParameters params) {
super();
   
this.staticPageFilename =
params.get("staticPageFilename").toString();
   
add(new Label("label", "This is a static page generated from: "
+ staticPageFilename));
}

@Override
public String getCacheKey(MarkupContainer container, Class
containerClass) {
return staticPageFilename;
}

@Override
public IResourceStream getMarkupResourceStream(MarkupContainer
container, Class containerClass) {
   
String html = getFileAsString(staticPageFilename);
//modify html if necessary
html = html.replace("", "\n ");
   
return new StringResourceStream(html);
}

}
On 11/01/14 06:11, Paul Bors wrote:
> I'm not following, you want to show 200 static HTML pages in your webapp?
>
> Your webapp must be running on top of a web server, why not just let the
> web server server the static content?
> What's the dynamic part of those 200 static HTML pages?
> Do you need to authenticate the user first or something before they can
> view the static content?
>
>
> On Fri, Jan 10, 2014 at 12:23 PM, andre seame  wrote:
>
>>
>> Hello,
>>
>>
>>
>> I
>> have a wicket site to manage different points on the project. I receive 200
>> HTML pages for the developer teams. These pages are "javadoc" pages.
>>
>> I
>> add some dynamic pages built over the static pages with wicket. And I will
>> to
>> publish all pages with wicket.
>>
>> As
>> I have static HTML pages and as want to use them immediately, I must use
>> the
>> Frame HTML mechanism.
>>
>> So
>> I will have a page with a left part: the menu or the list of pages, and on
>> the
>> right part (in another frame) the associated page.
>>
>> So
>> I am using the
>> http://www.wicket-library.com/wicket-examples/frames/ examples. This
>> works, but I have 2 problems:
>>
>> -
>> I have to created 200 page.java/page.class, one per static pages!
>>
>> -
>> I have to modify the code (creating a new page.java/page.class) if there
>> is a
>> new static page.
>>
>>
>>
>> So
>> what is the easiest way to manage this problem?
>>
>>
>>
>> May
>> be an idea is to say to wicket:  just for
>> this time, the associated html page to genericsaticpage.class is
>> staticpage1.html. Of course for another link, the associated html page to
>> genericsaticpage.class will be staticpage2.html.
>>
>>
>>
>> I
>> can also image to have staticpage.html : ...> wicket:id="The body will be read from the static
>> page">. In this case, I will lost the css or the javascript
>> code that may be included in the original static page.
>>
>>
>>
>> Thanks
>> for any pointers or suggestion.
>>
>>


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Publish Javadoc or big number of Static pages

2014-01-10 Thread Steve
public class StaticPage extends Page implements
IMarkupResourceStreamProvider, IMarkupCacheKeyProvider {

private String staticPageFilename;

public StaticPage(String staticPageFilename) {
super();
this.staticPageFilename = staticPageFilename;
}

@Override
public String getCacheKey(MarkupContainer container, Class
containerClass) {
return staticPageFilename;
}

@Override
public IResourceStream getMarkupResourceStream(MarkupContainer
container, Class containerClass) {
   
String html = getFileAsString(staticPageFilename);
//modify html if necessary
return new StringResourceStream(html);
}

}
On 11/01/14 06:11, Paul Bors wrote:
> I'm not following, you want to show 200 static HTML pages in your webapp?
>
> Your webapp must be running on top of a web server, why not just let the
> web server server the static content?
> What's the dynamic part of those 200 static HTML pages?
> Do you need to authenticate the user first or something before they can
> view the static content?
>
>
> On Fri, Jan 10, 2014 at 12:23 PM, andre seame  wrote:
>
>>
>> Hello,
>>
>>
>>
>> I
>> have a wicket site to manage different points on the project. I receive 200
>> HTML pages for the developer teams. These pages are "javadoc" pages.
>>
>> I
>> add some dynamic pages built over the static pages with wicket. And I will
>> to
>> publish all pages with wicket.
>>
>> As
>> I have static HTML pages and as want to use them immediately, I must use
>> the
>> Frame HTML mechanism.
>>
>> So
>> I will have a page with a left part: the menu or the list of pages, and on
>> the
>> right part (in another frame) the associated page.
>>
>> So
>> I am using the
>> http://www.wicket-library.com/wicket-examples/frames/ examples. This
>> works, but I have 2 problems:
>>
>> -
>> I have to created 200 page.java/page.class, one per static pages!
>>
>> -
>> I have to modify the code (creating a new page.java/page.class) if there
>> is a
>> new static page.
>>
>>
>>
>> So
>> what is the easiest way to manage this problem?
>>
>>
>>
>> May
>> be an idea is to say to wicket:  just for
>> this time, the associated html page to genericsaticpage.class is
>> staticpage1.html. Of course for another link, the associated html page to
>> genericsaticpage.class will be staticpage2.html.
>>
>>
>>
>> I
>> can also image to have staticpage.html : ...> wicket:id="The body will be read from the static
>> page">. In this case, I will lost the css or the javascript
>> code that may be included in the original static page.
>>
>>
>>
>> Thanks
>> for any pointers or suggestion.
>>
>>


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Publish Javadoc or big number of Static pages

2014-01-10 Thread Paul Bors
I'm not following, you want to show 200 static HTML pages in your webapp?

Your webapp must be running on top of a web server, why not just let the
web server server the static content?
What's the dynamic part of those 200 static HTML pages?
Do you need to authenticate the user first or something before they can
view the static content?


On Fri, Jan 10, 2014 at 12:23 PM, andre seame  wrote:

>
>
> Hello,
>
>
>
> I
> have a wicket site to manage different points on the project. I receive 200
> HTML pages for the developer teams. These pages are "javadoc" pages.
>
> I
> add some dynamic pages built over the static pages with wicket. And I will
> to
> publish all pages with wicket.
>
> As
> I have static HTML pages and as want to use them immediately, I must use
> the
> Frame HTML mechanism.
>
> So
> I will have a page with a left part: the menu or the list of pages, and on
> the
> right part (in another frame) the associated page.
>
> So
> I am using the
> http://www.wicket-library.com/wicket-examples/frames/ examples. This
> works, but I have 2 problems:
>
> -
> I have to created 200 page.java/page.class, one per static pages!
>
> -
> I have to modify the code (creating a new page.java/page.class) if there
> is a
> new static page.
>
>
>
> So
> what is the easiest way to manage this problem?
>
>
>
> May
> be an idea is to say to wicket:  just for
> this time, the associated html page to genericsaticpage.class is
> staticpage1.html. Of course for another link, the associated html page to
> genericsaticpage.class will be staticpage2.html.
>
>
>
> I
> can also image to have staticpage.html : ... wicket:id="The body will be read from the static
> page">. In this case, I will lost the css or the javascript
> code that may be included in the original static page.
>
>
>
> Thanks
> for any pointers or suggestion.
>
>