You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@devicemap.apache.org by Reza <re...@yahoo.com> on 2013/05/07 15:52:53 UTC

DeviceMap Java API

So I spent some time last night working with the DeviceMap Java API. Good news is that I was able to get everything working as needed. My next step is finish up a few web pages and have a fully functioning "demo" site. Hopefully this will be done and ready in the next week or two.

That being said, I would like focus more on the Java API next. Here are some issues I found which I think can be addressed (mostly maven related):

-The oddr package is empty: https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/openddr/simpleapi/oddr/. The example here makes use of oddr: https://github.com/OpenDDRdotORG/OpenDDR-Java. So this needs to be rectified and/or the example needs to be updated.

-We have a maven project for the DeviceMap resources (https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/data/) but the Java API cannot load resources from a jar source. I havent looked deeply at the code, but this is fixable. If this functionality exists today, please guide me in the right direction.

-Make the project "zero configuration", or close to it. I would like to simply add 2 dependencies to my POM and then add 5-10 lines of code and be done. I think this is possible. The dependencies would be DeviceMap data (resources) and the DeviceMap Java API. We could even make a version of the data called LATEST which would always pull our latest DDR. This way you get the latest devices on every compile (if you choose).

-Streamline the Java API. Once I get the structural changes completed, I would like to begin work on maybe making the API a bit more streamlined and more accurate. A few ideas have been tossed around for this, so I will leave this as the last task. Some of the steps above will accomplish part of this task.

Thoughts?

thanks,
Reza

Re: DeviceMap Java API

Posted by Werner Keil <we...@gmail.com>.
Yep, it's here:
https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/apache/devicemap/simpleddr/

Did you try that one?

I was under the impression, SVN also purges empty folders, so maybe
Bertrand or other committers simply missed the final commit after a delete,
only CVS and SCM from a similar era are known to keep all old directories
at least in an "attic" form, in SVN it should not be necessary to leave an
empty folder, and ideally the  OpenDDR variant or anything we'd like to
experiment shall be on a special branch first, and only be committed into
trunk if it's stable (i.E. passing Unit Tests, assume we have some, a CI
server like Jenkins should be within reach, too, maybe we can have a chat
with Steve, Sacha or other CloudBees reps who come to Zurich next week?[?])

Werner

On Tue, May 7, 2013 at 3:56 PM, Werner Keil <we...@gmail.com> wrote:

