IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.web2.transformation
Class Web2ServiceUtil

java.lang.Object
  extended by com.ibm.btt.web2.transformation.Web2ServiceUtil

public class Web2ServiceUtil
extends java.lang.Object


Nested Class Summary
(package private) static class Web2ServiceUtil.SingletonHolder
           
 
Method Summary
static Web2ServiceUtil getInstance()
           
 java.lang.String json2Xml4Service(java.lang.String jsonStr, java.lang.String serviceContent)
          merge the increasement widget's with service template file to form a new new increased xml string. the reverse operation is getDeltaJson().
 java.lang.String xml2Json4Service(java.lang.String xmlStr, java.lang.String serviceContent)
          Divide the increasedXml string by the service template file and then transfer the delta info into json format. the reverse operation is getIncreasedXml().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Web2ServiceUtil getInstance()
Returns:
singleton instance static Web2ServiceUtil

json2Xml4Service

public java.lang.String json2Xml4Service(java.lang.String jsonStr,
                                         java.lang.String serviceContent)
                                  throws java.lang.Exception
merge the increasement widget's with service template file to form a new new increased xml string. the reverse operation is getDeltaJson().

Parameters:
jsonStr - json array string with increasement info this json arrys is composed with a list of json object as this: {"ri":"xxx","ws":[{},{}]} 1. the first object is the {"ri":"xxx"} 2. the scecond object is a widgets array
serviceContent - template service list structure, it have defined all services to be used. 1. each service is identified by the unique id. 2. Services are grouped with different service catagories. 3. A service can have one or more widgets 4. A widget has its own attributes or attribute children(with just name, value property) 5. A widget can own one or more children widgets 6. A widget can be find by the service if and index id(which is the widget index under the service,default is 0) 7. A widget's children attribute and properties can be added by user and should be merged into the increment xml file.
Returns:
String the whole info of json defined widget into xml string
Throws:
java.lang.Exception - throws exception if the xml parse error or json parse error

xml2Json4Service

public java.lang.String xml2Json4Service(java.lang.String xmlStr,
                                         java.lang.String serviceContent)
                                  throws java.lang.Exception
Divide the increasedXml string by the service template file and then transfer the delta info into json format. the reverse operation is getIncreasedXml().

Parameters:
xmlStr - the increased xml file
serviceContent - template service list structure, it have defined all services to be used. 1. each service is identified by the unique id. 2. Services are grouped with different service catagories. 3. A service can have one or more widgets 4. A widget has its own attributes or attribute children(with just name, value property) 5. A widget can own one or more children widgets 6. A widget can be find by the service if and index id(which is the widget index under the service,default is 0) 7. A widget's children attribute and properties can be added by user and should be merged into the increment xml file.
Returns:
String json for the modified parts
Throws:
java.lang.Exception - throws exception if the xml parse error or json parse error

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011