I have created a document delivery form which is just a modification of the
feedback form. I updated the /ViewArtifacts/sitemap.xmap basically just by
copy/pasting where the instance of feedback form occurred. I would now like
to ask for help and suggestions if I made the correct modifications.

In sitemap.xmap, I add this code:
                    <map:match pattern="handle/*/*/DocumentDelivery">
                        <!-- Document delivery comes here -->
                            <map:act
type="SendDocumentDeliveryRequestAction">
                                <map:transform
type="DocumentDeliveryRequestForm">
                                    <map:parameter name="comments"
value="{comments}"/>
                                    <map:parameter name="email"
value="{email}"/>
                                    <map:parameter name="page"
value="{page}"/>
                                </map:transform>

                                <map:serialize type="xml"/>
                            </map:act>
                            <map:transform
type="DocumentDeliveryRequestSent"/>
                            <map:serialize type="xml"/>
                    </map:match>

In my DocumentDeliveryRequestForm.java, (a modification of
FeedbackForm.java), I have this code:

// Build the item viewer division.
        Division ill = body.addInteractiveDivision("ill-form",

request.getRequestURI()+"/DocumentDelivery",Division.METHOD_POST,"primary");

and in my theme's xsl, I created a link for this form:

                                <a>
                                    <xsl:attribute name="href">
                                        <xsl:value-of
select="confman:getProperty('dspace.baseUrl')"/>
                                        <xsl:text>/handle/10862</xsl:text>
                                        <xsl:value-of
select="substring-after($request-uri, '/10862')"/>

<xsl:text>/DocumentDelivery</xsl:text>
                                    </xsl:attribute>
                                    <xsl:text>Request this
document.</xsl:text>
                                </a>
Not very tidy but this is the only way I can think of on how to match that
with my code in DocumentDeliveryRequestForm.java
(request.getRequestURI()+"/DocumentDelivery"). Anyways, if I click on the
'Request this document' link, the form appeared. My problem now is that
after properly filling out the form and clicking the submit button, I
received the "org.apache.cocoon.ResourceNotFoundException: Page cannot be
found" error. The url upon submission have added the text
"/DocumentDelivery" at the end of the existing url (i.e.
http://localhost:8080/handle/123456789/123//DocumentDelivery became
http://localhost:8080/handle/123456789/123//DocumentDelivery/DocumentDeliveryafter
the submit button was pressed. I don't know if the error is caused by
a faulty sitemap.xmap or by the form. I have successfully implemented this
form a few days back but then I got 'ambitious' and decided to add the
item's title into the form. If I just retain the code from the feedbackform
which is (contextPath+"/DocumentDelivery ",Division.METHOD_POST,"primary"),
I have my document delivery form working without the requested item title
though:(. Any ideas? I have been working on this code for a few days now
with a lot of trial and error since my post a few days back asking if
anybody have actually created a feature like this. If somebody could advise
me if I'm on the right track.

Thanks in advance and regards,

-- 
Elvi
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to