Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(refactor): remove UPL feed element when UPL configuration is missing #7

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 32 additions & 26 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,107 +1,113 @@
# CHANGELOG

## Version 2.2.0

### Changed

- Remove UPL feed element when UPL configuration is missing

## Version 2.1.3

### Fixed

- Map audience 'ondernemer' correctly
- Map audience 'ondernemer' correctly

## Version 2.1.2

### Refactor

- Only use the prefix 'http://standaarden.overheid.nl/owms/terms/' while retrieving the upl resource url but the value is empty.
- Only use the prefix '<http://standaarden.overheid.nl/owms/terms/>' while retrieving the upl resource url but the value is empty.

## Version 2.1.1

### Refactor

- Usage of upl resource.
- Usage of upl resource.

## Version 2.1.0

### Features

- Updates can now be provided through the Admin interface
- Updates can now be provided through the Admin interface

## Version 2.0.9

### Chore

- Replaced Composer plugin dependency check with runtime check.
- Replaced Composer plugin dependency check with runtime check.

## Version 2.0.8

### Chore

- Update dependencies + reference pdc-base plugin from BitBucket to GitHub
- Update dependencies + reference pdc-base plugin from BitBucket to GitHub

## Version 2.0.7

### Features

- (refactor): sc feed pdc-type tax query, use all terms slugs except internal.
- (refactor): sc feed pdc-type tax query, use all terms slugs except internal.

## Version 2.0.6

### Features

- (feat): government type setting, used in feed.
- (feat): government type setting, used in feed.

## Version 2.0.5

### Features

- (feat): remove internal pdc-items from sc feed.
- (feat): remove internal pdc-items from sc feed.

## Version 2.0.4

### Features

- (refactor): strip unnecessary characters in UPL values and display them in lowercase. Used in xml sc feed.
- (refactor): strip unnecessary characters in UPL values and display them in lowercase. Used in xml sc feed.

## Version 2.0.3

### Features

- (feat): add UPL values in xml sc feed. UPL stands for 'Uniform Product List' and is used for naming the products and services of the Dutch government (https://standaarden.overheid.nl/upl)
- (feat): add UPL values in xml sc feed. UPL stands for 'Uniform Product List' and is used for naming the products and services of the Dutch government (<https://standaarden.overheid.nl/upl>)

## Version 2.0.2

### Fixed:
### Fixed

- (fix): 'pdc-doelgroepen' terms in xml sc feed
- (fix): 'pdc-doelgroepen' terms in xml sc feed

## Version 2.0.1

### Fixed:
### Fixed

- (fix): meta query used in creating xml feed
- (fix): meta query used in creating xml feed

## Version 2.0.0

### Features:
### Features

- (refactor): clean-up for version 1.0.
- (feat): clean-up & improvement feed serviceprovider
- (refactor): clean-up for version 1.0.
- (feat): clean-up & improvement feed serviceprovider

### Added

- (feat): ScItem model used in feed serviceprovider
- (feat): ScItem model used in feed serviceprovider

### Changed

- (refactor): architecture change in the pdc-base plug-in, used as dependency, affects namespaces used
- (refactor): architecture change in the pdc-base plug-in, used as dependency, affects namespaces used

## Version 1.2.2

- (feat): add new audiences
- (fix): tests
- (feat): add php-cs-fixer
- (feat): format documents
- (feat): add new audiences
- (fix): tests
- (feat): add php-cs-fixer
- (feat): format documents

## Version 1.2.1

### Fix:
### Fix

- (fix): check if required file for `is_plugin_active` is already loaded, otherwise load it. Props @Jasper Heidebrink
- (fix): check if required file for `is_plugin_active` is already loaded, otherwise load it. Props @Jasper Heidebrink
2 changes: 1 addition & 1 deletion pdc-samenwerkende-catalogi.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: PDC Samenwerkende Catalogi
* Plugin URI: https://www.openwebconcept.nl/
* Description: Plugin to create a XML feed according to the Samenwerkende Catalogi requirements.
* Version: 2.1.3
* Version: 2.2.0
* Author: Yard | Digital Agency
* Author URI: https://www.yard.nl/
* License: GPL-3.0
Expand Down
24 changes: 13 additions & 11 deletions src/SamenwerkendeCatalogi/Feed/ProductEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,19 @@ private function getMetaSc(): object
$onlineAanvragen = $this->feed->xml->createElement("overheidproduct:onlineAanvragen", $kenmerk);
$scMeta->appendChild($onlineAanvragen);

$upl = $this->feed->xml->createElement("overheidproduct:uniformeProductnaam", $this->args['upl_name']);
$upl->setAttribute(
'scheme',
'overheid:UniformeProductnaam'
);
$upl->setAttribute(
'resourceIdentifier',
$this->args['upl_resource']
);

$scMeta->appendChild($upl);
if (! empty($this->args['upl_name']) && ! empty($this->args['upl_resource'])) {
$upl = $this->feed->xml->createElement("overheidproduct:uniformeProductnaam", $this->args['upl_name']);
$upl->setAttribute(
'scheme',
'overheid:UniformeProductnaam'
);
$upl->setAttribute(
'resourceIdentifier',
$this->args['upl_resource']
);

$scMeta->appendChild($upl);
}

return $scMeta;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SamenwerkendeCatalogi/Foundation/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Plugin extends BasePlugin
*
* @const string VERSION
*/
public const VERSION = '2.1.3';
public const VERSION = '2.2.0';

protected function checkForUpdate()
{
Expand Down
12 changes: 2 additions & 10 deletions src/SamenwerkendeCatalogi/Models/ScItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ public function getUplName(): string
{
$uplName = get_post_meta($this->getID(), '_owc_pdc_upl_naam', true);

if (empty($uplName)) {
$uplName = $this->getTitle();
}

return $uplName;
return 0 < strlen($uplName) ? $uplName : '';
}

public function getStrippedUplName(): string
Expand All @@ -76,11 +72,7 @@ public function getUplResource(): string
{
$uplResource = get_post_meta($this->getID(), '_owc_pdc_upl_resource', true);

if (empty($uplResource)) {
$uplResource = sprintf('http://standaarden.overheid.nl/owms/terms/%s', $this->getStrippedUplName());
}

return $uplResource;
return 0 < strlen($uplResource) ? $uplResource : '';
}

/**
Expand Down
Loading