« Return to Thread: [Bug 616] New: Problem with accessing mountpoint methods from another application

[Bug 616] New: Problem with accessing mountpoint methods from another application

by Bugzilla from bugzilla-daemon@helma.at :: Rate this Message:

Reply to Author | View in Thread

http://helma.org/bugs/show_bug.cgi?id=616

           Summary: Problem with accessing mountpoint methods from another
                    application
           Product: Helma
           Version: CVS trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: HopObject Functionality
        AssignedTo: helma-dev@...
        ReportedBy: interface@...


I have an application "foo" with a prototype Bar which is a mountpoint of Root:

Root.properties
===============
bar = mountpoint(Bar)

A method "test" is available in Bar:

Bar.js
======
Bar.prototype.test = function() {
   return true;
}

Thus, I can execute code like the following:

res.write(root.bar.test());
// true

When I try to access the test() method from within another application I get an
exception:

var server = Packages.helma.main.Server.getServer();
var app = server.getApplication("foo");
var rewt = app.getDataRoot();
var mountpoint = rewt.bar; // This is mountpoint(Bar) of Root in foo
mountpoint.test() // Method is defined in Bar but the call throws an exception

However, the mountpoint itself is available:

res.write(mountpoint);
// [object HopObject]

And it has the basic HopObject properties:

res.write(mountpoint._id);
// bar

res.write(mountpoint.get);
// function get() { [native code, arity=1] }

Am I doing something silly here or could it be that Helma is missing to add the
correct methods and properties to the (somehow remotely) retrieved prototype?


--
Configure bugmail: http://helma.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
Helma-dev mailing list
Helma-dev@...
http://helma.org/mailman/listinfo/helma-dev

 « Return to Thread: [Bug 616] New: Problem with accessing mountpoint methods from another application

LightInTheBox - Buy quality products at wholesale price