       return error err if err
       success JSON.parse(body) if success
 
+  fetchWidgetIdByIdentifier: (id, success, error) ->
+    r = request_get "http://115.28.1.119:18860/mam/api/mam/widget/checkIdentity?identify=#{id}"
+
   newModule: (data, success, error) ->
 
     Q.Promise (resolve, reject, notify) ->

      throw new Error('upload fail') unless result.result is 'success'
      @validateAttach(result.id).then (nResult) -> _.extend(nResult, boundle: result.id)
    .then (result) =>
      console.log "new module"
      throw new Error('validate fail') unless result.result is 'success'
      @newModule _.extend result, {widget_id: '548698920cf2da4e8927bab5'}
    .then (result) ->
      cell.changeState 'normal' if result.result is 'success'
    .catch (err) ->

        filename: 'upload.zip'
        contentType: 'application/zip'

  encrypt: (sourceDir, targetDir) ->

    Q.Promise (resolve, reject, notify) ->
      encrypt sourceDir, targetDir, 'foreveross', (err)=>
        if err then reject(err) else resolve()

  destroy: ->
    @detach()
