Permalink
Browse files

Update readme.md

  • Loading branch information...
mansilladev committed Jul 19, 2012
1 parent 5f98cc5 commit a5beec0ba0aacce7d063cf8bf57256589f1c4040
Showing with 44 additions and 8 deletions.
  1. +44 −8 readme.md
View
@@ -32,29 +32,65 @@ Above is just a pseudo-PHP-code example of how this library works.
1. Python (2.6+)
2. [Google App Utils](http://code.google.com/p/google-apputils-python/downloads/detail?name=google-apputils-0.3.0.tar.gz&can=2&q=)
-## Installation / Quick Start Guide
+## Installation / Quick Start
The steps below are for Linux, Mac OS X or other UNIX-variant operating systems.
1. Deploy this distro to /usr/src/
2. Unpack Google App utils to /usr/src/
-3. Unpack Google API PHP Client to /usr/src/google-api-php-client
-
-4. Point your browser to: /usr/src/io-wraps/iodocs_json_converter.html
+3. Point your browser to: /usr/src/io-wraps/iodocs_json_converter.html
a. Paste in an I/O Docs configuration from the Mashery Dashboard configuration
b. Click Convert to Google Discovery Format button
c. Save output in Google Discovery Format textarea to: /usr/src/io-wraps/new_api.json
-5. From shell: export PYTHONPATH=/usr/src/io-wraps/google-apis-client-generator/src:/usr/src/google-apputils-0.3.0/build/lib:/usr/lib/python2.6:$PYTHONPATH (assuming Python 2.6 is your current version)
+4. From shell: export PYTHONPATH=/usr/src/io-wraps/google-apis-client-generator/src:/usr/src/google-apputils-0.3.0/build/lib:/usr/lib/python2.6:$PYTHONPATH (assuming Python 2.6 is your current version)
+
+5. From shell: cd /usr/src/io-wraps/google-apis-client-generator/src/googleapis/codegen
+
+6. From shell: ./generate_library.py --language=php --language_variant=stable --output_dir=/usr/src/io-wraps/new_api_php --input=/usr/src/io-wraps/new_api.json
+
+## PHP - Next Steps
+If you have followed the instructions above and generated a PHP library, you will find it in:
+/usr/src/io-wraps/new_api_php.
+
+The next steps:
+
+1. Deploy the [Google API PHP Client fork from the Mashery Github repo](https://github.com/mashery/google-api-php-client) into /usr/src/io-wraps
+
+2. Move the newly generated PHP file from /usr/src/io-wraps/new_api_php directory into:
+/usr/src/io-wraps/google-api-php-client/contrib
+
+3. Edit the file /usr/src/io-wraps/google-api-php-client/config.php - in particular, set the 'key_name' and 'basePath'
+
+At this point, you're ready to start linking the client libraries into your code. To see built/bundled I/O Wraps SDKs with example apps, check out these repos:
+
+ [https://github.com/mashery/io-wraps-rovi-php](https://github.com/mashery/io-wraps-rovi-php)
+ [https://github.com/mashery/io-wraps-usatoday-php](https://github.com/mashery/io-wraps-usatoday-php)
+ [https://github.com/mashery/io-wraps/whitli-php](https://github.com/mashery/io-wraps/whitli-php)
+
+## Java - Next Steps
+If you have generated a Java library, you simply need to build the Maven project. For example, if you set the --output_dir to /usr/src/io-wraps/new_api_java, follow these simple steps:
+
+1. From shell: cd /usr/src/io-wraps/new_api_java
+
+2. From shell: maven install
+
+You do need to have Java and Maven installed. At this point, you're ready to start linking the client libraries into your code.
+
+## Caveats - YMMV (Your Mileage May Vary)
+Building client libraries with a generator such as this may not produce the perfect SDK out of the box. In fact, there are plenty of improvements, optimizations and features that this project could use. The entire process is open-source from end to end, meaning that from the schema, to the generator, generator templates, and of course, the generated SDK, you are free to make any style and design modifications.
-6. From shell: cd /usr/src/io-wraps/google-apis-client-generator/src/googleapis/codegen
+If your JSON configuration schema came directly from an I/O Docs implementation and you have very long resource and method names, that translates to very long function names in your code.
-7. From shell: ./generate_library.py --language=php --language_variant=stable --output_dir=/usr/src/io-wraps/new_api_php --input=/usr/src/io-wraps/new_api.json
+For payload responses to be fully objectified, you must describe the response object in the Google Resource format. Otherwise, the response data will need to be traversed as a regular object/hash/array. See the [Google Discovery Document Resource reference](https://developers.google.com/discovery/v1/reference#resource_discovery), and in particular the "schemas" and "response" properties.
+## To Do (TODO)
+* Autoload and namespaces for PHP - one of high-priority followups for the google-api-php-client fork
+* Mashery I/O Docs Node.js (on Github) JSON schema support - the current Javascript converter only supports the Mashery I/O Docs production/enterprise schema
## About / License
* No warranty expressed or implied. Software as is.
* [MIT License](http://www.opensource.org/licenses/mit-license.html)
-* Lovingly created by [Mashery Dev](http://dev.mashery.com)
+* Lovingly created by [Mashery Dev](http://dev.mashery.com)

0 comments on commit a5beec0

Please sign in to comment.