← Prev in month ← Prev in thread

Input Specification Developer's Release

From
Micah Dubinko <>
Date
2005-04-20T01:17:17+00:00
ID
Thread
Input Specification Developer's Release
For the impatient, go have a look at 
http://wiki.brainattic.info/UBL_Input_Specifications

Now is the time for potential implementers or any others to take a look 
and provide feedback.

Note that the final version will consist of separate HTML files, not a 
Wiki page. For now the Wiki format gives added flexibility (and a 
discussion page). The scripts are attached. Inline below is the separate 
configuration file, to give an idea of its format.

#!/usr/bin/python

def configure_rules(rule):
    """Define the mapping from elements/attribues in UBL to a
    'data collection intent' (DCI)

    First parameter is a substring to match. Second parameter is the DCI.

    The list of possible data collection intents is defined in the next 
section

    In the event of an overlap, last rule wins.
    """
    rule("ID", "stringinput")
    rule("Code", "stringinput")
    rule("Indicator", "stringinput")
    rule("Name", "stringinput")
    rule("Reason", "stringinput")
    rule("BuildingNumber", "stringinput") # not a bug -- really string
    rule("Mail", "stringinput")
    rule("Telephone", "stringinput")
    rule("Telefax", "stringinput")
    rule("Zone", "stringinput")
    rule("Description", "stringinput")
    rule("Line", "stringinput")
    rule("Terms", "stringinput")
    rule("Country", "stringinput")
    rule("Note", "textarea")
    rule("Date", "dateinput")
    rule("DateTime", "datetimeinput")
    rule("Quantity", "numberinput")
    rule("Numeric", "numberinput")
    rule("GUID", "hidden")
    rule("Amount", "decimalinput")
    rule("@", "hidden")
    rule("/", "group")

def configure_data_collection_intents(intent):
    """A list of the data collection intents (first parameter), and a
    human-readable description of each (second parameter)
    """
    intent("hidden", "not presented to the end user")
    intent("group", "recursive")
    intent("stringinput",  "plain string entry")
    intent("numberinput",  "whole number entry")
    intent("decimalinput", "decimal number entry")
    intent("dateinput",    "date/calendar entry")
    intent("datetimeinput","date and time entry")
    intent("textarea",     "multiline text entry")
    intent("select1-AcknowledgementResponseCode", "code list 
AcknowledgementResponseCode")
    intent("select1-AllowanceChargeReasonCode",   "code list 
AllowanceChargeReasonCode")
    intent("select1-ChannelCode",                 "code list ChannelCode")
    intent("select1-ChipCode",                    "code list ChipCode")
    intent("select1-CountryIdentificationCode",   "code list 
CountryIdentificationCode")
    intent("select1-CurrencyCode",                "code list CurrencyCode")
    intent("select1-DocumentStatusCode",          "code list 
DocumentStatusCode")
    intent("select1-LatitudeDirectionCode",       "code list 
LatitudeDirectionCode")
    intent("select1-LineStatusCode",              "code list 
LineStatusCode")
    intent("select1-LongitudeDirectionCode",      "code list 
LongitudeDirectionCode")
    intent("select1-OperatorCode",                "code list OperatorCode")
    intent("select1-PaymentMeansCode",            "code list 
PaymentMeansCode")
    intent("select1-SubstitutionStatusCode",      "code list 
SubsitutionStatusCode")


def configure_inline_groups(inline):
    """A simple list of group names to flatten out by one level.

    (Mainly trivial things like a group-of-one)
    """
    inline("cac:DeliveryTerms")
    inline("cac:SalesConditons")
    inline("cac:LegalTotal")
    inline("cac:PaymentTerms")
    inline("cac:AllowanceCharge")
    inline("cac:OrderReference")
    inline("cac:OrderedItemIdentification")
    inline("cac:PartyName")
    inline("cac:DocumentReference")
    inline("cac:Contact")
    inline("cac:SellersItemIdentification")
    inline("cac:BasePrice")
    inline("cac:TaxCategory")
    inline("cac:TaxScheme")

-m

-- 
  Available for consulting. XForms, web forms, information overload.
  Micah Dubinko                           mailto:
  Brain Attic, L.L.C.                        http://brainattic.info
  Yahoo IM: mdubinko                                +1 623 298 5172
  Learn XForms today: http://xformsinstitute.com
← Prev in month ← Prev in thread