[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Updating / replacing the content of a Container



Thanks for the hint Lars,

Do you have a simple usage example of XUpdate or a pointer to where i could
find out more?

Best regards,
Per

> What about XUpdate? Ozone already supports the XUpdate specification.
> Simple create an XUpdate string with your new content and perfom the
> update method.
>
> Lars
>
> >     public void setContentAsDOM( Node content ) throws XMLDBException {
> >         ExternalTransaction tx = database.newTransaction();
> >         try {
> >             if (content == null) {
> >                 throw new XMLDBException(ErrorCodes.INVALID_RESOURCE);
> >             }
> >             if (content instanceof Document) {
> >                 tx.begin();
> >                 container.storeDOM((Document)content);
> > 				//container is an XMLContainer
> >                 tx.commit();
> >             }
> >             else {
> >                 throw new XMLDBException(ErrorCodes.VENDOR_ERROR,"NOT
> > IMPLEMENTED -
> > 			Cannot store Nodes right now, must be a Document");
> >             }
> >         }
> >         catch (Exception e) {
> >             try {
> >                 if (tx.getStatus() == tx.STATUS_ACTIVE)
> >                     tx.rollback();
> >                 throw new XMLDBException( ErrorCodes.VENDOR_ERROR,
> > 				e.getMessage());
> >             }
> >             catch (Exception rollbackException) {
> >                 throw new XMLDBException(ErrorCodes.VENDOR_ERROR,
> > 				rollbackException.getMessage());
> >             }
> >         }
> >     }
> >
> > Hope this clarifies it.
> >
> > Best regards,
> > Per
> --
> ______________________________________________________________________
> Lars Martin                                    mailto:lars@smb-tec.com
> SMB GmbH                                        http://www.smb-tec.com
>
> ----------------------------------------------------------------------
> Post a message:         mailto:ozone-dev@ozone-db.org
> Unsubscribe:
mailto:ozone-dev-request@ozone-db.org?body=unsubscribe
Contact adminstrator:   mailto:ozone-dev-owner@ozone-db.org
Read archived messages: http://www.ozone-db.org/
----------------------------------------------------------------------

----------------------------------------------------------------------
Post a message:         mailto:ozone-dev@ozone-db.org
Unsubscribe:            mailto:ozone-dev-request@ozone-db.org?body=unsubscribe
Contact adminstrator:   mailto:ozone-dev-owner@ozone-db.org
Read archived messages: http://www.ozone-db.org/
----------------------------------------------------------------------