Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 48422 invoked from network); 23 Feb 2005 09:30:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Feb 2005 09:30:46 -0000 Received: (qmail 73003 invoked by uid 500); 23 Feb 2005 09:30:19 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 72900 invoked by uid 500); 23 Feb 2005 09:30:19 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 72853 invoked by uid 99); 23 Feb 2005 09:30:18 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 23 Feb 2005 01:30:18 -0800 Received: (qmail 48053 invoked by uid 65534); 23 Feb 2005 09:30:14 -0000 Message-ID: <20050223093014.48052.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Wed, 23 Feb 2005 09:30:14 -0000 Subject: svn commit: r154990 - in cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples: pb/ pb/xsp/ pb/xsp/demo1.xsp welcome.xml To: cvs@cocoon.apache.org From: antonio@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: antonio Date: Wed Feb 23 01:30:12 2005 New Revision: 154990 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D154990 Log: Add XSP sample for PersistenceBroker Added: cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples/pb/ cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples/pb/xsp/ cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples/pb/xsp/demo1.xsp Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples/welcome.xml Added: cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples/pb/xsp/demo1.xsp URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/= ojb/samples/pb/xsp/demo1.xsp?view=3Dauto&rev=3D154990 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples/pb/xsp/demo1.xsp (a= dded) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples/pb/xsp/demo1.xsp We= d Feb 23 01:30:12 2005 @@ -0,0 +1,79 @@ + + + + + + + + + org.apache.cocoon.ojb.broker.components.PBFactory + org.apache.cocoon.ojb.samples.bean.Department + org.apache.ojb.broker.PersistenceBroker + + + + PBFactory pbFactory =3D null; + PersistenceBroker pb =3D null; + Department bean =3D new Department(); + String s; + + + + + Hello OJB + This is my first Cocoon page with OJB using Persistence = Broker! + + try { + /* Get the PersistenceManager */ + try { + pbFactory =3D (PBFactory)manager.lookup(PBFactory.ROLE= ); + pb =3D pbFactory.defaultPersistenceBroker(); + } catch (ComponentException cme) { + getLogger().error("Could not look up the PB Factory", cme); + } + + bean.setId(8); + bean.setName("Apache OJB-PB Development"); + + pb.beginTransaction(); + + pb.commitTransaction(); + s =3D bean.getId() + " : " + bean.getName(); + +

Inserted data: s +

+ + } finally { + if (pb !=3D null && !pb.isClosed()) { + if (pb.isInTransaction()) { + pb.abortTransaction(); + } + pb.close(); + } + manager.release(pbFactory); + } + +
+
+
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples/welcome.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/= ojb/samples/welcome.xml?view=3Ddiff&r1=3D154989&r2=3D154990 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples/welcome.xml (origin= al) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/samples/welcome.xml Wed Feb= 23 01:30:12 2005 @@ -53,7 +53,7 @@ Low-level API that can be used directly by applications that don't n= eed full fledged object level transactions. - Sample using JDO in a XSP page. To be d= one. + Sample using JDO in a XSP pag= e=2E Sample using Cocoon Forms Bind= ing. To be done. Sample using JXForms. To be done.