Exemple #1
0
    def __init__(self, context):
        super(ZCDataProvider, self).__init__(context)
        catalog_adapter = ICatalog(context)
        # extract the metadata
        self.keys = catalog_adapter.get_schema()

        # add specific catalog brain mappings
        self.attributes.update({
            "path": "getPath",
        })

        # ignore some metadata values, which we already mapped
        self.ignore = [
            'CreationDate',
            'Creator',
            'Date',
            'Description',
            'EffectiveDate',
            'ExpirationDate',
            'ModificationDate',
            'Subject',
            'Title',
            'Type',
            'UID',
            'cmf_uid',
            'getIcon',
            'getId',
            'getObjSize',
            'getRemoteUrl',
            'listCreators',
            'meta_type',
        ]
Exemple #2
0
def get_catalog():
    """Get catalog adapter

    :returns: ICatalog adapter for the Portal
    :rtype: CatalogTool
    """
    portal = get_portal()
    return ICatalog(portal)
Exemple #3
0
def search(**kw):
    """Search the catalog adapter

    :returns: Catalog search results
    :rtype: iterable
    """
    portal = get_portal()
    catalog = ICatalog(portal)
    catalog_query = ICatalogQuery(catalog)
    query = catalog_query.make_query(**kw)
    return catalog(query)