You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Joe Baldwin <jf...@earthlink.net> on 2015/07/26 19:41:03 UTC

Version API

Migration 3.0 => 4.0

	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION

appears to be no longer supported in 4.0.

Is there a substitute (as easy to access)?



Re: Version API

Posted by Mike Kienenberger <mk...@gmail.com>.
Moving to dev.

Ok.  I'll plan on making the change when I get a chance.

On Mon, Jul 27, 2015 at 10:50 AM, Andrus Adamchik
<an...@objectstyle.org> wrote:
>
>> On Jul 27, 2015, at 5:41 PM, Mike Kienenberger <mk...@gmail.com> wrote:
>>
>> Our jar MANIFEST file also contains:
>>
>> Bundle-Version: 4.0.0.M2
>
> Yeah, that's OSGi stuff.
>
>> But shouldn't we also be supplying this information as
>>
>> Implementation-Version: 4.0.0.M2
>
> Yeah, probably.
>
>
>> I'd guess that's a simple maven build change -- I know how to do it
>> under ant, but not under maven.
>
> "manifestEntries" property of maven-jar-plugin:
>
> https://maven.apache.org/plugins/maven-jar-plugin/examples/manifest-customization.html
>
> Andrus
>

Re: Version API

Posted by Andrus Adamchik <an...@objectstyle.org>.
> On Jul 27, 2015, at 5:41 PM, Mike Kienenberger <mk...@gmail.com> wrote:
> 
> Our jar MANIFEST file also contains:
> 
> Bundle-Version: 4.0.0.M2

Yeah, that's OSGi stuff.

> But shouldn't we also be supplying this information as
> 
> Implementation-Version: 4.0.0.M2

Yeah, probably.


> I'd guess that's a simple maven build change -- I know how to do it
> under ant, but not under maven.

"manifestEntries" property of maven-jar-plugin:

https://maven.apache.org/plugins/maven-jar-plugin/examples/manifest-customization.html

Andrus


Re: Version API

Posted by Andrus Adamchik <an...@objectstyle.org>.

> On Jul 29, 2015, at 5:08 PM, Mike Kienenberger <mk...@gmail.com> wrote:
> 
> On Wed, Jul 29, 2015 at 7:04 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>> (taking to dev)
>> 
>> Seems kind of pointless API to me.
> 
> It would at least be a redundant API if there's a standardized way of
> fetching the Implementation-Version field, which there is.

Mike, thanks for better explanation of what I was trying to say :) I actually check various third-party lib versions quite a lot in my own code, and it is important to be able to do it in a standardized way (by reading Maven properties of MANIFEST.MF). 

Andrus

Re: Version API

Posted by Mike Kienenberger <mk...@gmail.com>.
On Wed, Jul 29, 2015 at 7:04 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
> (taking to dev)
>
> Seems kind of pointless API to me.

It would at least be a redundant API if there's a standardized way of
fetching the Implementation-Version field, which there is.

Re: Version API

Posted by Andrus Adamchik <an...@objectstyle.org>.
(taking to dev)

Seems kind of pointless API to me.


