Difference between revisions of "KMLCode"

From KiSS DP 558 STAGE2 WiKi
Jump to: navigation, search
(Created page with "== What is KML ? == KML stands for Kiss Markup Language. A code in development at KiSS technology that allows internet to be used on the KiSS. It’s like your browser is load...")
(No difference)

Revision as of 10:07, 3 February 2012

What is KML ?

KML stands for Kiss Markup Language. A code in development at KiSS technology that allows internet to be used on the KiSS. It’s like your browser is loading HTML pages, KiSS players can load KML pages on the internet. Features for KML are only limited by the developers imagination and can be used for a wider range of adjustments for KiSS players with Ethernet connection. These KISS players can connect to websites and read pages authored in KML. KML is an XML format.

How ?

KML listen to port 8888

In the /htmlroot/ there is a index.kml file which point to /htmlroot/kml/index.htm. The Kiss player will always check and use this index.kml

Change your background with your remote

  1. Make a kml folder in htmlroot (/stage2/htmlroot/kml/)
  2. Copy a nice background there (for example from stage2/img/), name it "background.jpg". This is the background for your KML page.
  3. Copy one more background there (for example from stage2/img/), name it "newbackground.jpg". This is for show what background you have changed to (later on).
  4. Make a index.htm in /stage2/htmlroot/kml/ with for example this code:
  <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<KMLPAGE>

<!-- BEGIN MENUITEMS --><MENUITEM id='1'>

<ONCLICK><![CDATA[
<GOTO href='http://127.0.0.1/cgi/kmlpic1.cgi' />
]]></ONCLICK>
<ONHILITE><![CDATA[
<TEXT coords='50,100' font='0' pen='69'>Original backdrop (KiSS)</TEXT>
]]></ONHILITE>
<ONUNHILITE><![CDATA[
<TEXT coords='50,100' font='0' pen='255'>Original backdrop (KiSS)</TEXT>
]]></ONUNHILITE>
</MENUITEM>

<!-- BEGIN MENUITEMS --><MENUITEM id='2'>
<ONCLICK><![CDATA[
<GOTO href='http://127.0.0.1/cgi/kmlpic2.cgi' />
]]></ONCLICK>
<ONHILITE><![CDATA[
<TEXT coords='50,130' font='0' pen='69'>Butterfly (Doppie)</TEXT>
]]></ONHILITE>
<ONUNHILITE><![CDATA[
<TEXT coords='50,130' font='0' pen='255'>Butterfly (Doppie)</TEXT>
]]></ONUNHILITE>
</MENUITEM>

<!-- BEGIN MENUITEMS --><MENUITEM id='3'>
<ONCLICK><![CDATA[
<GOTO href='http://127.0.0.1/cgi/kmlpic3.cgi' />
]]></ONCLICK>
<ONHILITE><![CDATA[
<TEXT coords='50,160' font='0' pen='69'>Escher (Meneel Aart)</TEXT>
]]></ONHILITE>
<ONUNHILITE><![CDATA[
<TEXT coords='50,160' font='0' pen='255'>Escher (Meneel Aart)</TEXT>
]]></ONUNHILITE>
</MENUITEM>

<!-- BEGIN MENUITEMS --><MENUITEM id='4'>
<ONCLICK><![CDATA[
<GOTO href='http://127.0.0.1/cgi/kmlpic4.cgi' />
]]></ONCLICK>
<ONHILITE><![CDATA[
<TEXT coords='50,190' font='0' pen='69'>Science Fiction (Trennel)</TEXT>
]]></ONHILITE>
<ONUNHILITE><![CDATA[
<TEXT coords='50,190' font='0' pen='255'>Science Fiction (Trennel)</TEXT>
]]></ONUNHILITE>
</MENUITEM>

<!-- BEGIN MENUITEMS --><MENUITEM id='5'>
<ONCLICK><![CDATA[
<GOTO href='http://127.0.0.1/cgi/kmlpic0.cgi' />
]]></ONCLICK>
<ONHILITE><![CDATA[
<TEXT coords='50,220' font='0' pen='69'>No background (martinb)</TEXT>
]]></ONHILITE>
<ONUNHILITE><![CDATA[
<TEXT coords='50,220' font='0' pen='255'>No background (martinb)</TEXT>
]]></ONUNHILITE>
</MENUITEM>

<!-- BEGIN MENUITEMS --><MENUITEM id='6'>
<ONCLICK><![CDATA[
<GOTO href='http://127.0.0.1/cgi/kmlpic6.cgi' />
]]></ONCLICK>
<ONHILITE><![CDATA[
<TEXT coords='50,250' font='0' pen='69'>My Own Background</TEXT>
]]></ONHILITE>
<ONUNHILITE><![CDATA[
<TEXT coords='50,250' font='0' pen='255'>My Own Background</TEXT>
]]></ONUNHILITE>
</MENUITEM>

<!-- BEGIN MENUITEMS --><MENUITEM id='7'>
<ONCLICK><![CDATA[
<GOTO href='http://127.0.0.1/cgi/reboot.cgi' />
]]></ONCLICK>
<ONHILITE><![CDATA[
<TEXT coords='350,100' font='0' pen='69'>Reboot (no confirmation!)</TEXT>
]]></ONHILITE>
<ONUNHILITE><![CDATA[
<TEXT coords='350,100' font='0' pen='255'>Reboot (no confirmation!)</TEXT>
]]></ONUNHILITE>
</MENUITEM>

