public Number preEditNewspaper(String mode, Number docId, String compCode) {
    this.getDBTransaction().getSession().getUserData().put("compCode", compCode);
    Number result = null;
    CmsNewspaperTVOImpl newspaperTVO = this.getCmsNewspaperTVO();
    if ("CREATE".equals(mode)) {
      CmsDocTVOImpl docVO = this.getCmsDocTVO();
      CmsDocTVORowImpl docNewRow = (CmsDocTVORowImpl) docVO.createRow();
      docNewRow.setStatus("TO_GATHER_NEWSPAPER");
      docNewRow.setLibCode("NEWSPAPER");
      docNewRow.setLibTypeCode("END_PROD_LIB");
      docNewRow.setCompCode(compCode);
      docVO.insertRow(docNewRow);

      CmsNewspaperTVORowImpl newRow = (CmsNewspaperTVORowImpl) newspaperTVO.createRow();

      // 初始化
      CmsNewspaperCategoryVOImpl newspaperCategoryVO = this.getCmsNewspaperCategoryVO();
      CmsNewspaperCategoryVORowImpl row =
          (CmsNewspaperCategoryVORowImpl) newspaperCategoryVO.first();
      if (row != null) {
        newRow.setNewspaperCategoryId(row.getNewspaperCategoryId());
        newRow.setDocId(docNewRow.getDocId());
        newRow.setPrice(row.getPrice());
        newRow.setNewspaperType(row.getNewspaperType());
        newRow.setNewspaperTypeMeaning(row.getNewspaperTypeMeaning());
        newRow.setIssn(row.getIssn());
        newRow.setCn(row.getCn());
        newRow.setLang(row.getLang());
        newRow.setLangMeaning(row.getLangMeaning());
        newRow.setChiefEditor(row.getChiefEditor());
        newRow.setBookSize(row.getBookSize());
        newRow.setBookSizeMeaning(row.getBookSizeMeaning());
        newRow.setProdSize(row.getProdSize());
        newRow.setProdSizeMeaning(row.getProdSizeMeaning());
        newRow.setReaderGroup(row.getReaderGroup());
        newRow.setReaderGroupMeaning(row.getReaderGroupMeaning());
        newspaperTVO.insertRow(newRow);
        preDocCategroupRel(mode, docNewRow.getDocId(), row.getNewspaperCategoryId());
      }

      result = newRow.getDocId();
    } else {
      result = docId;
      newspaperTVO.setbvDocId(docId);
      newspaperTVO.executeQuery();
      Row row = newspaperTVO.first();
      if (row != null) {
        row.setAttribute("LastUpdateDate", new Date());
        newspaperTVO.setCurrentRow(row);
      }
      preDocCategroupRel(mode, docId, null);
    }
    return result;
  }
 public void initInfo4View(Number docId) {
   CmsDocTVOImpl docVO = this.getCmsDocTVO4View();
   docVO.setbvDocId(docId);
   docVO.executeQuery();
   CmsDocUcmRelTVOImpl durTVO = this.getCmsDocUcmRelTVO4FileList();
   durTVO.setbvDocId(docId);
   durTVO.executeQuery();
   Row row = docVO.first();
   if (row != null) {
     docVO.setCurrentRow(row);
   }
 }