> On Jul 29, 2015, at 1:56 PM, Michael Gentry <mg...@masslight.net> wrote:
> 
> Maybe we should add a Cayenne.getVersion() method?
> 
> 
> 
>> On Jul 27, 2015, at 10:41 AM, Mike Kienenberger <mk...@gmail.com> wrote:
>> 
>> Our jar MANIFEST file also contains:
>> 
>> Bundle-Version: 4.0.0.M2
>> 
>> But shouldn't we also be supplying this information as
>> 
>> Implementation-Version: 4.0.0.M2
>> 
>> so it's in a standardized place?
>> 
>> I'd guess that's a simple maven build change -- I know how to do it
>> under ant, but not under maven.
>> 
>> 
>> Once we do that, then we can use the standard java libraries to
>> provide the information:
>> 
>>       Object object = new CayenneRuntimeException();
>>       Package objPackage = object.getClass().getPackage();
>>       System.out.println("Implementation Version: " +
>> objPackage.getImplementationVersion());
>> 
>> produces
>> 
>> Implementation Version: 4.0.0.M2
>> 
>> when I add an Implementation-Version: line to the MANIFEST in
>> cayenne-server-4.0.M2.jar
>> 
>> =====
>>  Manifest-Version: 1.0
>> + Implementation-Version: 4.0.0.M2
>>  Export-Package: org.apache.cayenne;uses:="org.apache.cayenne.reflect,o
>> =====
>> 
>>> On Mon, Jul 27, 2015 at 9:57 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>> 
>>>> On Jul 27, 2015, at 4:21 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>> 
>>>> 1. My goal is to display the version of cayenne server jar I have added to the project with Cayenne 4.0.
>>> 
>>> As it happens, Project.CURRENT_PROJECT_VERSION (or its 4.0 alternative) is not the same as the version of cayenne server jar. It denotes the version of the XML mapping format, which does not align with the .jar version.
>>> 
>>> If you need the version of the jar, here is another approach. While you are not using Maven, Cayenne is assembled with Maven, so each Cayenne jar has some extra metadata that you get for free. Namely there's a "pom.properties" file that you can read and get the version:
>>> 
>>> Properties props = new Properties();
>>> String path = "META-INF/maven/org.apache.cayenne/cayenne-server/pom.properties";
>>> try(InputStream in : ObjectContext.class.getClassLoader().getResourceAsStream(path)) {
>>>  props.load(in);
>>> }
>>> 
>>> String version = props.getProperty("version");
>>> 
>>> Andrus
>>> 
>>> 
> 


Re: Version API

Posted by Michael Gentry <mg...@masslight.net>.
Maybe we should add a Cayenne.getVersion() method?



> On Jul 27, 2015, at 10:41 AM, Mike Kienenberger <mk...@gmail.com> wrote:
> 
> Our jar MANIFEST file also contains:
> 
> Bundle-Version: 4.0.0.M2
> 
> But shouldn't we also be supplying this information as
> 
> Implementation-Version: 4.0.0.M2
> 
> so it's in a standardized place?
> 
> I'd guess that's a simple maven build change -- I know how to do it
> under ant, but not under maven.
> 
> 
> Once we do that, then we can use the standard java libraries to
> provide the information:
> 
>        Object object = new CayenneRuntimeException();
>        Package objPackage = object.getClass().getPackage();
>        System.out.println("Implementation Version: " +
> objPackage.getImplementationVersion());
> 
> produces
> 
> Implementation Version: 4.0.0.M2
> 
> when I add an Implementation-Version: line to the MANIFEST in
> cayenne-server-4.0.M2.jar
> 
> =====
>   Manifest-Version: 1.0
> + Implementation-Version: 4.0.0.M2
>   Export-Package: org.apache.cayenne;uses:="org.apache.cayenne.reflect,o
> =====
> 
>> On Mon, Jul 27, 2015 at 9:57 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>> 
>>> On Jul 27, 2015, at 4:21 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>> 
>>> 1. My goal is to display the version of cayenne server jar I have added to the project with Cayenne 4.0.
>> 
>> As it happens, Project.CURRENT_PROJECT_VERSION (or its 4.0 alternative) is not the same as the version of cayenne server jar. It denotes the version of the XML mapping format, which does not align with the .jar version.
>> 
>> If you need the version of the jar, here is another approach. While you are not using Maven, Cayenne is assembled with Maven, so each Cayenne jar has some extra metadata that you get for free. Namely there's a "pom.properties" file that you can read and get the version:
>> 
>> Properties props = new Properties();
>> String path = "META-INF/maven/org.apache.cayenne/cayenne-server/pom.properties";
>> try(InputStream in : ObjectContext.class.getClassLoader().getResourceAsStream(path)) {
>>   props.load(in);
>> }
>> 
>> String version = props.getProperty("version");
>> 
>> Andrus
>> 
>> 

Re: Version API

