Google APIS Lib for Fivewin

User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Post by cnavarro »

Read documentarion ( powerpoint presentation of Austria ) or PDF document

https://bitbucket.org/fivetech/harbour_ ... o_REST.pdf
( pages 45 and 46 )
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Post by Silvio.Falconi »

ok i create the file client_id.json from my My Project-2db95ee820d0.json
run gcalndar.exe
but I see nothing
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Post by cnavarro »

Modify prg

Code: Select all


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

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

 
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Post by Silvio.Falconi »

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 ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Post by cnavarro »

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
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Post by Silvio.Falconi »

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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Post by cnavarro »

You added APIS for use this products to you project google console?
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Post by Silvio.Falconi »

I set all products
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Post by cnavarro »

And when you have added new APIS, you are download json file again and put this file in path of exe?
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Post by Silvio.Falconi »

Why i cannot use the same json i use fir gcalendar? It is the same Project
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Post by cnavarro »

you must use a single .json file updated for all products
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Post by Silvio.Falconi »

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 ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Post by Silvio.Falconi »

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 )
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Google APIS Lib for Fivewin

Post by Silvio.Falconi »

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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Google APIS Lib for Fivewin

Post by cnavarro »

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


//----------------------------------------------------------------------------//
//
// 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

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

 
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Post Reply