Search in sources :

Example 1 with ImportsDVO

use of com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO in project Gargoyle by callakrsos.

the class ProjectInfoBaseInfoTab method createDocumentAction.

@Override
public void createDocumentAction(ProgramSpecSVO svo) {
    UserSourceMetaDVO meta = new UserSourceMetaDVO();
    meta.setPackages(baseInfoController.getPackage());
    meta.setProjectName(baseInfoController.getProjectName());
    meta.setProgramName(baseInfoController.getProjectName());
    meta.setUserPcName(baseInfoController.getUserName());
    svo.setUserSourceMetaDVO(meta);
    ImportsDVO importDvo = new ImportsDVO();
    importDvo.setImports(baseInfoController.getImports());
    svo.setImportsDVO(importDvo);
    svo.setMethodDVOList(baseInfoController.getMethodData());
}
Also used : ImportsDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO) UserSourceMetaDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.UserSourceMetaDVO)

Example 2 with ImportsDVO

use of com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO in project Gargoyle by callakrsos.

the class ProgramSpecUtil method doJavaFile.

public static ProgramSpecSVO doJavaFile(String projectName, String fileName, AbstractJavaProgramSpecFile newInstance) {
    ProgramSpecSVO svo = new ProgramSpecSVO();
    String packageNames = newInstance.getPackage();
    newInstance.setPackage(packageNames);
    newInstance.setProjectName(projectName);
    svo.setFile(newInstance);
    // svo.getUserSourceMetaDVO().setProjectName(projectName);
    // svo.getUserSourceMetaDVO().setPackages(packageNames);
    String userName = System.getProperty("user.name");
    List<SourceAnalysisDVO> listStatement = newInstance.listStatement();
    UserSourceMetaDVO userSourceMetaDVO = new UserSourceMetaDVO();
    userSourceMetaDVO.setProjectName(projectName);
    userSourceMetaDVO.setSimpleFileName(fileName);
    userSourceMetaDVO.setRealFilePath(newInstance.getFullFileName());
    userSourceMetaDVO.setUserPcName(userName);
    userSourceMetaDVO.setPackages(packageNames);
    svo.setUserSourceMetaDVO(userSourceMetaDVO);
    /* 시작 import문 처리 */
    List<String> imports = newInstance.getImports();
    ImportsDVO importsDVO = new ImportsDVO();
    importsDVO.setImports(imports);
    svo.setImportsDVO(importsDVO);
    /* 끝 import문 처리 */
    // 테이블 데이터 바인드
    List<MethodDVO> methodDVOList = new ArrayList<MethodDVO>();
    for (SourceAnalysisDVO dvo : listStatement) {
        try {
            // 소스내에 존재하는 메소드명.. 접근지 정자 + static + void 등의 잡다한 정보가 담겨있다.
            String methodName = dvo.getMethodName();
            String methodDescription = newInstance.getMethodDescription(methodName);
            MethodDVO methodDVO = null;
            methodDVO = AbstractJavaProgramSpecFile.toMethodDVO(methodName);
            methodDVO.setDescription(methodDescription);
            methodDVOList.add(methodDVO);
        } catch (ProgramSpecSourceException e) {
            e.printStackTrace();
        }
    }
    svo.setMethodDVOList(methodDVOList);
    return svo;
}
Also used : ImportsDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO) UserSourceMetaDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.UserSourceMetaDVO) ArrayList(java.util.ArrayList) ProgramSpecSVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ProgramSpecSVO) ProgramSpecSourceException(com.kyj.fx.voeditor.visual.exceptions.ProgramSpecSourceException) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO) SourceAnalysisDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.SourceAnalysisDVO)

Example 3 with ImportsDVO

use of com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO in project Gargoyle by callakrsos.

the class ProgramSpecUtil method doJsFile.

