Permalink
Browse files

Converting the docbook stragglers to markdown.

  • Loading branch information...
1 parent 654ca91 commit b87a1030fd9450731d9a81237e17bb9b81b1c830 @LouisLandry committed Nov 11, 2012
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
-%BOOK_ENTITIES;
-]>
-<section>
- <title>JKeychain</title>
-
- <section>
- <title>Construction</title>
-
- <para>The <classname>JKeychain</classname> class extends <classname>JRegistry</classname>. There are no changes to the
- constructor's argument list so optional initialisation with data can be done in the normal way.</para>
-
- <example>
- <title>JKeychain construction</title>
-
- <programlisting>// Create a keychain.
-$keychain1 = new JKeychain;
-
-$keychain2 = new JKeychain(array('username' =&gt; 'foo', 'password' =&gt; 'bar'));</programlisting>
- </example>
- </section>
-
- <section>
- <title>Usage</title>
-
- <para>A <classname>JKeychain</classname> object operates in the same way as a <classname>JRegistry</classname> object. What
- <classname>JKeychain</classname> provides is a way to load data from, and store data to an encrypted data source.</para>
-
- <para>When using this class, the private and public keys must already exist on the server. The third required element is the
- passphrase file and the following example shows how to create it.</para>
-
- <example>
- <title>Using JKeychain to create a passphrase file</title>
-
- <programlisting>// Create a keychain object.
-$keychain = new JKeychain;
-
-// The passphrase/passowrd should not be stored in any code repository.
-$passPhrase = 'the Pass Phrase';
-$privateKeyPwd = 'the Private Key Password';
-
-// The paths to keychain files could come from the application configuration.
-$passPhrasePath = '/etc/project/config/keychain.passphrase';
-$privateKeyPath = '/etc/project/config/keychain.key';
-
-$keychain-&gt;createPassphraseFile($passPhrase, $passPhrasePath, $privateKeyPath, $privateKeyPwd);</programlisting>
- </example>
-
- <para>The passphrase file will generally be created using the Keychain Management Utility (see next section) on the command
- line so that neither the passphrase, nor the private key password are stored in clear text in any application code.</para>
-
- <para>Likewise, initial data is probably already created in a keychain data file (again, using the Keychain Management Utility
- and the <command>create</command> command). The following example shows how to load the keychain data:</para>
-
- <example>
- <title>Using JKeychain to access existing data</title>
-
- <programlisting>// Create a keychain object.
-$keychain = new JKeychain;
-
-$keychainFile = '/etc/project/config/keychain.dat';
-$passPhrasePath = '/etc/project/config/keychain.passphrase';
-$publicKeyPath = '/etc/project/config/keychain.pem';
-
-$keychain-&gt;loadKeychain($keychainFile, $passPhrasePath, $publicKeyPath);
-
-$secureUsername = $keychain-&gt;get('secure.username');
-$securePassword = $keychain-&gt;get('secure.password');
-
-$conn = connect_to_server($secureUsername, $securePassword);</programlisting>
- </example>
-
- <para>The keychain object can manipulate data as if it was a normal <classname>JRegistry</classname> object. However, an
- additional <methodname>deleteValue</methodname> method is provided to strip out registry data if required.</para>
-
- <para>Finally, the <methodname>saveKeychain</methodname> method can be used to save data back to the keychain file.</para>
- </section>
-</section>
@@ -0,0 +1,79 @@
+## The Google Package
+
+### Using the Google Package
+
+The Google package is designed to be a straightforward interface for working with various Google APIs. You can find a list of APIs and documentation for each API at [https://developers.google.com/products/.](https://developers.google.com/products/)
+
+#### Instantiating JGoogle
+
+Instantiating JGoogle is easy:
+
+```php
+$google = new JGoogle;
+```
+
+This creates a generic JGoogle object that can be used to instantiate objects for specific Google APIs.
+
+Sometimes it is necessary to specify additional options. This can be done by injecting in a JRegistry object with your preferred options:
+
+```php
+$options = new JRegistry;
+$options->set('clientid', 'google_client_id.apps.googleusercontent.com');
+$options->set('clientsecret', 'google_client_secret');
+
+$google = new JGoogle($options);
+```
+
+#### Accessing the JGoogle APIs
+
+The Google Package divides APIs into two types: data APIs and embed APIs. Data APIs use JHttp to send and receive data from Google. Embed APIs output HTML, JavaScript, and XML in order to embed information from Google in a webpage.
+
+The Google package is still incomplete, but there are five object APIs that have currently been implemented:
+
+Data: Google Calendar, Google AdSense, Google Picasa
+
+Data: Google Maps, Google Analytics
+
+Once a JGoogle object has been created, it is simple to use it to create objects for each individual API:
+
+```php
+$calendar = $google->data('calendar');
+```
+
+or
+
+```php
+$analytics = $google->data('analytics');
+```
+
+#### Using an API
+
+See below for an example demonstrating the use of the Calendar API:
+
+```php
+$options = new JRegistry;
+
+// Client ID and Client Secret can be obtained through the Google API Console (https://code.google.com/apis/console/).
+$options->set('clientid', 'google_client_id.apps.googleusercontent.com');
+$options->set('clientsecret', 'google_client_secret');
+$options->set('redirecturi', JURI::current());
+
+$google = new JGoogle($options);
+
+// Get a calendar API object
+$calendar = $google->data('calendar');
+
+// If the client hasn't been authenticated via OAuth yet, redirect to the appropriate URL and terminate the program
+if (!$calendar->isAuth())
+{
+ JResponse::sendHeaders();
+ die();
+}
+
+// Create a new Google Calendar called "Hello World."
+$calendar->createCalendar('Hello World');
+```
+
+#### More Information
+
+The following resources contain more information:[Joomla! API Reference](http://api.joomla.org), [Google Developers Homepage](https://developers.google.com/)
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
-%BOOK_ENTITIES;
-]>
-<section id="chap-Joomla_Platform_Manual-Google">
- <title>The Google Package</title>
-
- <section>
- <title>Using the Google Package</title>
-
- <para>The Google package is designed to be a straightforward interface for working with various Google APIs. You can find a list of APIs and documentation for each API at <ulink
- url="https://developers.google.com/products/">https://developers.google.com/products/.</ulink></para>
-
- <section>
- <title>Instantiating JGoogle</title>
-
- <para>Instantiating JGoogle is easy:</para>
-
- <programlisting>$google = new JGoogle;</programlisting>
-
- <para>This creates a generic JGoogle object that can be used to instantiate objects for specific Google APIs.</para>
-
- <para>Sometimes it is necessary to specify additional options. This can be done by injecting in a JRegistry object with your
- preferred options:<programlisting>$options = new JRegistry;
-$options-&gt;set('clientid', 'google_client_id.apps.googleusercontent.com');
-$options-&gt;set('clientsecret', 'google_client_secret');
-
-$google = new JGoogle($options);</programlisting></para>
- </section>
-
- <section>
- <title>Accessing the JGoogle APIs</title>
-
- <para>The Google Package divides APIs into two types: data APIs and embed APIs. Data APIs use JHttp to send and receive data from Google.
- Embed APIs output HTML, JavaScript, and XML in order to embed information from Google in a webpage.</para>
-
- <para>The Google package is still incomplete, but there are five object APIs that have currently been
- implemented:</para>
-
- <para>Data: <simplelist>
- <member>Google Calendar</member>
-
- <member>Google AdSense</member>
-
- <member>Google Picasa</member>
- </simplelist></para>
-
- <para>Data: <simplelist>
- <member>Google Maps</member>
-
- <member>Google Analytics</member>
- </simplelist></para>
-
- <para>Once a JGoogle object has been created, it is simple to use it to create objects for each individual API:<programlisting>$calendar = $google-&gt;data('calendar');</programlisting> or <programlisting>$analytics = $google-&gt;data('analytics');</programlisting></para>
- </section>
-
- <section>
- <title>Using an API</title>
-
- <para>See below for an example demonstrating the use of the Calendar API:<programlisting>$options = new JRegistry;
-
-// Client ID and Client Secret can be obtained through the Google API Console (https://code.google.com/apis/console/).
-$options-&gt;set('clientid', 'google_client_id.apps.googleusercontent.com');
-$options-&gt;set('clientsecret', 'google_client_secret');
-$options-&gt;set('redirecturi', JURI::current());
-
-$google = new JGoogle($options);
-
-// Get a calendar API object
-$calendar = $google->data('calendar');
-
-// If the client hasn't been authenticated via OAuth yet, redirect to the appropriate URL and terminate the program
-if (!$calendar->isAuth())
-{
- JResponse::sendHeaders();
- die();
-}
-
-// Create a new Google Calendar called "Hello World."
-$calendar->createCalendar('Hello World');</programlisting></para>
- </section>
-
- <section>
- <title>More Information</title>
-
- <para>The following resources contain more information:<simplelist>
- <member><ulink url="http://api.joomla.org">Joomla! API Reference</ulink></member>
-
- <member><ulink url="https://developers.google.com/">Google Developers Homepage</ulink></member>
- </simplelist></para>
- </section>
- </section>
-</section>
Oops, something went wrong.

0 comments on commit b87a103

Please sign in to comment.