Difference between revisions of "KiwixKolibri"

Jump to navigation Jump to search
Lots of edits + USER STORIES in preparation for hackathon.
(Lots of edits + USER STORIES in preparation for hackathon.)
Line 1: Line 1:
== Introduction ==
== Introduction ==
This page is about hackathon projects that integrate Kiwix and Kolibri.


This page is about integration between Kiwix and Kolibri <ref>[http://kolibri.readthedocs.io/en/master/ Kolibri docs]</ref> <ref>[http://github.com/learningequality/kolibri Kolibri Github]</ref> <ref>[http://learningequality.org/kolibri Kolibri website]</ref>


(created for the Wikimania 2017 Hackathon)
== General context ==
 
Things that currently exist:
* KA lite content packs
* Content channels (Kolibri) and zim files (Kiwix)
* Content curation server + sushi chefs content pipeline
* ZimFiles listings (formats?)
* IIAB software
* Kiwix server and mobile apps
 
 
THINGS CURRENTLY MISSING on KOLIBI:
* sharable linkable URLs (content level links)
* Search / listing API
 
Questions:
* Does Kiwix have ability to do deep links?
 
 
 
== User scenarios ==
 
 
=== Backend content integration ===
This importing/exporting currently existing content.
 
Context:
* Kiwix content repository running in the cloud
* Scripts (zim chefs) for creating OpenZim file formats from various sources
* Kolibri Content curation server running in the cloud
* Chef scripts that package various sources as kolibri channels
 
 
USER STORY 1.1: As a Sushi Chef author I want to import content from ZimFiles
* read OPDS listing to know what OpenZIM files are available
* use libzim to extract contents
* use chef script to package contents as channel
* upload to content curation server
 
USER STORY 1.2: As a ZimFile author I want to import content from Kolibri channels
* read CCServer listing to find listed channels
* download content database + storage (need new code that simulates what kolibri does)
* use libzim to package content as OpenZIM file
* upload to Kiwix content repository
 
USER STORY 1.3: As a subject specialist (e.g. medical wikipedia) I want to use the content curation server to remix an content from existing kolibri channel and zim files
* Prerequisite: USER STORY 1.1/1.2 upload of content
* use CC Server to remix content from multiple channels
* publish and view channel in Kolibri
* can also export as openzimfile (e.g. to include in a standalone Kiwix app)
 
 
Discussion points:
* Possible integration of available content via OPDS (ask IIAB/Kiwix/RACHEL ppl)
* Aligning standards of exporting meta data to OPDS, such that Kiwix Zim resources and Kolibri Channels can be searched and browsed through the same interfaces. Collaborate with Tim Moody on this.
 
 
==== Exporting Kolibri channels to Zim ====
Static contents like videos in Khan Academy or Sikana.tv can be exported as a static zim, given we use the meta data (topic trees) for navigation + some template parameters like title, logo and colors.
 
==== Rendering Zim files in Kolibri ====
Kolibri rendered access data from wherever Zim files are stored
(maybe preferable to link to Kiwix deep-link / shallow links)
 
==== Importing from a Zim into a Kolibri channel ====
Importing a OpenZim file into a channel in the [http://contentworkshop.learningequality.org/ Kolibri Content Curation server]: Build a "sushi chef" script (using the ricecooker) to create a topic tree by traversing the content within the Zim. Depending on the format of the content in the zim, this might be a topic tree with videos, or in the Kolibri "HTML5 app" format, a set of pages that will be iframed. May not be very useful for something like all of Wikipedia, but can be useful for smaller Zim projects (or ones with a lot of rich media files).
 
* '''Benefit''': Someone can start creating '''exercises''' and '''re-organizing''' for a specific educational purpose
* '''Benefit''': Other channels can include new learning materials from already existing Zim resources
 
 
 
 
 
=== School server integration ===
 
Context:
* Kolibri running on port 8080
* Kiwix running on 8000
 
 
==== Shallow-linking (channel/zimfile-level linking) ====
 
GOAL: implement working prototype during hackathon
 
Detect that Kiwix is installed, get an index of OpenZIM bundles and their metadata, and show links to the corresponding Kiwix URLs alongside the Kolibri channel list. This seems like a good first step. Detecting that the other is running isn't as simple as it might seem, as people run on various ports. An interesting challenge with a clear but simple outcome.
 
 
 
USER STORY 2.1.1: Search in Kiwix also surfaces Kolibri content channels
* User is Kiwix main channel search interface
* User sees a mix of OpenZim files available and Kolibri channels
* Clicking on a Kolibri channel in the listing, takes user to Kolibri channel import screen
 
USER STORY 2.1.2: Search in Kolibri also surfaces Kiwix content channels
(same as above but reversed)
 
 
USER STORY 2.2: As a student completing a Kolibri "research exercise" activity, I want to access Kiwix content for research.
* Open exercise in Kolibri interface, e.g. what is bleach made of?
* Use Kiwix to search for content/answers
* Switch back to Kolibri tab to enter answer
 
 
==== Deep-linking ====
 
GOAL: discuss but leave for future session since too big project for five days.
 
A more general version of cross-linking to resources between the platforms. Possibly based either on a GUID or URI approach (which will likely be implemented in some form for cross-linking within Kolibri channels anyway), or through shared metadata/tagging schemes.
 
From Kiwix: Say you export a zim of a Kolibri channel which has an exercise, then we can use a placeholder with a deep link back to Kolibri.
 
From Kolibri: Instead of trying to fit in a Wikipedia zim, we can find a mechanism to add links as related contents. Like "Want to learn more about atomic fusion, read about it on Wikipedia".
 
 
 
USER STORY 2.3.1: Kiwix user is watching a TED talk video on programming.
* Kiwix calls a "related content" Kolibri API endpoint to find related items in Kolibri
* Suggested/related items: "watch an intro to programming from KA"
* Link to Kolibri channel or content item
* Kolibri Content-level links are  fairly consistent. They can also be constructed from searching this endpoint: https://kolibridemo.learningequality.org/api/content/197934f144305350b5820c7c4dd8e194/contentnode/?page=1&page_size=20&search=physics
 
 
USER STORY 2.3.2: Kolibri user is watching an introduction to programming KA video
* Kolibri calls “related content” on Kiwix API endpoint
* Suggested/related items: "watch an Video programming TED Talk"
* Link to Kiwix ZimFile or directly to content item
 
USER STORY 2.4: As a Kiwix user I want to access Perseus exercises.
* While browsing KA channel in Kiwix, I encounter a perseus exercise
* Link text "open in Kolibri" <a href=”{{ KOLIBRI_URL }}/exercise_id”>
* At Kiwix boot time it check if Kolibri is also installed and sets KOLIBRI_URL appropriately
* Kolibri renders exercise form Kolibri content dir
* Student solves exercise in Kolibri
* Note: This idea doesn't make too much sense: presumably OpenZim data distribution for videos only, and no exercises. Maybe this user story is a special case of USER STORY 2.3.1? (once we have content-level linking)
 
 
USER STORY 2.5. As a student learning about "Topic X" in Kolibri, I can search for supporting material withing the Kiwix installation
* Working on exercise in Kolibri interface
* Click on "Search Library" function
* API call to Kiwix indexes to search within all OpenZim files installed in Kiwix
* Clicking on a result opens resource in Kiwix (in new tab)
* Switch back to Kolibri tab to finish exercise
 
 
 
 
=== Android integration ===
 
* How can we know if both apps are installed?
* Discuss future deep linking between apps
** See APPENDIX A with custom scheme for ACTION_VIEW
* Note: better pursue content backend integration and server integration instead of Android since the dominant use case is "small server through the web"
 
 
 
 
 
=== Dev setup ===
 
# Kolibri <ref>[http://github.com/learningequality/kolibri Kolibri Github]</ref>,
docs <ref>[http://kolibri.readthedocs.io/en/master/ Kolibri docs]</ref>,
demo <ref>[http://kolibridemo.learningequality.org/ Demo]</ref>
# Content Curation Server
 


== Trying Kolibri ==
== Trying Kolibri ==


Online demo: http://kolibridemo.learningequality.org/
Online  


'''''Please note that Kolibri is alpha software - we do not recommend deploying it before later this year. Also, please do not share/promote it externally yet, as we are still stabilizing it and streamlining the UX for public usability.'''''
'''''Please note that Kolibri is alpha software - we do not recommend deploying it before later this year. Also, please do not share/promote it externally yet, as we are still stabilizing it and streamlining the UX for public usability.'''''
Line 33: Line 197:
In case you find an issue, feel free to ask in [http://community.learningequality.org/ the community forum] or file an issue [http://github.com/learningequality/kolibri/issues/ on Github].
In case you find an issue, feel free to ask in [http://community.learningequality.org/ the community forum] or file an issue [http://github.com/learningequality/kolibri/issues/ on Github].


== Integration focus areas ==


=== Cross-linking between platforms ===
TODO: before hackathon
* Docker compose file for content pipeline (fast install dev environment)
** CCServer
** Kolibri
** KA-lite (KA-content packs?)
** Kiwix
** Example sushichef in dev mode project  (install -e .)
** Example openzim project in dev mode project  (install -e .)
** High level intro to Kolibri and Kolibri content pipeline. Explain using above setup how content starts from a local dir + youtube links into a running Kolibri instance.
* Update KiwixKolibri wiki page
* Link to KiwixKolibri page from main event page
 


==== Shallow-linking ====
From Kolibri: detect that Kiwix is installed, get an index of OpenZIM bundles and their metadata, and show links to the corresponding Kiwix URLs alongside the Kolibri channel list


From Kiwix: _____


==== Deep-linking ====


A more general version of cross-linking to resources between the platforms. Possibly based either on a GUID or URI approach (which will likely be implemented in some form for cross-linking within Kolibri channels anyway), or through shared metadata/tagging schemes.


From Kiwix: Say you export a zim of a Kolibri channel which has an exercise, then we can use a placeholder with a deep link back to Kolibri.


From Kolibri: Instead of trying to fit in a Wikipedia zim, we can find a mechanism to add links as related contents. Like "Want to learn more about atomic fusion, read about it on Wikipedia".


=== Importing/Exporting content ===


==== Exporting Kolibri channels to Zim ====


Static contents like videos in Khan Academy or Sikana.tv can be exported as a static zim, given we use the meta data (topic trees) for navigation + some template parameters like title, logo and colors.
== More ideas ==
 
* Special purpose Zim files for Wikipedia content that we can link to from within Kolibri content.
** USE CASE: a Kolibri channel on fractions fractions + associated zim file
** channel is a topic tree + videos + exercises + new node type (KiwixRef)
** e.g. KiwixRef link to Wikipedia page fractions opens Kiwix in a new tab
** Kiwix renders a custom ZIMfile that conains fractions + 3 links deep
 
* Stickers & Swag
** Kolibri <3 Kiwix (Lovebirds :) )
 
(please add your ideas here)
 
 
 


==== Importing from a Zim into a Kolibri channel ====
== References ==


Importing a Zim into a channel in the [http://contentworkshop.learningequality.org/ Kolibri Content Curation server]: Build a "sushi chef" script (using the ricecooker) to create a topic tree by traversing the content within the Zim. Depending on the format of the content in the zim, this might be a topic tree with videos, or in the Kolibri "HTML5 app" format, a set of pages that will be iframed. May not be very useful for something like all of Wikipedia, but can be useful for smaller Zim projects (or ones with a lot of rich media files).
<references />


* '''Benefit''': Someone can start creating '''exercises''' and '''re-organizing''' for a specific educational purpose
* '''Benefit''': Other channels can include new learning materials from already existing Zim resources


=== Shared OPDS standard ===


Aligning standards of exporting meta data to OPDS, such that Kiwix Zim resources and Kolibri Channels can be searched and browsed through the same interfaces. Collaborate with Tim Moody on this.
== Appendix A: Technical notes about deep-linking integration on Android ===


=== Integration on Android ===
Using Intents to cross-link between the Kolibri and Kiwix apps. Useful links:
Using Intents to cross-link between the Kolibri and Kiwix apps. Useful links:
# [https://developer.android.com/training/basics/intents/index.html Intent basics]
# [https://developer.android.com/training/basics/intents/index.html Intent basics]
# [https://developer.android.com/reference/android/content/Intent.html Intent class]
# [https://developer.android.com/reference/android/content/Intent.html Intent class]
Line 119: Line 293:
         </intent-filter>
         </intent-filter>
     </activity>
     </activity>
To verify there is an activity available that can respond to the intent, call <code>queryIntentActivities()</code> to get a list of activities capable of handling your <code>Intent</code>. If the returned <code>List</code> is not empty, you can safely use the intent. For example:
 
To verify there is an activity available that can respond to the intent, call <code>queryIntentActivities()</code> to get a list of activities capable of handling your <code>Intent</code>. If the returned <code>List</code> is not empty, you can safely use the intent. For example:
  PackageManager packageManager = <code>getPackageManager()</code>;<br>
  PackageManager packageManager = <code>getPackageManager()</code>;<br>
  List = activities = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
  List = activities = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
  boolean isIntentSafe = activities.size() > 0;
  boolean isIntentSafe = activities.size() > 0;
If <code>isIntentSafe</code> is <code>true</code>, then we know that the intent-receiving app is installed and will respond to the intent.
If <code>isIntentSafe</code> is <code>true</code>, then we know that the intent-receiving app is installed and will respond to the intent.
 
== Stickers & Swag ==
 
# Kolibri <3 Kiwix (Lovebirds :) )
 
 
== References ==
 
<references />
16

edits

Navigation menu