View the source of this content.
Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:
Roses are red Violets are blue
| // import commons-fileupload-1.4.jar into your CPI resources | |
| import com.sap.gateway.ip.core.customdev.util.Message as CpiMsg | |
| import javax.activation.DataHandler | |
| import org.apache.commons.fileupload.MultipartStream | |
| import org.apache.commons.io.IOUtils | |
| import javax.mail.internet.* | |
| import java.util.zip.* |
| import com.sap.gateway.ip.core.customdev.util.Message; | |
| def Message setMPLCustomHeaderProperty(Message message) { | |
| def messageLog = messageLogFactory.getMessageLog(message); | |
| messageLog?.addCustomHeaderProperty("SalesOrder", "XXX10202910129XXX") | |
| return message | |
| } |
| /** | |
| * Some scriptApi | |
| * | |
| * @author Iliya Kuznetsov <iliya.kuznetsov@gmail.com> | |
| * @version 1.0.1 | |
| * @date 2018-01-31 | |
| * @see https://github.com/rsugio/cpi/tree/master/rsugio-cpi-003-scriptApi | |
| */ | |
| import com.sap.gateway.ip.core.customdev.util.Message as CpiMsg |
| import com.sap.gateway.ip.core.customdev.util.Message as CpiMsg | |
| import groovy.transform.TypeChecked | |
| import groovy.transform.TypeCheckingMode | |
| /** | |
| * When your IFlow gets running in CPI environment, you are in need of detecting some parameters. | |
| * Here below is the code for system environment reporting. | |
| * | |
| * @author Iliya Kuznetsov <iliya.kuznetsov@gmail.com> | |
| * @version 1.0.1 |
| import javax.xml.transform.TransformerFactory | |
| import javax.xml.transform.stream.StreamResult | |
| import javax.xml.transform.stream.StreamSource | |
| // Load xslt | |
| def xslt= new File("MyTrasform.xsl").getText() | |
| // Create transformer | |
| def transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(xslt))) |
| import java.io.UnsupportedEncodingException; | |
| public final class HexDumpUtil { | |
| public static String formatHexDump(byte[] array, int offset, int length) { | |
| final int width = 16; | |
| StringBuilder builder = new StringBuilder(); | |
| for (int rowOffset = offset; rowOffset < offset + length; rowOffset += width) { | |
| builder.append(String.format("%06d: ", rowOffset)); |
View the source of this content.
Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:
Roses are red Violets are blue