On 5/4/06, Andrew Golightly <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] wrote:
> On 5/3/06, Andrew Golightly <[EMAIL PROTECTED]> wrote:
>> Unfortunately I couldn't get it to work.
>> Firstly, I am using lenya 1.4. I need to use this version for various
>> reasons.
>> Basically, after following the steps, and appending
>> ?lenya.usecase=contact to any url, i get a 404 page.
>
> The code is there; you just need to figure how to call it.
>
> Did you move "usecase-contact.xmap" to the pub directory?  With
> Lenya1.2, that file is the hook into the Usecase framework.  I cannot
> tell from the documentation if Lenya1.4 Usecases are
> backwards-compatible with Lenya1.2 Usecases :
>   http://lenya.apache.org/1_4/reference/usecase-framework/index.html
> It seems you may need additional configuration to make it work.

Thanks for the info. It looks like I've got it calling it, as my
terminal is printing out: "### CONTACT US ###". So code.js is definitely
being called.

I tried this suggestion:
------
5. Depending on how this module is called, the following change to
"template.xml" may be necessary.
CHANGE:
<ft:form-template action="#{$continuation/id}.more" method="POST">
TO:
<ft:form-template
action="#{$continuation/id}.more?lenya.usecase=contact" method="POST">
--------
But that, unfortunately, made no difference.

So to summarise my current error: If I add the suffix
"?lenya.usecase=contact" to page resources.html (a page that normally
works fine), I'll get the error:
"The requested document '/resources.html' with document-id '/resources'
does not exist."

Sequence of events:
1. Enter URL with "?lenya.usecase=contact".
2. The 1.2 Usecase Framework passes control to "usecase-contact.xmap"
3. usecase-contact.xmap's default pipeline passes control to
"modules/contact/module.xmap"
4.  module.xmap's default pipeline calls function "contact()" in "code.js"
5. contact() prints "### CONTACT US ###"
6. contact() passes control to "contact-display" pipeline in module.xmap.
7. "contact-display" pipeline should send the web form.  Instead it
sends error "The requested document '/resources.html' with document-id
'/resources' does not exist."

If it had not errored, the visitor sees the form, and would submit it
to the ft:form-template action, which must send the continuation back
to the module.xmap.  You are not reaching that point.

So the current error is from the "contact-display" pipeline in "module.xmap":
     <map:match pattern="contact-display">
       <map:aggregate element="cmsbody">
          <map:part
src="cocoon://{page-envelope:publication-id}/navigation/breadcrumb/live/index.xml"/>
          <map:part
src="cocoon://{page-envelope:publication-id}/navigation/menu//index.xml"
prefix="xhtml"/>
          <map:part
src="cocoon://{page-envelope:publication-id}/navigation/search/index.xml"/>
          <map:part src="cocoon:/session-info"/>
          <map:part src="cocoon:/contact-form"/>
       </map:aggregate>
       <map:call resource="page-xhtml"/>
       <map:call resource="html-finish"/>
     </map:match>

The first 3 "part" are for hardcoded navigation elements, which should be fine.
The "session-info" part might be removed.  We use a customized
"login.xsp" to add user data to the XML, but you should not need that.
The "contact-form" part adds "template.xml" modified by resource "form-finish".
"form-finish" uses "formfixer.xsl" and
"../../resources/forms-samples-styling.xsl".

"../../resources/forms-samples-styling.xsl" becomes
{pub}/resources/forms-samples-styling.xsl.  If that file is missing,
you get the current error.

Then contact-display calls resource "page-xhtml", which uses
"../../xslt/page2xhtml.xsl".  "../../xslt/page2xhtml.xsl" becomes
{pub}/xslt/page2xhtml.xsl.  If that file is missing, you get the
current error.

Then contact-display calls resource "html-finish", which uses
"../../../../xslt/util/strip_namespaces.xsl". "../../../../xslt/util/strip_namespaces.xsl" becomes
"build/lenya/webapp/lenya/xslt/util/strip_namespaces.xsl".  If that
file is missing, you get the current error.

The error is probably caused by one of these files being missing:
  {pub}/resources/forms-samples-styling.xsl
  {pub}/xslt/page2xhtml.xsl
  build/lenya/webapp/lenya/xslt/util/strip_namespaces.xsl

My guess is the first one, as that is not a standard file in Lenya. It comes from the Cocoon "forms" block:
  cocoon-2.1.6-src\cocoon-2.1.6\src\blocks\forms\samples\resources
Copy that directory to your Lenya installation and adjust the path in
module.xmap.  The given "../../resources/forms-samples-styling.xsl"
was because we dumped that directory into {pub}/resources.  That is
slightly messy, so I recommend adding a subdirectory, copying (adjust
for your version of Cocoon):
  cocoon-2.1.6-src/cocoon-2.1.6/src/blocks/forms/samples/resources
to:
  {pub}/resources/forms
and adjusting module.xmap:
  ../../resources/forms-samples-styling.xsl
to:
  ../../resources/forms/forms-samples-styling.xsl

I hope that fixes it.  We improved the "forms" block slightly, but I
think that was for presentation rather than anything functional.  Let
me know if this fixes it so I can update the documentation.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to