Google APIS Lib for Fivewin

Re: Google APIS Lib for Fivewin

Postby cnavarro » Wed Feb 14, 2018 6: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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Postby Silvio.Falconi » Wed Feb 14, 2018 6: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Postby cnavarro » Wed Feb 14, 2018 6:23 pm

Modify prg

Code: Select all  Expand view


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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Postby Silvio.Falconi » Wed Feb 14, 2018 6:27 pm

ok now it request
email and password google

then I saw a msginfo "activado "

and now I have a xbrowse

Image


How I can insert it on calendar dbf ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Postby cnavarro » Wed Feb 14, 2018 6: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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Postby Silvio.Falconi » Thu Feb 15, 2018 9: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Postby Silvio.Falconi » Thu Feb 15, 2018 1:01 pm

I set all products
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Postby cnavarro » Thu Feb 15, 2018 7: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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Postby Silvio.Falconi » Fri Feb 16, 2018 9: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Postby Silvio.Falconi » Fri Feb 16, 2018 9: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Postby Silvio.Falconi » Fri Feb 16, 2018 9: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Postby cnavarro » Fri Feb 16, 2018 2: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: Select all  Expand view


//----------------------------------------------------------------------------//
//
// 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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests

cron