This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Httpconnection connection = null; | |
BufferedReader reader = null; | |
String forecastJsonStr = null; | |
try { | |
URL url = new URL("http://api.openweathermap.org/data/2.5/forecast/daily?q=94043&mode=json&units=metric&cnt=7"); | |
connection = (Httpconnection) url.openConnection(); | |
connection.setRequestMethod("GET"); | |
connection.connect(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Name: ProCon Invoice Mapping | |
Author: Chris Mills | |
Details: Mapping implemented as an XSL as single SAP Invoice message needs to be split to mutliple ProCon messages, 1 per PO | |
and financials calculated by unique PO. i.e. if invoice has 3 line items which relate to two PO's then need to split to | |
two output messages and calculate the tax and net amounts by PO, recursion much easier in XSL | |
NOTE: This will only send items from the invoice that relate to a contract, the business rules are meant to be no multi-contract | |
invoices and no mix of 1 item against a contract and another not but if it happens ProCon will only see parts of the invoice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String getRFCLookupUDF(Container container) throws StreamTransformationException{ | |
GlobalContainer globalContainer; | |
MappingTrace trace; | |
java.util.Map map; | |
trace = container.getTrace(); | |
globalContainer = container.getGlobalContainer(); | |
map = globalContainer.getTransformationParameters(); | |
SystemAccessor rfcAccessor = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String getDBLookupUDF(Container container) throws StreamTransformationException{ | |
GlobalContainer globalContainer; | |
MappingTrace trace; | |
java.util.Map map; | |
trace = container.getTrace(); | |
globalContainer = container.getGlobalContainer(); | |
map = globalContainer.getTransformationParameters(); | |
//Variables Used |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//import com.seeburger.functions.permstore.*; | |
public String getSeeburgerCounter(String counterName, Container container) throws StreamTransformationException{ | |
String counterValue = ""; | |
try { | |
CounterBean be = CounterFactory.getCounterInstance(); | |
counterValue = be.nextCounter( counterName ); | |
} catch (Exception e) { | |
throw new RuntimeException(e.getMessage()); | |
} | |
return counterValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String setSeeburgerVariable(String variableName, String variableValue, Container container) throws StreamTransformationException{ | |
try | |
{ | |
VariableBean be=VariableFactory.getVariableInstance(""); | |
be.setStringVariable(variableName, variableValue); | |
}catch (Exception e){ | |
throw new RuntimeException(e); | |
} | |
return ""; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String getSeeburgerVariable(String variableName, Container container) throws StreamTransformationException{ | |
AbstractTrace trace; | |
trace = container.getTrace(); | |
String variableValue = ""; | |
try | |
{ | |
VariableBean be=VariableFactory.getVariableInstance(""); | |
variableValue = be.getStringVariable(variableName); | |
if ( variableValue!= null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String getStreamTransformationConstant(Container container) throws StreamTransformationException{ | |
GlobalContainer globalContainer; | |
MappingTrace trace; | |
String headerField; | |
java.util.Map map; | |
trace = container.getTrace(); | |
globalContainer = container.getGlobalContainer(); | |
map = globalContainer.getTransformationParameters(); | |
headerField = (String) map.get( StreamTransformationConstants.INTERFACE_NAMESPACE ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void splitValue(String FieldValue, String SplitterChar, ResultList result, Container container) throws StreamTransformationException{ | |
try{ | |
//Split the string value based on the splitterchar | |
String [ ] strArray = FieldValue.split(SplitterChar); | |
int istrArray = strArray.length; | |
for (int i=0; i < istrArray; i++){ | |
result.addValue(strArray[i]); | |
} | |
}catch(Exception ee){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String getInstanceUDF(Container container) throws StreamTransformationException{ | |
GlobalContainer globalContainer; | |
MappingTrace trace; | |
String headerField; | |
java.util.Map map; | |
trace = container.getTrace(); | |
globalContainer = container.getGlobalContainer(); | |
map = globalContainer.getTransformationParameters(); | |
headerField = (String) map.get( StreamTransformationConstants.INTERFACE_NAMESPACE ); |
OlderNewer