RavenclawDev: RavenClawDev: reusing agents in another part of atree

Thomas K Harris tkharris+ at cs.cmu.edu
Wed Oct 4 10:41:16 EDT 2006


Yes, Ravenclaw uses this pseudo-galaxy-frame format for the inframe. I wrote
some fix-up code that converts these frames to real galaxy frames, but the
code is in c++. The code snippet follows. This is something that probably
needs to be fixed in Ravenclaw eventually, but there's an installed code
base that depends on the current format, so it will take some coordination.

 

Gal_PrFrame(f);

char* s_inframe = Gal_StringValue(aStr);

if(s_inframe) {

//frame fixup -> ravenclaw embeds inframe frame

ostringstream fixed;

            string notfixed(s_inframe + 1);

            istringstream inotfixed(notfixed);

            fixed << "{c zap ";

            string token;

            do {

                        inotfixed >> token;

                        if(token == "}") break;

                        fixed << ':' << token << ' ';

                        char cpVal[255];

                        inotfixed.ignore();

                        inotfixed.getline(cpVal, 254);

                        fixed << '"' << cpVal << "\" ";

            } while(inotfixed);

            GalUtil_Error("working with fixed version: %s",
fixed.str().c_str());

            Gal_Frame inframe =
Gal_ReadFrameFromString(fixed.str().c_str());

}

 

-Thomas

 

  _____  

From: ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu
[mailto:ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu] On Behalf Of
Basia Mucha
Sent: Wednesday, October 04, 2006 10:22 AM
To: Dan Bohus; Dialog Group CMU
Subject: Re: RavenclawDev: RavenClawDev: reusing agents in another part of
atree

 

Sorry for the last email, I pressed send by mistake.

 

What I wanted to write:

 

We have created a CalendarBackened that receive GFrames from the
DataManagar. 

The GFrame looks like this:

Received frame:
{c java_be.get_events
   :hub_opaque_data {c admin_info
                       :reply_requested 1
                       :session_id "Default"
                       :invoked_stype "java_be" 
                       :tidx 12
                       :provider_id "[8]"
                       :timestamp [array: type GAL_FLOAT_64, 1 elements]
                       :scriptless 1 }
   :session_id "Default" 
   :tidx 12
   :inframe "{
            event_query {
            event_type  CLASS
            }

            }
            " }

I could easity get the inframe by

String tokens = ((String)f.getProperty(":inframe"));

however is there a way to get the event_type without parsing the string
meaning something like

String tokesn =
((String)f.getPropperty(":inframe.event_query.event_type")????

 

Thank You for all your help.



 

On 10/4/06, Basia Mucha <basiamucha at gmail.com > wrote: 

Received frame:
{c java_be.get_events
   :hub_opaque_data {c admin_info
                       :reply_requested 1
                       :session_id "Default"
                       :invoked_stype "java_be" 
                       :tidx 12
                       :provider_id "[8]"
                       :timestamp [array: type GAL_FLOAT_64, 1 elements]
                       :scriptless 1 }
   :session_id "Default" 
   :tidx 12
   :inframe "{
            event_query {
            event_type  CLASS
            }

            }
            " }




-- 
Thanks, 
Basia 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20061004/60f9996e/attachment-0001.html


More information about the Ravenclaw-developers mailing list