1. Edit the cocoon.xconf as below,
Add <tab label="Contact" name="contact" usecase=" contactform.sendMessage"/> to <gui-manager> <tab-group name="admin"> tag
Then, insert
<component-instance name="contactform.sendMessage" logger="lenya.usecase"
class="org.apache.lenya.cms.contactform.ContactForm">
<view template="modules/administration/usecases/contactForm.jx" menu="true">
<tab group="admin" name="contact"/>
</view>
<exit usecase="contactform.sendMessage"/>
</component-instance>
2. Adjust the file named usecase-contactForm.xconf in lenya/pubs/default/config/cocoon-xconf
<xconf xpath="/cocoon/gui-manager/[EMAIL PROTECTED] = 'admin']"
unless="/cocoon/gui-manager/[EMAIL PROTECTED] = 'admin']/[EMAIL PROTECTED]'contact']">
<tab name="contact" label="Contact" usecase" contactform.sendMessage"/>
</xconf>
3. Move the file named contactForm.jx to lenya/modules/administration, and the content inside as below
<page:page
xmlns:jx=" http://apache.org/cocoon/templates/jx/1.0"
xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
xmlns=" http://www.w3.org/1999/xhtml"
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
>
<page:body>
<jx:import uri="fallback://lenya/usecases/templates/tabs.jx"/>
<div id="contentblock1" class="lenya-tab">
<form id="form-contact">
<input type="hidden" name="lenya.continuation" value="${ continuation.id}"/>
<input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/>
<table style="font-size: small">
<tr>
<td colspan="2">
<jx:import uri="fallback://lenya/usecases/templates/messages.jx"/>
</td>
</tr>
<tr>
<td><label for="" Name</i18n:text> *</label></td>
<td><input type="text" name="name" value="${usecase.getParameter('name')}"/></td>
</tr>
<tr>
<td><label for="" E-Mail Address</i18n:text> *</label></td>
<td><input type="text" name="email" value="${usecase.getParameter('email')}"/></td>
</tr>
<tr>
<td><label for="" Message</i18n:text> *</label></td>
<td><textarea name="message"><jx:out value="${usecase.getParameter('message')}"/></textarea></td>
</tr>
<tr>
<td/>
<td>
<input i18n:attr="value" name="submit" type="submit" value="Submit"/>
</td>
</tr>
</table>
</form>
</div>
</page:body>
</page:page>
Finally, when I compiled and deployed my Lenya project, I saw contact menu on admin page. However, I still got the same result that there is no menu tab and menu bar after clicking on contact menu. Did I miss any importent step? Any help would be appreciated.
Best regards,
Suriya
2006/10/19, Paloma Gomez <[EMAIL PROTECTED]>:
Hi Suriya,2006/10/19, Suriya Simsuwat < [EMAIL PROTECTED]>:Thank you Paloma. Now I have another doubt that if I want to present the form in area of Lenya content area with the Lenya menu tab and bar. How to do that? Now I have changed the jx file as below, but there is still no menu tab and bar. Thank you for any help in advance.
Regards,
Suriya
The documentation on the usecase framework explains how to do it (See the section Displaying Usecases in Tabs). You may want to have a look at the usecases that implement the admin area, which are displayed in tabs. They are placed in src/modules-core/administration.
HTH,
Paloma