Posted by Mike Kienenberger <mk...@gmail.com>.
Starting in 4.0.M3, you will be able to use

object.getClass().getPackage().getImplementationVersion() to get the
build version which will be stored in the jar's WEB-INF/MANIFEST.MF
where object can be any class in the jar.

I'm guessing something like ObjectContext.class will work in place of
"object.getClass()"   or you can set object to "new
CayenneRuntimeException()"



On Mon, Jul 27, 2015 at 10:41 AM, Mike Kienenberger <mk...@gmail.com> wrote:
> Our jar MANIFEST file also contains:
>
> Bundle-Version: 4.0.0.M2
>
> But shouldn't we also be supplying this information as
>
> Implementation-Version: 4.0.0.M2
>
> so it's in a standardized place?
>
> I'd guess that's a simple maven build change -- I know how to do it
> under ant, but not under maven.
>
>
> Once we do that, then we can use the standard java libraries to
> provide the information:
>
>         Object object = new CayenneRuntimeException();
>         Package objPackage = object.getClass().getPackage();
>         System.out.println("Implementation Version: " +
> objPackage.getImplementationVersion());
>
> produces
>
> Implementation Version: 4.0.0.M2
>
> when I add an Implementation-Version: line to the MANIFEST in
> cayenne-server-4.0.M2.jar
>
> =====
>    Manifest-Version: 1.0
> + Implementation-Version: 4.0.0.M2
>    Export-Package: org.apache.cayenne;uses:="org.apache.cayenne.reflect,o
> =====
>
> On Mon, Jul 27, 2015 at 9:57 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>
>>> On Jul 27, 2015, at 4:21 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>
>>> 1. My goal is to display the version of cayenne server jar I have added to the project with Cayenne 4.0.
>>
>> As it happens, Project.CURRENT_PROJECT_VERSION (or its 4.0 alternative) is not the same as the version of cayenne server jar. It denotes the version of the XML mapping format, which does not align with the .jar version.
>>
>> If you need the version of the jar, here is another approach. While you are not using Maven, Cayenne is assembled with Maven, so each Cayenne jar has some extra metadata that you get for free. Namely there's a "pom.properties" file that you can read and get the version:
>>
>> Properties props = new Properties();
>> String path = "META-INF/maven/org.apache.cayenne/cayenne-server/pom.properties";
>> try(InputStream in : ObjectContext.class.getClassLoader().getResourceAsStream(path)) {
>>    props.load(in);
>> }
>>
>> String version = props.getProperty("version");
>>
>> Andrus
>>
>>

Re: Version API

Posted by Mike Kienenberger <mk...@gmail.com>.
Our jar MANIFEST file also contains:

Bundle-Version: 4.0.0.M2

But shouldn't we also be supplying this information as

Implementation-Version: 4.0.0.M2

so it's in a standardized place?

I'd guess that's a simple maven build change -- I know how to do it
under ant, but not under maven.


Once we do that, then we can use the standard java libraries to
provide the information:

        Object object = new CayenneRuntimeException();
        Package objPackage = object.getClass().getPackage();
        System.out.println("Implementation Version: " +
objPackage.getImplementationVersion());

produces

Implementation Version: 4.0.0.M2

when I add an Implementation-Version: line to the MANIFEST in
cayenne-server-4.0.M2.jar

=====
   Manifest-Version: 1.0
+ Implementation-Version: 4.0.0.M2
   Export-Package: org.apache.cayenne;uses:="org.apache.cayenne.reflect,o
=====

On Mon, Jul 27, 2015 at 9:57 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>
>> On Jul 27, 2015, at 4:21 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>
>> 1. My goal is to display the version of cayenne server jar I have added to the project with Cayenne 4.0.
>
> As it happens, Project.CURRENT_PROJECT_VERSION (or its 4.0 alternative) is not the same as the version of cayenne server jar. It denotes the version of the XML mapping format, which does not align with the .jar version.
>
> If you need the version of the jar, here is another approach. While you are not using Maven, Cayenne is assembled with Maven, so each Cayenne jar has some extra metadata that you get for free. Namely there's a "pom.properties" file that you can read and get the version:
>
> Properties props = new Properties();
> String path = "META-INF/maven/org.apache.cayenne/cayenne-server/pom.properties";
> try(InputStream in : ObjectContext.class.getClassLoader().getResourceAsStream(path)) {
>    props.load(in);
> }
>
> String version = props.getProperty("version");
>
> Andrus
>
>

