Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
7 replies Latest Post - ‏2012-12-24T01:37:23Z by HermannSW
SystemAdmin
SystemAdmin
6772 Posts
ACCEPTED ANSWER

Pinned topic Can DP use something like a Java class for transforms?

‏2012-12-21T17:29:03Z |
We are doing binary transforms, and I'm officially declaring WTX the transformation enemy of the universe. What we can do in Java in about 10 minutes is taking days to figure out in WTX, and we still haven't succeeded.

The truth is, we aren't really doing a "binary" transform. We are handling HL7 files, which are ASCII text.

Since DP is running Java internally, is it possible to tell DP to use some kind of Java class to handle binary transforms?

I mean, it would make DP infinitely more powerful, and if they enabled such a thing via a strict interface running inside a simple sandbox with a strict security manager, wouldn't everyone's life be so much better?
Updated on 2012-12-24T01:37:23Z at 2012-12-24T01:37:23Z by HermannSW
  • HermannSW
    HermannSW
    4491 Posts
    ACCEPTED ANSWER

    Re: Can DP use something like a Java class for transforms?

    ‏2012-12-21T19:52:37Z  in response to SystemAdmin
    > Since DP is running Java internally, is it possible to tell DP to use some kind of Java class to handle binary transforms?
    >
    That is definitely not true.

    > The truth is, we aren't really doing a "binary" transform. We are handling HL7 files, which are ASCII text.
    >
    You can use below stylesheet in a "Transform Binary Action" to process any Non-XML input "UTF-8 string" (includes ASCII):
    
    $ echo -n 
    "test123" | coproc2 to-utf8.xsl -  http:
    //dp5-l3:2224 -s ; echo <read>test123</read> $ $ cat to-utf8.xsl <xsl:stylesheet version=
    "1.0" xmlns:xsl=
    "http://www.w3.org/1999/XSL/Transform" xmlns:dp=
    "http://www.datapower.com/extensions" extension-element-prefixes=
    "dp" > <dp:input-mapping  href=
    "store:///pkcs7-convert-input.ffd" type=
    "ffd"/>   <xsl:output omit-xml-declaration=
    "yes" /> <xsl:template match=
    "/"> <xsl:variable name=
    "input64" select=
    "dp:binary-encode(/object/message/node())" /> <!-- 
    
    this does UTF-8 validation and decoding --> <xsl:variable name=
    "str" select=
    "dp:decode($input64, 'base-64')"/>   <read> <xsl:value-of select=
    "$str"/> </read> </xsl:template> </xsl:stylesheet> $
    


     
    Hermann<myXsltBlog/> <myXsltTweets/>
    • SystemAdmin
      SystemAdmin
      6772 Posts
      ACCEPTED ANSWER

      Re: Can DP use something like a Java class for transforms?

      ‏2012-12-21T19:57:34Z  in response to HermannSW
      So, when my device has "Java API for XML processing support", does this mean it isn't using Java?
      • kenhygh
        kenhygh
        1461 Posts
        ACCEPTED ANSWER

        Re: Can DP use something like a Java class for transforms?

        ‏2012-12-21T22:05:09Z  in response to SystemAdmin
        yup. It may be using the wire format for that API, but there really really is no Java.

        Ken
        • SystemAdmin
          SystemAdmin
          6772 Posts
          ACCEPTED ANSWER

          Re: Can DP use something like a Java class for transforms?

          ‏2012-12-21T23:03:48Z  in response to kenhygh
          So... how hard would it be? In the same way they did the CLI for DataPower, why can't IBM create a very restricted JVM with a very strong Security Manager and a very small subset of RT Java and a set of very strict interfaces for transforms? I spent 3 days trying to figure out a single very simple example in WTX what I and every other Java programmer could pull off in about 5 minutes with Java (and that includes loading Eclipse).

          When we start talking about TCO...it takes only a few moments to figure out the cost of WTX, WTX Training, a WTX resource, etc., compared to a Java one. I think Intel's SOA Gateway supports Java, and it seems like such a natural fit for the environment.

          On the downside, though, I assume if they started supporting Java, they'd be flooded with requests for C/C++/PERL, etc.... but.. I'd take a scripting language over WTX any day!

          Anyway.... guess I can dream...
  • kenhygh
    kenhygh
    1461 Posts
    ACCEPTED ANSWER

    Re: Can DP use something like a Java class for transforms?

    ‏2012-12-21T19:54:00Z  in response to SystemAdmin
    Uh, DataPower is definitely NOT running Java internally. So no way to execute a Java class.

    The learning curve on WTX is pretty steep, though.

    Ken