User Guide
  • Introduction
  • Overview
    • About 4WS.Platform
      • Architecture
      • Enterprise Edition
      • Tech specs and requirements
      • Warp SDK
    • Creating a web application
  • Core features
    • Tables
    • SqlTool
    • Definition of Data models and Relations
      • Relations
      • Reverse Engineering
      • Custom Fields
    • Defining business components
      • What are business components
      • Business components to fill-in panels
      • Creating business components
        • By a datastore entity
        • By a MongoDB collection
      • Defining Custom Java Business component
    • Defining the UI
      • App Designer
        • App Designer Menu
        • Definition of additional data sources
        • Panel containers and layouts
          • Tab panel
          • Alternative panel
          • Accordion panel
          • Vertical orientation panel
          • Horizontal orientation panel
          • Columns panel
          • Table panel
          • Generic panel
          • Responsive panel
        • Window content
          • Grid Panel
          • Form Panel
          • Filter Panel
          • Tree Panel
          • Google Map Panel
          • Preview Panel (old Image panel)
          • Tree + Grid Panel
          • Image Gallery
        • Windows list
        • Panel definition
          • Columns properties
          • Controls properties
          • Filter properties
          • Supported components
        • Variables
        • Code selectors
          • When not to use a dynamic combo-box
        • Smart Filter and Advanced Filter
        • Multi Value Combobox Filter
        • Multi Value Tree Filter
        • Buttons
        • Translations
          • Translations about GUI components and internationalization settings
          • Data coming from database
          • Custom code and translations
        • Application Menu
        • Bulk import binded to a grid
        • Range Date Filter
      • Web Interpreter
        • Grid components
        • Detail forms
        • Other components
        • Other features
          • Chat
        • Global variables
          • Client-side global variables
          • Server global variables
        • Forgot Password
    • Working with users and roles
      • Rule for roles
      • Permissions Administrator
    • Wizard
      • How to add a checkbox grid to select one or more rows
      • How to load a second grid when clicking on a row from the first grid
      • How to load a form when clicking on a row of the grid
      • How to open a window when double clicking on a row of the grid
      • How to open a window with right click on the popup menu
      • How to open a window when pressing a button on the grid toolbar
      • How to load a grid after loading a form
      • How to open a window when pressing a button on the form toolbar
      • How to load a grid when clicking on a tree node
      • How to load a form when clicking on a tree node
    • Defining events
      • Panel events
      • Column events
      • Control events
      • Filter events
      • Timer events
      • Start-End event
    • Server-side Javascript & Web Service
      • Server-side Javascript
      • Grid component filled by a server-side JS
      • Detail component filled by a server-side JS
      • How to define a server-side JavaScript action
      • Web service
  • Setting up the environment
    • How to install
    • Application parameters
    • Global parameters
  • Modules
    • Reports & Charts
      • Jasper Report + iReport
      • Online report
      • Docx templating
      • Charts
      • Pivot Grid
      • Multidimensional pivot grid
      • Data Export from SQL query
    • SSO
      • Identity management in Platform
        • Identity management on the internal Platform database
        • Identity management based on Google SSO
      • LDAP
        • LDAP support
        • Identity management based on LDAP and database
        • Identity management based on an embedded LDAP server used by Alfresco and or Activiti
        • Identity management based on a remote LDAP server to connect to Platform on the cloud
        • Connecting an LDAP server to Activiti BPM
        • Connecting an LDAP server to Alfresco ECM
      • Google SSO
        • Google SSO
        • Google OAuth2
        • Identity management based on Google SSO
      • Custom SSO
      • Firebase
    • Mobile
      • Mobile introduction
      • Offline vs Online
        • Server side features
        • Server side functionalities
        • Server side Platform features
        • Mobile app features
      • Mobile side specifics
        • Customizations
          • Custom theme editor
        • App Menu
        • Window content
          • Detail scrollable form
          • Scrollable paginated grid
          • Constraint layout
          • Constraint panel
          • Collection grid view
          • Preview panel (mobile)
        • Form Controls
      • Reference guide
      • Cleaning up data
      • How to
      • App deployment
        • App deployment for the iOS platform
        • App deployment for the Android platform
      • Style properties
      • Appendix : Synchronization flow
      • Translations
    • GSuite
      • Introduction
      • Client-side integration
      • GMail
      • Calendar
      • Drive
      • Contacts
    • Google Cloud Platform
      • Datastore
        • Google Datastore Introduction
        • How to create Datastore entities
      • Google Cloud Storage
    • Scheduler
      • Scheduler Introduction
      • Process settings
        • How to define a sequence of consecutive processes
        • How to define a Custom Java Business component
        • How to define a Grid Data Import
        • How to define a server-side Javascript action
      • Email notifications
      • Process executions
      • Manually start a scheduled process
      • Process input parameters
    • Queue Manager
    • Log & Analysis
      • Application Log
      • Log statistics
      • App analyzer
      • Table log
      • Threads
      • Sessions and heap memory
      • Heap memory analysis
      • Access Log
      • Datastore statistics
      • Total monthly costs with Google Datastore
      • Service Monitoring
        • Introduction
        • Defining a service to monitor
        • Notifications setup
        • Events automatically managed by Platform
        • Remote Platform servers
        • Knowledge base
        • Adding log programatically
        • Searching for logged data
        • Use cases
    • File Management
    • Export and Import of Metadata
      • Application Metadata Management
    • Trigger writing operations
    • Audit
    • BPM
      • BPMN Introduction
      • BPMN main parts
      • Activiti Setup
      • Platform integration
        • Processes
        • Models
        • Process instances
        • To-do list
        • Process history
      • Process Web Modeler
        • Model Creation
          • Start-End Event
          • Gateways
        • Supported objects
        • Start tasks and user tasks
        • Form properties
          • Important notes
          • Property types
        • Service tasks
          • Web service
          • SQL Query
          • SQL statement
        • Mail task
        • Script task
          • Example : how to get a value previously read from a SQL query
          • Example : how to get the current process instance id
        • Timer events
        • Subprocess and Call Activiti
      • Utility methods available in Platform
        • How to start a process from a JavaScript action
        • How to complete a user task from a JavaScript action
      • An example
        • Processes
        • Instances
        • Activities
        • History
    • Embedded CMS
    • ECM
      • Alfresco
        • Alfresco Introduction
        • Integration between 4WS.Platform and Alfresco
          • Integration at GUI level
          • Integration at model level
          • Integration at authentication and authorizations level
          • Additional features
        • How to use 4WS.Platform and Alfresco together
          • Set the same Identity Management system
          • Define document types and aspects in Alfresco
          • Import the document types and aspects definitions in 4WS.Platform
          • Define document types and aspects in 4WS.Platform
          • Reverse engineering of document types or aspects
          • Definition of business components to fill-in panels
          • Definition of the GUI
          • Additional server-side services
        • Requirements
        • Current limits in 4WS.Platform - Alfresco integration
      • Archiflow
        • Setup
        • Archiflow artifacts
        • How to
    • Lotus Notes Migration Tool
    • NoSQL databases
      • MongoDB
        • MongoDB Introduction
        • Setting up the environment
        • How to create collections
        • How to create business components
        • How to create windows filled with data coming from MongoDB collections
        • Design rules
      • Google Datastore
        • Google Datastore Introduction
        • Setting up the environment
        • How to create entities
        • How to create business components
        • How to create windows filled with data coming from Datastore entities
        • Design rules
    • TensorFlow
    • Web Page Development
      • Pure Web Page Development
      • Google Material Design development
      • Appendix A - a complete example without any lib
      • Appendix B - a complete example with Google MD
    • Jira Integration
    • Platform for GAE
    • SQL errors management
    • Multidimensional pivot grid
    • Quality
      • Automated Web Service Testing
      • Automated unit testing
      • Source code static analysis using ESlint
      • Source code static analysis using SonarQube
  • Troubleshootings
  • Best practises
    • Database design
    • Database maintenance
    • Creating a Web app : common use cases
    • Creating a mobile app : common use cases
