@SuppressWarnings("unchecked")
  public EditNotePage(PageParameters params) {
    super(params);
    if (params.containsKey(BugeaterConstants.PARAM_NAME_NOTE_ID)) {
      try {
        Note note = noteService.load(params.getLong(BugeaterConstants.PARAM_NAME_NOTE_ID));
        init(new IssueModel(note.getIssue()), new NoteModel(note), null);
      } catch (StringValueConversionException svce) {
        throw new IllegalArgumentException(svce);
      }
    } else if (params.containsKey(BugeaterConstants.PARAM_NAME_ISSUE_ID)) {
      try {
        Long issueid = params.getLong(BugeaterConstants.PARAM_NAME_ISSUE_ID);
        IssueStatus newStatus = null;
        if (params.containsKey(BugeaterConstants.PARAM_NAME_ISSUE_STATUS)) {
          try {
            newStatus =
                IssueStatus.fromOrdinal(params.getInt(BugeaterConstants.PARAM_NAME_ISSUE_STATUS));
          } catch (StringValueConversionException svce) {
            throw new IllegalArgumentException(svce);
          }
        }

        init(new IssueModel(issueid), new NoteModel((Long) null), newStatus);
      } catch (StringValueConversionException svce) {
        logger.error(svce);
      }
    } else {
      setResponsePage(Home.class);
    }
  }