Re: Version API

Posted by Joe Baldwin <jf...@earthlink.net>.
The META-INF method is not as concise as the Project.CURRENT_PROJECT_VERSION method, but it appears to be more correct.  

You had a mistake in your code.  Here is the corrected version.

	Properties props = new Properties();
	String path = "META-INF/maven/org.apache.cayenne/cayenne-server/pom.properties";
	try(InputStream in = ObjectContext.class.getClassLoader().getResourceAsStream(path)) {
		props.load(in);
	}
	String cayenneServerVersion = props.getProperty("version");


This results in the string:

	4.0.M2

This is adequate for a system health-check, thanks.
Joe


> On Jul 27, 2015, at 9:57 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
> 
> 
>> On Jul 27, 2015, at 4:21 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>> 
>> 1. My goal is to display the version of cayenne server jar I have added to the project with Cayenne 4.0.
> 
> As it happens, Project.CURRENT_PROJECT_VERSION (or its 4.0 alternative) is not the same as the version of cayenne server jar. It denotes the version of the XML mapping format, which does not align with the .jar version. 
> 
> If you need the version of the jar, here is another approach. While you are not using Maven, Cayenne is assembled with Maven, so each Cayenne jar has some extra metadata that you get for free. Namely there's a "pom.properties" file that you can read and get the version:
> 
> Properties props = new Properties();
> String path = "META-INF/maven/org.apache.cayenne/cayenne-server/pom.properties";
> try(InputStream in : ObjectContext.class.getClassLoader().getResourceAsStream(path)) {
>   props.load(in);
> }
> 
> String version = props.getProperty("version");
> 
> Andrus
> 
> 


Re: Version API

Posted by Andrus Adamchik <an...@objectstyle.org>.
> On Jul 27, 2015, at 4:21 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> 
> 1. My goal is to display the version of cayenne server jar I have added to the project with Cayenne 4.0.

As it happens, Project.CURRENT_PROJECT_VERSION (or its 4.0 alternative) is not the same as the version of cayenne server jar. It denotes the version of the XML mapping format, which does not align with the .jar version. 

If you need the version of the jar, here is another approach. While you are not using Maven, Cayenne is assembled with Maven, so each Cayenne jar has some extra metadata that you get for free. Namely there's a "pom.properties" file that you can read and get the version:

Properties props = new Properties();
String path = "META-INF/maven/org.apache.cayenne/cayenne-server/pom.properties";
try(InputStream in : ObjectContext.class.getClassLoader().getResourceAsStream(path)) {
   props.load(in);
}

String version = props.getProperty("version");

Andrus



Re: Version API

Posted by Joe Baldwin <jf...@earthlink.net>.
> No, it wasn't. You are not reading my reply. 

Perhaps, but if that is true, then it is possible you were not reading my question as well.


1. My goal is to display the version of cayenne server jar I have added to the project with Cayenne 4.0.
2. With Cayenne 3.0 this was *easily* accomplished with 
>>>>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
3. I am doing this as part of a status to provide a *simple* visual verification of system health for my system administrator.
4. This definition is no longer available in 4.0/
5. If I understand your 3 or 4 emails, then I need to employ the use of an extension library in order to get the version of the cayenne-server.jar.  In addition, it appears to be part of a maven repository.
6. If that is correct then, what was a very simple query of the cayenne-server api version, has become a much more complex and convoluted procedure to determine.
7. If that is true (which it appears to be from your last email - detailing and additional filter, an addition jar file,etc), then the conclusion is that a “simple query of the jar version” (previously available in Cayenne 3.0) is no longer available.

