use of com.helger.peppol.domain.NiceNameEntry in project peppol-practical by phax.
the class AppCommonUI method createProcessID.
@Nonnull
public static IHCNode createProcessID(@Nonnull final IDocumentTypeIdentifier aDocTypeID, @Nonnull final IProcessIdentifier aProcessID) {
final String sURI = aProcessID.getURIEncoded();
final boolean bInDetails = true;
// Check direct match first
NiceNameEntry aNN = PROCESS_NAMES.get(sURI);
if (aNN != null)
return _createID(sURI, aNN, bInDetails);
aNN = DOCTYPE_NAMES.get(aDocTypeID.getURIEncoded());
if (aNN != null) {
if (aNN.containsProcessID(aProcessID))
return _createFormattedID(sURI, "Matching Process Identifier", EBootstrapBadgeType.SUCCESS, false, bInDetails);
return _createFormattedID(sURI, "Unexpected Process Identifier", EBootstrapBadgeType.WARNING, false, bInDetails);
}
return _createFormattedID(sURI, null, null, false, bInDetails);
}
use of com.helger.peppol.domain.NiceNameEntry in project peppol-practical by phax.
the class SMPJsonResponseExt method convert.
@Nonnull
public static IJsonObject convert(@Nonnull final ESMPAPIType eSMPAPIType, @Nonnull final IParticipantIdentifier aParticipantID, @Nonnull final Map<String, String> aSGHrefs, @Nonnull final IIdentifierFactory aIF) {
final IJsonObject aJson = SMPJsonResponse.convert(eSMPAPIType, aParticipantID, aSGHrefs, aIF);
final IJsonArray aURLsArray = aJson.getAsArray(SMPJsonResponse.JSON_URLS);
if (aURLsArray != null)
for (final IJson aEntry : aURLsArray) if (aEntry.isObject()) {
final IJsonObject aUrlEntry = aEntry.getAsObject();
final String sDocType = aUrlEntry.getAsString(SMPJsonResponse.JSON_DOCUMENT_TYPE_ID);
if (sDocType != null) {
final NiceNameEntry aNN = AppCommonUI.getDocTypeNames().get(sDocType);
if (aNN != null) {
aUrlEntry.add(JSON_NICE_NAME, aNN.getName());
aUrlEntry.add(JSON_IS_DEPRECATED, aNN.isDeprecated());
}
}
}
return aJson;
}
Aggregations