                                         console.log error
                                         res.send {'no_result' : 'Error : Server error occurred while retrieving data.'}
                                     else
-                                        se.doBasicSearch(res, tabDoctypes, pageParams)
+                                        searchEngine.doBasicSearch(res, tabDoctypes, pageParams)
                             else
                                 res.send {'no_result' : 'Error : Server error occurred while retrieving data.'}
 
-            else 
-                se.doBasicSearch(res, tabDoctypes, pageParams)
+            else
+                searchEngine.doBasicSearch(res, tabDoctypes, pageParams)
 
-                    
+
         else
             res.send {'no_result' : 'Error : Unknown research parameters'}
 

    if req.params.id?
        requests = []
        requests.push (callback) -> #0 -> delete
                ds.deleteById callback, req.params.id
        async.parallel requests, (error, results) ->
            if error
                res.send('error', 'Server error occurred while trying to remove data.')

action 'doctypes', ->

    #index several id for test
    #dataSystem.indexId "39bade34f76d6b32234c3974c8004ca9", ["description"]
    #dataSystem.indexId "39bade34f76d6b32234c3974c80059f0", ["description"]

    #prepare request
    requests = []
    requests.push (callback) -> #0 -> doctypes
        dataSystem.getDoctypes(callback)
    requests.push (callback) -> #1 -> metadoctypes
        dataSystem.getView(callback, dataSystem.getPATH().metadoctype.getallbyrelated)
        #dataSystem.applyModelRequest(callback, 'Metadoctype', 'getAllByRelated')
    requests.push (callback) -> #2 -> sums
        dataSystem.getView(callback, dataSystem.getPATH().common.getsumsbydoctype, {group : true})
        #dataSystem.applyModelRequest(callback, 'All', 'getSumsByDoctype', {group : true})
    requests.push (callback) -> #3 -> permissions
        dataSystem.getView(callback, dataSystem.getPATH().application.getpermissions)

    #agregate callback
    async.parallel requests, (error, results) ->
