Okay, I fixed up my previous error with regards to missing blips (helps
if you create a child blip for the blip you're already in - sigh).

Now I have one more question.

AIUI, Robots don't have global variable persistance (if you set a
variable in one call, it won't be available in the next). What would be
the best way of persisting information across calls.

Right now I'm trying to use the Button Element to carry information
across, but I don't think it's the best way.

def command_Open(properties, context, user, **kwargs):
    """Invoked when a plone address is fed"""
    wavelet = context.GetRootWavelet()
    blip = context.GetBlipById(properties['blipId'])
    urlsub = kwargs.get("PLONE_URL", None)
    plonesite = kwargs.get("PLONE_SITE", None)
    s = xmlrpclib.ServerProxy(plonesite)    
    doc = getattr(s, urlsub)
    plone_text = doc.Title()
    plone_text += "\n"
    plone_text += doc.CookedBody()
    nblipdoc = blip.CreateChild()
    '''dbdoc = plonie_bot_models.documents(plone_site=plonesite,
                                         plone_page=urlsub,
                                         blipid=nblipdoc.GetId()
                                         ) 

    dbdoc.put()'''
    nblipdoc.GetDocument().SetText(plone_text)
    nblipdoc.GetDocument().AppendElement(document.FormElement(

document.ELEMENT_TYPE.BUTTON,

{'name':'approve',

'value':'Approve Changes',

'plone_site':plonesite,

'plone_url':urlsub}
                                                              ))

def onButtonClicked(properties, context):
    button = properties['button']
    blip = context.GetBlipById(properties['blipId'])
    s = xmlrpclib.ServerProxy(button['plone_site'])    
    doc = getattr(s, button['urlsub'])
    doc.SetText(blip.GetDocument().GetText())

Any help would be greatly appreciated.
-- 
James Purser
http://wavingtheshiny.collaborynth.com.au
Wave Addresses: 
[email protected] (wave.google.com)
[email protected] (wavesandbox.com)
[email protected] (collaborynth.com.au FedOne Server)
Skype: purserj1977
GTalk: [email protected]
-- 
James Purser
Collaborynth
http://collaborynth.com.au
Mob: +61 406 576 553
Skype: purserj1977
Twitter: http://twitter.com/purserj

--

You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.


Reply via email to