FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Google APIS Lib for Fivewin
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Google APIS Lib for Fivewin
Posted: Wed Feb 14, 2018 06:11 PM

Read documentarion ( powerpoint presentation of Austria ) or PDF document

https://bitbucket.org/fivetech/harbour_ ... o_REST.pdf
( pages 45 and 46 )

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Google APIS Lib for Fivewin
Posted: Wed Feb 14, 2018 06:14 PM

ok i create the file client_id.json from my My Project-2db95ee820d0.json
run gcalndar.exe
but I see nothing

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Google APIS Lib for Fivewin
Posted: Wed Feb 14, 2018 06:23 PM
Modify prg

Code (fw): Select all Collapse
Function CalendList()

   local oCalendList
   local lSw      := .F.

   oCalendList  := TGCalendarList():New()
   lSw          := oCalendList:Activate()
   if lSw
      ? "Activado"
      oCalendList:ListCalendars()
      XBrowse( oCalendList:aCalendList )
   else
      ? oCalend:cError
   endif

Return nil

//----------------------------------------------------------------------------//
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Google APIS Lib for Fivewin
Posted: Wed Feb 14, 2018 06:27 PM
ok now it request
email and password google

then I saw a msginfo "activado "

and now I have a xbrowse




How I can insert it on calendar dbf ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Google APIS Lib for Fivewin
Posted: Wed Feb 14, 2018 06:31 PM

Methods they do not use any rdd
Export array to dbf: FW_ArrayToDBF

If I created a dbf it would be a mistake
You have to understand that each user prefers a different structure of the dbf or prefers to export directly to fwmaria or any other rdd with a custom structure

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Google APIS Lib for Fivewin
Posted: Thu Feb 15, 2018 09:02 AM

ok Cris , My error was to create json from credential no Auth Now it is ok I can help Italian fwh User if they need the help for this
I tried also Gdrive and Gmail
for this two sample I not see nothing
How test the other classes ? thanks

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Google APIS Lib for Fivewin
Posted: Thu Feb 15, 2018 12:16 PM

You added APIS for use this products to you project google console?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Google APIS Lib for Fivewin
Posted: Thu Feb 15, 2018 01:01 PM

I set all products

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Google APIS Lib for Fivewin
Posted: Thu Feb 15, 2018 07:58 PM

And when you have added new APIS, you are download json file again and put this file in path of exe?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Google APIS Lib for Fivewin
Posted: Thu Feb 15, 2018 10:47 PM

Why i cannot use the same json i use fir gcalendar? It is the same Project

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Google APIS Lib for Fivewin
Posted: Thu Feb 15, 2018 10:54 PM

you must use a single .json file updated for all products

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Google APIS Lib for Fivewin
Posted: Fri Feb 16, 2018 09:37 AM

I not understood
I downloaded a json file and I tried gcalendar Test and it run ok
I cannot use the same json file for nother service as gDrive or gmail ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Google APIS Lib for Fivewin
Posted: Fri Feb 16, 2018 09:49 AM

this morning I tried with gcalendar and I have this error after it askme the user/password of google and showed "activado" message

Application

Path and name: C:\work\Prg\GOOGLE\gcalend.Exe (32 bits)
Size: 3,807,232 bytes
Compiler version: Harbour 3.2.0dev (r1712141320)
FiveWin version: FWH 17.12
C compiler version: Borland/Embarcadero C++ 7.3 (32-bit)
Windows version: 6.2, Build 9200

Time from start: 0 hours 1 mins 0 secs
Error occurred at: 16/02/2018, 10:47:57
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... } length: 0
[ 2] = N 1

Stack Calls

Called from: d:\fwh\fwhteam\source\internal\Tgevecal.prg => TGEVENTCALC:LISTEVENT( 275 )
Called from: gcalend.prg => EVENTLIST( 74 )
Called from: gcalend.prg => MAIN( 21 )

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Google APIS Lib for Fivewin
Posted: Fri Feb 16, 2018 09:53 AM

sorry I must activate the service on google I understood now

tried gcalendar I see the records I allready abilitate the service
tried gmail I see nothing ( only xbrowse and criptated strings) I allready abilitate the service
tried gdrive 0 and 1 I see the records I allready abilitate the service

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Google APIS Lib for Fivewin
Posted: Fri Feb 16, 2018 02:10 PM
Silvio.Falconi wrote:
tried gmail I see nothing ( only xbrowse and criptated strings) I allready abilitate the service


You see Id of thread and id of message
With Id of message, you can see all the properties of the message
Try with this sample

Code (fw): Select all Collapse
//----------------------------------------------------------------------------//
//
// GGMAIL.PRG: sample use Class TGMail from TGGoogle
// Author: Cristobal Navarro ( C ) 20/11/2017 - 16/02/2018
//
//----------------------------------------------------------------------------//

#include "Fivewin.ch"
#include "Splitter.ch"
#include "colores.ch"

REQUEST HB_CODEPAGE_ESWIN

Static nLeftPos
Static oMail

Function Main()

聽 聽local aMessages 聽 := Main1()
聽 聽if !Empty( aMessages )
聽 聽 聽 XbrwMail(,,,,, aMessages )
聽 聽endif

Return nil

//----------------------------------------------------------------------------//

Function Main1()

聽 聽local lSw 聽 聽:= .F.
聽 聽local aList 聽:= {}
聽 聽HB_CDPSELECT( "ESWIN" )
聽 聽
聽 聽oMail := TGMail():New()

   // you can configure the name and path of the json file between New and Activate methods 
   // oMail:cJSonFile  := ".\client_id.json"      

