def testSchemataOrdering(self):
        schema = ManagedSchema()
        schema.addField(MockField("one", "one"))
        schema.addField(MockField("two", "two"))
        order = get_schema_order(schema)
        self.assertEqual(order, {"two": ["two"], "one": ["one"]})
        self.assertEqual(order.keys(), ["one", "two"])

        schema.moveSchemata("two", -1)
        order = get_schema_order(schema)
        self.assertEqual(order, {"two": ["two"], "one": ["one"]})
        self.assertEqual(order.keys(), ["two", "one"])
Example #2
0
    def testSchemataOrdering(self):
        schema=ManagedSchema()
        schema.addField(MockField("one", "one"))
        schema.addField(MockField("two", "two"))
        order=get_schema_order(schema)
        self.assertEqual(order, {"two": ["two"], "one": ["one"]})
        self.assertEqual(order.keys(), ["one", "two"])

        schema.moveSchemata("two", -1)
        order=get_schema_order(schema)
        self.assertEqual(order, {"two": ["two"], "one": ["one"]})
        self.assertEqual(order.keys(), ["two", "one"])
            description = _(u'If this adapter tries to update an existing object using the above expression, '
                            u'but no object is found, what should happen?'),
            ),
        vocabulary = DisplayList((
            ('create', _(u'Create a new object instead.')),
            ('abort', _(u'Fail with an error message.')),
            ('quiet_abort', _(u'Silently skip this and any subsequent Salesforce adapters.')),
            )),
        default = 'abort',
        ),

))

# move 'field mapping' schemata before the inherited overrides schemata
schema = ManagedSchema(schema.copy().fields())
schema.moveSchemata('field mapping', -1)
schema.moveSchemata('create vs. update', -1)


class SalesforcePFGAdapter(FormActionAdapter):
    """ An adapter for PloneFormGen that saves results to Salesforce.
    """
    implements(interfaces.ISalesforcePFGAdapter)

    schema = schema
    security = ClassSecurityInfo()

    if not HAS_PLONE30:
        finalizeATCTSchema(schema, folderish=True, moveDiscussion=False)

    meta_type = portal_type = 'SalesforcePFGAdapter'
Example #4
0
                u'If this adapter tries to update an existing object using the above expression, '
                u'but no object is found, what should happen?'),
        ),
        vocabulary=DisplayList((
            ('create', _(u'Create a new object instead.')),
            ('abort', _(u'Fail with an error message.')),
            ('quiet_abort',
             _(u'Silently skip this and any subsequent Salesforce adapters.')),
        )),
        default='abort',
    ),
))

# move 'field mapping' schemata before the inherited overrides schemata
schema = ManagedSchema(schema.copy().fields())
schema.moveSchemata('field mapping', -1)
schema.moveSchemata('create vs. update', -1)


class SalesforcePFGAdapter(FormActionAdapter):
    """ An adapter for PloneFormGen that saves results to Salesforce.
    """
    implements(interfaces.ISalesforcePFGAdapter)

    schema = schema
    security = ClassSecurityInfo()

    if not HAS_PLONE30:
        finalizeATCTSchema(schema, folderish=True, moveDiscussion=False)

    meta_type = portal_type = 'SalesforcePFGAdapter'
Example #5
0
                 with your Form Folder. Choose the appropriate \
                 Salesforce Field for each Form Field.""",
                description_msgid="help_salesforce_field_map",
                columns={
                    "form_field": FixedColumn("Form Fields"),
                    "sf_field": SelectColumn("Salesforce Fields", vocabulary="buildSFFieldOptionList"),
                },
                i18n_domain="salesforcepfgadapter",
            ),
        ),
    )
)

# move 'field mapping' schemata before the inherited overrides schemata
schema = ManagedSchema(schema.copy().fields())
schema.moveSchemata("field mapping", -1)


class SalesforcePFGAdapter(FormActionAdapter):
    """ An adapter for PloneFormGen that saves results to Salesforce.
    """

    schema = schema
    security = ClassSecurityInfo()

    if not HAS_PLONE30:
        finalizeATCTSchema(schema, folderish=True, moveDiscussion=False)

    meta_type = portal_type = "SalesforcePFGAdapter"
    archetype_name = "Salesforce Adapter"
    content_icon = "salesforce.gif"