Does anyone have a very simple example of using OData4J and GAE?
In the OData4J site there is a stub project for use in GAE...but doesn't really show how to expose entities out of the datastore as odata entities.
I may be missing something with that stub project(I'm sure I am)...but just need a little jump start on how to publish my persisted entities.
Thanks
MJD
Take a look at http://code.google.com/p/odata-appengine/
Maybe it's just what you're looking for.
the odata4j-appengine sample project in the repository shows how to expose existing appengine datastore kinds as odata open-typed entities.
See appengine-web.xml for how it's configured.
If you need any additional help, feel free to post to our discussion group at odata4j-discuss.
Thanks,
- John
unfortunately, it looks like no one has written and published such example code yet. google has only 127 results for odata4j "app engine", and the vast majority are unrelated mentions that happen to be on the same page.
so, you may be in unexplored territory here, at least as far as the internet is concerned. if you do end up writing example code yourself, feel free to post it here so others can benefit!
Related
When it comes to write REST doc documentations, is it good to write all possible values of each request parameter? I think it's better even though there are many other ways to get the information like source codes. But I am not sure. Is there correct answer, or it's just a matter of team policy?
I think the answer to that question is depends on the project that you are working on. If this API will be used by many other developers and open to everyone, I think it would be better to put a few example code snippets by using a different language and explain each parameter like what is used for and the limits that should be considered. I think you don't need to put all possible combinations after simply explain each parameter itself. You may look at popular projects API documentation to get an idea; for example :
Github API Documentation
Twitter API Documentation
Dropbox API Documentation
These documentations are giving every detail that a developer needs. If this API is only for your small team and you don't need such detailed explanations you may use Swagger like tools to easily document your API.
Swagger
I completely agree with the above, just wanted to add another handy thing. You might want to have Postman Collection with all the test case scenarios. This will come handy when you will want to share it with the team or QA. There is a practice to keep the Postman Collections in source control and to update them as needed.
I am thinking about building a student app, that would use Moodle data, and notify the user when a new file has been uploaded, and perhaps do something like checking your grades etc.
I'm quite new to android programming and can get easily confused with the technical terms. I've looked around the web and found that there is an API, but I dont really 100% know what that means. Which is weird since I've communicated with API's like the OpenWeatherMap one and uTorrent. Would Moodle's api do the same? Make it easier for me to get their data? Their descriptions are really technical and I can not understand much.
Please note that "API" in moodle does not automatically refer to webservices like you are used to communicate with.
See https://docs.moodle.org/32/en/Mobile_web_services and https://docs.moodle.org/32/en/Using_web_services and https://docs.moodle.org/dev/Web_service_API_functions
These docs might be interesting for you.
Beside the existing webservice methods, you can also create your own moodle plugin, which provides the methods required, some info can be found here https://docs.moodle.org/dev/Adding_a_web_service_to_a_plugin
I am considering using EWS Java API to access Exchange. Specifically, to insert appointment into users' calendars. Now, the online documentation that I immediately find is... sparse, so I would very much appreciate if someone could give some input in:
1. Is this an API worth using?
2. Are there any online resources for it (that a rather superficial google doesn't find)?
3. Is there anyone of the alternatives I should use instead? (SyncEx, j-exchange)
I've seen previously posted links to the alternatives. What I am hoping for, however, is that someone can share experience with what is actually good to work with.
Thanks a lot,
HÃ¥kan
i would like to implement some kind of service my customers can use to find their company on
a. blogs, forums
b. facebook, twitter
c. review sites
a. blogs, forums
This can only be done by a crawler, right? A crawler looking for the robots.txt on a forum/blog and than optionally reading the content (and of course links) of the forum/blog.
But where to start? Can i use a set of sites to start with crawling? do i have to predefine them or can i use some other searchengine first? E.g. searching in Google for that company and then crawl the SERPs? Legal?
b. facebook, twitter
They have APIs, so hat should not be a problem i think.
c. review sites
I looked at some review site's TOS and they wrote that using an automated software crawling their sites is not permitted. On the other hand, the sites that are relevant to me are not disallowed in their robots.txt. What matters here?
Any other hints are welcome.
Thanks in advance :-)
Honestly, the easiest way to do it would be to start with the search engines. They all have APIs for doing automated searches, so that'd probably give yout he highest return for your time on getting back links/mentions of your client's products or brand.
That won't handle things behind authentication, only public stuff (of course). But it'll give you a good baseline to start with. From there, you could (if you want) use API's or custom-written bots that are given auth creds on the sites, but honestly I think at that point you're missnig the core question, I think.
Is the core question, "Where are we mentioned?" or is the core question really... "What sites are getting traffic to come to us?" In most cases, it's the latter, in which case you can ignore all of what I said previously and just use Google Analytics, or similar software on your client's site to determine where traffic's coming from.
Edit
Ok, so if it's where are we mentioned, I'd still start w/ the search engines as stated. Google's api is pretty easy and it has a SOAP based one that you can pull in as a web reference if you want; example
Re: review sites. If the site's TOS says you can't use automated bots, then it's a good idea not to use automated bots. The robots.txt is not legally binding (it's sort of a good-neighbor thing), and so I wouldn't not use the lack of exclusion there to be permission. Some review sites (more modern ones) might disallow automated scraping of their site, but they might still publish RSS feeds or Atom feeds or have some other API that you can hook into, that's worth checking.
I'm writing a Java program, and I want a function that, given a string, returns the number of Google hits a search formed from that query returns. How can I do this? (Bonus points for the same answer but with Bing instead.)
For instance, googleHits("Has anyone really been far even as decided to use even go want to do look more like?") would return 131,000,000. (or however many there are.)
Related: How can I programmatically access the "did you mean" suggestion? (eg searching "teh circuz" returns "did you mean the circus?")
found it: http://code.google.com/apis/ajaxsearch/documentation/#fonje
The Google Terms of Service say this:
5.3 You agree not to access (or attempt to access) any of the Services
by any means other than through the
interface that is provided by Google,
unless you have been specifically
allowed to do so in a separate
agreement with Google. You
specifically agree not to access (or
attempt to access) any of the Services
through any automated means (including
use of scripts or web crawlers) and
shall ensure that you comply with the
instructions set out in any robots.txt
file present on the Services.
Google has ways of making life unpleasant for you / your company if you violate the Terms of Service ...
UPDATE: The second sentence is about the way that you use Google's services ... including their published APIs. It is not entirely clear from the wording what is allowed and what is forbidden; literally speaking "any automated means" is very broad. However a Java app that performed Google searches, screen-scraped the results and repackaged them to provide some value added service would (IMO) be a violation of the TOS. And using Google's published APIs to do the same thing would (IMO) also be a violation.
But that's my opinion, not Google's. And it is the Google opinion that matters. If anyone is thinking of doing something like this, they should contact Google and check that what they are proposing is OK.
The point is that Google is not going to assist people to subvert their search business model. Anyone who thinks they can get away with it based on some clever interpretation of the TOS is going to get burned.
for the first part of the answer, try read the t-o-s; for the "did you mean" part, see: http://norvig.com/spell-correct.html
You may be able to do it "legally" using the Google Java Client Library. I don't know for sure, but they may have some methods similar to what you're looking for, and you won't be violating their TOS.
Google Data APIs Library
You can legally access the Google AJAX Feed API through its RESTful interface:
http://code.google.com/apis/ajaxfeeds/documentation/#fonje
Bing still has a developer program where you can call against their API in a JSON/XML or SOAP matter:
http://www.bing.com/developers