Powered by GitBook
On this page
  • Get a list of contacts/emails from the user’s Google Apps contact list
  • Syntax
  • Details
  • Example
  • Get a list of contacts/emails from the Google Apps domain shared contact list
  • Syntax
  • Details
  • Example
  • Add a contact to the user’s contact list or to the domain shared contact list
  • Syntax
  • Details
  • Updates the contact of the user’s contact list or the domain shared contact list
  • Syntax
  • Details
  • Deletes the contact from the user’s contact list or the domain shared contact list
  • Syntax
  • Details
  • Get a list of contacts from the Google Apps domain user list
  • Syntax
  • Details
  • Example
  • Shared contacts synchronizations

Was this helpful?

  1. Modules
  2. GSuite

Contacts

With the Google contacts integration, developers can read the user contact list and retrieve data to use, for example, in Javascript actions. In order to use this feature, you have also to define a few parameters in 4WS.Platform:

  • GOOGLE_SERVACC_EMAIL

  • GOOGLE_SERVACC_KEY

to enable the Google Apps integration and the 4WS.Platform user must be a Google Apps user. The Javascript actions available are the following.

Get a list of contacts/emails from the user’s Google Apps contact list

Syntax

utils.getGoogleContactsFiltered(pages, maxPageResults, searchString, splitEmails)

Details

pages – (can be null) the number of pages to retrieve. Every page is a call to Google Contacts APIs. If null all pages are retrieved. maxPageResults – (can be null) the max number of contacts to retrieve in every call. If null the Google default limit is used. searchString – (can be null) a search string used for full text search on contacts. splitEmails – (can be null) boolean value that indicates to create more contacts results in case of multiple e-mail addresses for a single contact.

