I'd like to load images using XML and Java - hints??
I have a XML files that are created on a timed basis....they describe a photo and point to a dir where the photo is stored...like...
<image>
<user>bill</user>
<img>photo.jpg</img>
<img_dir>'/tmp/photos'</img_dir>
</image>
I'd like to write a Java program that parses the XML and loads the images, data into Oracle.
Suggestions on Oracle tools, downloads that will help me accomplish this???
Thanks!
I pass a URL and then when I parse the XML I download the file from the URL.
A.
Similar Messages
-
How to load images using xml in flash
Hi
im working on a quiz project where i plan to load images using xml in to flash, can any one help with the script with AS2 or 3You'll find a tutorial for what you are after here:
http://www.gotoandlearn.com/play?id=22 -
Problem loading Image through XML!
Hi,
I am Akshay and am beginner in this forum. I am trying to load images using flickr API and having problem.
I am doing it in following fashion:
1) I am calling the Httpservice to get the xml through flickr API as
<s:HTTPService id="photoService" url="http://api.flickr.com/services/feeds/....FullAPI" resultFormat="e4x" result="photoResultHandler(event);" fault="photoFaultHandler(event);"/>
2) In photoResultHandler I am retrieving the XML
private function photoResultHandler(re:ResultEvent):void
photoXml= re.result as XML;
However, I am struggeling to retireve elements from photoXML and then use it to display image in :
<mx:Image id="img0" x="151" y="98" width="520" height="291"/>
The XML structure is as below:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed">
<entry>
<author> </author>
<link rel="enclosure" type="image/jpeg" href="http://farm5.static.flickr.com/4484460580_04bbced2d8_o.jpg"/>
</entry>
<entry>
</entry>
I need to load the href value of link which can be found in feed-->entry-->link in the above xml.
Please help!
-AkshayHello Dave,
Thanks for your prompt reply. Here's the mxml code :
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" creationComplete="photoService.send()" minHeight="600">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.events.MoveEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
public var photoXml:XML;
private function photoResultHandler(re:ResultEvent):void
photoXml= re.result as XML;
//var src :int = "{photoXml.feed.entry.updated}" as int;
img0.source= String(photoXml.entry[0].link[1].@href);
private function photoFaultHandler(fe:FaultEvent):void
Alert.show(fe.fault.message);
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:HTTPService id="photoService" url="http://api.flickr.com/services/feeds/photos_public.gne?id=48951865@N07" resultFormat="e4x" result="photoResultHandler(event);" fault="photoFaultHandler(event);"/>
</fx:Declarations>
<mx:Image id="img0" x="151" y="98" width="520" height="291"/>
</s:Application>
Hope it helps you in finding out the problem...DO let me know your thouhgts
Thanks again for your replies so far......
-Akshay -
hi all
It would be appreciated if any one let me know how to edit
bitmap which is imported in flash using xml and save the edited
bitmap back to xml in flash.
Is it posible to save the bitmap data in flash?
thanks in advanceYes you can... but like I said before you need to upload the
data from the changes you make to a server.
In terms of the solution... its unlikely that you'll find one
specifically for your needs. You will have to learn whatever you
don't know how already and maybe adapt some existing examples to
your needs.
To change the visual state of a movie clip... you just do all
the regular things that you want to do to it using flash... scale,
rotation, drawing API , textfields etc in actionscript. If you
don't know how to how to do that stuff, then you need to learn that
first. That's basic actionscript.
You can capture the visual state of a movieclip using the
BitmapData class. That includes a loaded jpeg. You can also
manipulate bimatp data using the same class. You should read up on
that if you don't know how to use it or check out the examples
below for uploading info.
For uploading to the server:
Here's an as2 solution that took 15 secs to find using
google:
http://www.quasimondo.com/archives/000645.php
If you're using as3, google search for "jpeg encoder as3" and
look through that info. There are also historical answers in the
forums here related to this type of thing that might help as
well. -
Create a new Buffered Image using Raster and ColorModel
Sorry , I crosspost this message,because no one reply.
Recently,I write a programme combining C++ and Java .
The C++ part create a array containing image data in form of BI_RGB and biBitCount==32.
The java part create a image using Raster and ColorModel like this:
static int[] data ;
DataBuffer db = new DataBufferInt(data, data.length);
WritableRaster wr =Raster.createPackedRaster(db, 1024,768, 32, null);
ColorModel cm = new DirectColorModel(32,0xff0000,0x00ff00,0x0000ff);
img = new BufferedImage(cm, wr, false, null);But it doesn't work .
it report this:
Exception in thread "main" java.lang.IllegalArgumentException: Raster sun.awt.im
age.SunWritableRaster@dff3a2 is incompatible with ColorModel DirectColorModel: r
mask=ff0000 gmask=ff00 bmask=ff amask=0
at java.awt.image.BufferedImage.<init>(BufferedImage.java:549)
at monitor.test.Perform2.main(Perform2.java:39)hey epico
compiles & runs 4 me
see javadocs for SinglePixelPackedSampleModel
import java.awt.image.*;
public class Tester {
DataBuffer db;
WritableRaster wr;
ColorModel cm;
BufferedImage im;
int[] data;
int[] masks;
int w = 768;
int h = 576;
public Tester() {
data = new int[768*576];
for (int i = 0;i < w*h ;i++ ) {
data[i] = 0;
masks = new int[3];
masks[0] = 0xff0000;
masks[1] = 0x00ff00;
masks[2] = 0x0000ff;
db = new DataBufferInt(data,data.length);
SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT,w,h,masks);
cm = new DirectColorModel(32,0xff0000,0x00ff00,0x0000ff);
wr = Raster.createWritableRaster(sm,db,null);
im = new BufferedImage(cm,wr,false,null);
public static void main(String[] args) {
Tester tester1 = new Tester();
} -
Simple XML to Text onversion using XSLT and Java?
Hi all!
I'm completly new to using XSLT and Java and are trying to convert a XML file into a ordinary Textfile that I am gonna import into another application.
I started up writing a ordinary XML parser in Java which interpreted the XML file, but realized later on that it was possible to do with a ordinary XSLT.
So far it is a 2-step process right now, I've tied my XSLT to the XML file and then just open the XML file up in a ordinary browser and then get the result.
I found an example (http://www.onjava.com/pub/a/onjava/excerpt/java_xslt_ch5/index.html?page=3) where u hook up a XML file and a XSL file separately and the process it, and dump it to Stdout. But do I need to hook up a XSL file like this when the XML file is tied to a XSL file internally?Just to give you an example to show you how easy it is: http://www.daniweb.com/forums/thread137587.html
-
Creating an Order Processing System Using XML and JavaBean/EJB
Hi,
I'm looking to design a solution for the following problem:
A distributor creates a purchase order from a home grown system. This purchase order is sent to the company as a flat text file. This file must then be validated for both syntax and data values and then processed by their ERP system running on an AS/400.
The solution I would like to provide is to place the data from this text file into an XML file and then create a system composed of server side components (either Java Beans or Enterprise Java Beans) that would parse the information and call the back end ERP processes (using business methods from within the beans). I have already developed a web app that processes orders using JSP and Java Beans. In this case however, the order will never be seen by a human unless it fails validation. I figured using XML to do this would not only be good for this part but also improve the e-commerce side as well. My only question is how to submit an XML document to a bean for processing without user intervention. Any information you can give me on this or even to point me in the right direction would be greatly appreciated. Thank you for your time.Hello,
Thank you for responding to my question. I have several books here on XML but have not gotten very far in them as of yet. I understand how to create an XML document and a DTD, but I guess I haven't gotten far enough to understand how "submit" per say an XML page like you would an HTML form and then proceed to retrieve the data from the request parameters. I will research this further. -
Hello all
i am new to obi ee and i wanna know how can we use the codes of xml and java scripting in it and i am sitting on the client system...Do i need to change some files on server???
thanks in advance,
pankajYou mean like in this thread? Re: Creating a Popup Box / List of Values on a Dashboard
What's the idea behind it?
Why this and not a prompt?
Input mask for write-back?
Cheers,
C. -
Problem in creating client side PDF with image using flex and AlivePD
I need a favor I am creating client side PDF with image using flex and AlivePDF for a web based application. Images have been generated on that pdf but it is creating problem for large size images as half of the image disappeared from that pdf.I am taking the image inside a canvas . How do i control my images so that they come fit on that pdf file for any image size that i take.
Thanks in advance
AtishayI am having a similar and more serious problem. It takes a
long time to execute, but even attaching a small image balloons the
pdf to 6MB plus. After a few images it gets up to 20MB. These are
100k jpeg files being attached. The resulting PDF is too large to
email or process effectively. Does anyone know how to reduce
size/processing? -
How to create a user using XML and specifying addional attributes that are objects
I'm trying to create a user using XML and specifying some attributes that are objects and not sure how to do it. How would I set the DirectoryUserAcl to Public?
Here's the xml file:
<?xml version = '1.0' standalone = 'yes'?>
<SimpleUser>
<UserName>mike2</UserName>
<Password>abc123</Password>
<AdminEnabled>false</AdminEnabled>
<HomeFolderRoot>/home</HomeFolderRoot>
<HasContentQuota>false</HasContentQuota>
<DirectoryUserAcl> ??? </DirectoryUserAcl>
<DefaultAclBundleAcl> ??? </DefaultAclBundleAcl>
<HomeFolderPolicyBundleAcl> ??? </HomeFolderPolicyBundleAcl>
</SimpleUser>I figured out the answer:
<?xml version = '1.0' standalone = 'yes'?>
<SimpleUser>
<UserName>mike2</UserName>
<Password>abc123</Password>
<AdminEnabled>false</AdminEnabled>
<HomeFolderRoot>/home</HomeFolderRoot>
<HasContentQuota>false</HasContentQuota>
<DirectoryUserAcl classname="SystemAccessControlList" refType="name">Public</DirectoryUserAcl>
</SimpleUser>
null -
Database updation using XML and stored Procedure?
Hello,
I want to perform updation in multiple tables using XML files.Please suggest can I do updation using xml and stored procedure.
If yes then which is more efficient and takes less time.
1.Updation using xml files only
2.Updation using xml files with stored procedure.
3.Stored procedure alone.
If direct xml and stored procedure communication is possible.then please write how.
Thanks in advance for any help.Here's a sample. The next code drop of the XSQL Servlet will make the easy-to-do from within XSQL Pages:
package package1;
import org.w3c.dom.*;
import java.sql.*;
import oracle.jdbc.driver.*;
import oracle.xml.sql.query.OracleXMLQuery;
public class Class1 extends Object {
public static void main( String[] arg ) throws Exception {
Connection conn = getConnection();
CallableStatement ocs = conn.prepareCall("begin ? := App.HotItems('PAUL'); end;");
ocs.registerOutParameter(1,OracleTypes.CURSOR);
ocs.execute();
ResultSet rs = ((OracleCallableStatement)ocs).getCursor(1);
OracleXMLQuery oxq = new OracleXMLQuery(conn,rs);
System.out.println(oxq.getXMLString());
oxq.close();
rs.close();
ocs.close();
conn.close();
public static Connection getConnection() throws Exception {
String username = "scott";
String password = "tiger";
String dburl = "jdbc:oracle:thin:@localhost:1521:xml";
String driverClass = "oracle.jdbc.driver.OracleDriver";
Driver d = (Driver)Class.forName(driverClass).newInstance();
return DriverManager.getConnection(dburl,username,password);
null -
Select images using keywords and view slideshow...using what?
I have a library full of jpeg images that were created either using the export command from LR or by editing in Br/Ps and then savedAs jpeg. Now I want to watch slideshows on my monitor (30" Apple HD Cinema Display). Now I have the following Dilemma:
- I can start a Search Command in Bridge and narrow it down to exactly the images I want in my slide show. Then from the View menu select Slideshow. The IQ is terrible. True sharpness is only revealed when zooming in 100% but that's not the idea of a slide show.
- I can also use Apple OS's (Tiger) built-in slide show and start it from the finder. That way I get high quality, fast dissolving slide shows, that are unfortunately limited to the first 100 images in the Finder view. However, in the Finder I cannot select my images using keywords and IPTC info.
So could there be a simple solution to the problems I'm running into with Bridge?
Or could there be a nice viewer for MacOS that features the search option I want and renders good images and dissolve option?
Thanks.@Ann Shelbourne: Thanks for your reply. I'm hesitant to upgrade to CS4 at this point. That would mean my only option is to look for a jpeg viewer other than Adobe that can select images based on keywords and iptc data. Would you know one that does?
@Ramon G Castaneda: I apologise for being an inexperienced forum visitor. I will take note of your advice and follow the posting instructions.
I checked FAQ's both here and at Adobe, as well as the knowledge base. No results. I also searched the forum.
My setup: MPB dual core Intel, 2GB RAM, 30GB free disk space. Adobe CS3, just updated to Bridge version 2.1.1.9. No improvement at all so far. According to Ann only CS4 will solve the problem.
Thank you. -
How do I upload an image using as3 and display it without a server?
Is it possible to upload an image using as3 and flash player 9 and then display it in a movie clip without server side assistance?
thanks,
JBHi,
Check out the links..
I hope it will helps u.
http://labs.findsubstance.com/2008/04/03/as3-upload-encode-images/
http://flexscript.wordpress.com/2009/01/12/uploading-an-image-into-flash-without-server-si de-script-using-flash-player-10/
Saransoft -
Jaxa xml tutorials, does anyone have some tutorial for using xml in java??
jaxa xml tutorials, does anyone have some tutorial for using xml in java??
can be dom,sax,jaxp whatever....
i try to find in google but din't find any complete one....dapim wrote:
jaxa xml tutorials, does anyone have some tutorial for using xml in java??
can be dom,sax,jaxp whatever....
i try to find in google but din't find any complete one....I would imagine anyone here would just produce the same set of hits that you did, so why waste our time doing it only to direct you to the same one(s) you already found and rejected. -
hi,
can anybody tell me in what scenarios we can use xml in java,jsp and servlets.
give some information and help on this..
regards,
javafandefine scenarios. You can use XML in java at any time you want.
- check out SAX http://java.sun.com/xml/tutorial_intro.html
- check out Xerces 2 http://xml.apache.org/xerces2-j/
Maybe you are looking for
-
Please help I keep getting this error message trying to save a photo in photoshop to return to lightroom
-
I would really like Apple to take notice of the number of "customers" who want to download in their own language, not the language of the country they are in. My Laptop was bought in England and my internet is an English provider. My bank account is
-
PDF Software causing problems in sending some PDF files but not all?
I have been having problems sending some emails with PDF attatchments, they are being returned more and more frequently. I've spoken to our server host and his answer is as follows saying that the problem is we are using "cheap PDF software" which i
-
When I used the transaction EA21 both the billing document & the invoice document got reversed. Is this a valid scenario ?? then after adjustment when i rebilled a new invoice document got genertaed which contains the old details as credit and the ne
-
I didn't try CC, but evidently not enough trial customers signed up. I got an email with this in it: We've reset our Creative Cloud free trial versions. We're notifying all Adobe Creative Cloud members that we've reset the clock on our product trials