Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7C9781757C for ; Mon, 27 Jul 2015 12:14:30 +0000 (UTC) Received: (qmail 47387 invoked by uid 500); 27 Jul 2015 12:14:30 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 47361 invoked by uid 500); 27 Jul 2015 12:14:30 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 47347 invoked by uid 99); 27 Jul 2015 12:14:30 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2015 12:14:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9F689190D3D for ; Mon, 27 Jul 2015 12:14:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.001 X-Spam-Level: * X-Spam-Status: No, score=1.001 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 3wulyB82j94c for ; Mon, 27 Jul 2015 12:14:20 +0000 (UTC) Received: from smtp4.objectstyle.com (smtp4.objectstyle.com [23.253.156.183]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id F29504C0ED for ; Mon, 27 Jul 2015 12:14:19 +0000 (UTC) Received: from [192.168.1.62] (unknown [212.98.191.4]) by smtp4.objectstyle.com (Postfix) with ESMTPSA id A4B65CC31D for ; Mon, 27 Jul 2015 12:14:45 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: Version API From: Andrus Adamchik In-Reply-To: <5AD2720C-07FB-4F7E-B704-50E470BEB1FA@earthlink.net> Date: Mon, 27 Jul 2015 15:13:47 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <6EFB733A-E660-495B-A778-9EEE59F1415C@earthlink.net> <701DD749-E181-4103-9C45-316FA2D5F720@objectstyle.org> <347D3453-E5A8-4942-87D0-ED2C5711254F@objectstyle.org> <5AD2720C-07FB-4F7E-B704-50E470BEB1FA@earthlink.net> To: user@cayenne.apache.org X-Mailer: Apple Mail (2.2102) No, I was answering your question. I thought you'd be able to figure it = out from the information that I shared already. But no worries, here are = more details: 1. Download cayenne-project.jar from = http://search.maven.org/#artifactdetails|org.apache.cayenne|cayenne-projec= t|4.0.M2|jar and add it to your dependencies. Or if you are using Maven, = simply include cayenne-project in your pom. 2. Add CayenneProjectModule to your runtime on startup. You are using = CayenneFilter, so that would look something like this: cayenne-project = org.apache.cayenne.configuration.web.CayenneFilter extra-modules = org.apache.cayenne.project.CayenneProjectModule= =20 This would ensure CayenneProjectModule is loaded. 3. Use the API: CayenneRuntime r =3D WebUtil.getCayenneRuntime(servletContext); ProjectUpgrader u =3D = r.getInjector().getInstance(ProjectUpgrader.class); String version =3D = u.getUpgradeHandler().getUpgradeMetaData().getSupportedVersion(); Andrus > On Jul 27, 2015, at 2:15 PM, Joe Baldwin = wrote: >=20 > Andrus, >=20 > I am really not following what you are trying to say. Let ask again: >=20 > 1. I am looking for an easy replacement to=20 >=20 >>>>> org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION >=20 > since it *appears* to be eliminated from your 4.0 API. >=20 > You then claim that there is a replacement in=20 >=20 >>>> Not sure in what context you are using that, but "cayenne-project" = DI module now has a service org.apache.cayenne.project.ProjectUpgrader = that gives you access to UpgradeHandler that gives you access to = UpgradeMetaData. UpgradeMetaData has the version supported by a given = runtime. >=20 >=20 > I could find none of these classes you mention in your online = documentation=20 >=20 > http://cayenne.apache.org/docs/4.0/api/index.html >=20 > So then you provide me with what appears to be a link to a Maven 4.0 = repository. >=20 > I am not sure how this is answering my question as to how to = programmatically obtain the current Cayenne project version from the = Cayenne runtime. Is it possible you don=E2=80=99t understand my = question? I am looking for a simple replacement for a runtime project = version, so I can print is on a webpage. This is a *simple* method call = I am looking for. >=20 >=20 >=20 >=20 >=20 >> On Jul 27, 2015, at 6:59 AM, Andrus Adamchik = wrote: >>=20 >> = http://search.maven.org/#artifactdetails|org.apache.cayenne|cayenne-projec= t|4.0.M2|jar >>=20 >> This has sources, javadocs, etc. >>=20 >>> On Jul 27, 2015, at 1:55 PM, Joe Baldwin = wrote: >>>=20 >>> I am looking for a simple replacement for version 3.0 API=20 >>>=20 >>>>> org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION >>>=20 >>>=20 >>> since it appears to be missing in 4.0. >>>=20 >>> I could find no reference to any of the classes you mention in your = 4.0 API. Do you have a url reference? >>>=20 >>>=20 >>>=20 >>>> On Jul 27, 2015, at 5:06 AM, Andrus Adamchik = wrote: >>>>=20 >>>> Not sure in what context you are using that, but "cayenne-project" = DI module now has a service org.apache.cayenne.project.ProjectUpgrader = that gives you access to UpgradeHandler that gives you access to = UpgradeMetaData. UpgradeMetaData has the version supported by a given = runtime. >>>>=20 >>>> Andrus >>>>=20 >>>>> On Jul 26, 2015, at 8:41 PM, Joe Baldwin = wrote: >>>>>=20 >>>>> Migration 3.0 =3D> 4.0 >>>>>=20 >>>>> org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION >>>>>=20 >>>>> appears to be no longer supported in 4.0. >>>>>=20 >>>>> Is there a substitute (as easy to access)? >>>>>=20 >>>>>=20 >>>>>=20 >>>>=20 >>>=20 >>>=20 >>=20 >=20 >=20