bvstone

Step by Step Instructions for Registering Google Drive Service with GreenTools for GSuite (Google Apps)

Posted:

Step by Step Instructions for Registering Google Drive Service with GreenTools for GSuite (Google Apps)

This article will show you how easy it is to set up and start using the the Google Drive addon for GreenTools for G Suite.

Step 1: Run the G4G Register Service (G4GREGSVC) Command

After adding the G4G library to your library list, type G4GREGSVC on your command line and press F4 to prompt the command.  You should see a screen that looks like the following:

This command only has a couple options.

  • Google ID - Enter the Google ID you wish to use.  This can be a gmail.com address or even your own domain if it's hosted through Google.
  • Service - Enter the service you wish to register.  In this case we are registering Google Drive, so the value we use is *DRIVE
  • Redo Registration - This is only here in case you need to re-register the service.   
  • CCSID, Debug and Debug File are really only there for troubleshooting.  If you have issues I will have you change some of these parameters in order to collect information necessary for support.  Otherwise you don't need to worry about these parameters.

Step 2: Click on the Link (or Copy and Paste it) to Open Your Browser

Once you have the command set up, press enter and you will be brought to a new screen:

This next screen will include a link you will need to either click on (if your 5250 session allows) or you can simply copy the link text and place it in the location bar on your browser.

Once you finish this step, you will be brought to a BVSTools.com web page.

Step 3: Click on the Link Provided in Your Browser

You should now be at a BVSTools.com web page.  On this page there will be a link that you need to click on to start the registration process.

Click on the link provided.  If you have multiple Google Accounts you will next be shown a list of accounts to use.  Remember to select the same account that you used on Step 1 in the G4GREGSVC command.

If only have one Google Account and are already signed in, you will be brought to the next page.  If you are not signed in you will need to go through the steps to sign in to your Google Account.  

Step 4: Review and Accept the Permissions Required by the Google Service

Once you have selected and signed in to the appropriate Google Account you will be asked to review and accept the permissions required by the specific GreenTools for G Suite service you are registering.  In our case it was Google Drive:

Step 5: Return to your 5250 Session and Complete the Registration

Once you accept the permissions required for the specific G4G service you will return to the BVSTools.com web page that will have a specific authorization code.

You don't need to do anything with this code.  When you get to this point you can return to your 5250 screen and complete the registration by pressing the F6 button.  When you do this the application will connect with the BVSTools.com web page and retrieve the authorization code automatically for you.  Once that is complete your registration is complete:

Step 6: Use the Service!

You are now ready to start using the specific service you just registered.  In this example it was Google Drive, so let's try something simple like uploading a file to Google Drive  This is done using the G4GUPLOAD command.  (More commands and ILE interfaces for each specific interface can be found in the G4G Documentation).

  • Google ID - Specify the Google ID that you want to upload a file too.  (Remember, the Google ID should already be registered using the G4GREGSVC command).
  • File to upload - Enter the fully qualified path and filename of the file you wish to upload.  This file should already exist in the IFS.  
  • File name - This option can be used if you want to upload the file as a different name.  
  • File content type - This is used to specify the content type of the file you're uploading.  G4G comes with many content-types already set up in the G4GCTTPF file in the G4G library.  You can enter the content type here or use the default of *DFT to allow G4G to look this up for you.  

Next press your Page Down key to see the next page of available parameters:

  • Upload to folder - Enter the fully qualified path to the folder on your Google Drive that you want to upload the file to.  This folder name is case sensitive.
  • Replace file - Specify if you wish to replace the file if it already exists.  If you specify *YES the file will be replaced.  If you specify *NO and the file exists the file will not be uploaded.  If you specify *ADD the file will be uploaded but it will have a different file ID (yes, on Google Drive you can have two files with the same name).
  • Convert file - This is used if the file you are uploading should be converted to it's related Google Drive format.  This normally is for Word, Excel, etc documents.
  • Create parents - If the folder you want to upload the file to doesn't exist it and any folders in the path will be created if this is set to *YES.  
  • The remaining parameters are mainly for debugging and should be left as is in most cases.

Once you press Enter you should get a message that says the file was uploaded similar to this:

File uploaded with id 0B2Sd62H63YjoXzI3R0NBZjRGazA as test.pdf

You can now go to your Google Drive and the file should be there!  You will even see in the details bar to the right information about what was uploaded and how.  

 


Last edited 06/06/2017 at 07:47:35




Reply




© Copyright 1983-2024 BVSTools
GreenBoard(v3) Powered by the eRPG SDK, MAILTOOL Plus!, GreenTools for Google Apps, jQuery, jQuery UI, BlockUI, CKEditor and running on the IBM i (AKA AS/400, iSeries, System i).