If all that is true (which it appears to be), then there is no simple substitute for 3.0’s

>>>>>>>> org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION


in 4.0.

IMHO, your substitute may be a substitute, but it is not a simple query against the cayenne-server jar for the runtime version as it was in 3.0.  In addition, I have done an exhaustive search through the API to find a simple substitute but could find none. Therefore, I believe I do understand.

If you have a more 3.0 way of accomplishing this, please let me know. Otherwise, I would not use your example as a simple substitute.







> On Jul 27, 2015, at 8:35 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
> 
> No, it wasn't. You are not reading my reply. 
> 
> 
>> On Jul 27, 2015, at 3:25 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>> 
>> I am not using Maven. 
>> 
>> So it appears that the answer is that the version has been eliminated from the runtime.
>> 
>> Thanks anyway.
>> 
>> 
>> 
>>> On Jul 27, 2015, at 8:13 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>> 
>>> 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-project|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:
>>> 
>>> <filter>
>>> <filter-name>cayenne-project</filter-name>
>>>      <filter-class>org.apache.cayenne.configuration.web.CayenneFilter</filter-class>
>>>  <init-param>
>>>    <param-name>extra-modules</param-name>
>>>    <param-value>org.apache.cayenne.project.CayenneProjectModule</param-value>
>>>  </init-param>    
>>> </filter>
>>> 
>>> This would ensure CayenneProjectModule is loaded.
>>> 
>>> 3. Use the API:
>>> 
>>> CayenneRuntime r = WebUtil.getCayenneRuntime(servletContext);
>>> ProjectUpgrader u = r.getInjector().getInstance(ProjectUpgrader.class);
>>> String version = u.getUpgradeHandler().getUpgradeMetaData().getSupportedVersion();
>>> 
>>> Andrus
>>> 
>>> 
>>>> On Jul 27, 2015, at 2:15 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>> 
>>>> Andrus,
>>>> 
>>>> I am really not following what you are trying to say.  Let ask again:
>>>> 
>>>> 1. I am looking for an easy replacement to 
>>>> 
>>>>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>>> 
>>>> since it *appears* to be eliminated from your 4.0 API.
>>>> 
>>>> You then claim that there is a replacement in 
>>>> 
>>>>>>> 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.
>>>> 
>>>> 
>>>> I could find none of these classes you mention in your online documentation 
>>>> 
>>>> 	http://cayenne.apache.org/docs/4.0/api/index.html
>>>> 
>>>> So then you provide me with what appears to be a link to a Maven 4.0 repository.
>>>> 
>>>> 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’t 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.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On Jul 27, 2015, at 6:59 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>>>> 
>>>>> http://search.maven.org/#artifactdetails|org.apache.cayenne|cayenne-project|4.0.M2|jar
>>>>> 
>>>>> This has sources, javadocs, etc.
>>>>> 
>>>>>> On Jul 27, 2015, at 1:55 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>>>> 
>>>>>> I am looking for a simple replacement for version 3.0 API 
>>>>>> 
>>>>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>>>>> 
>>>>>> 
>>>>>> since it appears to be missing in 4.0.
>>>>>> 
>>>>>> I could find no reference to any of the classes you mention in your 4.0 API. Do you have a url reference?
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> On Jul 27, 2015, at 5:06 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>>>>>> 
>>>>>>> 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.
>>>>>>> 
>>>>>>> Andrus
>>>>>>> 
>>>>>>>> On Jul 26, 2015, at 8:41 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>>>>>> 
>>>>>>>> Migration 3.0 => 4.0
>>>>>>>> 
>>>>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>>>>>>> 
>>>>>>>> appears to be no longer supported in 4.0.
>>>>>>>> 
>>>>>>>> Is there a substitute (as easy to access)?
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
> 


Re: Version API

Posted by Andrus Adamchik <an...@objectstyle.org>.
No, it wasn't. You are not reading my reply. 


