Download the PHP package ynorth-projects/openy_pef_gxp_sync without Composer

On this page you can find all versions of the php package ynorth-projects/openy_pef_gxp_sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package openy_pef_gxp_sync

OpenY PEF GXP Sync

Synchronizes GroupEx schedules to PEF.

Quick start

Enable the modules

  1. Log in as an Admin
  2. Go to Extend (/admin/modules)
  3. Install OpenY PEF GXP Sync and Open Y Mappings Feature then enable all dependencies as requested on the next step.

Configure the OpenY GXP module

  1. Go to: Open Y -> Integrations -> GroupEx Pro -> GroupEx Pro settings (/admin/openy/integrations/groupex-pro/gxp).
  2. Set up your GroupExPro Client Id (which you can obtain from GroupEx PRO support).
  3. Provide the parent activity ID. It should be listed in Group Exercises, under Fitness.
  4. Enter Activity Group Exercise Classes (choose node of type Activity from autocomplete). Most likely the ID will be 94 if this is a default demo content).
  5. Enter Locations Mapping in the following format:

  6. Save the configuration.
  7. Go to: Configuration -> System -> YMCA Sync settings (/admin/config/system/ymca-sync)
  8. Enable the checkbox labeled openy_pef_gxp_sync and Save. The openy_pef_gxp_sync module should be enabled in your system.
  9. Go to: Open Y -> Settings -> Mappings -> Mapping list (/admin/openy/settings/mappings/mapping)
  10. Add mappings for every branch you would like to synchronize:
    • Enter the name of the mapping to easily identify it in the future. For instance, West YMCA GXP sync mapping.
    • Authored by - Keep as is
    • Locations - Choose Branch
    • GroupEx ID - Enter the GroupEx ID of the Branch
    • Save
  11. Go to: admin/openy/settings/groupex-enabled-locations and enable Locations that you want to sync.
  12. Run the Drush command to sync from your project docroot:
    • drush openy-pef-gxp-sync (Drupal 8, Drush 8)
    • drush yn-sync openy_pef_gxp_sync.syncer (Drupal 9, Drush 10)

How to sync my GroupEx data to my project?

See the final step above for the proper Drush commands.

How the syncer works

The syncer consists of the next steps:

  1. Fetcher - fetches data from GroupEx API.
  2. Wrapper - processes the data for saving (maps location ids, fixes title encoding problems, etc).
  3. Wrapper - groups all items by Class ID and Location ID, calculates hashes.
  4. Wrapper - prepares data to be removed (extra items in DB or changed hashes)
  5. Wrapper - prepares data to be created (new items + changed hashes)
  6. Cleaner - removes data to be removed.
  7. Saver - creates data to be created.

How the syncer works (for developers)

Adding & Removing locations

  1. If a location is removed in API it should be removed in DB.
  2. If a location is added in API it should be added (with classes) in DB.
  3. If a class is removed in API it should be removed in DB (with all class items);
  4. If a class is added in API it should be added in DB (with all class items);

Updating classes

  1. Each GroupEx class can have several class items (with the same class ID).
  2. We compare hashes for Location ID + Class ID + all class items inside (on unprocessed data!).
  3. If the hash is changed we should remove all items belonging to this hash and create them again.

How to debug

  1. To emulate API data please use FetcherDebuggerClass. Just replace @openy_pef_gxp_sync.fetcher with @openy_pef_gxp_sync.fetcher_debugger to emulate API response.
  2. Use DEBUG_MODE constants inside classes to debug specific services.

Known issues in sync.

  1. There is an issue if a class in a GroupEx has its category set to "General" - it will not be synced and displayed at PEF. This is a limitation of GroupEX PRO API.

Default Syncer behavior

By default, the Syncer creates unpublished Session nodes. In order for them to become visible in the Schedules application, you'd need to set config variables to allow unpublished entities to be displayed

Run next commands if you want to switch to published mode:

Run next commands if you want to switch to unpublished mode:

You need to clear cache in order to get this setting working. At this moment we have no UI for setting these variables, so using drush cset or importing configs via Config Manager is recommended.

Enabled Groupex Locations

Use config openy_pef_gxp_sync.enabled_locations to allow locations from GroupEx PRO to be synced.

This config contains an array of location IDs from GroupEx.


All versions of openy_pef_gxp_sync with dependencies

PHP Build Version
Package Version
Requires ycloudyusa/yusaopeny Version *
drupal/core Version >=10.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ynorth-projects/openy_pef_gxp_sync contains the following files

Loading the files please wait ....