Hi Fella's,

First of all, I'm sending this message to both the users as well as the
developers list mainly because I haven't seen any activity on the Users list
and I do want my question to get answered. If this is the wrong aproach,
please tell me ;)

So, I'm still pretty new to MMBase, even new to Java but I think I've gotten
pretty far already. In the basics, that is. Made quite and advanced
application, with quite some relations and builders. And that all seems to
work. Added a JAVA class to some builders, works fine too. That is, it gets
linked but I cannot do much with it yet, besides doing some basic
manipulation of parameters. Now I've doven into the wonderful world of
calling functions in the prefered 1.7.0-rc1 way. But all I get are messages
in my logs I cannot get much further with. The things:

 - I'm trying stuff with my vmUsers builder, which has a classfile entry of
<classfile>com.medialab.builders.vMuseum.User</classfile> and of course some
fields that are of no interest for now
 - Basically, there are three scenario's I want to call functions on
        1. To Login, with a function Login(String userName, String
passWord); returning one single node, either the User that matches with the
username and password or an empty one with some default values. The website
allows users not to be logged in, but will tailor stuff for users who are
logged in.
        2. To Logout, destroying the session .. this is a void
        3. registerLocation(Double longitude, Double lattitude); when
someody clicks on a map, this click is registered and a list of vmLocations
nodes will be returned for near Locations. Like "Het Buitenhof", here in The
Hague.

(from now on, "probably" is assumed untill stated otherwise)

For scenario one, I was guessing that <mm:listnodefunction> would be the
best approach, returning a list of just one vmUsers object. Now, since
Michiel suggested me to use <mm:functioncontainer> to handle parameters and
return values. I was guessing something like:

        <mm:functioncontainer>
                <mm:param value="username" />   
                <mm:param value="password" />
                <mm:nodelistfunction name="Login">
                        // and here my user would exist
                </mm:nodelistfunction>
        </mm:functioncontainer

But that doesn't work, resulting in 

        org.apache.jasper.JasperException: /vmtesting/User.jsp(7,2)
According to the TLD attribute name is mandatory for tag param

and a stacktrace on my screen.

In scenario two, I'll basically have to call <mm:voidfunction
name="Logout()" /> in some sort of context where a vmUsers node exists.
Resulting in:

2004-02-04 15:08:54,187 WARN    mmbase.util.functions.NodeFunction - Trying
to use unknown function 'Logout()' on builder 'vmUsers'
2004-02-04 15:08:54,187 WARN    jsp.taglib.functions.AbstractFunctionTag -
Could not find parameter definition for function 'Logout()', trying without
definition.

in my logs.

Scenario three is basically the same as one, actually .. won't go into more
detail since this is already getting to be a very long message.

In my JAVA file, I've defined a class User (public class User extends
MMObjectBuilder), and overridden the executeFunction method. In it is a set
of if-statements like: if (function.equals("Login")) { } else if
(function.equals("Logout")) {} else if ( .. and so on. Only things there are
some resting return values. like * return "Yeah .. dude .. swelly!"; *. I
did get that on my screen when I used the old thing <mm:field
name="Logout()" />.

Now, the question basically comes down to: what should I do to get it
working? As you might have guessed, I'm trying to use no java code in my
.jsp files at all.

So, all good for everybody who made it all the way through my text and thank
you very much already !
Wouter




Reply via email to