> On Jul 27, 2015, at 3:25 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> 
> I am not using Maven. 
> 
> So it appears that the answer is that the version has been eliminated from the runtime.
> 
> Thanks anyway.
> 
> 
> 
>> On Jul 27, 2015, at 8:13 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>> 
>> 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-project|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:
>> 
>> <filter>
>>  <filter-name>cayenne-project</filter-name>
>>       <filter-class>org.apache.cayenne.configuration.web.CayenneFilter</filter-class>
>>   <init-param>
>>     <param-name>extra-modules</param-name>
>>     <param-value>org.apache.cayenne.project.CayenneProjectModule</param-value>
>>   </init-param>    
>> </filter>
>> 
>> This would ensure CayenneProjectModule is loaded.
>> 
>> 3. Use the API:
>> 
>> CayenneRuntime r = WebUtil.getCayenneRuntime(servletContext);
>> ProjectUpgrader u = r.getInjector().getInstance(ProjectUpgrader.class);
>> String version = u.getUpgradeHandler().getUpgradeMetaData().getSupportedVersion();
>> 
>> Andrus
>> 
>> 
>>> On Jul 27, 2015, at 2:15 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>> 
>>> Andrus,
>>> 
>>> I am really not following what you are trying to say.  Let ask again:
>>> 
>>> 1. I am looking for an easy replacement to 
>>> 
>>>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>> 
>>> since it *appears* to be eliminated from your 4.0 API.
>>> 
>>> You then claim that there is a replacement in 
>>> 
>>>>>> 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.
>>> 
>>> 
>>> I could find none of these classes you mention in your online documentation 
>>> 
>>> 	http://cayenne.apache.org/docs/4.0/api/index.html
>>> 
>>> So then you provide me with what appears to be a link to a Maven 4.0 repository.
>>> 
>>> 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’t 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.
>>> 
>>> 
>>> 
>>> 
>>> 
>>>> On Jul 27, 2015, at 6:59 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>>> 
>>>> http://search.maven.org/#artifactdetails|org.apache.cayenne|cayenne-project|4.0.M2|jar
>>>> 
>>>> This has sources, javadocs, etc.
>>>> 
>>>>> On Jul 27, 2015, at 1:55 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>>> 
>>>>> I am looking for a simple replacement for version 3.0 API 
>>>>> 
>>>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>>>> 
>>>>> 
>>>>> since it appears to be missing in 4.0.
>>>>> 
>>>>> I could find no reference to any of the classes you mention in your 4.0 API. Do you have a url reference?
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Jul 27, 2015, at 5:06 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>>>>> 
>>>>>> 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.
>>>>>> 
>>>>>> Andrus
>>>>>> 
>>>>>>> On Jul 26, 2015, at 8:41 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>>>>> 
>>>>>>> Migration 3.0 => 4.0
>>>>>>> 
>>>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>>>>>> 
>>>>>>> appears to be no longer supported in 4.0.
>>>>>>> 
>>>>>>> Is there a substitute (as easy to access)?
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>> 
>>> 
>> 
> 
> 


Re: Version API

Posted by Joe Baldwin <jf...@earthlink.net>.
I am not using Maven. 

So it appears that the answer is that the version has been eliminated from the runtime.

Thanks anyway.



