<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Jaggery - Delicious Javascript</title>
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le styles -->
    <link href="../css/bootstrap.css" rel="stylesheet">
    <style type="text/css">
        body {
            padding-top: 60px;
        }
    </style>
    <link href="../css/prettify.css" rel="stylesheet">
    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../images/favicon.ico">
    <link rel="apple-touch-icon" href="../images/apple-touch-icon.png">
    <link rel="apple-touch-icon" sizes="72x72"
          href="../images/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="114x114"
          href="../images/apple-touch-icon-114x114.png">
</head>

<body>

<%
include('/includes/topnavi.jag');
%>

<div class="container-fluid" style="width: 960px; margin: auto;">
<div class="row">
    <div class="span16">
        <div class="page-header">
            <h1>
                Documentation
                <small>API documentation for Jaggery.js</small>
            </h1>
        </div>
    </div>
</div>

<div class="row">
<div class="span4">
    <div class="well">
        <%
        include('/includes/navi.jag');
        %>

    </div>

</div>
<div class="span12">
<div class="content" id="atomFeed" name="atomFeed">
    <h3>AtomClient</h3>

        <pre class="prettyprint linenums">
&lt%
// Creating an instance of APPClient
var client = new APPClient();

// Creating an instance of AtomFeed
var feed = new AtomFeed();

// Setting login credentials for the client
//client.credentials={username:"you@email.com",password:"xxx",service:"blogger",authtype:"google"};

// Retrieving and online feed
feed = client.getFeed("http://ruchirawageesha.blogspot.com/feeds/posts/default");

// Getting an array of individual entries from the feed
var entries = new Array();
entries = feed.getEntries();
for(var i=0;i &lt entries.length; i++) {
	var entry = entries[i];
%&gt
	&lttr&gt
        &lttd&gt&lta href="&lt%=entry.link[0]%&gt"&gt&lt%=entry.title%&gt&lt/a&gt&lt/td&gt
        &lttd&gt&lt%=entry.updated%&gt&lt/td&gt
        &lt/tr&gt
&lt%
}
%&gt
</pre>
    <%
    var reqCode = '&lt%'
    + '\n // Creating an instance of APPClient'
    + '\n var client = new APPClient();'
    + '\n '
    + '\n // Creating an instance of AtomFeed '
    + '\n var feed = new AtomFeed();'
    + '\n'
    + '\n // Setting login credentials for the client '
    + '\n //client.credentials={username:"you@email.com",password:"xxx",service:"blogger",authtype:"google"};'
    + '\n'
    + '\n // Retrieving and online feed '
    + '\n feed = client.getFeed("http://ruchirawageesha.blogspot.com/feeds/posts/default");'
    + '\n '
    + '\n // Getting an array of individual entries from the feed'
    + '\n var entries = new Array();'
    + '\n entries = feed.getEntries();'
    + '\n for(var i=0;i &lt entries.length; i++) {'
    + '\n var entry = entries[i];'
    + '\n %&gt'
    + '\n &lttr&gt'
    + '\n &lttd&gt&lta href="&lt%=entry.link[0]%&gt"&gt&lt%=entry.title%&gt&lt/a&gt&lt/td&gt'
    + '\n &lttd&gt&lt%=entry.updated%&gt&lt/td&gt '
    + '\n &lt/tr&gt'
    + '\n &lt%'
    + '\n }'
    + '\n %&gt';

    var codeSnip = encodeURIComponent(reqCode);
    var urlString = '../tryitframe.jag?code='+codeSnip;

    include('/includes/tryit_but.jag');
    %>


   <div id="pageLinks">
