From 908f6459e3a8fe3438f1f57057ae366fbe107a95 Mon Sep 17 00:00:00 2001 From: Koda Date: Sat, 19 Sep 2015 04:36:07 +0900 Subject: [PATCH] =?UTF-8?q?-=20Website=E3=81=AE=E6=83=85=E5=A0=B1=E3=82=92?= =?UTF-8?q?=E8=A8=98=E4=BA=8B=E3=81=A8=E3=81=97=E3=81=9F=E3=81=84=20#7=20-?= =?UTF-8?q?=20=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E3=81=A3=E3=81=9F=E7=99=BB=E9=8C=B2=20#27=20?= =?UTF-8?q?=20=20=20=20-=20=E7=99=BB=E9=8C=B2=E3=81=99=E3=82=8B=E3=83=8A?= =?UTF-8?q?=E3=83=AC=E3=83=83=E3=82=B8=E3=81=AE=E7=A8=AE=E9=A1=9E=E3=82=92?= =?UTF-8?q?=E4=BB=8A=E3=81=BE=E3=81=A7=E3=81=A9=E3=81=8A=E3=82=8A=E3=81=AE?= =?UTF-8?q?=E3=80=8Cknowledge=E3=80=8D=E3=81=A8=E3=80=81Web=E3=82=B5?= =?UTF-8?q?=E3=82=A4=E3=83=88=E3=81=AE=E6=83=85=E5=A0=B1=E3=81=A7=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=80=8Cbookmark=E3=80=8D=E3=81=A7=E9=81=B8=E6=8A=9E?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E3=81=AB=E3=81=97=E3=81=9F=20=20=20=20=20-?= =?UTF-8?q?=20=E3=80=8Cbookmark=E3=80=8D=E3=81=AE=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=80=81=E7=99=BB=E9=8C=B2=E3=81=97=E3=81=9FURL=E3=81=AB?= =?UTF-8?q?=E6=9B=B8=E3=81=8B=E3=82=8C=E3=82=8B=E3=82=B3=E3=83=B3=E3=83=86?= =?UTF-8?q?=E3=83=B3=E3=83=84=E3=81=AE=E5=86=85=E5=AE=B9=E3=81=A7=E6=A4=9C?= =?UTF-8?q?=E7=B4=A2=E5=8F=AF=E8=83=BD=E3=81=AB=E3=81=97=E3=81=9F=20=20=20?= =?UTF-8?q?=20=20-=20=E3=80=8Cknowledge=E3=80=8D=E3=81=A8=E3=80=8Cbookmark?= =?UTF-8?q?=E3=80=8D=E3=82=92=E5=88=87=E3=82=8A=E6=9B=BF=E3=81=88=E3=81=AE?= =?UTF-8?q?=E9=83=A8=E5=88=86=E3=81=A7=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E9=81=B8=E6=8A=9E=E3=81=AE=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90=20=20=20=20=20=20=20=20=20-=20DB?= =?UTF-8?q?=E3=81=AB=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=99=E3=82=8B=E3=81=A8=E3=80=81=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E3=81=99=E3=82=8B=E3=83=8A=E3=83=AC=E3=83=83=E3=82=B8?= =?UTF-8?q?=E3=81=AE=E7=A8=AE=E9=A1=9E=E3=81=8C=E5=A2=97=E3=81=88=E3=82=8B?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20-=20=E3=83=86=E3=83=B3=E3=83=97?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=83=88=E7=99=BB=E9=8C=B2=EF=BC=8F=E7=B7=A8?= =?UTF-8?q?=E9=9B=86=E3=81=AE=E7=94=BB=E9=9D=A2=E3=81=AF=E7=84=A1=E3=81=84?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E3=80=81=E4=BB=8A=E3=81=AE=E3=81=A8=E3=81=93?= =?UTF-8?q?=E3=82=8D=E3=80=81=E5=88=9D=E6=9C=9F=E3=83=87=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=81=AE=E3=80=8Cknowledge=E3=80=8D=E3=81=A8=E3=80=8Cbookmark?= =?UTF-8?q?=E3=80=8D=E3=81=AE=E3=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ユーザのLDAP認証 #8 - BaseDNが固定になる問題を修正 - コメント欄でも添付ファイルをつけたい #39 - 添付ファイルをつけれるようにした --- document/database/knowledge.a5er | 806 +++++++----------- pom.xml | 7 + .../project/knowledge/bat/FileParseBat.java | 67 +- .../project/knowledge/config/AuthType.java | 21 + .../project/knowledge/config/IndexType.java | 3 +- .../knowledge/control/admin/MailControl.java | 20 +- .../knowledge/control/admin/ProxyControl.java | 172 ++++ .../control/open/KnowledgeControl.java | 40 + .../control/protect/KnowledgeControl.java | 49 +- .../project/knowledge/dao/ItemChoicesDao.java | 40 + .../knowledge/dao/KnowledgeItemValuesDao.java | 34 + .../knowledge/dao/StockKnowledgesDao.java | 28 + .../knowledge/dao/TemplateItemsDao.java | 30 + .../knowledge/dao/TemplateMastersDao.java | 74 ++ .../knowledge/dao/gen/GenCommentsDao.java | 3 + .../knowledge/dao/gen/GenItemChoicesDao.java | 327 +++++++ .../dao/gen/GenKnowledgeItemValuesDao.java | 327 +++++++ .../knowledge/dao/gen/GenKnowledgesDao.java | 3 + .../dao/gen/GenStockKnowledgesDao.java | 307 +++++++ .../knowledge/dao/gen/GenStocksDao.java | 103 +-- .../dao/gen/GenTemplateItemsDao.java | 310 +++++++ .../dao/gen/GenTemplateMastersDao.java | 288 +++++++ .../project/knowledge/deploy/InitDB.java | 6 +- .../deploy/v0_6_0pre2/Migrate_0_6_0pre2.java | 21 + .../knowledge/entity/ItemChoicesEntity.java | 52 ++ .../entity/KnowledgeItemValuesEntity.java | 49 ++ .../entity/StockKnowledgesEntity.java | 51 ++ .../knowledge/entity/StocksEntity.java | 7 +- .../knowledge/entity/TemplateItemsEntity.java | 68 ++ .../entity/TemplateMastersEntity.java | 57 ++ .../entity/gen/GenCommentsEntity.java | 28 + .../entity/gen/GenItemChoicesEntity.java | 445 ++++++++++ .../gen/GenKnowledgeItemValuesEntity.java | 415 +++++++++ .../entity/gen/GenKnowledgesEntity.java | 28 + .../entity/gen/GenStockKnowledgesEntity.java | 334 ++++++++ .../knowledge/entity/gen/GenStocksEntity.java | 131 +-- .../entity/gen/GenTemplateItemsEntity.java | 402 +++++++++ .../entity/gen/GenTemplateMastersEntity.java | 367 ++++++++ .../project/knowledge/logic/CrawlerLogic.java | 540 ++++++++++++ .../knowledge/logic/KnowledgeLogic.java | 108 ++- src/main/resources/appresource.properties | 24 +- src/main/resources/appresource_ja.properties | 23 +- src/main/resources/log4j.xml | 2 +- .../sql/CommentsDao/CommentsDao_insert.sql | 2 + .../CommentsDao/CommentsDao_raw_insert.sql | 2 + .../sql/CommentsDao/CommentsDao_update.sql | 1 + .../ItemChoicesDao/ItemChoicesDao_delete.sql | 6 + .../ItemChoicesDao/ItemChoicesDao_insert.sql | 24 + .../ItemChoicesDao_physical_select_all.sql | 1 + ...hoicesDao_physical_select_on_choice_no.sql | 5 + ...mChoicesDao_physical_select_on_item_no.sql | 5 + .../ItemChoicesDao_physical_select_on_key.sql | 6 + ...mChoicesDao_physical_select_on_type_id.sql | 5 + .../ItemChoicesDao_raw_insert.sql | 24 + .../ItemChoicesDao_select_all.sql | 2 + .../ItemChoicesDao_select_on_choice_no.sql | 5 + .../ItemChoicesDao_select_on_item_no.sql | 5 + .../ItemChoicesDao_select_on_key.sql | 7 + .../ItemChoicesDao_select_on_type_id.sql | 5 + .../ItemChoicesDao/ItemChoicesDao_update.sql | 14 + .../KnowledgeItemValuesDao_delete.sql | 6 + .../KnowledgeItemValuesDao_insert.sql | 24 + ...ledgeItemValuesDao_physical_select_all.sql | 1 + ...emValuesDao_physical_select_on_item_no.sql | 5 + ...geItemValuesDao_physical_select_on_key.sql | 6 + ...uesDao_physical_select_on_knowledge_id.sql | 5 + ...emValuesDao_physical_select_on_type_id.sql | 5 + .../KnowledgeItemValuesDao_raw_insert.sql | 24 + .../KnowledgeItemValuesDao_select_all.sql | 2 + ...owledgeItemValuesDao_select_on_item_no.sql | 5 + .../KnowledgeItemValuesDao_select_on_key.sql | 7 + ...geItemValuesDao_select_on_knowledge_id.sql | 5 + ...owledgeItemValuesDao_select_on_type_id.sql | 5 + .../KnowledgeItemValuesDao_update.sql | 14 + .../KnowledgesDao/KnowledgesDao_insert.sql | 2 + .../KnowledgesDao_raw_insert.sql | 2 + .../KnowledgesDao/KnowledgesDao_update.sql | 1 + .../StockKnowledgesDao_delete.sql | 5 + .../StockKnowledgesDao_insert.sql | 20 + ...StockKnowledgesDao_physical_select_all.sql | 1 + ...ckKnowledgesDao_physical_select_on_key.sql | 5 + ...gesDao_physical_select_on_knowledge_id.sql | 5 + ...wledgesDao_physical_select_on_stock_id.sql | 5 + .../StockKnowledgesDao_raw_insert.sql | 20 + .../StockKnowledgesDao_select_all.sql | 2 + .../StockKnowledgesDao_select_on_key.sql | 6 + ...ckKnowledgesDao_select_on_knowledge_id.sql | 5 + .../StockKnowledgesDao_select_on_stock_id.sql | 5 + .../StockKnowledgesDao_update.sql | 12 + .../dao/sql/StocksDao/StocksDao_delete.sql | 3 +- .../dao/sql/StocksDao/StocksDao_insert.sql | 10 +- .../StocksDao_physical_select_on_key.sql | 3 +- .../sql/StocksDao/StocksDao_raw_insert.sql | 8 +- .../sql/StocksDao/StocksDao_select_on_key.sql | 3 +- .../dao/sql/StocksDao/StocksDao_update.sql | 7 +- .../TemplateItemsDao_delete.sql | 5 + .../TemplateItemsDao_insert.sql | 22 + .../TemplateItemsDao_physical_select_all.sql | 1 + ...ateItemsDao_physical_select_on_item_no.sql | 5 + ...emplateItemsDao_physical_select_on_key.sql | 5 + ...ateItemsDao_physical_select_on_type_id.sql | 5 + .../TemplateItemsDao_raw_insert.sql | 22 + .../TemplateItemsDao_select_all.sql | 2 + .../TemplateItemsDao_select_on_item_no.sql | 5 + .../TemplateItemsDao_select_on_key.sql | 6 + .../TemplateItemsDao_select_on_type_id.sql | 5 + .../TemplateItemsDao_update.sql | 13 + .../TemplateMastersDao_delete.sql | 4 + .../TemplateMastersDao_insert.sql | 22 + ...TemplateMastersDao_physical_select_all.sql | 1 + ...plateMastersDao_physical_select_on_key.sql | 4 + .../TemplateMastersDao_raw_insert.sql | 22 + .../TemplateMastersDao_select_all.sql | 2 + .../TemplateMastersDao_select_on_key.sql | 5 + .../TemplateMastersDao_update.sql | 13 + .../project/knowledge/database/ddl.sql | 169 +++- .../project/knowledge/database/init_datas.sql | 13 +- .../knowledge/deploy/v0_6_0pre2/migrate.sql | 246 ++++++ .../WEB-INF/views/admin/proxy/config.jsp | 144 ++++ .../views/commons/layout/commonNavbar.jsp | 5 + .../WEB-INF/views/open/knowledge/view.jsp | 93 +- .../views/protect/knowledge/view_add.jsp | 60 +- .../views/protect/knowledge/view_edit.jsp | 61 +- src/main/webapp/css/knowledge-view.css | 11 + src/main/webapp/js/knowledge-edit.js | 52 ++ src/main/webapp/js/knowledge-view.js | 50 +- .../knowledge/dao/KnowledgesDaoTest.java | 2 +- .../knowledge/logic/KnowledgeLogicTest.java | 8 +- .../knowledge/tool/AddSampleKnowledge.java | 2 +- 129 files changed, 6914 insertions(+), 751 deletions(-) create mode 100644 src/main/java/org/support/project/knowledge/config/AuthType.java create mode 100644 src/main/java/org/support/project/knowledge/control/admin/ProxyControl.java create mode 100644 src/main/java/org/support/project/knowledge/dao/ItemChoicesDao.java create mode 100644 src/main/java/org/support/project/knowledge/dao/KnowledgeItemValuesDao.java create mode 100644 src/main/java/org/support/project/knowledge/dao/StockKnowledgesDao.java create mode 100644 src/main/java/org/support/project/knowledge/dao/TemplateItemsDao.java create mode 100644 src/main/java/org/support/project/knowledge/dao/TemplateMastersDao.java create mode 100644 src/main/java/org/support/project/knowledge/dao/gen/GenItemChoicesDao.java create mode 100644 src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeItemValuesDao.java create mode 100644 src/main/java/org/support/project/knowledge/dao/gen/GenStockKnowledgesDao.java create mode 100644 src/main/java/org/support/project/knowledge/dao/gen/GenTemplateItemsDao.java create mode 100644 src/main/java/org/support/project/knowledge/dao/gen/GenTemplateMastersDao.java create mode 100644 src/main/java/org/support/project/knowledge/deploy/v0_6_0pre2/Migrate_0_6_0pre2.java create mode 100644 src/main/java/org/support/project/knowledge/entity/ItemChoicesEntity.java create mode 100644 src/main/java/org/support/project/knowledge/entity/KnowledgeItemValuesEntity.java create mode 100644 src/main/java/org/support/project/knowledge/entity/StockKnowledgesEntity.java create mode 100644 src/main/java/org/support/project/knowledge/entity/TemplateItemsEntity.java create mode 100644 src/main/java/org/support/project/knowledge/entity/TemplateMastersEntity.java create mode 100644 src/main/java/org/support/project/knowledge/entity/gen/GenItemChoicesEntity.java create mode 100644 src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgeItemValuesEntity.java create mode 100644 src/main/java/org/support/project/knowledge/entity/gen/GenStockKnowledgesEntity.java create mode 100644 src/main/java/org/support/project/knowledge/entity/gen/GenTemplateItemsEntity.java create mode 100644 src/main/java/org/support/project/knowledge/entity/gen/GenTemplateMastersEntity.java create mode 100644 src/main/java/org/support/project/knowledge/logic/CrawlerLogic.java create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_delete.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_insert.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_all.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_choice_no.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_item_no.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_key.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_type_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_raw_insert.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_all.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_choice_no.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_item_no.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_key.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_type_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_update.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_delete.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_insert.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_all.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_item_no.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_key.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_knowledge_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_type_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_raw_insert.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_all.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_item_no.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_key.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_knowledge_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_type_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_update.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_delete.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_insert.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_all.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_key.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_knowledge_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_stock_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_raw_insert.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_all.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_key.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_knowledge_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_stock_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_update.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_delete.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_insert.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_all.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_item_no.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_key.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_type_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_raw_insert.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_all.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_item_no.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_key.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_type_id.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_update.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_delete.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_insert.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_physical_select_all.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_physical_select_on_key.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_raw_insert.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_select_all.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_select_on_key.sql create mode 100644 src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_update.sql create mode 100644 src/main/resources/org/support/project/knowledge/deploy/v0_6_0pre2/migrate.sql create mode 100644 src/main/webapp/WEB-INF/views/admin/proxy/config.jsp diff --git a/document/database/knowledge.a5er b/document/database/knowledge.a5er index 9ef92be87..3b16fa442 100755 --- a/document/database/knowledge.a5er +++ b/document/database/knowledge.a5er @@ -46,6 +46,221 @@ SqlSeparator=0 ShowTag=1 ShowCommonAttributes=0 +[Relation] +Entity1=STOCKS +Entity2=STOCK_KNOWLEDGES +RelationType1=1 +RelationType2=3 +Fields1=STOCK_ID +Fields2=STOCK_ID +Cardinarity1= +Cardinarity2= +Position="MAIN",0,4273,5090,4224,R,R +Dependence=1 +Caption= +PName= +ModifiedDateTime=20150910042933 +LineMode=0 +Bar1=427 +Bar2=509 +Bar3=422 +TermPos1=R +TermPos2=R + +[Entity] +PName=STOCKS +LName=ストック +Comment= +TableOption= +Page=MAIN +Left=2000 +Top=1330 +Field="STOCK ID","STOCK_ID","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" +Field="STOCK 名","STOCK_NAME","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,"" +Field="区分","STOCK_TYPE","@INT","NOT NULL",,"","",$FFFFFFFF,"" +Field="説明","DESCRIPTION","@VARCHAR(1024)",,,"","",$FFFFFFFF,"" +EffectMode=None +Color=$000000 +BkColor=$FFFFFF +ModifiedDateTime=20150910042830 +Position="MAIN",2000,1330 + +[Relation] +Entity1=TEMPLATE_ITEMS +Entity2=KNOWLEDGE_ITEM_VALUES +RelationType1=1 +RelationType2=3 +Fields1=TYPE_ID,ITEM_NO +Fields2=TYPE_ID,ITEM_NO +Cardinarity1= +Cardinarity2= +Position="MAIN",0,3751,4599,3188,R,R +Dependence=1 +Caption= +PName= +LineMode=0 +Bar1=375 +Bar2=460 +Bar3=319 +TermPos1=R +TermPos2=R + +[Relation] +Entity1=KNOWLEDGES +Entity2=KNOWLEDGE_ITEM_VALUES +RelationType1=1 +RelationType2=3 +Fields1=KNOWLEDGE_ID +Fields2=KNOWLEDGE_ID +Cardinarity1= +Cardinarity2= +Position="MAIN",0,7401,6340,2403,R,R +Dependence=1 +Caption= +PName= +LineMode=0 +Bar1=740 +Bar2=634 +Bar3=240 +TermPos1=R +TermPos2=R + +[Entity] +PName=KNOWLEDGE_ITEM_VALUES +LName=ナレッジの項目値 +Comment= +TableOption= +Page=MAIN +Left=1240 +Top=590 +Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,"" +Field="テンプレートの種類ID","TYPE_ID","@INT","NOT NULL",1,"","",$FFFFFFFF,"" +Field="項目NO","ITEM_NO","@INT","NOT NULL",2,"","",$FFFFFFFF,"" +Field="項目値","ITEM_VALUE","text",,,"","",$FFFFFFFF,"" +Field="ステータス","ITEM_STATUS","@INT","NOT NULL",,"","",$FFFFFFFF,"" +EffectMode=None +Color=$000000 +BkColor=$FFFFFF +ModifiedDateTime=20150915190523 +Position="MAIN",1240,590 + +[Relation] +Entity1=TEMPLATE_ITEMS +Entity2=ITEM_CHOICES +RelationType1=1 +RelationType2=3 +Fields1=TYPE_ID,ITEM_NO +Fields2=TYPE_ID,ITEM_NO +Cardinarity1= +Cardinarity2= +Position="MAIN",0,6366,6905,3237,R,R +Dependence=1 +Caption= +PName= +ModifiedDateTime=20150910034625 +LineMode=0 +Bar1=637 +Bar2=690 +Bar3=324 +TermPos1=R +TermPos2=R + +[Entity] +PName=ITEM_CHOICES +LName=選択肢の値 +Comment= +TableOption= +Page=MAIN +Left=2010 +Top=140 +Field="テンプレートの種類ID","TYPE_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" +Field="項目NO","ITEM_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,"" +Field="選択肢番号","CHOICE_NO","@INT","NOT NULL",2,"","",$FFFFFFFF,"" +Field="選択肢値","CHOICE_VALUE","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,"" +Field="選択肢ラベル","CHOICE_LABEL","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,"" +EffectMode=None +Color=$000000 +BkColor=$FFFFFF +ModifiedDateTime=20150910041119 +Position="MAIN",2010,140,542,135 + +[Relation] +Entity1=TEMPLATE_MASTERS +Entity2=TEMPLATE_ITEMS +RelationType1=2 +RelationType2=3 +Fields1=TYPE_ID +Fields2=TYPE_ID +Cardinarity1= +Cardinarity2= +Position="MAIN",0,4347,6903,3260,R,R +Dependence=1 +Caption= +PName= +ModifiedDateTime=20150910034230 +LineMode=0 +Bar1=435 +Bar2=690 +Bar3=326 +TermPos1=R +TermPos2=R + +[Relation] +Entity1=TEMPLATE_MASTERS +Entity2=KNOWLEDGES +RelationType1=1 +RelationType2=3 +Fields1=TYPE_ID +Fields2=TYPE_ID +Cardinarity1= +Cardinarity2= +Position="MAIN",0,1272,5475,2177,R,R +Dependence=0 +Caption= +PName= +LineMode=0 +Bar1=127 +Bar2=548 +Bar3=218 +TermPos1=R +TermPos2=R + +[Entity] +PName=TEMPLATE_MASTERS +LName=テンプレートのマスタ +Comment= +TableOption= +Page=MAIN +Left=1120 +Top=390 +Field="テンプレートの種類ID","TYPE_ID","serial","NOT NULL",0,"","",$FFFFFFFF,"" +Field="テンプレート名","TYPE_NAME","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,"" +Field="アイコン","TYPE_ICON","@VARCHAR(64)",,,"","",$FFFFFFFF,"" +Field="説明","DESCRIPTION","@VARCHAR(1024)",,,"","",$FFFFFFFF,"" +EffectMode=None +Color=$000000 +BkColor=$FFFFFF +ModifiedDateTime=20150912014311 +Position="MAIN",1120,390 + +[Entity] +PName=TEMPLATE_ITEMS +LName=テンプレートの項目 +Comment= +TableOption= +Page=MAIN +Left=1870 +Top=390 +Field="テンプレートの種類ID","TYPE_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" +Field="項目NO","ITEM_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,"" +Field="項目名","ITEM_NAME","@VARCHAR(32)","NOT NULL",,"","",$FFFFFFFF,"" +Field="項目の種類","ITEM_TYPE","@INT","NOT NULL",,"","",$FFFFFFFF,"" +EffectMode=None +Color=$000000 +BkColor=$FFFFFF +ModifiedDateTime=20150910041108 +Position="MAIN",1870,390 + [Relation] Entity1=KNOWLEDGES Entity2=KNOWLEDGE_EDIT_GROUPS @@ -55,15 +270,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,1999,4683,7039,R,R +Position="MAIN",0,1514,3775,5634,R,R Dependence=1 Caption= PName= ModifiedDateTime=20150517063537 LineMode=0 -Bar1=200 -Bar2=468 -Bar3=704 +Bar1=151 +Bar2=378 +Bar3=563 TermPos1=R TermPos2=R @@ -72,16 +287,16 @@ PName=KNOWLEDGE_EDIT_GROUPS LName=編集可能なグループ Comment= TableOption= -Page=Main -Left=1920 -Top=920 +Page=MAIN +Left=2000 +Top=810 Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,"" Field="GROUP_ID","GROUP_ID","@INT","NOT NULL",1,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150517064451 -Position="Main",1920,920 +Position="MAIN",2000,810 [Relation] Entity1=KNOWLEDGES @@ -92,14 +307,14 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,697,3356,5072,R,R +Position="MAIN",0,472,3356,6489,R,R Dependence=1 Caption= PName= LineMode=0 -Bar1=70 +Bar1=47 Bar2=336 -Bar3=507 +Bar3=649 TermPos1=R TermPos2=R @@ -108,16 +323,16 @@ PName=KNOWLEDGE_EDIT_USERS LName=編集可能なユーザ Comment= TableOption= -Page=Main -Left=1910 -Top=830 +Page=MAIN +Left=2000 +Top=720 Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,"" Field="USER_ID","USER_ID","@INT","NOT NULL",1,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150517063424 -Position="Main",1910,830 +Position="MAIN",2000,720 [Relation] Entity1=KNOWLEDGES @@ -128,14 +343,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",1,1504,7091,8088,R,R +Position="MAIN",0,5333,7091,5770,R,R Dependence=1 Caption= PName= -LineMode=1 -Bar1=150 +ModifiedDateTime=20150910041644 +LineMode=0 +Bar1=533 Bar2=709 -Bar3=809 +Bar3=577 TermPos1=R TermPos2=R @@ -145,8 +361,8 @@ LName=ナレッジ更新履歴 Comment= TableOption= Page=MAIN -Left=60 -Top=1620 +Left=70 +Top=810 Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,"" Field="履歴番号","HISTORY_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,"" Field="タイトル","TITLE","@VARCHAR(1024)","NOT NULL",,"","",$FFFFFFFF,"" @@ -160,7 +376,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150507141708 -Position="MAIN",60,1620 +Position="MAIN",70,810 [Entity] PName=NOTIFY_QUEUES @@ -168,8 +384,8 @@ LName=通知待ちキュー Comment= TableOption= Page=MAIN -Left=80 -Top=1350 +Left=1530 +Top=160 Field="HASH","HASH","@VARCHAR(32)","NOT NULL",0,"","",$FFFFFFFF,"" Field="種類","TYPE","@INT","NOT NULL",,"","",$FFFFFFFF,"" Field="通知する種類のID","ID","bigint","NOT NULL",,"","",$FFFFFFFF,"" @@ -177,27 +393,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150331055404 -Position="MAIN",80,1350 - -[Relation] -Entity1=USERS -Entity2=NOTIFY_CONFIGS -RelationType1=1 -RelationType2=3 -Fields1=USER_ID -Fields2=USER_ID -Cardinarity1= -Cardinarity2= -Position="MAIN",0,1886,5092,8260,R,R -Dependence=1 -Caption= -PName= -LineMode=0 -Bar1=189 -Bar2=509 -Bar3=826 -TermPos1=R -TermPos2=R +Position="MAIN",1530,160 [Entity] PName=NOTIFY_CONFIGS @@ -205,8 +401,8 @@ LName=通知設定 Comment= TableOption= Page=MAIN -Left=90 -Top=890 +Left=50 +Top=140 Field="ユーザID","USER_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" Field="メール通知する","NOTIFY_MAIL","@INT",,,"","",$FFFFFFFF,"" Field="デスクトップ通知する","NOTIFY_DESKTOP","@INT",,,"","",$FFFFFFFF,"" @@ -222,7 +418,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150328062820 -Position="MAIN",90,890 +Position="MAIN",50,140 [Relation] Entity1=COMMENTS @@ -233,34 +429,14 @@ Fields1=COMMENT_NO Fields2=COMMENT_NO Cardinarity1= Cardinarity2= -Position="MAIN",0,7469,4072,4888,R,R +Position="MAIN",0,5422,4072,4786,R,R Dependence=0 Caption= PName= LineMode=0 -Bar1=747 +Bar1=542 Bar2=407 -Bar3=489 -TermPos1=R -TermPos2=R - -[Relation] -Entity1=USERS -Entity2=ACCOUNT_IMAGES -RelationType1=1 -RelationType2=3 -Fields1=USER_ID -Fields2=USER_ID -Cardinarity1= -Cardinarity2= -Position="MAIN",0,7092,4791,2068,R,R -Dependence=0 -Caption= -PName= -LineMode=0 -Bar1=709 -Bar2=479 -Bar3=207 +Bar3=479 TermPos1=R TermPos2=R @@ -270,8 +446,8 @@ LName=アカウントの画像 Comment= TableOption= Page=MAIN -Left=1010 -Top=900 +Left=940 +Top=150 Field="IMAGE_ID","IMAGE_ID","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ユーザID","USER_ID","@INT",,,"","",$FFFFFFFF,"" Field="ファイル名","FILE_NAME","@VARCHAR(256)",,,"","",$FFFFFFFF,"" @@ -284,7 +460,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416234339 -Position="MAIN",1010,900 +Position="MAIN",940,150 [Relation] Entity1=KNOWLEDGES @@ -295,12 +471,12 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,7702,6913,5217,R,R +Position="MAIN",0,1535,6913,5217,R,R Dependence=0 Caption= PName= LineMode=0 -Bar1=770 +Bar1=154 Bar2=691 Bar3=522 TermPos1=R @@ -312,8 +488,8 @@ LName=いいね Comment= TableOption= Page=MAIN -Left=570 -Top=1350 +Left=600 +Top=470 Field="NO","NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",,"","",$FFFFFFFF,"" Index=IDX_LIKES_KNOWLEDGE_ID=0,KNOWLEDGE_ID @@ -321,7 +497,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416233511 -Position="MAIN",570,1350 +Position="MAIN",600,470 [Relation] Entity1=KNOWLEDGES @@ -332,15 +508,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,4453,5745,2877,R,R +Position="MAIN",0,1398,5745,3878,R,R Dependence=1 Caption= PName= ModifiedDateTime=20141222155941 LineMode=0 -Bar1=445 +Bar1=140 Bar2=574 -Bar3=288 +Bar3=388 TermPos1=R TermPos2=R @@ -350,17 +526,18 @@ LName=コメント Comment= TableOption= Page=MAIN -Left=1270 -Top=1670 +Left=840 +Top=1330 Field="コメント番号","COMMENT_NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",,"","",$FFFFFFFF,"" Field="コメント","COMMENT","text",,,"","",$FFFFFFFF,"" +Field="ステータス","COMMENT_STATUS","@INT",,,"","",$FFFFFFFF,"" Index=IDX_COMMENTS_KNOWLEDGE_ID=0,KNOWLEDGE_ID EffectMode=None Color=$000000 BkColor=$FFFFFF -ModifiedDateTime=20150506050206 -Position="MAIN",1270,1670 +ModifiedDateTime=20150910035117 +Position="MAIN",840,1330 [Relation] Entity1=KNOWLEDGES @@ -371,14 +548,14 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,10000,5116,3064,R,R +Position="MAIN",0,7905,5116,2114,R,R Dependence=0 Caption= PName= LineMode=0 -Bar1=1000 +Bar1=790 Bar2=512 -Bar3=306 +Bar3=211 TermPos1=R TermPos2=R @@ -388,8 +565,8 @@ LName=投票 Comment= TableOption= Page=MAIN -Left=1890 -Top=1790 +Left=1350 +Top=1340 Field="VOTE_NO","VOTE_NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",,"","",$FFFFFFFF,"" Field="投票区分","VOTE_KIND","@INT","NOT NULL",,"","",$FFFFFFFF,"" @@ -398,7 +575,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416233659 -Position="MAIN",1890,1790,435,89 +Position="MAIN",1350,1340,435,89 [Relation] Entity1=KNOWLEDGES @@ -409,15 +586,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,4343,8931,9780,R,R +Position="MAIN",0,7859,6407,5990,R,R Dependence=1 Caption= PName= ModifiedDateTime=20141204130740 LineMode=0 -Bar1=434 -Bar2=893 -Bar3=978 +Bar1=786 +Bar2=641 +Bar3=599 TermPos1=R TermPos2=R @@ -427,8 +604,8 @@ LName=ナレッジの参照履歴 Comment= TableOption= Page=MAIN -Left=1900 -Top=1290 +Left=60 +Top=1100 Field="HISTORY_NO","HISTORY_NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",,"","",$FFFFFFFF,"" Field="日時","VIEW_DATE_TIME","@DATETIME","NOT NULL",,"","",$FFFFFFFF,"" @@ -437,11 +614,11 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416233623 -Position="MAIN",1900,1290 +Position="MAIN",60,1100 [Relation] Entity1=KNOWLEDGES -Entity2=STOCKS +Entity2=STOCK_KNOWLEDGES RelationType1=1 RelationType2=3 Fields1=KNOWLEDGE_ID @@ -452,6 +629,7 @@ Position="MAIN",0,8770,5725,5124,R,R Dependence=1 Caption= PName= +ModifiedDateTime=20150910042925 LineMode=0 Bar1=877 Bar2=572 @@ -460,21 +638,21 @@ TermPos1=R TermPos2=R [Entity] -PName=STOCKS +PName=STOCK_KNOWLEDGES LName=ストックしたナレッジ Comment= TableOption= Page=MAIN -Left=1900 -Top=1650 -Field="USER_ID","USER_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" +Left=2000 +Top=1110 +Field="STOCK ID","STOCK_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,"" Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",1,"","",$FFFFFFFF,"" Field="コメント","COMMENT","@VARCHAR(1024)",,,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF -ModifiedDateTime=20141222154849 -Position="MAIN",1900,1650 +ModifiedDateTime=20150910042912 +Position="MAIN",2000,1110 [Relation] Entity1=KNOWLEDGES @@ -485,12 +663,12 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,7208,6468,5676,R,R +Position="MAIN",0,3944,6468,5676,R,R Dependence=1 Caption= PName= LineMode=0 -Bar1=721 +Bar1=394 Bar2=647 Bar3=568 TermPos1=R @@ -502,15 +680,15 @@ LName=アクセス可能なグループ Comment= TableOption= Page=MAIN -Left=1900 -Top=1530 +Left=2010 +Top=990 Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,"" Field="GROUP_ID","GROUP_ID","@INT","NOT NULL",1,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20141222154841 -Position="MAIN",1900,1530 +Position="MAIN",2010,990 [Relation] Entity1=KNOWLEDGES @@ -521,15 +699,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,5775,7524,8641,R,R +Position="MAIN",0,2787,7524,7865,R,R Dependence=1 Caption= PName= ModifiedDateTime=20141204125301 LineMode=0 -Bar1=578 +Bar1=279 Bar2=752 -Bar3=864 +Bar3=786 TermPos1=R TermPos2=R @@ -539,15 +717,15 @@ LName=アクセス可能なユーザ Comment= TableOption= Page=MAIN -Left=1900 -Top=1420 +Left=2000 +Top=900 Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,"" Field="USER_ID","USER_ID","@INT","NOT NULL",1,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150517063359 -Position="MAIN",1900,1420 +Position="MAIN",2000,900 [Relation] Entity1=TAGS @@ -558,14 +736,14 @@ Fields1=TAG_ID Fields2=TAG_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,4552,5672,4552,R,R +Position="MAIN",0,4552,5672,4574,R,R Dependence=1 Caption= PName= LineMode=0 Bar1=455 Bar2=567 -Bar3=455 +Bar3=457 TermPos1=R TermPos2=R @@ -578,12 +756,12 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,4056,5163,6381,R,R +Position="MAIN",0,2324,5163,6381,R,R Dependence=1 Caption= PName= LineMode=0 -Bar1=406 +Bar1=232 Bar2=516 Bar3=638 TermPos1=R @@ -595,15 +773,15 @@ LName=ナレッジが持つタグ Comment= TableOption= Page=MAIN -Left=570 -Top=1240 +Left=60 +Top=650 Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,"" Field="タグ_ID","TAG_ID","@INT","NOT NULL",1,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20141222154737 -Position="MAIN",570,1240 +Position="MAIN",60,650 [Entity] PName=TAGS @@ -611,15 +789,15 @@ LName=タグ Comment= TableOption= Page=MAIN -Left=70 -Top=1240 +Left=60 +Top=470 Field="タグ_ID","TAG_ID","SERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="タグ名称","TAG_NAME","@VARCHAR(128)","NOT NULL",,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416233544 -Position="MAIN",70,1240 +Position="MAIN",60,470 [Relation] Entity1=KNOWLEDGES @@ -630,14 +808,14 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",1,2653,7258,7728,R,R +Position="MAIN",1,756,8060,7728,R,R Dependence=1 Caption= PName= ModifiedDateTime=20150517063131 LineMode=1 -Bar1=265 -Bar2=726 +Bar1=76 +Bar2=806 Bar3=773 TermPos1=R TermPos2=R @@ -648,8 +826,8 @@ LName=添付ファイル Comment= TableOption= Page=MAIN -Left=610 -Top=1640 +Left=50 +Top=1300 Field="添付ファイル番号","FILE_NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ナレッジID","KNOWLEDGE_ID","bigint",,,"","",$FFFFFFFF,"" Field="コメント番号","COMMENT_NO","bigint",,,"","",$FFFFFFFF,"" @@ -662,7 +840,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416234328 -Position="MAIN",610,1640 +Position="MAIN",50,1300 [Entity] PName=KNOWLEDGES @@ -670,8 +848,8 @@ LName=ナレッジ Comment= TableOption= Page=MAIN -Left=1160 -Top=1150 +Left=930 +Top=820 Field="ナレッジID","KNOWLEDGE_ID","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="タイトル","TITLE","@VARCHAR(1024)","NOT NULL",,"","",$FFFFFFFF,"" Field="内容","CONTENT","text",,,"","",$FFFFFFFF,"" @@ -680,11 +858,12 @@ Field="タグID一覧","TAG_IDS","@VARCHAR(1024)",,,"","",$FFFFFFFF,"" Field="タグ名称一覧","TAG_NAMES","text",,,"","",$FFFFFFFF,"" Field="いいね件数","LIKE_COUNT","bigint",,,"","",$FFFFFFFF,"" Field="コメント件数","COMMENT_COUNT","@INT",,,"","",$FFFFFFFF,"" +Field="テンプレートの種類ID","TYPE_ID","integer",,,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF -ModifiedDateTime=20150506050220 -Position="MAIN",1160,1150 +ModifiedDateTime=20150910053608 +Position="MAIN",930,820 [Comment] Comment=knowledge @@ -697,356 +876,7 @@ FontColor=$FFFFFF LineColor=$000000 BkColor=$000000 Page=Main -Left=0 -Top=750 +Left=20 +Top=20 Width=402 Height=53 - -[Comment] -Comment=Web共通テーブル -FontName=Tahoma -FontBold=0 -FontItalic=0 -FontUnderline=0 -FontSize=7 -FontColor=$FFFFFF -LineColor=$000000 -BkColor=$000000 -Page=Main -Left=0 -Top=0 -Width=402 -Height=53 - -[Comment] -Comment=ユーザID/グループIDはシステムで採番する。\n(制御用で桁合わせする)\nKEYは、ユーザが使う一意のキー -FontName=Tahoma -FontBold=0 -FontItalic=0 -FontUnderline=0 -FontSize=6 -FontColor=$000000 -LineColor=$000000 -BkColor=$99FFFF -Page=Main -Left=1200 -Top=600 -Width=527 -Height=110 - -[Relation] -Entity1=GROUPS -Entity2=USER_GROUPS -RelationType1=2 -RelationType2=3 -Fields1=GROUP_KEY -Fields2=GROUP_ID -Cardinarity1= -Cardinarity2= -Position="MAIN",0,3256,6098,5013,R,R -Dependence=1 -Caption= -PName= -LineMode=0 -Bar1=326 -Bar2=610 -Bar3=501 -TermPos1=R -TermPos2=R - -[Relation] -Entity1=USERS -Entity2=USER_GROUPS -RelationType1=2 -RelationType2=3 -Fields1=USER_ID -Fields2=USER_ID -Cardinarity1= -Cardinarity2= -Position="MAIN",0,2786,8120,4179,R,R -Dependence=1 -Caption= -PName= -LineMode=0 -Bar1=279 -Bar2=812 -Bar3=418 -TermPos1=R -TermPos2=R - -[Entity] -PName=USER_GROUPS -LName=ユーザが所属するグループ -Comment= -TableOption= -Page=MAIN -Left=1350 -Top=500 -Field="ユーザID","USER_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" -Field="グループID","GROUP_ID","@INT","NOT NULL",1,"","CHARACTER SET latin1",$FFFFFFFF,"" -Field="グループの権限","GROUP_ROLE","@INT",,,"","",$FFFFFFFF,"" -NoDDL=1 -EffectMode=None -Color=$000000 -BkColor=$FFFFFF -ModifiedDateTime=20140429060638 -Position="MAIN",1350,500 - -[Entity] -PName=GROUPS -LName=グループ -Comment= -TableOption= -Page=MAIN -Left=1350 -Top=200 -Field="グループID","GROUP_ID","@INT","NOT NULL",0,"","CHARACTER SET latin1",$FFFFFFFF,"" -Field="グループKEY","GROUP_KEY","@VARCHAR(68)","NOT NULL",,"","ユニーク",$FFFFFFFF,"" -Field="グループ名称","GROUP_NAME","@VARCHAR(128)","NOT NULL",,"","",$FFFFFFFF,"" -Field="説明","DESCRIPTION","@VARCHAR(256)",,,"","",$FFFFFFFF,"" -Field="親グループKKEY","PARENT_GROUP_KEY","@VARCHAR(128)",,,"","",$FFFFFFFF,"" -NoDDL=1 -EffectMode=None -Color=$000000 -BkColor=$FFFFFF -ModifiedDateTime=20130928170709 -Position="MAIN",1350,200 - -[Entity] -PName=USERS -LName=ユーザ -Comment= -TableOption= -Page=MAIN -Left=700 -Top=500 -Field="ユーザID","USER_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" -Field="ユーザKEY","USER_KEY","@VARCHAR(256)","NOT NULL",,"","ユニーク",$FFFFFFFF,"" -Field="ユーザ名","USER_NAME","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,"" -Field="パスワード","PASSWORD","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,"" -NoDDL=1 -EffectMode=None -Color=$000000 -BkColor=$FFFFFF -ModifiedDateTime=20130928170728 -Position="MAIN",700,500 - -[Entity] -PName=ROLES -LName=権限 -Comment= -TableOption= -Page=MAIN -Left=100 -Top=450 -Field="権限ID","ROLE_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" -Field="権限KEY","ROLE_KEY","@VARCHAR(12)","NOT NULL",,"","",$FFFFFFFF,"" -Field="権限名","ROLE_NAME","@VARCHAR(50)",,,"","",$FFFFFFFF,"" -NoDDL=1 -EffectMode=None -Color=$000000 -BkColor=$FFFFFF -ModifiedDateTime=20130928170719 -Position="MAIN",100,450 - -[Entity] -PName=USER_ROLES -LName=ユーザの権限 -Comment= -TableOption= -Page=MAIN -Left=100 -Top=600 -Field="ユーザID","USER_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" -Field="権限ID","ROLE_ID","@INT","NOT NULL",1,"","",$FFFFFFFF,"" -NoDDL=1 -EffectMode=None -Color=$000000 -BkColor=$FFFFFF -ModifiedDateTime=20130928170723 -Position="MAIN",100,600 - -[Relation] -Entity1=USERS -Entity2=USER_ROLES -RelationType1=1 -RelationType2=3 -Fields1=USER_ID -Fields2=USER_ID -Cardinarity1= -Cardinarity2= -Position="MAIN",0,5000,5000,5925,R,R -Dependence=1 -Caption= -PName= -LineMode=0 -Bar1=500 -Bar2=500 -Bar3=592 -TermPos1=R -TermPos2=R - -[Relation] -Entity1=ROLES -Entity2=USER_ROLES -RelationType1=1 -RelationType2=3 -Fields1=ROLE_ID -Fields2=ROLE_ID -Cardinarity1= -Cardinarity2= -Position="MAIN",0,5000,5000,6158,R,R -Dependence=1 -Caption= -PName= -LineMode=0 -Bar1=500 -Bar2=500 -Bar3=616 -TermPos1=R -TermPos2=R - -[Entity] -PName=LOGIN_HISTORIES -LName=ログイン履歴 -Comment= -TableOption= -Page=MAIN -Left=700 -Top=200 -Field="ユーザID","USER_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" -Field="ログイン番号","LOGIN_COUNT","@DOUBLE","NOT NULL",1,"","",$FFFFFFFF,"" -Field="ログイン日時","LODIN_DATE_TIME","@DATETIME","NOT NULL",,"","",$FFFFFFFF,"" -Field="IPアドレス","IP_ADDRESS","@VARCHAR(15)",,,"","",$FFFFFFFF,"" -Field="エージェント","USER_AGENT","@VARCHAR(256)",,,"","",$FFFFFFFF,"" -NoDDL=1 -EffectMode=None -Color=$000000 -BkColor=$FFFFFF -ModifiedDateTime=20130928170707 -Position="MAIN",700,200 - -[Relation] -Entity1=USERS -Entity2=LOGIN_HISTORIES -RelationType1=1 -RelationType2=3 -Fields1=USER_ID -Fields2=USER_ID -Cardinarity1= -Cardinarity2= -Position="MAIN",0,5239,5000,4486,R,R -Dependence=1 -Caption= -PName= -ModifiedDateTime=20121112222858 -LineMode=0 -Bar1=524 -Bar2=500 -Bar3=449 -TermPos1=R -TermPos2=R - -[Entity] -PName=FUNCTIONS -LName=機能 -Comment= -TableOption= -Page=MAIN -Left=100 -Top=150 -Field="機能","FUNCTION_KEY","@VARCHAR(64)","NOT NULL",0,"","",$FFFFFFFF,"" -Field="機能の説明","DESCRIPTION","@VARCHAR(256)",,,"","",$FFFFFFFF,"" -NoDDL=1 -EffectMode=None -Color=$000000 -BkColor=$FFFFFF -ModifiedDateTime=20130928170659 -Position="MAIN",100,150 - -[Entity] -PName=ROLE_FUNCTIONS -LName=機能にアクセスできる権限 -Comment= -TableOption= -Page=MAIN -Left=100 -Top=300 -Field="権限ID","ROLE_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,"" -Field="機能","FUNCTION_KEY","@VARCHAR(64)","NOT NULL",1,"","",$FFFFFFFF,"" -NoDDL=1 -EffectMode=None -Color=$000000 -BkColor=$FFFFFF -ModifiedDateTime=20130928170704 -Position="MAIN",100,300 - -[Relation] -Entity1=ROLES -Entity2=ROLE_FUNCTIONS -RelationType1=1 -RelationType2=3 -Fields1=ROLE_ID -Fields2=ROLE_ID -Cardinarity1= -Cardinarity2= -Position="MAIN",0,5182,5000,4396,R,R -Dependence=1 -Caption= -PName= -LineMode=0 -Bar1=518 -Bar2=500 -Bar3=440 -TermPos1=R -TermPos2=R - -[Relation] -Entity1=FUNCTIONS -Entity2=ROLE_FUNCTIONS -RelationType1=1 -RelationType2=3 -Fields1=FUNCTION_KEY -Fields2=FUNCTION_KEY -Cardinarity1= -Cardinarity2= -Position="MAIN",0,5000,5000,4710,R,R -Dependence=1 -Caption= -PName= -LineMode=0 -Bar1=500 -Bar2=500 -Bar3=471 -TermPos1=R -TermPos2=R - -[Shape] -Page=Main -Left=19 -Top=11 -Width=2807 -Height=712 -BrushColor=$F0CAA6 -BrushAlpha=50 -ShapeType=Rectangle -Text= -FontName=Tahoma -FontSize=9 -FontColor=$000000 -ImageFileName= - -[Shape] -Page=Main -Left=21 -Top=794 -Width=2797 -Height=1148 -BrushColor=$DEB2C7 -BrushAlpha=50 -ShapeType=Rectangle -Text= -FontName=Tahoma -FontSize=9 -FontColor=$000000 -ImageFileName= diff --git a/pom.xml b/pom.xml index 3309b2e92..b4ed7d782 100644 --- a/pom.xml +++ b/pom.xml @@ -111,6 +111,13 @@ 1.5.0 + + org.apache.httpcomponents + httpclient + 4.3.1 + + + diff --git a/src/main/java/org/support/project/knowledge/bat/FileParseBat.java b/src/main/java/org/support/project/knowledge/bat/FileParseBat.java index 9215631ae..b977feb03 100644 --- a/src/main/java/org/support/project/knowledge/bat/FileParseBat.java +++ b/src/main/java/org/support/project/knowledge/bat/FileParseBat.java @@ -1,7 +1,9 @@ package org.support.project.knowledge.bat; import java.io.File; +import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; @@ -9,6 +11,7 @@ import org.apache.commons.lang.ClassUtils; import org.apache.tika.mime.MimeType; +import org.apache.tika.mime.MimeTypeException; import org.apache.tika.mime.MimeTypes; import org.support.project.common.config.ConfigLoader; import org.support.project.common.log.Log; @@ -18,17 +21,24 @@ import org.support.project.knowledge.config.AppConfig; import org.support.project.knowledge.config.IndexType; import org.support.project.knowledge.dao.KnowledgeFilesDao; +import org.support.project.knowledge.dao.KnowledgeItemValuesDao; import org.support.project.knowledge.dao.KnowledgesDao; import org.support.project.knowledge.dao.TagsDao; +import org.support.project.knowledge.dao.TemplateItemsDao; +import org.support.project.knowledge.dao.TemplateMastersDao; import org.support.project.knowledge.entity.KnowledgeFilesEntity; +import org.support.project.knowledge.entity.KnowledgeItemValuesEntity; import org.support.project.knowledge.entity.KnowledgesEntity; import org.support.project.knowledge.entity.TagsEntity; import org.support.project.knowledge.indexer.IndexingValue; +import org.support.project.knowledge.logic.CrawlerLogic; import org.support.project.knowledge.logic.IndexLogic; import org.support.project.knowledge.logic.KnowledgeLogic; import org.support.project.knowledge.parser.Parser; import org.support.project.knowledge.parser.ParserFactory; import org.support.project.knowledge.vo.ParseResult; +import org.support.project.web.dao.ProxyConfigsDao; +import org.support.project.web.entity.ProxyConfigsEntity; public class FileParseBat extends AbstractBat { /** ログ */ @@ -45,6 +55,7 @@ public class FileParseBat extends AbstractBat { public static final int TYPE_FILE = IndexType.KnowledgeFile.getValue(); public static final String ID_PREFIX = "FILE-"; + public static final String WEB_ID_PREFIX = "WEB-"; public static void main(String[] args) throws Exception { initLogName("FileParseBat.log"); @@ -58,6 +69,60 @@ public static void main(String[] args) throws Exception { } private void start() throws Exception { + fileParse(); + crawl(); + } + + private void crawl() throws Exception { + KnowledgeItemValuesDao itemValuesDao = KnowledgeItemValuesDao.get(); + List itemValues = itemValuesDao.selectOnTypeIdAndItemNoAndStatus( + TemplateMastersDao.TYPE_ID_BOOKMARK, TemplateItemsDao.ITEM_ID_BOOKMARK_URL, KnowledgeItemValuesEntity.STATUS_SAVED); + if (itemValues != null && !itemValues.isEmpty()) { + ProxyConfigsEntity proxyConfigs = ProxyConfigsDao.get().selectOnKey(AppConfig.get().getSystemName()); + if (proxyConfigs == null) { + proxyConfigs = new ProxyConfigsEntity(); + } + LOG.info("web target count: " + itemValues.size()); + CrawlerLogic logic = CrawlerLogic.get(); + for (KnowledgeItemValuesEntity itemValue : itemValues) { + KnowledgesEntity knowledgesEntity = KnowledgesDao.get().selectOnKey(itemValue.getKnowledgeId()); + if (knowledgesEntity == null) { + continue; + } + // タグを取得 + List tagsEntities = TagsDao.get().selectOnKnowledgeId(knowledgesEntity.getKnowledgeId()); + // Webアクセス + String content = logic.crawle(proxyConfigs, itemValue.getItemValue()); + if (StringUtils.isNotEmpty(content)) { + LOG.info("[SUCCESS] " + itemValue.getItemValue()); + // 全文検索エンジンにのみ、検索できるように情報登録 + IndexingValue value = new IndexingValue(); + value.setType(IndexType.bookmarkContent.getValue()); + value.setId(WEB_ID_PREFIX + itemValue.getKnowledgeId()); + value.setTitle(itemValue.getItemValue()); + value.setContents(content); + + value.addUser(knowledgesEntity.getInsertUser()); + if (knowledgesEntity.getPublicFlag() == null + || KnowledgeLogic.PUBLIC_FLAG_PUBLIC == knowledgesEntity.getPublicFlag()) { + value.addUser(KnowledgeLogic.ALL_USER); + } + for (TagsEntity tagsEntity : tagsEntities) { + value.addTag(tagsEntity.getTagId()); + } + value.setCreator(knowledgesEntity.getInsertUser()); + value.setTime(knowledgesEntity.getUpdateDatetime().getTime()); // 更新日時をセットするので、更新日時でソート + IndexLogic.get().save(value); + + // ステータス更新 + itemValue.setItemStatus(KnowledgeItemValuesEntity.STATUS_WEBACCESSED); + itemValuesDao.update(itemValue); + } + } + } + } + + private void fileParse() throws FileNotFoundException, IOException, MimeTypeException, Exception { KnowledgeFilesDao filesDao = KnowledgeFilesDao.get(); IndexLogic indexLogic = IndexLogic.get(); KnowledgesDao knowledgesDao = KnowledgesDao.get(); @@ -67,7 +132,7 @@ private void start() throws Exception { List filesEntities = filesDao.selectWaitStateFiles(); AppConfig appConfig = ConfigLoader.load(AppConfig.APP_CONFIG, AppConfig.class); File tmpDir = new File(appConfig.getTmpPath()); - LOG.info("target count: " + filesEntities.size()); + LOG.info("file target count: " + filesEntities.size()); for (KnowledgeFilesEntity knowledgeFilesEntity : filesEntities) { // ナレッジを取得 diff --git a/src/main/java/org/support/project/knowledge/config/AuthType.java b/src/main/java/org/support/project/knowledge/config/AuthType.java new file mode 100644 index 000000000..b05d5eb75 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/config/AuthType.java @@ -0,0 +1,21 @@ +package org.support.project.knowledge.config; + +public enum AuthType { + None, + Basic, + Digest, + NTLM, + Samba, + Form; + + public int getValue() { + return ordinal(); + } + + public static AuthType getType(int type) { + AuthType[] values = values(); + return values[type]; + } + + +} diff --git a/src/main/java/org/support/project/knowledge/config/IndexType.java b/src/main/java/org/support/project/knowledge/config/IndexType.java index 27af9027f..fb2097191 100644 --- a/src/main/java/org/support/project/knowledge/config/IndexType.java +++ b/src/main/java/org/support/project/knowledge/config/IndexType.java @@ -3,7 +3,8 @@ public enum IndexType { knowledge, KnowledgeFile, - KnowledgeComment; + KnowledgeComment, + bookmarkContent; public int getValue() { diff --git a/src/main/java/org/support/project/knowledge/control/admin/MailControl.java b/src/main/java/org/support/project/knowledge/control/admin/MailControl.java index a04224512..5bf10a13c 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/MailControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/MailControl.java @@ -26,6 +26,7 @@ @DI(instance=Instance.Prototype) public class MailControl extends Control { + private static final String NO_CHANGE_PASSWORD = "NO_CHANGE_PASSWORD-fXLSJ_V-ZJ2E-GBAghu_usb-gtaG"; //パスワードを更新しなかったことを表すパスワード /** * メールの設定画面を表示 @@ -38,9 +39,10 @@ public Boundary config() { MailConfigsEntity entity = dao.selectOnKey(AppConfig.get().getSystemName()); if (entity == null) { entity = new MailConfigsEntity(); + } else { + entity.setSmtpPassword(NO_CHANGE_PASSWORD); // パスワードは送らない } entity.setSystemName(AppConfig.get().getSystemName()); - entity.setSmtpPassword(""); // パスワードは送らない setAttributeOnProperty(entity); return forward("config.jsp"); @@ -80,13 +82,19 @@ public Boundary save() throws InvalidKeyException, NoSuchAlgorithmException, NoS } MailConfigsEntity entity = super.getParams(MailConfigsEntity.class); + MailConfigsDao dao = MailConfigsDao.get(); - // パスワードは暗号化する - String salt = PasswordUtil.getSalt(); - entity.setSmtpPassword(PasswordUtil.encrypt(entity.getSmtpPassword(), salt)); - entity.setSalt(salt); + if (entity.getSmtpPassword().equals(NO_CHANGE_PASSWORD)) { + MailConfigsEntity db = dao.selectOnKey(AppConfig.get().getSystemName()); + entity.setSmtpPassword(db.getSmtpPassword()); + entity.setSalt(db.getSalt()); + } else { + // パスワードは暗号化する + String salt = PasswordUtil.getSalt(); + entity.setSmtpPassword(PasswordUtil.encrypt(entity.getSmtpPassword(), salt)); + entity.setSalt(salt); + } - MailConfigsDao dao = MailConfigsDao.get(); entity = dao.save(entity); setAttributeOnProperty(entity); diff --git a/src/main/java/org/support/project/knowledge/control/admin/ProxyControl.java b/src/main/java/org/support/project/knowledge/control/admin/ProxyControl.java new file mode 100644 index 000000000..983fc5db0 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/control/admin/ProxyControl.java @@ -0,0 +1,172 @@ +package org.support.project.knowledge.control.admin; + +import java.util.ArrayList; +import java.util.List; + +import org.support.project.common.bean.ValidateError; +import org.support.project.common.config.INT_FLAG; +import org.support.project.common.log.Log; +import org.support.project.common.log.LogFactory; +import org.support.project.common.util.PasswordUtil; +import org.support.project.common.util.StringUtils; +import org.support.project.knowledge.config.AppConfig; +import org.support.project.knowledge.config.AuthType; +import org.support.project.knowledge.control.Control; +import org.support.project.knowledge.logic.CrawlerLogic; +import org.support.project.web.annotation.Auth; +import org.support.project.web.boundary.Boundary; +import org.support.project.web.control.service.Get; +import org.support.project.web.control.service.Post; +import org.support.project.web.dao.ProxyConfigsDao; +import org.support.project.web.entity.ProxyConfigsEntity; + +public class ProxyControl extends Control { + /** ログ */ + private static Log LOG = LogFactory.getLog(ProxyControl.class); + + private static final String NO_CHANGE_PASSWORD = "NO_CHANGE_PASSWORD-fXLSJ_V-ZJ2E-GHUuagFASR-gtaG"; //パスワードを更新しなかったことを表すパスワード + + /** + * 設定画面を表示 + * @return + */ + @Get + @Auth(roles="admin") + public Boundary config() { + ProxyConfigsDao dao = ProxyConfigsDao.get(); + ProxyConfigsEntity entity = dao.selectOnKey(AppConfig.get().getSystemName()); + if (entity != null) { + entity.setProxyAuthPassword(NO_CHANGE_PASSWORD); + setAttributeOnProperty(entity); + } + setAttribute("systemName", AppConfig.get().getSystemName()); + return forward("config.jsp"); + } + + @Post + @Auth(roles="admin") + public Boundary save() throws Exception { + List errors = new ArrayList<>(); + errors.addAll(ProxyConfigsEntity.get().validate(getParams())); + + String type = getParam("proxyAuthType"); + //認証がONの場合のチェック + if (!type.equals(String.valueOf(AuthType.None.getValue()))) { + if (StringUtils.isEmpty(getParam("proxyAuthUserId"))) { + ValidateError error = new ValidateError("errors.required", getResource("label.auth.id")); + errors.add(error); + } + if (StringUtils.isEmpty(getParam("proxyAuthPassword"))) { + ValidateError error = new ValidateError("errors.required", getResource("label.auth.password")); + errors.add(error); + } + } + if (!errors.isEmpty()) { + setResult(null, errors); + return forward("config.jsp"); + } + + ProxyConfigsEntity entity = super.getParamOnProperty(ProxyConfigsEntity.class); + ProxyConfigsDao dao = ProxyConfigsDao.get(); + + if (entity.getProxyAuthPassword().equals(NO_CHANGE_PASSWORD)) { + // パスワード変更無し + ProxyConfigsEntity db = dao.selectOnKey(AppConfig.get().getSystemName()); + entity.setProxyAuthPassword(db.getProxyAuthPassword()); + entity.setProxyAuthSalt(db.getProxyAuthSalt()); + } else { + // パスワードは暗号化する + String salt = PasswordUtil.getSalt(); + entity.setProxyAuthPassword(PasswordUtil.encrypt(entity.getProxyAuthPassword(), salt)); + entity.setProxyAuthSalt(salt); + } + + entity = dao.save(entity); + + String successMsg = "message.success.save"; + setResult(successMsg, errors); + return config(); + } + + + @Post + @Auth(roles="admin") + public Boundary test() throws Exception { + try { + ProxyConfigsEntity entity = null; + String testUrl = getParam("testUrl"); + Integer testType = getParam("testType", Integer.class); + if (INT_FLAG.OFF.getValue() == testType.intValue()) { + entity = new ProxyConfigsEntity(); + } else { + List errors = new ArrayList<>(); + errors.addAll(ProxyConfigsEntity.get().validate(getParams())); + + String type = getParam("proxyAuthType"); + //認証がONの場合のチェック + if (!type.equals(String.valueOf(AuthType.None.getValue()))) { + if (StringUtils.isEmpty(getParam("proxyAuthUserId"))) { + ValidateError error = new ValidateError("errors.required", getResource("label.auth.id")); + errors.add(error); + } + if (StringUtils.isEmpty(getParam("proxyAuthPassword"))) { + ValidateError error = new ValidateError("errors.required", getResource("label.auth.password")); + errors.add(error); + } + } + if (!errors.isEmpty()) { + setResult(null, errors); + return forward("config.jsp"); + } + + entity = super.getParamOnProperty(ProxyConfigsEntity.class); + ProxyConfigsDao dao = ProxyConfigsDao.get(); + + if (entity.getProxyAuthPassword().equals(NO_CHANGE_PASSWORD)) { + // パスワード変更無し + ProxyConfigsEntity db = dao.selectOnKey(AppConfig.get().getSystemName()); + entity.setProxyAuthPassword(db.getProxyAuthPassword()); + entity.setProxyAuthSalt(db.getProxyAuthSalt()); + } else { + // パスワードは暗号化する + String salt = PasswordUtil.getSalt(); + entity.setProxyAuthPassword(PasswordUtil.encrypt(entity.getProxyAuthPassword(), salt)); + entity.setProxyAuthSalt(salt); + } + } + + // 確認用のURLで通信出来るか確認 + CrawlerLogic crawlerLogic = CrawlerLogic.get(); + String content = crawlerLogic.crawle(entity, testUrl); + setAttribute("content", content); + + addMsgInfo("knowledge.proxy.test.done"); + + } catch(Exception e) { + LOG.warn("knowledge.proxy.test.fail", e); + addMsgError("knowledge.proxy.test.fail"); + addMsgError(e.getClass().getSimpleName()); + if (StringUtils.isNotEmpty(e.getMessage())) { + addMsgError(e.getMessage()); + } + } + return forward("config.jsp"); + } + + + @Post + @Auth(roles="admin") + public Boundary delete() throws Exception { + ProxyConfigsDao dao = ProxyConfigsDao.get(); + dao.physicalDelete(AppConfig.get().getSystemName()); // 物理削除で消してしまう + + ProxyConfigsEntity entity = new ProxyConfigsEntity(); + entity.setSystemName(AppConfig.get().getSystemName()); + setAttributeOnProperty(entity); + + addMsgInfo("message.success.delete.target", getResource("knowledge.proxy.title")); + + return forward("config.jsp"); + } + +} diff --git a/src/main/java/org/support/project/knowledge/control/open/KnowledgeControl.java b/src/main/java/org/support/project/knowledge/control/open/KnowledgeControl.java index bb87e0be5..9b6b1f6c2 100644 --- a/src/main/java/org/support/project/knowledge/control/open/KnowledgeControl.java +++ b/src/main/java/org/support/project/knowledge/control/open/KnowledgeControl.java @@ -14,13 +14,18 @@ import org.support.project.knowledge.control.KnowledgeControlBase; import org.support.project.knowledge.dao.CommentsDao; import org.support.project.knowledge.dao.KnowledgeHistoriesDao; +import org.support.project.knowledge.dao.KnowledgeItemValuesDao; import org.support.project.knowledge.dao.LikesDao; import org.support.project.knowledge.dao.TagsDao; +import org.support.project.knowledge.dao.TemplateMastersDao; import org.support.project.knowledge.entity.CommentsEntity; import org.support.project.knowledge.entity.KnowledgeHistoriesEntity; +import org.support.project.knowledge.entity.KnowledgeItemValuesEntity; import org.support.project.knowledge.entity.KnowledgesEntity; import org.support.project.knowledge.entity.LikesEntity; import org.support.project.knowledge.entity.TagsEntity; +import org.support.project.knowledge.entity.TemplateItemsEntity; +import org.support.project.knowledge.entity.TemplateMastersEntity; import org.support.project.knowledge.logic.DiffLogic; import org.support.project.knowledge.logic.KnowledgeLogic; import org.support.project.knowledge.logic.MarkdownLogic; @@ -452,6 +457,41 @@ public Boundary history() throws InvalidParamException { return forward("history.jsp"); } + + /** + * ナレッジのテンプレート情報を取得 + * @return + * @throws InvalidParamException + */ + @Get + public Boundary template() throws InvalidParamException { + Integer typeId = super.getParam("type_id", Integer.class); + TemplateMastersEntity template = TemplateMastersDao.get().selectWithItems(typeId); + + String knowledgeId = super.getParam("knowledge_id"); + if (StringUtils.isNotEmpty(knowledgeId) && StringUtils.isLong(knowledgeId)) { + KnowledgeLogic knowledgeLogic = KnowledgeLogic.get(); + KnowledgesEntity entity = knowledgeLogic.select(new Long(knowledgeId), getLoginedUser()); + if (entity == null) { + return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND"); + } + + // 保存している値も返す + List values = KnowledgeItemValuesDao.get().selectOnKnowledgeId(entity.getKnowledgeId()); + List items = template.getItems(); + for (KnowledgeItemValuesEntity val : values) { + for (TemplateItemsEntity item : items) { + if (val.getItemNo().equals(item.getItemNo())) { + item.setItemValue(val.getItemValue()); + break; + } + } + } + } + return send(template); + } + + } diff --git a/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java b/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java index 83cf88516..0c9a2c783 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/KnowledgeControl.java @@ -1,11 +1,10 @@ package org.support.project.knowledge.control.protect; -import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; - -import net.arnx.jsonic.JSONException; +import java.util.Map; import org.support.project.common.bean.ValidateError; import org.support.project.common.exception.ParseException; @@ -19,9 +18,12 @@ import org.support.project.knowledge.dao.CommentsDao; import org.support.project.knowledge.dao.KnowledgesDao; import org.support.project.knowledge.dao.TagsDao; +import org.support.project.knowledge.dao.TemplateMastersDao; import org.support.project.knowledge.entity.CommentsEntity; import org.support.project.knowledge.entity.KnowledgesEntity; import org.support.project.knowledge.entity.TagsEntity; +import org.support.project.knowledge.entity.TemplateItemsEntity; +import org.support.project.knowledge.entity.TemplateMastersEntity; import org.support.project.knowledge.logic.KnowledgeLogic; import org.support.project.knowledge.logic.TargetLogic; import org.support.project.knowledge.logic.UploadedFileLogic; @@ -61,6 +63,11 @@ public Boundary view_add() { List tagitems = TagsDao.get().selectAll(); setAttribute("tagitems", tagitems); + List templates = TemplateMastersDao.get().selectAll(); + setAttribute("templates", templates); + + setAttribute("typeId", KnowledgeLogic.TEMPLATE_TYPE_KNOWLEDGE); + return forward("view_add.jsp"); } /** @@ -110,6 +117,9 @@ public Boundary view_edit() throws InvalidParamException { List tagitems = TagsDao.get().selectAll(); setAttribute("tagitems", tagitems); + List templates = TemplateMastersDao.get().selectAll(); + setAttribute("templates", templates); + return forward("view_edit.jsp"); } @@ -155,10 +165,17 @@ public Boundary add(KnowledgesEntity entity) throws Exception, ParseException { } } } - - //entity.setTitle(super.sanitize(entity.getTitle())); //XSS対策 - //entity.setContent(super.sanitize(entity.getContent())); //XSS対策 + List templates = TemplateMastersDao.get().selectAll(); + setAttribute("templates", templates); + + TemplateMastersEntity template = TemplateMastersDao.get().selectWithItems(entity.getTypeId()); + List items = template.getItems(); + for (TemplateItemsEntity item : items) { + String itemValue = super.getParam("item_" + item.getItemNo()); + item.setItemValue(itemValue); + } + List errors = entity.validate(); if (!errors.isEmpty()) { setResult(null, errors); @@ -180,7 +197,7 @@ public Boundary add(KnowledgesEntity entity) throws Exception, ParseException { String tags = super.getParam("tagNames"); List tagList = knowledgeLogic.manegeTags(tags); - entity = knowledgeLogic.insert(entity, tagList, fileNos, groups, editors, super.getLoginedUser()); + entity = knowledgeLogic.insert(entity, tagList, fileNos, groups, editors, template, super.getLoginedUser()); setAttributeOnProperty(entity); List files = fileLogic.selectOnKnowledgeIdWithoutCommentFiles(entity.getKnowledgeId(), getRequest().getContextPath()); @@ -230,9 +247,16 @@ public Boundary update(KnowledgesEntity entity) throws Exception { } } } - - //entity.setTitle(super.sanitize(entity.getTitle())); //XSS対策 - //entity.setContent(super.sanitize(entity.getContent())); //XSS対策 + + List templates = TemplateMastersDao.get().selectAll(); + setAttribute("templates", templates); + + TemplateMastersEntity template = TemplateMastersDao.get().selectWithItems(entity.getTypeId()); + List items = template.getItems(); + for (TemplateItemsEntity item : items) { + String itemValue = super.getParam("item_" + item.getItemNo()); + item.setItemValue(itemValue); + } KnowledgesDao dao = Container.getComp(KnowledgesDao.class); List errors = entity.validate(); @@ -271,7 +295,7 @@ public Boundary update(KnowledgesEntity entity) throws Exception { String tags = super.getParam("tagNames"); List tagList = knowledgeLogic.manegeTags(tags); - entity = knowledgeLogic.update(entity, tagList, fileNos, groups, editors, super.getLoginedUser()); + entity = knowledgeLogic.update(entity, tagList, fileNos, groups, editors, template, super.getLoginedUser()); setAttributeOnProperty(entity); addMsgSuccess("message.success.update"); @@ -304,6 +328,9 @@ public Boundary delete() throws Exception { List tagitems = TagsDao.get().selectAll(); setAttribute("tagitems", tagitems); + + List templates = TemplateMastersDao.get().selectAll(); + setAttribute("templates", templates); Long knowledgeId = new Long(id); KnowledgesEntity check = dao.selectOnKey(knowledgeId); diff --git a/src/main/java/org/support/project/knowledge/dao/ItemChoicesDao.java b/src/main/java/org/support/project/knowledge/dao/ItemChoicesDao.java new file mode 100644 index 000000000..84ee21be0 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/ItemChoicesDao.java @@ -0,0 +1,40 @@ +package org.support.project.knowledge.dao; + +import java.util.List; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.knowledge.dao.gen.GenItemChoicesDao; +import org.support.project.knowledge.entity.ItemChoicesEntity; + +/** + * 選択肢の値 + */ +@DI(instance=Instance.Singleton) +public class ItemChoicesDao extends GenItemChoicesDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static ItemChoicesDao get() { + return Container.getComp(ItemChoicesDao.class); + } + + /** + * 指定の項目の、選択肢情報を取得 + * @param typeId + * @param itemNo + * @return + */ + public List selectOnItem(Integer typeId, Integer itemNo) { + String sql = "SELECT * FROM ITEM_CHOICES WHERE TYPE_ID = ? AND ITEM_NO = ? AND DELETE_FLAG = 0"; + return super.executeQueryList(sql, ItemChoicesEntity.class, typeId, itemNo); + } + + +} diff --git a/src/main/java/org/support/project/knowledge/dao/KnowledgeItemValuesDao.java b/src/main/java/org/support/project/knowledge/dao/KnowledgeItemValuesDao.java new file mode 100644 index 000000000..990997552 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/KnowledgeItemValuesDao.java @@ -0,0 +1,34 @@ +package org.support.project.knowledge.dao; + +import java.util.List; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.knowledge.dao.gen.GenKnowledgeItemValuesDao; +import org.support.project.knowledge.entity.KnowledgeItemValuesEntity; + +/** + * ナレッジの項目値 + */ +@DI(instance=Instance.Singleton) +public class KnowledgeItemValuesDao extends GenKnowledgeItemValuesDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static KnowledgeItemValuesDao get() { + return Container.getComp(KnowledgeItemValuesDao.class); + } + public List selectOnTypeIdAndItemNoAndStatus(int typeId, int itemNo, int status) { + String sql = "SELECT * FROM KNOWLEDGE_ITEM_VALUES WHERE TYPE_ID = ? AND ITEM_NO = ? AND ITEM_STATUS = ? AND DELETE_FLAG = 0"; + return executeQueryList(sql, KnowledgeItemValuesEntity.class, typeId, itemNo, status); + } + + + +} diff --git a/src/main/java/org/support/project/knowledge/dao/StockKnowledgesDao.java b/src/main/java/org/support/project/knowledge/dao/StockKnowledgesDao.java new file mode 100644 index 000000000..1cbf4a7cb --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/StockKnowledgesDao.java @@ -0,0 +1,28 @@ +package org.support.project.knowledge.dao; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; + +import org.support.project.knowledge.dao.gen.GenStockKnowledgesDao; + +/** + * ストックしたナレッジ + */ +@DI(instance=Instance.Singleton) +public class StockKnowledgesDao extends GenStockKnowledgesDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static StockKnowledgesDao get() { + return Container.getComp(StockKnowledgesDao.class); + } + + + +} diff --git a/src/main/java/org/support/project/knowledge/dao/TemplateItemsDao.java b/src/main/java/org/support/project/knowledge/dao/TemplateItemsDao.java new file mode 100644 index 000000000..5357b4f37 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/TemplateItemsDao.java @@ -0,0 +1,30 @@ +package org.support.project.knowledge.dao; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.knowledge.dao.gen.GenTemplateItemsDao; + +/** + * テンプレートの項目 + */ +@DI(instance=Instance.Singleton) +public class TemplateItemsDao extends GenTemplateItemsDao { + + public static final int ITEM_ID_BOOKMARK_URL = 0; + + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static TemplateItemsDao get() { + return Container.getComp(TemplateItemsDao.class); + } + + + +} diff --git a/src/main/java/org/support/project/knowledge/dao/TemplateMastersDao.java b/src/main/java/org/support/project/knowledge/dao/TemplateMastersDao.java new file mode 100644 index 000000000..214ccf5f4 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/TemplateMastersDao.java @@ -0,0 +1,74 @@ +package org.support.project.knowledge.dao; + +import java.util.List; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.knowledge.dao.gen.GenTemplateMastersDao; +import org.support.project.knowledge.entity.ItemChoicesEntity; +import org.support.project.knowledge.entity.TemplateItemsEntity; +import org.support.project.knowledge.entity.TemplateMastersEntity; + +/** + * テンプレートのマスタ + */ +@DI(instance=Instance.Singleton) +public class TemplateMastersDao extends GenTemplateMastersDao { + + public static final int TYPE_ID_KNOWLEDGE = -100; + public static final int TYPE_ID_BOOKMARK = -99; + + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static TemplateMastersDao get() { + return Container.getComp(TemplateMastersDao.class); + } + + + /** + * ID + */ + private int currentId = 0; + + /** + * IDを採番 + * ※コミットしなくても次のIDを採番する為、保存しなければ欠番になる + */ + public Integer getNextId() { + String sql = "SELECT MAX(TYPE_ID) FROM TEMPLATE_MASTERS;"; + Integer integer = executeQuerySingle(sql, Integer.class); + if (integer != null) { + if (currentId < integer) { + currentId = integer; + } + } + currentId++; + return currentId; + } + + /** + * 登録されているテンプレートを全て取得 + * @return + */ + public TemplateMastersEntity selectWithItems(Integer typeId) { + TemplateMastersEntity template = selectOnKey(typeId); + List items = TemplateItemsDao.get().selectOnTypeId(typeId); + for (TemplateItemsEntity item : items) { + template.getItems().add(item); + List choices = ItemChoicesDao.get().selectOnItem(typeId, item.getItemNo()); + for (ItemChoicesEntity choice : choices) { + item.getChoices().add(choice); + } + } + return template; + } + + +} diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenCommentsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenCommentsDao.java index 5ee8c73b0..dca30e145 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenCommentsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenCommentsDao.java @@ -76,6 +76,7 @@ public CommentsEntity rawPhysicalInsert(CommentsEntity entity) { entity.getCommentNo() , entity.getKnowledgeId() , entity.getComment() + , entity.getCommentStatus() , entity.getInsertUser() , entity.getInsertDatetime() , entity.getUpdateUser() @@ -99,6 +100,7 @@ public CommentsEntity physicalInsert(CommentsEntity entity) { Object key = executeInsert(sql, type, entity.getKnowledgeId() , entity.getComment() + , entity.getCommentStatus() , entity.getInsertUser() , entity.getInsertDatetime() , entity.getUpdateUser() @@ -138,6 +140,7 @@ public CommentsEntity physicalUpdate(CommentsEntity entity) { executeUpdate(sql, entity.getKnowledgeId() , entity.getComment() + , entity.getCommentStatus() , entity.getInsertUser() , entity.getInsertDatetime() , entity.getUpdateUser() diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenItemChoicesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenItemChoicesDao.java new file mode 100644 index 000000000..6ae7489f2 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenItemChoicesDao.java @@ -0,0 +1,327 @@ +package org.support.project.knowledge.dao.gen; + +import java.util.List; + +import java.sql.Timestamp; + + +import org.support.project.knowledge.entity.ItemChoicesEntity; +import org.support.project.ormapping.dao.AbstractDao; +import org.support.project.ormapping.exception.ORMappingException; +import org.support.project.ormapping.common.SQLManager; +import org.support.project.ormapping.common.DBUserPool; +import org.support.project.ormapping.common.IDGen; +import org.support.project.ormapping.config.ORMappingParameter; +import org.support.project.ormapping.connection.ConnectionManager; +import org.support.project.common.util.PropertyUtil; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.aop.Aspect; + +/** + * 選択肢の値 + */ +@DI(instance=Instance.Singleton) +public class GenItemChoicesDao extends AbstractDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static GenItemChoicesDao get() { + return Container.getComp(GenItemChoicesDao.class); + } + + /** + * 全て取得(削除フラグを無視して取得) + */ + public List physicalSelectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_all.sql"); + return executeQueryList(sql, ItemChoicesEntity.class); + } + /** + * キーで1件取得(削除フラグを無視して取得) + */ + public ItemChoicesEntity physicalSelectOnKey(Integer choiceNo, Integer itemNo, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_key.sql"); + return executeQuerySingle(sql, ItemChoicesEntity.class, choiceNo, itemNo, typeId); + } + /** + * 全て取得 + */ + public List selectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_all.sql"); + return executeQueryList(sql, ItemChoicesEntity.class); + } + /** + * キーで1件取得 + */ + public ItemChoicesEntity selectOnKey(Integer choiceNo, Integer itemNo, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_key.sql"); + return executeQuerySingle(sql, ItemChoicesEntity.class, choiceNo, itemNo, typeId); + } + /** + * CHOICE_NO でリストを取得 + */ + public List selectOnChoiceNo(Integer choiceNo) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_choice_no.sql"); + return executeQueryList(sql, ItemChoicesEntity.class, choiceNo); + } + /** + * ITEM_NO でリストを取得 + */ + public List selectOnItemNo(Integer itemNo) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_item_no.sql"); + return executeQueryList(sql, ItemChoicesEntity.class, itemNo); + } + /** + * TYPE_ID でリストを取得 + */ + public List selectOnTypeId(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_type_id.sql"); + return executeQueryList(sql, ItemChoicesEntity.class, typeId); + } + /** + * CHOICE_NO でリストを取得 + */ + public List physicalSelectOnChoiceNo(Integer choiceNo) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_choice_no.sql"); + return executeQueryList(sql, ItemChoicesEntity.class, choiceNo); + } + /** + * ITEM_NO でリストを取得 + */ + public List physicalSelectOnItemNo(Integer itemNo) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_item_no.sql"); + return executeQueryList(sql, ItemChoicesEntity.class, itemNo); + } + /** + * TYPE_ID でリストを取得 + */ + public List physicalSelectOnTypeId(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_type_id.sql"); + return executeQueryList(sql, ItemChoicesEntity.class, typeId); + } + /** + * 登録(データを生で操作/DBの採番機能のカラムも自分でセット) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public ItemChoicesEntity rawPhysicalInsert(ItemChoicesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_raw_insert.sql"); + executeUpdate(sql, + entity.getChoiceNo() + , entity.getItemNo() + , entity.getTypeId() + , entity.getChoiceValue() + , entity.getChoiceLabel() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + ); + return entity; + } + /** + * 登録(データを生で操作) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public ItemChoicesEntity physicalInsert(ItemChoicesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_insert.sql"); + executeUpdate(sql, + entity.getChoiceNo() + , entity.getItemNo() + , entity.getTypeId() + , entity.getChoiceValue() + , entity.getChoiceLabel() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + ); + return entity; + } + /** + * 登録(登録ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public ItemChoicesEntity insert(Integer user, ItemChoicesEntity entity) { + entity.setInsertUser(user); + entity.setInsertDatetime(new Timestamp(new java.util.Date().getTime())); + entity.setUpdateUser(user); + entity.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + entity.setDeleteFlag(0); + return physicalInsert(entity); + } + /** + * 登録 + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public ItemChoicesEntity insert(ItemChoicesEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return insert(userId, entity); + } + /** + * 更新(データを生で操作) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public ItemChoicesEntity physicalUpdate(ItemChoicesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_update.sql"); + executeUpdate(sql, + entity.getChoiceValue() + , entity.getChoiceLabel() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + , entity.getChoiceNo() + , entity.getItemNo() + , entity.getTypeId() + ); + return entity; + } + /** + * 更新(更新ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public ItemChoicesEntity update(Integer user, ItemChoicesEntity entity) { + ItemChoicesEntity db = selectOnKey(entity.getChoiceNo(), entity.getItemNo(), entity.getTypeId()); + entity.setInsertUser(db.getInsertUser()); + entity.setInsertDatetime(db.getInsertDatetime()); + entity.setDeleteFlag(db.getDeleteFlag()); + entity.setUpdateUser(user); + entity.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + return physicalUpdate(entity); + } + /** + * 更新 + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public ItemChoicesEntity update(ItemChoicesEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return update(userId, entity); + } + /** + * 保存(ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public ItemChoicesEntity save(Integer user, ItemChoicesEntity entity) { + ItemChoicesEntity db = selectOnKey(entity.getChoiceNo(), entity.getItemNo(), entity.getTypeId()); + if (db == null) { + return insert(user, entity); + } else { + return update(user, entity); + } + } + /** + * 保存(存在しなければ登録、存在すれば更新) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public ItemChoicesEntity save(ItemChoicesEntity entity) { + ItemChoicesEntity db = selectOnKey(entity.getChoiceNo(), entity.getItemNo(), entity.getTypeId()); + if (db == null) { + return insert(entity); + } else { + return update(entity); + } + } + /** + * 削除(データを生で操作/物理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(Integer choiceNo, Integer itemNo, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_delete.sql"); + executeUpdate(sql, choiceNo, itemNo, typeId); + } + /** + * 削除(データを生で操作/物理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(ItemChoicesEntity entity) { + physicalDelete(entity.getChoiceNo(), entity.getItemNo(), entity.getTypeId()); + + } + /** + * 削除(削除ユーザを指定/論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, Integer choiceNo, Integer itemNo, Integer typeId) { + ItemChoicesEntity db = selectOnKey(choiceNo, itemNo, typeId); + db.setDeleteFlag(1); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * 削除(論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer choiceNo, Integer itemNo, Integer typeId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + delete(user, choiceNo, itemNo, typeId); + } + /** + * 削除(削除ユーザを指定/論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, ItemChoicesEntity entity) { + delete(user, entity.getChoiceNo(), entity.getItemNo(), entity.getTypeId()); + + } + /** + * 削除(論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(ItemChoicesEntity entity) { + delete(entity.getChoiceNo(), entity.getItemNo(), entity.getTypeId()); + + } + /** + 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, Integer choiceNo, Integer itemNo, Integer typeId) { + ItemChoicesEntity db = physicalSelectOnKey(choiceNo, itemNo, typeId); + db.setDeleteFlag(0); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer choiceNo, Integer itemNo, Integer typeId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + activation(user, choiceNo, itemNo, typeId); + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, ItemChoicesEntity entity) { + activation(user, entity.getChoiceNo(), entity.getItemNo(), entity.getTypeId()); + + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(ItemChoicesEntity entity) { + activation(entity.getChoiceNo(), entity.getItemNo(), entity.getTypeId()); + + } + +} diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeItemValuesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeItemValuesDao.java new file mode 100644 index 000000000..93a8100b5 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeItemValuesDao.java @@ -0,0 +1,327 @@ +package org.support.project.knowledge.dao.gen; + +import java.util.List; + +import java.sql.Timestamp; + + +import org.support.project.knowledge.entity.KnowledgeItemValuesEntity; +import org.support.project.ormapping.dao.AbstractDao; +import org.support.project.ormapping.exception.ORMappingException; +import org.support.project.ormapping.common.SQLManager; +import org.support.project.ormapping.common.DBUserPool; +import org.support.project.ormapping.common.IDGen; +import org.support.project.ormapping.config.ORMappingParameter; +import org.support.project.ormapping.connection.ConnectionManager; +import org.support.project.common.util.PropertyUtil; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.aop.Aspect; + +/** + * ナレッジの項目値 + */ +@DI(instance=Instance.Singleton) +public class GenKnowledgeItemValuesDao extends AbstractDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static GenKnowledgeItemValuesDao get() { + return Container.getComp(GenKnowledgeItemValuesDao.class); + } + + /** + * 全て取得(削除フラグを無視して取得) + */ + public List physicalSelectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_all.sql"); + return executeQueryList(sql, KnowledgeItemValuesEntity.class); + } + /** + * キーで1件取得(削除フラグを無視して取得) + */ + public KnowledgeItemValuesEntity physicalSelectOnKey(Integer itemNo, Long knowledgeId, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_key.sql"); + return executeQuerySingle(sql, KnowledgeItemValuesEntity.class, itemNo, knowledgeId, typeId); + } + /** + * 全て取得 + */ + public List selectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_all.sql"); + return executeQueryList(sql, KnowledgeItemValuesEntity.class); + } + /** + * キーで1件取得 + */ + public KnowledgeItemValuesEntity selectOnKey(Integer itemNo, Long knowledgeId, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_key.sql"); + return executeQuerySingle(sql, KnowledgeItemValuesEntity.class, itemNo, knowledgeId, typeId); + } + /** + * ITEM_NO でリストを取得 + */ + public List selectOnItemNo(Integer itemNo) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_item_no.sql"); + return executeQueryList(sql, KnowledgeItemValuesEntity.class, itemNo); + } + /** + * KNOWLEDGE_ID でリストを取得 + */ + public List selectOnKnowledgeId(Long knowledgeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_knowledge_id.sql"); + return executeQueryList(sql, KnowledgeItemValuesEntity.class, knowledgeId); + } + /** + * TYPE_ID でリストを取得 + */ + public List selectOnTypeId(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_type_id.sql"); + return executeQueryList(sql, KnowledgeItemValuesEntity.class, typeId); + } + /** + * ITEM_NO でリストを取得 + */ + public List physicalSelectOnItemNo(Integer itemNo) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_item_no.sql"); + return executeQueryList(sql, KnowledgeItemValuesEntity.class, itemNo); + } + /** + * KNOWLEDGE_ID でリストを取得 + */ + public List physicalSelectOnKnowledgeId(Long knowledgeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_knowledge_id.sql"); + return executeQueryList(sql, KnowledgeItemValuesEntity.class, knowledgeId); + } + /** + * TYPE_ID でリストを取得 + */ + public List physicalSelectOnTypeId(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_type_id.sql"); + return executeQueryList(sql, KnowledgeItemValuesEntity.class, typeId); + } + /** + * 登録(データを生で操作/DBの採番機能のカラムも自分でセット) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public KnowledgeItemValuesEntity rawPhysicalInsert(KnowledgeItemValuesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_raw_insert.sql"); + executeUpdate(sql, + entity.getItemNo() + , entity.getKnowledgeId() + , entity.getTypeId() + , entity.getItemValue() + , entity.getItemStatus() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + ); + return entity; + } + /** + * 登録(データを生で操作) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public KnowledgeItemValuesEntity physicalInsert(KnowledgeItemValuesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_insert.sql"); + executeUpdate(sql, + entity.getItemNo() + , entity.getKnowledgeId() + , entity.getTypeId() + , entity.getItemValue() + , entity.getItemStatus() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + ); + return entity; + } + /** + * 登録(登録ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public KnowledgeItemValuesEntity insert(Integer user, KnowledgeItemValuesEntity entity) { + entity.setInsertUser(user); + entity.setInsertDatetime(new Timestamp(new java.util.Date().getTime())); + entity.setUpdateUser(user); + entity.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + entity.setDeleteFlag(0); + return physicalInsert(entity); + } + /** + * 登録 + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public KnowledgeItemValuesEntity insert(KnowledgeItemValuesEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return insert(userId, entity); + } + /** + * 更新(データを生で操作) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public KnowledgeItemValuesEntity physicalUpdate(KnowledgeItemValuesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_update.sql"); + executeUpdate(sql, + entity.getItemValue() + , entity.getItemStatus() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + , entity.getItemNo() + , entity.getKnowledgeId() + , entity.getTypeId() + ); + return entity; + } + /** + * 更新(更新ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public KnowledgeItemValuesEntity update(Integer user, KnowledgeItemValuesEntity entity) { + KnowledgeItemValuesEntity db = selectOnKey(entity.getItemNo(), entity.getKnowledgeId(), entity.getTypeId()); + entity.setInsertUser(db.getInsertUser()); + entity.setInsertDatetime(db.getInsertDatetime()); + entity.setDeleteFlag(db.getDeleteFlag()); + entity.setUpdateUser(user); + entity.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + return physicalUpdate(entity); + } + /** + * 更新 + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public KnowledgeItemValuesEntity update(KnowledgeItemValuesEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return update(userId, entity); + } + /** + * 保存(ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public KnowledgeItemValuesEntity save(Integer user, KnowledgeItemValuesEntity entity) { + KnowledgeItemValuesEntity db = selectOnKey(entity.getItemNo(), entity.getKnowledgeId(), entity.getTypeId()); + if (db == null) { + return insert(user, entity); + } else { + return update(user, entity); + } + } + /** + * 保存(存在しなければ登録、存在すれば更新) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public KnowledgeItemValuesEntity save(KnowledgeItemValuesEntity entity) { + KnowledgeItemValuesEntity db = selectOnKey(entity.getItemNo(), entity.getKnowledgeId(), entity.getTypeId()); + if (db == null) { + return insert(entity); + } else { + return update(entity); + } + } + /** + * 削除(データを生で操作/物理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(Integer itemNo, Long knowledgeId, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_delete.sql"); + executeUpdate(sql, itemNo, knowledgeId, typeId); + } + /** + * 削除(データを生で操作/物理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(KnowledgeItemValuesEntity entity) { + physicalDelete(entity.getItemNo(), entity.getKnowledgeId(), entity.getTypeId()); + + } + /** + * 削除(削除ユーザを指定/論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, Integer itemNo, Long knowledgeId, Integer typeId) { + KnowledgeItemValuesEntity db = selectOnKey(itemNo, knowledgeId, typeId); + db.setDeleteFlag(1); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * 削除(論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer itemNo, Long knowledgeId, Integer typeId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + delete(user, itemNo, knowledgeId, typeId); + } + /** + * 削除(削除ユーザを指定/論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, KnowledgeItemValuesEntity entity) { + delete(user, entity.getItemNo(), entity.getKnowledgeId(), entity.getTypeId()); + + } + /** + * 削除(論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(KnowledgeItemValuesEntity entity) { + delete(entity.getItemNo(), entity.getKnowledgeId(), entity.getTypeId()); + + } + /** + 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, Integer itemNo, Long knowledgeId, Integer typeId) { + KnowledgeItemValuesEntity db = physicalSelectOnKey(itemNo, knowledgeId, typeId); + db.setDeleteFlag(0); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer itemNo, Long knowledgeId, Integer typeId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + activation(user, itemNo, knowledgeId, typeId); + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, KnowledgeItemValuesEntity entity) { + activation(user, entity.getItemNo(), entity.getKnowledgeId(), entity.getTypeId()); + + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(KnowledgeItemValuesEntity entity) { + activation(entity.getItemNo(), entity.getKnowledgeId(), entity.getTypeId()); + + } + +} diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgesDao.java index 0074c2a78..233be02b1 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgesDao.java @@ -81,6 +81,7 @@ public KnowledgesEntity rawPhysicalInsert(KnowledgesEntity entity) { , entity.getTagNames() , entity.getLikeCount() , entity.getCommentCount() + , entity.getTypeId() , entity.getInsertUser() , entity.getInsertDatetime() , entity.getUpdateUser() @@ -109,6 +110,7 @@ public KnowledgesEntity physicalInsert(KnowledgesEntity entity) { , entity.getTagNames() , entity.getLikeCount() , entity.getCommentCount() + , entity.getTypeId() , entity.getInsertUser() , entity.getInsertDatetime() , entity.getUpdateUser() @@ -153,6 +155,7 @@ public KnowledgesEntity physicalUpdate(KnowledgesEntity entity) { , entity.getTagNames() , entity.getLikeCount() , entity.getCommentCount() + , entity.getTypeId() , entity.getInsertUser() , entity.getInsertDatetime() , entity.getUpdateUser() diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenStockKnowledgesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenStockKnowledgesDao.java new file mode 100644 index 000000000..17d8364ef --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenStockKnowledgesDao.java @@ -0,0 +1,307 @@ +package org.support.project.knowledge.dao.gen; + +import java.util.List; + +import java.sql.Timestamp; + + +import org.support.project.knowledge.entity.StockKnowledgesEntity; +import org.support.project.ormapping.dao.AbstractDao; +import org.support.project.ormapping.exception.ORMappingException; +import org.support.project.ormapping.common.SQLManager; +import org.support.project.ormapping.common.DBUserPool; +import org.support.project.ormapping.common.IDGen; +import org.support.project.ormapping.config.ORMappingParameter; +import org.support.project.ormapping.connection.ConnectionManager; +import org.support.project.common.util.PropertyUtil; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.aop.Aspect; + +/** + * ストックしたナレッジ + */ +@DI(instance=Instance.Singleton) +public class GenStockKnowledgesDao extends AbstractDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static GenStockKnowledgesDao get() { + return Container.getComp(GenStockKnowledgesDao.class); + } + + /** + * 全て取得(削除フラグを無視して取得) + */ + public List physicalSelectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_all.sql"); + return executeQueryList(sql, StockKnowledgesEntity.class); + } + /** + * キーで1件取得(削除フラグを無視して取得) + */ + public StockKnowledgesEntity physicalSelectOnKey(Long knowledgeId, Long stockId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_key.sql"); + return executeQuerySingle(sql, StockKnowledgesEntity.class, knowledgeId, stockId); + } + /** + * 全て取得 + */ + public List selectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_all.sql"); + return executeQueryList(sql, StockKnowledgesEntity.class); + } + /** + * キーで1件取得 + */ + public StockKnowledgesEntity selectOnKey(Long knowledgeId, Long stockId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_key.sql"); + return executeQuerySingle(sql, StockKnowledgesEntity.class, knowledgeId, stockId); + } + /** + * KNOWLEDGE_ID でリストを取得 + */ + public List selectOnKnowledgeId(Long knowledgeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_knowledge_id.sql"); + return executeQueryList(sql, StockKnowledgesEntity.class, knowledgeId); + } + /** + * STOCK_ID でリストを取得 + */ + public List selectOnStockId(Long stockId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_stock_id.sql"); + return executeQueryList(sql, StockKnowledgesEntity.class, stockId); + } + /** + * KNOWLEDGE_ID でリストを取得 + */ + public List physicalSelectOnKnowledgeId(Long knowledgeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_knowledge_id.sql"); + return executeQueryList(sql, StockKnowledgesEntity.class, knowledgeId); + } + /** + * STOCK_ID でリストを取得 + */ + public List physicalSelectOnStockId(Long stockId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_stock_id.sql"); + return executeQueryList(sql, StockKnowledgesEntity.class, stockId); + } + /** + * 登録(データを生で操作/DBの採番機能のカラムも自分でセット) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public StockKnowledgesEntity rawPhysicalInsert(StockKnowledgesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_raw_insert.sql"); + executeUpdate(sql, + entity.getKnowledgeId() + , entity.getStockId() + , entity.getComment() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + ); + return entity; + } + /** + * 登録(データを生で操作) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public StockKnowledgesEntity physicalInsert(StockKnowledgesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_insert.sql"); + executeUpdate(sql, + entity.getKnowledgeId() + , entity.getStockId() + , entity.getComment() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + ); + return entity; + } + /** + * 登録(登録ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public StockKnowledgesEntity insert(Integer user, StockKnowledgesEntity entity) { + entity.setInsertUser(user); + entity.setInsertDatetime(new Timestamp(new java.util.Date().getTime())); + entity.setUpdateUser(user); + entity.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + entity.setDeleteFlag(0); + return physicalInsert(entity); + } + /** + * 登録 + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public StockKnowledgesEntity insert(StockKnowledgesEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return insert(userId, entity); + } + /** + * 更新(データを生で操作) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public StockKnowledgesEntity physicalUpdate(StockKnowledgesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_update.sql"); + executeUpdate(sql, + entity.getComment() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + , entity.getKnowledgeId() + , entity.getStockId() + ); + return entity; + } + /** + * 更新(更新ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public StockKnowledgesEntity update(Integer user, StockKnowledgesEntity entity) { + StockKnowledgesEntity db = selectOnKey(entity.getKnowledgeId(), entity.getStockId()); + entity.setInsertUser(db.getInsertUser()); + entity.setInsertDatetime(db.getInsertDatetime()); + entity.setDeleteFlag(db.getDeleteFlag()); + entity.setUpdateUser(user); + entity.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + return physicalUpdate(entity); + } + /** + * 更新 + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public StockKnowledgesEntity update(StockKnowledgesEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return update(userId, entity); + } + /** + * 保存(ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public StockKnowledgesEntity save(Integer user, StockKnowledgesEntity entity) { + StockKnowledgesEntity db = selectOnKey(entity.getKnowledgeId(), entity.getStockId()); + if (db == null) { + return insert(user, entity); + } else { + return update(user, entity); + } + } + /** + * 保存(存在しなければ登録、存在すれば更新) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public StockKnowledgesEntity save(StockKnowledgesEntity entity) { + StockKnowledgesEntity db = selectOnKey(entity.getKnowledgeId(), entity.getStockId()); + if (db == null) { + return insert(entity); + } else { + return update(entity); + } + } + /** + * 削除(データを生で操作/物理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(Long knowledgeId, Long stockId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_delete.sql"); + executeUpdate(sql, knowledgeId, stockId); + } + /** + * 削除(データを生で操作/物理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(StockKnowledgesEntity entity) { + physicalDelete(entity.getKnowledgeId(), entity.getStockId()); + + } + /** + * 削除(削除ユーザを指定/論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, Long knowledgeId, Long stockId) { + StockKnowledgesEntity db = selectOnKey(knowledgeId, stockId); + db.setDeleteFlag(1); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * 削除(論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Long knowledgeId, Long stockId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + delete(user, knowledgeId, stockId); + } + /** + * 削除(削除ユーザを指定/論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, StockKnowledgesEntity entity) { + delete(user, entity.getKnowledgeId(), entity.getStockId()); + + } + /** + * 削除(論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(StockKnowledgesEntity entity) { + delete(entity.getKnowledgeId(), entity.getStockId()); + + } + /** + 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, Long knowledgeId, Long stockId) { + StockKnowledgesEntity db = physicalSelectOnKey(knowledgeId, stockId); + db.setDeleteFlag(0); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Long knowledgeId, Long stockId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + activation(user, knowledgeId, stockId); + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, StockKnowledgesEntity entity) { + activation(user, entity.getKnowledgeId(), entity.getStockId()); + + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(StockKnowledgesEntity entity) { + activation(entity.getKnowledgeId(), entity.getStockId()); + + } + +} diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenStocksDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenStocksDao.java index 36258e34a..3a94abeaf 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenStocksDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenStocksDao.java @@ -21,7 +21,7 @@ import org.support.project.aop.Aspect; /** - * ストックしたナレッジ + * ストック */ @DI(instance=Instance.Singleton) public class GenStocksDao extends AbstractDao { @@ -48,9 +48,9 @@ public List physicalSelectAll() { /** * キーで1件取得(削除フラグを無視して取得) */ - public StocksEntity physicalSelectOnKey(Long knowledgeId, Integer userId) { + public StocksEntity physicalSelectOnKey(Long stockId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_physical_select_on_key.sql"); - return executeQuerySingle(sql, StocksEntity.class, knowledgeId, userId); + return executeQuerySingle(sql, StocksEntity.class, stockId); } /** * 全て取得 @@ -62,37 +62,9 @@ public List selectAll() { /** * キーで1件取得 */ - public StocksEntity selectOnKey(Long knowledgeId, Integer userId) { + public StocksEntity selectOnKey(Long stockId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_select_on_key.sql"); - return executeQuerySingle(sql, StocksEntity.class, knowledgeId, userId); - } - /** - * KNOWLEDGE_ID でリストを取得 - */ - public List selectOnKnowledgeId(Long knowledgeId) { - String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_select_on_knowledge_id.sql"); - return executeQueryList(sql, StocksEntity.class, knowledgeId); - } - /** - * USER_ID でリストを取得 - */ - public List selectOnUserId(Integer userId) { - String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_select_on_user_id.sql"); - return executeQueryList(sql, StocksEntity.class, userId); - } - /** - * KNOWLEDGE_ID でリストを取得 - */ - public List physicalSelectOnKnowledgeId(Long knowledgeId) { - String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_physical_select_on_knowledge_id.sql"); - return executeQueryList(sql, StocksEntity.class, knowledgeId); - } - /** - * USER_ID でリストを取得 - */ - public List physicalSelectOnUserId(Integer userId) { - String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_physical_select_on_user_id.sql"); - return executeQueryList(sql, StocksEntity.class, userId); + return executeQuerySingle(sql, StocksEntity.class, stockId); } /** * 登録(データを生で操作/DBの採番機能のカラムも自分でセット) @@ -101,15 +73,21 @@ public List physicalSelectOnUserId(Integer userId) { public StocksEntity rawPhysicalInsert(StocksEntity entity) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_raw_insert.sql"); executeUpdate(sql, - entity.getKnowledgeId() - , entity.getUserId() - , entity.getComment() + entity.getStockId() + , entity.getStockName() + , entity.getStockType() + , entity.getDescription() , entity.getInsertUser() , entity.getInsertDatetime() , entity.getUpdateUser() , entity.getUpdateDatetime() , entity.getDeleteFlag() ); + String driverClass = ConnectionManager.getInstance().getDriverClass(getConnectionName()); + if (ORMappingParameter.DRIVER_NAME_POSTGRESQL.equals(driverClass)) { + String setValSql = "select setval('STOCKS_STOCK_ID_seq', (select max(STOCK_ID) from STOCKS));"; + executeQuerySingle(setValSql, Long.class); + } return entity; } /** @@ -118,16 +96,18 @@ public StocksEntity rawPhysicalInsert(StocksEntity entity) { @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public StocksEntity physicalInsert(StocksEntity entity) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_insert.sql"); - executeUpdate(sql, - entity.getKnowledgeId() - , entity.getUserId() - , entity.getComment() + Class type = PropertyUtil.getPropertyType(entity, "stockId"); + Object key = executeInsert(sql, type, + entity.getStockName() + , entity.getStockType() + , entity.getDescription() , entity.getInsertUser() , entity.getInsertDatetime() , entity.getUpdateUser() , entity.getUpdateDatetime() , entity.getDeleteFlag() ); + PropertyUtil.setPropertyValue(entity, "stockId", key); return entity; } /** @@ -158,14 +138,15 @@ public StocksEntity insert(StocksEntity entity) { public StocksEntity physicalUpdate(StocksEntity entity) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_update.sql"); executeUpdate(sql, - entity.getComment() + entity.getStockName() + , entity.getStockType() + , entity.getDescription() , entity.getInsertUser() , entity.getInsertDatetime() , entity.getUpdateUser() , entity.getUpdateDatetime() , entity.getDeleteFlag() - , entity.getKnowledgeId() - , entity.getUserId() + , entity.getStockId() ); return entity; } @@ -174,7 +155,7 @@ public StocksEntity physicalUpdate(StocksEntity entity) { */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public StocksEntity update(Integer user, StocksEntity entity) { - StocksEntity db = selectOnKey(entity.getKnowledgeId(), entity.getUserId()); + StocksEntity db = selectOnKey(entity.getStockId()); entity.setInsertUser(db.getInsertUser()); entity.setInsertDatetime(db.getInsertDatetime()); entity.setDeleteFlag(db.getDeleteFlag()); @@ -196,7 +177,7 @@ public StocksEntity update(StocksEntity entity) { */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public StocksEntity save(Integer user, StocksEntity entity) { - StocksEntity db = selectOnKey(entity.getKnowledgeId(), entity.getUserId()); + StocksEntity db = selectOnKey(entity.getStockId()); if (db == null) { return insert(user, entity); } else { @@ -208,7 +189,7 @@ public StocksEntity save(Integer user, StocksEntity entity) { */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public StocksEntity save(StocksEntity entity) { - StocksEntity db = selectOnKey(entity.getKnowledgeId(), entity.getUserId()); + StocksEntity db = selectOnKey(entity.getStockId()); if (db == null) { return insert(entity); } else { @@ -219,24 +200,24 @@ public StocksEntity save(StocksEntity entity) { * 削除(データを生で操作/物理削除) */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) - public void physicalDelete(Long knowledgeId, Integer userId) { + public void physicalDelete(Long stockId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_delete.sql"); - executeUpdate(sql, knowledgeId, userId); + executeUpdate(sql, stockId); } /** * 削除(データを生で操作/物理削除) */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public void physicalDelete(StocksEntity entity) { - physicalDelete(entity.getKnowledgeId(), entity.getUserId()); + physicalDelete(entity.getStockId()); } /** * 削除(削除ユーザを指定/論理削除があれば論理削除) */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) - public void delete(Integer user, Long knowledgeId, Integer userId) { - StocksEntity db = selectOnKey(knowledgeId, userId); + public void delete(Integer user, Long stockId) { + StocksEntity db = selectOnKey(stockId); db.setDeleteFlag(1); db.setUpdateUser(user); db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); @@ -246,17 +227,17 @@ public void delete(Integer user, Long knowledgeId, Integer userId) { * 削除(論理削除があれば論理削除) */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) - public void delete(Long knowledgeId, Integer userId) { + public void delete(Long stockId) { DBUserPool pool = Container.getComp(DBUserPool.class); Integer user = (Integer) pool.getUser(); - delete(user, knowledgeId, userId); + delete(user, stockId); } /** * 削除(削除ユーザを指定/論理削除があれば論理削除) */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public void delete(Integer user, StocksEntity entity) { - delete(user, entity.getKnowledgeId(), entity.getUserId()); + delete(user, entity.getStockId()); } /** @@ -264,15 +245,15 @@ public void delete(Integer user, StocksEntity entity) { */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public void delete(StocksEntity entity) { - delete(entity.getKnowledgeId(), entity.getUserId()); + delete(entity.getStockId()); } /** 復元(論理削除されていたものを有効化) */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) - public void activation(Integer user, Long knowledgeId, Integer userId) { - StocksEntity db = physicalSelectOnKey(knowledgeId, userId); + public void activation(Integer user, Long stockId) { + StocksEntity db = physicalSelectOnKey(stockId); db.setDeleteFlag(0); db.setUpdateUser(user); db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); @@ -282,17 +263,17 @@ public void activation(Integer user, Long knowledgeId, Integer userId) { * 復元(論理削除されていたものを有効化) */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) - public void activation(Long knowledgeId, Integer userId) { + public void activation(Long stockId) { DBUserPool pool = Container.getComp(DBUserPool.class); Integer user = (Integer) pool.getUser(); - activation(user, knowledgeId, userId); + activation(user, stockId); } /** * 復元(論理削除されていたものを有効化) */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public void activation(Integer user, StocksEntity entity) { - activation(user, entity.getKnowledgeId(), entity.getUserId()); + activation(user, entity.getStockId()); } /** @@ -300,7 +281,7 @@ public void activation(Integer user, StocksEntity entity) { */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public void activation(StocksEntity entity) { - activation(entity.getKnowledgeId(), entity.getUserId()); + activation(entity.getStockId()); } diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateItemsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateItemsDao.java new file mode 100644 index 000000000..3897eb5a1 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateItemsDao.java @@ -0,0 +1,310 @@ +package org.support.project.knowledge.dao.gen; + +import java.util.List; + +import java.sql.Timestamp; + + +import org.support.project.knowledge.entity.TemplateItemsEntity; +import org.support.project.ormapping.dao.AbstractDao; +import org.support.project.ormapping.exception.ORMappingException; +import org.support.project.ormapping.common.SQLManager; +import org.support.project.ormapping.common.DBUserPool; +import org.support.project.ormapping.common.IDGen; +import org.support.project.ormapping.config.ORMappingParameter; +import org.support.project.ormapping.connection.ConnectionManager; +import org.support.project.common.util.PropertyUtil; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.aop.Aspect; + +/** + * テンプレートの項目 + */ +@DI(instance=Instance.Singleton) +public class GenTemplateItemsDao extends AbstractDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static GenTemplateItemsDao get() { + return Container.getComp(GenTemplateItemsDao.class); + } + + /** + * 全て取得(削除フラグを無視して取得) + */ + public List physicalSelectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_all.sql"); + return executeQueryList(sql, TemplateItemsEntity.class); + } + /** + * キーで1件取得(削除フラグを無視して取得) + */ + public TemplateItemsEntity physicalSelectOnKey(Integer itemNo, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_key.sql"); + return executeQuerySingle(sql, TemplateItemsEntity.class, itemNo, typeId); + } + /** + * 全て取得 + */ + public List selectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_all.sql"); + return executeQueryList(sql, TemplateItemsEntity.class); + } + /** + * キーで1件取得 + */ + public TemplateItemsEntity selectOnKey(Integer itemNo, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_key.sql"); + return executeQuerySingle(sql, TemplateItemsEntity.class, itemNo, typeId); + } + /** + * ITEM_NO でリストを取得 + */ + public List selectOnItemNo(Integer itemNo) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_item_no.sql"); + return executeQueryList(sql, TemplateItemsEntity.class, itemNo); + } + /** + * TYPE_ID でリストを取得 + */ + public List selectOnTypeId(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_type_id.sql"); + return executeQueryList(sql, TemplateItemsEntity.class, typeId); + } + /** + * ITEM_NO でリストを取得 + */ + public List physicalSelectOnItemNo(Integer itemNo) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_item_no.sql"); + return executeQueryList(sql, TemplateItemsEntity.class, itemNo); + } + /** + * TYPE_ID でリストを取得 + */ + public List physicalSelectOnTypeId(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_type_id.sql"); + return executeQueryList(sql, TemplateItemsEntity.class, typeId); + } + /** + * 登録(データを生で操作/DBの採番機能のカラムも自分でセット) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateItemsEntity rawPhysicalInsert(TemplateItemsEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_raw_insert.sql"); + executeUpdate(sql, + entity.getItemNo() + , entity.getTypeId() + , entity.getItemName() + , entity.getItemType() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + ); + return entity; + } + /** + * 登録(データを生で操作) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateItemsEntity physicalInsert(TemplateItemsEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_insert.sql"); + executeUpdate(sql, + entity.getItemNo() + , entity.getTypeId() + , entity.getItemName() + , entity.getItemType() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + ); + return entity; + } + /** + * 登録(登録ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateItemsEntity insert(Integer user, TemplateItemsEntity entity) { + entity.setInsertUser(user); + entity.setInsertDatetime(new Timestamp(new java.util.Date().getTime())); + entity.setUpdateUser(user); + entity.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + entity.setDeleteFlag(0); + return physicalInsert(entity); + } + /** + * 登録 + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateItemsEntity insert(TemplateItemsEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return insert(userId, entity); + } + /** + * 更新(データを生で操作) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateItemsEntity physicalUpdate(TemplateItemsEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_update.sql"); + executeUpdate(sql, + entity.getItemName() + , entity.getItemType() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + , entity.getItemNo() + , entity.getTypeId() + ); + return entity; + } + /** + * 更新(更新ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateItemsEntity update(Integer user, TemplateItemsEntity entity) { + TemplateItemsEntity db = selectOnKey(entity.getItemNo(), entity.getTypeId()); + entity.setInsertUser(db.getInsertUser()); + entity.setInsertDatetime(db.getInsertDatetime()); + entity.setDeleteFlag(db.getDeleteFlag()); + entity.setUpdateUser(user); + entity.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + return physicalUpdate(entity); + } + /** + * 更新 + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateItemsEntity update(TemplateItemsEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return update(userId, entity); + } + /** + * 保存(ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateItemsEntity save(Integer user, TemplateItemsEntity entity) { + TemplateItemsEntity db = selectOnKey(entity.getItemNo(), entity.getTypeId()); + if (db == null) { + return insert(user, entity); + } else { + return update(user, entity); + } + } + /** + * 保存(存在しなければ登録、存在すれば更新) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateItemsEntity save(TemplateItemsEntity entity) { + TemplateItemsEntity db = selectOnKey(entity.getItemNo(), entity.getTypeId()); + if (db == null) { + return insert(entity); + } else { + return update(entity); + } + } + /** + * 削除(データを生で操作/物理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(Integer itemNo, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_delete.sql"); + executeUpdate(sql, itemNo, typeId); + } + /** + * 削除(データを生で操作/物理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(TemplateItemsEntity entity) { + physicalDelete(entity.getItemNo(), entity.getTypeId()); + + } + /** + * 削除(削除ユーザを指定/論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, Integer itemNo, Integer typeId) { + TemplateItemsEntity db = selectOnKey(itemNo, typeId); + db.setDeleteFlag(1); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * 削除(論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer itemNo, Integer typeId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + delete(user, itemNo, typeId); + } + /** + * 削除(削除ユーザを指定/論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, TemplateItemsEntity entity) { + delete(user, entity.getItemNo(), entity.getTypeId()); + + } + /** + * 削除(論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(TemplateItemsEntity entity) { + delete(entity.getItemNo(), entity.getTypeId()); + + } + /** + 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, Integer itemNo, Integer typeId) { + TemplateItemsEntity db = physicalSelectOnKey(itemNo, typeId); + db.setDeleteFlag(0); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer itemNo, Integer typeId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + activation(user, itemNo, typeId); + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, TemplateItemsEntity entity) { + activation(user, entity.getItemNo(), entity.getTypeId()); + + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(TemplateItemsEntity entity) { + activation(entity.getItemNo(), entity.getTypeId()); + + } + +} diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateMastersDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateMastersDao.java new file mode 100644 index 000000000..2076f13ef --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateMastersDao.java @@ -0,0 +1,288 @@ +package org.support.project.knowledge.dao.gen; + +import java.util.List; + +import java.sql.Timestamp; + + +import org.support.project.knowledge.entity.TemplateMastersEntity; +import org.support.project.ormapping.dao.AbstractDao; +import org.support.project.ormapping.exception.ORMappingException; +import org.support.project.ormapping.common.SQLManager; +import org.support.project.ormapping.common.DBUserPool; +import org.support.project.ormapping.common.IDGen; +import org.support.project.ormapping.config.ORMappingParameter; +import org.support.project.ormapping.connection.ConnectionManager; +import org.support.project.common.util.PropertyUtil; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.aop.Aspect; + +/** + * テンプレートのマスタ + */ +@DI(instance=Instance.Singleton) +public class GenTemplateMastersDao extends AbstractDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static GenTemplateMastersDao get() { + return Container.getComp(GenTemplateMastersDao.class); + } + + /** + * 全て取得(削除フラグを無視して取得) + */ + public List physicalSelectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_physical_select_all.sql"); + return executeQueryList(sql, TemplateMastersEntity.class); + } + /** + * キーで1件取得(削除フラグを無視して取得) + */ + public TemplateMastersEntity physicalSelectOnKey(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_physical_select_on_key.sql"); + return executeQuerySingle(sql, TemplateMastersEntity.class, typeId); + } + /** + * 全て取得 + */ + public List selectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_select_all.sql"); + return executeQueryList(sql, TemplateMastersEntity.class); + } + /** + * キーで1件取得 + */ + public TemplateMastersEntity selectOnKey(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_select_on_key.sql"); + return executeQuerySingle(sql, TemplateMastersEntity.class, typeId); + } + /** + * 登録(データを生で操作/DBの採番機能のカラムも自分でセット) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateMastersEntity rawPhysicalInsert(TemplateMastersEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_raw_insert.sql"); + executeUpdate(sql, + entity.getTypeId() + , entity.getTypeName() + , entity.getTypeIcon() + , entity.getDescription() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + ); + String driverClass = ConnectionManager.getInstance().getDriverClass(getConnectionName()); + if (ORMappingParameter.DRIVER_NAME_POSTGRESQL.equals(driverClass)) { + String setValSql = "select setval('TEMPLATE_MASTERS_TYPE_ID_seq', (select max(TYPE_ID) from TEMPLATE_MASTERS));"; + executeQuerySingle(setValSql, Long.class); + } + return entity; + } + /** + * 登録(データを生で操作) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateMastersEntity physicalInsert(TemplateMastersEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_insert.sql"); + Class type = PropertyUtil.getPropertyType(entity, "typeId"); + Object key = executeInsert(sql, type, + entity.getTypeName() + , entity.getTypeIcon() + , entity.getDescription() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + ); + PropertyUtil.setPropertyValue(entity, "typeId", key); + return entity; + } + /** + * 登録(登録ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateMastersEntity insert(Integer user, TemplateMastersEntity entity) { + entity.setInsertUser(user); + entity.setInsertDatetime(new Timestamp(new java.util.Date().getTime())); + entity.setUpdateUser(user); + entity.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + entity.setDeleteFlag(0); + return physicalInsert(entity); + } + /** + * 登録 + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateMastersEntity insert(TemplateMastersEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return insert(userId, entity); + } + /** + * 更新(データを生で操作) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateMastersEntity physicalUpdate(TemplateMastersEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_update.sql"); + executeUpdate(sql, + entity.getTypeName() + , entity.getTypeIcon() + , entity.getDescription() + , entity.getInsertUser() + , entity.getInsertDatetime() + , entity.getUpdateUser() + , entity.getUpdateDatetime() + , entity.getDeleteFlag() + , entity.getTypeId() + ); + return entity; + } + /** + * 更新(更新ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateMastersEntity update(Integer user, TemplateMastersEntity entity) { + TemplateMastersEntity db = selectOnKey(entity.getTypeId()); + entity.setInsertUser(db.getInsertUser()); + entity.setInsertDatetime(db.getInsertDatetime()); + entity.setDeleteFlag(db.getDeleteFlag()); + entity.setUpdateUser(user); + entity.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + return physicalUpdate(entity); + } + /** + * 更新 + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateMastersEntity update(TemplateMastersEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return update(userId, entity); + } + /** + * 保存(ユーザを指定) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateMastersEntity save(Integer user, TemplateMastersEntity entity) { + TemplateMastersEntity db = selectOnKey(entity.getTypeId()); + if (db == null) { + return insert(user, entity); + } else { + return update(user, entity); + } + } + /** + * 保存(存在しなければ登録、存在すれば更新) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public TemplateMastersEntity save(TemplateMastersEntity entity) { + TemplateMastersEntity db = selectOnKey(entity.getTypeId()); + if (db == null) { + return insert(entity); + } else { + return update(entity); + } + } + /** + * 削除(データを生で操作/物理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_delete.sql"); + executeUpdate(sql, typeId); + } + /** + * 削除(データを生で操作/物理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(TemplateMastersEntity entity) { + physicalDelete(entity.getTypeId()); + + } + /** + * 削除(削除ユーザを指定/論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, Integer typeId) { + TemplateMastersEntity db = selectOnKey(typeId); + db.setDeleteFlag(1); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * 削除(論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer typeId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + delete(user, typeId); + } + /** + * 削除(削除ユーザを指定/論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, TemplateMastersEntity entity) { + delete(user, entity.getTypeId()); + + } + /** + * 削除(論理削除があれば論理削除) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void delete(TemplateMastersEntity entity) { + delete(entity.getTypeId()); + + } + /** + 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, Integer typeId) { + TemplateMastersEntity db = physicalSelectOnKey(typeId); + db.setDeleteFlag(0); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer typeId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + activation(user, typeId); + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, TemplateMastersEntity entity) { + activation(user, entity.getTypeId()); + + } + /** + * 復元(論理削除されていたものを有効化) + */ + @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) + public void activation(TemplateMastersEntity entity) { + activation(entity.getTypeId()); + + } + +} diff --git a/src/main/java/org/support/project/knowledge/deploy/InitDB.java b/src/main/java/org/support/project/knowledge/deploy/InitDB.java index 9a1ace59e..9e7de0d28 100644 --- a/src/main/java/org/support/project/knowledge/deploy/InitDB.java +++ b/src/main/java/org/support/project/knowledge/deploy/InitDB.java @@ -14,6 +14,7 @@ import org.support.project.knowledge.deploy.v0_5_2pre2.Migrate_0_5_2pre2; import org.support.project.knowledge.deploy.v0_5_3pre2.Migrate_0_5_3pre2; import org.support.project.knowledge.deploy.v0_5_3pre3.Migrate_0_5_3pre3; +import org.support.project.knowledge.deploy.v0_6_0pre2.Migrate_0_6_0pre2; import org.support.project.web.dao.SystemsDao; import org.support.project.web.entity.SystemsEntity; @@ -26,7 +27,7 @@ public class InitDB { private static final Map MAP = new LinkedHashMap<>(); private static final Migrate INIT = InitializeSystem.get(); - public static final String CURRENT = "0.5.3.pre3"; + public static final String CURRENT = "0.6.0.pre2"; public InitDB() { super(); @@ -36,7 +37,8 @@ public InitDB() { MAP.put("0.5.1", Migrate_0_5_1.get()); // ナレッジの更新履歴 MAP.put("0.5.2.pre2", Migrate_0_5_2pre2.get()); // 共同編集 MAP.put("0.5.3.pre2", Migrate_0_5_3pre2.get()); // ALLグループ - MAP.put(CURRENT, Migrate_0_5_3pre3.get()); // メールアドレス + MAP.put("0.5.3.pre3", Migrate_0_5_3pre3.get()); // メールアドレス + MAP.put(CURRENT, Migrate_0_6_0pre2.get()); } public static void main(String[] args) throws Exception { diff --git a/src/main/java/org/support/project/knowledge/deploy/v0_6_0pre2/Migrate_0_6_0pre2.java b/src/main/java/org/support/project/knowledge/deploy/v0_6_0pre2/Migrate_0_6_0pre2.java new file mode 100644 index 000000000..079089cb2 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/deploy/v0_6_0pre2/Migrate_0_6_0pre2.java @@ -0,0 +1,21 @@ +package org.support.project.knowledge.deploy.v0_6_0pre2; + +import org.support.project.knowledge.deploy.Migrate; +import org.support.project.ormapping.tool.dao.InitializeDao; + +public class Migrate_0_6_0pre2 implements Migrate { + + public static Migrate_0_6_0pre2 get() { + return org.support.project.di.Container.getComp(Migrate_0_6_0pre2.class); + } + + @Override + public boolean doMigrate() throws Exception { + InitializeDao initializeDao = InitializeDao.get(); + String[] sqlpaths = { "/org/support/project/knowledge/deploy/v0_6_0pre2/migrate.sql" }; + initializeDao.initializeDatabase(sqlpaths); + return true; + + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/ItemChoicesEntity.java b/src/main/java/org/support/project/knowledge/entity/ItemChoicesEntity.java new file mode 100644 index 000000000..e0b32f5bc --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/ItemChoicesEntity.java @@ -0,0 +1,52 @@ +package org.support.project.knowledge.entity; + +import org.support.project.knowledge.entity.gen.GenItemChoicesEntity; + +import java.util.List; +import java.util.Map; + +import org.support.project.common.bean.ValidateError; +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; + +import java.sql.Timestamp; + + +/** + * 選択肢の値 + */ +@DI(instance=Instance.Prototype) +public class ItemChoicesEntity extends GenItemChoicesEntity { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static ItemChoicesEntity get() { + return Container.getComp(ItemChoicesEntity.class); + } + + /** + * コンストラクタ + */ + public ItemChoicesEntity() { + super(); + } + + /** + * コンストラクタ + * @param choiceNo 選択肢番号 + * @param itemNo 項目NO + * @param typeId テンプレートの種類ID + */ + + public ItemChoicesEntity(Integer choiceNo, Integer itemNo, Integer typeId) { + super( choiceNo, itemNo, typeId); + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/KnowledgeItemValuesEntity.java b/src/main/java/org/support/project/knowledge/entity/KnowledgeItemValuesEntity.java new file mode 100644 index 000000000..84ca93c78 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/KnowledgeItemValuesEntity.java @@ -0,0 +1,49 @@ +package org.support.project.knowledge.entity; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.knowledge.entity.gen.GenKnowledgeItemValuesEntity; + + +/** + * ナレッジの項目値 + */ +@DI(instance=Instance.Prototype) +public class KnowledgeItemValuesEntity extends GenKnowledgeItemValuesEntity { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + /** ステータス: 保存済み */ + public static final Integer STATUS_SAVED = 0; + /** ステータス: Webの値取得済み */ + public static final Integer STATUS_WEBACCESSED = 1; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static KnowledgeItemValuesEntity get() { + return Container.getComp(KnowledgeItemValuesEntity.class); + } + + /** + * コンストラクタ + */ + public KnowledgeItemValuesEntity() { + super(); + } + + /** + * コンストラクタ + * @param itemNo 項目NO + * @param knowledgeId ナレッジID + * @param typeId テンプレートの種類ID + */ + + public KnowledgeItemValuesEntity(Integer itemNo, Long knowledgeId, Integer typeId) { + super( itemNo, knowledgeId, typeId); + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/StockKnowledgesEntity.java b/src/main/java/org/support/project/knowledge/entity/StockKnowledgesEntity.java new file mode 100644 index 000000000..d7bfb1f51 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/StockKnowledgesEntity.java @@ -0,0 +1,51 @@ +package org.support.project.knowledge.entity; + +import org.support.project.knowledge.entity.gen.GenStockKnowledgesEntity; + +import java.util.List; +import java.util.Map; + +import org.support.project.common.bean.ValidateError; +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; + +import java.sql.Timestamp; + + +/** + * ストックしたナレッジ + */ +@DI(instance=Instance.Prototype) +public class StockKnowledgesEntity extends GenStockKnowledgesEntity { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static StockKnowledgesEntity get() { + return Container.getComp(StockKnowledgesEntity.class); + } + + /** + * コンストラクタ + */ + public StockKnowledgesEntity() { + super(); + } + + /** + * コンストラクタ + * @param knowledgeId ナレッジID + * @param stockId STOCK ID + */ + + public StockKnowledgesEntity(Long knowledgeId, Long stockId) { + super( knowledgeId, stockId); + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/StocksEntity.java b/src/main/java/org/support/project/knowledge/entity/StocksEntity.java index f08e726d9..82cc11eea 100644 --- a/src/main/java/org/support/project/knowledge/entity/StocksEntity.java +++ b/src/main/java/org/support/project/knowledge/entity/StocksEntity.java @@ -38,12 +38,11 @@ public StocksEntity() { /** * コンストラクタ - * @param knowledgeId ナレッジID - * @param userId USER_ID + * @param stockId stockId */ - public StocksEntity(Long knowledgeId, Integer userId) { - super(knowledgeId, userId); + public StocksEntity(Long stockId) { + super(stockId); } } diff --git a/src/main/java/org/support/project/knowledge/entity/TemplateItemsEntity.java b/src/main/java/org/support/project/knowledge/entity/TemplateItemsEntity.java new file mode 100644 index 000000000..6903ef1b7 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/TemplateItemsEntity.java @@ -0,0 +1,68 @@ +package org.support.project.knowledge.entity; + +import java.util.ArrayList; +import java.util.List; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.knowledge.entity.gen.GenTemplateItemsEntity; + + +/** + * テンプレートの項目 + */ +@DI(instance=Instance.Prototype) +public class TemplateItemsEntity extends GenTemplateItemsEntity { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + private List choices = new ArrayList<>(); + + /** 値 */ + private String itemValue; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static TemplateItemsEntity get() { + return Container.getComp(TemplateItemsEntity.class); + } + + /** + * コンストラクタ + */ + public TemplateItemsEntity() { + super(); + } + + /** + * コンストラクタ + * @param itemNo 項目NO + * @param typeId テンプレートの種類ID + */ + + public TemplateItemsEntity(Integer itemNo, Integer typeId) { + super( itemNo, typeId); + } + + public List getChoices() { + return choices; + } + + public void setChoices(List choices) { + this.choices = choices; + } + + public String getItemValue() { + return itemValue; + } + + public void setItemValue(String itemValue) { + this.itemValue = itemValue; + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/TemplateMastersEntity.java b/src/main/java/org/support/project/knowledge/entity/TemplateMastersEntity.java new file mode 100644 index 000000000..af0a257de --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/TemplateMastersEntity.java @@ -0,0 +1,57 @@ +package org.support.project.knowledge.entity; + +import java.util.ArrayList; +import java.util.List; + +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.knowledge.entity.gen.GenTemplateMastersEntity; + + +/** + * テンプレートのマスタ + */ +@DI(instance=Instance.Prototype) +public class TemplateMastersEntity extends GenTemplateMastersEntity { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + private List items = new ArrayList(); + + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static TemplateMastersEntity get() { + return Container.getComp(TemplateMastersEntity.class); + } + + /** + * コンストラクタ + */ + public TemplateMastersEntity() { + super(); + } + + /** + * コンストラクタ + * @param typeId テンプレートの種類ID + */ + + public TemplateMastersEntity(Integer typeId) { + super( typeId); + } + + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenCommentsEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenCommentsEntity.java index 8c5d7a28b..654651f43 100644 --- a/src/main/java/org/support/project/knowledge/entity/gen/GenCommentsEntity.java +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenCommentsEntity.java @@ -56,6 +56,8 @@ public GenCommentsEntity(Long commentNo) { private Long knowledgeId; /** コメント */ private String comment; + /** ステータス */ + private Integer commentStatus; /** 登録ユーザ */ private Integer insertUser; /** 登録日時 */ @@ -112,6 +114,21 @@ public GenCommentsEntity setComment(String comment) { return this; } + /** + * ステータス を取得する + */ + public Integer getCommentStatus() { + return this.commentStatus; + } + /** + * ステータス を設定する + * @param commentStatus ステータス + */ + public GenCommentsEntity setCommentStatus(Integer commentStatus) { + this.commentStatus = commentStatus; + return this; + } + /** * 登録ユーザ を取得する */ @@ -234,6 +251,7 @@ public String toString() { builder.append("commentNo = ").append(commentNo).append("\n"); builder.append("knowledgeId = ").append(knowledgeId).append("\n"); builder.append("comment = ").append(comment).append("\n"); + builder.append("commentStatus = ").append(commentStatus).append("\n"); builder.append("insertUser = ").append(insertUser).append("\n"); builder.append("insertDatetime = ").append(insertDatetime).append("\n"); builder.append("updateUser = ").append(updateUser).append("\n"); @@ -260,6 +278,11 @@ public List validate() { errors.add(error); } validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.commentStatus, convLabelName("Comment Status")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); error = validator.validate(this.insertUser, convLabelName("Insert User")); if (error != null) { errors.add(error); @@ -289,6 +312,11 @@ public List validate(Map values) { errors.add(error); } validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("commentStatus"), convLabelName("Comment Status")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); error = validator.validate(values.get("insertUser"), convLabelName("Insert User")); if (error != null) { errors.add(error); diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenItemChoicesEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenItemChoicesEntity.java new file mode 100644 index 000000000..8522c78d8 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenItemChoicesEntity.java @@ -0,0 +1,445 @@ +package org.support.project.knowledge.entity.gen; + +import java.io.Serializable; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; + +import java.sql.Timestamp; + + + +import org.support.project.common.bean.ValidateError; +import org.support.project.common.validate.Validator; +import org.support.project.common.validate.ValidatorFactory; +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; + +/** + * 選択肢の値 + */ +@DI(instance=Instance.Prototype) +public class GenItemChoicesEntity implements Serializable { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static GenItemChoicesEntity get() { + return Container.getComp(GenItemChoicesEntity.class); + } + + /** + * コンストラクタ + */ + public GenItemChoicesEntity() { + super(); + } + + /** + * コンストラクタ + * @param choiceNo 選択肢番号 + * @param itemNo 項目NO + * @param typeId テンプレートの種類ID + */ + + public GenItemChoicesEntity(Integer choiceNo, Integer itemNo, Integer typeId) { + super(); + this.choiceNo = choiceNo; + this.itemNo = itemNo; + this.typeId = typeId; + } + /** テンプレートの種類ID */ + private Integer typeId; + /** 項目NO */ + private Integer itemNo; + /** 選択肢番号 */ + private Integer choiceNo; + /** 選択肢値 */ + private String choiceValue; + /** 選択肢ラベル */ + private String choiceLabel; + /** 登録ユーザ */ + private Integer insertUser; + /** 登録日時 */ + private Timestamp insertDatetime; + /** 更新ユーザ */ + private Integer updateUser; + /** 更新日時 */ + private Timestamp updateDatetime; + /** 削除フラグ */ + private Integer deleteFlag; + + /** + * テンプレートの種類ID を取得する + */ + public Integer getTypeId() { + return this.typeId; + } + /** + * テンプレートの種類ID を設定する + * @param typeId テンプレートの種類ID + */ + public GenItemChoicesEntity setTypeId(Integer typeId) { + this.typeId = typeId; + return this; + } + + /** + * 項目NO を取得する + */ + public Integer getItemNo() { + return this.itemNo; + } + /** + * 項目NO を設定する + * @param itemNo 項目NO + */ + public GenItemChoicesEntity setItemNo(Integer itemNo) { + this.itemNo = itemNo; + return this; + } + + /** + * 選択肢番号 を取得する + */ + public Integer getChoiceNo() { + return this.choiceNo; + } + /** + * 選択肢番号 を設定する + * @param choiceNo 選択肢番号 + */ + public GenItemChoicesEntity setChoiceNo(Integer choiceNo) { + this.choiceNo = choiceNo; + return this; + } + + /** + * 選択肢値 を取得する + */ + public String getChoiceValue() { + return this.choiceValue; + } + /** + * 選択肢値 を設定する + * @param choiceValue 選択肢値 + */ + public GenItemChoicesEntity setChoiceValue(String choiceValue) { + this.choiceValue = choiceValue; + return this; + } + + /** + * 選択肢ラベル を取得する + */ + public String getChoiceLabel() { + return this.choiceLabel; + } + /** + * 選択肢ラベル を設定する + * @param choiceLabel 選択肢ラベル + */ + public GenItemChoicesEntity setChoiceLabel(String choiceLabel) { + this.choiceLabel = choiceLabel; + return this; + } + + /** + * 登録ユーザ を取得する + */ + public Integer getInsertUser() { + return this.insertUser; + } + /** + * 登録ユーザ を設定する + * @param insertUser 登録ユーザ + */ + public GenItemChoicesEntity setInsertUser(Integer insertUser) { + this.insertUser = insertUser; + return this; + } + + /** + * 登録日時 を取得する + */ + public Timestamp getInsertDatetime() { + return this.insertDatetime; + } + /** + * 登録日時 を設定する + * @param insertDatetime 登録日時 + */ + public GenItemChoicesEntity setInsertDatetime(Timestamp insertDatetime) { + this.insertDatetime = insertDatetime; + return this; + } + + /** + * 更新ユーザ を取得する + */ + public Integer getUpdateUser() { + return this.updateUser; + } + /** + * 更新ユーザ を設定する + * @param updateUser 更新ユーザ + */ + public GenItemChoicesEntity setUpdateUser(Integer updateUser) { + this.updateUser = updateUser; + return this; + } + + /** + * 更新日時 を取得する + */ + public Timestamp getUpdateDatetime() { + return this.updateDatetime; + } + /** + * 更新日時 を設定する + * @param updateDatetime 更新日時 + */ + public GenItemChoicesEntity setUpdateDatetime(Timestamp updateDatetime) { + this.updateDatetime = updateDatetime; + return this; + } + + /** + * 削除フラグ を取得する + */ + public Integer getDeleteFlag() { + return this.deleteFlag; + } + /** + * 削除フラグ を設定する + * @param deleteFlag 削除フラグ + */ + public GenItemChoicesEntity setDeleteFlag(Integer deleteFlag) { + this.deleteFlag = deleteFlag; + return this; + } + + /** + * キーの値を取得 + */ + public Object[] getKeyValues() { + Object[] keyValues = new Object[3]; + keyValues[0] = this.choiceNo; + keyValues[1] = this.itemNo; + keyValues[2] = this.typeId; + return keyValues; + } + /** + * キーの値を設定 + * @param choiceNo 選択肢番号 + * @param itemNo 項目NO + * @param typeId テンプレートの種類ID + */ + public void setKeyValues(Integer choiceNo, Integer itemNo, Integer typeId) { + this.choiceNo = choiceNo; + this.itemNo = itemNo; + this.typeId = typeId; + } + /** + * キーで比較 + */ + public boolean equalsOnKey(GenItemChoicesEntity entity) { + Object[] keyValues1 = getKeyValues(); + Object[] keyValues2 = entity.getKeyValues(); + for (int i = 0; i < keyValues1.length; i++) { + Object val1 = keyValues1[i]; + Object val2 = keyValues2[i]; + if (val1 == null && val2 != null) { + return false; + } + if (val1 != null && val2 == null) { + return false; + } + if (val1 != null && val2 != null) { + if (!val1.equals(val2)) { + return false; + } + } + + } + return true; + } + /** + * ToString + */ + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("choiceNo = ").append(choiceNo).append("\n"); + builder.append("itemNo = ").append(itemNo).append("\n"); + builder.append("typeId = ").append(typeId).append("\n"); + builder.append("choiceValue = ").append(choiceValue).append("\n"); + builder.append("choiceLabel = ").append(choiceLabel).append("\n"); + builder.append("insertUser = ").append(insertUser).append("\n"); + builder.append("insertDatetime = ").append(insertDatetime).append("\n"); + builder.append("updateUser = ").append(updateUser).append("\n"); + builder.append("updateDatetime = ").append(updateDatetime).append("\n"); + builder.append("deleteFlag = ").append(deleteFlag).append("\n"); + return builder.toString(); + } + /** + * 表示用の名称を変換 + */ + protected String convLabelName(String label) { + return label; + } + /** + * validate + */ + public List validate() { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.typeId, convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.typeId, convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.itemNo, convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.itemNo, convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.choiceNo, convLabelName("Choice No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.choiceNo, convLabelName("Choice No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.choiceValue, convLabelName("Choice Value")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(this.choiceValue, convLabelName("Choice Value"), 256); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.choiceLabel, convLabelName("Choice Label")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(this.choiceLabel, convLabelName("Choice Label"), 256); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.insertUser, convLabelName("Insert User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.updateUser, convLabelName("Update User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.deleteFlag, convLabelName("Delete Flag")); + if (error != null) { + errors.add(error); + } + return errors; + } + /** + * validate + */ + public List validate(Map values) { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("typeId"), convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("typeId"), convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("itemNo"), convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("itemNo"), convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("choiceNo"), convLabelName("Choice No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("choiceNo"), convLabelName("Choice No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("choiceValue"), convLabelName("Choice Value")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(values.get("choiceValue"), convLabelName("Choice Value"), 256); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("choiceLabel"), convLabelName("Choice Label")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(values.get("choiceLabel"), convLabelName("Choice Label"), 256); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("insertUser"), convLabelName("Insert User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("updateUser"), convLabelName("Update User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("deleteFlag"), convLabelName("Delete Flag")); + if (error != null) { + errors.add(error); + } + return errors; + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgeItemValuesEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgeItemValuesEntity.java new file mode 100644 index 000000000..4fd10f634 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgeItemValuesEntity.java @@ -0,0 +1,415 @@ +package org.support.project.knowledge.entity.gen; + +import java.io.Serializable; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; + +import java.sql.Timestamp; + + + +import org.support.project.common.bean.ValidateError; +import org.support.project.common.validate.Validator; +import org.support.project.common.validate.ValidatorFactory; +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; + +/** + * ナレッジの項目値 + */ +@DI(instance=Instance.Prototype) +public class GenKnowledgeItemValuesEntity implements Serializable { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static GenKnowledgeItemValuesEntity get() { + return Container.getComp(GenKnowledgeItemValuesEntity.class); + } + + /** + * コンストラクタ + */ + public GenKnowledgeItemValuesEntity() { + super(); + } + + /** + * コンストラクタ + * @param itemNo 項目NO + * @param knowledgeId ナレッジID + * @param typeId テンプレートの種類ID + */ + + public GenKnowledgeItemValuesEntity(Integer itemNo, Long knowledgeId, Integer typeId) { + super(); + this.itemNo = itemNo; + this.knowledgeId = knowledgeId; + this.typeId = typeId; + } + /** ナレッジID */ + private Long knowledgeId; + /** テンプレートの種類ID */ + private Integer typeId; + /** 項目NO */ + private Integer itemNo; + /** 項目値 */ + private String itemValue; + /** ステータス */ + private Integer itemStatus; + /** 登録ユーザ */ + private Integer insertUser; + /** 登録日時 */ + private Timestamp insertDatetime; + /** 更新ユーザ */ + private Integer updateUser; + /** 更新日時 */ + private Timestamp updateDatetime; + /** 削除フラグ */ + private Integer deleteFlag; + + /** + * ナレッジID を取得する + */ + public Long getKnowledgeId() { + return this.knowledgeId; + } + /** + * ナレッジID を設定する + * @param knowledgeId ナレッジID + */ + public GenKnowledgeItemValuesEntity setKnowledgeId(Long knowledgeId) { + this.knowledgeId = knowledgeId; + return this; + } + + /** + * テンプレートの種類ID を取得する + */ + public Integer getTypeId() { + return this.typeId; + } + /** + * テンプレートの種類ID を設定する + * @param typeId テンプレートの種類ID + */ + public GenKnowledgeItemValuesEntity setTypeId(Integer typeId) { + this.typeId = typeId; + return this; + } + + /** + * 項目NO を取得する + */ + public Integer getItemNo() { + return this.itemNo; + } + /** + * 項目NO を設定する + * @param itemNo 項目NO + */ + public GenKnowledgeItemValuesEntity setItemNo(Integer itemNo) { + this.itemNo = itemNo; + return this; + } + + /** + * 項目値 を取得する + */ + public String getItemValue() { + return this.itemValue; + } + /** + * 項目値 を設定する + * @param itemValue 項目値 + */ + public GenKnowledgeItemValuesEntity setItemValue(String itemValue) { + this.itemValue = itemValue; + return this; + } + + /** + * ステータス を取得する + */ + public Integer getItemStatus() { + return this.itemStatus; + } + /** + * ステータス を設定する + * @param itemStatus ステータス + */ + public GenKnowledgeItemValuesEntity setItemStatus(Integer itemStatus) { + this.itemStatus = itemStatus; + return this; + } + + /** + * 登録ユーザ を取得する + */ + public Integer getInsertUser() { + return this.insertUser; + } + /** + * 登録ユーザ を設定する + * @param insertUser 登録ユーザ + */ + public GenKnowledgeItemValuesEntity setInsertUser(Integer insertUser) { + this.insertUser = insertUser; + return this; + } + + /** + * 登録日時 を取得する + */ + public Timestamp getInsertDatetime() { + return this.insertDatetime; + } + /** + * 登録日時 を設定する + * @param insertDatetime 登録日時 + */ + public GenKnowledgeItemValuesEntity setInsertDatetime(Timestamp insertDatetime) { + this.insertDatetime = insertDatetime; + return this; + } + + /** + * 更新ユーザ を取得する + */ + public Integer getUpdateUser() { + return this.updateUser; + } + /** + * 更新ユーザ を設定する + * @param updateUser 更新ユーザ + */ + public GenKnowledgeItemValuesEntity setUpdateUser(Integer updateUser) { + this.updateUser = updateUser; + return this; + } + + /** + * 更新日時 を取得する + */ + public Timestamp getUpdateDatetime() { + return this.updateDatetime; + } + /** + * 更新日時 を設定する + * @param updateDatetime 更新日時 + */ + public GenKnowledgeItemValuesEntity setUpdateDatetime(Timestamp updateDatetime) { + this.updateDatetime = updateDatetime; + return this; + } + + /** + * 削除フラグ を取得する + */ + public Integer getDeleteFlag() { + return this.deleteFlag; + } + /** + * 削除フラグ を設定する + * @param deleteFlag 削除フラグ + */ + public GenKnowledgeItemValuesEntity setDeleteFlag(Integer deleteFlag) { + this.deleteFlag = deleteFlag; + return this; + } + + /** + * キーの値を取得 + */ + public Object[] getKeyValues() { + Object[] keyValues = new Object[3]; + keyValues[0] = this.itemNo; + keyValues[1] = this.knowledgeId; + keyValues[2] = this.typeId; + return keyValues; + } + /** + * キーの値を設定 + * @param itemNo 項目NO + * @param knowledgeId ナレッジID + * @param typeId テンプレートの種類ID + */ + public void setKeyValues(Integer itemNo, Long knowledgeId, Integer typeId) { + this.itemNo = itemNo; + this.knowledgeId = knowledgeId; + this.typeId = typeId; + } + /** + * キーで比較 + */ + public boolean equalsOnKey(GenKnowledgeItemValuesEntity entity) { + Object[] keyValues1 = getKeyValues(); + Object[] keyValues2 = entity.getKeyValues(); + for (int i = 0; i < keyValues1.length; i++) { + Object val1 = keyValues1[i]; + Object val2 = keyValues2[i]; + if (val1 == null && val2 != null) { + return false; + } + if (val1 != null && val2 == null) { + return false; + } + if (val1 != null && val2 != null) { + if (!val1.equals(val2)) { + return false; + } + } + + } + return true; + } + /** + * ToString + */ + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("itemNo = ").append(itemNo).append("\n"); + builder.append("knowledgeId = ").append(knowledgeId).append("\n"); + builder.append("typeId = ").append(typeId).append("\n"); + builder.append("itemValue = ").append(itemValue).append("\n"); + builder.append("itemStatus = ").append(itemStatus).append("\n"); + builder.append("insertUser = ").append(insertUser).append("\n"); + builder.append("insertDatetime = ").append(insertDatetime).append("\n"); + builder.append("updateUser = ").append(updateUser).append("\n"); + builder.append("updateDatetime = ").append(updateDatetime).append("\n"); + builder.append("deleteFlag = ").append(deleteFlag).append("\n"); + return builder.toString(); + } + /** + * 表示用の名称を変換 + */ + protected String convLabelName(String label) { + return label; + } + /** + * validate + */ + public List validate() { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.knowledgeId, convLabelName("Knowledge Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.typeId, convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.typeId, convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.itemNo, convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.itemNo, convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.itemStatus, convLabelName("Item Status")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.itemStatus, convLabelName("Item Status")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.insertUser, convLabelName("Insert User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.updateUser, convLabelName("Update User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.deleteFlag, convLabelName("Delete Flag")); + if (error != null) { + errors.add(error); + } + return errors; + } + /** + * validate + */ + public List validate(Map values) { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("knowledgeId"), convLabelName("Knowledge Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("typeId"), convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("typeId"), convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("itemNo"), convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("itemNo"), convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("itemStatus"), convLabelName("Item Status")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("itemStatus"), convLabelName("Item Status")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("insertUser"), convLabelName("Insert User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("updateUser"), convLabelName("Update User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("deleteFlag"), convLabelName("Delete Flag")); + if (error != null) { + errors.add(error); + } + return errors; + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgesEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgesEntity.java index 65ad852bb..b64c99205 100644 --- a/src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgesEntity.java +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgesEntity.java @@ -66,6 +66,8 @@ public GenKnowledgesEntity(Long knowledgeId) { private Long likeCount; /** コメント件数 */ private Integer commentCount; + /** テンプレートの種類ID */ + private Integer typeId; /** 登録ユーザ */ private Integer insertUser; /** 登録日時 */ @@ -197,6 +199,21 @@ public GenKnowledgesEntity setCommentCount(Integer commentCount) { return this; } + /** + * テンプレートの種類ID を取得する + */ + public Integer getTypeId() { + return this.typeId; + } + /** + * テンプレートの種類ID を設定する + * @param typeId テンプレートの種類ID + */ + public GenKnowledgesEntity setTypeId(Integer typeId) { + this.typeId = typeId; + return this; + } + /** * 登録ユーザ を取得する */ @@ -324,6 +341,7 @@ public String toString() { builder.append("tagNames = ").append(tagNames).append("\n"); builder.append("likeCount = ").append(likeCount).append("\n"); builder.append("commentCount = ").append(commentCount).append("\n"); + builder.append("typeId = ").append(typeId).append("\n"); builder.append("insertUser = ").append(insertUser).append("\n"); builder.append("insertDatetime = ").append(insertDatetime).append("\n"); builder.append("updateUser = ").append(updateUser).append("\n"); @@ -370,6 +388,11 @@ public List validate() { errors.add(error); } validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.typeId, convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); error = validator.validate(this.insertUser, convLabelName("Insert User")); if (error != null) { errors.add(error); @@ -419,6 +442,11 @@ public List validate(Map values) { errors.add(error); } validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("typeId"), convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); error = validator.validate(values.get("insertUser"), convLabelName("Insert User")); if (error != null) { errors.add(error); diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenStockKnowledgesEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenStockKnowledgesEntity.java new file mode 100644 index 000000000..f040a3da2 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenStockKnowledgesEntity.java @@ -0,0 +1,334 @@ +package org.support.project.knowledge.entity.gen; + +import java.io.Serializable; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; + +import java.sql.Timestamp; + + + +import org.support.project.common.bean.ValidateError; +import org.support.project.common.validate.Validator; +import org.support.project.common.validate.ValidatorFactory; +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; + +/** + * ストックしたナレッジ + */ +@DI(instance=Instance.Prototype) +public class GenStockKnowledgesEntity implements Serializable { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static GenStockKnowledgesEntity get() { + return Container.getComp(GenStockKnowledgesEntity.class); + } + + /** + * コンストラクタ + */ + public GenStockKnowledgesEntity() { + super(); + } + + /** + * コンストラクタ + * @param knowledgeId ナレッジID + * @param stockId STOCK ID + */ + + public GenStockKnowledgesEntity(Long knowledgeId, Long stockId) { + super(); + this.knowledgeId = knowledgeId; + this.stockId = stockId; + } + /** STOCK ID */ + private Long stockId; + /** ナレッジID */ + private Long knowledgeId; + /** コメント */ + private String comment; + /** 登録ユーザ */ + private Integer insertUser; + /** 登録日時 */ + private Timestamp insertDatetime; + /** 更新ユーザ */ + private Integer updateUser; + /** 更新日時 */ + private Timestamp updateDatetime; + /** 削除フラグ */ + private Integer deleteFlag; + + /** + * STOCK ID を取得する + */ + public Long getStockId() { + return this.stockId; + } + /** + * STOCK ID を設定する + * @param stockId STOCK ID + */ + public GenStockKnowledgesEntity setStockId(Long stockId) { + this.stockId = stockId; + return this; + } + + /** + * ナレッジID を取得する + */ + public Long getKnowledgeId() { + return this.knowledgeId; + } + /** + * ナレッジID を設定する + * @param knowledgeId ナレッジID + */ + public GenStockKnowledgesEntity setKnowledgeId(Long knowledgeId) { + this.knowledgeId = knowledgeId; + return this; + } + + /** + * コメント を取得する + */ + public String getComment() { + return this.comment; + } + /** + * コメント を設定する + * @param comment コメント + */ + public GenStockKnowledgesEntity setComment(String comment) { + this.comment = comment; + return this; + } + + /** + * 登録ユーザ を取得する + */ + public Integer getInsertUser() { + return this.insertUser; + } + /** + * 登録ユーザ を設定する + * @param insertUser 登録ユーザ + */ + public GenStockKnowledgesEntity setInsertUser(Integer insertUser) { + this.insertUser = insertUser; + return this; + } + + /** + * 登録日時 を取得する + */ + public Timestamp getInsertDatetime() { + return this.insertDatetime; + } + /** + * 登録日時 を設定する + * @param insertDatetime 登録日時 + */ + public GenStockKnowledgesEntity setInsertDatetime(Timestamp insertDatetime) { + this.insertDatetime = insertDatetime; + return this; + } + + /** + * 更新ユーザ を取得する + */ + public Integer getUpdateUser() { + return this.updateUser; + } + /** + * 更新ユーザ を設定する + * @param updateUser 更新ユーザ + */ + public GenStockKnowledgesEntity setUpdateUser(Integer updateUser) { + this.updateUser = updateUser; + return this; + } + + /** + * 更新日時 を取得する + */ + public Timestamp getUpdateDatetime() { + return this.updateDatetime; + } + /** + * 更新日時 を設定する + * @param updateDatetime 更新日時 + */ + public GenStockKnowledgesEntity setUpdateDatetime(Timestamp updateDatetime) { + this.updateDatetime = updateDatetime; + return this; + } + + /** + * 削除フラグ を取得する + */ + public Integer getDeleteFlag() { + return this.deleteFlag; + } + /** + * 削除フラグ を設定する + * @param deleteFlag 削除フラグ + */ + public GenStockKnowledgesEntity setDeleteFlag(Integer deleteFlag) { + this.deleteFlag = deleteFlag; + return this; + } + + /** + * キーの値を取得 + */ + public Object[] getKeyValues() { + Object[] keyValues = new Object[2]; + keyValues[0] = this.knowledgeId; + keyValues[1] = this.stockId; + return keyValues; + } + /** + * キーの値を設定 + * @param knowledgeId ナレッジID + * @param stockId STOCK ID + */ + public void setKeyValues(Long knowledgeId, Long stockId) { + this.knowledgeId = knowledgeId; + this.stockId = stockId; + } + /** + * キーで比較 + */ + public boolean equalsOnKey(GenStockKnowledgesEntity entity) { + Object[] keyValues1 = getKeyValues(); + Object[] keyValues2 = entity.getKeyValues(); + for (int i = 0; i < keyValues1.length; i++) { + Object val1 = keyValues1[i]; + Object val2 = keyValues2[i]; + if (val1 == null && val2 != null) { + return false; + } + if (val1 != null && val2 == null) { + return false; + } + if (val1 != null && val2 != null) { + if (!val1.equals(val2)) { + return false; + } + } + + } + return true; + } + /** + * ToString + */ + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("knowledgeId = ").append(knowledgeId).append("\n"); + builder.append("stockId = ").append(stockId).append("\n"); + builder.append("comment = ").append(comment).append("\n"); + builder.append("insertUser = ").append(insertUser).append("\n"); + builder.append("insertDatetime = ").append(insertDatetime).append("\n"); + builder.append("updateUser = ").append(updateUser).append("\n"); + builder.append("updateDatetime = ").append(updateDatetime).append("\n"); + builder.append("deleteFlag = ").append(deleteFlag).append("\n"); + return builder.toString(); + } + /** + * 表示用の名称を変換 + */ + protected String convLabelName(String label) { + return label; + } + /** + * validate + */ + public List validate() { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.stockId, convLabelName("Stock Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.knowledgeId, convLabelName("Knowledge Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(this.comment, convLabelName("Comment"), 1024); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.insertUser, convLabelName("Insert User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.updateUser, convLabelName("Update User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.deleteFlag, convLabelName("Delete Flag")); + if (error != null) { + errors.add(error); + } + return errors; + } + /** + * validate + */ + public List validate(Map values) { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("stockId"), convLabelName("Stock Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("knowledgeId"), convLabelName("Knowledge Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(values.get("comment"), convLabelName("Comment"), 1024); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("insertUser"), convLabelName("Insert User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("updateUser"), convLabelName("Update User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("deleteFlag"), convLabelName("Delete Flag")); + if (error != null) { + errors.add(error); + } + return errors; + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenStocksEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenStocksEntity.java index b7fe064a3..691d20b4b 100644 --- a/src/main/java/org/support/project/knowledge/entity/gen/GenStocksEntity.java +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenStocksEntity.java @@ -17,7 +17,7 @@ import org.support.project.di.Instance; /** - * ストックしたナレッジ + * ストック */ @DI(instance=Instance.Prototype) public class GenStocksEntity implements Serializable { @@ -43,21 +43,21 @@ public GenStocksEntity() { /** * コンストラクタ - * @param knowledgeId ナレッジID - * @param userId USER_ID + * @param stockId STOCK ID */ - public GenStocksEntity(Long knowledgeId, Integer userId) { + public GenStocksEntity(Long stockId) { super(); - this.knowledgeId = knowledgeId; - this.userId = userId; + this.stockId = stockId; } - /** USER_ID */ - private Integer userId; - /** ナレッジID */ - private Long knowledgeId; - /** コメント */ - private String comment; + /** STOCK ID */ + private Long stockId; + /** STOCK 名 */ + private String stockName; + /** 区分 */ + private Integer stockType; + /** 説明 */ + private String description; /** 登録ユーザ */ private Integer insertUser; /** 登録日時 */ @@ -70,47 +70,62 @@ public GenStocksEntity(Long knowledgeId, Integer userId) { private Integer deleteFlag; /** - * USER_ID を取得する + * STOCK ID を取得する */ - public Integer getUserId() { - return this.userId; + public Long getStockId() { + return this.stockId; } /** - * USER_ID を設定する - * @param userId USER_ID + * STOCK ID を設定する + * @param stockId STOCK ID */ - public GenStocksEntity setUserId(Integer userId) { - this.userId = userId; + public GenStocksEntity setStockId(Long stockId) { + this.stockId = stockId; return this; } /** - * ナレッジID を取得する + * STOCK 名 を取得する */ - public Long getKnowledgeId() { - return this.knowledgeId; + public String getStockName() { + return this.stockName; } /** - * ナレッジID を設定する - * @param knowledgeId ナレッジID + * STOCK 名 を設定する + * @param stockName STOCK 名 */ - public GenStocksEntity setKnowledgeId(Long knowledgeId) { - this.knowledgeId = knowledgeId; + public GenStocksEntity setStockName(String stockName) { + this.stockName = stockName; return this; } /** - * コメント を取得する + * 区分 を取得する */ - public String getComment() { - return this.comment; + public Integer getStockType() { + return this.stockType; } /** - * コメント を設定する - * @param comment コメント + * 区分 を設定する + * @param stockType 区分 */ - public GenStocksEntity setComment(String comment) { - this.comment = comment; + public GenStocksEntity setStockType(Integer stockType) { + this.stockType = stockType; + return this; + } + + /** + * 説明 を取得する + */ + public String getDescription() { + return this.description; + } + /** + * 説明 を設定する + * @param description 説明 + */ + public GenStocksEntity setDescription(String description) { + this.description = description; return this; } @@ -193,19 +208,16 @@ public GenStocksEntity setDeleteFlag(Integer deleteFlag) { * キーの値を取得 */ public Object[] getKeyValues() { - Object[] keyValues = new Object[2]; - keyValues[0] = this.knowledgeId; - keyValues[1] = this.userId; + Object[] keyValues = new Object[1]; + keyValues[0] = this.stockId; return keyValues; } /** * キーの値を設定 - * @param knowledgeId ナレッジID - * @param userId USER_ID + * @param stockId STOCK ID */ - public void setKeyValues(Long knowledgeId, Integer userId) { - this.knowledgeId = knowledgeId; - this.userId = userId; + public void setKeyValues(Long stockId) { + this.stockId = stockId; } /** * キーで比較 @@ -236,9 +248,10 @@ public boolean equalsOnKey(GenStocksEntity entity) { */ public String toString() { StringBuilder builder = new StringBuilder(); - builder.append("knowledgeId = ").append(knowledgeId).append("\n"); - builder.append("userId = ").append(userId).append("\n"); - builder.append("comment = ").append(comment).append("\n"); + builder.append("stockId = ").append(stockId).append("\n"); + builder.append("stockName = ").append(stockName).append("\n"); + builder.append("stockType = ").append(stockType).append("\n"); + builder.append("description = ").append(description).append("\n"); builder.append("insertUser = ").append(insertUser).append("\n"); builder.append("insertDatetime = ").append(insertDatetime).append("\n"); builder.append("updateUser = ").append(updateUser).append("\n"); @@ -260,22 +273,27 @@ public List validate() { Validator validator; ValidateError error; validator = ValidatorFactory.getInstance(Validator.REQUIRED); - error = validator.validate(this.userId, convLabelName("User Id")); + error = validator.validate(this.stockName, convLabelName("Stock Name")); if (error != null) { errors.add(error); } - validator = ValidatorFactory.getInstance(Validator.INTEGER); - error = validator.validate(this.userId, convLabelName("User Id")); + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(this.stockName, convLabelName("Stock Name"), 256); if (error != null) { errors.add(error); } validator = ValidatorFactory.getInstance(Validator.REQUIRED); - error = validator.validate(this.knowledgeId, convLabelName("Knowledge Id")); + error = validator.validate(this.stockType, convLabelName("Stock Type")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.stockType, convLabelName("Stock Type")); if (error != null) { errors.add(error); } validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); - error = validator.validate(this.comment, convLabelName("Comment"), 1024); + error = validator.validate(this.description, convLabelName("Description"), 1024); if (error != null) { errors.add(error); } @@ -304,22 +322,27 @@ public List validate(Map values) { Validator validator; ValidateError error; validator = ValidatorFactory.getInstance(Validator.REQUIRED); - error = validator.validate(values.get("userId"), convLabelName("User Id")); + error = validator.validate(values.get("stockName"), convLabelName("Stock Name")); if (error != null) { errors.add(error); } - validator = ValidatorFactory.getInstance(Validator.INTEGER); - error = validator.validate(values.get("userId"), convLabelName("User Id")); + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(values.get("stockName"), convLabelName("Stock Name"), 256); if (error != null) { errors.add(error); } validator = ValidatorFactory.getInstance(Validator.REQUIRED); - error = validator.validate(values.get("knowledgeId"), convLabelName("Knowledge Id")); + error = validator.validate(values.get("stockType"), convLabelName("Stock Type")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("stockType"), convLabelName("Stock Type")); if (error != null) { errors.add(error); } validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); - error = validator.validate(values.get("comment"), convLabelName("Comment"), 1024); + error = validator.validate(values.get("description"), convLabelName("Description"), 1024); if (error != null) { errors.add(error); } diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateItemsEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateItemsEntity.java new file mode 100644 index 000000000..552a0045e --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateItemsEntity.java @@ -0,0 +1,402 @@ +package org.support.project.knowledge.entity.gen; + +import java.io.Serializable; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; + +import java.sql.Timestamp; + + + +import org.support.project.common.bean.ValidateError; +import org.support.project.common.validate.Validator; +import org.support.project.common.validate.ValidatorFactory; +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; + +/** + * テンプレートの項目 + */ +@DI(instance=Instance.Prototype) +public class GenTemplateItemsEntity implements Serializable { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static GenTemplateItemsEntity get() { + return Container.getComp(GenTemplateItemsEntity.class); + } + + /** + * コンストラクタ + */ + public GenTemplateItemsEntity() { + super(); + } + + /** + * コンストラクタ + * @param itemNo 項目NO + * @param typeId テンプレートの種類ID + */ + + public GenTemplateItemsEntity(Integer itemNo, Integer typeId) { + super(); + this.itemNo = itemNo; + this.typeId = typeId; + } + /** テンプレートの種類ID */ + private Integer typeId; + /** 項目NO */ + private Integer itemNo; + /** 項目名 */ + private String itemName; + /** 項目の種類 */ + private Integer itemType; + /** 登録ユーザ */ + private Integer insertUser; + /** 登録日時 */ + private Timestamp insertDatetime; + /** 更新ユーザ */ + private Integer updateUser; + /** 更新日時 */ + private Timestamp updateDatetime; + /** 削除フラグ */ + private Integer deleteFlag; + + /** + * テンプレートの種類ID を取得する + */ + public Integer getTypeId() { + return this.typeId; + } + /** + * テンプレートの種類ID を設定する + * @param typeId テンプレートの種類ID + */ + public GenTemplateItemsEntity setTypeId(Integer typeId) { + this.typeId = typeId; + return this; + } + + /** + * 項目NO を取得する + */ + public Integer getItemNo() { + return this.itemNo; + } + /** + * 項目NO を設定する + * @param itemNo 項目NO + */ + public GenTemplateItemsEntity setItemNo(Integer itemNo) { + this.itemNo = itemNo; + return this; + } + + /** + * 項目名 を取得する + */ + public String getItemName() { + return this.itemName; + } + /** + * 項目名 を設定する + * @param itemName 項目名 + */ + public GenTemplateItemsEntity setItemName(String itemName) { + this.itemName = itemName; + return this; + } + + /** + * 項目の種類 を取得する + */ + public Integer getItemType() { + return this.itemType; + } + /** + * 項目の種類 を設定する + * @param itemType 項目の種類 + */ + public GenTemplateItemsEntity setItemType(Integer itemType) { + this.itemType = itemType; + return this; + } + + /** + * 登録ユーザ を取得する + */ + public Integer getInsertUser() { + return this.insertUser; + } + /** + * 登録ユーザ を設定する + * @param insertUser 登録ユーザ + */ + public GenTemplateItemsEntity setInsertUser(Integer insertUser) { + this.insertUser = insertUser; + return this; + } + + /** + * 登録日時 を取得する + */ + public Timestamp getInsertDatetime() { + return this.insertDatetime; + } + /** + * 登録日時 を設定する + * @param insertDatetime 登録日時 + */ + public GenTemplateItemsEntity setInsertDatetime(Timestamp insertDatetime) { + this.insertDatetime = insertDatetime; + return this; + } + + /** + * 更新ユーザ を取得する + */ + public Integer getUpdateUser() { + return this.updateUser; + } + /** + * 更新ユーザ を設定する + * @param updateUser 更新ユーザ + */ + public GenTemplateItemsEntity setUpdateUser(Integer updateUser) { + this.updateUser = updateUser; + return this; + } + + /** + * 更新日時 を取得する + */ + public Timestamp getUpdateDatetime() { + return this.updateDatetime; + } + /** + * 更新日時 を設定する + * @param updateDatetime 更新日時 + */ + public GenTemplateItemsEntity setUpdateDatetime(Timestamp updateDatetime) { + this.updateDatetime = updateDatetime; + return this; + } + + /** + * 削除フラグ を取得する + */ + public Integer getDeleteFlag() { + return this.deleteFlag; + } + /** + * 削除フラグ を設定する + * @param deleteFlag 削除フラグ + */ + public GenTemplateItemsEntity setDeleteFlag(Integer deleteFlag) { + this.deleteFlag = deleteFlag; + return this; + } + + /** + * キーの値を取得 + */ + public Object[] getKeyValues() { + Object[] keyValues = new Object[2]; + keyValues[0] = this.itemNo; + keyValues[1] = this.typeId; + return keyValues; + } + /** + * キーの値を設定 + * @param itemNo 項目NO + * @param typeId テンプレートの種類ID + */ + public void setKeyValues(Integer itemNo, Integer typeId) { + this.itemNo = itemNo; + this.typeId = typeId; + } + /** + * キーで比較 + */ + public boolean equalsOnKey(GenTemplateItemsEntity entity) { + Object[] keyValues1 = getKeyValues(); + Object[] keyValues2 = entity.getKeyValues(); + for (int i = 0; i < keyValues1.length; i++) { + Object val1 = keyValues1[i]; + Object val2 = keyValues2[i]; + if (val1 == null && val2 != null) { + return false; + } + if (val1 != null && val2 == null) { + return false; + } + if (val1 != null && val2 != null) { + if (!val1.equals(val2)) { + return false; + } + } + + } + return true; + } + /** + * ToString + */ + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("itemNo = ").append(itemNo).append("\n"); + builder.append("typeId = ").append(typeId).append("\n"); + builder.append("itemName = ").append(itemName).append("\n"); + builder.append("itemType = ").append(itemType).append("\n"); + builder.append("insertUser = ").append(insertUser).append("\n"); + builder.append("insertDatetime = ").append(insertDatetime).append("\n"); + builder.append("updateUser = ").append(updateUser).append("\n"); + builder.append("updateDatetime = ").append(updateDatetime).append("\n"); + builder.append("deleteFlag = ").append(deleteFlag).append("\n"); + return builder.toString(); + } + /** + * 表示用の名称を変換 + */ + protected String convLabelName(String label) { + return label; + } + /** + * validate + */ + public List validate() { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.typeId, convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.typeId, convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.itemNo, convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.itemNo, convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.itemName, convLabelName("Item Name")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(this.itemName, convLabelName("Item Name"), 32); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.itemType, convLabelName("Item Type")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.itemType, convLabelName("Item Type")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.insertUser, convLabelName("Insert User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.updateUser, convLabelName("Update User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.deleteFlag, convLabelName("Delete Flag")); + if (error != null) { + errors.add(error); + } + return errors; + } + /** + * validate + */ + public List validate(Map values) { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("typeId"), convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("typeId"), convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("itemNo"), convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("itemNo"), convLabelName("Item No")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("itemName"), convLabelName("Item Name")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(values.get("itemName"), convLabelName("Item Name"), 32); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("itemType"), convLabelName("Item Type")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("itemType"), convLabelName("Item Type")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("insertUser"), convLabelName("Insert User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("updateUser"), convLabelName("Update User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("deleteFlag"), convLabelName("Delete Flag")); + if (error != null) { + errors.add(error); + } + return errors; + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateMastersEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateMastersEntity.java new file mode 100644 index 000000000..0d86a4ef4 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenTemplateMastersEntity.java @@ -0,0 +1,367 @@ +package org.support.project.knowledge.entity.gen; + +import java.io.Serializable; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; + +import java.sql.Timestamp; + + + +import org.support.project.common.bean.ValidateError; +import org.support.project.common.validate.Validator; +import org.support.project.common.validate.ValidatorFactory; +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; + +/** + * テンプレートのマスタ + */ +@DI(instance=Instance.Prototype) +public class GenTemplateMastersEntity implements Serializable { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * インスタンス取得 + * AOPに対応 + * @return インスタンス + */ + public static GenTemplateMastersEntity get() { + return Container.getComp(GenTemplateMastersEntity.class); + } + + /** + * コンストラクタ + */ + public GenTemplateMastersEntity() { + super(); + } + + /** + * コンストラクタ + * @param typeId テンプレートの種類ID + */ + + public GenTemplateMastersEntity(Integer typeId) { + super(); + this.typeId = typeId; + } + /** テンプレートの種類ID */ + private Integer typeId; + /** テンプレート名 */ + private String typeName; + /** アイコン */ + private String typeIcon; + /** 説明 */ + private String description; + /** 登録ユーザ */ + private Integer insertUser; + /** 登録日時 */ + private Timestamp insertDatetime; + /** 更新ユーザ */ + private Integer updateUser; + /** 更新日時 */ + private Timestamp updateDatetime; + /** 削除フラグ */ + private Integer deleteFlag; + + /** + * テンプレートの種類ID を取得する + */ + public Integer getTypeId() { + return this.typeId; + } + /** + * テンプレートの種類ID を設定する + * @param typeId テンプレートの種類ID + */ + public GenTemplateMastersEntity setTypeId(Integer typeId) { + this.typeId = typeId; + return this; + } + + /** + * テンプレート名 を取得する + */ + public String getTypeName() { + return this.typeName; + } + /** + * テンプレート名 を設定する + * @param typeName テンプレート名 + */ + public GenTemplateMastersEntity setTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * アイコン を取得する + */ + public String getTypeIcon() { + return this.typeIcon; + } + /** + * アイコン を設定する + * @param typeIcon アイコン + */ + public GenTemplateMastersEntity setTypeIcon(String typeIcon) { + this.typeIcon = typeIcon; + return this; + } + + /** + * 説明 を取得する + */ + public String getDescription() { + return this.description; + } + /** + * 説明 を設定する + * @param description 説明 + */ + public GenTemplateMastersEntity setDescription(String description) { + this.description = description; + return this; + } + + /** + * 登録ユーザ を取得する + */ + public Integer getInsertUser() { + return this.insertUser; + } + /** + * 登録ユーザ を設定する + * @param insertUser 登録ユーザ + */ + public GenTemplateMastersEntity setInsertUser(Integer insertUser) { + this.insertUser = insertUser; + return this; + } + + /** + * 登録日時 を取得する + */ + public Timestamp getInsertDatetime() { + return this.insertDatetime; + } + /** + * 登録日時 を設定する + * @param insertDatetime 登録日時 + */ + public GenTemplateMastersEntity setInsertDatetime(Timestamp insertDatetime) { + this.insertDatetime = insertDatetime; + return this; + } + + /** + * 更新ユーザ を取得する + */ + public Integer getUpdateUser() { + return this.updateUser; + } + /** + * 更新ユーザ を設定する + * @param updateUser 更新ユーザ + */ + public GenTemplateMastersEntity setUpdateUser(Integer updateUser) { + this.updateUser = updateUser; + return this; + } + + /** + * 更新日時 を取得する + */ + public Timestamp getUpdateDatetime() { + return this.updateDatetime; + } + /** + * 更新日時 を設定する + * @param updateDatetime 更新日時 + */ + public GenTemplateMastersEntity setUpdateDatetime(Timestamp updateDatetime) { + this.updateDatetime = updateDatetime; + return this; + } + + /** + * 削除フラグ を取得する + */ + public Integer getDeleteFlag() { + return this.deleteFlag; + } + /** + * 削除フラグ を設定する + * @param deleteFlag 削除フラグ + */ + public GenTemplateMastersEntity setDeleteFlag(Integer deleteFlag) { + this.deleteFlag = deleteFlag; + return this; + } + + /** + * キーの値を取得 + */ + public Object[] getKeyValues() { + Object[] keyValues = new Object[1]; + keyValues[0] = this.typeId; + return keyValues; + } + /** + * キーの値を設定 + * @param typeId テンプレートの種類ID + */ + public void setKeyValues(Integer typeId) { + this.typeId = typeId; + } + /** + * キーで比較 + */ + public boolean equalsOnKey(GenTemplateMastersEntity entity) { + Object[] keyValues1 = getKeyValues(); + Object[] keyValues2 = entity.getKeyValues(); + for (int i = 0; i < keyValues1.length; i++) { + Object val1 = keyValues1[i]; + Object val2 = keyValues2[i]; + if (val1 == null && val2 != null) { + return false; + } + if (val1 != null && val2 == null) { + return false; + } + if (val1 != null && val2 != null) { + if (!val1.equals(val2)) { + return false; + } + } + + } + return true; + } + /** + * ToString + */ + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("typeId = ").append(typeId).append("\n"); + builder.append("typeName = ").append(typeName).append("\n"); + builder.append("typeIcon = ").append(typeIcon).append("\n"); + builder.append("description = ").append(description).append("\n"); + builder.append("insertUser = ").append(insertUser).append("\n"); + builder.append("insertDatetime = ").append(insertDatetime).append("\n"); + builder.append("updateUser = ").append(updateUser).append("\n"); + builder.append("updateDatetime = ").append(updateDatetime).append("\n"); + builder.append("deleteFlag = ").append(deleteFlag).append("\n"); + return builder.toString(); + } + /** + * 表示用の名称を変換 + */ + protected String convLabelName(String label) { + return label; + } + /** + * validate + */ + public List validate() { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.typeId, convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.typeName, convLabelName("Type Name")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(this.typeName, convLabelName("Type Name"), 256); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(this.typeIcon, convLabelName("Type Icon"), 64); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(this.description, convLabelName("Description"), 1024); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.insertUser, convLabelName("Insert User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.updateUser, convLabelName("Update User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.deleteFlag, convLabelName("Delete Flag")); + if (error != null) { + errors.add(error); + } + return errors; + } + /** + * validate + */ + public List validate(Map values) { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("typeId"), convLabelName("Type Id")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("typeName"), convLabelName("Type Name")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(values.get("typeName"), convLabelName("Type Name"), 256); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(values.get("typeIcon"), convLabelName("Type Icon"), 64); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(values.get("description"), convLabelName("Description"), 1024); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("insertUser"), convLabelName("Insert User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("updateUser"), convLabelName("Update User")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("deleteFlag"), convLabelName("Delete Flag")); + if (error != null) { + errors.add(error); + } + return errors; + } + +} diff --git a/src/main/java/org/support/project/knowledge/logic/CrawlerLogic.java b/src/main/java/org/support/project/knowledge/logic/CrawlerLogic.java new file mode 100644 index 000000000..e9454d12d --- /dev/null +++ b/src/main/java/org/support/project/knowledge/logic/CrawlerLogic.java @@ -0,0 +1,540 @@ +package org.support.project.knowledge.logic; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.Charset; +import java.security.InvalidKeyException; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; + +import javax.crypto.BadPaddingException; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.swing.text.MutableAttributeSet; +import javax.swing.text.html.HTML; +import javax.swing.text.html.HTML.Tag; +import javax.swing.text.html.HTMLEditorKit; + +import org.apache.http.Header; +import org.apache.http.HeaderElement; +import org.apache.http.HttpEntity; +import org.apache.http.HttpHost; +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.NameValuePair; +import org.apache.http.StatusLine; +import org.apache.http.auth.AuthScope; +import org.apache.http.auth.Credentials; +import org.apache.http.auth.UsernamePasswordCredentials; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.CredentialsProvider; +import org.apache.http.client.HttpClient; +import org.apache.http.client.ResponseHandler; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.conn.params.ConnRoutePNames; +import org.apache.http.conn.scheme.Scheme; +import org.apache.http.conn.ssl.AllowAllHostnameVerifier; +import org.apache.http.conn.ssl.SSLSocketFactory; +import org.apache.http.conn.ssl.TrustStrategy; +import org.apache.http.conn.ssl.X509HostnameVerifier; +import org.apache.http.entity.BufferedHttpEntity; +import org.apache.http.entity.ContentType; +import org.apache.http.impl.client.BasicCredentialsProvider; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.util.EntityUtils; +import org.apache.tika.mime.MimeType; +import org.apache.tika.mime.MimeTypeException; +import org.apache.tika.mime.MimeTypes; +import org.support.project.common.config.INT_FLAG; +import org.support.project.common.log.Log; +import org.support.project.common.log.LogFactory; +import org.support.project.common.util.FileUtil; +import org.support.project.common.util.PasswordUtil; +import org.support.project.common.util.StringUtils; +import org.support.project.di.Container; +import org.support.project.di.DI; +import org.support.project.di.Instance; +import org.support.project.knowledge.config.AppConfig; +import org.support.project.knowledge.config.AuthType; +import org.support.project.knowledge.parser.Parser; +import org.support.project.knowledge.parser.ParserFactory; +import org.support.project.knowledge.vo.ParseResult; +import org.support.project.web.dao.ProxyConfigsDao; +import org.support.project.web.entity.ProxyConfigsEntity; + +@DI(instance=Instance.Singleton) +public class CrawlerLogic { + /** ログ */ + private static Log log = LogFactory.getLog(CrawlerLogic.class); + + public static CrawlerLogic get() { + return Container.getComp(CrawlerLogic.class); + } + + /** Webで除外するパターン */ + private final static Pattern FILTERS_PATTERN = Pattern.compile( + ".*(\\.(css|js|bmp|gif|jpe?g" + + "|png|tiff?|mid|mp2|mp3|mp4" + // + "|wav|avi|mov|mpeg|ram|m4v|pdf" + + "|wav|avi|mov|mpeg|ram|m4v" + //+ "|rm|smil|wmv|swf|wma|zip|rar|gz))$"); + + "|rm|smil|wmv|swf|wma))$"); + + + + public static void main(String[] args) throws Exception { + CrawlerLogic logic = new CrawlerLogic(); + ProxyConfigsEntity proxyConfig = ProxyConfigsDao.get().selectOnKey(AppConfig.get().getSystemName()); + proxyConfig.setProxyAuthPassword(PasswordUtil.decrypt(proxyConfig.getProxyAuthPassword(), proxyConfig.getProxyAuthSalt())); + logic.crawle(proxyConfig, "http://www.yahoo.co.jp"); + } + + /** HttpClient */ + private HttpClient httpclient = null; + + /** + * URLにある情報を取得 + * @param proxyConfig + * @param url + * @return + * @throws Exception + */ + public String crawle(ProxyConfigsEntity proxyConfig, String url) + throws Exception { + URI uri = new URI(url); + + // HttpClient生成 + this.httpclient = createHttpClient(proxyConfig); + + // Getリクエスト実行 + HttpGet httpGet = new HttpGet(uri); + try { + ResponseHandler responseHandler = new HttpResponseHandler(uri); + HttpResponse response; + try { + response = httpclient.execute(httpGet); + } catch (IllegalStateException e) { + //HttpGetが何らかのエラーを返したので、このアイテムの取得終了 + log.error("http get error. -->" + e.getMessage()); + // HttpClientをクリア + httpGet.abort(); + httpGet.releaseConnection(); + + this.httpclient = null; + return ""; + } + ResponseData responseData = responseHandler.handleResponse(response); + if (responseData.cashed) { + if (log.isDebugEnabled()) { + log.debug("結果" + responseData.cashed); + log.debug("url の情報を取得"); + log.debug(responseData.cashFile.getAbsolutePath()); + log.debug("url のリンク"); + for (URI child : responseData.childLinks) { + log.debug(child); + } + } + + // Tikaでテキスト抽出 + Parser parser = ParserFactory.getParser(responseData.cashFile.getAbsolutePath()); + ParseResult result = parser.parse(responseData.cashFile); + log.debug(result.getText()); + + FileUtil.delete(responseData.cashFile); + + return result.getText(); + } else { + return null; + } + } finally { + if (this.httpclient != null) { + httpGet.abort(); + httpGet.releaseConnection(); + } + } + } + + /** + * HttpClientの生成 + * @return + * @throws KeyStoreException + * @throws IOException + * @throws CertificateException + * @throws NoSuchAlgorithmException + * @throws UnrecoverableKeyException + * @throws KeyManagementException + * @throws BadPaddingException + * @throws IllegalBlockSizeException + * @throws NoSuchPaddingException + * @throws InvalidKeyException + */ + private HttpClient createHttpClient(ProxyConfigsEntity proxyConfig) throws KeyStoreException, NoSuchAlgorithmException, + CertificateException, IOException, KeyManagementException, UnrecoverableKeyException, InvalidKeyException, NoSuchPaddingException, + IllegalBlockSizeException, BadPaddingException { + if (httpclient != null) { + return httpclient; + } + + DefaultHttpClient httpclient = new DefaultHttpClient(); + if (proxyConfig == null) { + this.httpclient = httpclient; + return httpclient; + } + + if (StringUtils.isNotEmpty(proxyConfig.getProxyHostName())) { + HttpHost proxy = new HttpHost(proxyConfig.getProxyHostName(), proxyConfig.getProxyPortNo()); + httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); + CredentialsProvider credsProvider = null; //認証プロバイダー + if (proxyConfig.getProxyAuthType() != null && proxyConfig.getProxyAuthType().intValue() > AuthType.None.getValue()) { + // Proxyに対する認証をセットする + String pass = PasswordUtil.decrypt(proxyConfig.getProxyAuthPassword(), proxyConfig.getProxyAuthSalt()); + credsProvider = new BasicCredentialsProvider(); + credsProvider.setCredentials(new AuthScope(proxyConfig.getProxyHostName(), proxyConfig.getProxyPortNo()), + getCredentials(proxyConfig.getProxyAuthType(), proxyConfig.getProxyAuthUserId(), + pass, proxyConfig.getProxyAuthPcName(), proxyConfig.getProxyAuthDomain())); + httpclient.setCredentialsProvider(credsProvider); + } + } + + if (proxyConfig.getThirdPartyCertificate() != null + && proxyConfig.getThirdPartyCertificate() == INT_FLAG.ON.getValue()) { + // オレオレ証明証でも全てOKにする + TrustStrategy trustStrategy = new TrustStrategy() { + @Override + public boolean isTrusted(X509Certificate[] chain, String authType) + throws CertificateException { + return true; + } + }; + X509HostnameVerifier hostnameVerifier = new AllowAllHostnameVerifier(); + SSLSocketFactory socketFactory = new SSLSocketFactory( + trustStrategy, hostnameVerifier); + + Scheme sch = new Scheme("https", 443, socketFactory); + httpclient.getConnectionManager().getSchemeRegistry().register(sch); + } + + this.httpclient = httpclient; + return httpclient; + } + + /** + * 認証用のCredentialsを生成 + * @param authConfigEntity + * @return + */ + private Credentials getCredentials(int authType, String user, String pass, String pcName, String domain) { + if (authType == AuthType.NTLM.getValue()) { + return new org.apache.http.auth.NTCredentials(user, pass, pcName, domain); + } + return new UsernamePasswordCredentials(user, pass); + + } + + + /** + * ResponseHandlerが返すレスポンスを解析した結果のオブジェクト + * + * @author koda + * + */ + private class ResponseData { + public boolean cashed; + public List childLinks; + public File cashFile; + public String mime; + } + + + /** + * HTTPのレスポンスを処理するResponseHandler + * + * @author koda + * + */ + private class HttpResponseHandler implements ResponseHandler { + private URI uri; + + /** + * @param url + */ + public HttpResponseHandler(URI uri) { + super(); + this.uri = uri; + } + + @Override + public ResponseData handleResponse(HttpResponse response) throws ClientProtocolException, IOException { + ResponseData responseData = new ResponseData(); + responseData.cashed = false; + final List list = new ArrayList<>(); + responseData.childLinks = list; + + debugResponse(response); + + StatusLine statusLine = response.getStatusLine(); + HttpEntity entity = response.getEntity(); + if (statusLine.getStatusCode() >= HttpStatus.SC_MULTIPLE_CHOICES) { + log.error(statusLine.getStatusCode() + ":" + statusLine.getReasonPhrase()); + return responseData; + } + if (entity == null) { + log.error("Response contains no content"); + return responseData; + } + + try { + Header contentsTypeheader = entity.getContentType(); + if (contentsTypeheader == null) { + throw new ClientProtocolException("Unexpected content type: null"); + } + log.debug(contentsTypeheader.toString()); + + ContentType contentType = ContentType.getOrDefault(entity); + responseData.mime = contentType.getMimeType(); + + // 取得した情報をテンポラリ領域にキャッシュする + File tempDir = new File(AppConfig.get().getTmpPath()); + if (!tempDir.exists()) { + tempDir.mkdirs(); + } + //tempDir.createTempFile("tmp", ".tmp", tempDir); + + // BasicHeader header = new BasicHeader("Content-Disposition", "attachment; filename=blah.txt"); + String tempfilename = null; + Header[] headers = response.getHeaders("Content-Disposition"); + for (Header header : headers) { + HeaderElement[] helelms = header.getElements(); + if (helelms.length > 0) { + HeaderElement helem = helelms[0]; + if (helem.getName().equalsIgnoreCase("attachment")) { + NameValuePair nmv = helem.getParameterByName("filename"); + if (nmv != null) { + tempfilename = nmv.getValue(); + } + } + } + } + if (tempfilename == null) { + String path = getPath(uri); + if (path.endsWith("/")) { + // 最後の「/」を消す + path = path.substring(0, path.length() - 1); + } + tempfilename = StringUtils.getFileName(path); + + MimeTypes allTypes = MimeTypes.getDefaultMimeTypes(); + + MimeType mimeType = allTypes.forName(responseData.mime); + String mimeExtention = mimeType.getExtension(); // Mimeから拡張子判定 + + String extention = StringUtils.getExtension(getPath(uri)); //パスから拡張子判定 + if (StringUtils.isEmpty(extention)) { + tempfilename = tempfilename + mimeExtention; + } else { + if (!extention.equals(mimeExtention)) { + tempfilename = tempfilename + mimeExtention; + } + } + } + + File tempFile = new File(tempDir, tempfilename); + + log.debug("cash to " + tempFile.getPath()); + InputStream inputStream = null; + OutputStream outputStream = null; + try { + BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(response.getEntity()); + log.debug("content-length : " + bufHttpEntity.getContentLength()); + + outputStream = new FileOutputStream(tempFile); + // inputStream = new ByteArrayInputStream(EntityUtils.toByteArray(bufHttpEntity)); + FileUtil.copy(bufHttpEntity.getContent(), outputStream); + EntityUtils.consume(entity); + + } finally { + if (inputStream != null) { + inputStream.close(); + } + if (outputStream != null) { + outputStream.close(); + } + } + + responseData.cashFile = tempFile; + responseData.cashed = true; + + if (!contentType.getMimeType().toLowerCase().equals("text/html")) { + // HTMLでない為パースはしない(子のリンクは無し) + return responseData; + } + + // 再帰的に、子のリンクまで処理したい場合、HTMLを解析する + /* + Charset enc = contentType.getCharset(); + if (enc == null) { + enc = Charset.forName("UTF-8"); + } + String charset = enc.name(); + + // HTMLのパースして、子のリンクを格納 + ParserDelegator parserDelegator = new ParserDelegator(); + ParserCallback callback = new ParserCallback(list, uri, enc); + + Reader reader = null; + try { + reader = new BufferedReader(new InputStreamReader(new FileInputStream(tempFile), charset)); + parserDelegator.parse(reader, callback, true); + } finally { + if (reader != null) { + reader.close(); + } + } + */ + } catch (IllegalStateException | MimeTypeException e) { + throw new ClientProtocolException("ParseError.", e); + } finally { + } + return responseData; + } + } + + /** + * Responceのデバッグ + * @param res + */ + private void debugResponse(HttpResponse res) { + if (log.isDebugEnabled()) { + Header[] headers = res.getAllHeaders(); + log.debug("======================================= response header ================================================="); + for (Header header : headers) { + log.debug(header.toString()); + } + log.debug("========================================================================================================="); + } + } + + + /** + * HTMLをパースして、子のリンク情報をchildLinksのリストに格納する + * + * @author koda + */ + private class ParserCallback extends HTMLEditorKit.ParserCallback { + private List childLinks; + private URI uri; + private Charset charset; + + /** + * @param childLinks + * @param charset + */ + public ParserCallback(List childLinks, URI uri, Charset charset) { + super(); + this.childLinks = childLinks; + this.uri = uri; + this.charset = charset; + } + + @Override + public void handleSimpleTag(Tag tag, MutableAttributeSet attr, int pos) { + // 閉じタグを持たない1つだけのタグを処理する + if (tag.equals(HTML.Tag.IMG)) { + //String src = (String) attr.getAttribute(HTML.Attribute.SRC); + } + super.handleSimpleTag(tag, attr, pos); + } + + @Override + public void handleStartTag(Tag tag, MutableAttributeSet attr, int pos) { + // 閉じタグを持ったタグの解した具部分を処理するもので、タグはこれにより処理されます。 + if (tag.equals(HTML.Tag.A)) { + String src = (String) attr.getAttribute(HTML.Attribute.HREF); + if (src == null) { + super.handleStartTag(tag, attr, pos); + return; + } + if (src.startsWith("#")) { + // ページ内リンクなのでリンク一覧に入れない + super.handleStartTag(tag, attr, pos); + return; + } + if (src.equals("/")) { + // "/"だけの場合はリンク一覧に入れない + // ページ内リンクなのでリンク一覧に入れない + super.handleStartTag(tag, attr, pos); + return; + } + try { + URL url = new URL(uri.toURL(), src); + if (shouldVisit(url.toString())) { + URI next = new URI(url.toString()); + childLinks.add(next); + } + } catch (MalformedURLException | URISyntaxException e) { + log.error("URL syntax error." + e.getMessage()); + } + } + super.handleStartTag(tag, attr, pos); + } + } + + /** + * 子のリンクを訪れるかどうかのチェック + * @param url + * @return + */ + private boolean shouldVisit(String url) { + String href = url.toLowerCase(); + + if (href.startsWith("mailto")) { + return false; + } + if (href.startsWith("javascript")) { + return false; + } + boolean visit = !FILTERS_PATTERN.matcher(href).matches() ; + return visit; + } + + /** + * パスの取得 + * パスが無い場合、ホスト名とする + * + * @param uri + * @return + */ + private String getPath(URI uri) { + StringBuilder builder = new StringBuilder(); + builder.append(uri.getScheme()); + builder.append("://"); + if (!StringUtils.isEmpty(uri.getHost())) { + builder.append(uri.getHost()); + if (uri.getPort() > 0) { + builder.append(":"); + builder.append(uri.getPort()); + } + } + if (StringUtils.isNotEmpty(uri.getPath())) { + builder.append(uri.getPath()); + } + return builder.toString(); + } + + + +} diff --git a/src/main/java/org/support/project/knowledge/logic/KnowledgeLogic.java b/src/main/java/org/support/project/knowledge/logic/KnowledgeLogic.java index 6518b514b..dbb31bdfe 100644 --- a/src/main/java/org/support/project/knowledge/logic/KnowledgeLogic.java +++ b/src/main/java/org/support/project/knowledge/logic/KnowledgeLogic.java @@ -25,11 +25,13 @@ import org.support.project.knowledge.dao.KnowledgeFilesDao; import org.support.project.knowledge.dao.KnowledgeGroupsDao; import org.support.project.knowledge.dao.KnowledgeHistoriesDao; +import org.support.project.knowledge.dao.KnowledgeItemValuesDao; import org.support.project.knowledge.dao.KnowledgeTagsDao; import org.support.project.knowledge.dao.KnowledgeUsersDao; import org.support.project.knowledge.dao.KnowledgesDao; import org.support.project.knowledge.dao.LikesDao; import org.support.project.knowledge.dao.TagsDao; +import org.support.project.knowledge.dao.TemplateMastersDao; import org.support.project.knowledge.dao.ViewHistoriesDao; import org.support.project.knowledge.entity.CommentsEntity; import org.support.project.knowledge.entity.KnowledgeEditGroupsEntity; @@ -37,11 +39,14 @@ import org.support.project.knowledge.entity.KnowledgeFilesEntity; import org.support.project.knowledge.entity.KnowledgeGroupsEntity; import org.support.project.knowledge.entity.KnowledgeHistoriesEntity; +import org.support.project.knowledge.entity.KnowledgeItemValuesEntity; import org.support.project.knowledge.entity.KnowledgeTagsEntity; import org.support.project.knowledge.entity.KnowledgeUsersEntity; import org.support.project.knowledge.entity.KnowledgesEntity; import org.support.project.knowledge.entity.LikesEntity; import org.support.project.knowledge.entity.TagsEntity; +import org.support.project.knowledge.entity.TemplateItemsEntity; +import org.support.project.knowledge.entity.TemplateMastersEntity; import org.support.project.knowledge.entity.ViewHistoriesEntity; import org.support.project.knowledge.indexer.IndexingValue; import org.support.project.knowledge.searcher.SearchResultValue; @@ -61,6 +66,9 @@ public class KnowledgeLogic { public static final int PUBLIC_FLAG_PRIVATE = 1; public static final int PUBLIC_FLAG_PROTECT = 2; + public static final int TEMPLATE_TYPE_KNOWLEDGE = -100; + public static final int TEMPLATE_TYPE_BOOKMARK = -99; + public static final int TYPE_KNOWLEDGE = IndexType.knowledge.getValue(); public static final int TYPE_FILE = IndexType.KnowledgeFile.getValue(); public static final int TYPE_COMMENT = IndexType.KnowledgeComment.getValue(); @@ -124,15 +132,17 @@ public List manegeTags(String tags) { * @param entity * @param tags * @param fileNos + * @param targets * @param editors - * @param groups + * @param template * @param loginedUser * @return * @throws Exception */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public KnowledgesEntity insert(KnowledgesEntity entity, List tags, List fileNos, - List targets, List editors, LoginedUser loginedUser) throws Exception { + List targets, List editors, TemplateMastersEntity template, + LoginedUser loginedUser) throws Exception { // ナレッジを登録 entity = knowledgesDao.insert(entity); // アクセス権を登録 @@ -141,19 +151,17 @@ public KnowledgesEntity insert(KnowledgesEntity entity, List tags, L saveEditorsUser(entity, loginedUser, editors); // タグを登録 setTags(entity, tags); - // 添付ファイルを更新(紐付けをセット) fileLogic.setKnowledgeFiles(entity.getKnowledgeId(), fileNos, loginedUser); + // 拡張項目の保存 + saveTemplateItemValue(entity.getKnowledgeId(), template, loginedUser); // 全文検索エンジンへ登録 - saveIndex(entity, tags, targets, loginedUser.getUserId()); - + saveIndex(entity, tags, targets, template, loginedUser.getUserId()); // 一覧表示用の情報を更新 updateKnowledgeExInfo(entity); - // 履歴登録 insertHistory(entity); - // 通知(TODO 別スレッド化を検討) NotifyLogic.get().notifyOnKnowledgeInsert(entity); @@ -166,14 +174,17 @@ public KnowledgesEntity insert(KnowledgesEntity entity, List tags, L * ナレッジを更新 * @param entity * @param fileNos + * @param targets * @param editors + * @param template * @param loginedUser * @return * @throws Exception */ @Aspect(advice=org.support.project.ormapping.transaction.Transaction.class) public KnowledgesEntity update(KnowledgesEntity entity, List tags, List fileNos, - List targets, List editors, LoginedUser loginedUser) throws Exception { + List targets, List editors, TemplateMastersEntity template, + LoginedUser loginedUser) throws Exception { // ナレッッジを更新 entity = knowledgesDao.update(entity); // ユーザのアクセス権を解除 @@ -197,11 +208,14 @@ public KnowledgesEntity update(KnowledgesEntity entity, List tags, L knowledgeTagsDao.deleteOnKnowledgeId(entity.getKnowledgeId()); setTags(entity, tags); + // 拡張項目の保存 + saveTemplateItemValue(entity.getKnowledgeId(), template, loginedUser); + // 添付ファイルを更新(紐付けをセット) fileLogic.setKnowledgeFiles(entity.getKnowledgeId(), fileNos, loginedUser); // 全文検索エンジンへ登録 - saveIndex(entity, tags, targets, entity.getInsertUser()); + saveIndex(entity, tags, targets, template, entity.getInsertUser()); // 一覧表示用の情報を更新 updateKnowledgeExInfo(entity); @@ -215,6 +229,30 @@ public KnowledgesEntity update(KnowledgesEntity entity, List tags, L return entity; } + /** + * テンプレートにある拡張項目値を保存 + * @param knowledgeId + * @param template + * @param loginedUser + */ + private void saveTemplateItemValue(Long knowledgeId, TemplateMastersEntity template, LoginedUser loginedUser) { + if (template == null) { + return; + } + List items = template.getItems(); + if (items == null) { + return; + } + for (TemplateItemsEntity item : items) { + KnowledgeItemValuesEntity val = new KnowledgeItemValuesEntity(); + val.setKnowledgeId(knowledgeId); + val.setTypeId(template.getTypeId()); + val.setItemNo(item.getItemNo()); + val.setItemValue(item.getItemValue()); + val.setItemStatus(KnowledgeItemValuesEntity.STATUS_SAVED); + KnowledgeItemValuesDao.get().save(val); + } + } /** * ナレッジの更新履歴を登録 @@ -337,16 +375,26 @@ private void saveAccessUser(KnowledgesEntity entity, LoginedUser loginedUser, Li * 全文検索エンジンへ保存 * @param entity * @param tags + * @param template * @param groups * @param loginedUser * @throws Exception */ - private void saveIndex(KnowledgesEntity entity, List tags, List targets, Integer creator) throws Exception { + private void saveIndex(KnowledgesEntity entity, List tags, List targets, + TemplateMastersEntity template, Integer creator) throws Exception { IndexingValue indexingValue = new IndexingValue(); indexingValue.setType(TYPE_KNOWLEDGE); indexingValue.setId(String.valueOf(entity.getKnowledgeId())); indexingValue.setTitle(entity.getTitle()); - indexingValue.setContents(entity.getContent()); + + StringBuilder content = new StringBuilder(entity.getContent()); + if (template != null) { + List items = template.getItems(); + for (TemplateItemsEntity item : items) { + content.append(item.getItemName()).append(':').append(item.getItemValue()); + } + } + indexingValue.setContents(content.toString()); indexingValue.addUser(creator); if (entity.getPublicFlag() == null || PUBLIC_FLAG_PUBLIC == entity.getPublicFlag()) { indexingValue.addUser(ALL_USER); @@ -621,6 +669,25 @@ private List getKnowledgeDatas(List list) { entity.setScore(searchResultValue.getScore()); knowledges.add(entity); } + } else if (searchResultValue.getType() == IndexType.bookmarkContent.getValue()) { + // TODO 1件づつ処理しているので、パフォーマンスが悪いので後で処理を検討 + String id = searchResultValue.getId().substring(FileParseBat.WEB_ID_PREFIX.length()); + Long knowledgeId = new Long(id); + KnowledgesEntity entity = knowledgesDao.selectOnKeyWithUserName(knowledgeId); + if (entity != null && entity.getKnowledgeId() != null) { + StringBuilder builder = new StringBuilder(); + builder.append("[Bookmark Content] "); + if (StringUtils.isNotEmpty(searchResultValue.getHighlightedTitle())) { + builder.append(searchResultValue.getHighlightedTitle()); + } + builder.append("
"); + if (StringUtils.isNotEmpty(searchResultValue.getHighlightedContents())) { + builder.append(searchResultValue.getHighlightedContents()); + } + entity.setContent(builder.toString()); + entity.setScore(searchResultValue.getScore()); + knowledges.add(entity); + } } } @@ -642,7 +709,7 @@ private List getKnowledgeDatas(List list) { // /** // * コメントの件数を取得 -// * TODO 再度SQLを実行するのでは無く、ナレッジ取得時にカウントもjoinして取得したほうが早い +// * 再度SQLを実行するのでは無く、ナレッジ取得時にカウントもjoinして取得したほうが早い // * // * @param entity // */ @@ -654,7 +721,7 @@ private List getKnowledgeDatas(List list) { // // /** // * いいねの件数を取得 -// * TODO 再度SQLを実行するのでは無く、ナレッジ取得時にカウントもjoinして取得したほうが早い +// * 再度SQLを実行するのでは無く、ナレッジ取得時にカウントもjoinして取得したほうが早い // * // * @param entity // */ @@ -1063,7 +1130,20 @@ public void reindexing(KnowledgesEntity knowledgesEntity) throws Exception { // ナレッジの情報を検索エンジンへ更新 List tags = tagsDao.selectOnKnowledgeId(knowledgesEntity.getKnowledgeId()); List targets = TargetLogic.get().selectTargetsOnKnowledgeId(knowledgesEntity.getKnowledgeId()); - saveIndex(knowledgesEntity, tags, targets, knowledgesEntity.getInsertUser()); + + // 拡張値を取得 + TemplateMastersEntity template = TemplateMastersDao.get().selectWithItems(knowledgesEntity.getTypeId()); + List items = template.getItems(); + List values = KnowledgeItemValuesDao.get().selectOnKnowledgeId(knowledgesEntity.getKnowledgeId()); + for (TemplateItemsEntity item : items) { + for (KnowledgeItemValuesEntity val : values) { + if (item.getItemNo().equals(val.getItemNo())) { + item.setItemValue(val.getItemValue()); + } + } + } + // インデックス更新 + saveIndex(knowledgesEntity, tags, targets, template, knowledgesEntity.getInsertUser()); // コメントを検索エンジンへ List comments = CommentsDao.get().selectOnKnowledgeId(knowledgesEntity.getKnowledgeId()); diff --git a/src/main/resources/appresource.properties b/src/main/resources/appresource.properties index 022ed4d26..bd4423af1 100644 --- a/src/main/resources/appresource.properties +++ b/src/main/resources/appresource.properties @@ -53,7 +53,7 @@ message.allready.updated=Allready updated. message.allready.started=Allready started. # Common Label -label.version=0.6.0 pre1 +label.version=0.6.0 pre2 label.login=Sign in label.previous = Previous label.next=Next @@ -91,6 +91,10 @@ label.end=End label.stop=Stop label.required=(required) label.comment=Comment +label.host=ホスト +label.port=ポート +label.auth.id=認証用ID +label.auth.password=認証用パスワード label.public.view= [Public] label.protect.view= [Protection] @@ -197,6 +201,7 @@ knowledge.search.placeholder=Search keyword knowledge.search.keyword=Keyword knowledge.search.tags=Tags knowledge.add.title=Add Knowledge +knowledge.add.label.type=Type knowledge.add.label.title=Title knowledge.add.label.content=Content knowledge.add.label.files=Upload files @@ -499,3 +504,20 @@ knowledge.ldap.confirm.delete=Delete. is it OK? knowledge.comment.add=Add Comment knowledge.comment.edit=Edit Comment +knowledge.proxy.title=Proxy Config +knowledge.proxy.auth.none=認証しない +knowledge.proxy.auth.basic=Basic認証 +knowledge.proxy.auth.ntlm=NTLM認証 +knowledge.proxy.auth.ntlm.domain=ドメイン(NTLM認証用) +knowledge.proxy.auth.ntlm.pcname=PC名(NTLM認証用) +knowledge.proxy.testurl=接続確認用URL +knowledge.proxy.test.result=接続確認用URLにアクセスした結果 +knowledge.proxy.test=接続確認テスト +knowledge.proxy.test.fail=接続確認に失敗しました +knowledge.proxy.test.type=接続確認テストの方法 +knowledge.proxy.test.type.proxy=Proxyの設定を使ってテスト +knowledge.proxy.test.type.direct=Proxyを使わずダイレクトに接続するテスト +knowledge.proxy.test.done=URLの内容を取得しました。下部の結果表示を確認してください。 +knowledge.proxy.msg=Knowledgeの種類が「Bookmark」の場合に、登録したURLに書かれた内容を取得します。この際に利用するProxyを設定します。 + + diff --git a/src/main/resources/appresource_ja.properties b/src/main/resources/appresource_ja.properties index b757bfc29..4ce9087c8 100644 --- a/src/main/resources/appresource_ja.properties +++ b/src/main/resources/appresource_ja.properties @@ -53,7 +53,7 @@ message.allready.updated=すでに更新されています message.allready.started=すでに開始済です # Common Label -label.version=0.6.0 pre1 +label.version=0.6.0 pre2 label.login=サインイン label.previous = 前へ label.next = 次へ @@ -91,6 +91,10 @@ label.end=終了 label.stop=停止 label.required=(必須) label.comment=コメント +label.host=ホスト +label.port=ポート +label.auth.id=認証用ID +label.auth.password=認証用パスワード label.public.view= [公開] label.protect.view= [保護] @@ -197,6 +201,7 @@ knowledge.search.placeholder=キーワードでナレッジを検索 knowledge.search.keyword=検索キーワード knowledge.search.tags=検索するタグを指定(AND条件) knowledge.add.title=ナレッジを新規に登録 +knowledge.add.label.type=種類 knowledge.add.label.title=タイトル knowledge.add.label.content=コンテンツ knowledge.add.label.files=ファイルを添付する @@ -498,3 +503,19 @@ knowledge.ldap.confirm.delete=削除します。よろしいですか? knowledge.comment.add=コメント追加 knowledge.comment.edit=コメント編集 + +knowledge.proxy.title=Proxy 設定 +knowledge.proxy.auth.none=認証しない +knowledge.proxy.auth.basic=Basic認証 +knowledge.proxy.auth.ntlm=NTLM認証 +knowledge.proxy.auth.ntlm.domain=ドメイン(NTLM認証用) +knowledge.proxy.auth.ntlm.pcname=PC名(NTLM認証用) +knowledge.proxy.testurl=接続確認用URL +knowledge.proxy.test.result=接続確認用URLにアクセスした結果 +knowledge.proxy.test=接続確認テスト +knowledge.proxy.test.fail=接続確認に失敗しました +knowledge.proxy.test.type=接続確認テストの方法 +knowledge.proxy.test.type.proxy=Proxyの設定を使ってテスト +knowledge.proxy.test.type.direct=Proxyを使わずダイレクトに接続するテスト +knowledge.proxy.test.done=URLの内容を取得しました。下部の結果表示を確認してください。 +knowledge.proxy.msg=Knowledgeの種類が「Bookmark」の場合に、登録したURLに書かれた内容を取得します。この際に利用するProxyを設定します。 diff --git a/src/main/resources/log4j.xml b/src/main/resources/log4j.xml index 5de90db80..f7fc043fa 100644 --- a/src/main/resources/log4j.xml +++ b/src/main/resources/log4j.xml @@ -43,7 +43,7 @@ - + diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_insert.sql index 33e0ffd1d..0571ec0b4 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_insert.sql @@ -3,6 +3,7 @@ INSERT INTO COMMENTS COMMENT_NO , KNOWLEDGE_ID , COMMENT + , COMMENT_STATUS , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -17,4 +18,5 @@ DEFAULT , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_raw_insert.sql index 84df3c317..b14172f60 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_raw_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_raw_insert.sql @@ -3,6 +3,7 @@ INSERT INTO COMMENTS COMMENT_NO , KNOWLEDGE_ID , COMMENT + , COMMENT_STATUS , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -17,4 +18,5 @@ COMMENT_NO , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_update.sql index e6d69874a..108cd8cc0 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_update.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_update.sql @@ -2,6 +2,7 @@ UPDATE COMMENTS SET KNOWLEDGE_ID = ? , COMMENT = ? + , COMMENT_STATUS = ? , INSERT_USER = ? , INSERT_DATETIME = ? , UPDATE_USER = ? diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_delete.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_delete.sql new file mode 100644 index 000000000..448902103 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_delete.sql @@ -0,0 +1,6 @@ +DELETE FROM ITEM_CHOICES +WHERE +CHOICE_NO = ? + AND ITEM_NO = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_insert.sql new file mode 100644 index 000000000..0c43f6d0c --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_insert.sql @@ -0,0 +1,24 @@ +INSERT INTO ITEM_CHOICES +( +CHOICE_NO + , ITEM_NO + , TYPE_ID + , CHOICE_VALUE + , CHOICE_LABEL + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_all.sql new file mode 100644 index 000000000..0fe61267d --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_all.sql @@ -0,0 +1 @@ +SELECT * FROM ITEM_CHOICES; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_choice_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_choice_no.sql new file mode 100644 index 000000000..c92dd8b81 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_choice_no.sql @@ -0,0 +1,5 @@ +SELECT * FROM ITEM_CHOICES + WHERE +CHOICE_NO = ? +; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_item_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_item_no.sql new file mode 100644 index 000000000..d878584c4 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_item_no.sql @@ -0,0 +1,5 @@ +SELECT * FROM ITEM_CHOICES + WHERE +ITEM_NO = ? +; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_key.sql new file mode 100644 index 000000000..e93acfa72 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_key.sql @@ -0,0 +1,6 @@ +SELECT * FROM ITEM_CHOICES + WHERE +CHOICE_NO = ? + AND ITEM_NO = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_type_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_type_id.sql new file mode 100644 index 000000000..d15fd3584 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_physical_select_on_type_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM ITEM_CHOICES + WHERE +TYPE_ID = ? +; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_raw_insert.sql new file mode 100644 index 000000000..0c43f6d0c --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_raw_insert.sql @@ -0,0 +1,24 @@ +INSERT INTO ITEM_CHOICES +( +CHOICE_NO + , ITEM_NO + , TYPE_ID + , CHOICE_VALUE + , CHOICE_LABEL + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_all.sql new file mode 100644 index 000000000..10a0b169f --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_all.sql @@ -0,0 +1,2 @@ +SELECT * FROM ITEM_CHOICES + WHERE DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_choice_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_choice_no.sql new file mode 100644 index 000000000..3fe328741 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_choice_no.sql @@ -0,0 +1,5 @@ +SELECT * FROM ITEM_CHOICES + WHERE +CHOICE_NO = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_item_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_item_no.sql new file mode 100644 index 000000000..566aa3fbc --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_item_no.sql @@ -0,0 +1,5 @@ +SELECT * FROM ITEM_CHOICES + WHERE +ITEM_NO = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_key.sql new file mode 100644 index 000000000..80f7c3a3b --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_key.sql @@ -0,0 +1,7 @@ +SELECT * FROM ITEM_CHOICES + WHERE +CHOICE_NO = ? + AND ITEM_NO = ? + AND TYPE_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_type_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_type_id.sql new file mode 100644 index 000000000..151483d4c --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_select_on_type_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM ITEM_CHOICES + WHERE +TYPE_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_update.sql new file mode 100644 index 000000000..374f0e265 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ItemChoicesDao/ItemChoicesDao_update.sql @@ -0,0 +1,14 @@ +UPDATE ITEM_CHOICES +SET + CHOICE_VALUE = ? + , CHOICE_LABEL = ? + , INSERT_USER = ? + , INSERT_DATETIME = ? + , UPDATE_USER = ? + , UPDATE_DATETIME = ? + , DELETE_FLAG = ? +WHERE +CHOICE_NO = ? + AND ITEM_NO = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_delete.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_delete.sql new file mode 100644 index 000000000..0541157a4 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_delete.sql @@ -0,0 +1,6 @@ +DELETE FROM KNOWLEDGE_ITEM_VALUES +WHERE +ITEM_NO = ? + AND KNOWLEDGE_ID = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_insert.sql new file mode 100644 index 000000000..971666dfa --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_insert.sql @@ -0,0 +1,24 @@ +INSERT INTO KNOWLEDGE_ITEM_VALUES +( +ITEM_NO + , KNOWLEDGE_ID + , TYPE_ID + , ITEM_VALUE + , ITEM_STATUS + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_all.sql new file mode 100644 index 000000000..31b1f4fca --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_all.sql @@ -0,0 +1 @@ +SELECT * FROM KNOWLEDGE_ITEM_VALUES; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_item_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_item_no.sql new file mode 100644 index 000000000..29be1b53e --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_item_no.sql @@ -0,0 +1,5 @@ +SELECT * FROM KNOWLEDGE_ITEM_VALUES + WHERE +ITEM_NO = ? +; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_key.sql new file mode 100644 index 000000000..c880a81f1 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_key.sql @@ -0,0 +1,6 @@ +SELECT * FROM KNOWLEDGE_ITEM_VALUES + WHERE +ITEM_NO = ? + AND KNOWLEDGE_ID = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_knowledge_id.sql new file mode 100644 index 000000000..9ab34ce5e --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_knowledge_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM KNOWLEDGE_ITEM_VALUES + WHERE +KNOWLEDGE_ID = ? +; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_type_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_type_id.sql new file mode 100644 index 000000000..816bc6df1 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_type_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM KNOWLEDGE_ITEM_VALUES + WHERE +TYPE_ID = ? +; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_raw_insert.sql new file mode 100644 index 000000000..971666dfa --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_raw_insert.sql @@ -0,0 +1,24 @@ +INSERT INTO KNOWLEDGE_ITEM_VALUES +( +ITEM_NO + , KNOWLEDGE_ID + , TYPE_ID + , ITEM_VALUE + , ITEM_STATUS + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_all.sql new file mode 100644 index 000000000..4d81093b4 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_all.sql @@ -0,0 +1,2 @@ +SELECT * FROM KNOWLEDGE_ITEM_VALUES + WHERE DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_item_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_item_no.sql new file mode 100644 index 000000000..aefd30039 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_item_no.sql @@ -0,0 +1,5 @@ +SELECT * FROM KNOWLEDGE_ITEM_VALUES + WHERE +ITEM_NO = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_key.sql new file mode 100644 index 000000000..77d850a1c --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_key.sql @@ -0,0 +1,7 @@ +SELECT * FROM KNOWLEDGE_ITEM_VALUES + WHERE +ITEM_NO = ? + AND KNOWLEDGE_ID = ? + AND TYPE_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_knowledge_id.sql new file mode 100644 index 000000000..ae67699e4 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_knowledge_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM KNOWLEDGE_ITEM_VALUES + WHERE +KNOWLEDGE_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_type_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_type_id.sql new file mode 100644 index 000000000..d838bfcdb --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_select_on_type_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM KNOWLEDGE_ITEM_VALUES + WHERE +TYPE_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_update.sql new file mode 100644 index 000000000..51c94e661 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_update.sql @@ -0,0 +1,14 @@ +UPDATE KNOWLEDGE_ITEM_VALUES +SET + ITEM_VALUE = ? + , ITEM_STATUS = ? + , INSERT_USER = ? + , INSERT_DATETIME = ? + , UPDATE_USER = ? + , UPDATE_DATETIME = ? + , DELETE_FLAG = ? +WHERE +ITEM_NO = ? + AND KNOWLEDGE_ID = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_insert.sql index e67ce01da..ab3a5a9f4 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_insert.sql @@ -8,6 +8,7 @@ KNOWLEDGE_ID , TAG_NAMES , LIKE_COUNT , COMMENT_COUNT + , TYPE_ID , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -27,4 +28,5 @@ DEFAULT , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_raw_insert.sql index c38942bce..0ab555637 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_raw_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_raw_insert.sql @@ -8,6 +8,7 @@ KNOWLEDGE_ID , TAG_NAMES , LIKE_COUNT , COMMENT_COUNT + , TYPE_ID , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -27,4 +28,5 @@ KNOWLEDGE_ID , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_update.sql index 78ed56b9c..902e468c2 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_update.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_update.sql @@ -7,6 +7,7 @@ SET , TAG_NAMES = ? , LIKE_COUNT = ? , COMMENT_COUNT = ? + , TYPE_ID = ? , INSERT_USER = ? , INSERT_DATETIME = ? , UPDATE_USER = ? diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_delete.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_delete.sql new file mode 100644 index 000000000..402a94a64 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_delete.sql @@ -0,0 +1,5 @@ +DELETE FROM STOCK_KNOWLEDGES +WHERE +KNOWLEDGE_ID = ? + AND STOCK_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_insert.sql new file mode 100644 index 000000000..60d015c86 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_insert.sql @@ -0,0 +1,20 @@ +INSERT INTO STOCK_KNOWLEDGES +( +KNOWLEDGE_ID + , STOCK_ID + , COMMENT + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_all.sql new file mode 100644 index 000000000..e4fcb651a --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_all.sql @@ -0,0 +1 @@ +SELECT * FROM STOCK_KNOWLEDGES; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_key.sql new file mode 100644 index 000000000..29586d8ef --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_key.sql @@ -0,0 +1,5 @@ +SELECT * FROM STOCK_KNOWLEDGES + WHERE +KNOWLEDGE_ID = ? + AND STOCK_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_knowledge_id.sql new file mode 100644 index 000000000..ecd7f49e4 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_knowledge_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM STOCK_KNOWLEDGES + WHERE +KNOWLEDGE_ID = ? +; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_stock_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_stock_id.sql new file mode 100644 index 000000000..50401cbaf --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_physical_select_on_stock_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM STOCK_KNOWLEDGES + WHERE +STOCK_ID = ? +; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_raw_insert.sql new file mode 100644 index 000000000..60d015c86 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_raw_insert.sql @@ -0,0 +1,20 @@ +INSERT INTO STOCK_KNOWLEDGES +( +KNOWLEDGE_ID + , STOCK_ID + , COMMENT + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_all.sql new file mode 100644 index 000000000..e7083b749 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_all.sql @@ -0,0 +1,2 @@ +SELECT * FROM STOCK_KNOWLEDGES + WHERE DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_key.sql new file mode 100644 index 000000000..812ee23a7 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_key.sql @@ -0,0 +1,6 @@ +SELECT * FROM STOCK_KNOWLEDGES + WHERE +KNOWLEDGE_ID = ? + AND STOCK_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_knowledge_id.sql new file mode 100644 index 000000000..e1537bbab --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_knowledge_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM STOCK_KNOWLEDGES + WHERE +KNOWLEDGE_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_stock_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_stock_id.sql new file mode 100644 index 000000000..02340081f --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_select_on_stock_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM STOCK_KNOWLEDGES + WHERE +STOCK_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_update.sql new file mode 100644 index 000000000..d89e02fd4 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StockKnowledgesDao/StockKnowledgesDao_update.sql @@ -0,0 +1,12 @@ +UPDATE STOCK_KNOWLEDGES +SET + COMMENT = ? + , INSERT_USER = ? + , INSERT_DATETIME = ? + , UPDATE_USER = ? + , UPDATE_DATETIME = ? + , DELETE_FLAG = ? +WHERE +KNOWLEDGE_ID = ? + AND STOCK_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_delete.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_delete.sql index b4df3654f..57fa7e6af 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_delete.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_delete.sql @@ -1,5 +1,4 @@ DELETE FROM STOCKS WHERE -KNOWLEDGE_ID = ? - AND USER_ID = ? +STOCK_ID = ? ; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_insert.sql index abda4712c..df5b3a60e 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_insert.sql @@ -1,15 +1,17 @@ INSERT INTO STOCKS ( -KNOWLEDGE_ID - , USER_ID - , COMMENT +STOCK_ID + , STOCK_NAME + , STOCK_TYPE + , DESCRIPTION , INSERT_USER , INSERT_DATETIME , UPDATE_USER , UPDATE_DATETIME , DELETE_FLAG ) VALUES ( -? +DEFAULT + , ? , ? , ? , ? diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_physical_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_physical_select_on_key.sql index eab28d5a6..5248c709d 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_physical_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_physical_select_on_key.sql @@ -1,5 +1,4 @@ SELECT * FROM STOCKS WHERE -KNOWLEDGE_ID = ? - AND USER_ID = ? +STOCK_ID = ? ; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_raw_insert.sql index abda4712c..dfe55894c 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_raw_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_raw_insert.sql @@ -1,8 +1,9 @@ INSERT INTO STOCKS ( -KNOWLEDGE_ID - , USER_ID - , COMMENT +STOCK_ID + , STOCK_NAME + , STOCK_TYPE + , DESCRIPTION , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -17,4 +18,5 @@ KNOWLEDGE_ID , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_select_on_key.sql index f1cfb80e5..0b7644e43 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_select_on_key.sql @@ -1,6 +1,5 @@ SELECT * FROM STOCKS WHERE -KNOWLEDGE_ID = ? - AND USER_ID = ? +STOCK_ID = ? AND DELETE_FLAG = 0; ; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_update.sql index d864cef69..180cbe549 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_update.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_update.sql @@ -1,12 +1,13 @@ UPDATE STOCKS SET - COMMENT = ? + STOCK_NAME = ? + , STOCK_TYPE = ? + , DESCRIPTION = ? , INSERT_USER = ? , INSERT_DATETIME = ? , UPDATE_USER = ? , UPDATE_DATETIME = ? , DELETE_FLAG = ? WHERE -KNOWLEDGE_ID = ? - AND USER_ID = ? +STOCK_ID = ? ; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_delete.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_delete.sql new file mode 100644 index 000000000..2e13729fb --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_delete.sql @@ -0,0 +1,5 @@ +DELETE FROM TEMPLATE_ITEMS +WHERE +ITEM_NO = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_insert.sql new file mode 100644 index 000000000..1203e2449 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_insert.sql @@ -0,0 +1,22 @@ +INSERT INTO TEMPLATE_ITEMS +( +ITEM_NO + , TYPE_ID + , ITEM_NAME + , ITEM_TYPE + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_all.sql new file mode 100644 index 000000000..567181fcf --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_all.sql @@ -0,0 +1 @@ +SELECT * FROM TEMPLATE_ITEMS; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_item_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_item_no.sql new file mode 100644 index 000000000..270e28109 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_item_no.sql @@ -0,0 +1,5 @@ +SELECT * FROM TEMPLATE_ITEMS + WHERE +ITEM_NO = ? +; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_key.sql new file mode 100644 index 000000000..6eb94e3f6 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_key.sql @@ -0,0 +1,5 @@ +SELECT * FROM TEMPLATE_ITEMS + WHERE +ITEM_NO = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_type_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_type_id.sql new file mode 100644 index 000000000..00dad3849 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_physical_select_on_type_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM TEMPLATE_ITEMS + WHERE +TYPE_ID = ? +; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_raw_insert.sql new file mode 100644 index 000000000..1203e2449 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_raw_insert.sql @@ -0,0 +1,22 @@ +INSERT INTO TEMPLATE_ITEMS +( +ITEM_NO + , TYPE_ID + , ITEM_NAME + , ITEM_TYPE + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_all.sql new file mode 100644 index 000000000..323e804a7 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_all.sql @@ -0,0 +1,2 @@ +SELECT * FROM TEMPLATE_ITEMS + WHERE DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_item_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_item_no.sql new file mode 100644 index 000000000..325e89f84 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_item_no.sql @@ -0,0 +1,5 @@ +SELECT * FROM TEMPLATE_ITEMS + WHERE +ITEM_NO = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_key.sql new file mode 100644 index 000000000..fd85d2d3a --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_key.sql @@ -0,0 +1,6 @@ +SELECT * FROM TEMPLATE_ITEMS + WHERE +ITEM_NO = ? + AND TYPE_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_type_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_type_id.sql new file mode 100644 index 000000000..88f2b5afc --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_select_on_type_id.sql @@ -0,0 +1,5 @@ +SELECT * FROM TEMPLATE_ITEMS + WHERE +TYPE_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_update.sql new file mode 100644 index 000000000..66c1325a0 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateItemsDao/TemplateItemsDao_update.sql @@ -0,0 +1,13 @@ +UPDATE TEMPLATE_ITEMS +SET + ITEM_NAME = ? + , ITEM_TYPE = ? + , INSERT_USER = ? + , INSERT_DATETIME = ? + , UPDATE_USER = ? + , UPDATE_DATETIME = ? + , DELETE_FLAG = ? +WHERE +ITEM_NO = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_delete.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_delete.sql new file mode 100644 index 000000000..4ff7fc294 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_delete.sql @@ -0,0 +1,4 @@ +DELETE FROM TEMPLATE_MASTERS +WHERE +TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_insert.sql new file mode 100644 index 000000000..48ba4feaa --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_insert.sql @@ -0,0 +1,22 @@ +INSERT INTO TEMPLATE_MASTERS +( +TYPE_ID + , TYPE_NAME + , TYPE_ICON + , DESCRIPTION + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +DEFAULT + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_physical_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_physical_select_all.sql new file mode 100644 index 000000000..4ab87afc5 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_physical_select_all.sql @@ -0,0 +1 @@ +SELECT * FROM TEMPLATE_MASTERS; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_physical_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_physical_select_on_key.sql new file mode 100644 index 000000000..f85b9f65e --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_physical_select_on_key.sql @@ -0,0 +1,4 @@ +SELECT * FROM TEMPLATE_MASTERS + WHERE +TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_raw_insert.sql new file mode 100644 index 000000000..0c51f5ecc --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_raw_insert.sql @@ -0,0 +1,22 @@ +INSERT INTO TEMPLATE_MASTERS +( +TYPE_ID + , TYPE_NAME + , TYPE_ICON + , DESCRIPTION + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_select_all.sql new file mode 100644 index 000000000..668b004a8 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_select_all.sql @@ -0,0 +1,2 @@ +SELECT * FROM TEMPLATE_MASTERS + WHERE DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_select_on_key.sql new file mode 100644 index 000000000..da512f65a --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_select_on_key.sql @@ -0,0 +1,5 @@ +SELECT * FROM TEMPLATE_MASTERS + WHERE +TYPE_ID = ? + AND DELETE_FLAG = 0; +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_update.sql new file mode 100644 index 000000000..e3388f0f4 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TemplateMastersDao/TemplateMastersDao_update.sql @@ -0,0 +1,13 @@ +UPDATE TEMPLATE_MASTERS +SET + TYPE_NAME = ? + , TYPE_ICON = ? + , DESCRIPTION = ? + , INSERT_USER = ? + , INSERT_DATETIME = ? + , UPDATE_USER = ? + , UPDATE_DATETIME = ? + , DELETE_FLAG = ? +WHERE +TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/database/ddl.sql b/src/main/resources/org/support/project/knowledge/database/ddl.sql index 90b79a613..5d1c07868 100644 --- a/src/main/resources/org/support/project/knowledge/database/ddl.sql +++ b/src/main/resources/org/support/project/knowledge/database/ddl.sql @@ -1,3 +1,85 @@ +-- ストック +drop table if exists STOCKS cascade; + +create table STOCKS ( + STOCK_ID BIGSERIAL not null + , STOCK_NAME character varying(256) not null + , STOCK_TYPE integer not null + , DESCRIPTION character varying(1024) + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint STOCKS_PKC primary key (STOCK_ID) +) ; + +-- ナレッジの項目値 +drop table if exists KNOWLEDGE_ITEM_VALUES cascade; + +create table KNOWLEDGE_ITEM_VALUES ( + KNOWLEDGE_ID bigint not null + , TYPE_ID integer not null + , ITEM_NO integer not null + , ITEM_VALUE text + , ITEM_STATUS integer not null + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint KNOWLEDGE_ITEM_VALUES_PKC primary key (KNOWLEDGE_ID,TYPE_ID,ITEM_NO) +) ; + +-- 選択肢の値 +drop table if exists ITEM_CHOICES cascade; + +create table ITEM_CHOICES ( + TYPE_ID integer not null + , ITEM_NO integer not null + , CHOICE_NO integer not null + , CHOICE_VALUE character varying(256) not null + , CHOICE_LABEL character varying(256) not null + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint ITEM_CHOICES_PKC primary key (TYPE_ID,ITEM_NO,CHOICE_NO) +) ; + +-- テンプレートのマスタ +drop table if exists TEMPLATE_MASTERS cascade; + +create table TEMPLATE_MASTERS ( + TYPE_ID serial not null + , TYPE_NAME character varying(256) not null + , TYPE_ICON character varying(64) + , DESCRIPTION character varying(1024) + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint TEMPLATE_MASTERS_PKC primary key (TYPE_ID) +) ; + +-- テンプレートの項目 +drop table if exists TEMPLATE_ITEMS cascade; + +create table TEMPLATE_ITEMS ( + TYPE_ID integer not null + , ITEM_NO integer not null + , ITEM_NAME character varying(32) not null + , ITEM_TYPE integer not null + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint TEMPLATE_ITEMS_PKC primary key (TYPE_ID,ITEM_NO) +) ; + -- 編集可能なグループ drop table if exists KNOWLEDGE_EDIT_GROUPS cascade; @@ -131,6 +213,7 @@ create table COMMENTS ( COMMENT_NO BIGSERIAL not null , KNOWLEDGE_ID bigint not null , COMMENT text + , COMMENT_STATUS integer , INSERT_USER integer , INSERT_DATETIME timestamp , UPDATE_USER integer @@ -179,10 +262,10 @@ create index IDX_VIEW_HISTORIES_KNOWLEDGE_ID on VIEW_HISTORIES(KNOWLEDGE_ID); -- ストックしたナレッジ -drop table if exists STOCKS cascade; +drop table if exists STOCK_KNOWLEDGES cascade; -create table STOCKS ( - USER_ID integer not null +create table STOCK_KNOWLEDGES ( + STOCK_ID bigint not null , KNOWLEDGE_ID bigint not null , COMMENT character varying(1024) , INSERT_USER integer @@ -190,7 +273,7 @@ create table STOCKS ( , UPDATE_USER integer , UPDATE_DATETIME timestamp , DELETE_FLAG integer - , constraint STOCKS_PKC primary key (USER_ID,KNOWLEDGE_ID) + , constraint STOCK_KNOWLEDGES_PKC primary key (STOCK_ID,KNOWLEDGE_ID) ) ; -- アクセス可能なグループ @@ -283,6 +366,7 @@ create table KNOWLEDGES ( , TAG_NAMES text , LIKE_COUNT bigint , COMMENT_COUNT integer + , TYPE_ID integer , INSERT_USER integer , INSERT_DATETIME timestamp , UPDATE_USER integer @@ -291,6 +375,63 @@ create table KNOWLEDGES ( , constraint KNOWLEDGES_PKC primary key (KNOWLEDGE_ID) ) ; +comment on table STOCKS is 'ストック'; +comment on column STOCKS.STOCK_ID is 'STOCK ID'; +comment on column STOCKS.STOCK_NAME is 'STOCK 名'; +comment on column STOCKS.STOCK_TYPE is '区分'; +comment on column STOCKS.DESCRIPTION is '説明'; +comment on column STOCKS.INSERT_USER is '登録ユーザ'; +comment on column STOCKS.INSERT_DATETIME is '登録日時'; +comment on column STOCKS.UPDATE_USER is '更新ユーザ'; +comment on column STOCKS.UPDATE_DATETIME is '更新日時'; +comment on column STOCKS.DELETE_FLAG is '削除フラグ'; + +comment on table KNOWLEDGE_ITEM_VALUES is 'ナレッジの項目値'; +comment on column KNOWLEDGE_ITEM_VALUES.KNOWLEDGE_ID is 'ナレッジID'; +comment on column KNOWLEDGE_ITEM_VALUES.TYPE_ID is 'テンプレートの種類ID'; +comment on column KNOWLEDGE_ITEM_VALUES.ITEM_NO is '項目NO'; +comment on column KNOWLEDGE_ITEM_VALUES.ITEM_VALUE is '項目値'; +comment on column KNOWLEDGE_ITEM_VALUES.ITEM_STATUS is 'ステータス'; +comment on column KNOWLEDGE_ITEM_VALUES.INSERT_USER is '登録ユーザ'; +comment on column KNOWLEDGE_ITEM_VALUES.INSERT_DATETIME is '登録日時'; +comment on column KNOWLEDGE_ITEM_VALUES.UPDATE_USER is '更新ユーザ'; +comment on column KNOWLEDGE_ITEM_VALUES.UPDATE_DATETIME is '更新日時'; +comment on column KNOWLEDGE_ITEM_VALUES.DELETE_FLAG is '削除フラグ'; + +comment on table ITEM_CHOICES is '選択肢の値'; +comment on column ITEM_CHOICES.TYPE_ID is 'テンプレートの種類ID'; +comment on column ITEM_CHOICES.ITEM_NO is '項目NO'; +comment on column ITEM_CHOICES.CHOICE_NO is '選択肢番号'; +comment on column ITEM_CHOICES.CHOICE_VALUE is '選択肢値'; +comment on column ITEM_CHOICES.CHOICE_LABEL is '選択肢ラベル'; +comment on column ITEM_CHOICES.INSERT_USER is '登録ユーザ'; +comment on column ITEM_CHOICES.INSERT_DATETIME is '登録日時'; +comment on column ITEM_CHOICES.UPDATE_USER is '更新ユーザ'; +comment on column ITEM_CHOICES.UPDATE_DATETIME is '更新日時'; +comment on column ITEM_CHOICES.DELETE_FLAG is '削除フラグ'; + +comment on table TEMPLATE_MASTERS is 'テンプレートのマスタ'; +comment on column TEMPLATE_MASTERS.TYPE_ID is 'テンプレートの種類ID'; +comment on column TEMPLATE_MASTERS.TYPE_NAME is 'テンプレート名'; +comment on column TEMPLATE_MASTERS.TYPE_ICON is 'アイコン'; +comment on column TEMPLATE_MASTERS.DESCRIPTION is '説明'; +comment on column TEMPLATE_MASTERS.INSERT_USER is '登録ユーザ'; +comment on column TEMPLATE_MASTERS.INSERT_DATETIME is '登録日時'; +comment on column TEMPLATE_MASTERS.UPDATE_USER is '更新ユーザ'; +comment on column TEMPLATE_MASTERS.UPDATE_DATETIME is '更新日時'; +comment on column TEMPLATE_MASTERS.DELETE_FLAG is '削除フラグ'; + +comment on table TEMPLATE_ITEMS is 'テンプレートの項目'; +comment on column TEMPLATE_ITEMS.TYPE_ID is 'テンプレートの種類ID'; +comment on column TEMPLATE_ITEMS.ITEM_NO is '項目NO'; +comment on column TEMPLATE_ITEMS.ITEM_NAME is '項目名'; +comment on column TEMPLATE_ITEMS.ITEM_TYPE is '項目の種類'; +comment on column TEMPLATE_ITEMS.INSERT_USER is '登録ユーザ'; +comment on column TEMPLATE_ITEMS.INSERT_DATETIME is '登録日時'; +comment on column TEMPLATE_ITEMS.UPDATE_USER is '更新ユーザ'; +comment on column TEMPLATE_ITEMS.UPDATE_DATETIME is '更新日時'; +comment on column TEMPLATE_ITEMS.DELETE_FLAG is '削除フラグ'; + comment on table KNOWLEDGE_EDIT_GROUPS is '編集可能なグループ'; comment on column KNOWLEDGE_EDIT_GROUPS.KNOWLEDGE_ID is 'ナレッジID'; comment on column KNOWLEDGE_EDIT_GROUPS.GROUP_ID is 'GROUP_ID'; @@ -380,6 +521,7 @@ comment on table COMMENTS is 'コメント'; comment on column COMMENTS.COMMENT_NO is 'コメント番号'; comment on column COMMENTS.KNOWLEDGE_ID is 'ナレッジID'; comment on column COMMENTS.COMMENT is 'コメント'; +comment on column COMMENTS.COMMENT_STATUS is 'ステータス'; comment on column COMMENTS.INSERT_USER is '登録ユーザ'; comment on column COMMENTS.INSERT_DATETIME is '登録日時'; comment on column COMMENTS.UPDATE_USER is '更新ユーザ'; @@ -406,15 +548,15 @@ comment on column VIEW_HISTORIES.UPDATE_USER is '更新ユーザ'; comment on column VIEW_HISTORIES.UPDATE_DATETIME is '更新日時'; comment on column VIEW_HISTORIES.DELETE_FLAG is '削除フラグ'; -comment on table STOCKS is 'ストックしたナレッジ'; -comment on column STOCKS.USER_ID is 'USER_ID'; -comment on column STOCKS.KNOWLEDGE_ID is 'ナレッジID'; -comment on column STOCKS.COMMENT is 'コメント'; -comment on column STOCKS.INSERT_USER is '登録ユーザ'; -comment on column STOCKS.INSERT_DATETIME is '登録日時'; -comment on column STOCKS.UPDATE_USER is '更新ユーザ'; -comment on column STOCKS.UPDATE_DATETIME is '更新日時'; -comment on column STOCKS.DELETE_FLAG is '削除フラグ'; +comment on table STOCK_KNOWLEDGES is 'ストックしたナレッジ'; +comment on column STOCK_KNOWLEDGES.STOCK_ID is 'STOCK ID'; +comment on column STOCK_KNOWLEDGES.KNOWLEDGE_ID is 'ナレッジID'; +comment on column STOCK_KNOWLEDGES.COMMENT is 'コメント'; +comment on column STOCK_KNOWLEDGES.INSERT_USER is '登録ユーザ'; +comment on column STOCK_KNOWLEDGES.INSERT_DATETIME is '登録日時'; +comment on column STOCK_KNOWLEDGES.UPDATE_USER is '更新ユーザ'; +comment on column STOCK_KNOWLEDGES.UPDATE_DATETIME is '更新日時'; +comment on column STOCK_KNOWLEDGES.DELETE_FLAG is '削除フラグ'; comment on table KNOWLEDGE_GROUPS is 'アクセス可能なグループ'; comment on column KNOWLEDGE_GROUPS.KNOWLEDGE_ID is 'ナレッジID'; @@ -475,6 +617,7 @@ comment on column KNOWLEDGES.TAG_IDS is 'タグID一覧'; comment on column KNOWLEDGES.TAG_NAMES is 'タグ名称一覧'; comment on column KNOWLEDGES.LIKE_COUNT is 'いいね件数'; comment on column KNOWLEDGES.COMMENT_COUNT is 'コメント件数'; +comment on column KNOWLEDGES.TYPE_ID is 'テンプレートの種類ID'; comment on column KNOWLEDGES.INSERT_USER is '登録ユーザ'; comment on column KNOWLEDGES.INSERT_DATETIME is '登録日時'; comment on column KNOWLEDGES.UPDATE_USER is '更新ユーザ'; diff --git a/src/main/resources/org/support/project/knowledge/database/init_datas.sql b/src/main/resources/org/support/project/knowledge/database/init_datas.sql index b0f9475a5..47b41a425 100644 --- a/src/main/resources/org/support/project/knowledge/database/init_datas.sql +++ b/src/main/resources/org/support/project/knowledge/database/init_datas.sql @@ -3,4 +3,15 @@ INSERT INTO GROUPS INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG ) VALUES (0,'g-all','ALL USERS','全てのユーザが所属するグループ',null,0,'g-all',0,'2015-07-04 00:00:00',null,null,0); - \ No newline at end of file + +INSERT INTO TEMPLATE_MASTERS ( TYPE_ID, TYPE_NAME, TYPE_ICON, DESCRIPTION, INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG ) +VALUES +(-100,'knowledge', 'fa-book', '通常のナレッジ。設定は変更できません。',0,'2015-09-09 00:00:00',null,null,0); + +INSERT INTO TEMPLATE_MASTERS ( TYPE_ID, TYPE_NAME, TYPE_ICON, DESCRIPTION, INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG ) +VALUES +(-99,'bookmark', 'fa-bookmark', 'Webにある情報を共有します。登録したURLの内容を検索可能にします。設定は変更できません。(監理者はProxyの設定を行ってください)',0,'2015-09-09 00:00:00',null,null,0); + +INSERT INTO TEMPLATE_ITEMS ( TYPE_ID, ITEM_NO, ITEM_NAME, ITEM_TYPE, INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG ) +VALUES +(-99,0,'URL',0,0,'2015-09-09 00:00:00',null,null,0); diff --git a/src/main/resources/org/support/project/knowledge/deploy/v0_6_0pre2/migrate.sql b/src/main/resources/org/support/project/knowledge/deploy/v0_6_0pre2/migrate.sql new file mode 100644 index 000000000..3563bf737 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/deploy/v0_6_0pre2/migrate.sql @@ -0,0 +1,246 @@ +-- プロキシ設定 +drop table if exists PROXY_CONFIGS cascade; + +create table PROXY_CONFIGS ( + SYSTEM_NAME character varying(64) not null + , PROXY_HOST_NAME character varying(256) not null + , PROXY_PORT_NO integer not null + , PROXY_AUTH_TYPE integer not null + , PROXY_AUTH_USER_ID character varying(256) + , PROXY_AUTH_PASSWORD character varying(1024) + , PROXY_AUTH_SALT character varying(1024) + , PROXY_AUTH_PC_NAME character varying(256) + , PROXY_AUTH_DOMAIN character varying(256) + , THIRD_PARTY_CERTIFICATE integer + , TEST_URL character varying(256) + , ROW_ID character varying(64) + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint PROXY_CONFIGS_PKC primary key (SYSTEM_NAME) +) ; + +comment on table PROXY_CONFIGS is 'プロキシ設定'; +comment on column PROXY_CONFIGS.SYSTEM_NAME is 'システム名'; +comment on column PROXY_CONFIGS.PROXY_HOST_NAME is '[Proxy]ホスト名'; +comment on column PROXY_CONFIGS.PROXY_PORT_NO is '[Proxy]ポート番号'; +comment on column PROXY_CONFIGS.PROXY_AUTH_TYPE is '[Proxy-Auth]認証タイプ'; +comment on column PROXY_CONFIGS.PROXY_AUTH_USER_ID is '[Proxy-Auth]認証ユーザID'; +comment on column PROXY_CONFIGS.PROXY_AUTH_PASSWORD is '[Proxy-Auth]認証パスワード'; +comment on column PROXY_CONFIGS.PROXY_AUTH_SALT is '[Proxy-Auth]認証SALT'; +comment on column PROXY_CONFIGS.PROXY_AUTH_PC_NAME is '[Proxy-Auth-NTLM]認証PC名'; +comment on column PROXY_CONFIGS.PROXY_AUTH_DOMAIN is '[Auth-NTLM]認証ドメイン'; +comment on column PROXY_CONFIGS.THIRD_PARTY_CERTIFICATE is '[Web]SSL証明書チェック'; +comment on column PROXY_CONFIGS.TEST_URL is '[Web]接続確認用URL'; +comment on column PROXY_CONFIGS.ROW_ID is '行ID'; +comment on column PROXY_CONFIGS.INSERT_USER is '登録ユーザ'; +comment on column PROXY_CONFIGS.INSERT_DATETIME is '登録日時'; +comment on column PROXY_CONFIGS.UPDATE_USER is '更新ユーザ'; +comment on column PROXY_CONFIGS.UPDATE_DATETIME is '更新日時'; +comment on column PROXY_CONFIGS.DELETE_FLAG is '削除フラグ'; + + + + + + + + +-- ストック +drop table if exists STOCKS cascade; + +create table STOCKS ( + STOCK_ID BIGSERIAL not null + , STOCK_NAME character varying(256) not null + , STOCK_TYPE integer not null + , DESCRIPTION character varying(1024) + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint STOCKS_PKC primary key (STOCK_ID) +) ; + +-- ナレッジの項目値 +drop table if exists KNOWLEDGE_ITEM_VALUES cascade; + +create table KNOWLEDGE_ITEM_VALUES ( + KNOWLEDGE_ID bigint not null + , TYPE_ID integer not null + , ITEM_NO integer not null + , ITEM_VALUE text + , ITEM_STATUS integer not null + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint KNOWLEDGE_ITEM_VALUES_PKC primary key (KNOWLEDGE_ID,TYPE_ID,ITEM_NO) +) ; + +-- 選択肢の値 +drop table if exists ITEM_CHOICES cascade; + +create table ITEM_CHOICES ( + TYPE_ID integer not null + , ITEM_NO integer not null + , CHOICE_NO integer not null + , CHOICE_VALUE character varying(256) not null + , CHOICE_LABEL character varying(256) not null + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint ITEM_CHOICES_PKC primary key (TYPE_ID,ITEM_NO,CHOICE_NO) +) ; + +-- テンプレートのマスタ +drop table if exists TEMPLATE_MASTERS cascade; + +create table TEMPLATE_MASTERS ( + TYPE_ID serial not null + , TYPE_NAME character varying(256) not null + , TYPE_ICON character varying(64) + , DESCRIPTION character varying(1024) + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint TEMPLATE_MASTERS_PKC primary key (TYPE_ID) +) ; + +-- テンプレートの項目 +drop table if exists TEMPLATE_ITEMS cascade; + +create table TEMPLATE_ITEMS ( + TYPE_ID integer not null + , ITEM_NO integer not null + , ITEM_NAME character varying(32) not null + , ITEM_TYPE integer not null + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint TEMPLATE_ITEMS_PKC primary key (TYPE_ID,ITEM_NO) +) ; + + +-- ストックしたナレッジ +drop table if exists STOCK_KNOWLEDGES cascade; + +create table STOCK_KNOWLEDGES ( + STOCK_ID bigint not null + , KNOWLEDGE_ID bigint not null + , COMMENT character varying(1024) + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint STOCK_KNOWLEDGES_PKC primary key (STOCK_ID,KNOWLEDGE_ID) +) ; + +comment on table STOCKS is 'ストック'; +comment on column STOCKS.STOCK_ID is 'STOCK ID'; +comment on column STOCKS.STOCK_NAME is 'STOCK 名'; +comment on column STOCKS.STOCK_TYPE is '区分'; +comment on column STOCKS.DESCRIPTION is '説明'; +comment on column STOCKS.INSERT_USER is '登録ユーザ'; +comment on column STOCKS.INSERT_DATETIME is '登録日時'; +comment on column STOCKS.UPDATE_USER is '更新ユーザ'; +comment on column STOCKS.UPDATE_DATETIME is '更新日時'; +comment on column STOCKS.DELETE_FLAG is '削除フラグ'; + +comment on table KNOWLEDGE_ITEM_VALUES is 'ナレッジの項目値'; +comment on column KNOWLEDGE_ITEM_VALUES.KNOWLEDGE_ID is 'ナレッジID'; +comment on column KNOWLEDGE_ITEM_VALUES.TYPE_ID is 'テンプレートの種類ID'; +comment on column KNOWLEDGE_ITEM_VALUES.ITEM_NO is '項目NO'; +comment on column KNOWLEDGE_ITEM_VALUES.ITEM_VALUE is '項目値'; +comment on column KNOWLEDGE_ITEM_VALUES.ITEM_STATUS is 'ステータス'; +comment on column KNOWLEDGE_ITEM_VALUES.INSERT_USER is '登録ユーザ'; +comment on column KNOWLEDGE_ITEM_VALUES.INSERT_DATETIME is '登録日時'; +comment on column KNOWLEDGE_ITEM_VALUES.UPDATE_USER is '更新ユーザ'; +comment on column KNOWLEDGE_ITEM_VALUES.UPDATE_DATETIME is '更新日時'; +comment on column KNOWLEDGE_ITEM_VALUES.DELETE_FLAG is '削除フラグ'; + +comment on table ITEM_CHOICES is '選択肢の値'; +comment on column ITEM_CHOICES.TYPE_ID is 'テンプレートの種類ID'; +comment on column ITEM_CHOICES.ITEM_NO is '項目NO'; +comment on column ITEM_CHOICES.CHOICE_NO is '選択肢番号'; +comment on column ITEM_CHOICES.CHOICE_VALUE is '選択肢値'; +comment on column ITEM_CHOICES.CHOICE_LABEL is '選択肢ラベル'; +comment on column ITEM_CHOICES.INSERT_USER is '登録ユーザ'; +comment on column ITEM_CHOICES.INSERT_DATETIME is '登録日時'; +comment on column ITEM_CHOICES.UPDATE_USER is '更新ユーザ'; +comment on column ITEM_CHOICES.UPDATE_DATETIME is '更新日時'; +comment on column ITEM_CHOICES.DELETE_FLAG is '削除フラグ'; + +comment on table TEMPLATE_MASTERS is 'テンプレートのマスタ'; +comment on column TEMPLATE_MASTERS.TYPE_ID is 'テンプレートの種類ID'; +comment on column TEMPLATE_MASTERS.TYPE_NAME is 'テンプレート名'; +comment on column TEMPLATE_MASTERS.TYPE_ICON is 'アイコン'; +comment on column TEMPLATE_MASTERS.DESCRIPTION is '説明'; +comment on column TEMPLATE_MASTERS.INSERT_USER is '登録ユーザ'; +comment on column TEMPLATE_MASTERS.INSERT_DATETIME is '登録日時'; +comment on column TEMPLATE_MASTERS.UPDATE_USER is '更新ユーザ'; +comment on column TEMPLATE_MASTERS.UPDATE_DATETIME is '更新日時'; +comment on column TEMPLATE_MASTERS.DELETE_FLAG is '削除フラグ'; + +comment on table TEMPLATE_ITEMS is 'テンプレートの項目'; +comment on column TEMPLATE_ITEMS.TYPE_ID is 'テンプレートの種類ID'; +comment on column TEMPLATE_ITEMS.ITEM_NO is '項目NO'; +comment on column TEMPLATE_ITEMS.ITEM_NAME is '項目名'; +comment on column TEMPLATE_ITEMS.ITEM_TYPE is '項目の種類'; +comment on column TEMPLATE_ITEMS.INSERT_USER is '登録ユーザ'; +comment on column TEMPLATE_ITEMS.INSERT_DATETIME is '登録日時'; +comment on column TEMPLATE_ITEMS.UPDATE_USER is '更新ユーザ'; +comment on column TEMPLATE_ITEMS.UPDATE_DATETIME is '更新日時'; +comment on column TEMPLATE_ITEMS.DELETE_FLAG is '削除フラグ'; + + +comment on table STOCK_KNOWLEDGES is 'ストックしたナレッジ'; +comment on column STOCK_KNOWLEDGES.STOCK_ID is 'STOCK ID'; +comment on column STOCK_KNOWLEDGES.KNOWLEDGE_ID is 'ナレッジID'; +comment on column STOCK_KNOWLEDGES.COMMENT is 'コメント'; +comment on column STOCK_KNOWLEDGES.INSERT_USER is '登録ユーザ'; +comment on column STOCK_KNOWLEDGES.INSERT_DATETIME is '登録日時'; +comment on column STOCK_KNOWLEDGES.UPDATE_USER is '更新ユーザ'; +comment on column STOCK_KNOWLEDGES.UPDATE_DATETIME is '更新日時'; +comment on column STOCK_KNOWLEDGES.DELETE_FLAG is '削除フラグ'; + + +ALTER TABLE COMMENTS DROP COLUMN IF EXISTS COMMENT_STATUS; +ALTER TABLE KNOWLEDGES DROP COLUMN IF EXISTS TYPE_ID; +ALTER TABLE COMMENTS ADD COLUMN COMMENT_STATUS integer; +ALTER TABLE KNOWLEDGES ADD COLUMN TYPE_ID integer; + +comment on column COMMENTS.COMMENT_STATUS is 'ステータス'; +comment on column KNOWLEDGES.TYPE_ID is 'テンプレートの種類ID'; + + + + +DELETE FROM TEMPLATE_MASTERS WHERE TYPE_ID = -100; +DELETE FROM TEMPLATE_ITEMS WHERE TYPE_ID = -100; +DELETE FROM TEMPLATE_MASTERS WHERE TYPE_ID = -99; +DELETE FROM TEMPLATE_ITEMS WHERE TYPE_ID = -99; + +INSERT INTO TEMPLATE_MASTERS ( TYPE_ID, TYPE_NAME, TYPE_ICON, DESCRIPTION, INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG ) +VALUES +(-100,'knowledge', 'fa-book', '通常のナレッジ。設定は変更できません。',0,'2015-09-09 00:00:00',null,null,0); + +INSERT INTO TEMPLATE_MASTERS ( TYPE_ID, TYPE_NAME, TYPE_ICON, DESCRIPTION, INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG ) +VALUES +(-99,'bookmark', 'fa-bookmark', 'Webにある情報を共有します。登録したURLの内容を検索可能にします。設定は変更できません。(監理者はProxyの設定を行ってください)',0,'2015-09-09 00:00:00',null,null,0); + +INSERT INTO TEMPLATE_ITEMS ( TYPE_ID, ITEM_NO, ITEM_NAME, ITEM_TYPE, INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG ) +VALUES +(-99,0,'URL',0,0,'2015-09-09 00:00:00',null,null,0); + +UPDATE KNOWLEDGES SET TYPE_ID = -100; diff --git a/src/main/webapp/WEB-INF/views/admin/proxy/config.jsp b/src/main/webapp/WEB-INF/views/admin/proxy/config.jsp new file mode 100644 index 000000000..44ad0a089 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/admin/proxy/config.jsp @@ -0,0 +1,144 @@ +<%@page import="org.support.project.common.util.StringUtils"%> +<%@page import="org.support.project.knowledge.config.AuthType"%> +<%@page import="org.support.project.knowledge.config.SystemConfig"%> +<%@page import="org.support.project.common.config.INT_FLAG"%> +<%@page import="org.support.project.knowledge.vo.Roles"%> +<%@page import="org.support.project.web.util.JspUtil"%> +<%@page pageEncoding="UTF-8" isELIgnored="false" session="false" errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> +<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> + +<% JspUtil jspUtil = new JspUtil(request, pageContext); %> + + + + + + + + + + + + + + +

