Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-25-2008, 03:56 AM
Junior Member
 
Join Date: Aug 2007
Posts: 4
Default Problem retrieving google calendar event entry.

Hi all

I had followed the reference guide closely to successfully quick add a event entry into my google calendar applications. But now when I am trying to retrieve the entry for modifications, exception starts to kick in.

my codes go as below
PHP Code:
if($this->_hasParam('modifyEvent'))
        {
            
//Retrieve information from database
            
Zend_Loader::loadClass('Zend_Auth_Adapter_DbTable');
            
$db Zend_Registry::get('dbAdapter');
            
            
//Modify my own existing event
            //Include libraries and application mode
            
Zend_Loader::loadClass('Zend_Gdata');
            
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
            
Zend_Loader::loadClass('Zend_Gdata_Calendar');
            
Zend_Loader::loadClass('Zend_Http_Client');
            
$service Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
            
            
//Retrieve login info for gmail.
            
$gserver Zend_Registry::get('smtp_config');
                    
            
$user $gserver->smtp->username;
            
$pass $gserver->smtp->password;
                    
            try
            {    
                
$client Zend_Gdata_ClientLogin::getHttpClient($user$pass$service);
            } 
            catch(
Exception $e)
            {
                
//TODO:Generate Error that having trouble logging into google
            
}
            
            
//Create an instance of the Calendar service
            
$service = new Zend_Gdata_Calendar($client);
                
            
//Create a new entry using the calendar service's magic factory method
            
try
            {
                
//$CalendarList = $service->getCalendarListFeed();
                //print("CalendarList<br><pre>");
                //print_r($CalendarList);
                //print("</pre>");
                
                //$CalendarListE = $service->getCalendarListEntry();
//                print("CalendarListE<br><pre>");
//                print_r($CalendarListE);
//                print("</pre>");
                
                
$CalendarEvent $service->getCalendarEventFeed();
//                print("CalendarEvent<br><pre>");
//                print_r($CalendarEvent);
//                print("</pre>");
                
                
foreach($CalendarEvent as $list)
                {
                    
/*
                    print($list->title . "<br><pre>");
                    print_r($list);
                    print("</pre>");
                    */
                    
echo "<ul>";
                    echo 
"<li>" $list->title "</li>";
                    echo 
"<li>" $list->id "</li>";
                    
                    
$event $service->getCalendarEventEntry($list->id);
                    
//print_r($event);
                    
                    
echo "</ul>";
                }
                
                
//$CalendarEventE = $service->getCalendarEventEntry();
//                print("CalendarEventE<br><pre>");
//                print_r($CalendarEventE);
//                print("</pre>");
            

            catch(
Exception $e)
            {
                print(
"<pre>");
                
print_r($e);
                print(
"</pre>");
                
//Service not active to initialize a event object.
            
}
            
//$this->sessionData->UserObj->modifyEvent();
        

the problem is not with this line : $CalendarEvent = $service->getCalendarEventFeed();
but
it's with this line : $event = $service->getCalendarEventEntry($list->id);

Exception Message is : You must specify the location as either a string URI or a child of Zend_Gdata_Query

Last edited by ionix : 02-25-2008 at 04:04 AM. Reason: include exception message
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:16 PM.