7 XML Week Web WebOS WebShell WebOS WebOS GUI WebOS WebOS 2
WebOS aplat WebOS WebOS 3 XML Yahoo!Pipes Popfry UNIX grep awk XML GUI WebOS GUI GUI 4 CUI
CUI JavaScript I/O CommandClass WebShell webshell CommandClass CommandClass WebShell WebOS Web 5 html, JavaScript POST /CUI_WebOS/ActionServlet?command=get&url= POST /CUI_WebOS/ActionServlet?command=post&url= POST /CUI_WebOS/ActionServlet?command=put&url= POST /CUI_WebOS/ActionServlet?command=delete&url= HTTP WebShell post put HTTP RESTFul GET, POST, PUT, DELETE HTTP GET, POST, PUT, DELETE OK 6
7 echo abcdefg, XML, set aaa abcdefg unset aaa $ echo $aaa XPath echo $xml//root/child1 $con, $CR, $PLUS, $SPACE, $$ < abcdefg > $aaa ; >> $aaa ; 8
HTTP cat http://www.google.co.jp/search?q=hogehoge get http://www.google.co.jp/search?q=hogehoge post http://localhost:8080/xmldb/archive/123/tags < name=value RESTFul get, post, put, delete cd http://www.google.co.jp/ get index.html get http://www.google.co.jp/index.html WebOS ls http://www.youos.com/aramoto/youos/ WebShell POST 9 WebShell GET, POST, PUT, DELETE Web Web WebOS WebOS login http://www.youos.com WebOS HTTP GET http://www.youos.com/api?apiname=login&username=aramoto&password=xxxx <apiresult name= login status= OK > <login auth= 1 user= aramoto token= TiZDPv... cookie_domain=".youos.com" /> </apiresult> WebShell token 10 WebShell WebOS
WebOS WebOS cat http://hogehoge/test.txt GET http://hogehoge/test.txt YouOS cat http://www.youos.com/aramoto/youfs/test.txt WebOS GET http://www.youos.com/api?apiname=fs_read&path=/aramoto/youfs/test.txt&est=tizdpv... <apiresult name= fs_read status= OK > <read path= /aramoto/youfs/test.txt filename= test.txt mimetype= text/plain > <![CDATA[ ]]></read> </apiresult> 11 WebOS WebOS XML XML get http://hogehoge/aaa.xml > $xml XPath echo $xml//root/child1/child2[position()=1] echo $xml/count(//root/child1/child2) echo $xml//root/child1/child2[position()=1] > $xmlsub XML echo 12345 > $xml//root/child1/child2[position()=1]/id/text() evaluate() echo 12345 > $xmlsub//child2/id/text() echo $xml//root/child1/child2[position()=1] > $newxml//a/b echo $xml//root/child1/child2[position()=1] >> $newxml//a/b echo $xml//root/child1/child2[position()=1] >>> $newxml//a/b >>> b 12
XML $xml <?xml version="1.0" encoding= UTF-8"?> <root> <child1> <name>aaaaaaaaaaaa</name> <id>00-2222</id> <name>bbbbbbbbbbbb</name> <id>00-3333</id> <name>cccccccccccc</name> <id>00-4444</id> <name>dddddddddddd</name> </child1> </root> $xmlsub <name>aaaaaaaaaaaa</name> Xpath $xmlsubsub 13 XML $xml <?xml version="1.0" encoding= UTF-8"?> <root> <child1> <id>12345</id> <name>aaaaaaaaaaaa</name> <id>00-2222</id> <name>bbbbbbbbbbbb</name> <id>00-3333</id> <name>cccccccccccc</name> <id>00-4444</id> <name>dddddddddddd</name> </child1> </root> $xmlsub <id>12345</id> <name>aaaaaaaaaaaa</name> XML $xmlsubsub <id>12345</id> 14
XML for CSV for $xml//root/child1/child2 $work echo $work//child2/id/text()+,+$work//child2/n ame/text()+,,,+$cr >> $csv XML for $xml//root/child1/child2 $work get http://wikipedia.simpleapi.net/api?output=x ml&keyword=+$work//child2/name/text() echo $con//results > $work//child2/ wikipedia 15 match regexp grep regexp replace regexp newstring HTML XHTML xhtml XML xmls edit save $xml view $html clear 16
JavaScript JavaScript exec function(){ alert ("test"); } exec $js WebShell exec function(){ webshell.execute ("echo $xml//root/child1/child2"); } WebShell exec function(){ var x=webshell.getenv("xml"); alert (x); } exec CommandClass.prototype.hello = function(args){ alert ("hello"); } 17 echo set unset cat url get url post url put url delete url cd url ls [url] login WebOS [ ] [ ] clear logout WebOS >, >>, >>> ; match regexp grep regexp [regexp]... replace regexp newstring xslt xml xsl xhtml [html] xmls [xml] for... edit [ ] save [ ] view [ ] exec JavaScript $ $ //XPath 18
Firefox2 XPath evaluate( ) location.href = "data:application/octet-stream,. ; cat, get, post, put, delete for exec 19 HTML+JavaScript 2.2KStep prototype.js Servlet 0.2KStep ServletAPI JavaScript replace JavaScript IE Firefox2 20
WebOS YouOS aplat SAML, OpenID, OAuth, JavaScript or POST XML HTTP Cookie >>> 21 Shell CUI XML