on 08-02-2009 8:53 AM
Hi all,
I am using Adobe IF in order to send data via mail (the data is in XML form).
Now I need to read the XML file form the mail and copy it to the context.
I have managed to read the data from the mail attachment, but I can't transfer the data to my context.
Aviad
Hi Aviad
I suppose that you have the data as java.io.InputStream. Then create new attribute in the context and set attribute type as "java.io.InputStream". Then set the attribute value as usual.
If you want you can convert InputStream to String and store the in a simple String attribute in the context.
BR, Sergei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What exactly is the problem?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here i am giving code for how to get the data from XML file available in server.
public void getmailAddr(){
String spath="Path\\xml name.xml";
try {
DocumentBuilderFactory documentFactory=DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder=documentFactory.newDocumentBuilder();
//wdComponentAPI.getMessageManager().reportSuccess("Before File(spath)");
Document doc=documentBuilder.parse(new File(spath));
//wdComponentAPI.getMessageManager().reportSuccess("After File(spath)");
doc.getDocumentElement().normalize();
org.w3c.dom.NodeList listOfObjects=doc.getElementsByTagName("Service");
Node ColoumnNode = listOfObjects.item(0);
for (int i = 0; i < ColoumnNode.getChildNodes().getLength();i++){
Node node = ColoumnNode.getChildNodes().item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
String nodevalue=node.getChildNodes().item(0).getNodeValue();
String bol=listOfObjects.item(0).getAttributes().getNamedItem("PropertiesModified").getNodeValue();
//wdComponentAPI.getMessageManager().reportSuccess("bol:"+bol);
if(node.getAttributes().item(0).getNodeValue().equals("to")){
mail=node.getChildNodes().item(0).getNodeValue();
//wdComponentAPI.getMessageManager().reportSuccess("ColoumnNode.getChildNodes().getLength():"+ColoumnNode.getChildNodes().getLength());
}
if(node.getAttributes().item(0).getNodeValue().equals("cc")){
mail2=node.getChildNodes().item(0).getNodeValue();
//wdComponentAPI.getMessageManager().reportSuccess("mail address:"+mail);
}
}
}
Regards,
surya.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.