tosh has asked for the wisdom of the Perl Monks concerning the following question:

I have recently decided I really like the Everything Engine, really really like...

But then I thought, what if I have to be able to display my Everything-based website on a mobile phone...

Here I got stuck.

I decided to look into Everything and see how much I could separate the presentation layer. The docs lead me to test with the Chatterbox like this:
#!/usr/bin/perl use Everything; initEverything('DATABASE') or die "Couldn't connect to database!\n"; my $node = getNodeById(287) or die "Can't get chatterbox node!\n"; my $nl = updateNodelet($node); # insertNodelet didn't work either print $nl;
Well that didn't work because the chatterbox calls to $USER and makes some other function calls which aren't in the namespace.

So reading the documentation I see that I can create $USER from EVERYTHING::HTML and also access the updateNodelet and insertNodelet functions but...

Ok this starts to get convoluted, so here's the question:

I see that PerlMonks now has the option to view a node in XML mode, I would be so ridiculously happy to write some code like this:
# filename = displayInMobilePhone.cgi use Everything; $chatter = getNode('chatterbox'); $loggedUsers = getNode('other users'); $chatter->makeXML; $loggedUsers->makeXML; ...other stuff... use Template; use XML::Simple; # or your personal choice $display = new Template(...); $xml = new XML::Simple(...); $chatterDATA = $xml->XMLin($chatter->{XML}); $usersDATA = $xml->XMLin($loggedUsers->{XML}); $display->parse('mobile.template', {chatter => $chatterDATA, users => +$usersDATA}); ....ta-da done!!!!!
Can I do this?

Please....?

Tosh

Replies are listed 'Best First'.
Re: Life, the Universe, and an Everything question
by PodMaster (Abbot) on Jul 25, 2002 at 13:36 UTC
    Well that didn't work because the chatterbox calls to $USER and makes some other function calls which aren't in the namespace.

    My experience with the everything engine (to which i commonly refer as the e2 engine, just because it runs everything2.com), has only been via the web interface (ie i don't see any of that stuff you got there), so the simplest thing to do here iis create a new node (superdoc or whatever), and if you need, a new display type (one without any container), and just stick all that template stuff in there.

    the chatterbox nodelet is located at node=chatterbox;type=nodelet;, and if you visit it on your website, and you got enough power, you can view source, so just go ahead and do that, and you'll see that it's not that complicated (a select here and there, and a call to parselinks and maybe parsecode - if you got it ) and that is it.

    What you are doing is a little crazy, cause that's not how the Everything engine was meant to be run ~ you'll have more trouble figuring it out that just sticking to how everybody else (ie me) does it (that's how everything hackers do it, and they are a few).

    ____________________________________________________
    ** The Third rule of perl club is a statement of fact: pod is sexy.