#NEWLINE# @ access . public #NEWLINE# @ filtermodel ( model = 'collection' ) #NEWLINE# @ describeRoute ( Description ( 'List or search for collections.' ) . responseClass ( 'Collection' ) . param ( 'text' , 'Pass this to perform a text search for collections.' , required = False ) . pagingParams ( defaultSort = 'name' ) ) #NEWLINE# def find( self , params ) : #NEWLINE# #INDENT# user = self . getCurrentUser ( ) #NEWLINE# ( limit , offset , sort ) = self . getPagingParameters ( params , 'name' ) #NEWLINE# if ( 'text' in params ) : #NEWLINE# #INDENT# return list ( self . model ( 'collection' ) . textSearch ( params [ 'text' ] , user = user , limit = limit , offset = offset ) ) #NEWLINE# #UNINDENT# return list ( self . model ( 'collection' ) . list ( user = user , offset = offset , limit = limit , sort = sort ) )