Show instance result modal windows

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

Show instance result modal windows

Alexandr.Slabukh
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?







Reply | Threaded
Open this post in threaded view
|

Re: Show instance result modal windows

Hank Ratzesberger-3
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!

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?









--
View this message in context: http://discuss.orbeon.com/Show-instance-result-modal-windows-tp4657014.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.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 <a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;orbeon+unsubscribe@googlegroups.com&#39;)">orbeon+unsubscribe@....
To post to this group, send email to <a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;orbeon@googlegroups.com&#39;)">orbeon@....




--
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].
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Show instance result modal windows

Alexandr.Slabukh
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> 
Reply | Threaded
Open this post in threaded view
|

Re: Show instance result modal windows

Hank Ratzesberger-3
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

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>

--
View this message in context: http://discuss.orbeon.com/Show-instance-result-modal-windows-tp4657014p4657037.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.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].


--
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].
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Show instance result modal windows

Alessandro  Vernet
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
Reply | Threaded
Open this post in threaded view
|

Re: Show instance result modal windows

Alexandr.Slabukh
Thanks guys,

I had the wrong name of the instance in the representation