public static ProgramSpecSVO doJsFile(String projectName, String fileName, AbstractXframeProgramSpecFile newInstance) {
    ProgramSpecSVO svo = new ProgramSpecSVO();
    newInstance.setProjectName(projectName);
    svo.setFile(newInstance);
    String userName = System.getProperty("user.name");
    List<SourceAnalysisDVO> listStatement = newInstance.listStatement();
    UserSourceMetaDVO userSourceMetaDVO = new UserSourceMetaDVO();
    userSourceMetaDVO.setProjectName(projectName);
    userSourceMetaDVO.setSimpleFileName(fileName);
    userSourceMetaDVO.setRealFilePath(newInstance.getFullFileName());
    userSourceMetaDVO.setUserPcName(userName);
    userSourceMetaDVO.setPackages("");
    svo.setUserSourceMetaDVO(userSourceMetaDVO);
    /* 시작 import문 처리 */
    svo.setImportsDVO(new ImportsDVO());
    /* 끝 import문 처리 */
    // 테이블 데이터 바인드
    List<MethodDVO> methodDVOList = new ArrayList<MethodDVO>();
    for (SourceAnalysisDVO dvo : listStatement) {
        try {
            // 소스내에 존재하는 메소드명.. 접근지 정자 + static + void 등의 잡다한 정보가 담겨있다.
            String methodName = dvo.getMethodName();
            String methodDescription = newInstance.getMethodDescription(methodName);
            MethodDVO methodDVO = null;
            methodDVO = AbstractXframeProgramSpecFile.toMethodDVO(methodName);
            methodDVO.setDescription(methodDescription);
            methodDVOList.add(methodDVO);
        } catch (ProgramSpecSourceException e) {
            e.printStackTrace();
        }
    }
    svo.setMethodDVOList(methodDVOList);
    return svo;
}
Also used : ImportsDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO) UserSourceMetaDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.UserSourceMetaDVO) ArrayList(java.util.ArrayList) ProgramSpecSVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ProgramSpecSVO) ProgramSpecSourceException(com.kyj.fx.voeditor.visual.exceptions.ProgramSpecSourceException) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO) SourceAnalysisDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.SourceAnalysisDVO)

Example 4 with ImportsDVO

use of com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO in project Gargoyle by callakrsos.

the class ProgramSpecWordTemplate method headerPage3.

/**
	 * 
	 * 전반적인 메소드에 대한 정보를 기록. 본문 요약 정보
	 * 
	 * @param msWord
	 * @param svo
	 * @throws ParseException
	 */