> On Jul 27, 2015, at 8:13 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
> 
> 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-project|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:
> 
> <filter>
>   <filter-name>cayenne-project</filter-name>
>        <filter-class>org.apache.cayenne.configuration.web.CayenneFilter</filter-class>
>    <init-param>
>      <param-name>extra-modules</param-name>
>      <param-value>org.apache.cayenne.project.CayenneProjectModule</param-value>
>    </init-param>    
>  </filter>
> 
> This would ensure CayenneProjectModule is loaded.
> 
> 3. Use the API:
> 
> CayenneRuntime r = WebUtil.getCayenneRuntime(servletContext);
> ProjectUpgrader u = r.getInjector().getInstance(ProjectUpgrader.class);
> String version = u.getUpgradeHandler().getUpgradeMetaData().getSupportedVersion();
> 
> Andrus
> 
> 
>> On Jul 27, 2015, at 2:15 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>> 
>> Andrus,
>> 
>> I am really not following what you are trying to say.  Let ask again:
>> 
>> 1. I am looking for an easy replacement to 
>> 
>>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>> 
>> since it *appears* to be eliminated from your 4.0 API.
>> 
>> You then claim that there is a replacement in 
>> 
>>>>> 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.
>> 
>> 
>> I could find none of these classes you mention in your online documentation 
>> 
>> 	http://cayenne.apache.org/docs/4.0/api/index.html
>> 
>> So then you provide me with what appears to be a link to a Maven 4.0 repository.
>> 
>> 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’t 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.
>> 
>> 
>> 
>> 
>> 
>>> On Jul 27, 2015, at 6:59 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>> 
>>> http://search.maven.org/#artifactdetails|org.apache.cayenne|cayenne-project|4.0.M2|jar
>>> 
>>> This has sources, javadocs, etc.
>>> 
>>>> On Jul 27, 2015, at 1:55 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>> 
>>>> I am looking for a simple replacement for version 3.0 API 
>>>> 
>>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>>> 
>>>> 
>>>> since it appears to be missing in 4.0.
>>>> 
>>>> I could find no reference to any of the classes you mention in your 4.0 API. Do you have a url reference?
>>>> 
>>>> 
>>>> 
>>>>> On Jul 27, 2015, at 5:06 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>>>> 
>>>>> 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.
>>>>> 
>>>>> Andrus
>>>>> 
>>>>>> On Jul 26, 2015, at 8:41 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>>>> 
>>>>>> Migration 3.0 => 4.0
>>>>>> 
>>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>>>>> 
>>>>>> appears to be no longer supported in 4.0.
>>>>>> 
>>>>>> Is there a substitute (as easy to access)?
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
> 


Re: Version API

Posted by Andrus Adamchik <an...@objectstyle.org>.
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-project|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:

<filter>
   <filter-name>cayenne-project</filter-name>
        <filter-class>org.apache.cayenne.configuration.web.CayenneFilter</filter-class>
    <init-param>
      <param-name>extra-modules</param-name>
      <param-value>org.apache.cayenne.project.CayenneProjectModule</param-value>
    </init-param>    
  </filter>

This would ensure CayenneProjectModule is loaded.

3. Use the API:

CayenneRuntime r = WebUtil.getCayenneRuntime(servletContext);
ProjectUpgrader u = r.getInjector().getInstance(ProjectUpgrader.class);
String version = u.getUpgradeHandler().getUpgradeMetaData().getSupportedVersion();

Andrus


> On Jul 27, 2015, at 2:15 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> 
> Andrus,
> 
> I am really not following what you are trying to say.  Let ask again:
> 
> 1. I am looking for an easy replacement to 
> 
>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
> 
> since it *appears* to be eliminated from your 4.0 API.
> 
> You then claim that there is a replacement in 
> 
>>>> 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.
> 
> 
> I could find none of these classes you mention in your online documentation 
> 
> 	http://cayenne.apache.org/docs/4.0/api/index.html
> 
> So then you provide me with what appears to be a link to a Maven 4.0 repository.
> 
> 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’t 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.
> 
> 
> 
> 
> 
>> On Jul 27, 2015, at 6:59 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>> 
>> http://search.maven.org/#artifactdetails|org.apache.cayenne|cayenne-project|4.0.M2|jar
>> 
>> This has sources, javadocs, etc.
>> 
>>> On Jul 27, 2015, at 1:55 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>> 
>>> I am looking for a simple replacement for version 3.0 API 
>>> 
>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>> 
>>> 
>>> since it appears to be missing in 4.0.
>>> 
>>> I could find no reference to any of the classes you mention in your 4.0 API. Do you have a url reference?
>>> 
>>> 
>>> 
>>>> On Jul 27, 2015, at 5:06 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>>> 
>>>> 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.
>>>> 
>>>> Andrus
>>>> 
>>>>> On Jul 26, 2015, at 8:41 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>>> 
>>>>> Migration 3.0 => 4.0
>>>>> 
>>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>>>> 
>>>>> appears to be no longer supported in 4.0.
>>>>> 
>>>>> Is there a substitute (as easy to access)?
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>> 
>>> 
>> 
> 
> 


