Hi!
I write the own processor For test i'm used java code from tutorial: public class ValidationProcessor extends SimpleProcessor { public ValidationProcessor() { addOutputInfo(new ProcessorInputOutputInfo("status")); } public void generateData(PipelineContext context, ContentHandler contentHandler) throws Exception { String status = "VALIDATION ERROR"; String message = "Validation bad-bad"; contentHandler.startDocument(); contentHandler.startElement("", "status", "status", new AttributesImpl()); contentHandler.characters(status.toCharArray(), 0, status.length()); contentHandler.endElement("", "status", "status"); contentHandler.endDocument(); } } It returns some xml file. Code of form: <submission id="validate_client_config" method="post" resource="validate_client_config" replace="instance" instance="validation_result" ref="instance('client_config')" relevant="false" > <action ev:event="xforms-submit"> <delete nodeset="instance('client_config')/configuration"/> <insert context="instance('client_config')" origin="instance('configuration')" /> </action> <action ev:event="xforms-submit-done"> <message ev:event="xforms-submit-done" level="modal"> <output ref="instance('validation_result')/status" /> </message> </action> <action ev:event="xforms-submit-error"> <setvalue ref="instance('variables')/lastOperationStatus" value="'error'" /> <message ev:event="xforms-submit-error" level="modal">Some error</message> </action> </submission> But in value of "output" element instance('validation_result')/status" is empty, what i do wrong? |
Hi Alexandr,
Do you have debug attributes or pipeline debugging enabled? That is, what XML does this return? (Could it be picking up a namespace?)
Thanks, Hank On Tuesday, July 16, 2013, Alexandr.Slabukh wrote: Hi! -- Hank Ratzesberger XMLWerks.com -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Hi, Hank
I was wrong contentHandler does not contain anything And I do not understand - why? validate_config.xpl: <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors"> <p:param name="instance" type="input"/> <p:param name="data" type="output"/> <p:processor name="oxf:xslt"> <p:input name="data" href="#instance"/> <p:input name="config"> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()" /> </xsl:copy> </xsl:template> <xsl:template match="configuration" /> </xsl:stylesheet> </p:input> <p:output name="data" id="client_configuration"/> </p:processor> <p:processor name="oxf:xml-converter"> <p:input name="config"> <config> <encoding>utf-8</encoding> </config> </p:input> <p:input name="data" href="#client_configuration"/> <p:output name="data" id="xml_client_configuration"/> </p:processor> <p:processor name="ValidationProcessor"> <p:input name="config"> <config sourcepath="." class="ValidationProcessor"/> </p:input> <p:input name="data" href="#xml_client_configuration" /> <p:output name="data" ref="data"/> </p:processor> </p:config> |
Hi Alexandr,
-- It looks like it should work or produce some output. Are there any errors reported in the logs?
When you add a debug attribute, is it clear that the processing goes through the converter step? <p:output name="data" id="xml_client_configuration" debug="client_config"/> Also, is it necessary to convert your xml document? It's been a while since I wrote a processor... It may be necessary to consume the input, which yours does not do because its just a sample output only processor. Regards,
Hank On Monday, July 22, 2013, Alexandr.Slabukh wrote: Hi, Hank You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
In reply to this post by Alexandr.Slabukh
Hi Alexandr,
In addition to what Hank mentioned, did you hook up the XPL to a page-flow.xml? Also, if you feel stuck, you can try to put all those files in a directory, say under apps, maybe you can create a zip of the files, and attach them to a response, so we can try this here? Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Thanks guys,
I had the wrong name of the instance in the representation |
Free forum by Nabble | Edit this page |