聽 聽lSw 聽 := oMail:Activate()
聽 聽if lSw
聽 聽 聽 
聽 聽 聽 //
聽 聽 聽 oMail:SentMessages()
聽 聽 聽 aList 聽 := AClone( oMail:aMessages )
聽 聽 聽 //XBrowse( oMail:aMessages )
聽 聽endif

Return aList 聽 //oMail:aMessages

//----------------------------------------------------------------------------//

Function XbrwMail( oWnd, nT, nL, nB, nR, aSource )

聽 聽local lWnd 聽 聽 聽 := .F.
聽 聽local oVSplitL
聽 聽local oBrw
聽 聽local oPnel1
聽 聽local nTop
聽 聽local nHeight
聽 聽local aMsgs 聽 聽 聽:= {}

聽 聽AEVal( aSource, { | a | AAdd( aMsgs, { a[ 1 ], a[ 2 ], "" } ) } )
聽 聽oMail:GetMessage( aMsgs[ 1 ][ 1 ] )
聽 聽nLeftPos 聽 聽:= Min( 300, Int( GetSysMetrics( 0 ) / 5 ) )
聽 聽if Empty( oWnd )
聽 聽 聽 lWnd 聽 聽 := .T.
聽 聽 聽 DEFINE WINDOW oWnd ;
聽 聽 聽 聽 聽TITLE " - Google Mail - " + FWVERSION + " - " + hb_Compiler() ;
聽 聽 聽 聽 聽PIXEL COLOR CLR_BLUE, CLR_WHITE //STYLE WS_POPUP
聽 聽endif
聽 聽nTop 聽 聽:= if( Empty( oWnd:oBar ), 0, oWnd:oBar:nBottom ) + 2
聽 聽nHeight := if( Empty( oWnd:oMsgBar ), 32, oWnd:oMsgBar:nTop - 2 )

聽 聽@ nTop, nLeftPos + 2 XBROWSE oBrw DATASOURCE aMsgs OF oWnd ; 
聽 聽 聽 SIZE GetSysMetrics( 0 ) - nLeftPos - 4, GetSysMetrics( 1 ) - nHeight ;
聽 聽 聽 HEADERS "Thread", "Id", "Message" ;
聽 聽 聽 COLUMNS 2, 1, 3 ;
聽 聽 聽 PIXEL CELL LINES NOBORDER

聽 聽WITH OBJECT oBrw
聽 聽 聽 :l2007 聽 聽 聽 聽 聽 聽:= .F.
聽 聽 聽 //:nMarqueeStyle 聽 聽:= MARQSTYLE_DOTEDCELL
聽 聽 聽 :nStretchCol 聽 聽 聽:= 3
聽 聽 聽 :bClrHeader 聽 聽 聽 := { || { CLR_WHITE, CLR_GRAY } }
聽 聽 聽 :bClrSelFocus 聽 聽 := ;
聽 聽 聽 :bClrSel 聽 聽 聽 聽 聽:= { || { CLR_BLACK, CLR_HGRAY } }
聽 聽 聽 :lRecordSelector 聽:= .F.
聽 聽 聽 :lHScroll 聽 聽 聽 聽 := .F.
聽 聽 聽 :nColDividerStyle := ;
聽 聽 聽 :nRowDividerStyle := LINESTYLE_LIGHTGRAY
聽 聽 聽 :nRowHeight 聽 聽 聽 := 87
聽 聽 聽 WITH OBJECT :aCols[ 3 ]
聽 聽 聽 聽 聽:bClrStd 聽 聽 聽 := { || { CLR_BLUE, CLR_WHITE } }
聽 聽 聽 聽 聽:nDataStrAlign := 0
聽 聽 聽 聽 聽:bEditValue 聽 聽:= { || oMail:GetMessage( oBrw:aRow[ 1 ] ), oMail:cMessage }
聽 聽 聽 END
聽 聽 聽 :CreateFromCode()
聽 聽END

聽 聽if lWnd
聽 聽 聽 oPnel1 := TPanel():New( nTop + 2, 2, GetSysMetrics( 1 ) - nHeight, nLeftPos - 2, oWnd )
聽 聽 聽 oPnel1:SetColor( CLR_WHITE, METRO_GRIS7 )
聽 聽 聽 
聽 聽 聽 @ nTop, nLeftPos SPLITTER oVSplitL ;
聽 聽 聽 聽 聽 聽VERTICAL ; 
聽 聽 聽 聽 聽 聽PREVIOUS CONTROLS oPnel1 ;
聽 聽 聽 聽 聽 聽HINDS CONTROLS oBrw ;
聽 聽 聽 聽 聽 聽LEFT MARGIN 聽 0 ;
聽 聽 聽 聽 聽 聽RIGHT MARGIN 80 ;
聽 聽 聽 聽 聽 聽SIZE 1, GetSysMetrics( 1 ) - nHeight + 2 ;
聽 聽 聽 聽 聽 聽COLOR CLR_HGRAY ; //oWnd:nClrPane ;
聽 聽 聽 聽 聽 聽PIXEL OF oWnd
聽 聽 聽 oVSplitL:lStatic := .T.

聽 聽 聽 ACTIVATE WINDOW oWnd MAXIMIZED
聽 聽endif

Return nil

//----------------------------------------------------------------------------//
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces