Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Attributes
wicked.at.seeker.AdvQueryMatchingSeeker Class Reference

List of all members.

Public Member Functions

def __init__
def configure
def queryUIDs
def scopedQuery
def basicQuery
def scopedSearch
def search
def bquery
def squery
def aggregate
def agg_brains
def agg_scoped_brains

Public Attributes

 context
 catalog
 path
 evalQ
 title

Static Public Attributes

 chunk = _marker
 normalled = _marker
 scope = _marker

Private Member Functions

def _query
def _aggquery

Static Private Attributes

 __call__ = _query

Detailed Description

An advanced query specific 
CMFish catalog query handler

Definition at line 10 of file seeker.py.


Constructor & Destructor Documentation

def wicked.at.seeker.AdvQueryMatchingSeeker.__init__ (   self,
  context 
)

Definition at line 22 of file seeker.py.

00022 
00023     def __init__(self, context):
00024         self.context = context
00025         self.catalog = getToolByName(context, 'portal_catalog')
00026         self.path = '/'.join(context.aq_inner.aq_parent.getPhysicalPath())    
00027         self.evalQ = self.catalog.evalAdvancedQuery

Here is the caller graph for this function:


Member Function Documentation

def wicked.at.seeker.AdvQueryMatchingSeeker._aggquery (   self,
  name,
  query 
) [private]

Definition at line 75 of file seeker.py.

00075 
00076     def _aggquery(self, name, query):
00077         curr = getattr(self, name, _marker)
00078         if curr is _marker:
00079             curr = query
00080         else:
00081             curr |= query
00082         setattr(self, name, curr)
00083         return curr

Here is the caller graph for this function:

def wicked.at.seeker.AdvQueryMatchingSeeker._query (   self,
  query,
  sort = ('created', 
) [private]

Definition at line 33 of file seeker.py.

00033 
00034     def _query(self, query, sort=('created',)):
00035         if sort:
00036             return self.evalQ(query, sort)
00037         else:
00038             return self.evalQ(query)

Here is the caller graph for this function:

aggregregate search returns

Definition at line 103 of file seeker.py.

00103 
00104     def agg_brains(self):
00105         """
00106         aggregregate search returns
00107         """
00108         return list(self._query(self._bquery))

Here is the call graph for this function:

aggregregate search returns

Definition at line 110 of file seeker.py.

00110 
00111     def agg_scoped_brains(self):
00112         """
00113         aggregregate search returns
00114         """
00115         return list(self._query(self._squery))

Here is the call graph for this function:

def wicked.at.seeker.AdvQueryMatchingSeeker.aggregate (   self,
  link,
  normalled,
  scope 
)
builds aggregated queries for scoped and basic

Definition at line 94 of file seeker.py.

00094 
00095     def aggregate(self, link, normalled, scope):
00096         """
00097         builds aggregated queries for scoped and basic
00098         """
00099         self.configure(link, normalled, scope)
00100         self.bquery 
00101         self.squery 

Here is the call graph for this function:

Definition at line 57 of file seeker.py.

00057 
00058     def basicQuery(self):
00059         chunk, normalled = self.chunk, self.normalled
00060         getId = chunk
00061         self.title = title = '"%s"' % chunk
00062         query = Generic('path', {'query': self.path, 'depth': -1}) \
00063                 & (Eq('getId', chunk) | Eq('Title', title) | Eq('getId', normalled))
00064         return query

Here is the caller graph for this function:

Definition at line 85 of file seeker.py.

00085 
00086     def bquery(self):
00087         return self._aggquery('_bquery', self.basicQuery)

Here is the call graph for this function:

Here is the caller graph for this function:

def wicked.at.seeker.AdvQueryMatchingSeeker.configure (   self,
  chunk,
  normalled,
  scope 
)

Definition at line 28 of file seeker.py.

00028 
00029     def configure(self, chunk, normalled, scope):
00030         self.chunk = chunk
00031         self.normalled = normalled
00032         self.scope = scope

Here is the caller graph for this function:

Definition at line 39 of file seeker.py.

00039 
00040     def queryUIDs(self, uids):
00041         return self._query(Generic('UID', uids), sort=None)

Here is the call graph for this function:

Definition at line 43 of file seeker.py.

00043 
00044     def scopedQuery(self):
00045         chunk, title = self.chunk, self.title
00046         query = (Eq('getId', chunk) | Eq('Title', title))
00047         if not self.scope is _marker:
00048             # XXX let's move this out of attr storage
00049             # on the content to at least an annotation
00050             scope = getattr(self.context, self.scope, self.scope)
00051             if callable(scope):
00052                 scope = scope()
00053             if scope:
00054                 query = Generic('path', scope) & query
00055         return query

Here is the caller graph for this function:

Definition at line 67 of file seeker.py.

00067 
00068     def scopedSearch(self):
00069         return self._query(self.scopedQuery)

Here is the call graph for this function:

Definition at line 72 of file seeker.py.

00072 
00073     def search(self):
00074         return self._query(self.basicQuery)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 89 of file seeker.py.

00089 
00090     def squery(self):
00091         return self._aggquery('_squery', self.scopedQuery)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 116 of file seeker.py.

Definition at line 24 of file seeker.py.

Definition at line 18 of file seeker.py.

Definition at line 23 of file seeker.py.

Definition at line 26 of file seeker.py.

Definition at line 19 of file seeker.py.

Definition at line 25 of file seeker.py.

Definition at line 20 of file seeker.py.

Definition at line 60 of file seeker.py.


The documentation for this class was generated from the following file: