OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Unable to LoadComponentFromURL in Python?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Aug 20, 2003 12:27 pm    Post subject: Unable to LoadComponentFromURL in Python? Reply with quote

Okay, next Python to OOo problem I'm having.

From the Desktop object, I am unable to even call LoadComponentFromURL.

I get the Desktop object, roughly like this...

Code:
import uno

# get the uno component context from the PyUNO runtime
oLocalContext = uno.getComponentContext()

# create the UnoUrlResolver
oLocalResolver = oLocalContext.ServiceManager.createInstanceWithContext(
            "com.sun.star.bridge.UnoUrlResolver", oLocalContext )

# connect to the running office             
OOo_Context = oLocalResolver.resolve( "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext" )

# get the ServiceManager object
OOo_ServiceManager = OOo_Context.ServiceManager

# get the central desktop object
OOo_Desktop = OOo_ServiceManager.createInstanceWithContext( "com.sun.star.frame.Desktop", OOo_Context )


Now, I can look at a method like this...

Code:
>>> OOo_Desktop.getComponents
<PyUNO_callable object at 0x01A8E320>


and see that it is a callable method. But if I try to look at method LoadComponentFromURL, there is no such method...

Code:
>>> OOo_Desktop.LoadComponentFromURL
Traceback (most recent call last):
  File "<pyshell#37>", line 1, in ?
    oDesktop.LoadComponentFromURL
AttributeError: LoadComponentFromURL


So I'm not surprised that I cannot even call LoadComponentFromURL, the method doesn't even seem to be in the Desktop object, from Python's perspective.

Any idea what's up?
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Aug 20, 2003 12:44 pm    Post subject: Reply with quote

I think I got it now. All the methods are case sensitive.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group