public class Utils
extends java.lang.Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
doubleToString(double number)
transform a double value in the format "##########0.000"
SAP assumes double value in this format |
static java.lang.String |
generateHTML(java.lang.String data,
OutboundSection outboundSection,
boolean autoSubmit,
boolean useHtml)
Generates a html page (contains the formular with the xml data (encoded as Base64) or html data) which submit
itself per JavaScript to the HOOK_URL
|
static java.lang.String |
generateHtmlData(SAPProductList sapproductlist,
OutboundSection outboundSection)
Transform the given SAPProductList into OCI specific html format.
|
static java.lang.String |
generateHtmlData(SAPProduct sapproduct,
OutboundSection outboundSection)
Transform a given SAPProduct into OCI specific html format.
|
static java.lang.String |
generateXMLData(SAPProductList sapproductlist,
OutboundSection outboundSection)
Transform the given SAPProductList into OCI specific xml format.
|
static java.lang.String |
generateXMLData(SAPProduct sapproduct,
OutboundSection outboundSection)
Transform the given SAPProduct into OCI conform xml data
|
static double |
getProductPrice(Product product,
double quantity)
Returns price of the given product.
|
static boolean |
isEmpty(java.lang.String string)
returns
true if a String is null or empty. |
public static java.lang.String generateHTML(java.lang.String data,
OutboundSection outboundSection,
boolean autoSubmit,
boolean useHtml)
throws OciException
data - a SAPProduct or SAPProductList as plain xml or html code in OCI conform tagsoutboundSection - contains the sended Parameter from the SRM ServerautoSubmit - if set to false the formular will not be send automatically to the HOOK_URL (no
JavaScript will be written to the output).useHtml - OciException - if something oci related failiure is happeningpublic static java.lang.String generateXMLData(SAPProduct sapproduct, OutboundSection outboundSection) throws OciException
sapproduct - the product to transform intooutboundSection - get the OCI Version from thisOciException - if a problem occurespublic static java.lang.String generateXMLData(SAPProductList sapproductlist, OutboundSection outboundSection) throws OciException
sapproductlist - the product listoutboundSection - needed for detecting OCI versionOciException - by problemspublic static boolean isEmpty(java.lang.String string)
true if a String is null or empty. Spaces are trimed out.string - the Stringpublic static java.lang.String generateHtmlData(SAPProductList sapproductlist, OutboundSection outboundSection) throws OciException
sapproductlist - the list with productsoutboundSection - needed for detecting OCI versionOciException - by problemspublic static java.lang.String generateHtmlData(SAPProduct sapproduct, OutboundSection outboundSection) throws OciException
sapproduct - the productoutboundSection - needed for detecting OCI versionOciException - by problemspublic static double getProductPrice(Product product, double quantity)
0.0 will be
returned.product - quantity - public static java.lang.String doubleToString(double number)
number - the double value to transformCopyright © 2018 SAP SE. All Rights Reserved.