Bookmarking Support

Proposed By

Name: Sanchayan Santra
Email: miltus31@…
IRC nick: m31

Proposal

Summary

Implementation of support for bookmarking of games and browsing bookmarked and recent games from the client UI. The information of the bookmarked games is stored in the user's xmpp account.

Details

As the clients can be implemented by any one the support of bookmarking has to be implemented in the libsoy for actually handling the bookmarks. And also some API functions so that clients may access the bookmarks.

Changes Required

Changes need to be done mainly in libsoy net sources. They are written in Genie. I have to read the code before actually typing things here. As for the UI part, currently the client code in the libsoy uses libsoy to display glowing cubes as progress. Those may be used for designing the UI.

Format of Bookmark

The format of the bookmark can be the following -

<storage xmlns='storage:bookmarks'>
    <url name='<Name of the game>'
        url='<link to the game>'/>
</storage>

Functions

Handling bookmarks requires three functions

  • saving bookmarks
  • deleting bookmarks
  • getting all bookmarks

Getting Bookmarks

Bookmark requesting format

<iq from='(jid)' type='get' id='retrieve1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <items node='storage:bookmarks'/>
  </pubsub>
</iq>

And server replies with

<iq type='result' to=(JID) id=(ID in the request) >
    <pubsub xmlns='http://jabber.org/protocol/pubsub'>
        <items node='storage:bookmarks'>
            <item id=(itemid) >
                <storage xmlns='storage:bookmars'>
                    <url name=(name) url=(url) />
                </storage>
            </item>
            <item id=''>
            ...
            </item>
        </items>
    </pubsub>
</iq>

Where the values in the parenthesis will contain actual values.

In case of error the server replies in the format

<iq type='error' ...

and the details of it are given in section-6.5.9 in XEP-0060.

Saving Bookmarks

As recommended in XEP-0048 this will be stored using Publish-Subscribe(XEP-0060). Uploading format

<iq from='(jid)' type='set' id='pip1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='storage:bookmarks'>
      <item id='current'>
        <storage xmlns='storage:bookmarks'>
          <url name='(Name of the game)'
                 url='(link to the game)'/>
        </storage>
      </item>
    </publish>
    <publish-options>
      <x xmlns='jabber:x:data' type='submit'>
        <field var='FORM_TYPE' type='hidden'>
          <value>http://jabber.org/protocol/pubsub#publish-options</value>
        </field>
        <field var='pubsub#persist_items'>
          <value>true</value>
        </field>
        <field var='pubsub#access_model'>
          <value>whitelist</value>
        </field>
      </x>
    </publish-options>
  </pubsub>
</iq>

Server replies with

<iq type='result' to=(JID) id=(id of query)>
    <pubsub xmlns='http://jabber.org/protocol/pubsub'>
        <publish node='storage:bookmarks'>
            <item id=(id of the saved bookmark) />
        </publish>
    </pubsub>
</iq>

Error cases are similar to bookmark retrieving and detailed in section-7.1.3 in XEP-0060

Deleting Bookmarks

Format of deleting a bookmark

<iq type='set' from=(JID) id=(req id) >
    <pubsub xmlns='http://jabber.org/protocol/pubsub'>
        <retract node='storage:bookmarks'>
            <item id=(id of the item to delete) />
        </retract>
    </pubsub>
</iq>

On Success the server replies with

<iq type='result' to=(JID) id=(id of the query) />

The error cases are detailed in section-7.2.3 in XEP-0060.

Breakup of the work

Prep Work

As prep work I will try to make myself familiar with how pysoy works as a whole. I also need to understand gnomesoy as it is intended to be a pysoy client and as I need to implement UI for bookmarks.

Completed by the midterm evaluation

By the midterm evaluation I will try to implement bookmarking implementation in the backend and APIs for accessing them.

Completed by the final evaluation

By the final evaluation I would complete APIs to for game browser and its implementation in gnomesoy.

Some mockups of the bookmark screen

Initial mockup given below.

Mockup of bookmark UI

Attachments