<!-- END MENUITEMS -->


<!-- BEGIN contexts -->
<!-- Context : ROOT -->
<FILLRECT coords='0,0,719,479' pen='16' />
<BACKGROUND href='http://127.0.0.1/kml/background.jpg' />
<FILLRECT coords='0,0,719,479' pen='0' />
<!-- Context : MAIN -->
<TEXT coords='50,43' font='1' pen='255'>Backgrounds</TEXT>
<TEXT coords='350,43' font='1' pen='255'>CGI</TEXT>
<FIP speed='3' intensity='6' >Manage your 558</FIP>

<TEXT coords='50,370' font='0' pen='255'>Thanks martinb ;-)</TEXT>

<!-- Context : OVERLAY -->
<!-- END contexts -->
</KMLPAGE>
<pre>

# Make a file named "change.htm" in /stage2/htmlroot/kml/ with this:
<pre>
 <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<KMLPAGE>
<!-- BEGIN MENUITEMS --><MENUITEM id='1'>
<ONCLICK><![CDATA[
<GOTO href='http://127.0.0.1/kml/index.htm' />
]]></ONCLICK>
<ONHILITE><![CDATA[
<TEXT coords='50,100' font='0' pen='69'>Go back</TEXT>
]]></ONHILITE>
<ONUNHILITE><![CDATA[
<TEXT coords='50,100' font='0' pen='255'>Go back</TEXT>
]]></ONUNHILITE>
</MENUITEM>
<!-- END MENUITEMS -->
<!-- BEGIN contexts -->
<!-- Context : ROOT -->
<FILLRECT coords='0,0,719,479' pen='16' />
<BACKGROUND href='http://127.0.0.1/kml/newbackground.jpg' />
<FILLRECT coords='0,0,719,479' pen='0' />
<!-- Context : MAIN -->
<TEXT coords='50,43' font='1' pen='255'>This is your new background!</TEXT>
<!-- Context : OVERLAY -->
<!-- END contexts -->
</KMLPAGE>
  1. Make new CGIs (copy the old ones and give them new names "kmlpic#.cgi"), and change them like this:
    1. kmlpic0.cgi
#!/bin/hush
echo Content-type: text/html
echo
rm /hdd/stage2/img/backdrop.jpg
rm /hdd/stage2/htmlroot/kml/newbackground.jpg
cat /hdd/stage2/htmlroot/kml/change.htm
sleep 1
    1. kmlpic1.cgi
#!/bin/hush
echo Content-type: text/html
echo
cp /hdd/stage2/img/kissorg.jpg /hdd/stage2/img/backdrop.jpg
cp /hdd/stage2/img/kissorg.jpg /hdd/stage2/htmlroot/kml/newbackground.jpg
cat /hdd/stage2/htmlroot/kml/change.htm
sleep 1
    1. kmlpic2.cgi
#!/bin/hush
echo Content-type: text/html
echo
cp /hdd/stage2/img/butterfly.jpg /hdd/stage2/img/backdrop.jpg
cp /hdd/stage2/img/butterfly.jpg /hdd/stage2/htmlroot/kml/newbackground.jpg
cat /hdd/stage2/htmlroot/kml/change.htm
sleep 1
    1. kmlpic3.cgi
#!/bin/hush
echo Content-type: text/html
echo
cp /hdd/stage2/img/esher.jpg /hdd/stage2/img/backdrop.jpg
cp /hdd/stage2/img/esher.jpg /hdd/stage2/htmlroot/kml/newbackground.jpg
cat /hdd/stage2/htmlroot/kml/change.htm
sleep 1
    1. kmlpic4.cgi
#!/bin/hush
echo Content-type: text/html
echo
cp /hdd/stage2/img/sf.jpg /hdd/stage2/img/backdrop.jpg
cp /hdd/stage2/img/sf.jpg /hdd/stage2/htmlroot/kml/newbackground.jpg
cat /hdd/stage2/htmlroot/kml/change.htm
sleep 1
    1. kmlpic6.cgi
#!/bin/hush
echo Content-type: text/html
echo
cp /hdd/stage2/img/my.jpg /hdd/stage2/img/backdrop.jpg
cp /hdd/stage2/img/my.jpg /hdd/stage2/htmlroot/kml/newbackground.jpg
cat /hdd/stage2/htmlroot/kml/change.htm
sleep 1

ONE last word about these CGIs : You can NOT use Windows CR (press [Enter] in Windows), you must use Linux LF. For more info about this,

look here or here.

  1. DON'T FORGET to chmod the *.cgi-files to 777. You can use a FTP-Client or open a telnet-window to your KiSS with:
    1. telnet ip-adress (e.g. telnet 192.168.1.55)
    2. Change to the cgi-directory with: cd /hdd/stage2/htmlroot/cgi
    3. And apply the chmod-command like this: chmod 777 kmlpic1.cgi
    4. Do point 3 for every CGI you have done.
  1. I use FreeKiSS 0.6 ( http://freekiss.sourceforge.net/ ), right klick and select Show/Hide
  2. Go to folder Shares - KML links
  3. Add your 558, for example Location: "http://192.168.0.100/kml/index.htm", Name: "My 558".
  4. Move it to the top (faster and easier to select it ) and klick OK
  5. With your remote on 558, go to Menu - PC Link - PC-Link KML start page
  6. Select for example "My 558"
  7. Play around with your KML-site