Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4CC5510EF7 for ; Mon, 9 Dec 2013 06:18:17 +0000 (UTC) Received: (qmail 60526 invoked by uid 500); 9 Dec 2013 06:18:14 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 60155 invoked by uid 500); 9 Dec 2013 06:18:10 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 60148 invoked by uid 99); 9 Dec 2013 06:18:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Dec 2013 06:18:08 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Young.Li@morningstar.com designates 64.18.2.171 as permitted sender) Received: from [64.18.2.171] (HELO exprod7og109.obsmtp.com) (64.18.2.171) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Dec 2013 06:18:00 +0000 Received: from MSEXET81.morningstar.com ([216.228.224.45]) (using TLSv1) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKUqVggoPxRhWjA/LAgXucJn+uh7+VV2ZI@postini.com; Sun, 08 Dec 2013 22:17:39 PST Received: from MSEXCHM81.morningstar.com (172.28.13.41) by MSEXET81.morningstar.com (172.28.6.45) with Microsoft SMTP Server (TLS) id 14.3.158.1; Mon, 9 Dec 2013 00:17:37 -0600 Received: from MSEXCHM82.morningstar.com ([fe80::480c:4cff:6113:7a85]) by MSEXCHM81.morningstar.com ([fe80::b102:6618:6e80:4bb8%22]) with mapi id 14.03.0158.001; Mon, 9 Dec 2013 00:17:37 -0600 From: Young Li To: "dev@jackrabbit.apache.org" Subject: Question on Activity Thread-Topic: Question on Activity Thread-Index: Ac70pC5hR2Z28VMaTYS9yRQUsDXvkQ== Date: Mon, 9 Dec 2013 06:17:36 +0000 Message-ID: <4C35B2B259BF674686A72A1C5DA6E44A148DEA7D@MSEXCHM82.morningstar.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.86.17.232] Content-Type: multipart/alternative; boundary="_000_4C35B2B259BF674686A72A1C5DA6E44A148DEA7DMSEXCHM82mornin_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_4C35B2B259BF674686A72A1C5DA6E44A148DEA7DMSEXCHM82mornin_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Dear All, I am confused on the concept Activity in JCR. By the introduction of it, i= t uses to record some changes on the session and that could be used to reus= ed in other workspaces. I try to build a simple demo to check the function of Activity, but it fail= ed. Attaching my code here, please give me some guide. Thanks. //create a Activity node Node activity =3D vm.getActivity(); if (null =3D=3D activity) { activity =3D vm.createActivity("test_act_default_3333"); } System.out.println(activity.getUUID()); Node root =3D adminSession.getRootNode(); Node testNode =3D root.addNode("test"); testNode.addMixin("mix:versionable"); adminSession.save(); vm.setActivity(activity);//set activity and begin to record the cha= nges vm.checkout("/test"); testNode.addNode("test_sub1"); testNode.addNode("test_sub2"); adminSession.save(); vm.setActivity(null);// stop the activity and the activity should c= ontains the addition of two child nodes. vm.checkin("/test"); After above code, I try to reuse the activity in another workspace 'test'. Session test_session =3D rep.login(new SimpleCredentials("admin", "admin".toCharArray()), "test"); //Create a similar root node here Node root =3D test_session.getRootNode(); Node testNode =3D root.addNode("test"); testNode.addMixin("mix:versionable"); test_session.save(); VersionManagerImpl vm =3D (VersionManagerImpl)adminSession.getWorks= pace().getVersionManager(); String uuid_act =3D "6047919f-2740-426c-ba91-94c1cc60e4bd";//this i= s UUID of activity node previously created. Node activity_node =3D test_session.getNodeByUUID(uuid_act); NodeIterator nit =3D vm.merge(activity_node);//merge, but there is= no anything changes to be taken effect. It is really appreciated if any suggestion is received. Thanks. Best regards, Young --_000_4C35B2B259BF674686A72A1C5DA6E44A148DEA7DMSEXCHM82mornin_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Dear All,

 =

I am confused on the con= cept Activity in JCR.  By the introduction of it, it uses to record so= me changes on the session and that could be used to reused in other workspaces. 

 =

I try to build a simple = demo to check the function of Activity, but it failed.   Attachin= g my code here, please give me some guide.  Thanks.<= /p>

 =

    =      //create a Activity node=

Node activity =3D vm.getActivity();

        if (null =3D=3D activity) {

          =   activity =3D vm.createActivity("test_act_default= _3333");

        }

        System.= out.println(activity.getUUID());

        Node root =3D adminSession.getRootNode();<= /p>

        Node testNode =3D= root.addNode("test");

       

        testNode.addMixin= ("mix:versionable");

        adminSession.save();

       

        vm.setActivity(ac= tivity);//set activity and begin to record the changes

        vm.checkout("/test");

        testNode.addNode(= "test_sub1");

        testNode.addNode(= "test_sub2");

        adminSession.save();

        vm.setActivity(null);// stop the activity and the activity should contains the addition of two chi= ld nodes.

        vm.= checkin("/test");=

 

After above code, I try = to reuse the activity in another workspace ‘test’.

 =

Session test_session =3D rep.login(new SimpleCredentials("admin",

          =       "admin".toCharArray()), "test");

         //Create a similar root node here

         Node r= oot =3D test_session.getRootNode();

        Node testNode =3D root.addNode("test");

        testNode.addMixin= ("mix:versionable");

        test_session.save= ();

 

        VersionManagerImp= l vm =3D (VersionManagerImpl)adminSession.get= Workspace().getVersionManager();

        String uuid_act = =3D "6047919f-2740-426c-ba91-94c1cc60e4bd";//this is UUID of activity node previously created.

        Nod= e activity_node =3D test_session.getNodeByUUID(uuid_act);

       &nbs= p; NodeIterator nit =3D vm.merge(activity_node);//merge, but the= re is no anything changes to be taken effect.

 

It is really appreciated= if any suggestion is received.  Thanks.

 =

Best regards,=

 =

Young<= /p>

 

--_000_4C35B2B259BF674686A72A1C5DA6E44A148DEA7DMSEXCHM82mornin_--