phax / peppol-commons

Java library with shared Peppol components - identifier handling, codelists, SBDH handler, SMP Client, SML Client
Apache License 2.0
29 stars 8 forks source link

Adding new document types to the enum EPredefinedDocumentTypeIdentifier #1

Closed patrickvanamstel closed 9 years ago

patrickvanamstel commented 9 years ago

Dear Philip,

I like the way you have set up the libraries.

But i need to add document types to the EPredefinedDocumentTypeIdentifier. The good thing about enum's is that they cannot change. But not all document types can be found in this enum.

See http://www.galaxygw.com/peppol-documents/

I need to add the the danish OIOUBL documents e.g

urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##OIOUBL-2.02::2.0.

What i can do is

final IReadonlyDocumentTypeIdentifier iReadonlyIdentifier = new IReadonlyDocumentTypeIdentifier(){
            @Override
            public String getScheme() {
                return "busdox-docid-qns";
            }
            @Override
            public String getValue() {
                //return "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol4a:ver2.0::2.1";
                return "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##OIOUBL-2.02::2.0";
            }

        };

Can you think of another way?

phax commented 9 years ago

Hi Patrick! There are several ways. The simplest one would be to use a SimpleDocumentTypeIdentifier instance. It has a constructor taking scheme and value. Additionally it offers a static factory method createWithDefaultScheme so that you can omit the busdox-docid-qns value.

The list on GalaxyGW is not 100% complete to my knowledge but it is surely a good starting point. Currently the enum is automatically generated from the official codelists (to be found in the src\main\codelists folder). I will investigate on that list and come back to you.

// Philip

patrickvanamstel commented 9 years ago

Hi Philip,

Thank you for your quick answer.

Patrick

On 06/08/2015 12:21 PM, Philip Helger wrote:

Hi Patrick! There are several ways. The simplest one would be to use a |SimpleDocumentTypeIdentifier| instance. It has a constructor taking scheme and value. Additionally it offers a static factory method |createWithDefaultScheme| so that you can omit the |busdox-docid-qns| value.

The list on GalaxyGW is not 100% complete to my knowledge but it is surely a good starting point. Currently the enum is automatically generated from the official codelists (to be found in the |src\main\codelists| folder). I will investigate on that list and come back to you.

// Philip

— Reply to this email directly or view it on GitHub https://github.com/phax/peppol-commons/issues/1#issuecomment-109942903.