Re: ResourceLink and page versioning

2011-11-07 Thread Martin Grigorov
On Mon, Nov 7, 2011 at 7:39 PM, Wolfgang Schreiner  wrote:
> Hi all,
>
> I got a couple of questions ...
>
> 1) I would like to open a new browser tab and display a PDF when I click a
> link. I extended ByteArrayResource but "getData" is not always called.
> Seems like once generated the documents get cached and randomly displayed,
> which of course is not acceptable, because the PDFs depend on user
> selection. How can I fix that?

Override
org.apache.wicket.request.resource.ByteArrayResource.configureResponse(ResourceResponse,
Attributes)
and call resourceResponse.setCacheDuration(Duration.NONE)

>
> 2) Is there a way to generally disable page versioning
> (getPageSettings().setVersionPagesByDefault(false)) but enable versioning
> for a single page?

Just override MyPage#isVersioned() to return 'true'

>
> Hope you can help me. Thanks!
>
> w
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: ResourceLink and page versioning

2011-11-07 Thread Wolfgang Schreiner
One more thing:

I implemented page authentication according to wicketstuff.org. My 
application class sets the AuthorizationStrategy in the init method. 
"isActionAuthorized" throws a 
RestartResponseAtInterceptPageException(Login.class), if the user is not 
signed in.

The Login class however throws a ReplaceHandlerException when I invoke 
"continueToOriginalDestination", and the original page is not displayed.

Am I missing something? I have to get this to work.

Thanks




From:
Wolfgang Schreiner/AUT/CSC@CSC
To:
users@wicket.apache.org
Date:
07.11.2011 18:40
Subject:
ResourceLink and page versioning



Hi all,

I got a couple of questions ...

1) I would like to open a new browser tab and display a PDF when I click a 

link. I extended ByteArrayResource but "getData" is not always called. 
Seems like once generated the documents get cached and randomly displayed, 

which of course is not acceptable, because the PDFs depend on user 
selection. How can I fix that?

2) Is there a way to generally disable page versioning 
(getPageSettings().setVersionPagesByDefault(false)) but enable versioning 
for a single page?

Hope you can help me. Thanks!

w




ResourceLink and page versioning

2011-11-07 Thread Wolfgang Schreiner
Hi all,

I got a couple of questions ...

1) I would like to open a new browser tab and display a PDF when I click a 
link. I extended ByteArrayResource but "getData" is not always called. 
Seems like once generated the documents get cached and randomly displayed, 
which of course is not acceptable, because the PDFs depend on user 
selection. How can I fix that?

2) Is there a way to generally disable page versioning 
(getPageSettings().setVersionPagesByDefault(false)) but enable versioning 
for a single page?

Hope you can help me. Thanks!

w