Author: jonesde
Date: Tue Jul 10 14:54:34 2007 New Revision: 555092 URL: http://svn.apache.org/viewvc?view=rev&rev=555092 Log: A few cleanups of namespace stuff, plus added some todos about elements that aren't being processed, especially for the Acknowledge Delivery, PO variation Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java?view=diff&rev=555092&r1=555091&r2=555092 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java Tue Jul 10 14:54:34 2007 @@ -364,19 +364,23 @@ Element dataAreaElement = UtilXml.firstChildElement(receivePoElement, "n:DATAAREA"); Element acknowledgeDeliveryElement = UtilXml.firstChildElement(dataAreaElement, "n:ACKNOWLEDGE_DELIVERY"); - Element receiptHdrElement = UtilXml.firstChildElement(acknowledgeDeliveryElement, "n:RECEIPTHDR"); + // TODO: need to support multiple RECEIPTLN elements in a single message + Element receiptHdrElement = UtilXml.firstChildElement(acknowledgeDeliveryElement, "n:RECEIPTLN"); Element qtyElement = UtilXml.firstChildElement(receiptHdrElement, "N1:QUANTITY"); String itemQty = UtilXml.childElementValue(qtyElement, "N2:VALUE"); String sign = UtilXml.childElementValue(qtyElement, "N2:SIGN"); String productId = UtilXml.childElementValue(receiptHdrElement, "N2:ITEM"); + // TODO: need to support multiple INVDETAIL elements under a RECEIPTLN element Element invDetailElement = UtilXml.firstChildElement(receiptHdrElement, "n:INVDETAIL"); - String serialNumber = UtilXml.childElementValue(invDetailElement, "N2:SERIALNUM"); + + // TODO: support DISPOSITN element, and set InventoryItem status accordingly Element documentRefElement = UtilXml.firstChildElement(receiptHdrElement, "N1:DOCUMNTREF"); String orderId = UtilXml.childElementValue(documentRefElement, "N2:DOCUMENTID"); + // TODO: need to get and if possible use the DOCUMNTREF -> LINENUM element, would be orderItemSeqId // prepare map to create inventory against PO Map cipCtx = new HashMap(); @@ -399,7 +403,6 @@ Debug.logError(e, errMsg, module); } } - } // sign handling for items double quantityAccepted = 0.0; @@ -539,8 +542,8 @@ String sku = UtilXml.childElementValue(receiptHdrElement, "N2:ITEM"); Element invDetailElement = UtilXml.firstChildElement(receiptHdrElement, "n:INVDETAIL"); - String serialNumber = UtilXml.childElementValue(invDetailElement, "N2:SERIALNUM"); + String invItemStatus = UtilXml.childElementValue(receiptHdrElement, "N2:DISPOSITN"); Element documentRefElement = UtilXml.firstChildElement(receiptHdrElement, "N1:DOCUMNTREF"); Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?view=diff&rev=555092&r1=555091&r2=555092 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Tue Jul 10 14:54:34 2007 @@ -87,7 +87,11 @@ public static final String certAlias = UtilProperties.getPropertyValue("oagis.properties", "auth.client.certificate.alias"); public static final String basicAuthUsername = UtilProperties.getPropertyValue("oagis.properties", "auth.basic.username"); public static final String basicAuthPassword = UtilProperties.getPropertyValue("oagis.properties", "auth.basic.password"); - + + public static final String oagisMainNamespacePrefix = "n"; + public static final String oagisSegmentsNamespacePrefix = "os"; + public static final String oagisFieldsNamespacePrefix = "of"; + public static Map showShipment(DispatchContext ctx, Map context) { InputStream in = (InputStream) context.get("inputStream"); LocalDispatcher dispatcher = ctx.getDispatcher(); @@ -115,21 +119,21 @@ Element showShipmentElement = doc.getDocumentElement(); showShipmentElement.normalize(); - Element controlAreaElement = UtilXml.firstChildElement(showShipmentElement, "N1:CNTROLAREA"); - Element bsrElement = UtilXml.firstChildElement(controlAreaElement, "N1:BSR"); - String bsrVerb = UtilXml.childElementValue(bsrElement, "N2:VERB"); - String bsrNoun = UtilXml.childElementValue(bsrElement, "N2:NOUN"); - String bsrRevision = UtilXml.childElementValue(bsrElement, "N2:REVISION"); + Element controlAreaElement = UtilXml.firstChildElement(showShipmentElement, "CNTROLAREA"); // os + Element bsrElement = UtilXml.firstChildElement(controlAreaElement, "BSR"); // os + String bsrVerb = UtilXml.childElementValue(bsrElement, "VERB"); // of + String bsrNoun = UtilXml.childElementValue(bsrElement, "NOUN"); // of + String bsrRevision = UtilXml.childElementValue(bsrElement, "REVISION"); // of Map oagisMsgInfoCtx = UtilMisc.toMap("bsrVerb", bsrVerb, "bsrNoun", bsrNoun, "bsrRevision", bsrRevision); - Element senderElement = UtilXml.firstChildElement(controlAreaElement, "N1:SENDER"); - String logicalId = UtilXml.childElementValue(senderElement, "N2:LOGICALID"); - String component = UtilXml.childElementValue(senderElement, "N2:COMPONENT"); - String task = UtilXml.childElementValue(senderElement, "N2:TASK"); - String referenceId = UtilXml.childElementValue(senderElement, "N2:REFERENCEID"); - String confirmation = UtilXml.childElementValue(senderElement, "N2:CONFIRMATION"); - String authId = UtilXml.childElementValue(senderElement, "N2:AUTHID"); + Element senderElement = UtilXml.firstChildElement(controlAreaElement, "SENDER"); // os + String logicalId = UtilXml.childElementValue(senderElement, "LOGICALID"); // of + String component = UtilXml.childElementValue(senderElement, "COMPONENT"); // of + String task = UtilXml.childElementValue(senderElement, "TASK"); // of + String referenceId = UtilXml.childElementValue(senderElement, "REFERENCEID"); // of + String confirmation = UtilXml.childElementValue(senderElement, "CONFIRMATION"); // of + String authId = UtilXml.childElementValue(senderElement, "AUTHID"); // of oagisMsgInfoCtx.put("logicalId", logicalId); oagisMsgInfoCtx.put("component", component); @@ -153,19 +157,19 @@ Debug.logError(e, errMsg, module); } - Element dataAreaElement = UtilXml.firstChildElement(showShipmentElement, "n:DATAAREA"); - Element daShowShipmentElement = UtilXml.firstChildElement(dataAreaElement, "n:SHOW_SHIPMENT"); - Element shipmentElement = UtilXml.firstChildElement(daShowShipmentElement, "n:SHIPMENT"); - String shipmentId = UtilXml.childElementValue(shipmentElement, "N2:DOCUMENTID"); + Element dataAreaElement = UtilXml.firstChildElement(showShipmentElement, "DATAAREA"); // n + Element daShowShipmentElement = UtilXml.firstChildElement(dataAreaElement, "SHOW_SHIPMENT"); // n + Element shipmentElement = UtilXml.firstChildElement(daShowShipmentElement, "SHIPMENT"); // n + String shipmentId = UtilXml.childElementValue(shipmentElement, "DOCUMENTID"); // of - Element shipUnitElement = UtilXml.firstChildElement(daShowShipmentElement, "n:SHIPUNIT"); - String trackingNum = UtilXml.childElementValue(shipUnitElement, "N2:TRACKINGID"); + Element shipUnitElement = UtilXml.firstChildElement(daShowShipmentElement, "SHIPUNIT"); // n + String trackingNum = UtilXml.childElementValue(shipUnitElement, "TRACKINGID"); // of - Element invItem = UtilXml.firstChildElement(shipUnitElement, "n:INVITEM"); - String productId = UtilXml.childElementValue(invItem, "N2:ITEM"); + Element invItem = UtilXml.firstChildElement(shipUnitElement, "INVITEM"); // n + String productId = UtilXml.childElementValue(invItem, "ITEM"); // of - Element invDetail = UtilXml.firstChildElement(invItem, "n:INVDETAIL"); - String serialNumber = UtilXml.childElementValue(invDetail,"N1:SERIALNUM"); + Element invDetail = UtilXml.firstChildElement(invItem, "INVDETAIL"); // n + String serialNumber = UtilXml.childElementValue(invDetail, "SERIALNUM"); // os try { GenericValue shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId)); String shipGroupSeqId = shipment.getString("primaryShipGroupSeqId"); Modified: ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl?view=diff&rev=555092&r1=555091&r2=555092 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl (original) +++ ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl Tue Jul 10 14:54:34 2007 @@ -17,96 +17,101 @@ specific language governing permissions and limitations under the License. --> -<n:PROCESS_SHIPMENT_001 xmlns:n="http://www.openapplications.org/161B_PROCESS_SHIPMENT_001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openapplications.org/161B_PROCESS_SHIPMENT_001 file:///C:/Documents%20and%20Settings/022523/My%20Documents/Vudu/XML%20Specs/REL%201%20-%20VER%202/161B_process_shipment_005.xsd" xmlns:N1="http://www.openapplications.org/oagis_segments" xmlns:N2="http://www.openapplications.org/oagis_fields"> - <N1:CNTROLAREA> - <N1:BSR> - <N2:VERB>PROCESS</N2:VERB> - <N2:NOUN>SHIPMENT</N2:NOUN> - <N2:REVISION>001</N2:REVISION> - </N1:BSR> - <N1:SENDER> - <N2:LOGICALID>${logicalId}</N2:LOGICALID> - <N2:COMPONENT>INVENTORY</N2:COMPONENT> - <N2:TASK>SHIPREQUEST</N2:TASK> - <N2:REFERENCEID>${referenceId}</N2:REFERENCEID> - <N2:CONFIRMATION>1</N2:CONFIRMATION> - <N2:LANGUAGE>ENG</N2:LANGUAGE> - <N2:CODEPAGE>NONE</N2:CODEPAGE> - <N2:AUTHID>${authId?if_exists}</N2:AUTHID> - </N1:SENDER> - <N1:DATETIMEISO>${sentDate?if_exists}</N1:DATETIMEISO> - </N1:CNTROLAREA> +<n:PROCESS_SHIPMENT_001 + xmlns:n="http://www.openapplications.org/161B_PROCESS_SHIPMENT_001" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openapplications.org/161B_PROCESS_SHIPMENT_001 file:///C:/Documents%20and%20Settings/022523/My%20Documents/Vudu/XML%20Specs/REL%201%20-%20VER%202/161B_process_shipment_005.xsd" + xmlns:os="http://www.openapplications.org/oagis_segments" + xmlns:of="http://www.openapplications.org/oagis_fields"> + <os:CNTROLAREA> + <os:BSR> + <of:VERB>PROCESS</of:VERB> + <of:NOUN>SHIPMENT</of:NOUN> + <of:REVISION>001</of:REVISION> + </os:BSR> + <os:SENDER> + <of:LOGICALID>${logicalId}</of:LOGICALID> + <of:COMPONENT>INVENTORY</of:COMPONENT> + <of:TASK>SHIPREQUEST</of:TASK> + <of:REFERENCEID>${referenceId}</of:REFERENCEID> + <of:CONFIRMATION>1</of:CONFIRMATION> + <of:LANGUAGE>ENG</of:LANGUAGE> + <of:CODEPAGE>NONE</of:CODEPAGE> + <of:AUTHID>${authId?if_exists}</of:AUTHID> + </os:SENDER> + <os:DATETIMEISO>${sentDate?if_exists}</os:DATETIMEISO> + </os:CNTROLAREA> <n:DATAAREA> <n:PROCESS_SHIPMENT> <n:SHIPMENT> - <N2:DOCUMENTID>${shipment.shipmentId?if_exists}</N2:DOCUMENTID> + <of:DOCUMENTID>${shipment.shipmentId?if_exists}</of:DOCUMENTID> <#if shipperId?has_content> - <N2:SHIPPERID>${shipperId}</N2:SHIPPERID><#-- TODO: fill in from PartyCarrierAccount.accountNumber; make sure filter by from/thru date and PartyCarrierAccount.carrierPartyId==orderItemShipGroup.carrierPartyId; get most recent fromDate --> + <of:SHIPPERID>${shipperId}</of:SHIPPERID><#-- TODO: fill in from PartyCarrierAccount.accountNumber; make sure filter by from/thru date and PartyCarrierAccount.carrierPartyId==orderItemShipGroup.carrierPartyId; get most recent fromDate --> </#if> - <N2:CARRIER>${orderItemShipGroup.carrierPartyId?if_exists}</N2:CARRIER> + <of:CARRIER>${orderItemShipGroup.carrierPartyId?if_exists}</of:CARRIER> <#if shipperId?has_content> - <N2:FRGHTTERMS>COLLECT</N2:FRGHTTERMS><#-- TODO: if SHIPPERID?has_content then set to COLLECT --> + <of:FRGHTTERMS>COLLECT</of:FRGHTTERMS><#-- TODO: if SHIPPERID?has_content then set to COLLECT --> <#else> - <N2:FRGHTTERMS>PREPAID</N2:FRGHTTERMS> + <of:FRGHTTERMS>PREPAID</of:FRGHTTERMS> </#if> - <N2:NOTES>${orderItemShipGroup.shippingInstructions?if_exists}</N2:NOTES> - <N2:SHIPNOTES>${shipnotes?if_exists}</N2:SHIPNOTES><#-- if order was a return replacement order (associated with return), then set to RETURNLABEL otherwise leave blank --> - <N2:TRANSMETHD>${orderItemShipGroup.shipmentMethodTypeId?if_exists}</N2:TRANSMETHD> - <N1:PARTNER> + <of:NOTES>${orderItemShipGroup.shippingInstructions?if_exists}</of:NOTES> + <of:SHIPNOTES>${shipnotes?if_exists}</of:SHIPNOTES><#-- if order was a return replacement order (associated with return), then set to RETURNLABEL otherwise leave blank --> + <of:TRANSMETHD>${orderItemShipGroup.shipmentMethodTypeId?if_exists}</of:TRANSMETHD> + <os:PARTNER> <#if address?has_content> - <N2:NAME>${address.toName?if_exists}</N2:NAME> - <N2:PARTNRTYPE>SHIPTO</N2:PARTNRTYPE> - <N2:CURRENCY>USD</N2:CURRENCY> - <N1:ADDRESS> - <N2:ADDRLINE>${address.address1?if_exists}</N2:ADDRLINE> + <of:NAME>${address.toName?if_exists}</of:NAME> + <of:PARTNRTYPE>SHIPTO</of:PARTNRTYPE> + <of:CURRENCY>USD</of:CURRENCY> + <os:ADDRESS> + <of:ADDRLINE>${address.address1?if_exists}</of:ADDRLINE> <#if address.address2?exists> - <N2:ADDRLINE>${address.address2}</N2:ADDRLINE> + <of:ADDRLINE>${address.address2}</of:ADDRLINE> </#if> - <N2:CITY>${address.city?if_exists}</N2:CITY> - <N2:COUNTRY>${address.countryGeoId?if_exists}</N2:COUNTRY> - <N2:DESCRIPTN></N2:DESCRIPTN> - <N2:FAX></N2:FAX> - <N2:POSTALCODE>${address.postalCode?if_exists}</N2:POSTALCODE> - <N2:STATEPROVN>${address.stateProvinceGeoId?if_exists}</N2:STATEPROVN> - <N2:TELEPHONE><#if telecomNumber.countryCode?has_content>${telecomNumber.countryCode}-</#if>${telecomNumber.areaCode?if_exists}-${telecomNumber.contactNumber?if_exists}</N2:TELEPHONE> - </N1:ADDRESS> - <N1:CONTACT> - <N2:NAME>${address.toName?if_exists}</N2:NAME> - <N2:EMAIL>${emailString?if_exists}</N2:EMAIL> - <N2:FAX></N2:FAX> - <N2:TELEPHONE><#if telecomNumber.countryCode?has_content>${telecomNumber.countryCode}-</#if>${telecomNumber.areaCode?if_exists}-${telecomNumber.contactNumber?if_exists}</N2:TELEPHONE> - </N1:CONTACT> + <of:CITY>${address.city?if_exists}</of:CITY> + <of:COUNTRY>${address.countryGeoId?if_exists}</of:COUNTRY> + <of:DESCRIPTN></of:DESCRIPTN> + <of:FAX></of:FAX> + <of:POSTALCODE>${address.postalCode?if_exists}</of:POSTALCODE> + <of:STATEPROVN>${address.stateProvinceGeoId?if_exists}</of:STATEPROVN> + <of:TELEPHONE><#if telecomNumber.countryCode?has_content>${telecomNumber.countryCode}-</#if>${telecomNumber.areaCode?if_exists}-${telecomNumber.contactNumber?if_exists}</of:TELEPHONE> + </os:ADDRESS> + <os:CONTACT> + <of:NAME>${address.toName?if_exists}</of:NAME> + <of:EMAIL>${emailString?if_exists}</of:EMAIL> + <of:FAX></of:FAX> + <of:TELEPHONE><#if telecomNumber.countryCode?has_content>${telecomNumber.countryCode}-</#if>${telecomNumber.areaCode?if_exists}-${telecomNumber.contactNumber?if_exists}</of:TELEPHONE> + </os:CONTACT> </#if> - </N1:PARTNER> + </os:PARTNER> <n:SHIPITEM> <#list shipmentItems as shipmentItem> - <N1:QUANTITY> - <N2:VALUE>${shipmentItem.quantity?if_exists}</N2:VALUE> - <N2:NUMOFDEC>0</N2:NUMOFDEC> - <N2:SIGN>+</N2:SIGN> - <N2:UOM>EACH</N2:UOM> - </N1:QUANTITY> - <N2:ITEM>${shipmentItem.productId?if_exists}</N2:ITEM> - <N2:DISPOSITN>FIFO</N2:DISPOSITN><#-- TODO: figure out if this is a reviewer order, if so set this to LIFO --> + <os:QUANTITY> + <of:VALUE>${shipmentItem.quantity?if_exists}</of:VALUE> + <of:NUMOFDEC>0</of:NUMOFDEC> + <of:SIGN>+</of:SIGN> + <of:UOM>EACH</of:UOM> + </os:QUANTITY> + <of:ITEM>${shipmentItem.productId?if_exists}</of:ITEM> + <of:DISPOSITN>FIFO</of:DISPOSITN><#-- TODO: figure out if this is a reviewer order, if so set this to LIFO --> <n:DOCUMNTREF> - <N2:DOCTYPE>SHIPMENT</N2:DOCTYPE> - <N2:DOCUMENTID>${shipment.shipmentId?if_exists}</N2:DOCUMENTID> - <N2:LINENUM>${shipmentItem.shipmentItemSeqId?if_exists}</N2:LINENUM> + <of:DOCTYPE>SHIPMENT</of:DOCTYPE> + <of:DOCUMENTID>${shipment.shipmentId?if_exists}</of:DOCUMENTID> + <of:LINENUM>${shipmentItem.shipmentItemSeqId?if_exists}</of:LINENUM> </n:DOCUMNTREF> </#list> </n:SHIPITEM> <#-- TODO: data preparation code to create the externalIdSet --> <#list externalIdSet?if_exists as externalId> <n:DOCUMNTREF> - <N2:DOCTYPE>PARTNER_SO</N2:DOCTYPE> - <N2:DOCUMENTID>${externalId?if_exists}</N2:DOCUMENTID> + <of:DOCTYPE>PARTNER_SO</of:DOCTYPE> + <of:DOCUMENTID>${externalId?if_exists}</of:DOCUMENTID> </n:DOCUMNTREF> </#list> <#-- TODO: data preparation code to create the correspondingPoIdSet --> <#list correspondingPoIdSet?if_exists as correspondingPoId> <n:DOCUMNTREF> - <N2:DOCTYPE>CUST_PO</N2:DOCTYPE> - <N2:DOCUMENTID>${correspondingPoId?if_exists}</N2:DOCUMENTID> + <of:DOCTYPE>CUST_PO</of:DOCTYPE> + <of:DOCUMENTID>${correspondingPoId?if_exists}</of:DOCUMENTID> </n:DOCUMNTREF> </#list> </n:SHIPMENT> |
Free forum by Nabble | Edit this page |