<%= jspUtil.label("knowledge.proxy.title") %>

+ + + + +
+
+ + " /> +
+
+ + " /> +
+
+
+ + + +
+
+ + " /> +
+
+ + " /> +
+
+ + " /> +
+
+ + " /> +
+ + +
+
+ + +
+ + +
+ + " /> +
+ + " /> + + + + + + +
+ + +<% if (StringUtils.isNotEmpty(jspUtil.getValue("content", String.class))) { %> +

+<%= jspUtil.label("knowledge.proxy.test.result") %> +
+<%= jspUtil.out("content", JspUtil.ESCAPE_HTML) %> +
+<% } %> + +
+ +
+ diff --git a/src/main/webapp/WEB-INF/views/commons/layout/commonNavbar.jsp b/src/main/webapp/WEB-INF/views/commons/layout/commonNavbar.jsp index 27a18e14b..09e01c182 100644 --- a/src/main/webapp/WEB-INF/views/commons/layout/commonNavbar.jsp +++ b/src/main/webapp/WEB-INF/views/commons/layout/commonNavbar.jsp @@ -138,6 +138,11 @@  <%= jspUtil.label("knowledge.ldap.title") %>
+
  • + +  <%= jspUtil.label("knowledge.proxy.title") %> + +
  • diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/view.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/view.jsp index 93a2fbfc2..0487c5c6b 100644 --- a/src/main/webapp/WEB-INF/views/open/knowledge/view.jsp +++ b/src/main/webapp/WEB-INF/views/open/knowledge/view.jsp @@ -58,47 +58,7 @@ Knowledge - [<%= jspUtil.out("knowledgeId") %>] <%= jspUtil.out("title", JspUtil
    -<%-- ナレッジの属性 --%> - -

    - " disabled="disabled"/> -

    -
    - -

    - -

    - -

    - <%= jspUtil.is(String.valueOf(KnowledgeLogic.PUBLIC_FLAG_PUBLIC), "publicFlag", - jspUtil.label("label.public.view")) %> - <%= jspUtil.is(String.valueOf(KnowledgeLogic.PUBLIC_FLAG_PRIVATE), "publicFlag", - jspUtil.label("label.private.view")) %> - - <% if(jspUtil.is(String.valueOf(KnowledgeLogic.PUBLIC_FLAG_PROTECT), "publicFlag")) { %> - - - <% } %> - -<%-- イイネ!など --%> - <%= jspUtil.out("params") %>" > -   - × <%= jspUtil.out("like_count") %> - - - -   - × <%= jspUtil.out("comments.size()") %> - -

    - - +<%-- 登録者情報 --%>
    [<%= jspUtil.label("label.registration") %>] @@ -131,6 +91,40 @@ Knowledge - [<%= jspUtil.out("knowledgeId") %>] <%= jspUtil.out("title", JspUtil
    +<%-- 公開区分やイイネ件数など --%> +

    + <%= jspUtil.is(String.valueOf(KnowledgeLogic.PUBLIC_FLAG_PUBLIC), "publicFlag", + jspUtil.label("label.public.view")) %> + <%= jspUtil.is(String.valueOf(KnowledgeLogic.PUBLIC_FLAG_PRIVATE), "publicFlag", + jspUtil.label("label.private.view")) %> + + <% if(jspUtil.is(String.valueOf(KnowledgeLogic.PUBLIC_FLAG_PROTECT), "publicFlag")) { %> + + + <% } %> + + <%= jspUtil.out("params") %>" > +   + × <%= jspUtil.out("like_count") %> + + + +   + × <%= jspUtil.out("comments.size()") %> + +

    + +<%-- タグ --%> + +

    + " disabled="disabled"/> +

    +
    + + <%-- 添付ファイル --%> @@ -144,16 +138,29 @@ Knowledge - [<%= jspUtil.out("knowledgeId") %>] <%= jspUtil.out("title", JspUtil <%-- ナレッジ表示 --%> -
    - <%= jspUtil.out("content", JspUtil.ESCAPE_NONE) %> +
    + " /> + " /> + +
    + +
    + <%= jspUtil.out("content", JspUtil.ESCAPE_NONE) %> +
    <%-- 操作ボタン --%> + + <% if (request.getRemoteUser() != null) { if ((boolean) request.getAttribute("edit")) { %> <%= jspUtil.out("params") %>" diff --git a/src/main/webapp/WEB-INF/views/protect/knowledge/view_add.jsp b/src/main/webapp/WEB-INF/views/protect/knowledge/view_add.jsp index 37bdcb560..9fe39c0e9 100644 --- a/src/main/webapp/WEB-INF/views/protect/knowledge/view_add.jsp +++ b/src/main/webapp/WEB-INF/views/protect/knowledge/view_add.jsp @@ -1,3 +1,4 @@ +<%@page import="org.support.project.common.util.StringUtils"%> <%@page import="org.support.project.knowledge.logic.KnowledgeLogic"%> <%@page import="org.support.project.web.util.JspUtil"%> <%@page pageEncoding="UTF-8" isELIgnored="false" session="false" errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> @@ -58,11 +59,31 @@ _TAGS.push('<%= jspUtil.out("tagitem.tagName") %>');

    <%= jspUtil.label("knowledge.add.title") %>

    - + + +
    +
    + + + +
    + +
    " value="<%= jspUtil.out("title") %>">
    + +
    + +
    +
    +
    -
    - -  <%= jspUtil.label("knowledge.add.label.select.file") %> - - + + +  <%= jspUtil.label("knowledge.add.label.select.file") %> + +
    @@ -116,6 +141,7 @@ _TAGS.push('<%= jspUtil.out("tagitem.tagName") %>');
    +

    + " /> " /> " /> " /> - + + +
    <%= jspUtil.out("params") %>" diff --git a/src/main/webapp/WEB-INF/views/protect/knowledge/view_edit.jsp b/src/main/webapp/WEB-INF/views/protect/knowledge/view_edit.jsp index 7ebe3faa7..ec92d089b 100644 --- a/src/main/webapp/WEB-INF/views/protect/knowledge/view_edit.jsp +++ b/src/main/webapp/WEB-INF/views/protect/knowledge/view_edit.jsp @@ -1,3 +1,4 @@ +<%@page import="org.support.project.common.util.StringUtils"%> <%@page import="org.support.project.knowledge.logic.KnowledgeLogic"%> <%@page import="org.support.project.web.util.JspUtil"%> <%@page pageEncoding="UTF-8" isELIgnored="false" session="false" errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> @@ -58,15 +59,36 @@ _TAGS.push('<%= jspUtil.out("tagitem.tagName") %>');

    <%= jspUtil.label("knowledge.edit.title") %>

    - +

     <%= jspUtil.out("knowledgeId") %> /  <%= jspUtil.date("updateDatetime")%>

    + + +
    +
    + + + +
    + +
    " value="<%= jspUtil.out("title") %>" />
    + +
    + + +
    +
    + + +
    -
    - + +  <%= jspUtil.label("knowledge.add.label.select.file") %> @@ -117,7 +146,10 @@ _TAGS.push('<%= jspUtil.out("tagitem.tagName") %>');
    - + + + +