<a class="navilink" href="#overview">Overview</a>
<a class="navilink" href="#members">Members</a>
<a class="navilink" href="#operations">Operations</a>
</div>

    <section id="overview">
                 <h4>Overview</h4>
        <p class="description">The "AtomClient" acts as a client to an APP server.
            It is capable of authenticating using the given credentials and performing HTTP operations GET, POST, PUT and DELETE.</p>
        </section>
    <section id="members">
        <h4>Members</h4>
    <table class="clsStd member-table">

        <tbody>

        <tr>

            <th>Member</th>
            <th>Type</th>
            <th>Description</th>

        </tr>

        <tr>
            <td>
                <code>credentials</code>
            </td>
            <td>Object</td>
            <td>
                <pre class="prettyprint">client.credentials={username:"you@email.com", password:"xxx", service:"blogger", authtype:"google"};</pre>
                This property can be used to provide a JavaScript object with the username,password and authentication
                service credentials needed to communicate with APPServer. Currently this supports blogger authentication only. 
            </td>
        </tr>

        
        </tbody>
    </table>



    </section>

    <section id="operations">
        <h4>Operations</h4>

        <table class="clsStd operations-table">
            <tbody>
            <tr>
                <th>Operation</th>
                <th>Returns</th>
                <th>Description</th>
            </tr>
            <tr>
            <td>
                <code> deleteEntry(AtomEntry entry)</code>
            </td>
            <td>None</td>
            <td>
                Deletes the AtomEntry designated by the AtomEntry object.
            </td>
        </tr>
        <tr>
            <td>
                <code>deleteEntry(String uri)</code>
            </td><td>None</td>
            <td>Deletes the AtomEntry designated by the uri
            </td>
        </tr>
        <tr>
            <td>
                <code>get(AtomEntry entry)</code>
            </td>
            <td>None</td>
            <td>Get an AtomEntry from the APPServer, given an AtomEntry object.
            </td>
        </tr>
        <tr>
            <td>
                <code>get(String uri)</code>
            </td>
            <td>AtomEntry</td>
            <td>
                 <pre class="prettyprint">
                var entry2 = client.get("http://www.blogger.com/feeds/000/posts/full/000");
            </pre>
                Get an AtomEntry from the APPServer, given a URI to an Atom entry.

            </td>
        </tr>
        <tr>
            <td>
                <code>getFeed(AtomFeed feed)</code>
            </td>
            <td>None</td>
            <td>Get an AtomFeed from the APPServer, given an AtomFeed object.</td>
        </tr>
        <tr>
            <td>
                <code>getFeed(String uri)</code>
            </td>
            <td>None</td>
            <td> <pre class="prettyprint">
                var entry2 = client.get("http://www.blogger.com/feeds/000/posts/full/000");
            </pre>
                Get an AtomFeed from the APPServer, given a URI to an Atom feed.

            </td>
        </tr>
        <tr>
            <td>
                <code>post(String postURI, AtomEntry entry)</code>
            </td>
            <td>None</td>
            <td>Posts an AtomEntry object to an APP server using the given post URI as described in the APP specification.</td>
        </tr>
        <tr>
            <td>
                <code>post(String postURI, Object entryObject)</code>
            </td>
            <td>None</td>
            <td>Posts an entry to an APP server using the given post URI as described in the
                            APP specification, as an object with the following properties defined:
                            <br><br>
                            <ul>
                                <li>String author|String authors (comma separated list)</li>
                                <li>String category|String categories(comma separated list)</li>
                                <li>XML content|String content</li>
                                <li>String contributor|String contributors(comma separated list)</li>
                                <li>String id</li>
                                <li>String link|String links(comma separated list)</li>
                                <li>String published : can put the value as'now' to specify the current time</li>
                                <li>XML rights|String rights</li>
                                <li>XML summary | String summary</li>
                                <li>XML title | String title</li>
                                <li>String updated : can put the value as'now' to specify the current time</li>
                            </ul>
                        </td>
        </tr>
        <tr>
            <td>
                <code>put(String editURI, AtomEntry entry)</code>
            </td>
            <td>None</td>
            <td>Puts an AtomEntry object to an APP server using the given edit URI as described in the APP specification.</td>
        </tr>
        <tr>
            <td>
                <code>put(String editURI, Object entryObject)</code>
            </td>
            <td>None</td>
            <td>Posts an entry to an APP server using the given edit URI as described in the
                            APP specification, as an object with the following properties defined:
                            <br><br>
                            <ul>
                                <li>String author|String authors (comma separated list)</li>
                                <li>String category|String categories(comma separated list)</li>
                                <li>XML content|String content</li>
                                <li>String contributor|String contributors(comma separated list)</li>
                                <li>String id</li>
                                <li>String link|String links(comma separated list)</li>
                                <li>String published : can put the value as'now' to specify the current time</li>
                                <li>XML rights|String rights</li>
                                <li>XML summary | String summary</li>
                                <li>XML title | String title</li>
                                <li>String updated : can put the value as'now' to specify the current time</li>
                            </ul>
                        </td>
        </tr>
            
            </tbody>
        </table>
    </section>

</div>



</div>

</div>
<%
include('/includes/footer.jag');
%>

</div>

<!-- /container -->
<%
include('/includes/scripts.jag')
%>

<script>

    $(document).ready(function () {
        $('#atomclient').toggleClass('active')
        $('#docs').addClass('active')
    })
</script>
</body>
</html>