phax / phoss-smp

phoss SMP - a Peppol and OASIS BDXR SMP Server, CEF eDelivery compliant
128 stars 37 forks source link

Business Card v3 #210

Closed tmhide closed 2 years ago

tmhide commented 2 years ago

I tried PUT /businesscard/{participantIdentifier}, but the language attribute did not register. According to the following implementation, phoss-smp does not support Business Card v3 via the API.

https://github.com/phax/phoss-smp/blob/7ceec53f9cecef3f012af5150de46ff5c57848f7/phoss-smp-backend-sql/src/main/java/com/helger/phoss/smp/backend/sql/mgr/SMPBusinessCardManagerJDBC.java#L212

I tried the following update query, but GET /businesscard/{participantIdentifier} did not output in Business Card v3 format.

update smp_bce set  name = '[{"name":"test","language":"en"}]' where id = 'idxxx'

I would like to see support for MultilingualNameType even if it is only for the REST API (GET/PUT), do you have any plans?

tmhide commented 2 years ago

Below is the conversation so far. https://github.com/phax/phoss-directory/issues/62

phax commented 2 years ago

This will be part of the v5.7.0 release. I added an additional column called names that is created using FlyWay migration v18. The column name is used only if there is a single name with a single language. If there is either one name with a language or more than one name, the data is stored in JSON format into the names column.

An example DB data structure looks like this:

[
  {
    "name": "Name1",
    "language": "de"
  },
  {
    "name": "Name2",
    "language": "en"
  }
]

So your statement on top needs to be changed to

update smp_bce set  name=null, names = '[{"name":"test","language":"en"}]' where id = 'idxxx'