Andriy; The basic problem seems to be one of accessing the URL in a workspace project - if that's what is meant by "But I need a local solution.".
You can address a folder in a project named tbl-www via the URL <server>/data/<project name>/. For example a file in the project myexample.tq.com with the path name tbl-www/index.html is addressed on TBL Personal server as: http://localhost:8083/tbl/data/myexample.tq.com/index.html -- Scott On Jul 1, 8:46 am, Andriy Sokolov <[email protected]> wrote: > By the way I'v tested it using "libs_js" at www, and it works: > > function loadJS(){ > var scr = document.createElement('script'); > scr.setAttribute('type', 'text/javascript'); > scr.setAttribute('src', 'http://www.xxxxx/libs_js/api/main- > api.js'); > document.getElementsByTagName("head")[0].appendChild(scr); > > } > > But I need a local solution. > > Thanks > Andriy > > On 1 Jul., 14:35, Andriy Sokolov <[email protected]> wrote: > > > Hello everybody! > > > Apologizing for unclarities, I try to start once again. > > > I want to use some custom javascript libraries "libs_js", that > > generate some html code for visualizing an ontology, in Ensemble. This > > scripts can use as a source results of SPARQL query. Therefore I use > > Flesh Builder 4 + Flex SDK 3.2 + Ensemble SDK. The component.swf I > > upload to server of Ensemble. > > > As first, I have a [Activescript + xhtml + my custom javascript > > "div.js"] component (compiled in one component.swf). "div.js" inserts > > a script tag: > > > function loadJS(){ > > var scr = document.createElement('script'); > > scr.setAttribute('type', 'text/javascript'); > > scr.setAttribute('src', 'libs_js/api/main-api.js'); > > document.getElementsByTagName("head")[0].appendChild(scr); > > > } > > > and creates a new <DIV id="myDiv"> and use methods from "libs_js". > > > I tested it in a simple HTML-file and it works fine. > > > But in Ensemble the jetty server cannot find "libs_js" if I place it > > into the "C:\Dokumente und Einstellungen\sokolov\workspace > > \server.topbraidlive.org\dynamic\components\" folder (where > > component.swf lies). I become the following message: > > > HTTP ERROR 404 > > Problem accessing /tbl/app/server.topbraidlive.org/dynamic/ > > applications/New%20Application.n3/-/server.topbraidlive.org/examples/ > > libs_js/api/main-api.js. Reason: > > Could not find: server.topbraidlive.org/examples/libs_js/api/main- > > api.js from (/server.topbraidlive.org/dynamic/applications/New > > Application.n3/-/server.topbraidlive.org/examples/libs_js/api/main- > > api.js) > > Powered by Jetty:// > > > (I can see it only through firebug add-on from mozilla) > > > It is something strange for me how and where does jetty looking for > > "libs_js/api/main-api.js".. > > Where should I place "libs_js" and how do I refer to them? > > > Hopefully my question is much more clear for you now :) > > > Regards, > > Andriy > > > On 30 Jun., 20:38, "Irene Polikoff" <[email protected]> wrote: > > > > To add more, you also have an option of using TBL Flex SDK (accessible > > > from > > > the console) to develop either a complete Flex app or a new custom TBE > > > component. If you do the latter, you will need to use the Upload Component > > > link in the SDK to make this component usable within TBE. > > > > -----Original Message----- > > > From: [email protected] > > > > [mailto:[email protected]] On Behalf Of Scott Henninger > > > Sent: Wednesday, June 30, 2010 2:31 PM > > > To: TopBraid Suite Users > > > Subject: [topbraid-users] Re: TBC ME: using swf with html + js > > > > Andriy; You may need to spend some time explaining the context you are > > > starting with. I.e. what do you currently have and what are you > > > trying to accomplish. > > > > <<May be you could say me how I use the personal TopBraidLive server > > > from TBC ME?>> > > > > I'm not sure if you mean Ensemble or not. But to get to the Personal > > > Server console, open a browser and go tohttp://localhost:8083/tbl. > > > From there you can open any model in Ensemble. See the > > > FAQhttp://www.topquadrant.com/products/TBS_FAQ.html#TBE1. > > > > If you want to display html in Ensemble, write a SPARQLMotion script > > > that uses a ReturnText module with HTML/XML contents. set the mime > > > time to text/html and runt he script from Ensemble. A window will pop > > > up with the html displayed. > > > > -- Scott > > > > On Jun 30, 12:39 pm, Andriy Sokolov <[email protected]> wrote: > > > > This is genarally possible. I integrate my custom javascript file into > > > > swf (after compiling it is in the swf). This script should generate > > > > html code (iframe) and refer some other javascripts, that I would > > > > place somewhere on the server, but I dont know where I place them and > > > > how do I refer them..Now I can only refer files (html, images, js...) > > > > in the www. May be you could say me how I use the personal > > > > TopBraidLive server from TBC ME? > > > > > Regards, > > > > Andriy > > > > > On 30 Jun., 15:59, Scott Henninger <[email protected]> wrote: > > > > > > Andriy; Do you mean embedding JavaScript in Flex? I don't think so, > > > > > but you can check with the Flex documentation. > > > > > > -- Scott > > > > > > On Jun 30, 4:48 am, Andriy Sokolov <[email protected]> wrote: > > > > > > > Thanks, Scott! > > > > > > > However my issue is, whether I can embed html code (that use .js for > > > > > > manipulating of it structure) in TopBraidLive components or not? > > > > > > > Thanks, > > > > > > Andriy > > > > > > > On 29 Jun., 15:47, Scott Henninger <[email protected]> > > > > > > wrote: > > > > > > > > Andriy; You can call JavaScript functions through SPINx. See > > > > > > > Help > > > > > > > > SPIN > Using JavaScript to define SPIN/SPARQL Functions. > > > > > > > Basically, > > > > > > > you define a SPIN function an link to to functions defined in a > > > > > > > .js > > > > > > > file. These can be used in any SPARQL query in TopBraid. > > > > > > > > -- Scott > > > > > > > > On Jun 29, 8:34 am, Andriy Sokolov <[email protected]> > > > wrote: > > > > > > > > > Hallo! > > > > > > > > > Is it possible to use within swf plug-in for topBraid some > > > html-code > > > > > > > > using .js-files? > > > > > > > > > Thanks, > > > > > > > > Andriy > > > > -- > > > You received this message because you are subscribed to the Google > > > Group "TopBraid Suite Users", the topics of which include TopBraid > > > Composer, > > > TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN. > > > To post to this group, send email to > > > [email protected] > > > To unsubscribe from this group, send email to > > > [email protected] > > > For more options, visit this group > > > athttp://groups.google.com/group/topbraid-users?hl=en -- You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include TopBraid Composer, TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/topbraid-users?hl=en
