public static void templateData(Restorable r, FormInstance dm, TreeReference parent) {
    if (parent == null) {
      parent = topRef(dm);
      applyDataType(dm, "timestamp", parent, Date.class);
    }

    if (r instanceof Persistable) {
      applyDataType(dm, RECORD_ID_TAG, parent, Integer.class);
    }

    r.templateData(dm, parent);
  }