WebDynpro 4 Java & Persistence options : Any Idea how 2 read an XML?
Hi,
I was wondering if there is an easy way to store modified (or new) values in a WebDynpro application.
e.g. A User adds a new row to an existing Table UI in Web Dynpro application with create button. I want to save this row either in an XML file, in a table connecting to database or in an ABAP table via RFC connection. Which option is a light (on resources?) and easy to implement. I think it's reading and writing to an XML file. What are the other options, if any?
I've been trying to read an xml file (stored under src/mimes/Components/<com.sap.myComp>/test.xml as below:
//controller code
private static final String FILE_NAME = "test.xml";
private static final WDWebResourceType FILE_EXT = WDWebResourceType.XML;
IWDResource resource = WDWebResource.getWebResource(wdComponentAPI.getDeployableObjectPart(), EditView.FILE_EXT, EditView.FILE_NAME);
wdContext.currentContextElement().setFile(resource);
//end controller code
//view Init() code
IWDResource resource = wdContext.currentContextElement().getFile();
File file = new File(resource.getResourceName().toString());
/* I've also tried below
FileInputStream fis = null;
fis = new FileInputStream(file);
url = file.getAbsolutePath();
//url is null when printed?
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(file);
doc.getDocumentElement().normalize();
content = doc.getDocumentElement().getNodeName().toString();
//end view Init() code
When I print the value of content, I get it's initial value which is null. What is wrong?? any ideas?
How to get the correct path to the stored xml and how to display its contents? I've read enough posts on SDN but couldn't get it working.
Appreciate your help.
Regards,
N.
hi,
U r retriving the elements by tag name.So it just chks the tag name ie.<book> & gives u array of elements.But u need retrive d attribute of <book> tag itself.
=Solution =====
Add one more statement ----> var[]= doc.getElementsByName("book");
Now u hav book elements as an array & can retrive id in for loop
for(var; var.length;var++)
doc.element[var].id.value
Similar Messages
-
I recently purchased a second hand new macbook air, although it was second hand to me the previous owner had never actually turned it on. So i went through all the set up steps when switching it on for the first time.
My problem is that iPhoto and iMovie are not installed, and when i go to the app store the icons have an accept button, it then prompts me for my apple ID, obviously these a registered to the original owner, and says i need that ID in order to download them, or i'll have to purchase them.
I'm happy to purchase them, but it doesn't give me that option, every time i search for them in the app store they always come up with the accept option and no purchase option.
Any idea how i can get round this would be great fully appreciated.I recently purchased a second hand new macbook air, although it was second hand to me the previous owner had never actually turned it on.
Something doesn't make sense here, though I'm not saying the previous owner is lying....
Time to send your serial # to iTS and let them see what's happening here.
iTunes Store Support
http://www.apple.com/emea/support/itunes/contact.html -
Hi there,
I bought My Iphone 4s from Iran, I need to make an Apple Id but Iran is not in the registered countries?! I dont know what to choose? Also From Iran we do not have Credit card facility for payment option?!! Any idea how I can get FREE APPS on my New Phon?!!
Please let me know how I can get this sorted as soon as possible!! Thank you very muchYou can create an Apple ID without a credit card, see this article:
Create an iTunes App Store account without a credit card
Check this post about iPhones from Iran:
Re: Why Apple does not support from Iran? And why not open a store in Iran? -
Any ideas how I can insert a pdf into word, using the insert object option. However the pdf i want to insert has text and lines annotated, but once inserted the comments don't appear???? any help would be greatly appreciated.
You will need to find a forum for MS Word since that is the software that you are trying to manipulate in this. If you think the processing/creation of the PDF plays a role then you should ask in the forum for the software that you are using to create the PDF.
This forum is for issue regarding downloading and installing Adobe trial products, so in any circumstance, your issue does not fit in this forum. -
Any ideas how to execute a .sql file on database server from java?
Any ideas how to execute a xyz.sql file (which is fisically on
database server) from java?
thanksTry
sqlplus "sys/oracletest as sysdba" @bpk.sql
Working locally, and having set the ORACLE_SID, you don't need to specify the SqlNet alias (@testdb).
Remember to put an exit at the end of the bpk.sql script. -
I did a trial using one email, then purchased a subscription using a different email. Every time I try to open a downloaded app it tells me that my trial has expired and only offers me the option to purchase it. Any ideas how I can access the subscription I just paid for?
Sign out from Creative Cloud desktop application and Sign in with email ID using which you had purchased subscription .
https://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
Then launch CC apps and try to activate.
Still face issue , let me know -
Any idea how the java application can get the physical memory?
Hello, everyone
Any idea how the java application can get the physical memory?
thanks in advanceI believe what yo intend to do is forbidden, but here
my answer.
when you start your application you can give your VM
the entire memory of your pc. like this this memory
is completly under your control.* headdesk * -
i have connect a seagate HDD formated on NTFS to my macbook pro with Mac OS 10.7 but my HDD is read only
any idea how can i change it to read & write ?i tried the trial version of tuxera and it gives me the possibility to read & write , Thanx fschweig.
@ Samberl : what is the benifts of keeping my drives on mac format and this SW mediafour i install on my PC to let it write the mac formated HDD ?
is it free ?
all the best
Adiab -
? I get an Error msg when syncing ipad "The disk could not be read from or written to" when loading photos. Does anyone have any idea how to fix?
You have posted in the Mac forum for problems & questions usting the iTunes store. You will probably find more help in the following forum.
http://discussions.apple.com/forum.jspa?forumID=800 -
Got to end of trial period for Adobe reader XI and cannot revert back to old version or install another version b/c it says I have a newer more functional version, so now I've got no reader at all and cannot fix. Any ideas how to overcome this?.
YOu need to be clear about the products you are using, so we can help you. In particular there is no trial of Adobe Reader, it is free and keeps running. Sounds like you are using some versions of Acrobat - which?
YOu must properly uninstall the trial, don't just delete files or you may get a mess impossible to recover. -
cannot export my D800 images out of lightroom, message reads not enough memory. Anyone any ideas how to fix this?
Is it Win7 32-Bit (that's where I've seen it happen). I would report it as a bug at the official Adobe site:
http://feedback.photoshop.com/photoshop_family
Beat -
I have been importing images via card reader with no problem. Now all of a sudden I can see the images on the screen but when I try to import the computer says that it can not read them and quotes numbers of the images. Any idea how to solve?
Please give us the exact error message.
Please state your operating system.
Please state the exact version of Lightroom you are using.
Please give us any other relevant details.
What does this mean: "Now all of a sudden I can see the images on the screen"? Are you looking in Lightroom or your operating system or the camera screen? Where? -
When i upgraded my ipad and reinstalled Ibooks, the print on my books is now so tiny i can barely read them. Any idea how to get my larger print back?
Media is not included in a backup. You should be able to resync them your copy of them on your computer's iTunes. If you haven't got your a copy of them then if they are still in the store, then you can re-download apps via the Purchased tab in the App Store, ibooks via the Purchased tab in the ibookstore in the iBooks app, and (depending upon what country that you are in) potentially music, films and tv shows via the Purchased tab in the iTunes store app.
For podcasts you can download the Podcasts app -
When I try to download Adobe Reader, the Adobe Installer opens a black box. The installer doesn't actually work. Any ideas how to fix? I am using Windows 8 installing the English version. Thanks!
Try the installer from http://get.adobe.com/reader/enterprise/
-
Since updating to iOS08 all my books have disappeared from iBooks, including some I haven't read yet. Any ideas how I can get them back?
Hi Raymond,
I am having the same issue. But I can't seem to be able to find my books & PDF's. How did you find them? I am trying to locate them on my iPad.
Thanks,
Lori
Maybe you are looking for
-
How to open a pdf document with bookmark from forms6i
Hi. I'd like to open a pdf file from forms6i but positioning at a specified bookmark. I've tried the following line of code, but it jus opens the document at the start of it: host ('c:\sqlfigo.pdf #EMPRESAS',no_screen); also tried: host ('c:\sqlfigo.
-
Product list/database in flash
I'm in the planning phase of building a product database/list in flash. It is suppose to be a pop-up from a HTML page and is only to contain product information. The key elements are: - Product name - Product image - Description - Article number(s) -
-
what is the problem if the message -We could not complete your iTunes Store request. The iTunes Store is temporarily unavailable. Please try again later is shown
-
Problem w/Apple 4.7GB DVD-RAM drive (LF-D211A)
It rejects DVD-RAM disks it used to accept (spits them out immediately after sucking them in), but only in their plastic cases. If remove from the case, it accepts the same DVD-RAM disk but regards it as read-only. Note: no problem reading CDs and DV
-
I ordered the package a month ago that included PS CC and LR 5. When I installed PS it installed fine and is working well. When I installed LR it said it's a trial only and is now expiring? Did I miss something??