Orbeon Forms: Add Link to EMAIL

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Orbeon Forms: Add Link to EMAIL

Venur
I've got pretty much the same question as in this post

http://stackoverflow.com/questions/19431203/orbeon-workflow-send-button-how-to-add-a-form-url-in-the-email-body

But I don't understand where I have to insert the code from the above post. Do I have to create a new email processor or how does this work in detail?

Thanks a lot for an answer.

Reply | Threaded
Open this post in threaded view
|

Re: Orbeon Forms: Add Link to EMAIL

Erik Bruchez
Administrator
Venur,

It looks like we didn't see this message. The idea is to modify the code of Orbeon Forms. Patching resources can be done by placing files under the WAR file's WEB-INF/resources/ directory. And yes the idea is to make changes to the pipeline which sends the emails, which currently is an XPL file. It is a developer-oriented task.

-Erik
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon Forms: Add Link to EMAIL

Venur
Hello Mr. Bruchez

I placed the email-form.xpl under "C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\orbeon\WEB-INF\resources" and added the following xml-Code in the section Email body.


<part name="text" content-type="text/plain">
     <xsl:value-of select="pipeline:rewriteServiceURI(concat('/fr/',$app,'/',$form, '/edit/',$doc), true())"/>
</part>

But if I send the Form to a recipient over the EMail button the URL isnt added to the body content of the email. I guess the variables $app, $form and $doc are defined or do I have to define them by my own?
The actual goal is that a member can fill out the form, then press the email button so that the supervisor, gets an email with the link to the filled form. There he can make some modifications and sends it then back to the member. Are there any other ways to realise this kind of workflow?

Greetz and Thanks for answering
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon Forms: Add Link to EMAIL

Erik Bruchez
Administrator
I see in the standard email-form.xpl that there is no $doc variable in that XSLT. Add one, e.g:

    <xsl:variable name="document" select="doc('input:parameters')/*/document" as="xs:string"/>

and then:

    concat('/fr/', $app,'/', $form, '/edit/', $document)

should work.

You can also use <xsl:message> to output debug information in XSLT. E.g.:

    <xsl:message>
        xxx <xsl:copy-of select="concat('/fr/', $app,'/', $form, '/edit/', $document)"/>
    </xsl:message>
   
The message will appear in orbeon.log.

-Erik