> Reza/all,
>
> I remember Bertrand (I believe it was him) said he refactored the package
> namespace so org/openddr/simpleapi/oddr/<https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/openddr/simpleapi/oddr/>.
> should be found elsewhere under something like
> org/apache/devicemap/simpleapi/ddr/<https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/openddr/simpleapi/oddr/>.
> (just guessing, that's probably not the actual package) does anybody know
> where those classes went??
>
> Werner
>
> On Tue, May 7, 2013 at 3:52 PM, Reza <re...@yahoo.com> wrote:
>
>> So I spent some time last night working with the DeviceMap Java API. Good
>> news is that I was able to get everything working as needed. My next step
>> is finish up a few web pages and have a fully functioning "demo" site.
>> Hopefully this will be done and ready in the next week or two.
>>
>> That being said, I would like focus more on the Java API next. Here are
>> some issues I found which I think can be addressed (mostly maven related):
>>
>> -The oddr package is empty:
>> https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/openddr/simpleapi/oddr/.
>> The example here makes use of oddr:
>> https://github.com/OpenDDRdotORG/OpenDDR-Java. So this needs to be
>> rectified and/or the example needs to be updated.
>>
>> -We have a maven project for the DeviceMap resources (
>> https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/data/) but
>> the Java API cannot load resources from a jar source. I havent looked
>> deeply at the code, but this is fixable. If this functionality exists
>> today, please guide me in the right direction.
>>
>> -Make the project "zero configuration", or close to it. I would like to
>> simply add 2 dependencies to my POM and then add 5-10 lines of code and be
>> done. I think this is possible. The dependencies would be DeviceMap data
>> (resources) and the DeviceMap Java API. We could even make a version of the
>> data called LATEST which would always pull our latest DDR. This way you get
>> the latest devices on every compile (if you choose).
>>
>> -Streamline the Java API. Once I get the structural changes completed, I
>> would like to begin work on maybe making the API a bit more streamlined and
>> more accurate. A few ideas have been tossed around for this, so I will
>> leave this as the last task. Some of the steps above will accomplish part
>> of this task.
>>
>> Thoughts?
>>
>> thanks,
>> Reza
>
>
>
>

Re: DeviceMap Java API

Posted by Reza <re...@yahoo.com>.
Does this project have an example Java J2EE web application which uses the latest DeviceMap Java API? I was using the old OpenDDR API as my guide which may explain the oddr issue. If we dont, I can check in my REST service app and use that as a start.


________________________________
 From: Werner Keil <we...@gmail.com>
To: devicemap-dev@incubator.apache.org; Reza <re...@yahoo.com> 
Sent: Tuesday, May 7, 2013 9:56 AM
Subject: Re: DeviceMap Java API
 

Reza/all,

I remember Bertrand (I believe it was him) said he refactored the package
namespace so org/openddr/simpleapi/oddr/<https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/openddr/simpleapi/oddr/>.
should be found elsewhere under something like
org/apache/devicemap/simpleapi/ddr/<https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/openddr/simpleapi/oddr/>.
(just guessing, that's probably not the actual package) does anybody know
where those classes went??

Werner

On Tue, May 7, 2013 at 3:52 PM, Reza <re...@yahoo.com> wrote:

> So I spent some time last night working with the DeviceMap Java API. Good
> news is that I was able to get everything working as needed. My next step
> is finish up a few web pages and have a fully functioning "demo" site.
> Hopefully this will be done and ready in the next week or two.
>
> That being said, I would like focus more on the Java API next. Here are
> some issues I found which I think can be addressed (mostly maven related):
>
> -The oddr package is empty:
> https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/openddr/simpleapi/oddr/.
> The example here makes use of oddr:
> https://github.com/OpenDDRdotORG/OpenDDR-Java. So this needs to be
> rectified and/or the example needs to be updated.
>
> -We have a maven project for the DeviceMap resources (
> https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/data/) but
> the Java API cannot load resources from a jar source. I havent looked
> deeply at the code, but this is fixable. If this functionality exists
> today, please guide me in the right direction.
>
> -Make the project "zero configuration", or close to it. I would like to
> simply add 2 dependencies to my POM and then add 5-10 lines of code and be
> done. I think this is possible. The dependencies would be DeviceMap data
> (resources) and the DeviceMap Java API. We could even make a version of the
> data called LATEST which would always pull our latest DDR. This way you get
> the latest devices on every compile (if you choose).
>
> -Streamline the Java API. Once I get the structural changes completed, I
> would like to begin work on maybe making the API a bit more streamlined and
> more accurate. A few ideas have been tossed around for this, so I will
> leave this as the last task. Some of the steps above will accomplish part
> of this task.
>
> Thoughts?
>
> thanks,
> Reza

Re: DeviceMap Java API

Posted by Werner Keil <we...@gmail.com>.
Reza/all,

I remember Bertrand (I believe it was him) said he refactored the package
namespace so org/openddr/simpleapi/oddr/<https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/openddr/simpleapi/oddr/>.
should be found elsewhere under something like
org/apache/devicemap/simpleapi/ddr/<https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/openddr/simpleapi/oddr/>.
(just guessing, that's probably not the actual package) does anybody know
where those classes went??

Werner

On Tue, May 7, 2013 at 3:52 PM, Reza <re...@yahoo.com> wrote:

> So I spent some time last night working with the DeviceMap Java API. Good
> news is that I was able to get everything working as needed. My next step
> is finish up a few web pages and have a fully functioning "demo" site.
> Hopefully this will be done and ready in the next week or two.
>
> That being said, I would like focus more on the Java API next. Here are
> some issues I found which I think can be addressed (mostly maven related):
>
> -The oddr package is empty:
> https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/java/src/main/java/org/openddr/simpleapi/oddr/.
> The example here makes use of oddr:
> https://github.com/OpenDDRdotORG/OpenDDR-Java. So this needs to be
> rectified and/or the example needs to be updated.
>
> -We have a maven project for the DeviceMap resources (
> https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/data/) but
> the Java API cannot load resources from a jar source. I havent looked
> deeply at the code, but this is fixable. If this functionality exists
> today, please guide me in the right direction.
>
> -Make the project "zero configuration", or close to it. I would like to
> simply add 2 dependencies to my POM and then add 5-10 lines of code and be
> done. I think this is possible. The dependencies would be DeviceMap data
> (resources) and the DeviceMap Java API. We could even make a version of the
> data called LATEST which would always pull our latest DDR. This way you get
> the latest devices on every compile (if you choose).
>
> -Streamline the Java API. Once I get the structural changes completed, I
> would like to begin work on maybe making the API a bit more streamlined and
> more accurate. A few ideas have been tossed around for this, so I will
> leave this as the last task. Some of the steps above will accomplish part
> of this task.
>
> Thoughts?
>
> thanks,
> Reza

Re: DeviceMap Java API

Posted by Werner Keil <we...@gmail.com>.
Sure, if we have something stable and create branches or tags based on
that, it isn't necessarily bad, if the trunk was considered "nightly" or in
progress[?]

On Tue, May 7, 2013 at 6:51 PM, Andrew Savory <as...@apache.org> wrote:

> Hi,
>
> On 7 May 2013 14:52, Reza <re...@yahoo.com> wrote:
>
> > So I spent some time last night working with the DeviceMap Java API. Good
> > news is that I was able to get everything working as needed. My next step
> > is finish up a few web pages and have a fully functioning "demo" site.
> > Hopefully this will be done and ready in the next week or two.
> >
>
> Great stuff! And remember: don't be afraid to commit early (and often);
> buggy prerelease code can be great for building contributions and community
> ;-)
>
>
> Thanks,
>
> Andrew.
>
> > --
>
> > asavory@apache.org / contact@andrewsavory.com
> http://www.andrewsavory.com/
>

Re: DeviceMap Java API

Posted by Andrew Savory <as...@apache.org>.
Hi,

On 7 May 2013 14:52, Reza <re...@yahoo.com> wrote:

> So I spent some time last night working with the DeviceMap Java API. Good
> news is that I was able to get everything working as needed. My next step
> is finish up a few web pages and have a fully functioning "demo" site.
> Hopefully this will be done and ready in the next week or two.
>

Great stuff! And remember: don't be afraid to commit early (and often);
buggy prerelease code can be great for building contributions and community
;-)


Thanks,

Andrew.

> --

> asavory@apache.org / contact@andrewsavory.com
http://www.andrewsavory.com/

Re: DeviceMap Java API

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Tue, May 7, 2013 at 4:50 PM, Reza <re...@yahoo.com> wrote:
>
> So it looks like our site and/or example is kind of bare bone and empty at the moment. So I think my demo site and Java
> service will be a good start. Right now they are separate J2EE applications using client side Javascript to call the
> Java DeviceMap service...

Yes, and if we can use your code directly as examples that's a plus
IMO, we can just add an overview page on the website and point to the
code via svn URLs.

In this way, the examples stay up to date, assuming we use that code.

IOW, make it pretty ;-)

