Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. field:  one of the defined field from https://github.com/folio-org/mod-gobi/blob/master/src/main/resources/mapping.jsonproperties.field
  2. dataSource.default: default value
  3. datasource.translation: defined and implemented method from https://github.com/folio-org/mod-gobi/blob/master/src/main/resources/mapping.jsonproperties.dataSource.properties.translation

How to map Vendor Code for libraries with unique and or multiple organization records

If there is NO "from" data source then FOLIO relies on the default value to look up the correct organization to use as a vendor. For the look up to work the default value must match the code of an existing organization in FOLIO that has a status of active and IS a vendor.

If the institution wants to have multiple Vendors used for orders created via the GOBI API. The library must mapped a local data field on the GOBI side to send a selected code that can be used instead of the default. In the example below the configuration expects to get a vendor code from the incoming xml file in the local data 4 field. If there is nothing present in that field FOLIO will fall back on the default value to try and find a valid organization for the incoming orders

Code Block
languagejava
themeMidnight
 {
	"field": "VENDOR",
	"dataSource": {
		"from": "//LocalData[Description='LocalData4']/Value"
		"default": "GOBI",
		"translation": "lookupOrganization",
		"translateDefault": true
	}
}


Supported methods

Defined in the https://github.com/folio-org/mod-gobi/blob/master/src/main/resources/mapping.jsonproperties.dataSource.properties.translation

...

