Hi,
just an short question regarding XML Database support. any processor for Berkley db xml available or developed by anyone outside? thanks, alex -- ---------------------------------------------------- TANNER AG Alexander Witzigmann Kemptener Strasse 99 D-88131 Lindau Germany tel +49(0)8382/272-142 fax +49(0)8382/272-900 mailto:[hidden email] http://www.tanner.de ---------------------------------------------------- The ultimate function of prophecy is not to tell the future, but to make it. Your successful past will block your visions of the future. -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
We haven't at Orbeon, but we support Tamino and eXist. It shouldn't be
too difficult for somebody to implement support for Berkeley. -Erik Alexander Witzigmann wrote: > Hi, > > just an short question regarding XML Database support. any processor for > Berkley db xml available or developed by anyone outside? > > thanks, > > alex -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Alexander Witzigmann
Hi,
Enclosed is a processor I use for a particular app I have that uses Berkeley DB XML. Cheers, Matthew Alexander Witzigmann wrote: > Hi, > > just an short question regarding XML Database support. any processor > for Berkley db xml available or developed by anyone outside? > > thanks, > > alex > >------------------------------------------------------------------------ > > >-- >You receive this message as a subscriber of the [hidden email] mailing list. >To unsubscribe: mailto:[hidden email] >For general help: mailto:[hidden email]?subject=help >ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > /** * DBXMLStoreHandler.java * Author: Matthew Graham (Caltech) * Version: Original (0.1) - 22 December 2005 */ package nvo.caltech.voeventnet.nexus; import com.sleepycat.db.DatabaseException; import com.sleepycat.db.Environment; import com.sleepycat.db.EnvironmentConfig; import com.sleepycat.dbxml.XmlContainer; import com.sleepycat.dbxml.XmlDocument; import com.sleepycat.dbxml.XmlException; import com.sleepycat.dbxml.XmlManager; import com.sleepycat.dbxml.XmlManagerConfig; import com.sleepycat.dbxml.XmlQueryContext; import com.sleepycat.dbxml.XmlUpdateContext; import com.sleepycat.dbxml.XmlResults; import com.sleepycat.dbxml.XmlValue; import org.dom4j.*; import edu.jhu.htm.core.*; import org.apache.log4j.*; import java.net.*; import java.io.*; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.ResourceBundle; /** * This class handles the store for VOEvent packets */ public class DBXMLStoreHandler implements StoreHandler { ResourceBundle props; Environment dbEnv = null; XmlManager dbManager = null; XmlContainer eventContainer = null; XmlContainer htmIdContainer = null; XmlUpdateContext context; XmlQueryContext queryContext; // Define static logger for this class static Logger log = Logger.getLogger(DBXMLStoreHandler.class); /* * Construct a basic StoreHandler: load the properties file and * initialize the db */ public DBXMLStoreHandler(String propFile) { try { props = ResourceBundle.getBundle(propFile); // Set logging properties PropertyConfigurator.configure(props.getString("log.properties")); EnvironmentConfig envConf = new EnvironmentConfig(); envConf.setAllowCreate(true); envConf.setInitializeCache(true); //envConf.setInitializeLocking(true); //envConf.setInitializeLogging(true); //envConf.setTransactional(true); dbEnv = new Environment(new File(props.getString("db.env.home")), envConf); // Get a manager XmlManagerConfig managerConfig = new XmlManagerConfig(); managerConfig.setAdoptEnvironment(true); //managerConfig.setAllowAutoOpen(true); dbManager = new XmlManager(dbEnv, managerConfig); // Open voevents container dbManager.setDefaultContainerType(XmlContainer.NodeContainer); eventContainer = dbManager.openContainer("voevents.dbxml"); htmIdContainer = dbManager.openContainer("htmids.dbxml"); // Get an update context context = dbManager.createUpdateContext(); // Get a query context queryContext = dbManager.createQueryContext(); // Assign namespaces queryContext.setNamespace("jab", "http://jabber.org/protocol/pubsub#event"); queryContext.setNamespace("vo", "http://www.ivoa.net/xml/VOEvent/v1.0"); queryContext.setNamespace("stc", "http://www.ivoa.net/xml/STC/stc-v1.20.xsd"); queryContext.setNamespace("crd", "http://www.ivoa.net/xml/STC/STCcoords/v1.20"); } catch (Exception e) { e.printStackTrace(System.err); close(); } } /* * Apply the specified query against the store */ public Document query(String query) { XmlResults xmlResults = null; Document results = null; try { results = DocumentFactory.getInstance().createDocument(); Element root = results.addElement("events"); xmlResults = dbManager.query(query, queryContext); if (xmlResults.size() == 0) { root.addText("No packets found"); } else { XmlValue value; while ((value = xmlResults.next()) != null) { Document result = DocumentHelper.parseText(value.asDocument().getContentAsString()); root.add(result.getRootElement()); } } } catch (Exception e) { e.printStackTrace(System.err); close(); } return results; } /* * Store the specified packet */ public void storePacket(String packet) { try { VOEventPacket event = new VOEventPacket(packet); // Store packet and htmId context = dbManager.createUpdateContext(); eventContainer.putDocument(event.getId(), packet, context); htmIdContainer.putDocument(event.getId(), event.getHtmIdAsXML(), context); } catch (Exception e) { e.printStackTrace(System.err); close(); } } /* * Store the specified packet */ public void storePacket(VOEventPacket event) { try { // Store packet and htmId eventContainer.putDocument(event.getId(), event.toString(), context); htmIdContainer.putDocument(event.getId(), event.getHtmIdAsXML(), context); } catch (Exception e) { e.printStackTrace(System.err); close(); } } /* * Check whether a packet is already stored */ public boolean packetIsStored(String eventId) { boolean isStored = false; try { //String idQuery = "exists(doc('dbxml:voevents.dbxml/" + eventId + "')/vo:VOEvent)"; String idQuery = "exists(collection('events.dbxml')/*[dbxml:metadata('dbxml:name']='" + eventId + "'])"; XmlResults result = dbManager.query(idQuery, queryContext); isStored = result.next().asBoolean(); /* XmlDocument packet = eventContainer.getDocument(eventId); if (packet != null) isStored = true; } catch (XmlException xe) { if (xe.getErrorCode() == XmlException.DOCUMENT_NOT_FOUND) { isStored = false; } */ } catch (Exception e) { e.printStackTrace(System.err); close(); } return isStored; } /* * Return the specified packet as a String */ public String getPacketAsString(String eventId) throws StoreHandlerException { String asString = null; try { XmlDocument packet = eventContainer.getDocument(eventId); asString = packet.getContentAsString(); } catch (XmlException xe) { if (xe.getErrorCode() == XmlException.DOCUMENT_NOT_FOUND) { throw new StoreHandlerException(StoreHandlerException.DOCUMENT_NOT_FOUND); } else { xe.printStackTrace(System.err); } } catch (Exception e) { e.printStackTrace(System.err); close(); } return asString; } /* * Close the store */ public void close() { try { if (eventContainer != null) { eventContainer.close(); } if (htmIdContainer != null) { htmIdContainer.close(); } if (dbManager != null) { dbManager.close(); } } catch (Exception e) { e.printStackTrace(System.err); } } public static void main(String[] args) { StoreHandler sh = new DBXMLStoreHandler("store.properties"); try { BufferedReader in = new BufferedReader(new FileReader(args[0])); StringBuffer sbuf = new StringBuffer(); String line; while ((line = in.readLine()) != null) { sbuf.append(line); } sh.storePacket(sbuf.toString()); sh.close(); } catch (Exception e) { e.printStackTrace(System.err); } } } -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Thanks, Matthew. Can you precise under what license you are making this
code available, so that people know that they can do with it, if anything? Thanks, -Erik Matthew Graham wrote: > Hi, > > Enclosed is a processor I use for a particular app I have that uses > Berkeley DB XML. > > Cheers, > > Matthew > > Alexander Witzigmann wrote: > >> Hi, >> >> just an short question regarding XML Database support. any processor >> for Berkley db xml available or developed by anyone outside? >> >> thanks, >> >> alex -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi,
Do with it as you want. I actually use a factory class to instantiate instances of the class and have a normal processor that passes calls to the class I gave which handles the db stuff. Cheers, Matthew Erik Bruchez wrote: > Thanks, Matthew. Can you precise under what license you are making > this code available, so that people know that they can do with it, if > anything? > > Thanks, > > -Erik > > Matthew Graham wrote: > >> Hi, >> >> Enclosed is a processor I use for a particular app I have that uses >> Berkeley DB XML. >> >> Cheers, >> >> Matthew >> >> Alexander Witzigmann wrote: >> >>> Hi, >>> >>> just an short question regarding XML Database support. any processor >>> for Berkley db xml available or developed by anyone outside? >>> >>> thanks, >>> >>> alex >> > > >------------------------------------------------------------------------ > > >-- >You receive this message as a subscriber of the [hidden email] mailing list. >To unsubscribe: mailto:[hidden email] >For general help: mailto:[hidden email]?subject=help >ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
alex Matthew Graham wrote: Hi, -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Alexander Witzigmann
Alex:
I'm currenty working on an BDB-XML processor. It's still quite specific to my apps but I expect to do extensive work on this in the next 2-3 month and have a generic version available (will be LGPL license). Just saw Matt's post and am quite curious to check his implementatio :-) I like eXist but BDB-XML's performs much better on large databases. What do you plan to use it for and what time frame are you looking at? cheers *P Alexander Witzigmann wrote: Hi, -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
hi pascal,
we're intent to develop a terminology management system. BDB-XML is used as storage backend for quite complex term model, orbeon is used for all transformation pipes and I/O processes. transformations in our context means transform matching terms into different output formats (excel, TBX, Trados,....) and via versa. we're currently in system design phase and implementation must start within next few weeks. we did lots of investigation in BDB-XML and the results are very promising in terms of functional / performance scalability (txn handling, multi user handling) --alexPascal Heus wrote: Alex: -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |