Introduction to ORML

kavulix

This guide will attempt to walk you through the process of creating your first ORML feed. The first step in creating a new Roku channel with OpenRokn is to create a primary ORML feed. Open a WYSIWYG editor like notepad or gedit or mousepad and create a new document. Save the document as primary-feed.xml. Copy all of the text between the two lines below into your new document.


<?xml version="1.0" encoding="UTF-8"?>

<orml version="1.1" xmlns="http://sourceforge.net/p/openrokn/home/ORML">
   <channel>

   </channel>
</orml>

The next step is to create either a poster item or a grid item. This will be the first screen that is displayed when your channel first loads. For the purposes of this guide we will use a poster item. This item does not require a poster url or shortdesc since it is displayed immediately and is not embedded within another poster or grid screen.


<?xml version="1.0" encoding="UTF-8"?>

<orml version="1.1" xmlns="http://sourceforge.net/p/openrokn/home/ORML">
   <channel>
      <item type="poster"
            style="flat-category"
            title="Home">

      </item>
   </channel>
</orml>

At this point you can begin adding media objects like videos or slideshows or if you plan on categorizing your media you can begin adding additional poster screens. For example, let's say that you are creating a channel for book reviews and you want to categorize the reviews by the book's genre. You might choose to create a separate poster screen for each genre. The example below shows what this might look like.


<?xml version="1.0" encoding="UTF-8"?>

<orml version="1.1" xmlns="http://sourceforge.net/p/openrokn/home/ORML">
   <channel>
      <item type="poster"
            style="flat-category"
            title="Home">
         <item type="poster"
               style="flat-episodic-16x9"
               title="Mystery"
               shortdesc="Mystery novels"
               sdposterurl="pkg:/images/sddocuments.png"
               hdposterurl="pkg:/images/hddocuments.png">
         </item>
         <item type="poster"
               style="flat-episodic-16x9"
               title="Action"
               shortdesc="Action novels"
               sdposterurl="pkg:/images/sddocuments.png"
               hdposterurl="pkg:/images/hddocuments.png">
         </item>
         <item type="poster"
               style="flat-episodic-16x9"
               title="Biographies"
               shortdesc="Biographies"
               sdposterurl="pkg:/images/sddocuments.png"
               hdposterurl="pkg:/images/hddocuments.png">
         </item>
      </item>
   </channel>
</orml>

You now have a primary feed that will display a poster screen when the channel first loads and on that poster screen it will contain 3 posters, each representing a separate group of book reviews. From here you can either embed the audio or video items directly into the primary feed or you can use the feedurl attribute to populate the poster screens. The example below uses the feedurl attribute to populate the Mystery poster screen, embeds an external document directly into the Action poster item and embeds an audio item directly into the Sports Non-fiction poster item.


<?xml version="1.0" encoding="UTF-8"?>

<orml version="1.1" xmlns="http://sourceforge.net/p/openrokn/home/ORML">
   <channel>
      <item type="poster"
            style="flat-category"
            title="Home">
         <item type="poster"
               style="flat-episodic-16x9"
               title="Mystery"
               shortdesc="Mystery novels"
               sdposterurl="pkg:/images/sddocuments.png"
               hdposterurl="pkg:/images/hddocuments.png"
               feedurl="http://yourdomain.com/mysterynovels.xml"/>
         <item type="poster"
               style="flat-episodic-16x9"
               title="Action"
               shortdesc="Action novels"
               sdposterurl="pkg:/images/sddocuments.png"
               hdposterurl="pkg:/images/hddocuments.png">
            <item type="document"
                  title="Josh Klein: Big in the IT Business"
                  shortdesc="Interview with Josh Klein"
                  sdposterurl="pkg:/images/sddocuments.png"
                  hdposterurl="pkg:/images/hddocuments.png"
                  url="http://www.simple-talk.com/opinion/opinion-pieces/josh-klein-big-in-the-it-business/"
                  striphtml="true"
                  stripews="true"
                  regexfilter="^.*?\&lt;[dD][iI][vV]\s+id\=\x22?pretty\x22?\&gt;|\&lt;/[dD][lL]\&gt;\&lt;/[dD][iI][vV]\&gt;.*$"/>
         </item>
         <item type="poster"
               style="flat-episodic-16x9"
               title="Sports Non-fiction"
               shortdesc="Sports Non-fiction"
               sdposterurl="pkg:/images/sddocuments.png"
               hdposterurl="pkg:/images/hddocuments.png">
            <item type="audio"
                  title="Wayne Gretzky's Ghost: And Other Tales from a Lifetime in Hockey"
                  shortdesc="Interview with Roy MacGregor"
                  sdposterurl="http://newbooksnetwork.com/wp-content/nbn_square_logos/sports_300x300.png"
                  hdposterurl="http://newbooksnetwork.com/wp-content/nbn_square_logos/sports_300x300.png"
                  released="2012"
                  length="3697"
                  url="http://files.newbooksnetwork.com/sports/027sportsmacgregor.mp3"
                  bitrate="64"
                  cid="1d8eb79bdf3f3b7c26537d071deaea7d"
                  enableemailmebtn="true"
                  enableemailfriendbtn="true"
                  enablereportstreambtn="true"
                  format="mp3"/>
         </item>
      </item>
   </channel>
</orml>

It's important to remember that if you use the feedurl attribute then its url must point to a file in orml format. If you have a xml file that you want to use to populate a poster or grid screen and it is not in orml format then you have a couple of options. The first is to use the usetemplate attribute. The second is to use the ormlGenerator.php script included in the ormlUtilities archive. The first option is described in greater detail on the Introduction to OpenRokn Templates page.

There is no limit to the number of poster or grid screens that you can use in a channel. If you need multiple sub-categories then just continue to create additional poster items for each sub-category. The example below shows 3 nested poster screens.


<?xml version="1.0" encoding="UTF-8"?>

<orml version="1.1" xmlns="http://sourceforge.net/p/openrokn/home/ORML">
   <channel>
      <item type="poster"
            style="flat-category"
            title="Home">
         <item type="poster"
               style="flat-episodic-16x9"
               title="Biographies"
               shortdesc="Biographies"
               sdposterurl="pkg:/images/sddocuments.png"
               hdposterurl="pkg:/images/hddocuments.png">
            <item type="poster"
                  style="flat-episodic-16x9"
                  title="Sports"
                  shortdesc="Sports"
                  sdposterurl="pkg:/images/sddocuments.png"
                  hdposterurl="pkg:/images/hddocuments.png">
               <item type="poster"
                     style="flat-episodic-16x9"
                     title="Hockey"
                     shortdesc="Hockey"
                     sdposterurl="pkg:/images/sddocuments.png"
                     hdposterurl="pkg:/images/hddocuments.png"
                     feedurl="http://yourdomain.com/hockeybiographies.xml"/>
            </item>
         </item>
      </item>
   </channel>
</orml>

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.