Skip to content

Commit

Permalink
Exporting document type details; #46
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Feb 12, 2020
1 parent 95914d4 commit ac6bf8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ The PD Publisher is the publicly accessible web site with listing and search fun
* Added possibility to automatically purge unwanted duplicate entries
* Updated the underlying UI libraries
* The lists of known document type IDs and process ID were updated
* Details about document types are now part of the export (see [issue #46](https://github.com/phax/phoss-directory/issues/46))
* v0.8.4 - 2020-01-24
* Updated to Jersey 2.30
* The Directory client has no more default truststore path and password
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
import com.helger.pd.indexer.storage.PDStoredIdentifier;
import com.helger.pd.indexer.storage.PDStoredMLName;
import com.helger.pd.indexer.storage.field.PDField;
import com.helger.pd.publisher.nicename.NiceNameEntry;
import com.helger.pd.publisher.nicename.NiceNameHandler;
import com.helger.peppolid.IDocumentTypeIdentifier;
import com.helger.peppolid.IParticipantIdentifier;
import com.helger.photon.app.io.WebFileIO;
Expand Down Expand Up @@ -133,9 +135,17 @@ public static IMicroDocument queryAllContainedBusinessCardsAsXML (@Nonnull final
if (bIncludeDocTypes && aEntry.getValue ().isNotEmpty ())
for (final IDocumentTypeIdentifier aDocTypeID : aEntry.getValue ().getFirst ().documentTypeIDs ())
{
eBC.appendElement (sNamespaceURI, "doctypeid")
.setAttribute ("scheme", aDocTypeID.getScheme ())
.setAttribute ("value", aDocTypeID.getValue ());
final IMicroElement eDocTypeID = eBC.appendElement (sNamespaceURI, "doctypeid")
.setAttribute ("scheme", aDocTypeID.getScheme ())
.setAttribute ("value", aDocTypeID.getValue ());
final NiceNameEntry aNiceName = NiceNameHandler.getDocTypeNiceName (aDocTypeID.getURIEncoded ());
if (aNiceName == null)
eDocTypeID.setAttribute ("non-standard", true);
else
{
eDocTypeID.setAttribute ("displayname", aNiceName.getName ());
eDocTypeID.setAttribute ("deprecated", aNiceName.isDeprecated ());
}
}

aRoot.appendChild (eBC);
Expand Down

0 comments on commit ac6bf8c

Please sign in to comment.