Commit graph

60 commits

Author SHA1 Message Date
Daniel Siepmann 7f6bd13628
Remove deprecated usage of StringUtility::endsWith() (#70)
This is deprecated in newer PHP versions, one should use native
str_ends_with() instead.

We remove the deprecation by using this function. But we also support
older PHP versions, so we add symfony/polyfill-php80 as dependency to
always ensure this function exists.
2022-09-13 09:44:54 +02:00
Benjamin Franzke 9bdb998f6d
Use decorator pattern for RequestFactory (#54)
The implementation of the TYPO3 RequestFactory and Uri classes is
internal API.

It is therefore better to decorate the PSR-17 interfaces instead
of extending or using the TYPO3 implementation directly.
2022-09-13 09:09:43 +02:00
Daniel Siepmann 2e4c9cc04e
Add TYPO3 v11 support (#60)
* Support generation of code coverage generation
* Remove useless caching within GitHub
* Add TYPO3 11.5 within CI
* Update phpstan

Replace friendsoftypo3/phpstan-typo3 with saschaegerer/phpstan.
The friendsoftypo3 is intended for TYPO3 itself, while saschaegerer is
intended for community.
Also update all related packages.
Fix some new findings and update baseline.

* Run composer none interactive in CI
* Remove dependency checker
* Migrate tests to no longer use legacy dependencies
* https://forge.typo3.org/issues/97479
* Fix phpstan findings
2022-09-13 09:05:47 +02:00
Daniel Siepmann 355e4717b0
Support PublicHolidays for opening hours (#51)
DayOfWeek is an enum as defined at https://schema.org/DayOfWeek
We missed the PublicHolidays enum value when building
`getDaysOfWeekWithMondayFirstWeekDay()` which is used in templates to
get ordered result.
Opening hours for public holidays were not rendered, which is now fixed.
2021-09-14 14:51:14 +02:00
Daniel Siepmann e8a44c555a
Sort offers by type (#52)
That ensures grouped output of related offers.
Offers are not sorted in any way and might end up in entry, parking,
entry, etc. Sorting ensures all of same type are rendered one after the
other, entry, entry, parking.

Sorting is done by alphabet on the technical enum value.
2021-09-14 14:39:28 +02:00
Daniel Siepmann 185dcab2bc
Add Offer Type (#49) 2021-09-13 10:32:12 +02:00
Daniel Siepmann c97b9bd24d Skip import of entities without content responsible
We always expect someone to be responsible for content.
If there is no one, skip the import of the entity.
2021-09-08 15:22:43 +02:00
Daniel Siepmann dd0f08e157 Fix none working Extbase queries
The queries missed an call to matching() to actually apply the
constraint.
2021-09-08 11:03:21 +02:00
Daniel Siepmann 2932a620e4 Don't store empty info for opening hour
Do not store none existing info.
Just store nothing if something is missing.

Frontend model already checks for existence.
2021-09-06 13:47:12 +02:00
Daniel Siepmann 5179e82706 Improve skipping detection in TYPO3 converter
All records which are not saved or useable are now skipped.
Some records were converted but could not be stored, e.g. because no
localization was configured for that table.

This should bring small performance improvement and also align import
log with actually imported (converted) records.

Logging is added as well, only debug level, to allow developer and
integrator to analyse why some records are skipped.

Ignore some errors which don't actually exist.
We already check type of entity, and logger is always injected.
2021-09-06 13:47:12 +02:00
Daniel Siepmann 07f189a7f8 Support multiple price rules 2021-09-06 13:47:12 +02:00
Daniel Siepmann 592269baa8 Handle references ending in 404
Catch the exception and return null.
That is already a possible return type which should be handled by
callers.

Add test case with referenced 404 image.
2021-09-06 13:47:12 +02:00
Daniel Siepmann 73db8b5d9d Assume default timezone if not provided.
Data is coming from Germany and affects German places only.
We therefore expect German timezone.
2021-09-06 13:47:12 +02:00
Daniel Siepmann 265cb27236 Support multiple provided URLs
An object might have more then a single URL.
This is now added.
2021-09-06 13:47:12 +02:00
Daniel Siepmann 8315d42934 Add accessibility_specification 2021-09-06 13:47:12 +02:00
Daniel Siepmann cc216429a5 Add parking_facility_near_by
- Removed individual converters for TYPO3.
  Conversion is now handled in a single converter.
- The new converter will import necessary dependencies upfront, e.g.
  town or organisation.
- Move import state into extra class.

Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann 5859c14525 Add distanceToPublicTransport property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann 46fe3a2e81 Add availableLanguage property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann 4c9b055e0c Add publicAccess property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann ffd894c102 Add isAccessibleForFree property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann bd717d1596 Add petsAllowed property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann ce6a34b543 Add photography property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann 07cd56fef4 Add digitalOffer property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann 4a1928ece6 Add paymentAccepted property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann c1167a7848 Add trafficInfrastructure property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann 3ce8f13b04 Add architecturalStyle property to tourist information
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann 92d33c0956 Add museumService property to tourist information
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann b41ba9b6d1 Add otherService propterty to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann b1ce004ddb Add sanitation property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann 78796e1efa Add startOfConstruction property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann 0f59085653 Add slogan property to tourist attraction
Relates: #34
2021-09-06 13:47:12 +02:00
Daniel Siepmann 8ef79d51cb Sort offer prices by title
ThüCAT doesn't provide the editorial order of prices.
Therefore our frontend now renders them based on title in alphabetical
order.
2021-08-23 16:35:13 +02:00
Daniel Siepmann 075a591256 Add strict_types to all files 2021-08-12 09:46:37 +02:00
Daniel Siepmann 7c8dd0df3b Cleanup refactoring after big refactoring 2021-08-12 09:46:37 +02:00
Daniel Siepmann bfd4c77a17 Refactor parsing of JSON-LD
Use Symfony components to map incoming JSON onto objects.
Those provide a mapping. They can then be used to fetch the data in a
common way and insert it into the system.

- Handle languages within JsonDecode
  (normalize incoming data based on language)
- Handle Single Value and List of Values within Entities. They will map
  incoming Data to proper Objects. (We now generally transform during
  serialization process if target is array but we got single entity)
- Add missing tests for existing data.
- Finish migration of all existing data, this includes next step
- Provide discriminator to ObjectNormalizer to auto detect target class
  based on "type" property. (Done for now by own registry)
- Combine generated object with current structure for import -> generate
  data array out of it.
- Resolve foreign references to existing entities,
  (images, contentresponsible, etc.)
2021-08-12 09:46:37 +02:00
Daniel Siepmann dc09713884 Move namespace below initial file comment 2021-08-10 09:41:54 +02:00
Daniel Siepmann 9c60e275d0 Handle 404 for assigned media 2021-06-08 14:05:24 +02:00
Daniel Siepmann 6b19485a36 Handle resources with missing containedInPlace
Check for situation and return empty array.
Do not create unnecessary requests to database but directly return.
2021-06-08 14:05:24 +02:00
Daniel Siepmann e13bb35252 Handle removed configuration in log overview
Resolves: #13
2021-06-01 11:23:25 +02:00
Daniel Siepmann 197a3e4696 Support sync scope
Add new configuration to support sync scope.
This one requires the provided sync scope id and will always update all
entries.

Relates: #23
2021-06-01 09:43:33 +02:00
Daniel Siepmann 22932545d3 Handle relation to single "containedInPlace"
Only multiple containedInPlace were supported.
Some instances only have a single containedInPlace. This is now handled
as well.
2021-05-10 09:41:25 +02:00
Daniel Siepmann bbf7ada1d2 Add tests for modified models
That's necessary as models grow.
Added features should be tested to not break with future changes.

The tests revealed an existing error in fallback which got fixed to make
new test pass.

Relates: #18
2021-04-14 11:33:37 +02:00
svenfnzd 960d2debec Update openingHours model to add count
Needed countable for checking if model contains content.

Relates: werkraum-media#18
2021-04-14 11:33:37 +02:00
svenfnzd 99b95ee3ed Update offers model to add count
Needed countable for checking if model contains content.

Relates: #18
2021-04-14 11:33:37 +02:00
Daniel Siepmann c73bf1c53a Fulfill phpstan requirements
Ensure proper annotation and usage of assertNull.
2021-04-13 15:32:10 +02:00
Daniel Siepmann c91f665d98 Make compatible with PHP 7.3
As some projects still might run on PHP 7.3 and supported TYPO3 version
still supports 7.3.
2021-04-13 15:32:10 +02:00
Daniel Siepmann bf1ae9540b Fix two bugs: Language handling and price structure
Sorry for fixing two things in one commit.

First fixed bug is single offer and / or single price.
Those lead to exception / fatal error and are now handled.

Second fixed bug is wrong multi language handling.
Instead of using supported languages from entity (which does not exist
and was miss interpreted) we use configured system languages.
Each record is inserted with default language.
Also tourist attractions are inserted for all other languages.
They are only inserted if they have a title for that language.
2021-02-25 09:23:06 +01:00
Daniel Siepmann 442a6842ec Add prices to tourist attraction
Import prices, show them in records and make them accessible in
frontend.
2021-02-18 16:00:07 +01:00
Daniel Siepmann 775db67efa Add new page type for tourist attraction
Allows to select a single tourist attraction.
Provides static TypoScript to resolve reference for Fluid based
rendering.
2021-02-18 08:52:20 +01:00
Daniel Siepmann 16ae83e841 Add icons 2021-02-17 16:06:09 +01:00