Hot to use BookmarkablePageLinks with a page mounted at several pathes?

View: New views
6 Messages — Rating Filter:   Alert me  

Hot to use BookmarkablePageLinks with a page mounted at several pathes?

by okrohne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have one page which is mounted at several pathes with IndexParamUrlCodingStrategy e.g. :
/pathA
/pathB

Now I want to create BookmarkablePageLinks with PageParameters and a specific path of the page, e.g.
/pathA/id where "id" is the page parameter.

The problems is that rendering url calls BookmarkablePageRequestTargetUrlCodingStrategy.matches
which only checks the Page class but not the mount path, so the
url is (in my case) /pathB/id which is wrong. So i tried to use the mount path as
first parameter and the id as second parameter but this generates:
/pathB/pathA/id

If call the page /pathA/id directly in the browser everthing is okay as the method
IRequestTargetUrlCodingStrategy.urlCodingStrategyForPath(String path)
takes care of the mount path.

So what can I do the specify the mount path + PageParameters in the BookmarkablePageLink?

Extend BookmarkablePageLink and overide onComponentTag ?

Thanks,
Oliver



Re: Hot to use BookmarkablePageLinks with a page mounted at several pathes?

by jthomerson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You might need to create your own url coding strategy that answers for
all the mount paths for that page.  The built-in one is only for a
single page at a single path.

Why do you have a single page on multiple paths?  Does the page
respond differently based on path?  Should the pages on different
paths be subclasses of the main page?  Or are you simply trying to
avoid an extra parameter?  What about mounting the page on "/path" and
then using an indexed parameter mount so that it is "/path/a/id"?

--
Jeremy Thomerson
http://www.wickettraining.com




On Mon, Jul 6, 2009 at 3:15 AM, Oliver Krohne<okrohne@...> wrote:

> Hi,
>
> I have one page which is mounted at several pathes with IndexParamUrlCodingStrategy e.g. :
> /pathA
> /pathB
>
> Now I want to create BookmarkablePageLinks with PageParameters and a specific path of the page, e.g.
> /pathA/id where "id" is the page parameter.
>
> The problems is that rendering url calls BookmarkablePageRequestTargetUrlCodingStrategy.matches
> which only checks the Page class but not the mount path, so the
> url is (in my case) /pathB/id which is wrong. So i tried to use the mount path as
> first parameter and the id as second parameter but this generates:
> /pathB/pathA/id
>
> If call the page /pathA/id directly in the browser everthing is okay as the method
> IRequestTargetUrlCodingStrategy.urlCodingStrategyForPath(String path)
> takes care of the mount path.
>
> So what can I do the specify the mount path + PageParameters in the BookmarkablePageLink?
>
> Extend BookmarkablePageLink and overide onComponentTag ?
>
> Thanks,
> Oliver
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Hot to use BookmarkablePageLinks with a page mounted at several pathes?

by okrohne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I mount the pages for all categories and subcategories starting at the
root path of my application.
/entertainment/movies
/entertainment/books and so on.

If I would mount the page e.g. at /categories then I would have url like
/categories/entertainment/movie which are not so nice.

In general the problem only exists because I have extended the PagingNavigator to have a stateless PagingNavigator and need to override these functions :
protected Link<?> newPagingNavigationIncrementLink
protected Link<?> newPagingNavigationLink
and they must return an instance of type Link so I can not simply return an
ExternalLink.

I solved the problem by overiding the getURL function of BookmarkablePageLink
to generate links like /entertainment/movie/1 /entertainment/movie/2
where the paramter "1" and "2" are used for a stateless navigator.

If I have more time then I will clean up and write sligthly modified IndexedParamCodingStrategy.

Thanks,
Oliver

jthomerson wrote:
You might need to create your own url coding strategy that answers for
all the mount paths for that page.  The built-in one is only for a
single page at a single path.

Why do you have a single page on multiple paths?  Does the page
respond differently based on path?  Should the pages on different
paths be subclasses of the main page?  Or are you simply trying to
avoid an extra parameter?  What about mounting the page on "/path" and
then using an indexed parameter mount so that it is "/path/a/id"?

--
Jeremy Thomerson
http://www.wickettraining.com




On Mon, Jul 6, 2009 at 3:15 AM, Oliver Krohne<okrohne@yahoo.de> wrote:
> Hi,
>
> I have one page which is mounted at several pathes with IndexParamUrlCodingStrategy e.g. :
> /pathA
> /pathB
>
> Now I want to create BookmarkablePageLinks with PageParameters and a specific path of the page, e.g.
> /pathA/id where "id" is the page parameter.
>
> The problems is that rendering url calls BookmarkablePageRequestTargetUrlCodingStrategy.matches
> which only checks the Page class but not the mount path, so the
> url is (in my case) /pathB/id which is wrong. So i tried to use the mount path as
> first parameter and the id as second parameter but this generates:
> /pathB/pathA/id
>
> If call the page /pathA/id directly in the browser everthing is okay as the method
> IRequestTargetUrlCodingStrategy.urlCodingStrategyForPath(String path)
> takes care of the mount path.
>
> So what can I do the specify the mount path + PageParameters in the BookmarkablePageLink?
>
> Extend BookmarkablePageLink and overide onComponentTag ?
>
> Thanks,
> Oliver
>
>
>

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

Wicket NetBeans Users please vote for these Issues

by Bernard-31 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Deploy on Save reportedly does not work for HTML files
http://www.netbeans.org/issues/showvotes.cgi?issue_id=153773


Unnecessary redeploys by "deploy on save"
http://www.netbeans.org/issues/showvotes.cgi?issue_id=152222


Thanks

Bernard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Wicket NetBeans Users please vote for these Issues

by Bergmann Manfred-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Done.

Btw: the Wicket plugin is not available in the plugin manager of  
NetBeans 6.7.
How can I install it?


Manfred


Am 07.07.2009 um 11:43 schrieb Bernard@...:

> Deploy on Save reportedly does not work for HTML files
> http://www.netbeans.org/issues/showvotes.cgi?issue_id=153773
>
>
> Unnecessary redeploys by "deploy on save"
> http://www.netbeans.org/issues/showvotes.cgi?issue_id=152222
>
>
> Thanks
>
> Bernard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>

--
software by MABE
http://www.software-by-mabe.com




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Wicket NetBeans Users please vote for these Issues

by Bernard-31 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Please vote for:

Source root's non-class files not included on Auto deploy
http://www.netbeans.org/issues/show_bug.cgi?id=145666


Unnecessary redeploys by "deploy on save"
http://www.netbeans.org/issues/showvotes.cgi?issue_id=152222


The Wicket plugin can be found here
http://plugins.netbeans.org/PluginPortal/faces/PluginListPage.jsp?search=wicket


Thanks

Bernard


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...