Hey Jeffrey,

2014-07-08 5:24 GMT+02:00 Jeffrey Scott Flesher Gmail <
jeffrey.scott.fles...@gmail.com>:

>  Where I have the executable located, is not where my resource folder is
> located,
> if I have the executable in /usr/bin, and the resources in /home/domain,
> where domain is based on the URL,
> then I want to change the way static files are read by changing the base
> path,
> so that relative paths are based on the URL,
> can this be done?
>

The location of the executable shouldn't matter at all, and Wt is organized
so that even the 'working directory' should not be relevant.
There are two things to distinguish:
 - docroot tells where static resources are being resolved: file path =
f(URL, docroot)
 - approot can be used to load files from within the application, which
acts as a more flexible alternative to 'working directory'

You seem to be wanting to change the 'docroot' but that will make things
messy: instead, why not organize the files inside your docroot so that the
URLs make sense?

Perhaps it's better to explain your problem with a concrete example instead
of in abstract terms.

Can you tell me where the code is that sets the base path and what the
> variable is called?
>

I wouldn't know what is 'the base path' as there is no such concept in Wt
or in a web server?

I can change where I read resources, but some of my pages are iframes to
> html pages with relative links,
> making symbolic links to the content will not work either, since different
> URLs will all have the same relative link,
> they would end up pointing at the same content, which is not what I want.
>

A relative link inside a html page is resolved against the URL of that html
page. You can thus always make sure that different html pages do not
interfere by for example putting them in different folders?

Again an example here would help us to understand better what you want.

Static pages are faster to load, the only workaround I can think of is to
> embed them all as templates or WText,
> since I have no arguments to pass in,
>

I'm not sure what you mean with a static page being faster to load? Wt
itself doesn't use the concept of 'pages'. But your options will be limited
if you rely on iframe's as these are in fact different 'pages' with less
interactivity options.


> but they have javascript in some of the pages, and the Template engine
> does not like that,
> unless there is a way to embed javascript in the template or WText that I
> do not know about to get around this issue.
>

It's in fact browser security restrictions which will not execute
JavaScript that is being loaded in this way dynamically.
But should you not separate 'executable' from 'content' anyway? A WTemplate
allows you to do exactly that: a template may contain placeholders which
can be resolved to plain text but also to widgets which add interactivity
to a 'page'.

Is it faster to link html pages via an iframe, or read them in as a
> Template or WText?
>

In terms of round-trip times (which is what dominates the responsiveness of
your application), WTemplate and WText is faster.

Regards,
koen
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to