Code Block
curl  --request POST 'https://{okapiURL}/configurations/entries' \
--header 'Content-Type: application/json' \
--header 'x-okapi-token: {x-okapi-token}\
--data-raw '\
--data-raw '{
"module": "GOBI",
"configName": "orderMappings",
"code": "gobi.order.ListedPrintMonograph",
"description": "GOBI order mappings",
"enabled": true,
"value": "{
"module": "GOBI",
"configName": "orderMappings",
"code": "gobi.order.ListedPrintMonograph",
"description": "GOBI order mappings",
"enabled": true,
"value": "{\n \"orderType\": \"ListedPrintMonograph\",\n \"mappings\": [\n {\n \"field\": \"ACQUISITION_METHOD\",\n \"dataSource\": {\n \"default\": \"Purchase At Vendor System\"\n }\n },\n {\n \"field\": \"APPROVED\",\n \"dataSource\": {\n \"default\": \"true\",\n \"translation\": \"toBoolean\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"CLAIMED\",\n \"dataSource\": {\n \"default\": \"true\",\n \"translation\": \"toBoolean\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"COLLECTION\",\n \"dataSource\": {\n \"default\": \"false\",\n \"translation\": \"toBoolean\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"CONTRIBUTOR\",\n \"dataSource\": {\n \"from\": \"//datafield[@tag='100']/*\",\n \"combinator\": \"concat\"\n }\n },\n {\n \"field\": \"CONTRIBUTOR_NAME_TYPE\",\n \"dataSource\": {\n \"default\": \"Personal name\",\n \"translation\": \"lookupContributorNameTypeId\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"CURRENCY\",\n \"dataSource\": {\n \"from\": \"//ListPrice/Currency\",\n \"default\": \"USD\"\n }\n },\n {\n \"field\": \"DATE_ORDERED\",\n \"dataSource\": {\n \"from\": \"//OrderPlaced\",\n \"translation\": \"toDate\"\n }\n },\n {\n \"field\": \"EXPENSE_CLASS\",\n \"dataSource\": {\n \"from\": \"//LocalData[Description='LocalData4']/Value\",\n \"translation\": \"lookupExpenseClassId\"\n }\n },\n {\n \"field\": \"FUND_ID\",\n \"dataSource\": {\n \"from\": \"//FundCode\",\n \"translation\": \"lookupFundId\"\n }\n },\n {\n \"field\": \"FUND_CODE\",\n \"dataSource\": {\n \"from\": \"//FundCode\"\n }\n },\n {\n \"field\": \"FUND_PERCENTAGE\",\n \"dataSource\": {\n \"default\": \"100\",\n \"translation\": \"toDouble\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"VENDOR_INSTRUCTIONS\",\n \"dataSource\": {\n \"from\": \"//OrderNotes\",\n \"default\" : \"N/A\"\n }\n },\n {\n \"field\": \"LIST_UNIT_PRICE\",\n \"dataSource\": {\n \"from\": \"//ListPrice/Amount\",\n \"default\": \"0\",\n \"translation\": \"toDouble\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"LOCATION\",\n \"dataSource\": {\n \"from\": \"//Location\",\n \"default\": \"*\",\n \"translation\": \"lookupLocationId\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"MANUAL_PO\",\n \"dataSource\": {\n \"default\": \"false\",\n \"translation\": \"toBoolean\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"MATERIAL_TYPE\",\n \"dataSource\": {\n \"from\": \"//LocalData[Description='LocalData1']/Value\",\n \"default\" : \"unspecified\",\n \"translation\": \"lookupMaterialTypeId\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"ORDER_TYPE\",\n \"dataSource\": {\n \"default\": \"One-Time\"\n }\n },\n {\n \"field\": \"PO_LINE_ORDER_FORMAT\",\n \"dataSource\": {\n \"default\": \"Physical Resource\"\n }\n },\n {\n \"field\": \"PO_LINE_PAYMENT_STATUS\",\n \"dataSource\": {\n \"default\": \"Awaiting Payment\"\n }\n },\n {\n \"field\": \"PO_LINE_RECEIPT_STATUS\",\n \"dataSource\": {\n \"default\": \"Awaiting Receipt\"\n }\n },\n {\n \"field\": \"PRODUCT_ID\",\n \"dataSource\": {\n \"from\": \"//datafield[@tag='020']/subfield[@code='a']\",\n \"translation\": \"truncateISBNQualifier\"\n }\n },\n {\n \"field\": \"PRODUCT_ID_TYPE\",\n \"dataSource\": {\n \"default\": \"ISBN\",\n \"translation\": \"lookupProductIdType\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"PRODUCT_QUALIFIER\",\n \"dataSource\": {\n \"from\": \"//datafield[@tag='020']/subfield[@code='q']\",\n \"defaultMapping\": {\n \"dataSource\": {\n \"from\": \"//datafield[@tag='020']/subfield[@code='a']\",\n \"translation\": \"separateISBNQualifier\"\n }\n }\n }\n },\n {\n \"field\": \"PUBLICATION_DATE\",\n \"dataSource\": {\n \"from\": \"//datafield[@tag='260']/subfield[@code='c']\"\n }\n },\n {\n \"field\": \"PUBLISHER\",\n \"dataSource\": {\n \"from\": \"//datafield[@tag='260']/subfield[@code='b']\"\n }\n },\n {\n \"field\": \"QUANTITY_PHYSICAL\",\n \"dataSource\": {\n \"from\": \"//Quantity\",\n \"default\": \"1\",\n \"translation\": \"toInteger\"\n }\n },\n {\n \"field\": \"RECEIVING_NOTE\",\n\": \"dataSource1\": {,\n \"fromtranslation\": \"//LocalData[Description='LocalData2']/ValuetoInteger\"\n }\n },\n {\n \"field\": \"REQUESTERRECEIVING_NOTE\",\n \"dataSource\": {\n \"from\": \"//LocalData[Description='LocalData3LocalData2']/Value\"\n }\n },\n {\n \"field\": \"SOURCEREQUESTER\",\n \"dataSource\": {\n \"defaultfrom\": \"API//LocalData[Description='LocalData3']/Value\"\n }\n },\n {\n \"field\": \"TAGSSOURCE\",\n \"dataSource\": {\n \"fromdefault\": \"//LocalData[Description='LocalData4']/ValueAPI\"\n }\n },\n {\n \"field\": \"TITLE\",\n \"dataSource\": {\n \"from\": \"//datafield[@tag='245']/*\",\n \"combinator\": \"concat\"\n }\n },\n {\n \"field\": \"VENDOR\",\n \"dataSource\": {\n \"default\": \"GOBI\",\n \"translation\": \"lookupOrganization\",\n \"translateDefault\": true\n }\n },\n {\n \"field\": \"VENDOR_ACCOUNT\",\n \"dataSource\": {\n \"from\": \"//SubAccount\",\n \"default\": \"0\"\n }\n },\n {\n \"field\": \"VENDOR_REF_NO\",\n \"dataSource\": {\n \"from\": \"//YBPOrderKey\"\n }\n },\n {\n \"field\": \"VENDOR_REF_NO_TYPE\",\n \"dataSource\": {\n \"default\": \"Vendor order reference number\"\n }\n },\n {\n \"field\": \"WORKFLOW_STATUS\",\n \"dataSource\": {\n \"default\": \"Open\"\n }\n }\n ]\n }\n"
}
"
}
'


Other points to note:

...