Пример #1
0
def ajax_search(request):
    """
    Used for the search box within the admin.
    """
    json = '[]'
    q = request.GET.get('q', None)
    if q:
        ws = service.WebScript('django/','search', format='json')
        ticket = request.user.ticket
        json = ws.search(q='@cm\:title:"%s" TEXT:%s' % (q, q), alf_ticket=ticket, raw=True)        
    return render_to_response('alfresco/ajax_search.json', {'json':json})
Пример #2
0
    def get(self, *args, **kwargs):
        #handles the Related Manager case.
        kwargs.update(getattr(self, 'core_filters', {}))

        ws = service.WebScript('django/', 'archive')
        try:
            if kwargs.has_key('space__id'):
                web_script_list = ws.get_by_space(*args, **kwargs)
            else:
                web_script_list = ws.get(*args, **kwargs)
        except service.AlfrescoException, e:
            if e.code is 4:
                raise self.model.DoesNotExist, 'No Alfresco content exists with that ID'
            else:
                raise e
Пример #3
0
    def all(self, *args, **kwargs):
        #handles the Related Manager case.
        kwargs.update(getattr(self, 'core_filters', {}))
        if not kwargs.has_key('space__id'):
            #raise NotImplementedError('Filter is not implemented for the Content Manager only the Space Related Manger')
            # Need to return empty for dumpdata to function properly
            logger.error(
                'Filter is not implemented for the Content Manager only the Space Related Manger'
            )
            return []

        ws = service.WebScript('django/', 'space')
        kwargs['id'] = kwargs.pop('space__id')
        web_script_list = ws.get(*args, **kwargs)
        return web_script_list