public void headerPage3(ProgramSpecSVO svo) {
    // [START] #### 선언부 테이블에 전체적인 내용 기술 ####
    List<List<String>> list = new ArrayList<List<String>>();
    // 0 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("프로그램 사양서");
        list.add(arr);
    }
    // 1 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("a.시스템 명");
        arr.add(" - ");
        arr.add("b.시스템");
        arr.add(" - ");
        arr.add("c.서브시스템");
        arr.add(getSubSystemName(svo.getUserSourceMetaDVO().getProjectName(), svo.getUserSourceMetaDVO().getPackages()));
        list.add(arr);
    }
    // 2 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("d.프로그램ID");
        arr.add(svo.getUserSourceMetaDVO().getSimpleFileName());
        arr.add("e.작성자");
        arr.add(svo.getUserSourceMetaDVO().getUserPcName());
        arr.add("f.작성일");
        arr.add(DateUtil.getCurrentDateString("yyyy-MM-dd"));
        list.add(arr);
    }
    // 3 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("g.프로그램명");
        // 프로그램명정의
        String programName = svo.getUserSourceMetaDVO().getProgramName();
        arr.add(programName == null ? "" : programName);
        list.add(arr);
    }
    // 4 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("h.개발 유형");
        arr.add(svo.getFile().getFileType().toString());
        arr.add("i.프로그램 유형");
        arr.add(" - ");
        list.add(arr);
    }
    // 5 row
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("j. 프로그램 개요");
        arr.add(" - ");
        list.add(arr);
    }
    XWPFTable table = addToTable(list);
    mergeCellHorizon(table, 0, 0, 6);
    mergeCellHorizon(table, 3, 1, 6);
    mergeCellHorizon(table, 4, 1, 2);
    mergeCellHorizon(table, 4, 3, 6);
    mergeCellHorizon(table, 5, 1, 6);
    // [END] #### 선언부 테이블에 전체적인 내용 기술 ####
    // 공백
    addBreak();
    addText("■. 화면/Report/비즈니스 로직 설계", MSWord.H4, true, false, false);
    addBreak();
    addText("■ Object  리스트", true, false, false);
    List<List<String>> objList = new ArrayList<List<String>>();
    // 0 row 테이블 헤더.
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("순번 ");
        arr.add("Object ID ");
        arr.add("주요 기능 ");
        arr.add("신규/변경 ");
        objList.add(arr);
    }
    // [START] #### 데이터부 ####
    List<MethodDVO> methodDVOList = svo.getMethodDVOList();
    for (int i = 0; i < methodDVOList.size(); i++) {
        MethodDVO methodDVO = methodDVOList.get(i);
        if (methodDVO == null || methodDVO.getMethodName() == null) {
            continue;
        }
        ArrayList<String> arr = new ArrayList<String>();
        // seq
        arr.add(String.valueOf((i + 1)));
        // 메소드명
        arr.add(methodDVO.getMethodName());
        // 주요기능-- Main펑션이 빈경우 Description으로 설정됨.
        arr.add(ValueUtil.isEmpty(methodDVO.getMainFunction()) ? methodDVO.getDescription() : methodDVO.getMainFunction());
        // 신규 or 변경
        arr.add(methodDVO.getIsNewOrChg());
        objList.add(arr);
    }
    // [END] #### 데이터부 ####
    addToTable(objList);
    addBreak();
    // [START] #### Object 선언부(패키지) ####
    addText("■ Object  선언", true, false, false);
    ImportsDVO importsDVO = svo.getImportsDVO();
    if (importsDVO != null) {
        List<String> imports = importsDVO.getImports();
        doNotEmptyTextureScope(imports, new ITextureBlock() {

            @Override
            public void doScope(String text) {
                addText(text);
            }

            @Override
            public void emptyThen() {
                addText("N/A");
            }
        });
    } else {
        addText("디폴트 (N/A)");
    }
    // [END] #### Object 선언부(패키지) ####
    addBreak();
    // [START] #### ObjectID (Object 리스트에 기술된 Object ID와 일치하게 기술함) ####
    addText("■ Object ID (Object 리스트에 기술된 Object ID와 일치하게 기술함) ", true, false, false);
    for (int i = 0; i < methodDVOList.size(); i++) {
        MethodDVO methodDVO = methodDVOList.get(i);
        if (methodDVO == null || methodDVO.getMethodName() == null) {
            continue;
        }
        String visivility = methodDVO.getVisivility();
        String methodName = methodDVO.getMethodName();
        String returnType = methodDVO.getReturnType();
        String parameters = methodDVO.getParameters();
        addText(new StringBuffer().append((i + 1)).append(". ").append(visivility).append(" ").append(returnType).append(" ").append(methodName).append(" ").append(parameters).toString());
    }
    // [END] #### (Object 리스트에 기술된 Object ID와 일치하게 기술함) ####
    addBreak();
    // [START] #### Table 리스트(프로그램에서 사용되는 Table을 모두 기술) ####
    addText("  ○ Table 리스트(프로그램에서 사용되는 Table을 모두 기술)", true, false, false);
    List<List<String>> tableList = new ArrayList<List<String>>();
    // 0 row 헤더부분 기술
    {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add("Table ID");
        arr.add("Table 명");
        arr.add("CRUD");
        tableList.add(arr);
    }
    List<TableDVO> tableDVOList = svo.getTableDVOList();
    int DEFAULT_ROW = 4;
    // /
    if (tableDVOList != null) {
        for (TableDVO dvo : tableDVOList) {
            ArrayList<String> arr = new ArrayList<String>();
            arr.add(dvo.getTableId());
            arr.add(dvo.getTableName());
            arr.add(dvo.getCrud());
            tableList.add(arr);
        }
    }
    // 여유 공간이 남는다면 빈공간을 추가한다.
    int loopCnt = DEFAULT_ROW;
    if (tableDVOList != null) {
        loopCnt = DEFAULT_ROW - tableDVOList.size();
    }
    for (int i = 0; i < loopCnt; i++) {
        ArrayList<String> arr = new ArrayList<String>();
        arr.add(" ");
        arr.add(" ");
        arr.add(" ");
        tableList.add(arr);
    }
    // /
    addToTable(tableList);
// [END] #### Table 리스트(프로그램에서 사용되는 Table을 모두 기술) ####
}
Also used : ImportsDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO) XWPFTable(org.apache.poi.xwpf.usermodel.XWPFTable) ArrayList(java.util.ArrayList) ITextureBlock(com.kyj.fx.voeditor.visual.words.spec.auto.msword.interfaces.ITextureBlock) TableDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.TableDVO) ArrayList(java.util.ArrayList) List(java.util.List) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)

Aggregations

ImportsDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ImportsDVO)4 MethodDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)3 UserSourceMetaDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.UserSourceMetaDVO)3 ArrayList (java.util.ArrayList)3 ProgramSpecSourceException (com.kyj.fx.voeditor.visual.exceptions.ProgramSpecSourceException)2 ProgramSpecSVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.ProgramSpecSVO)2 SourceAnalysisDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.SourceAnalysisDVO)2 ITextureBlock (com.kyj.fx.voeditor.visual.words.spec.auto.msword.interfaces.ITextureBlock)1 TableDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.TableDVO)1 List (java.util.List)1 XWPFTable (org.apache.poi.xwpf.usermodel.XWPFTable)1