public Entry editEntry(User user,String id,String note,String quotation,boolean isPublic,Long modTime,boolean isAdmin,Errors errors){
  if (modTime == null) {
    Errors.add(errors,errorMessages.errorModTimeIsNull());
    return null;
  }
  if (user == null) {
    Errors.add(errors,errorMessages.errorUserIsNull());
    return null;
  }
  if (id != null && !idGenerator.isIdWellFormed(id)) {
    Errors.add(errors,errorMessages.errorIdIsInvalid());
    return null;
  }
  final Entry entry=getEntryById(id);
  if (entry == null) {
    Errors.add(errors,errorMessages.errorTheEntryCouldNotBeFound());
    return null;
  }
  if (!canUserModifyEntry(user,entry,isAdmin)) {
    Errors.add(errors,errorMessages.errorTheUserIsNotEntitledToModifyTheEntry());
    return null;
  }
  if (note != null) {
    note=cleanUpText(note);
  }
  if (entry.isNotebook()) {
    entry.setNotebookTitle(note);
  }
 else   if (entry.isSource()) {
    entry.setSourceTitle(note);
  }
 else {
    entry.setNote(note);
  }
  entry.setModTime(modTime);
  entry.setIsPublic(isPublic);
  if (entry.getCreateTime() > modTime.longValue()) {
    modTime=entry.getCreateTime();
  }
  if (entry.isQuotation()) {
    if (quotation != null) {
      quotation=cleanUpText(quotation);
      entry.setQuotation(quotation);
    }
  }
  return entry;
}

public Entry editEntry ( User user , String id , String note , String quotation , boolean isPublic , Long modTime , boolean isAdmin , Errors errors ) { if ( modTime == null ) { Errors . add ( errors , errorMessages . errorModTimeIsNull ( ) ) ; return null ; } if ( user == null ) { Errors . add ( errors , errorMessages . errorUserIsNull ( ) ) ; return null ; } if ( id != null && ! idGenerator . isIdWellFormed ( id ) ) { Errors . add ( errors , errorMessages . errorIdIsInvalid ( ) ) ; return null ; } final Entry entry = getEntryById ( id ) ; if ( entry == null ) { Errors . add ( errors , errorMessages . errorTheEntryCouldNotBeFound ( ) ) ; return null ; } if ( ! canUserModifyEntry ( user , entry , isAdmin ) ) { Errors . add ( errors , errorMessages . errorTheUserIsNotEntitledToModifyTheEntry ( ) ) ; return null ; } if ( note != null ) { note = cleanUpText ( note ) ; } if ( entry . isNotebook ( ) ) { entry . setNotebookTitle ( note ) ; } else if ( entry . isSource ( ) ) { entry . setSourceTitle ( note ) ; } else { entry . setNote ( note ) ; } entry . setModTime ( modTime ) ; entry . setIsPublic ( isPublic ) ; if ( entry . getCreateTime ( ) > modTime . longValue ( ) ) { modTime = entry . getCreateTime ( ) ; } if ( entry . isQuotation ( ) ) { if ( quotation != null ) { quotation = cleanUpText ( quotation ) ; entry . setQuotation ( quotation ) ; } } return entry ; }
api method . change values for the entry entry .
