コメントアウト(エラーを減らすため)

This commit is contained in:
r-ca 2024-01-08 16:49:11 +09:00
parent 89e2f15a29
commit 4a66ed786d
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -50,74 +50,74 @@ public class DocumentProcessorImpl implements DocumentProcessor{
@Override @Override
public void init() { public void init() {
logger.debug("init", "called"); // logger.debug("init", "called");
// Init Variables // // Init Variables
this.documentRootPath = this.documentDetail.getPath().getFullPath(); // this.documentRootPath = this.documentDetail.getPath().getFullPath();
logger.debug("init", "documentRootPath: " + this.documentRootPath); // logger.debug("init", "documentRootPath: " + this.documentRootPath);
//
this.fileManager = fileManagerFactory.create(this.documentRootPath); //Initialize FileManager // this.fileManager = fileManagerFactory.create(this.documentRootPath); //Initialize FileManager
logger.debug("init", "fileManager created"); // logger.debug("init", "fileManager created");
//
this.fileManager.autoCreateDir(this.documentRootPath); // this.fileManager.autoCreateDir(this.documentRootPath);
//
// rawディレクトリInit // // rawディレクトリInit
this.fileManager.autoCreateDir(DEFAULT_SAVE_DIR); // this.fileManager.autoCreateDir(DEFAULT_SAVE_DIR);
//
// xmlファイルの読み込み // // xmlファイルの読み込み
if (fileManager.isExist("meta.xml")) { // if (fileManager.isExist("meta.xml")) {
logger.debug("init", "meta.xml found"); // logger.debug("init", "meta.xml found");
try { // try {
xmlMetaModel = xmlMetaParser.deserialize(this.fileManager.loadDocument("meta.xml")); // xmlMetaModel = xmlMetaParser.deserialize(this.fileManager.loadDocument("meta.xml"));
} catch (Exception e) { // } catch (Exception e) {
logger.debug("init", "meta.xml parse failed"); // logger.debug("init", "meta.xml parse failed");
logger.trace("init", e.getMessage()); // logger.trace("init", e.getMessage());
} // }
} else { // } else {
logger.debug("init", "meta.xml not found"); // logger.debug("init", "meta.xml not found");
xmlMetaModel = new XmlMetaModel(); // xmlMetaModel = new XmlMetaModel();
//
xmlMetaModel.setTitle(this.documentDetail.getMeta().getTitle()); // xmlMetaModel.setTitle(this.documentDetail.getMeta().getTitle());
xmlMetaModel.setAuthor(this.documentDetail.getAuthor()); // xmlMetaModel.setAuthor(this.documentDetail.getAuthor());
xmlMetaModel.setDescription(""); // FIXME-rca: // xmlMetaModel.setDescription(""); // FIXME-rca:
xmlMetaModel.setDefaultBranch(this.documentDetail.getDefaultBranch()); // xmlMetaModel.setDefaultBranch(this.documentDetail.getDefaultBranch());
xmlMetaModel.setPages(new ArrayList<>()); // xmlMetaModel.setPages(new ArrayList<>());
//
try { // try {
this.fileManager.saveDocument(xmlMetaParser.serialize(xmlMetaModel), "meta.xml"); // this.fileManager.saveDocument(xmlMetaParser.serialize(xmlMetaModel), "meta.xml");
logger.debug("init", "meta.xml saved"); // logger.debug("init", "meta.xml saved");
} catch (Exception e) { // } catch (Exception e) {
logger.error("init", "meta.xml save failed"); // logger.error("init", "meta.xml save failed");
logger.trace("init", e.getMessage()); // logger.trace("init", e.getMessage());
} // }
} // }
//
logger.info("init", "finished"); // logger.info("init", "finished");
} }
@Override @Override
public void addNewPageToLast(Bitmap bitmap) { public void addNewPageToLast(Bitmap bitmap) {
logger.debug("addNewPageToLast", "called"); // logger.debug("addNewPageToLast", "called");
String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする // String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする
//
// FileManager // // FileManager
if (this.fileManager.getCurrentDir().equals(this.documentRootPath.resolve(DEFAULT_SAVE_DIR))) { // TODO-rca: 効率化 // if (this.fileManager.getCurrentDir().equals(this.documentRootPath.resolve(DEFAULT_SAVE_DIR))) { // TODO-rca: 効率化
logger.debug("addNewPageToLast", "currentDir is documentRootPath"); // logger.debug("addNewPageToLast", "currentDir is documentRootPath");
} else { // } else {
logger.debug("addNewPageToLast", "currentDir is not documentRootPath"); // logger.debug("addNewPageToLast", "currentDir is not documentRootPath");
this.fileManager.backRootDir(); // this.fileManager.backRootDir();
this.fileManager.autoCreateDir(DEFAULT_SAVE_DIR); // this.fileManager.autoCreateDir(DEFAULT_SAVE_DIR);
this.fileManager.changeDir(DEFAULT_SAVE_DIR); // this.fileManager.changeDir(DEFAULT_SAVE_DIR);
} // }
logger.debug("addNewPageToLast", "DirInit finished"); // logger.debug("addNewPageToLast", "DirInit finished");
//
// Save file // // Save file
this.fileManager.saveBitmapAtCurrent(bitmap, filename); // this.fileManager.saveBitmapAtCurrent(bitmap, filename);
//
// Update meta // // Update meta
XmlMetaPageModel page = new XmlMetaPageModel(); // XmlMetaPageModel page = new XmlMetaPageModel();
page.setIndex(xmlMetaModel.getPages().size() + 1); // page.setIndex(xmlMetaModel.getPages().size() + 1);
page.setFilename(filename); // page.setFilename(filename);
xmlMetaModel.addPage(page); // xmlMetaModel.addPage(page);
} }
@Override @Override