[ 
https://issues.apache.org/jira/browse/WICKET-657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527681
 ] 

Ate Douma commented on WICKET-657:
----------------------------------

With the latest changes and additions to the wicket core, all Wicket Examples 
can be run as a portlet except for the frames and prototype example.
And several initial changes have even been reverted!
The most important (and mostly only) change to Wicket Examples is the required 
upgrade to Servlet api 2.4 to allow the WicketFilter to work on 
RequestDispatcher include as required for portlets.

Additionally, I've written a new example, WicketExamplesMenuApplication which 
is a portlet context only Wicket example.
It is served by WicketExamplesMenuPortlet which extends WicketPortlet to "wrap" 
the available (Wicket) portlets in the war with a front-end menu, just like the 
static index.html start page in a Servlet environment.

But this MenuPortlet is quite a bit more fancy :)
It dynamically determines the available portlets by parsing portlet.xml and 
build its menu from it and renders it through a Wicket MenuPage.
Furthermore, it has 2 other Wicket Pages: HeaderPage and EditPage.

When one of the menu items is selected, the MenuPortlet will first invoke the 
WicketExamplesMenuApplication to render the HeaderPage. This page provides a 
back link to the main MenuPage.
Then, the MenuPortlet invokes the selected Wicket Example and renders it within 
its own portlet window!
So, effectively, this gives the same appearance and behavior as what the normal 
Servlet based WicketExampleHeader does.
But, to prevent that header back link from rendering (which links to the static 
index.html) in a portlet context, I've modified WicketExampleHeader slightly to 
make that link invisible in that case.
When rendered as a normal Servlet example, the behavior hasn't changed.

Finally, the MenuPortlet also provides a PortletMode.EDIT page, EditPage, which 
can be invoked from the Portlet window action icons (most left icon in the top 
right corner).
When the EditPage is rendered, it allows the user to select the *default* 
example to be displayed in VIEW mode.
This is initially the MenuPage showing all available examples, but when one of 
the other examples is chosen, this will be *stored* as Portlet Preference (thus 
persisted for this user),
after which it will automatically switch back the VIEW mode and the selected 
example is displayed.
The next time you open the portal page (like after stopping the portal or 
logging out), you'll notice the selected example now is displayed by default.

> New Wicket Portlet support: adapting wicket-examples to use the new portlet 
> support so they can be run as portlets  
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-657
>                 URL: https://issues.apache.org/jira/browse/WICKET-657
>             Project: Wicket
>          Issue Type: Sub-task
>          Components: wicket-portlet
>    Affects Versions: 1.3.0-beta2
>            Reporter: Ate Douma
>            Assignee: Ate Douma
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to