on 2007 Jul 19 11:44 AM
Hi All,
Can anyone send sample programs in XI.
jsp-> controller-> database
how much scope of the java we are going to use in XI.
Thank you
with best regards
Jeevan Roy
java is extensively used in XI .... for
1 .creating mapping program ( SAX and DOM Parser are used).
2. Creating user defined function in mapping.
3. for creating custom logging framework in XI.
4. for creating adapter modules.
5. for creating lookup programs in mapping..
Ranjeet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks alot Ranjeet.
3. for creating custom logging framework in XI.
(Can you explain what is logging framework in xi. which like a struts framework.)
4. for creating adapter modules.
(how can we create adapter modules. can you explain in java terminalogy)
5. for creating lookup programs in mapping..
(is it like a search mechanism in java )
<b>4. for creating adapter modules.<b>
when u want some opertation to be performed at adapter level u create module and export at the CC level.
<b>5. for creating lookup programs in mapping..
(is it like a search mechanism in java )</b>
u have material number and plant and based on this u need to map the description field in the target. here u wud gofor lookup which are of database lookup and rfc lookup. here u would make a call to the DB and get the description and pass the value to the target fields. this opertaion is carried in the user defined function in MM
a sample program for adapter module: this has the main process function...
-
public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
throws ModuleException
{
Object obj = null; // Handler to get Principle data
Message msg = null; // Handler to get Message object
try
{
obj = inputModuleData.getPrincipalData();
msg = (Message)obj;
try
{
XMLPayload xmlpayload = msg.getDocument();
String messageStr = xmlpayload.getText();
String inputStr = null;
String tags[] = new String[2];
String values[] = new String[2];
String tagvalue1 = messageStr.substring(messageStr.indexOf("BEGIN+"), messageStr.indexOf("'");
String tagvalue2 = messageStr.substring(messageStr.indexOf("'"), messageStr.lastindexOf("ENDING");
tags[0] = "tag1";
tags[1] = "tag2";
values[0] = tagvalue1 ;
values[1] = tagvalue2 ;
Document xmldoc = null;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
DOMImplementation impl = builder.getDOMImplementation();
org.w3c.dom.Element e = null;
Node n = null;
xmldoc = impl.createDocument(null, "MT940", null);
org.w3c.dom.Element root = xmldoc.getDocumentElement();
for(int i = 0; i < tags.length; i++)
{
e = xmldoc.createElementNS(null, tags);
n = xmldoc.createTextNode(values);
e.appendChild(n);
root.appendChild(e);
}
DOMSource domSource = new DOMSource(xmldoc);
ByteArrayOutputStream myBytes = new ByteArrayOutputStream();
Result dest = new StreamResult(myBytes);
TransformerFactory tf = TransformerFactory.newInstance();
Transformer serializer = tf.newTransformer();
serializer.setOutputProperty("indent", "yes");
serializer.transform(domSource, dest);
byte[] docContent = myBytes.toByteArray();
if (docContent != null) {
xmlpayload.setContent(docContent);
inputModuleData.setPrincipalData(msg);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"sample: Inside sample Module---after setting principal data");
}
}
}
catch(ArrayIndexOutOfBoundsException e)
{
e.printStackTrace();
}
catch(StringIndexOutOfBoundsException e)
{
e.printStackTrace();
}
catch(TransformerException e)
{
e.printStackTrace();
}
catch(Exception e)
{
e.printStackTrace();
}
}
catch(Exception e)
{
ModuleException me = new ModuleException(e);
throw me;
}
return inputModuleData;
}
-
for creating adapter module refer to
<b>how much scope of the java we are going to use in XI.</b>
depends. u use java for UDF and if req u can use it for creating mapping program which is then imported to IR and used in IM. Creation of mapping program also has alternative to be done in abap and xslt. and also used in modules and creation of customized adapters
Message was edited by:
Prabhu S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.