To write to a particular position in file
I have to write objects involved with the diagram in to a XML file.as new components are drawn in the diagram corresponding objects will get added to XML file.For the Object to xml conversion i am using Xstream API.
In have to insert this portion
*<Rstmain.gui.TextRectangle>*
*<x>15</x>*
*<y>2350</y>*
*<width>110</width>*
*<height>63</height>*
*<rectNo>0</rectNo>*
*<text__Rectangle>With its distant orbit-50 percent farther from the sun </text__Rectangle>*
*</Rstmain.gui.TextRectangle>*
above </temp>
*<temp>*
<string-array>
<string>With its distant orbit-50 percent farther from the sun </string>
<string>than earth-and slim atmospheric blanket,mars experiences frigid weather conditions.Surface temperatures typically average about -60 d</string>
<string>egrees Celsius(-76 degrees Fahrenheit)at the equator and can dip to -123 degrees C nea</string>
<string>r the poles.Only the midday sun at tropic</string>
<string>al lattitudes is warm enough to thaw ice on occasion,but any liquid water formed in </string>
<string>this way would evaporate almost </string>
<string>instantly because of low atmospheric pressure. </string>
</string-array>
<int-array>
<int>55</int>
<int>189</int>
<int>276</int>
<int>318</int>
<int>403</int>
<int>436</int>
<int>485</int>
</int-array>
*</temp>*
<Rstmain.gui.TextRectangle>
<x>15</x>
<y>2350</y>
<width>110</width>
<height>63</height>
<rectNo>0</rectNo>
<text__Rectangle>With its distant orbit-50 percent farther from the sun </text__Rectangle>
</Rstmain.gui.TextRectangle>I cant use random access file for this because the lines in xml file are not of equal length.
currently i am using this approach.convert each object separately to xml and then write to a file.
tempOut = new BufferedWriter(new FileWriter(tempFileXML, true));
tempOut.newLine();
String txtRectXml = stream.toXML(textRectangle);
tempOut.write(txtRectXml);
tempOut.close();please suggest some method for solving my problem...
Thanks...I could solve it by another approach...
Hope it will be helpful for others
create Root Node first.tempFileXML is the fileName here.
String root="temp";
documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilder = documentBuilderFactory.newDocumentBuilder();
document = documentBuilder.newDocument();
rootElement = document.createElement(root);
document.appendChild(rootElement);
writeXmlFile(document,tempFileXML);//writing document to file...
For appending one document to another
txtXml is string Object comprising a xml document
txtXml is
<string-array>
<string>With its distant orbit-50 percent farther from the sun than</string>
<string> earth-and slim atmospheric blanket,mars experiences frigid weather conditions.Surface temperatures typically average</string>
<string> about -60 degrees Celsius(-76 degrees Fahrenheit)at the equator and can dip to -123 degrees C near the poles.</string>
<string>Only the midday sun at tropical lattitudes is warm </string>
<string>enough to thaw ice on occasion,but any liquid water formed in this way</string>
<string> would evaporate almost instantly because of low atmospheric pressure. </string>
</string-array>
//Creating new instances of document builder factory
documentBuilderFactory2 = DocumentBuilderFactory.newInstance();
documentBuilder2 = documentBuilderFactory.newDocumentBuilder();
inStream = new InputSource();
inStream.setCharacterStream(new StringReader(txtXml));
document2=documentBuilder2.parse(inStream);
document=documentBuilder.parse(tempFileXML);
document.getFirstChild().appendChild(document.importNode(document2.getDocumentElement(),true));
writeXmlFile(document,tempFileXML);
writeXmlFile I got from another forum posting
public static void writeXmlFile(Document doc, String filename) {
try {
// Prepare the DOM document for writing
Source source = new DOMSource(doc);
// Prepare the output file
File file = new File(filename);
Result result = new StreamResult(file);
// Write the DOM document to the file
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(source, result);
} catch (TransformerConfigurationException e) {
} catch (TransformerException e) {
}
Similar Messages
-
To get the content of a pdf file in a particular position in text format
I am troubling with geting the content of a pdf file in a particular position.I got the code to get the content of a pdf document as whole in text format.But i only need the content at a particular area.
i am using PDFTextStripper class in pdfBox jar to get the content as whole.
pls send some sample code
pls help me
Edited by: thomas00 on Sep 21, 2007 2:55 AM
Edited by: thomas00 on Sep 21, 2007 3:08 AMpls any one reply
-
Geting the content of a pdf file in a particular position
I am troubling with geting the content of a pdf file in a particular position.I got the code to get the content of a pdf document as whole in text format.But i only need the content at a particular area.
i am using PDFTextStripper class in pdfBox jar to get the content as whole.
pls send some sample code
pls help mepls any one reply
-
Move data from one fs to another from a particular position.
Hi all,
i have a requirement where i want to move data from one field symbol to another from a particular
position.
I have a work area which contains string values. i have converted this string to hexadecimal value .
in this hex string m lukin for a position where '0A' occurs. Now i have to pick the string till dis '0A' value and move it to some other field symbol. Can anybody tell me how to do that.
The code i have written is as follows:
FIELD-SYMBOLS: <fs> TYPE x.
data: temp1 type string,
p_word type string,
temp2 TYPE string,
w_len TYPE i.
temp1 = wa_value-value. "this wa containd the value
w_len = strlen( temp1 ).
if temp1 cp '"*'.
ASSIGN wa_value-value TO <fs> CASTING TYPE x. " converting wa to hex value
DATA: VAR TYPE i,
COUNTER TYPE i,
line_feed_count type i,
temp_count type i.
VAR = strlen( wa_value-value ).
CLEAR: COUNTER, temp_count, line_feed_count.
WHILE COUNTER LE VAR.
IF <fs>+counter(1) = '0A'.
line_feed_count = line_feed_count + 1.
COUNTer = COUNTer + 1.
ENDIF.
COUNTER = COUNTER + 1.
ENDWHILE.
endif.
Now , i want to pick data from starting till the position it gets '0A' and then again till it finds another '0A'.
Thanks in advance.Hi,
As everyone has rightly pointed out, there is no direct way of transferring the data from one appset to another. However, there are definitely few ways of doing it:
1. Run export package. Export the data in flat file. Import the data using import DM package.
2. Export the data from the cube of your application in excel file. Then run the import DM package to load the data.
3. Run UJBR transaction in SAP. Take the backup of the transactional data. You will get few flat files. Run the import DM package.
All the above steps will work only if the structure of the applications in both the appsets is the same. Otherwise, you will have to modify the flat file before uploading the file.
Hope this helps. -
Hi -
I'm creating a positive pay file for my client (they are on Oracle Applications version 11.5.10.2), all has been successful with altering APXPOPAY, I've set this up under a custom directory and as a custom concurrent program. Users can submit the request for the positive pay file and it works correctly.
The problem I'm having is the checkbox in Payment Batches (this is under Payables Manager Responsibility) named "Create Positive Pay File", it is still trying to call APXPOPAY instead of the new custom concurrent program I've created. How do I change this form's checkbox option to start the new program instead of the old one?
Thanks for any help!!!I hope d_benhur 's suggestion would work, another workaround would be "not" selecting the check box for creating positive pay file as part of payment batch. You can write a simple pl/sql program to generate the file once the payment batch is over. This would give you freedom of format and any future enhancements.
Thanks
Girish -
Positional Flat File Handling in B2B
Problem:
There is a big problem with handling positional flat files in Oracle B2B. We are trying to handle Positional Flat File, in UTF-8 with BOM encoding, after creating document definition and setting the agreement, we received:
B2B-51507 Error: The data starting at position 0 is not recognized as a valid data transmission.
What’s more, we remembered to locate Parser file into Config/schema location, which usually fixes problem.
Full description:
We have a sample flat file, with UNIX (LF) endline character, encoded in UTF-8 with BOM:
11B6Kamil Mazur Lazurowa 8 12 CityABCD PL
Junior Consultant MyCompanyX
StreetAAAAAA 00-000 CityABCD
First of all, we have created a guideline *.ecs and schema XSD, like that:
imgur: the simple image sharer
During XSD creation we have remembered to confirm, that our endline character is in UNIX standard (LF).
After that, we have created Parser Schema File, and paste it in the schema location in our server:
/oracle/Middleware/MyDomain/soa/thirdparty/edifecs/XEngine/config/schema,
after that we paste the schema location in XRegistry file:
imgur: the simple image sharer
After that action, we restarted SOA Server (which was running during these changes).
When SOA Server was in alive again, we’ve created a document definition :
imgur: the simple image sharer
Starting and Ending positions are from 2-5, because of BOM character existence. Then, we created Trading Partner and Inbound Agreement, based on this Document Definition:
imgur: the simple image sharer
Then we posted out test file via Generic File Listening Channel, with no Java Callout and other properties. Unfortunately, we receive error like this:
Business Message :
Id
AC18017B146145ADDCD00000178AA4F9
Message Id
AC18017B146145ADDCB00000178AA4F8-1
Refer To Message
Refer To Message
Sender Type
Name
Sender Value
Szkolenie
Receiver Type
Name
Receiver Value
MyCompany
Sender
Szkolenie
Receiver
MyCompany
Agreement Id
PersonIn
Agreement
PersonIn
Document Type
Person
Document Protocol
PositionalFlatFile
Document Version
Logistics2013
Message Type
REQ
Direction
INBOUND
State
MSG_ERROR
Acknowledgement Mode
NONE
Response Mode
ASYNC
Send Time Stamp
2014-05-19 14:00
Receive Time Stamp
2014-05-19 14:00
Document Retry Interval(Channel)
0
Document Remaining Retry(Channel)
0
Document Retry Interval(Agreement)
Document Remaining Retry(Agreement)
Native Message Size
141
Translated Message Size
Business Action Name
Business Transaction Name
Xpath Name1
Xpath Value1
Xpath Expression1
Xpath Name2
Xpath Value2
Xpath Expression2
Xpath Name3
Xpath Value3
Xpath Expression3
Correlation From XPath Name
Correlation From XPath Value
Correlation From XPath Expression
Correlation To XPath Name
Correlation To XPath Value
Correlation To XPath Expression
Wire Message
Wire Message
Application Message
Application Message
Payload Storage
Payload Storage
Attachment
Attachment
Label
soa_b2b_ - Thu May 15 15:04:40 CEST 2014 - 1
Collaboration Id
AC18017B146145ADD9200000178AA4F7
Collaboration Name
Collaboration Version
Business Action Name
Exchange Protocol Name
Generic File
Exchange Protocol Version
1.0
Interchange Control Number
Group Control Number
Transaction Set Control Number
Error Code
B2B-51507
Error Description
Machine Info: (soatest.corp.prv) The data starting at position 0 is not recognized as a valid data transmission.
Error Level
ERROR_LEVEL_COLLABORATION
Error Severity
ERROR
Error Text
Payload validation error.
Wire Message:
Id
AC18017B146145ADAB400000178AA4F1
Message Id
AC18017B146145ADAB400000178AA4F1
Business Message
AC18017B146145ADDCD00000178AA4F9
Packed Message
Packed Message
Payload
Payload
Protocol Message Id
test_4value.txt@AC18017B146145ADAE500000178AA4F5
Refer To Protocol Message Id
Protocol Collaboration Id
Protocol Transport Binding
filename=test_4value.txt filesize=143 ChannelName=SzkolenieChannel file_ext=txt fullpath=/home/oracle/POC/positional/Krzysiek/test_4value.txt timestamp=2014-05-07T10:23:30.000+01:00 tp_profile_name=Szkolenie MSG_RECEIVED_TIME=Mon May 19 14:00:37 CEST 2014
Message Digest
Message Digest
Digest Algorithm
Transport Protocol
File
Transport Protocol Version
1.0
Url
file://localhost//home/oracle/POC/positional/Krzysiek
security
Transport Headers
filename=test_4value.txt filesize=143 ChannelName=SzkolenieChannel file_ext=txt fullpath=/home/oracle/POC/positional/Krzysiek/test_4value.txt timestamp=2014-05-07T10:23:30.000+01:00 tp_profile_name=Szkolenie MSG_RECEIVED_TIME=Mon May 19 14:00:37 CEST 2014
certificates
certificates
State
ERROR
Reattempt Count
Error Code
B2B-51507
Error Description
Machine Info: (soatest.corp.prv) The data starting at position 0 is not recognized as a valid data transmission.
Error Text
Payload validation error.
exchange Retry Interval
exchange Remaining Retry
Message Size
141
Payload seems to be unchanged. Problem appears, when our B2B works in Cluster (but both configuration parameters b2b.HAInstance b2b.HAInstanceName are set properly for both soa-servers):
imgur: the simple image sharer
There are no additional info in logs :
[2014-05-19T14:07:47.994+02:00] [soa_server1] [NOTIFICATION] [] [oracle.soa.b2b.engine] [tid: DaemonWorkThread: '20' of WorkManager: 'wm/SOAWorkManager'] [userId: <anonymous>] [ecid: a8bc74c6eb84aa5b:452af1da:146046c88de:-8000-00000000000598a0,0] [APP: soa-infra] Engine: processIncomingMessageImpl: Message id = AC18017B14614616E1A00000178AA510-1 FromParty = Szkolenie Doctype = Person version = Logistics2013
That’s unfortunately all. Is there any configuration that we missed? How to fix this problem?Hi Anuj,
I have added a transformation in the mediator component and I'm now able to transfer the opaque data from Oracle B2B to composite and then write the contents of flat file to another specified file thorugh file adapter.
However I still have few more issues in different scenarios:
I have tried the excercise that was mentioned in your blog:
http://www.anuj-dwivedi.blogspot.com/2011/10/handling-positionaldelimited-flat-files.html
I tried to create a flat file with two records or lines as mentioned in the blog. First line contains header information whose length is 57 characters with 5 Fileds in it. Second line contains the actual data with 57 characters and 5 fields in it. In the agreement that was created to handle this flat file, I have checked the Validate & Translate check box.
During validation, B2B is failing to treat the second line as a new record and it considering it in one record and the validation is failing as nothing is specified from 58th character in the ECS & XSD files.
Following is the error:
Error -: B2B-51507: Payload validation error.: Machine Info: (corpdevsoa10) Extra Field was found in the data file as part of Record HEADER. Record HEADER is defined in the guideline at position 1.{br}{br}This error was detected at:{br}{tab}Record Count: 1{br}{tab}Field Count: 6{br}{tab}Characters: 57 through 116
Please advice me in resolving this issue.
Thanks,
Krishna. -
In 10.1.2.0.2 Positional EDI Document can be processed using Custom Document Plugin and following are the steps for the same.
1. Apply the latest B2B patch on 10.1.2.0.2 Installation.
2. Add the parser into registryValidator.xml
<Item
Name="SchemaFile">D:/Oracle/midtier/ip/oem/edifecs/XEngine/config/schema/IDoc_parser_40_2_ch
ar_delim.ecs</Item>
3. Design the ecs file in spec builder depending on the Positional Flat file.
4. As part of Document protocol Revision Override the Document Protocol parameter by specifying the ImplementationClass as oracle.tip.adapter.b2b.document.custom.CustomDocumentPlugin
5. Provide the IDOC Ecs file as part of the Document definition Parameter along with start position and End position.
6. Run the End to End test.Hi Chandra,
Instead of using File Content Conversion to convert the file structure, try using the standard module StrictXML2PlainBean instead. The problem is File Content Conversion doesn't identify an empty payload, even if you don't pass anything from the proxy. It doesn't return an empty message to the file adapter.
StrictXML2PlainBean or MessageTransformBean will do the trick for you.
Don't forget to set the empty message handling to Write Empty File.
http://help.sap.com/saphelp_nwpi711/helpdata/en/44/748d595dab6fb5e10000000a155369/frameset.htm
HTH,
Erwin -
Splitting a string into multiple parts from particular position (string has no delimiter )
Hello Gurus,
I need to make string of having length 1000 into multiple parts from a particular position which has some text without any delimiter and i want to populate each part into an internal table which has one filed...
eg : string = 'sap abap sap abap sap abap sap abap sap abap sap abap sap abap sap sap sap abap sap abap'
suppose i want to start splitting from 40th position...assume that i have 3 parts
and these 3 parts i have put into an internal table..
lt_itab = [sap abap sap abap sap abap sap abap,
sap abap sap abap sap abap sap abap,
sap abap sap sap sap abap sap abap]
plese help!
any help would be Appreciated ...thank youHi,
Try this code.
TYPES: BEGIN OF ty,
b TYPE string,
END OF ty,
tt TYPE STANDARD TABLE OF ty.
DATA: a TYPE string VALUE 'aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll',
tb TYPE tt,
wa TYPE ty,
off TYPE i,
len TYPE i,
count TYPE i,
count1 TYPE i,
temp TYPE i.
len = 8. "Position
off = 0.
count = strlen( a ).
count1 = count / 8.
temp = len - 1.
DO count1 times.
temp = off + len.
IF temp > count.
wa-b = a+off.
ELSE.
wa-b = a+off(len).
ENDIF.
off = off + len.
SHIFT wa-b LEFT DELETING LEADING space.
APPEND wa to tb.
ENDDO.
LOOP AT tb INTO wa.
write: / wa-b.
ENDLOOP. -
Read and write excel sheet data from uploded file in sharepoint site programmatically 2013
hi team,
I am working on sharepoint 2013.I want to read and write data in excel sheet (micrsoft excel) from stored file in shrepoint docoumnt library .please suggest me
vijayHi
Vijay,
check those links
http://www.sharepointwithattitude.com/archives/61
https://social.technet.microsoft.com/Forums/en-US/e760051b-a92f-473c-9ec9-0f0c36c99e40/read-and-write-excel-sheet-data-from-uploded-file-in-sharepoint-site-programmatically-2013?forum=sharepointdevelopment
Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation. Please remember to mark the reply as answer if it helps. -
Hi friends,
My server Intelligence Agent (SIA) can not start because the database service "SQLAnywhereForBI" can't start also. I got the following error :
"I . 08/09 20:35:06. A read failed with error code: (1392), Le fichier ou le répertoire est endommagé et illisible.
E. 08/09 20:35:06. Fatal error: cannot write to transaction log "C:\Program Files (x86)\SAP BusinessObjects\sqlanywhere\database\BI4_Audit.log"
E. 08/09 20:35:06. unable to start database "C:\Program Files (x86)\SAP BusinessObjects\sqlanywhere\database\BI4_CMS.db"
E. 08/09 20:35:06. Error writing to transaction log file
I. 08/09 20:35:06. Database server shutdown due to startup error "
inside the database log file.
Please, can you help meI found the solution by following the advice given on the following forum:
http://evtechnologies.com/transaction-logs-on-sybase-sql-anywhere-and-sap-businessobjects-bi-4-1
In fact, I crushed the BI4_Audit.db and BI4_Audit.log files and I replaced with others that I got from another machine where I installed BO again and where the files are not corrupted . After I logged in to the CMS database by executing the command in the command line:
dbisql -c "UID = DBA; PWD = mypassword; BI4 Server =; DBF = C: \ Program Files (x86) \ SAP BusinessObjects \ sqlanywhere \ database \ BI4_CMS.db."
Once connected, I start the command:
alter database 'C: \ Program Files (x86) \ SAP BusinessObjects \ sqlanywhere \ database \ BI4_Audit.db' alter log off;
The query runs successfully.
And that's good, I can be connected to BO smoothly.
Thank you again Eric -
To attach a Phone or a vehicle to a particular position in Organisation
Hi Experts,
Is it possible to attach a Phone or a vehicle to a particular position in an organisation so that an employee holding that particular position may be able to access them.
Scenario is like a Phone & Car is issued to a particular position like(Chief Engiineer) in the organisation.
Regards,
TomeshDear Tomesh,
You can make use of IT1010 for tha assignment of resources by creating subtypes for the same IT. Also crate entries in the table T778W for the subtype you have created.
If you are looking for any icon display then i'm nor sure but you can place in SAP Note.
Regards,
Anil. -
How to read and write a string into a txt.file
Hi, I am now using BEA Workshop for Weblogic Platform version10. I am using J2EE is my programming language. The problem I encounter is as the above title; how to read and write a string into a txt.file with a specific root directory? Do you have any sample codes to reference?
I hope someone can answer my question as soon as possible
Thank you very much.Accessing the file system directly from a web app is a bad idea for several reasons. See http://weblogs.java.net/blog/simongbrown/archive/2003/10/file_access_in.html for a great discussion of the topic.
On Weblogic there seems to be two ways to access files. First, use a File T3 connector from the console. Second, use java.net.URL with the file: protocol. The T3File object has been deprecated and suggests:
Deprecated in WebLogic Server 6.1. Use java.net.URL.openConnection() instead.
Edited by: m0smith on Mar 12, 2008 5:18 PM -
How to write the nodevalue back to xml file?
Hi, Everybody:
These are two packages I used. javax.xml.parsers.*,org.w3c.dom.*
Now I use "setNodeValue("abc") to set the node value to "abc". But it is not really saved back into XML file. It only change the node value in memory.
How to write the changes back to XML file? Thank you very much for your help.
Michelle* Version : 1.00
* File Purpose : Given the xml file loads into dom and recreate the file with the updated values.
* Developer : Kashif Qasim : 25/july/04
* Modify detail :
import java.lang.*;
import java.io.*;
import java.util.*;
import java.text.*;
import org.w3c.dom.*;
import org.apache.xerces.parsers.DOMParser;
import org.apache.xerces.*;
public class XMLWriter
private String displayStrings[] = new String[5000];
private int numberDisplayLines = 0;
private Document document;
//private final Node c;
public synchronized void displayDocument(String uri,Vector UpdatedValues,String getTaskID)
try {
DOMParser parser = new DOMParser();
parser.parse(uri);
document = parser.getDocument();
display(document, "",UpdatedValues);
} catch (Exception e) {
e.printStackTrace(System.err);
ReadXmlConfig objReadXmlConfig = null;
FileWriter filewriter = null;
try {
filewriter = new FileWriter(uri);
for(int loopIndex = 0; loopIndex < numberDisplayLines; loopIndex++){
filewriter.write(displayStrings[loopIndex].toCharArray());
//System.out.println("displayStrings[loopIndex].toCharArray() "+displayStrings[loopIndex].toString());
//filewriter.write("\n");
filewriter.close();
System.gc();
objReadXmlConfig = new ReadXmlConfig();
objReadXmlConfig.ITSLog("File updated for "+getTaskID+" succesfully, file is closed now ");
} catch (IOException e) {
System.err.println("Caught IOException: " + e.getMessage());
objReadXmlConfig = new ReadXmlConfig();
objReadXmlConfig.ITSErrorLog("File updated FAILED for "+getTaskID+". Reason for file error "+e.toString());
}finally {
if (filewriter != null) {
System.out.println("Closing File");
objReadXmlConfig =null;
try{
filewriter.close();
}catch(IOException e){
System.err.println("Caught IOException: " + e.getMessage());
} else {
System.out.println("File not open");
private void display(Node node, String indent, Vector UpdtRecs)
if (node == null) {
return;
int type = node.getNodeType();
NodeList nodeList = document.getElementsByTagName("QueryParm");
int TotalRecs = UpdtRecs.size();
switch (type) {
case Node.DOCUMENT_NODE: {
displayStrings[numberDisplayLines] = indent;
displayStrings[numberDisplayLines] +=
"<?xml version=\"1.0\" encoding=\""+
"UTF-8" + "\"?>";
numberDisplayLines++;
displayStrings[numberDisplayLines] += "\n";
display(((Document)node).getDocumentElement(), "",UpdtRecs);
break;
case Node.ELEMENT_NODE: {
if(node.getNodeName().equals("QueryParm")) {
for(int i =0 ; i< nodeList.getLength() ; i++)
Node nodeQry = nodeList.item(i);
NamedNodeMap nnp = nodeQry.getAttributes();
for(int j= 0 ; j < nnp.getLength() ; j++)
Attr atr = (Attr) nnp.item(j);
if(atr.getName().equalsIgnoreCase("value_"+(i+1)))
//System.out.println(atr.getName() +" : " + atr.getNodeValue() );
atr.setNodeValue(UpdtRecs.get(i).toString());
displayStrings[numberDisplayLines] = indent;
displayStrings[numberDisplayLines] += "<";
displayStrings[numberDisplayLines] += node.getNodeName();
int length = (node.getAttributes() != null) ?
node.getAttributes().getLength() : 0;
Attr attributes[] = new Attr[length];
for (int loopIndex = 0; loopIndex < length; loopIndex++) {
attributes[loopIndex] = (Attr)node.getAttributes().item(loopIndex);
for (int loopIndex = 0; loopIndex < attributes.length; loopIndex++) {
Attr attribute = attributes[loopIndex];
displayStrings[numberDisplayLines] += " ";
displayStrings[numberDisplayLines] += attribute.getNodeName();
displayStrings[numberDisplayLines] += "=\"";
displayStrings[numberDisplayLines] += attribute.getNodeValue();
displayStrings[numberDisplayLines] += "\"";
displayStrings[numberDisplayLines]+=">";
numberDisplayLines++;
NodeList childNodes = node.getChildNodes();
if (childNodes != null) {
length = childNodes.getLength();
indent += " ";
for (int loopIndex = 0; loopIndex < length; loopIndex++ ) {
display(childNodes.item(loopIndex), indent,UpdtRecs);
break;
case Node.CDATA_SECTION_NODE: {
displayStrings[numberDisplayLines] = "";
displayStrings[numberDisplayLines] += "<![CDATA[";
displayStrings[numberDisplayLines] += node.getNodeValue();
displayStrings[numberDisplayLines] += "]]>";
numberDisplayLines++;
break;
case Node.TEXT_NODE: {
displayStrings[numberDisplayLines] = "";
String newText = node.getNodeValue().trim();
if(newText.indexOf("\n") < 0 && newText.length() > 0) {
displayStrings[numberDisplayLines] += newText;
displayStrings[numberDisplayLines] += "\n";
numberDisplayLines++;
break;
case Node.PROCESSING_INSTRUCTION_NODE: {
displayStrings[numberDisplayLines] = "";
displayStrings[numberDisplayLines] += "<?";
displayStrings[numberDisplayLines] += node.getNodeName();
String text = node.getNodeValue();
if (text != null && text.length() > 0) {
displayStrings[numberDisplayLines] += text;
displayStrings[numberDisplayLines] += "?>";
displayStrings[numberDisplayLines] += "\n";
numberDisplayLines++;
break;
if (type == Node.ELEMENT_NODE) {
displayStrings[numberDisplayLines] = indent.substring(0,
indent.length() - 4);
displayStrings[numberDisplayLines] += "</";
displayStrings[numberDisplayLines] += node.getNodeName();
displayStrings[numberDisplayLines] += ">";
displayStrings[numberDisplayLines] += "\n";
numberDisplayLines++;
indent += " ";
public static void main(String args[])
Vector xmlValue = new Vector();
xmlValue.add(0,"Kashif");
xmlValue.add(1,"Qasim");
//displayDocument("NewMediation.xml",xmlValue);
<?xml version="1.0" encoding="UTF-8"?>
<Mediation>
<Task1>
<Source>
<SourceDriver>com.microsoft.jdbc.sqlserver.SQLServerDriver</SourceDriver>
<SourceConnection>jdbc:microsoft:sqlserver://10.2.1.58:1433;DatabaseName=MTCVB_HDS;</SourceConnection>
<SourceUser>sa</SourceUser>
<SourcePassword>sa</SourcePassword>
<Table>
<SourceTable>t_Agent</SourceTable>
<SourceQuery><![CDATA[SELECT SkillTargetID,PersonID,PeripheralID,EnterpriseName,PeripheralNumber,Deleted,TemporaryAgent,AgentStateTrace,ChangeStamp FROM t_Agent where SkillTargetID > {value_1} order by SkillTargetID]]>
</SourceQuery>
<SourceParm BusinessRule="" ColumnName="SKILLTARGETID" ColumnNumber="1" DataType="Numeric" DefaultValue="0" Format="mm/dd/yyyy xx:xx:xx XX">
</SourceParm>
<SourceParm BusinessRule="" ColumnName="PERSONID" ColumnNumber="2" DataType="String" DefaultValue="" Format="">
</SourceParm>
<SourceParm BusinessRule="" ColumnName="PERIPHERALID" ColumnNumber="3" DataType="String" DefaultValue="" Format="">
</SourceParm>
<SourceParm BusinessRule="" ColumnName="ENTERPRISENAME" ColumnNumber="4" DataType="String" DefaultValue="" Format="">
</SourceParm>
<SourceParm BusinessRule="" ColumnName="PERIPHERALNUMBER" ColumnNumber="5" DataType="String" DefaultValue="" Format="">
</SourceParm>
<SourceParm BusinessRule="" ColumnName="DELETED" ColumnNumber="6" DataType="String" DefaultValue="" Format="">
</SourceParm>
<SourceParm BusinessRule="" ColumnName="TEMPORARYAGENT" ColumnNumber="7" DataType="String" DefaultValue="" Format="">
</SourceParm>
<SourceParm BusinessRule="" ColumnName="AGENTSTATETRACE" ColumnNumber="8" DataType="String" DefaultValue="" Format="">
</SourceParm>
<SourceParm BusinessRule="" ColumnName="CHANGESTAMP" ColumnNumber="9" DataType="String" DefaultValue="" Format="">
</SourceParm>
<QueryParm FldName_1="SkillTargetID" FldType_1="Number" value_1="0">
</QueryParm>
</Table>
</Source>
</Task1>
</Mediation>
The QueryParm values are updated thru this code :)
Hope it helps u ... -
How to write a return in a text file.
Hi, i am trying to write diferent lines into a text file, i write strings ending with \r\n but it doesn't work, how could i write in diferent lines?
Thanks.PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("myfile.txt")));
out.println("This is the first line");
out.println("This is the second line");
out.flush();
out.close();Jesper -
How to write a plain string into a file using File Adapter
Hi All,
I am new to ESB technology. I have created one ESB application to invoke a java web service(Which will return string as result) and to write retrieved result in to a file. To achieve it i have created the file adapter using user defined schema. It was working fine. But, I got the modifications in my requirement to store the returned result(String value) in to a text file without any user defined schema. So i used native format for FileAdapter and mapped the returnedResponse(String value) to opaque:opaqueElement. But i am facing relationship error.
anybody can help me to solve this issue?.. is there any method to convert a string value to opaqueElement..
Thanks in advance..Hi All,
I am new to ESB technology. I have created one ESB application to invoke a java web service(Which will return string as result) and to write retrieved result in to a file. To achieve it i have created the file adapter using user defined schema. It was working fine. But, I got the modifications in my requirement to store the returned result(String value) in to a text file without any user defined schema. So i used native format for FileAdapter and mapped the returnedResponse(String value) to opaque:opaqueElement. But i am facing relationship error.
anybody can help me to solve this issue?.. is there any method to convert a string value to opaqueElement..
Thanks in advance..
Maybe you are looking for
-
Can you recommend a pattern or a better apporach?
Hello, I have to map a lot of strings from one object to another. These objects are made up of smaller objects but all there member vars are still String. Some of these something like this: //Lots of mapping like this. test1.getSomeMethod().getSomeOt
-
What is the best video adapter to buy? Pinnacle or Canopus..
i was wondering on what will be the best of the two because i'm trying to buy one of those but i dont know what to buy. because will be doing a lot of video editing using a Hi8 video camera because i don't have any money to buy a DV camera. what woul
-
Delta load to ODS taking too much time
Hi, I have one delta load running everyday to ODS .its getting data from R3 & its taking too 3-4 hours daily.due to this data is not getting updated in cube on time and there arises issue with data in Reports Please let me know what are possible solu
-
History, Snapshots and Virtual Copies
In other applications I use, specifically PS and Nikon Capture NX, I have the ability to delete random editing steps that I have done either directly through history or some sort of "layer" methodology. I have noticed in LR that the history list seem
-
Where is the "Net" trail from Java tutorial?
Hello! May be it's stupid question, but I just need to look at Net trail from java tutorial (java.net, urls, sokets etc...) . As I remember there was good tutorial about this, probably in "essential java classes", but now there is no it. Does anybody