Index of /p4/l10n/AjaxChooser/en_us/docs

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[   ]LICENSE 2011-08-15 00:26 18K 
[TXT]default.css 2011-08-15 00:26 5.4K 

CC Ajax License Chooser Demonstration

CC Ajax License Chooser Demonstration

Author:$Author: nyergler $
Version:$Revision: 1.2 $
Updated:$Date: 2005/08/01 14:52:52 $

What

This package implements a sample browser client for the Creative Commons license engine web service. More information on the web services can be found at http://api.creativecommons.org.

The implementation included in this package uses PHP to proxy web service requests from your local web host to api.creativecommons.org. It also uses Javascript to implement an AJAX interface, like that found in wpLicense.

How

The cc_ajax package provides both PHP and Javascript files which combine to implement a basic license chooser. To integrate a license chooser in your web-based application:

  1. Modify the WS_ROOT_URL variable in cc_ajax/client.js to point to the location of your copy of ccwsclient.php. Due to browser security restrictions, this must be in the same domain as your license chooser.

    For example, if your are implementing a license chooser at http://example.com/choose.php with the cc_ajax library installed at the root, WS_ROOT_URL would be http://example.com/cc_ajax/ccwsclient.php.

  2. Upload the cc_ajax package to your web server.

  3. Include the chooser in your page by requiring the cc_ajax/cc_ajax.php library. This file defines two functions which are used to generate the license chooser:

    1. scriptHeader($base)

      Generates the <script> tags necessary for including the Javascript libraries. In the above example, you would use

      <?php scriptHeader("http://example.com"); ?>
      
    2. licenseChooser($action, $prefix)

      Generates the license chooser itself. $action specifies the URL to post the form to; the package includes choose.php which simply shows the results of the form. $prefix specifies a string to prefix the form variables with. For example

      <?php licenseChooser('choose.php', ''); ?>
      
  4. The form uses the following variables:

    • license_name The human-readable name of the license
    • license_uri The URI of the license deed
    • license_rdf The RDF block which describes the license permissions, prohibitions and requirements.
    • license_html The HTML block, including the RDF-in-a-comment, suitable for embedding in a web page.

Acknowledgements

cc_ajax is built using excellent Open Source libraries, including:

License

cc_ajax is licensed under the GNU GPL version 2 or later. See docs/LICENSE in the distribution for full license text. This documentation is licensed under a Creative Commons Attribution 2.5 License.