Exemple #1
0
  public static ADDocType getType(DocumentType type) {
    DocumentDaoImpl dao = DB.getDocumentDao();

    ADDocType adtype = new ADDocType(type.getId(), type.getName(), type.getDisplayName());

    if (type.getId() != null) {
      adtype = dao.getDocumentTypeById(type.getId());
      adtype.setName(type.getName());
      adtype.setDisplay(type.getDisplayName());
    }

    return adtype;
  }
Exemple #2
0
  public static DocumentType getType(ADDocType adtype, boolean loadDetails) {
    DocumentDaoImpl dao = DB.getDocumentDao();
    DocumentType type =
        new DocumentType(
            adtype.getId(), adtype.getName(), adtype.getDisplay(), adtype.getClassName());

    if (loadDetails) {
      type.setFormId(dao.getFormId(adtype.getId()));
    }

    if (adtype.getProcessDef() != null) {
      type.setProcessId(adtype.getProcessDef().getProcessId());
    }

    return type;
  }