Example

Fetch all emails in the contacts list

utils.getGoogleContactsFiltered(null,null,null,null);

Be careful because this example may use a lot of Google API calls depending on the number of contacts. To limit the calls and data exchanged use something like:

utils.getGoogleEmailContactsFiltered(3,150,’John’,false);

IMPORTANT NOTES: The number of email addresses retrieved can be different from the number of contacts, if contacts have 0 or more than 1 email addresses, in case of splitted emails.

Get a list of contacts/emails from the Google Apps domain shared contact list

Syntax

utils.getGoogleSharedContactsFiltered(pages, maxPageResults, searchString, splitEmails)

Details

pages – (can be null) the number of pages to retrieve. Every page is a call to Google Contacts APIs. If null all pages are retrieved. maxPageResults – (can be null) the max number of contacts to retrieve in every call. If null the Google default limit is used. searchString – (can be null) a search string used for full text search on shared contacts. splitEmails – (can be null) boolean value that indicates to create more contacts results in case of multiple e-mail addresses for a single contact, .

Example

fetch all contacts in the contacts list

utils.getGoogleSharedContactsFiltered(null,null,null,null);

Be careful because this example may use a lot of Google API calls depending on the number of contacts. To limit the calls and data exchanged use something like:

utils.getGoogleContactsFiltered(3,150,’John’,false);

IMPORTANT NOTES: The contact may not contain an email address.

Add a contact to the user’s contact list or to the domain shared contact list

Syntax

utils.addGoogleContact(name, surname, email, phone, shared)

Details

name – the name of the contact. surname – the surname of the contact. email – the e-mail of the contact. phone – the phone of the contact. shared – (can be null) true if the contact must be stored in the share contact list of the domain, false for the user’s contact list. If null, the false case applies.

Updates the contact of the user’s contact list or the domain shared contact list

Syntax

utils.updateGoogleContact(contactId, name, surname, email, phone, shared)

Details

contactId – the id of the contact. name – the name of the contact. surname – the surname of the contact. email – the e-mail of the contact. phone – the phone of the contact. shared – (can be null) true if the contact is stored in the share contact list of the domain, false for the user’s contact list. If null, the false case applies.

Deletes the contact from the user’s contact list or the domain shared contact list

Syntax

utils.deleteGoogleContact(contactId, shared)

Details

contactId – the id of the contact. shared – (can be null) true if the contact is stored in the share contact list of the domain, false for the user’s contact list. If null, the false case applies.

Get a list of contacts from the Google Apps domain user list

Syntax

utils.getGoogleDomainContactsFiltered(pages, maxPageResults, query, orderBy, sortOrder)

Details

pages – (can be null) the number of pages to retrieve. Every page is a call to Google Contacts APIs. If null all pages are retrieved. maxPageResults – (can be null) the max number of contacts to retrieve in every call. If null the Google default limit is used. query – (can be null) a search query. The syntax is explained in the Google Directory API documentation orderBy – (can be null) the property used to sort results sortOrder – (can be null) the sort order. Possible values are "ASCENDING" or "DESCENDING".

Example

fetch all users in the domain

utils.getGoogleDomainContactsFiltered(null,null,null,null,null);

Be careful because this example may use a lot of Google API calls depending on the number of contacts. To limit the calls and data exchanged use something like:

utils.getGoogleDomainContactsFiltered(3,150,’John’,’email:a*’,’DESCENDING’);

IMPORTANT NOTES: The contact may not contain an email address.

Shared contacts synchronizations

4WS.Platform has a DB table that can contain shared contacts and can be inquired by functionalities (grids, lookups and so on). The table can be filled from different sources, one of which is Google Apps for Work. In particular two sources are synced:

  • the Google Apps Directory, which contains the contacts of the Google Apps Domian, i.e. all people in the same domain.

  • the Google Domain GAL (Global Access List), which contains common contacts that do not belong to the Google Domain, i.e. contacts of general interest.

    NOTE : The Google Apps Domain is only a source of information, not a destination. This means that the Google Apps Domain in not updated, only read. To synchronize the table, each application must be configured. In case of Google Apps as source, the following parameters must be specified:

  • GOOGLE_SERVACC_ADMIN_USER: the account of an admin user

  • GOOGLE_SERVACC_EMAIL: the service account email address

  • GOOGLE_SERVACC_KEY: the service account p12 public key, Base64 encoded

  • CONTACTS_SOURCE_GOOGLE_DOMAIN: must contain GOOGLE keyword.

To call the synchronization method, two ways can be used:

  • call the web method sharedcontactssync with a GET call on the 4WS.Platform server, for example

GET http://<server>/sharedcontactssync
  • use the server side Javascript call from an action:

utils.sharedContatctsSync()
PreviousDriveNextGoogle Cloud Platform

Last updated 5 years ago

Was this helpful?