{"id":84,"date":"2008-07-18T16:22:31","date_gmt":"2008-07-19T00:22:31","guid":{"rendered":"http:\/\/www.antunkarlovac.com\/blog\/?p=84"},"modified":"2008-07-18T16:22:31","modified_gmt":"2008-07-19T00:22:31","slug":"debugging-solo-applications","status":"publish","type":"post","link":"https:\/\/www.antunkarlovac.com\/blog\/2008\/07\/18\/debugging-solo-applications\/","title":{"rendered":"Debugging SOLO Applications"},"content":{"rendered":"<p>The <a href=\"http:\/\/labs.openlaszlo.org\/trunk-nightly\/docs\/developers\/debugging.html\" target=\"_blank\">OpenLaszlo debugger<\/a> is a very versatile tool. You can use it for everything from <a href=\"http:\/\/forum.openlaszlo.org\/showthread.php?t=28\" target=\"_blank\">tracing output<\/a>, to <a href=\"http:\/\/forum.openlaszlo.org\/showthread.php?t=59\" target=\"_blank\">analyzing the state of objects within your application at runtime<\/a>, to tracking-down memory leaks. The debugger requires the OpenLaszlo server to be present, but works with SOLO applications &#8211; provided the SOLO application can access server. Naturally, while developing a SOLO OpenLaszlo application, you want to have the full capabilities of the debugger available to you.<\/p>\n<p>To achieve this your development workflow should involve:<\/p>\n<ol>\n<li>Make sure the debugger is enabled in the canvas (debug=&#8221;true&#8221;).<\/li>\n<li>Change your LZX source file(s).<\/li>\n<li>Recompile by accessing the application in your browser (i.e. http:\/\/localhost:8080\/lps-version\/&#8230;\/my-app.lzx).<\/li>\n<li>Use the debugger.<\/li>\n<\/ol>\n<p>The above will work fine for both SOLO and proxied OpenLaszlo applications, since you&#8217;re accessing the LZX directly. What happens when you want to have a custom HTML wrapper page? You may <em>have <\/em>to access your OpenLaszlo application via a wrapper page if, say, you pass parameters from the wrapper page to your own application. In a SOLO application, your SWF will probably be embedded in a custom wrapper page like the following. (This is the new 4.1 embed code, the embed code for 4.0.12 looks a little different):<\/p>\n<p><code>lz.embed.swf({url: 'main.lzx.lzr=swf8.swf?myparam=123', bgcolor: '#ffffff', width: '800', height: '600', id: 'lzapp', accessible: 'false'});<\/code><\/p>\n<p>As an example, I&#8217;ve added a myparam paramaNote the direct reference to the compiled SWF file. If you run the above application with the debugger open, it will throw the following error:<\/p>\n<blockquote><p><em>Debugger cannot contact LPS server, switching to SOLO mode.<\/em><\/p><\/blockquote>\n<p>At this point, the debugger can trace output from Debug.write() statements in your code, but it won&#8217;t be able to execute arbitrary code you type into it, or many of its other useful features. To fix this, when developing SOLO applications within a custom wraper page, you should embed the application as follows:<\/p>\n<p><code>lz.embed.swf({url: 'main.lzx?lzt=swf&amp;lzr=swf8&amp;myparam=123', bgcolor: '#ffffff', width: '800', height: '600', id: 'lzapp', accessible: 'false'});<\/code><\/p>\n<p>Since you specify that the application is SOLO in your LZX code, the returned SWF will be a SOLO OpenLaszlo application, but it will have access to the server too. I wouldn&#8217;t recommend using the command-line compiler for development.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>The OpenLaszlo debugger is a very versatile tool. You can use it for everything from tracing output, to analyzing the state of objects within your application at runtime, to tracking-down memory leaks. The debugger requires the OpenLaszlo server to be present, but works with SOLO applications &#8211; provided the SOLO application can access server. Naturally, &hellip; <a href=\"https:\/\/www.antunkarlovac.com\/blog\/2008\/07\/18\/debugging-solo-applications\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Debugging SOLO Applications<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/84"}],"collection":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/comments?post=84"}],"version-history":[{"count":0,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/84\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/media?parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/categories?post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/tags?post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}