-Bertrand

Re: DeviceMap Java API

Posted by Reza <re...@yahoo.com>.
http://svn.apache.org/repos/asf/incubator/devicemap/site/trunk/ 


So it looks like our site and/or example is kind of bare bone and empty at the moment. So I think my demo site and Java service will be a good start. Right now they are separate J2EE applications using client side Javascript to call the Java DeviceMap service. Looking forward to getting it online on our dev server. I will keep everyone posted.


________________________________
 From: Bertrand Delacretaz <bd...@apache.org>
To: devicemap-dev@incubator.apache.org 
Sent: Tuesday, May 7, 2013 10:13 AM
Subject: Re: DeviceMap Java API
 

Hi,

On Tue, May 7, 2013 at 3:52 PM, Reza <re...@yahoo.com> wrote:
> -The oddr package is empty...

Yeah, I forgot to remove that folder after moving the java classes to
the org.apache.devicemap package - fixed in
http://svn.apache.org/r1479913

> ...The example here makes use of oddr: https://github.com/OpenDDRdotORG/OpenDDR-Java.
> So this needs to be rectified and/or the example needs to be updated....

That's an OpenDDR example, we should have our own under
http://incubator.apache.org/devicemap/ (which can be edited from
https://cms.apache.org/devicemap/ and/or
http://svn.apache.org/repos/asf/incubator/devicemap/site/trunk/ )

