AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones Google / Google Calendar
  • Overview
  • How to manage a Google calendar?
  • Managing a Google calendar
  • Creating a Google calendar
  • Remark
  • How to retrieve a Google calendar and its elements?
  • 1st method: retrieving the list of calendars then their events
  • 2nd method: retrieving a specific calendar
  • How to add, modify or delete events in a Google calendar?
  • Principle
  • Adding events to a calendar
  • Modifying the events in a calendar:
  • Deleting an event from a calendar
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
The Google Calendar service is an Internet application provided by Google that is used to manage a calendar on Internet.
For example, WINDEV and WEBDEV can be used to synchronize schedules with existing applications, such as meeting rooms or vehicles.
These WLanguage functions also allow you to develop specific interfaces (suited for your business requirements, more user-friendly, etc.) and to add specific processes (prints, among others).
Examples of processes that can be implemented natively in WLanguage:
  • Retrieving the detailed list of calendars (professional calendars, personal calendars, etc.).
  • Retrieving the list of appointments from a calendar.
  • Performing a search in the appointments of a calendar.
  • Adding, modifying and deleting appointments.
Warning: Before using a feature related to Google services, we strongly advise you to refer to the license agreement for that service.. Some restrictions may apply. The content of the licenses may change over time.
PC SOFT is in no case responsible for the way the native access functions are used. Make sure that you comply with the license of the service provider.
How to manage a Google calendar?

Managing a Google calendar

To manage a Google calendar:
  1. Create a Google account if necessary. This account can be created via the following address: https://www.google.com/accounts/NewAccount?hl=fr
    Caution: the address of this page may have changed since this page was written.
    The Google account is identified by an email address and the associated password.
  2. In the code of your application, create a variable of type gglConnection. This variable contains the characteristics of the connection to your Google account.

Creating a Google calendar

A Google calendar can be created via the Google interface or through programming with the WLanguage functions.
To create a Google calendar with the WLanguage functions:
  1. Create a variable of type gglCalendar.
  2. Define the characteristics of the calendar via the gglCalendar properties.
  3. Define (if necessary) the events linked to the calendar (gglEvent variable).
  4. Validate the creation of the calendar with GglWrite.

Remark

If you use a proxy to access Internet, the proxy must be configured (Proxy) to use Google functions.
How to retrieve a Google calendar and its elements?

1st method: retrieving the list of calendars then their events

To retrieve a Google calendar from the list of calendars:
  1. Declare an array of gglCalendar variables (to retrieve several calendars).
  2. Use the GglListCalendar function. This function is used to list the available calendars. The calendars found are assigned to the array of gglCalendar variables.
  3. Use GglFillCalendar to retrieve the events. The events can be retrieved from a single calendar or from several calendars. The events to retrieve can be filtered (between two dates for instance).
Example:
Cnt is gglConnection
...
arrCalendars is array of 0 gglCalendar
arrCalendars = GglListCalendar(Cnt)
// First calendar
Calendar is gglCalendar = arrCalendars[1]
// Retrieve the events between 01/01/2008 and 01/01/2009 included
GglFillCalendar(Cnt, Calendar, "20080101", "20090102")
// Browse the events of a calendar
Evt is gglEvent
FOR EACH Evt OF Calendar
Trace(Evt.Title)
END

2nd method: retrieving a specific calendar

To retrieve a specific Google calendar as well as its events:
  1. Declare a variable of type gglCalendar.
  2. Use the GglGetCalendar function. This function is used to retrieve the Google calendar (and its events) corresponding to the specified title.
Example:
Cnt is gglConnection
...
// Retrieve the calendar named "Work"
Calendar is gglCalendar = GglGetCalendar(Cnt, "Work")
// Browse the events of the calendar
IF ErrorOccurred = False THEN
Evt is gglEvent
FOR EACH Evt OF gglCalendar
Trace(Evt.Title)
END
END
How to add, modify or delete events in a Google calendar?

Principle

The principle for modifying the events is straightforward: the calendar is retrieved locally, the modifications are performed locally and the calendar is updated on the server.
Note: In the case of shared calendars, it is advisable to regularly update the calendars on the server.

Adding events to a calendar

To add events to a calendar:
  1. Retrieve the requested calendar (and its events if necessary).
  2. Declare a variable of type gglEvent.
  3. Define the characteristics of the event via the properties of the variable.
  4. Use GglWrite to update the calendar on the server.
Example: Creating an event in the "Work" calendar:
Cnt is gglConnection
...
// Retrieve the calendar named "Work"
Calendar is gglCalendar = GglGetCalendar(Cnt, "Work")
// Create an event
MyEvent is gglEvent
MyEvent.StartDate = "20081201085000"
MyEvent.EndDate = "20081201093000"
MyEvent.Title = "Appointment"
MyEvent.Content = "Appointment to discuss the November status report"
// Add the event into the calendar
Add(Calendar.Event, MyEvent)
// Update the calendar on the server
GglWrite(Cnt, Calendar)
Example: Creating an event on the first calendar found:
Cnt is gglConnection
...
arrCalendars is array of 0 gglCalendar
arrCalendars = GglListCalendar(Cnt)
// Retrieve the future events of the first calendar
GglFillCalendar(Cnt, arrCalendars[1])
// Create an event
MyEvent is gglEvent
MyEvent.StartDate = "20081201085000"
MyEvent.EndDate = "20081201093000"
MyEvent.Title = "Appointment"
MyEvent.Content = "Appointment to discuss the November status report"
// Add the event into the calendar
Add(arrCalendars[1].Event, MyEvent)
// Update the calendar on the server
GglWrite(Cnt, arrCalendars[1])

Modifying the events in a calendar:

To modify the events in a calendar:
  1. Retrieve the requested calendar and its events.
  2. Find the event to modify.
  3. Modify the characteristics of the event.
  4. Validate the modifications with GglWrite.
Note: You can make several changes before using the GglWrite function.
Example:
Cnt is gglConnection
...
// Retrieve the calendar named "Work"
Calendar is gglCalendar = GglGetCalendar(Cnt, "Work")
// Modify the first event of the calendar
Calendar.Event[1].Title = "Meeting w/ boss"
Calendar.Event[1].EndDate = "200810131530"
// Actually update the changes on the server
GglWrite(Cnt, Calendar)

Deleting an event from a calendar

To delete an event from a calendar:
  1. Retrieve the requested calendar and its events.
  2. Find the event to delete.
  3. Delete the event.
  4. Validate the modifications with GglWrite.
Note: It is possible to make several deletions before using the GglWrite function.
Example:
Cnt is gglConnection
...
// Retrieve the calendar named "Work"
Calendar is gglCalendar = GglGetCalendar(Cnt, "Work")
// Delete the second event from the calendar
Delete(Calendar.Event, 2)
// Actually update the changes on the server
GglWrite(Cnt, Calendar)
Versión mínima requerida
  • Versión 14
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 25/03/2025

Señalar un error o enviar una sugerencia | Ayuda local