[Jvending-development] Parsing the PAR file
Status: Alpha
Brought to you by:
random7
From: Isbell <ra...@wo...> - 2004-03-30 04:50:04
|
response inline: > -----Original Message----- > From: Rashmi Jain [mailto:b_r...@ya...] > Sent: Monday, March 29, 2004 2:08 PM > To: Isbell; jve...@li... > Subject: Re: [Jvending-development] provisioning.xml > > > Hi Shane! > > Few more questions/clarifications:- > > I made an attempt to parse the provisioning.xml file > and extracting provisioning.xml from PAR (zip file), I > used JAXP-SAX. > > (1) I also tried JAXB, it generated bunch of java > source files (about 40interfaces + implementations + > runtime classes), I still need to look how the JAXB > works and how it will be useful to us. Once you go through XML parsing Hell once or twice, you'll swear by JAXB. > (2) I used log4j, created a log4Config.xml - right now > I have just two appenders - console and fileappender. > Is this all right ?? Sounds good. > (2) To my understanding we'll be implementing the > interfaces/abstract classes provided in specification > - javax.provisioning, javax.provisioning.adapter, > javax.provisioning.matcher. Am I correct ? That is correct. > (3) For JAXP-SAX, I used Java Web Services developer > pack. Or should I be using AXIS and JAXP pack provided > by Sun. For now, it does not matter. I am not sure what the versioning differences are for JAXP-SAX between JWS and AXIS, but if there are problems, we can resolve them later. > (4) Please find attached herewith the Provisioning XSD > document, I have added some comments which I need to > take care while parsing. (can you please take a look > at it) To summarize action item includes: Ignore, > validate for uniqueness, validate for file existence, > store in db-table). I also need to work on creating a > table structure. I'll be using mySQL, do not have > access to oracle. We should not lose any information from provisioning.xml, even if it does not seem relevant. Persist everything to a DB or file system. BTW, you can download Oracle, if you want to play around with it. It is free for development purposes. > (5) I haven't yet looked at MMSClient uploaded on > project page, I'll do that. I have WTK21, Nokia > Devloper Suite MMS 1.1, JDK1.4. > > (6) For extracting information from PAR file, you > mentioned storing data in some object structure. I > extracted the file names(entries) and stored in > Arraylist. If file name is provisioning.xml, I simply > copied on to a different output xml file to parse > later. I am not sure if this is a good way to do it. For provisioning.xml, object structure should look something like: public interface Provisioning { public ClientBundle[] getClientBundles(); } public interface ClientBundle { public String getBundleType(); public String getDescriptorFile(); public VendorInfo getVendorInfo(); public DeviceRequirement getDeviceRequirement(); public CatalogProperty[] getCatalogProperties(); } and so on. As for the PAR file, an ArrayList sound okay for the prototype. I think we will get a better feel for what the API should look like after working the code a bit. > I am not sure if sourceforge mailing list allows > attachments. > > Thanks and Regards, > Rashmi > Sounds as though you are making some headway. I am still working on the JXTA interface. I will have something within the next week or two (schedule permitting), so we can integrate these two components. Have fun, Shane |