>
> -We have a maven project for the DeviceMap resources (https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/data/) but
> the Java API cannot load resources from a jar source. I havent looked deeply at the code, but this is fixable. If this
> functionality exists today, please guide me in the right direction....

It doesn't exist, you're correct - currently the tests under
openddr/java use the maven-dependency-plugin to unpack the
dependencies under target/devicemap, but you're right that loading
data directly from a jar would be more convenient.

>
> -Make the project "zero configuration", or close to it. I would like to simply add 2 dependencies to my POM
> and then add 5-10 lines of code and be done. I think this is possible. The dependencies would be DeviceMap
> data (resources) and the DeviceMap Java API. We could even make a version of the data called LATEST
> which would always pull our latest DDR. This way you get the latest devices on every compile (if you choose)....

Sounds good to me.

> -Streamline the Java API...

I guess that depends how close we want to be to the w3c DDR spec - for
my use cases I'd be happy with a simplistic interface like

  public Map<String, String> getDeviceProperties(String userAgent);

which we can certainly support in parallel with the w3c DDR APIs.

-Bertrand

Re: DeviceMap Java API

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Tue, May 7, 2013 at 3:52 PM, Reza <re...@yahoo.com> wrote:
> -The oddr package is empty...

Yeah, I forgot to remove that folder after moving the java classes to
the org.apache.devicemap package - fixed in
http://svn.apache.org/r1479913

> ...The example here makes use of oddr: https://github.com/OpenDDRdotORG/OpenDDR-Java.
> So this needs to be rectified and/or the example needs to be updated....

That's an OpenDDR example, we should have our own under
http://incubator.apache.org/devicemap/ (which can be edited from
https://cms.apache.org/devicemap/ and/or
http://svn.apache.org/repos/asf/incubator/devicemap/site/trunk/ )

>
> -We have a maven project for the DeviceMap resources (https://svn.apache.org/repos/asf/incubator/devicemap/trunk/openddr/data/) but
> the Java API cannot load resources from a jar source. I havent looked deeply at the code, but this is fixable. If this
> functionality exists today, please guide me in the right direction....

It doesn't exist, you're correct - currently the tests under
openddr/java use the maven-dependency-plugin to unpack the
dependencies under target/devicemap, but you're right that loading
data directly from a jar would be more convenient.

>
> -Make the project "zero configuration", or close to it. I would like to simply add 2 dependencies to my POM
> and then add 5-10 lines of code and be done. I think this is possible. The dependencies would be DeviceMap
> data (resources) and the DeviceMap Java API. We could even make a version of the data called LATEST
> which would always pull our latest DDR. This way you get the latest devices on every compile (if you choose)....

Sounds good to me.

> -Streamline the Java API...

I guess that depends how close we want to be to the w3c DDR spec - for
my use cases I'd be happy with a simplistic interface like

  public Map<String, String> getDeviceProperties(String userAgent);

which we can certainly support in parallel with the w3c DDR APIs.

-Bertrand