use of com.kyj.fx.voeditor.visual.words.spec.auto.msword.model.AbstractJavaProgramSpecFile in project Gargoyle by callakrsos.
the class ProgramSpecUtil method createDefault.
public static boolean createDefault(File sourceFile, File targetFile) {
boolean result = false;
try {
IProgramSpecFile newInstance = ProgramSpecFileUtil.newInstance(sourceFile);
ProgramSpecSVO svo = new ProgramSpecSVO();
if (newInstance instanceof AbstractJavaProgramSpecFile) {
svo = doJavaFile("sampleJavaProject", sourceFile.getName(), (AbstractJavaProgramSpecFile) newInstance);
} else if (newInstance instanceof AbstractXframeProgramSpecFile) {
svo = doJsFile("sampleXframeProject", sourceFile.getName(), (AbstractXframeProgramSpecFile) newInstance);
}
IProgramSpecFile abPFile = svo.getFile();
// 확장자까지 포함된 파일명
String simpleFileName = svo.getUserSourceMetaDVO().getSimpleFileName();
// 확장자를 제거하고 워드문서가 생성될 파일명 작성
String fileName = "(" + abPFile.getSourceFileType().toString() + ")(사양서)" + simpleFileName.substring(0, simpleFileName.indexOf('.')) + ".docx";
// 풀 경로 설정.( 유저의 데스크탑에 저장됨.)
String docFile = "";
if (targetFile == null)
docFile = System.getProperty("user.home") + File.separator + "Desktop" + File.separator + fileName;
else
docFile = targetFile.getAbsolutePath();
ProgramSpecWordTemplate word = new ProgramSpecWordTemplate(docFile, svo);
word.write();
word.close();
LOGGER.debug("사양서 생성 완료.[ " + sourceFile + " ]");
result = true;
} catch (Exception e1) {
e1.printStackTrace();
}
return result;
}
use of com.kyj.fx.voeditor.visual.words.spec.auto.msword.model.AbstractJavaProgramSpecFile in project Gargoyle by callakrsos.
the class ProgramSpecFileUtilTest method simpleWrite.
/**
* 프로그램 사양서 정의대로 비즈니스에 맞게 변환
*
* @param file
* @return
* @throws Exception
*/
@Test
public void simpleWrite() throws Exception {
String filePath = "ProgramSpecFileUtilTest.java";
File file = new File(filePath);
IProgramSpecFile newInstance = ProgramSpecFileUtil.newInstance(file);
ProgramSpecSVO svo = new ProgramSpecSVO();
if (newInstance instanceof AbstractJavaProgramSpecFile) {
svo = ProgramSpecUtil.doJavaFile("sampleJavaProject", file.getName(), (AbstractJavaProgramSpecFile) newInstance);
} else if (newInstance instanceof AbstractXframeProgramSpecFile) {
svo = ProgramSpecUtil.doJsFile("sampleXframeProject", file.getName(), (AbstractXframeProgramSpecFile) newInstance);
}
// InspectorSourceMeta meta = newInstance.getInspectorSourceMeta();
// List<SourceAnalysisDVO> methodList = InspectorBiz.getInstance().methodList(meta);
// methodList.forEach(method -> {
// String methodName = method.getMethodName();
// System.out.println(methodName);
// System.out.println(method.getStartLine());
// System.out.println(method.getEndLine());
// });
// System.out.println(meta.listBlock());
// System.out.println(meta.getSourceCodeList());
// svo.getMethodDVOList().forEach(method -> {
//
// MethodMetaDVO methodMetaDVO = method.getMethodMetaDVO();
// System.out.println(method.getMethodName());
//
// System.out.println(method.getDescription());
//
// System.out.println(method.getMainFunction());
// });
IProgramSpecFile abPFile = svo.getFile();
// 확장자까지 포함된 파일명
String simpleFileName = svo.getUserSourceMetaDVO().getSimpleFileName();
// 확장자를 제거하고 워드문서가 생성될 파일명 작성
String fileName = "(" + abPFile.getSourceFileType().toString() + ")(사양서)" + simpleFileName.substring(0, simpleFileName.indexOf('.')) + ".docx";
// 풀 경로 설정.( 유저의 데스크탑에 저장됨.)
String docFile = System.getProperty("user.home") + File.separator + "Desktop" + File.separator + fileName;
try {
ProgramSpecWordTemplate word = new ProgramSpecWordTemplate(docFile, svo);
word.write();
word.close();
System.out.println("사양서 생성 완료.[ " + file + " ]");
} catch (IOException e1) {
throw e1;
}
}
Aggregations