/**
  * 	GET note view.
  */
 public function getIndex($id = null)
 {
     //Return 404 if no id is passed
     if ($id == null) {
         App::abort(404, 'Note id not found');
     }
     //Invalid note id
     $annotation = Annotation::find($id);
     $user = $annotation->user()->first();
     if (!isset($annotation)) {
         App::abort(404, 'Unable to retrieve note');
     }
     //Retrieve note information
     $data = array('page_id' => 'Annotation', 'page_title' => 'View Annotation', 'annotation' => $annotation, 'user' => $user);
     //Render view and return to user
     return View::make('annotation.index', $data);
 }
 public function postFlags($doc, $annotation = null)
 {
     if ($annotation === null) {
         App::abort(404, 'No note id passed');
     }
     $annotation = Annotation::find($annotation);
     $annotation->saveUserAction(Auth::user()->id, Annotation::ACTION_FLAG);
     return Response::json($annotation->toAnnotatorArray());
 }