Re: Version API

Posted by Joe Baldwin <jf...@earthlink.net>.
Andrus,

I am really not following what you are trying to say.  Let ask again:

1. I am looking for an easy replacement to 

>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION

since it *appears* to be eliminated from your 4.0 API.

You then claim that there is a replacement in 

>>> 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.


I could find none of these classes you mention in your online documentation 

	http://cayenne.apache.org/docs/4.0/api/index.html

So then you provide me with what appears to be a link to a Maven 4.0 repository.

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’t 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.





> On Jul 27, 2015, at 6:59 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
> 
> http://search.maven.org/#artifactdetails|org.apache.cayenne|cayenne-project|4.0.M2|jar
> 
> This has sources, javadocs, etc.
> 
>> On Jul 27, 2015, at 1:55 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>> 
>> I am looking for a simple replacement for version 3.0 API 
>> 
>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>> 
>> 
>> since it appears to be missing in 4.0.
>> 
>> I could find no reference to any of the classes you mention in your 4.0 API. Do you have a url reference?
>> 
>> 
>> 
>>> On Jul 27, 2015, at 5:06 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>> 
>>> 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.
>>> 
>>> Andrus
>>> 
>>>> On Jul 26, 2015, at 8:41 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>> 
>>>> Migration 3.0 => 4.0
>>>> 
>>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>>> 
>>>> appears to be no longer supported in 4.0.
>>>> 
>>>> Is there a substitute (as easy to access)?
>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
> 


Re: Version API

Posted by Andrus Adamchik <an...@objectstyle.org>.
http://search.maven.org/#artifactdetails|org.apache.cayenne|cayenne-project|4.0.M2|jar

This has sources, javadocs, etc.

> On Jul 27, 2015, at 1:55 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> 
> I am looking for a simple replacement for version 3.0 API 
> 
>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
> 
> 
> since it appears to be missing in 4.0.
> 
> I could find no reference to any of the classes you mention in your 4.0 API. Do you have a url reference?
> 
> 
> 
>> On Jul 27, 2015, at 5:06 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
>> 
>> 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.
>> 
>> Andrus
>> 
>>> On Jul 26, 2015, at 8:41 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>> 
>>> Migration 3.0 => 4.0
>>> 
>>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>>> 
>>> appears to be no longer supported in 4.0.
>>> 
>>> Is there a substitute (as easy to access)?
>>> 
>>> 
>>> 
>> 
> 
> 


Re: Version API

Posted by Joe Baldwin <jf...@earthlink.net>.
I am looking for a simple replacement for version 3.0 API 

>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION


since it appears to be missing in 4.0.

I could find no reference to any of the classes you mention in your 4.0 API. Do you have a url reference?



> On Jul 27, 2015, at 5:06 AM, Andrus Adamchik <an...@objectstyle.org> wrote:
> 
> 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.
> 
> Andrus
> 
>> On Jul 26, 2015, at 8:41 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>> 
>> Migration 3.0 => 4.0
>> 
>> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
>> 
>> appears to be no longer supported in 4.0.
>> 
>> Is there a substitute (as easy to access)?
>> 
>> 
>> 
> 


Re: Version API

Posted by Andrus Adamchik <an...@objectstyle.org>.
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.

Andrus

> On Jul 26, 2015, at 8:41 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> 
> Migration 3.0 => 4.0
> 
> 	org.apache.cayenne.project.Project.CURRENT_PROJECT_VERSION
> 
> appears to be no longer supported in 4.0.
> 
> Is there a substitute (as easy to access)?
> 
> 
>