OS2Web Data lookup provides integration with Danish data lookup services such as Service platformen or Datafordeler. Module is available to download via composer.
composer require os2web/os2web_datalookup
drush en os2web_datalookup
Updating process for OS2Web Data lookup module is similar to the usual Drupal 8 module. Use Composer's built-in command for listing packages that have updates available:
composer outdated os2web/os2web_datalookup
See OS2Web testing and CI information
Project is opened for new features and os course bugfixes. If you have any suggestion, or you found a bug in project, you are very welcome to create an issue in GitHub repository issue tracker. For issue description, there is expected that you will provide clear and sufficient information about your feature request or bug report.
See OS2Web git name convention
// CVR lookup
/** @var \Drupal\os2web_datalookup\Plugin\DataLookupManager $pluginManager */
$pluginManager = \Drupal::service('plugin.manager.os2web_datalookup');
/** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCompanyInterface $cvrPlugin */
$cvrPlugin = $pluginManager->createDefaultInstanceByGroup('cvr_lookup');
if ($cvrPlugin->isReady()) {
$cvrResult = $cvrPlugin->lookup($cvr);
}
// CPR lookup.
/** @var \Drupal\os2web_datalookup\Plugin\DataLookupManager $pluginManager */
$pluginManager = \Drupal::service('plugin.manager.os2web_datalookup');
/** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCprInterface $cprPlugin */
$cprPlugin = $pluginManager->createDefaultInstanceByGroup('cpr_lookup');
if ($cprPlugin->isReady()) {
$cprResult = $cprPlugin->lookup($cpr);
}
// CVR lookup - DEPRECATED.
\Drupal::service('plugin.manager.os2web_datalookup')->createInstance('serviceplatformen_cvr')->getLegalUnit('[CVR number]')
// CPP lookup - DEPRECATED.
\Drupal::service('plugin.manager.os2web_datalookup')->createInstance('serviceplatformen_cpr')->cprBasicInformation('[CPR number]'))
Datafordeler integration (https://datafordeler.dk)
In the scope of os2forms project already implemented light integration with Danmarks Adresseregister (DAR) via fetching data for form elements autocomplete.
As soon as it is clear how the integration is going to be used, then os2forms_dawa will be refactored to OS2Web Data lookup plugin.
Settings for CPR and CVR serviceplatformen plugins are storing as configuration
in db and will(could) be exported as yml
file via Drupal's configuration
management system. And afterward could be tracked by git
.
If case you have public access to your git repository, all settings from plugins will be exposed for third persons.
To avoid/prevent this behavior, we recommend use Config ignore
module, where
you can add all settings you do not want to export/import via the configuration
management system.