diff --git a/bower.json b/bower.json index d8e4dbf4d..a66e1b90f 100644 --- a/bower.json +++ b/bower.json @@ -4,7 +4,7 @@ "jquery": "2.2.3", "bootstrap": "3.3.6", "bootswatch": "3.3.6", - "font-awesome": "4.5.0", + "font-awesome": "4.7.0", "html5shiv": "3.7.2", "respond": "1.4.2", "notifyjs": "0.3.2", @@ -21,11 +21,12 @@ "notify.js": "1.2.8", "emoji-parser": "0.1.1", "bluebird": "3.0.6", - "jquery-oembed-all": "nfl/jquery-oembed-all", + "jquery-oembed-all": "support-project/jquery-oembed-all", "flag-icon-css": "0.8.5", "moment": "2.12.0", "clipboard": "1.5.10", - "MathJax": "2.6.1" + "MathJax": "2.6.1", + "cropper": "2.3.4" }, "devDependencies": {}, "resolutions": { diff --git a/config/eclipse_memo.md b/config/eclipse_memo.md new file mode 100644 index 000000000..4a373654a --- /dev/null +++ b/config/eclipse_memo.md @@ -0,0 +1,62 @@ +# .project ファイル + +``` + + + knowledge + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + net.sf.eclipsecs.core.CheckstyleBuilder + + + + + ch.acanda.eclipse.pmd.builder.PMDBuilder + + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + net.sf.eclipsecs.core.CheckstyleNature + ch.acanda.eclipse.pmd.builder.PMDNature + + +``` + + diff --git a/document/database/A5M2_knowledge.pdf b/document/database/A5M2_knowledge.pdf index 759515e05..13123938e 100755 Binary files a/document/database/A5M2_knowledge.pdf and b/document/database/A5M2_knowledge.pdf differ diff --git a/document/database/knowledge.a5er b/document/database/knowledge.a5er index d6b7217fe..5e9d03c34 100755 --- a/document/database/knowledge.a5er +++ b/document/database/knowledge.a5er @@ -46,14 +46,191 @@ SqlSeparator=0 ShowTag=1 ShowCommonAttributes=0 +[Entity] +PName=PINS +LName=ピン +Comment= +TableOption= +Page=Main +Left=1750 +Top=1900 +Field="NO","NO","serial","NOT NULL",0,"","",$FFFFFFFF,"" +Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",,"","",$FFFFFFFF,"" +Field="行ID","ROW_ID","@VARCHAR(64)",,,"","",$FFFFFFFF,"" +Index=IDX_PINS_INSERT_USER=0,INSERT_USER +EffectMode=None +Color=$000000 +BkColor=$FFFFFF +ModifiedDateTime=20161206105257 +Position="Main",1750,1900 + +[Relation] +Entity1=WEBHOOK_CONFIGS +Entity2=WEBHOOKS +RelationType1=1 +RelationType2=3 +Fields1=HOOK_ID +Fields2=HOOK +Cardinarity1= +Cardinarity2= +Position="MAIN",0,6704,4194,4959,R,R +Dependence=0 +Caption= +PName= +ModifiedDateTime=20161206104307 +LineMode=0 +Bar1=670 +Bar2=419 +Bar3=496 +TermPos1=R +TermPos2=R + +[Entity] +PName=WEBHOOKS +LName=Webhooks +Comment= +TableOption= +Page=Main +Left=2300 +Top=1850 +Field="WEBHOOK ID","WEBHOOK_ID","@VARCHAR(64)","NOT NULL",0,"","",$FFFFFFFF,"" +Field="ステータス","STATUS","@INT","NOT NULL",,"","",$FFFFFFFF,"" +Field="HOOK","HOOK","@VARCHAR(20)",,,"","",$FFFFFFFF,"" +Field="通知用json文字列","CONTENT","text",,,"","",$FFFFFFFF,"" +Index=IDX_WEBHOOKS_STATUS=0,STATUS +EffectMode=None +Color=$000000 +BkColor=$FFFFFF +ModifiedDateTime=20161206105158 +Position="Main",2300,1850 + +[Entity] +PName=WEBHOOK_CONFIGS +LName=Webhook 設定 +Comment= +TableOption= +Page=Main +Left=2300 +Top=1650 +Field="HOOK ID","HOOK_ID","serial","NOT NULL",0,"","",$FFFFFFFF,"" +Field="HOOK","HOOK","@VARCHAR(20)","NOT NULL",,"","",$FFFFFFFF,"" +Field="URL","URL","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,"" +EffectMode=None +Color=$000000 +BkColor=$FFFFFF +ModifiedDateTime=20161206103902 +Position="Main",2300,1650 + +[Relation] +Entity1=DRAFT_KNOWLEDGES +Entity2=KNOWLEDGE_FILES +RelationType1=1 +RelationType2=3 +Fields1=DRAFT_ID +Fields2=DRAFT_ID +Cardinarity1= +Cardinarity2= +Position="MAIN",0,9067,3161,4409,R,R +Dependence=0 +Caption= +PName= +LineMode=0 +Bar1=907 +Bar2=316 +Bar3=441 +TermPos1=R +TermPos2=R + +[Relation] +Entity1=TEMPLATE_ITEMS +Entity2=DRAFT_ITEM_VALUES +RelationType1=2 +RelationType2=3 +Fields1=TYPE_ID,ITEM_NO +Fields2=TYPE_ID,ITEM_NO +Cardinarity1= +Cardinarity2= +Position="MAIN",0,4856,5144,3450,R,R +Dependence=1 +Caption= +PName= +LineMode=0 +Bar1=486 +Bar2=514 +Bar3=345 +TermPos1=R +TermPos2=R + +[Relation] +Entity1=DRAFT_KNOWLEDGES +Entity2=DRAFT_ITEM_VALUES +RelationType1=2 +RelationType2=3 +Fields1=DRAFT_ID +Fields2=DRAFT_ID +Cardinarity1= +Cardinarity2= +Position="MAIN",0,5502,5144,2030,R,R +Dependence=1 +Caption= +PName= +LineMode=0 +Bar1=550 +Bar2=514 +Bar3=203 +TermPos1=R +TermPos2=R + +[Entity] +PName=DRAFT_ITEM_VALUES +LName=ナレッジの項目値 +Comment= +TableOption= +Page=MAIN +Left=1600 +Top=850 +Field="下書きID","DRAFT_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=20161118154223 +Position="MAIN",1600,850 + +[Entity] +PName=DRAFT_KNOWLEDGES +LName=ナレッジの下書き +Comment= +TableOption= +Page=MAIN +Left=2250 +Top=750 +Field="下書きID","DRAFT_ID","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" +Field="ナレッジID","KNOWLEDGE_ID","bigint",,,"","",$FFFFFFFF,"" +Field="タイトル","TITLE","@VARCHAR(1024)","NOT NULL",,"","",$FFFFFFFF,"" +Field="内容","CONTENT","text",,,"","",$FFFFFFFF,"" +Field="公開区分","PUBLIC_FLAG","@INT",,,"","",$FFFFFFFF,"" +Field="公開対象","ACCESSES","text",,,"","",$FFFFFFFF,"" +Field="共同編集対象","EDITORS","text",,,"","",$FFFFFFFF,"" +Field="タグ名称一覧","TAG_NAMES","text",,,"","",$FFFFFFFF,"" +Field="テンプレートの種類ID","TYPE_ID","@INT",,,"","",$FFFFFFFF,"" +EffectMode=None +Color=$000000 +BkColor=$FFFFFF +ModifiedDateTime=20161118154033 +Position="MAIN",2250,750 + [Entity] PName=MAIL_POSTS LName=メールから投稿 Comment= TableOption= Page=MAIN -Left=2300 -Top=1250 +Left=1800 +Top=50 Field="Message-ID","MESSAGE_ID","@VARCHAR(128)","NOT NULL",0,"","",$FFFFFFFF,"" Field="投稿区分","POST_KIND","@INT","NOT NULL",,"","1: Knowledge 2:Comment",$FFFFFFFF,"" Field="ID","ID","BIGINT","NOT NULL",,"","",$FFFFFFFF,"" @@ -62,7 +239,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20160611082117 -Position="MAIN",2300,1250 +Position="MAIN",1800,50 [Relation] Entity1=MAIL_HOOKS @@ -73,7 +250,7 @@ Fields1=HOOK_ID Fields2=HOOK_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,4081,5073,3934,R,R +Position="MAIN",0,4081,5073,3880,R,R Dependence=1 Caption= PName= @@ -81,7 +258,7 @@ ModifiedDateTime=20160603134957 LineMode=0 Bar1=408 Bar2=507 -Bar3=393 +Bar3=388 TermPos1=R TermPos2=R @@ -92,7 +269,7 @@ Comment= TableOption= Page=MAIN Left=2300 -Top=900 +Top=350 Field="HOOK_ID","HOOK_ID","INTEGER","NOT NULL",0,"","",$FFFFFFFF,"" Field="CONDITION_NO","CONDITION_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,"" Field="条件の種類","CONDITION_KIND","@INT","NOT NULL",,"","1:宛先が「条件文字」であった場合",$FFFFFFFF,"" @@ -109,7 +286,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20160720194529 -Position="MAIN",2300,900 +Position="MAIN",2300,350 [Entity] PName=MAIL_HOOKS @@ -118,7 +295,7 @@ Comment= TableOption= Page=MAIN Left=2300 -Top=570 +Top=50 Field="HOOK_ID","HOOK_ID","SERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="MAIL_PROTOCOL","MAIL_PROTOCOL","@VARCHAR(10)","NOT NULL",,"","",$FFFFFFFF,"" Field="MAIL_HOST","MAIL_HOST","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,"" @@ -131,7 +308,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20160603171116 -Position="MAIN",2300,570 +Position="MAIN",2300,50 [Relation] Entity1=STOCKS @@ -142,7 +319,7 @@ Fields1=STOCK_ID Fields2=STOCK_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,4450,5090,4398,R,R +Position="MAIN",0,4450,5090,4490,R,R Dependence=1 Caption= PName= @@ -150,7 +327,7 @@ ModifiedDateTime=20150910042933 LineMode=0 Bar1=445 Bar2=509 -Bar3=440 +Bar3=449 TermPos1=R TermPos2=R @@ -160,8 +337,8 @@ LName=ストック Comment= TableOption= Page=MAIN -Left=1800 -Top=1300 +Left=50 +Top=1550 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,"" @@ -170,7 +347,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150910042830 -Position="MAIN",1800,1300 +Position="MAIN",50,1550 [Relation] Entity1=TEMPLATE_ITEMS @@ -181,12 +358,13 @@ Fields1=TYPE_ID,ITEM_NO Fields2=TYPE_ID,ITEM_NO Cardinarity1= Cardinarity2= -Position="MAIN",0,6291,5004,3188,R,R +Position="MAIN",1,2761,5004,3188,R,R Dependence=1 Caption= PName= -LineMode=0 -Bar1=629 +ModifiedDateTime=20161118152831 +LineMode=1 +Bar1=276 Bar2=500 Bar3=319 TermPos1=R @@ -201,14 +379,14 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,7401,6340,2403,R,R +Position="MAIN",0,7352,6340,2550,R,R Dependence=1 Caption= PName= LineMode=0 -Bar1=740 +Bar1=735 Bar2=634 -Bar3=240 +Bar3=255 TermPos1=R TermPos2=R @@ -218,8 +396,8 @@ LName=ナレッジの項目値 Comment= TableOption= Page=MAIN -Left=1240 -Top=590 +Left=1000 +Top=850 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,"" @@ -229,7 +407,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150915190523 -Position="MAIN",1240,590 +Position="MAIN",1000,850 [Relation] Entity1=TEMPLATE_ITEMS @@ -240,15 +418,15 @@ Fields1=TYPE_ID,ITEM_NO Fields2=TYPE_ID,ITEM_NO Cardinarity1= Cardinarity2= -Position="MAIN",0,6366,6905,3237,R,R +Position="MAIN",0,3356,6905,3308,R,R Dependence=1 Caption= PName= ModifiedDateTime=20150910034625 LineMode=0 -Bar1=637 +Bar1=336 Bar2=690 -Bar3=324 +Bar3=331 TermPos1=R TermPos2=R @@ -258,8 +436,8 @@ LName=選択肢の値 Comment= TableOption= Page=MAIN -Left=2010 -Top=140 +Left=1350 +Top=300 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,"" @@ -269,7 +447,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150910041119 -Position="MAIN",2010,140,542,135 +Position="MAIN",1350,300,542,135 [Relation] Entity1=TEMPLATE_MASTERS @@ -280,15 +458,15 @@ Fields1=TYPE_ID Fields2=TYPE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,4347,6903,3478,R,R +Position="MAIN",0,4460,6903,3568,R,R Dependence=1 Caption= PName= ModifiedDateTime=20150910034230 LineMode=0 -Bar1=435 +Bar1=446 Bar2=690 -Bar3=348 +Bar3=357 TermPos1=R TermPos2=R @@ -301,14 +479,14 @@ Fields1=TYPE_ID Fields2=TYPE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,1272,5475,2177,R,R +Position="MAIN",0,3334,5475,2219,R,R Dependence=0 Caption= PName= LineMode=0 -Bar1=127 +Bar1=333 Bar2=548 -Bar3=218 +Bar3=222 TermPos1=R TermPos2=R @@ -318,8 +496,8 @@ LName=テンプレートのマスタ Comment= TableOption= Page=MAIN -Left=1120 -Top=390 +Left=650 +Top=550 Field="テンプレートの種類ID","TYPE_ID","serial","NOT NULL",0,"","",$FFFFFFFF,"" Field="テンプレート名","TYPE_NAME","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,"" Field="アイコン","TYPE_ICON","@VARCHAR(64)",,,"","",$FFFFFFFF,"" @@ -328,7 +506,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150912014311 -Position="MAIN",1120,390 +Position="MAIN",650,550 [Entity] PName=TEMPLATE_ITEMS @@ -336,8 +514,8 @@ LName=テンプレートの項目 Comment= TableOption= Page=MAIN -Left=1870 -Top=390 +Left=1350 +Top=550 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,"" @@ -347,7 +525,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20151027035632 -Position="MAIN",1870,390 +Position="MAIN",1350,550 [Relation] Entity1=KNOWLEDGES @@ -358,14 +536,14 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,1514,3775,5634,R,R +Position="MAIN",3,8366,5077,5634,R,R Dependence=1 Caption= PName= -ModifiedDateTime=20150517063537 -LineMode=0 -Bar1=151 -Bar2=378 +ModifiedDateTime=20161206103019 +LineMode=3 +Bar1=837 +Bar2=508 Bar3=563 TermPos1=R TermPos2=R @@ -376,15 +554,15 @@ LName=編集可能なグループ Comment= TableOption= Page=MAIN -Left=1800 -Top=800 +Left=750 +Top=1900 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",1800,800 +Position="MAIN",750,1900 [Relation] Entity1=KNOWLEDGES @@ -395,14 +573,14 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,472,3356,6489,R,R +Position="MAIN",0,7515,3356,9481,R,R Dependence=1 Caption= PName= LineMode=0 -Bar1=47 +Bar1=752 Bar2=336 -Bar3=649 +Bar3=948 TermPos1=R TermPos2=R @@ -412,15 +590,15 @@ LName=編集可能なユーザ Comment= TableOption= Page=MAIN -Left=1800 -Top=700 +Left=750 +Top=1800 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",1800,700 +Position="MAIN",750,1800 [Relation] Entity1=KNOWLEDGES @@ -431,15 +609,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,5333,7091,5770,R,R +Position="MAIN",0,5026,7091,5584,R,R Dependence=1 Caption= PName= ModifiedDateTime=20150910041644 LineMode=0 -Bar1=533 +Bar1=503 Bar2=709 -Bar3=577 +Bar3=558 TermPos1=R TermPos2=R @@ -449,8 +627,8 @@ LName=ナレッジ更新履歴 Comment= TableOption= Page=MAIN -Left=70 -Top=810 +Left=50 +Top=1100 Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,"" Field="履歴番号","HISTORY_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,"" Field="タイトル","TITLE","@VARCHAR(1024)","NOT NULL",,"","",$FFFFFFFF,"" @@ -464,7 +642,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150507141708 -Position="MAIN",70,810 +Position="MAIN",50,1100 [Entity] PName=NOTIFY_QUEUES @@ -472,8 +650,8 @@ LName=通知待ちキュー Comment= TableOption= Page=MAIN -Left=1530 -Top=160 +Left=50 +Top=500 Field="HASH","HASH","@VARCHAR(32)","NOT NULL",0,"","",$FFFFFFFF,"" Field="種類","TYPE","@INT","NOT NULL",,"","",$FFFFFFFF,"" Field="通知する種類のID","ID","bigint","NOT NULL",,"","",$FFFFFFFF,"" @@ -481,7 +659,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150331055404 -Position="MAIN",1530,160 +Position="MAIN",50,500 [Entity] PName=NOTIFY_CONFIGS @@ -517,14 +695,14 @@ Fields1=COMMENT_NO Fields2=COMMENT_NO Cardinarity1= Cardinarity2= -Position="MAIN",0,5422,4072,4842,R,R +Position="MAIN",0,5422,4072,4828,R,R Dependence=0 Caption= PName= LineMode=0 Bar1=542 Bar2=407 -Bar3=484 +Bar3=483 TermPos1=R TermPos2=R @@ -534,8 +712,8 @@ LName=アカウントの画像 Comment= TableOption= Page=MAIN -Left=940 -Top=150 +Left=900 +Top=50 Field="IMAGE_ID","IMAGE_ID","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ユーザID","USER_ID","@INT",,,"","",$FFFFFFFF,"" Field="ファイル名","FILE_NAME","@VARCHAR(256)",,,"","",$FFFFFFFF,"" @@ -548,7 +726,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416234339 -Position="MAIN",940,150 +Position="MAIN",900,50 [Relation] Entity1=KNOWLEDGES @@ -576,8 +754,8 @@ LName=いいね Comment= TableOption= Page=MAIN -Left=600 -Top=470 +Left=50 +Top=650 Field="NO","NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",,"","",$FFFFFFFF,"" Index=IDX_LIKES_KNOWLEDGE_ID=0,KNOWLEDGE_ID @@ -585,7 +763,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416233511 -Position="MAIN",600,470 +Position="MAIN",50,650 [Relation] Entity1=KNOWLEDGES @@ -596,15 +774,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,1398,7735,3878,R,R +Position="MAIN",0,4982,7735,3632,R,R Dependence=1 Caption= PName= ModifiedDateTime=20141222155941 LineMode=0 -Bar1=140 +Bar1=498 Bar2=774 -Bar3=388 +Bar3=363 TermPos1=R TermPos2=R @@ -614,8 +792,8 @@ LName=コメント Comment= TableOption= Page=MAIN -Left=650 -Top=1300 +Left=1400 +Top=1350 Field="コメント番号","COMMENT_NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",,"","",$FFFFFFFF,"" Field="コメント","COMMENT","text",,,"","",$FFFFFFFF,"" @@ -625,7 +803,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150910035117 -Position="MAIN",650,1300 +Position="MAIN",1400,1350 [Relation] Entity1=KNOWLEDGES @@ -636,14 +814,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,7905,5116,2114,R,R +Position="MAIN",3,6828,5116,5997,R,R Dependence=0 Caption= PName= -LineMode=0 -Bar1=790 +ModifiedDateTime=20161118152345 +LineMode=3 +Bar1=683 Bar2=512 -Bar3=211 +Bar3=600 TermPos1=R TermPos2=R @@ -653,8 +832,8 @@ LName=投票 Comment= TableOption= Page=MAIN -Left=1150 -Top=1300 +Left=50 +Top=1700 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,"" @@ -663,7 +842,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416233659 -Position="MAIN",1150,1300,435,89 +Position="MAIN",50,1700,435,89 [Relation] Entity1=KNOWLEDGES @@ -674,13 +853,13 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,7859,6407,5990,R,R +Position="MAIN",0,7005,6407,5990,R,R Dependence=1 Caption= PName= ModifiedDateTime=20141204130740 LineMode=0 -Bar1=786 +Bar1=700 Bar2=641 Bar3=599 TermPos1=R @@ -692,8 +871,8 @@ LName=ナレッジの参照履歴 Comment= TableOption= Page=MAIN -Left=60 -Top=1100 +Left=50 +Top=1400 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,"" @@ -702,7 +881,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150416233623 -Position="MAIN",60,1100 +Position="MAIN",50,1400 [Relation] Entity1=KNOWLEDGES @@ -713,15 +892,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,8770,5725,5124,R,R +Position="MAIN",0,2082,5725,4629,R,R Dependence=1 Caption= PName= ModifiedDateTime=20150910042925 LineMode=0 -Bar1=877 +Bar1=208 Bar2=572 -Bar3=512 +Bar3=463 TermPos1=R TermPos2=R @@ -731,8 +910,8 @@ LName=ストックしたナレッジ Comment= TableOption= Page=MAIN -Left=1800 -Top=1100 +Left=600 +Top=1550 Field="STOCK ID","STOCK_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,"" Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",1,"","",$FFFFFFFF,"" Field="コメント","COMMENT","@VARCHAR(1024)",,,"","",$FFFFFFFF,"" @@ -740,7 +919,7 @@ EffectMode=None Color=$000000 BkColor=$FFFFFF ModifiedDateTime=20150910042912 -Position="MAIN",1800,1100 +Position="MAIN",600,1550 [Relation] Entity1=KNOWLEDGES @@ -751,13 +930,14 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,3944,6468,5676,R,R +Position="MAIN",3,8825,4332,5676,R,R Dependence=1 Caption= PName= -LineMode=0 -Bar1=394 -Bar2=647 +ModifiedDateTime=20161206103135 +LineMode=3 +Bar1=882 +Bar2=433 Bar3=568 TermPos1=R TermPos2=R @@ -768,15 +948,15 @@ LName=アクセス可能なグループ Comment= TableOption= Page=MAIN -Left=1800 -Top=1000 +Left=1250 +Top=1900 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",1800,1000 +Position="MAIN",1250,1900 [Relation] Entity1=KNOWLEDGES @@ -787,15 +967,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,2787,7524,7865,R,R +Position="MAIN",0,9500,7524,1847,R,R Dependence=1 Caption= PName= ModifiedDateTime=20141204125301 LineMode=0 -Bar1=279 +Bar1=950 Bar2=752 -Bar3=786 +Bar3=185 TermPos1=R TermPos2=R @@ -805,15 +985,15 @@ LName=アクセス可能なユーザ Comment= TableOption= Page=MAIN -Left=1800 -Top=900 +Left=1250 +Top=1800 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",1800,900 +Position="MAIN",1250,1800 [Relation] Entity1=TAGS @@ -824,14 +1004,14 @@ Fields1=TAG_ID Fields2=TAG_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,4552,5672,4574,R,R +Position="MAIN",0,4552,5672,4658,R,R Dependence=1 Caption= PName= LineMode=0 Bar1=455 Bar2=567 -Bar3=457 +Bar3=466 TermPos1=R TermPos2=R @@ -844,13 +1024,13 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",0,2324,5163,6381,R,R +Position="MAIN",0,2923,5592,6381,R,R Dependence=1 Caption= PName= LineMode=0 -Bar1=232 -Bar2=516 +Bar1=292 +Bar2=559 Bar3=638 TermPos1=R TermPos2=R @@ -861,15 +1041,15 @@ LName=ナレッジが持つタグ Comment= TableOption= Page=MAIN -Left=60 -Top=650 +Left=50 +Top=950 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",60,650 +Position="MAIN",50,950 [Entity] PName=TAGS @@ -877,15 +1057,15 @@ LName=タグ Comment= TableOption= Page=MAIN -Left=60 -Top=470 +Left=50 +Top=750 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",60,470 +Position="MAIN",50,750 [Relation] Entity1=KNOWLEDGES @@ -896,15 +1076,15 @@ Fields1=KNOWLEDGE_ID Fields2=KNOWLEDGE_ID Cardinarity1= Cardinarity2= -Position="MAIN",1,756,6760,7728,R,R +Position="MAIN",0,1708,7637,5252,R,R Dependence=1 Caption= PName= -ModifiedDateTime=20150517063131 -LineMode=1 -Bar1=76 -Bar2=676 -Bar3=773 +ModifiedDateTime=20161206103055 +LineMode=0 +Bar1=171 +Bar2=764 +Bar3=525 TermPos1=R TermPos2=R @@ -914,11 +1094,12 @@ LName=添付ファイル Comment= TableOption= Page=MAIN -Left=50 -Top=1300 +Left=1600 +Top=1050 Field="添付ファイル番号","FILE_NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="ナレッジID","KNOWLEDGE_ID","bigint",,,"","",$FFFFFFFF,"" Field="コメント番号","COMMENT_NO","bigint",,,"","",$FFFFFFFF,"" +Field="下書きID","DRAFT_ID","bigint",,,"","",$FFFFFFFF,"" Field="ファイル名","FILE_NAME","@VARCHAR(256)",,,"","",$FFFFFFFF,"" Field="ファイルサイズ","FILE_SIZE","@DOUBLE",,,"","",$FFFFFFFF,"" Field="バイナリ","FILE_BINARY","BYTEA",,,"","",$FFFFFFFF,"" @@ -927,8 +1108,8 @@ Index=IDX_KNOWLEDGE_FILES_KNOWLEDGE_ID=0,KNOWLEDGE_ID EffectMode=None Color=$000000 BkColor=$FFFFFF -ModifiedDateTime=20150416234328 -Position="MAIN",50,1300 +ModifiedDateTime=20161206105608 +Position="MAIN",1600,1050 [Entity] PName=KNOWLEDGES @@ -936,8 +1117,8 @@ LName=ナレッジ Comment= TableOption= Page=MAIN -Left=900 -Top=850 +Left=700 +Top=1100 Field="ナレッジID","KNOWLEDGE_ID","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,"" Field="タイトル","TITLE","@VARCHAR(1024)","NOT NULL",,"","",$FFFFFFFF,"" Field="内容","CONTENT","text",,,"","",$FFFFFFFF,"" @@ -946,12 +1127,13 @@ 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,"" +Field="テンプレートの種類ID","TYPE_ID","@INT",,,"","",$FFFFFFFF,"" +Field="通知ステータス","NOTIFY_STATUS","@INT",,,"","",$FFFFFFFF,"" EffectMode=None Color=$000000 BkColor=$FFFFFF -ModifiedDateTime=20150910053608 -Position="MAIN",900,850 +ModifiedDateTime=20161118153424 +Position="MAIN",700,1100 [Comment] Comment=knowledge diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 000000000..913e59553 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,83 @@ +var gulp = require('gulp'); +var usemin = require('gulp-usemin'); +var uglify = require('gulp-uglify'); +var minifyHtml = require('gulp-minify-html'); +var minifyCss = require('gulp-minify-css'); +var rev = require('gulp-rev'); +var replace = require('gulp-replace'); + +gulp.task('min', function() { + return gulp.src([ + 'src/main/webapp/WEB-INF/views/**/*.jsp' + ]) + .pipe(usemin({ + css: [rev], + htmlmin: [ function () {return minifyHtml({ empty: true });} ], + js: [uglify, rev], + inlinejs: [ uglify ], + inlinecss: [ minifyCss, 'concat' ], + outputRelativePath: '../../' + })) + .pipe(gulp.dest('target/knowledge/WEB-INF/views/')); +}); + +gulp.task('copy', ['copy:bootswatch', 'copy:highlightjs', 'copy:font-awesome', 'copy:flag-icon-css', + 'copy:html5shiv', 'copy:respond', 'copy:MathJax', 'copy:emoji-parser', 'copy:free-file-icons']); +gulp.task('copy:bootswatch', function() { + return gulp.src([ + 'src/main/webapp/bower/bootswatch/**/*' + ]) + .pipe(replace(/^@import url\("https:\/\/fonts.googleapis.com\/css.*\)\;/, '')) + .pipe(gulp.dest('target/knowledge/bower/bootswatch')); +}); +gulp.task('copy:highlightjs', function() { + return gulp.src([ + 'src/main/webapp/bower/highlightjs/**/*' + ]) + .pipe(gulp.dest('target/knowledge/bower/highlightjs')); +}); +gulp.task('copy:font-awesome', function() { + return gulp.src([ + 'src/main/webapp/bower/font-awesome/**/*' + ]) + .pipe(gulp.dest('target/knowledge/bower/font-awesome')); +}); +gulp.task('copy:flag-icon-css', function() { + return gulp.src([ + 'src/main/webapp/bower/flag-icon-css/**/*' + ]) + .pipe(gulp.dest('target/knowledge/bower/flag-icon-css')); +}); +gulp.task('copy:html5shiv', function() { + return gulp.src([ + 'src/main/webapp/bower/html5shiv/**/*' + ]) + .pipe(gulp.dest('target/knowledge/bower/html5shiv')); +}); +gulp.task('copy:respond', function() { + return gulp.src([ + 'src/main/webapp/bower/respond/**/*' + ]) + .pipe(gulp.dest('target/knowledge/bower/respond')); +}); +gulp.task('copy:MathJax', function() { + return gulp.src([ + 'src/main/webapp/bower/MathJax/**/*' + ]) + .pipe(gulp.dest('target/knowledge/bower/MathJax')); +}); +gulp.task('copy:emoji-parser', function() { + return gulp.src([ + 'src/main/webapp/bower/emoji-parser/**/*' + ]) + .pipe(gulp.dest('target/knowledge/bower/emoji-parser')); +}); +gulp.task('copy:free-file-icons', function() { + return gulp.src([ + 'src/main/webapp/bower/teambox.free-file-icons/**/*' + ]) + .pipe(gulp.dest('target/knowledge/bower/teambox.free-file-icons')); +}); + + +gulp.task('default', ['min', 'copy']); diff --git a/package.json b/package.json index 705b3a4a0..582d9e6cb 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,15 @@ "url": "https://github.com/support-project/knowledge" }, "dependencies": { - "bower": "^1.7.9", - "npm": "^3.3.12" + "bower": "^1.8.0", + "gulp": "^3.9.1", + "gulp-usemin": "^0.3.26", + "gulp-uglify": "^0.3.1", + "gulp-minify-html": "^0.1.4", + "gulp-minify-css": "^0.3.7", + "gulp-rev": "^7.1.2", + "gulp-replace": "^0.5.4", + "npm": "^3.10.9" }, "devDependencies": {}, "scripts": { diff --git a/pom.xml b/pom.xml index 877e583b7..592e05d9a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.support-project knowledge - 1.6.0 + 1.7.0 war knowledge @@ -59,13 +59,13 @@ org.support-project web - 1.6.0 + 1.7.0 org.support-project markedj - 1.6.0-SNAPSHOT + 1.6.0 @@ -194,6 +194,10 @@ 2.6 false + + + WEB-INF/views/**/*.jsp,bower/**/* + @@ -209,7 +213,7 @@ com.github.jsimone webapp-runner - 8.0.30.2 + 8.0.33.4 webapp-runner.jar @@ -220,7 +224,7 @@ com.github.eirslett frontend-maven-plugin - 1.0 + 1.3 install node and npm @@ -228,12 +232,12 @@ install-node-and-npm - v5.3.0 - 3.3.12 + v6.9.2 + 3.10.9 - npm install bower + npm install npm @@ -250,6 +254,16 @@ install + + gulp + prepare-package + + gulp + + + default + + diff --git a/src/main/java/org/support/project/knowledge/bat/AbstractBat.java b/src/main/java/org/support/project/knowledge/bat/AbstractBat.java index 673d84eba..532fbd757 100644 --- a/src/main/java/org/support/project/knowledge/bat/AbstractBat.java +++ b/src/main/java/org/support/project/knowledge/bat/AbstractBat.java @@ -1,5 +1,7 @@ package org.support.project.knowledge.bat; +import java.util.TimeZone; + import org.apache.log4j.FileAppender; import org.apache.log4j.Logger; import org.support.project.common.log.Log; @@ -21,6 +23,10 @@ public static void initLogName(String logname) { } protected static void configInit(String batName) { + // 内部的には、日付はGMTとして扱う + TimeZone zone = TimeZone.getTimeZone("GMT"); + TimeZone.setDefault(zone); + AppConfig.initEnvKey(SystemConfig.KNOWLEDGE_ENV_KEY); String envValue = System.getenv(SystemConfig.KNOWLEDGE_ENV_KEY); LOG.info(batName + " is start."); diff --git a/src/main/java/org/support/project/knowledge/bat/FileParse.java b/src/main/java/org/support/project/knowledge/bat/FileParse.java new file mode 100644 index 000000000..47459079c --- /dev/null +++ b/src/main/java/org/support/project/knowledge/bat/FileParse.java @@ -0,0 +1,46 @@ +package org.support.project.knowledge.bat; + +import java.io.File; +import java.io.IOException; + +import org.support.project.common.exception.ParseException; +import org.support.project.common.log.Log; +import org.support.project.common.log.LogFactory; +import org.support.project.knowledge.parser.SlideShowParser; +import org.support.project.knowledge.parser.SlideShowParserFactory; + +/** + * スライドに表示する画像の抽出が、サーバーで実施するとうまくいかない事が多い + * ローカルで実施できるようにツール化 + * + * @author Koda + */ +public class FileParse { + /** ログ */ + private static final Log LOG = LogFactory.getLog(FileParseBat.class); + + private static final String EXPORT_DIR = "/data/temp/slide/exports"; + private static final String FILE_PATH = "/data/temp/slide/hoge.pdf"; + private static final int FILE_NO = 999; + + public static void main(String[] main) throws IOException, ParseException { + File slide = new File(FILE_PATH); + LOG.info(FILE_PATH + " のスライドを抽出します"); + SlideShowParser showParser = SlideShowParserFactory.getParser(slide.getName()); + if (showParser != null) { + File dir = new File(EXPORT_DIR); + if (!dir.exists()) { + dir.mkdirs(); + } + File slideDir = new File(dir, String.valueOf(FILE_NO)); + if (!slideDir.exists()) { + slideDir.mkdirs(); + } + showParser.parse(slide, slideDir); + LOG.info(FILE_PATH + " のスライド抽出が完了しました"); + } else { + LOG.info(FILE_PATH + " はスライドの抽出の対象ではありません"); + } + } + +} diff --git a/src/main/java/org/support/project/knowledge/bat/NotifyMailBat.java b/src/main/java/org/support/project/knowledge/bat/NotifyMailBat.java index 61632e3f3..8a860fe68 100644 --- a/src/main/java/org/support/project/knowledge/bat/NotifyMailBat.java +++ b/src/main/java/org/support/project/knowledge/bat/NotifyMailBat.java @@ -11,11 +11,13 @@ import java.util.UUID; import org.apache.commons.lang.ClassUtils; +import org.support.project.aop.Aspect; import org.support.project.common.config.INT_FLAG; import org.support.project.common.config.LocaleConfigLoader; import org.support.project.common.log.Log; import org.support.project.common.log.LogFactory; import org.support.project.common.util.StringUtils; +import org.support.project.di.Container; import org.support.project.knowledge.config.AppConfig; import org.support.project.knowledge.config.MailConfig; import org.support.project.knowledge.config.NotifyType; @@ -81,7 +83,7 @@ public static void main(String[] args) throws Exception { initLogName("NotifyMailBat.log"); configInit(ClassUtils.getShortClassName(NotifyMailBat.class)); - NotifyMailBat bat = new NotifyMailBat(); + NotifyMailBat bat = Container.getComp(NotifyMailBat.class); bat.dbInit(); bat.start(); @@ -123,6 +125,7 @@ private void start() throws Exception { * @param notifyQueuesEntity * @throws Exception */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) private void notifyLikeInsert(NotifyQueuesEntity notifyQueuesEntity) throws Exception { LikesDao likesDao = LikesDao.get(); LikesEntity like = likesDao.selectOnKey(notifyQueuesEntity.getId()); @@ -223,6 +226,7 @@ private void sendLikeMail(LikesEntity like, KnowledgesEntity knowledge, UsersEnt * @param notifyQueuesEntity * @throws Exception */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) private void notifyCommentInsert(NotifyQueuesEntity notifyQueuesEntity) throws Exception { CommentsDao commentsDao = CommentsDao.get(); CommentsEntity comment = commentsDao.selectOnKey(notifyQueuesEntity.getId()); @@ -354,6 +358,7 @@ private void sendCommentMail(CommentsEntity comment, KnowledgesEntity knowledge, * @param notifyQueuesEntity * @throws Exception */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) private void notifyKnowledgeUpdate(NotifyQueuesEntity notifyQueuesEntity) throws Exception { // ナレッジが登録/更新された KnowledgesDao knowledgesDao = KnowledgesDao.get(); @@ -362,17 +367,30 @@ private void notifyKnowledgeUpdate(NotifyQueuesEntity notifyQueuesEntity) throws LOG.warn("Knowledge record not found. id: " + notifyQueuesEntity.getId()); return; } - + + // Webhook通知 sendKnowledgeWebhook(knowledge, notifyQueuesEntity.getType()); - + // 「非公開」のナレッジは、メール通知対象外 if (knowledge.getPublicFlag() == KnowledgeLogic.PUBLIC_FLAG_PUBLIC) { notifyPublicKnowledgeUpdate(notifyQueuesEntity, knowledge); + updateNotifyStatus(knowledge); } else if (knowledge.getPublicFlag() == KnowledgeLogic.PUBLIC_FLAG_PROTECT) { notifyProtectKnowledgeUpdate(notifyQueuesEntity, knowledge); + updateNotifyStatus(knowledge); } - // 「非公開」のナレッジは、通知対象外 } + /** + * 通知を送ったもののステータスを更新 + * @param knowledge + */ + private void updateNotifyStatus(KnowledgesEntity knowledge) { + if (knowledge.getNotifyStatus() == null || knowledge.getNotifyStatus().intValue() == 0) { + knowledge.setNotifyStatus(1); // 通知済へ + KnowledgesDao.get().physicalUpdate(knowledge); // 更新日時などは更新しない + } + } + /** * 「保護」のナレッジを登録・更新した際にメール通知を送信する * @param notifyQueuesEntity @@ -467,7 +485,7 @@ private void notifyKnowledgeUpdateToUsers(NotifyQueuesEntity notifyQueuesEntity, } Locale locale = usersEntity.getLocale(); MailConfig config; - if (notifyQueuesEntity.getType() == Notify.TYPE_KNOWLEDGE_INSERT) { + if (knowledge.getNotifyStatus() == null || knowledge.getNotifyStatus().intValue() == 0) { config = LocaleConfigLoader.load(MAIL_CONFIG_DIR, "notify_insert_knowledge", locale, MailConfig.class); } else { config = LocaleConfigLoader.load(MAIL_CONFIG_DIR, "notify_update_knowledge", locale, MailConfig.class); diff --git a/src/main/java/org/support/project/knowledge/config/SystemConfig.java b/src/main/java/org/support/project/knowledge/config/SystemConfig.java index a214c1157..ae7a90631 100644 --- a/src/main/java/org/support/project/knowledge/config/SystemConfig.java +++ b/src/main/java/org/support/project/knowledge/config/SystemConfig.java @@ -1,5 +1,7 @@ package org.support.project.knowledge.config; +import org.support.project.web.config.WebConfig; + public class SystemConfig { public static final String KNOWLEDGE_ENV_KEY = "KNOWLEDGE_HOME"; @@ -15,7 +17,7 @@ public class SystemConfig { public static final String USER_ADD_TYPE_VALUE_MAIL = "MAIL"; /** システムへアクセスするためのURLのシステム設定のラベル */ - public static final String SYSTEM_URL = "SYSTEM_URL"; + public static final String SYSTEM_URL = WebConfig.KEY_SYSTEM_URL; /** アナリティクス設定を保持するキー */ public static final String ANALYTICS = "ANALYTICS"; diff --git a/src/main/java/org/support/project/knowledge/control/KnowledgeControlBase.java b/src/main/java/org/support/project/knowledge/control/KnowledgeControlBase.java index e28f69d32..3a89fb37a 100644 --- a/src/main/java/org/support/project/knowledge/control/KnowledgeControlBase.java +++ b/src/main/java/org/support/project/knowledge/control/KnowledgeControlBase.java @@ -1,7 +1,23 @@ package org.support.project.knowledge.control; +import java.util.ArrayList; +import java.util.List; + import org.support.project.di.DI; import org.support.project.di.Instance; +import org.support.project.knowledge.dao.KnowledgeFilesDao; +import org.support.project.knowledge.dao.TagsDao; +import org.support.project.knowledge.dao.TemplateMastersDao; +import org.support.project.knowledge.entity.DraftKnowledgesEntity; +import org.support.project.knowledge.entity.KnowledgeFilesEntity; +import org.support.project.knowledge.entity.KnowledgesEntity; +import org.support.project.knowledge.entity.TagsEntity; +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; +import org.support.project.knowledge.vo.UploadFile; +import org.support.project.web.bean.LabelValue; @DI(instance = Instance.Prototype) public class KnowledgeControlBase extends Control { @@ -22,4 +38,57 @@ protected String setViewParam() { setAttribute("params", params.toString()); return params.toString(); } + + protected void setAttributeForEditPage() { + List tagitems = TagsDao.get().selectAll(); + setAttribute("tagitems", tagitems); + + List templates = TemplateMastersDao.get().selectAll(); + setAttribute("templates", templates); + } + + /** + * 下書きの情報をセットする + * 下書き一覧と、Knowledgeの編集画面の2つから呼び出されるため共通化 + * @param draft + */ + protected void setDraftInfo(DraftKnowledgesEntity draft) { + List files = new ArrayList(); + // 下書きにのみ紐づくファイルがあれば取得 + List draftFiles = new ArrayList(); + List filesEntities = KnowledgeFilesDao.get().selectOnDraftId(draft.getDraftId()); + for (KnowledgeFilesEntity entity : filesEntities) { + if (entity.getCommentNo() == null || entity.getCommentNo() == 0) { + draftFiles.add(UploadedFileLogic.get().convUploadFile(getRequest().getContextPath(), entity)); + } + } + if (draft.getKnowledgeId() != null && draft.getKnowledgeId() > 0) { + // ナレッジに紐付いた下書きであれば、Knowledgeの編集権限をチェックする + KnowledgesEntity knowledge = KnowledgeLogic.get().select(draft.getKnowledgeId(), getLoginedUser()); + if (knowledge == null) { + addMsgWarn("knowledge.draft.view.msg.not.editor"); + } + + // ナレッジに紐づく添付ファイルを取得 + List knowledgeFiles = UploadedFileLogic.get().selectOnKnowledgeIdWithoutCommentFiles( + draft.getKnowledgeId(), getRequest().getContextPath()); + files.addAll(knowledgeFiles); + } else { + draft.setKnowledgeId(null); + } + setAttributeOnProperty(draft); + files.addAll(draftFiles); + setAttribute("files", files); + + // 表示するグループを取得 + String[] targets = draft.getAccesses().split(","); + List viewers = TargetLogic.get().selectTargets(targets); + setAttribute("groups", viewers); + // 共同編集者 + String[] editordids = draft.getEditors().split(","); + List editors = TargetLogic.get().selectTargets(editordids); + setAttribute("editors", editors); + + } + } diff --git a/src/main/java/org/support/project/knowledge/control/admin/ConfigControl.java b/src/main/java/org/support/project/knowledge/control/admin/ConfigControl.java index 7716efee3..a26b5c1f2 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/ConfigControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/ConfigControl.java @@ -34,7 +34,7 @@ public class ConfigControl extends Control { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary config() { SystemConfigsDao dao = SystemConfigsDao.get(); @@ -69,7 +69,7 @@ public Boundary config() { * * @return */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary save() { List errors = new ArrayList<>(); @@ -110,7 +110,7 @@ public Boundary save() { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary system() { SystemConfigsDao dao = SystemConfigsDao.get(); @@ -132,11 +132,10 @@ public Boundary system() { } /** - * ユーザ登録方法設定を保存 - * + * システム設定を保存 * @return */ - @Post + @Post(subscribeToken = "admin", checkReferer=false, checkReqToken = true) @Auth(roles = "admin") public Boundary save_params() { List errors = new ArrayList<>(); @@ -180,7 +179,7 @@ public Boundary save_params() { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary analytics() { SystemAttributesDao dao = SystemAttributesDao.get(); @@ -198,7 +197,7 @@ public Boundary analytics() { * * @return */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary analytics_save() { String analyticsScript = getParam("analytics_script"); diff --git a/src/main/java/org/support/project/knowledge/control/admin/DatabaseControl.java b/src/main/java/org/support/project/knowledge/control/admin/DatabaseControl.java index c5e3eeaa2..29cdd8985 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/DatabaseControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/DatabaseControl.java @@ -51,7 +51,7 @@ public class DatabaseControl extends Control { * @see org.support.project.web.control.Control#index() */ @Override - @Get + @Get(publishToken = "admin") public Boundary index() { H2DBServerLogic h2dbServerLogic = H2DBServerLogic.get(); boolean active = h2dbServerLogic.isActive(); @@ -65,7 +65,7 @@ public Boundary index() { * @return */ @Auth(roles = "admin") - @Get + @Get(subscribeToken = "admin") public Boundary start() { H2DBServerLogic h2dbServerLogic = H2DBServerLogic.get(); h2dbServerLogic.start(); @@ -90,7 +90,7 @@ public Boundary start() { * @throws SQLException */ @Auth(roles = "admin") - @Get + @Get(subscribeToken = "admin") public Boundary stop() throws ORMappingException, SQLException { // 組み込みDBを使っている場合、コネクション解除 if (DBConnenctionLogic.get().getCustomConnectionConfig() == null) { @@ -114,7 +114,7 @@ public Boundary stop() throws ORMappingException, SQLException { * @throws IOException */ @Auth(roles = "admin") - @Get + @Get(subscribeToken = "admin") public Boundary backup() throws IOException { HttpServletResponse res = getResponse(); @@ -135,7 +135,7 @@ public Boundary backup() throws IOException { * @throws IOException */ @Auth(roles = "admin") - @Post + @Post(subscribeToken = "admin") public Boundary restore() throws IOException { H2DBServerLogic h2dbServerLogic = H2DBServerLogic.get(); boolean active = h2dbServerLogic.isActive(); @@ -165,7 +165,7 @@ public Boundary restore() throws IOException { * * @return */ - @Get + @Get(subscribeToken = "admin") @Auth(roles = "admin") public Boundary connect() { ConnectionConfig connectionConfig = DBConnenctionLogic.get().getCustomConnectionConfig(); @@ -203,7 +203,7 @@ public Boundary connect() { * @return * @throws Exception */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary custom_save() throws Exception { ConnectionConfig connectionConfig = super.getParamOnProperty(ConnectionConfig.class); @@ -240,7 +240,7 @@ public Boundary custom_save() throws Exception { * * @return */ - @Get + @Get(subscribeToken = "admin") @Auth(roles = "admin") public Boundary custom_delete() { ConnectionConfig connectionConfig = DBConnenctionLogic.get().getCustomConnectionConfig(); @@ -272,7 +272,7 @@ public Boundary custom_delete() { * @return * @throws IOException */ - @Get + @Get(subscribeToken = "admin") @Auth(roles = "admin") public Boundary data_transfer() throws IOException { ConnectionConfig connectionConfig = DBConnenctionLogic.get().getCustomConnectionConfig(); @@ -289,7 +289,7 @@ public Boundary data_transfer() throws IOException { * @return * @throws IOException */ - @Get + @Get(subscribeToken = "admin") @Auth(roles = "admin") public Boundary data_transfer_back() throws IOException { ConnectionConfig connectionConfig = DBConnenctionLogic.get().getCustomConnectionConfig(); @@ -311,7 +311,7 @@ public Boundary data_transfer_back() throws IOException { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary reindexing() { SystemConfigsEntity entity = SystemConfigsDao.get().selectOnKey(SystemConfig.RE_INDEXING, AppConfig.get().getSystemName()); @@ -328,7 +328,7 @@ public Boundary reindexing() { * * @return */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary start_reindexing() { SystemConfigsEntity entity = SystemConfigsDao.get().selectOnKey(SystemConfig.RE_INDEXING, AppConfig.get().getSystemName()); @@ -353,7 +353,7 @@ public Boundary start_reindexing() { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary export() { SystemConfigsEntity entity = SystemConfigsDao.get().selectOnKey(SystemConfig.DATA_EXPORT, AppConfig.get().getSystemName()); @@ -371,7 +371,7 @@ public Boundary export() { * * @return */ - @Get + @Get(subscribeToken = "admin") @Auth(roles = "admin") public Boundary export_data_create() { SystemConfigsEntity entity = SystemConfigsDao.get().selectOnKey(SystemConfig.DATA_EXPORT, AppConfig.get().getSystemName()); @@ -393,7 +393,7 @@ public Boundary export_data_create() { * @return * @throws FileNotFoundException */ - @Get + @Get(subscribeToken = "admin") @Auth(roles = "admin") public Boundary download() throws FileNotFoundException { AppConfig config = AppConfig.get(); diff --git a/src/main/java/org/support/project/knowledge/control/admin/LdapControl.java b/src/main/java/org/support/project/knowledge/control/admin/LdapControl.java index 8a902e7f4..10650b84f 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/LdapControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/LdapControl.java @@ -43,7 +43,7 @@ public class LdapControl extends Control { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary config() { LdapConfigsDao dao = LdapConfigsDao.get(); @@ -167,7 +167,7 @@ private LdapConfigsEntity loadLdapConfig() throws InstantiationException, Illega * @throws NoSuchAlgorithmException * @throws InvalidKeyException */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary check() throws InstantiationException, IllegalAccessException, JSONException, IOException, InvalidParamException, LdapException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException { @@ -210,7 +210,7 @@ public Boundary check() throws InstantiationException, IllegalAccessException, J } /** - * Ldap認証の設定のテスト + * Ldap認証の設定の保存 * * @return * @throws InvalidParamException @@ -225,7 +225,7 @@ public Boundary check() throws InstantiationException, IllegalAccessException, J * @throws NoSuchAlgorithmException * @throws InvalidKeyException */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary save() throws InstantiationException, IllegalAccessException, JSONException, IOException, InvalidParamException, LdapException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException { @@ -283,7 +283,7 @@ public Boundary save() throws InstantiationException, IllegalAccessException, JS * * @return */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary delete() { LdapConfigsDao dao = LdapConfigsDao.get(); diff --git a/src/main/java/org/support/project/knowledge/control/admin/LoggingControl.java b/src/main/java/org/support/project/knowledge/control/admin/LoggingControl.java index 54eba00bc..b27a9d19a 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/LoggingControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/LoggingControl.java @@ -29,7 +29,7 @@ public class LoggingControl extends Control { /** ログ */ private static final Log LOG = LogFactory.getLog(LoggingControl.class); - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary index() { LOG.trace("index"); @@ -47,7 +47,7 @@ public Boundary index() { return forward("index.jsp"); } - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary delete_config() { LOG.trace("delete_config"); @@ -77,7 +77,7 @@ public Boundary delete_config() { return index(); } - @Get + @Get(subscribeToken = "admin") @Auth(roles = "admin") public Boundary download() throws FileNotFoundException, InvalidParamException { LOG.trace("download"); 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 99f4212ac..1c0dc901d 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 @@ -43,7 +43,7 @@ public class MailControl extends Control { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary config() { MailConfigsDao dao = MailConfigsDao.get(); @@ -69,7 +69,7 @@ public Boundary config() { * @throws NoSuchAlgorithmException * @throws InvalidKeyException */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary save() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException { @@ -123,7 +123,7 @@ public Boundary save() * * @return */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary delete() { MailConfigsDao dao = MailConfigsDao.get(); @@ -143,7 +143,7 @@ public Boundary delete() { * * @return */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary test_send() { MailConfigsDao mailConfigsDao = MailConfigsDao.get(); diff --git a/src/main/java/org/support/project/knowledge/control/admin/MailhookControl.java b/src/main/java/org/support/project/knowledge/control/admin/MailhookControl.java index 9282c92cc..a48319278 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/MailhookControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/MailhookControl.java @@ -51,7 +51,7 @@ public class MailhookControl extends Control { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary index() { MailHooksEntity entity = MailHooksDao.get().selectOnKey(MailhookLogic.MAIL_HOOK_ID); @@ -80,7 +80,7 @@ public Boundary index() { * @throws NoSuchAlgorithmException * @throws InvalidKeyException */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary save() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException { @@ -119,7 +119,7 @@ public Boundary save() throws InvalidKeyException, NoSuchAlgorithmException, NoS * * @return */ - @Get + @Get(subscribeToken = "admin") @Auth(roles = "admin") public Boundary check() { MailHooksEntity entity = MailHooksDao.get().selectOnKey(MailhookLogic.MAIL_HOOK_ID); @@ -139,7 +139,7 @@ public Boundary check() { * 設定削除 * @return */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary delete() { MailhookLogic.get().removeHook(MailhookLogic.MAIL_HOOK_ID); @@ -156,7 +156,7 @@ public Boundary delete() { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary hook() throws InvalidParamException { int conditionNo = getPathInteger(-1); @@ -194,7 +194,7 @@ public Boundary hook() throws InvalidParamException { * @throws IllegalAccessException * @throws InstantiationException */ - @Post(path = "admin.mailhook/hook") + @Post(path = "admin.mailhook/hook", subscribeToken = "admin") @Auth(roles = "admin") public Boundary saveHook() throws InvalidParamException, InstantiationException, IllegalAccessException, JSONException, IOException { LOG.trace("saveHook"); @@ -234,7 +234,7 @@ public Boundary saveHook() throws InvalidParamException, InstantiationException, * @throws JSONException * @throws IOException */ - @Post(path = "admin.mailhook/deleteHook") + @Post(path = "admin.mailhook/deleteHook", subscribeToken = "admin") @Auth(roles = "admin") public Boundary deleteHook() throws InvalidParamException, InstantiationException, IllegalAccessException, JSONException, IOException { Integer conditionNo = super.getParam("conditionNo", Integer.class); diff --git a/src/main/java/org/support/project/knowledge/control/admin/NoticeControl.java b/src/main/java/org/support/project/knowledge/control/admin/NoticeControl.java index 835f225f6..8c30c1e75 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/NoticeControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/NoticeControl.java @@ -10,7 +10,7 @@ public class NoticeControl extends Control { * 通知一覧画面を表示 * @return Boundary */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary list() { return forward("list.jsp"); 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 index 798bc61df..327a8a961 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/ProxyControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/ProxyControl.java @@ -34,7 +34,7 @@ public class ProxyControl extends Control { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary config() { ProxyConfigsDao dao = ProxyConfigsDao.get(); @@ -47,7 +47,7 @@ public Boundary config() { return forward("config.jsp"); } - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary save() throws Exception { List errors = new ArrayList<>(); @@ -92,7 +92,7 @@ public Boundary save() throws Exception { return config(); } - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary test() throws Exception { try { @@ -156,7 +156,7 @@ public Boundary test() throws Exception { return forward("config.jsp"); } - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary delete() throws Exception { ProxyConfigsDao dao = ProxyConfigsDao.get(); diff --git a/src/main/java/org/support/project/knowledge/control/admin/SystemConfigControl.java b/src/main/java/org/support/project/knowledge/control/admin/SystemConfigControl.java index 65e784274..acf6fbdaf 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/SystemConfigControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/SystemConfigControl.java @@ -12,7 +12,7 @@ @DI(instance = Instance.Prototype) public class SystemConfigControl extends Control { - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary index() { Boolean postgres = Boolean.FALSE; diff --git a/src/main/java/org/support/project/knowledge/control/admin/TemplateControl.java b/src/main/java/org/support/project/knowledge/control/admin/TemplateControl.java index 6752ec1da..8c2f581c2 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/TemplateControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/TemplateControl.java @@ -35,7 +35,7 @@ public class TemplateControl extends Control { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary list() { // テンプレートの個数はあまり多く出来ないようにする(でないと登録の画面が微妙) @@ -59,7 +59,7 @@ public int compare(TemplateMastersEntity o1, TemplateMastersEntity o2) { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary view_add() { return forward("view_add.jsp"); @@ -71,7 +71,7 @@ public Boundary view_add() { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary view_edit() throws InvalidParamException { Integer id = super.getPathInteger(); @@ -193,7 +193,7 @@ private TemplateMastersEntity loadParams(List errors) * @throws IllegalAccessException * @throws InstantiationException */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary create() throws InstantiationException, IllegalAccessException, JSONException, IOException, InvalidParamException { List errors = new ArrayList(); @@ -219,7 +219,7 @@ public Boundary create() throws InstantiationException, IllegalAccessException, * @throws IllegalAccessException * @throws InstantiationException */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary update() throws InstantiationException, IllegalAccessException, JSONException, IOException, InvalidParamException { List errors = new ArrayList(); @@ -245,7 +245,7 @@ public Boundary update() throws InstantiationException, IllegalAccessException, * @return * @throws Exception */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary delete() throws Exception { Integer typeId = getParam("typeId", Integer.class); diff --git a/src/main/java/org/support/project/knowledge/control/admin/UsersControl.java b/src/main/java/org/support/project/knowledge/control/admin/UsersControl.java index a519f9f27..124343514 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/UsersControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/UsersControl.java @@ -39,7 +39,7 @@ public class UsersControl extends Control { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary list() throws InvalidParamException { Integer offset = super.getPathInteger(0); @@ -57,7 +57,7 @@ public Boundary list() throws InvalidParamException { * @param keyword * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") private Boundary list(Integer offset, String keyword) { UsersDao dao = UsersDao.get(); @@ -83,7 +83,7 @@ private Boundary list(Integer offset, String keyword) { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary view_add() { String offset = super.getParam("offset", String.class); @@ -143,7 +143,7 @@ private void setSystemRoles(UsersEntity user) { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary view_edit() throws InvalidParamException { String offset = super.getParam("offset", String.class); @@ -174,7 +174,7 @@ public Boundary view_edit() throws InvalidParamException { * * @return */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary create() { String offset = super.getParam("offset", String.class); @@ -225,7 +225,7 @@ public Boundary create() { * * @return */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary save() { String offset = super.getParam("offset", String.class); @@ -290,7 +290,7 @@ public Boundary save() { * @return * @throws Exception */ - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary delete() throws Exception { String offset = super.getParam("offset", String.class); @@ -317,7 +317,7 @@ public Boundary delete() throws Exception { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary accept_list() { ProvisionalRegistrationsDao dao = ProvisionalRegistrationsDao.get(); @@ -331,7 +331,7 @@ public Boundary accept_list() { * * @return */ - @Get + @Get(subscribeToken = "admin") @Auth(roles = "admin") public Boundary accept() { String id = getPathInfo(); @@ -365,4 +365,33 @@ public Boundary accept() { return accept_list(); } + /** + * 承認待ちユーザ削除 + * + * @return + */ + @Get(subscribeToken = "admin") + @Auth(roles = "admin") + public Boundary accept_delete() { + String id = getPathInfo(); + if (StringUtils.isEmpty(id)) { + return accept_list(); + } + if (id.startsWith("/")) { + id = id.substring(1); + } + + ProvisionalRegistrationsDao dao = ProvisionalRegistrationsDao.get(); + ProvisionalRegistrationsEntity entity = dao.selectOnKey(id); + if (entity == null) { + // 削除する仮登録情報が見つかりませんでした。(他の管理者が削除) + addMsgWarn("message.allready.deleted"); + return accept_list(); + } + + dao.delete(entity); + addMsgSuccess("message.success.delete"); + + return accept_list(); + } } diff --git a/src/main/java/org/support/project/knowledge/control/admin/WebhookControl.java b/src/main/java/org/support/project/knowledge/control/admin/WebhookControl.java index 53db52549..f41b47be9 100644 --- a/src/main/java/org/support/project/knowledge/control/admin/WebhookControl.java +++ b/src/main/java/org/support/project/knowledge/control/admin/WebhookControl.java @@ -32,7 +32,7 @@ public class WebhookControl extends Control { * * @return */ - @Get + @Get(publishToken = "admin") @Auth(roles = "admin") public Boundary config() { WebhookConfigsDao dao = WebhookConfigsDao.get(); @@ -42,7 +42,7 @@ public Boundary config() { return forward("config.jsp"); } - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary save() throws Exception { WebhookConfigsDao dao = WebhookConfigsDao.get(); @@ -84,7 +84,7 @@ public Boundary save() throws Exception { return config(); } - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary test() throws Exception { ProxyConfigsDao proxyConfigDao = ProxyConfigsDao.get(); @@ -117,7 +117,7 @@ public Boundary test() throws Exception { return config(); } - @Post + @Post(subscribeToken = "admin") @Auth(roles = "admin") public Boundary delete() throws Exception { WebhookConfigsDao dao = WebhookConfigsDao.get(); diff --git a/src/main/java/org/support/project/knowledge/control/open/FileControl.java b/src/main/java/org/support/project/knowledge/control/open/FileControl.java index b8bcf73a1..379919106 100644 --- a/src/main/java/org/support/project/knowledge/control/open/FileControl.java +++ b/src/main/java/org/support/project/knowledge/control/open/FileControl.java @@ -33,6 +33,10 @@ public Boundary download() { if (entity == null) { return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND"); } + if (entity.getFileBinary() == null) { + LOG.debug("File binary is null. [fileNo] " + fileNo); + return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND"); + } return download(entity.getFileName(), entity.getFileBinary(), entity.getFileSize().longValue()); } 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 6453913b6..63906d9b9 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,6 +14,7 @@ import org.support.project.knowledge.config.SystemConfig; import org.support.project.knowledge.control.KnowledgeControlBase; import org.support.project.knowledge.dao.CommentsDao; +import org.support.project.knowledge.dao.DraftItemValuesDao; import org.support.project.knowledge.dao.ExGroupsDao; import org.support.project.knowledge.dao.KnowledgeHistoriesDao; import org.support.project.knowledge.dao.KnowledgeItemValuesDao; @@ -23,6 +24,7 @@ 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.DraftItemValuesEntity; import org.support.project.knowledge.entity.KnowledgeHistoriesEntity; import org.support.project.knowledge.entity.KnowledgeItemValuesEntity; import org.support.project.knowledge.entity.KnowledgesEntity; @@ -82,7 +84,7 @@ public class KnowledgeControl extends KnowledgeControlBase { * @throws InvalidParamException * @throws ParseException */ - @Get + @Get(publishToken = "knowledge") public Boundary view() throws InvalidParamException, ParseException { // 共通処理呼の表示条件の保持の呼び出し setViewParam(); @@ -574,7 +576,7 @@ public Boundary stocks() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Post public Boundary like() throws InvalidParamException { Long knowledgeId = super.getPathLong(Long.valueOf(-1)); KnowledgeLogic knowledgeLogic = KnowledgeLogic.get(); @@ -792,8 +794,20 @@ public Boundary template() throws InvalidParamException { template = TemplateMastersDao.get().selectWithItems(typeId); } + String draftId = super.getParam("draft_id"); String knowledgeId = super.getParam("knowledge_id"); - if (StringUtils.isNotEmpty(knowledgeId) && StringUtils.isLong(knowledgeId)) { + if (StringUtils.isNotEmpty(draftId) && StringUtils.isLong(draftId)) { + List values = DraftItemValuesDao.get().selectOnDraftId(new Long(draftId)); + List items = template.getItems(); + for (DraftItemValuesEntity val : values) { + for (TemplateItemsEntity item : items) { + if (val.getItemNo().equals(item.getItemNo())) { + item.setItemValue(val.getItemValue()); + break; + } + } + } + } else if (StringUtils.isNotEmpty(knowledgeId) && StringUtils.isLong(knowledgeId)) { KnowledgeLogic knowledgeLogic = KnowledgeLogic.get(); KnowledgesEntity entity = knowledgeLogic.select(new Long(knowledgeId), getLoginedUser()); if (entity == null) { diff --git a/src/main/java/org/support/project/knowledge/control/open/PasswordInitializationControl.java b/src/main/java/org/support/project/knowledge/control/open/PasswordInitializationControl.java index b92719b35..e31a0d33c 100644 --- a/src/main/java/org/support/project/knowledge/control/open/PasswordInitializationControl.java +++ b/src/main/java/org/support/project/knowledge/control/open/PasswordInitializationControl.java @@ -29,7 +29,7 @@ public class PasswordInitializationControl extends Control { * * @return */ - @Get + @Get(publishToken = "knowledge") public Boundary view() { return forward("forgot_pass_request.jsp"); } @@ -39,7 +39,7 @@ public Boundary view() { * * @return */ - @Post + @Post(subscribeToken = "knowledge") public Boundary request() { String email = getParam("username"); @@ -82,7 +82,7 @@ public Boundary request() { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary init() throws InvalidParamException { String key = getPathString(); PasswordResetsDao resetsDao = PasswordResetsDao.get(); @@ -105,7 +105,7 @@ public Boundary init() throws InvalidParamException { * * @return */ - @Post + @Post(subscribeToken = "knowledge") public Boundary change() { String key = getParam("key"); PasswordResetsDao resetsDao = PasswordResetsDao.get(); diff --git a/src/main/java/org/support/project/knowledge/control/open/SignupControl.java b/src/main/java/org/support/project/knowledge/control/open/SignupControl.java index 616d012c3..5af0ff2ec 100644 --- a/src/main/java/org/support/project/knowledge/control/open/SignupControl.java +++ b/src/main/java/org/support/project/knowledge/control/open/SignupControl.java @@ -42,7 +42,7 @@ public class SignupControl extends Control { * * @return */ - @Get + @Get(publishToken = "knowledge") public Boundary view() { return forward("signup.jsp"); } @@ -52,7 +52,7 @@ public Boundary view() { * * @return */ - @Post + @Post(subscribeToken = "knowledge") public Boundary save() { SystemConfigsDao systemConfigsDao = SystemConfigsDao.get(); SystemConfigsEntity userAddType = systemConfigsDao.selectOnKey(SystemConfig.USER_ADD_TYPE, AppConfig.get().getSystemName()); @@ -123,7 +123,7 @@ public Boundary save() { * * @return */ - @Post + @Post(subscribeToken = "knowledge") @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) private ProvisionalRegistrationsEntity addProvisionalRegistration() { ProvisionalRegistrationsEntity entity = super.getParams(ProvisionalRegistrationsEntity.class); diff --git a/src/main/java/org/support/project/knowledge/control/open/ThemaControl.java b/src/main/java/org/support/project/knowledge/control/open/ThemaControl.java index ebb6ad8f2..613ebe434 100644 --- a/src/main/java/org/support/project/knowledge/control/open/ThemaControl.java +++ b/src/main/java/org/support/project/knowledge/control/open/ThemaControl.java @@ -13,11 +13,13 @@ public class ThemaControl extends Control { @Get public Boundary list() { + getResponse().setHeader("X-Frame-Options", "SAMEORIGIN"); return forward("list.jsp"); } @Get public Boundary show() { + getResponse().setHeader("X-Frame-Options", "SAMEORIGIN"); String thema = getPathInfo(); if (StringUtils.isEmpty(thema)) { thema = "flatly"; @@ -34,6 +36,7 @@ public Boundary show() { @Get public Boundary enable() { + getResponse().setHeader("X-Frame-Options", "SAMEORIGIN"); String thema = getPathInfo(); if (StringUtils.isEmpty(thema)) { thema = "flatly"; @@ -48,6 +51,7 @@ public Boundary enable() { @Get public Boundary highlight() { + getResponse().setHeader("X-Frame-Options", "SAMEORIGIN"); String thema = getPathInfo(); if (StringUtils.isEmpty(thema)) { thema = "dark"; @@ -64,6 +68,7 @@ public Boundary highlight() { @Get public Boundary style() { + getResponse().setHeader("X-Frame-Options", "SAMEORIGIN"); String thema = getPathInfo(); if (StringUtils.isEmpty(thema)) { thema = "dark"; diff --git a/src/main/java/org/support/project/knowledge/control/protect/AccountControl.java b/src/main/java/org/support/project/knowledge/control/protect/AccountControl.java index 290f6b91b..be3a42948 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/AccountControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/AccountControl.java @@ -5,12 +5,14 @@ import java.util.List; import java.util.Map; +import org.apache.commons.codec.binary.Base64; import org.apache.commons.fileupload.FileItem; import org.support.project.common.bean.ValidateError; import org.support.project.common.config.INT_FLAG; import org.support.project.common.exception.ParseException; import org.support.project.common.log.Log; import org.support.project.common.log.LogFactory; +import org.support.project.common.util.Base64Utils; import org.support.project.common.util.StringUtils; import org.support.project.common.validate.Validator; import org.support.project.common.validate.ValidatorFactory; @@ -52,7 +54,7 @@ public class AccountControl extends Control { /** * アカウント情報表示 */ - @Get + @Get(publishToken = "account") @Override public Boundary index() { SystemConfigsDao dao = SystemConfigsDao.get(); @@ -86,7 +88,7 @@ public Boundary index() { * @throws ScanException * @throws PolicyException */ - @Post + @Post(subscribeToken = "account", checkReqToken = true) public Boundary update() throws ParseException { SystemConfigsDao systemConfigsDao = SystemConfigsDao.get(); @@ -165,7 +167,7 @@ public Boundary update() throws ParseException { * * @return */ - @Get + @Get(publishToken = "withdrawal") public Boundary withdrawal() { return forward("withdrawal.jsp"); } @@ -176,7 +178,7 @@ public Boundary withdrawal() { * @return * @throws Exception */ - @Post + @Post(subscribeToken = "withdrawal", checkReqToken = true) public Boundary delete() throws Exception { // アカウント削除(退会処理) boolean knowledgeRemove = true; @@ -200,53 +202,31 @@ public Boundary delete() throws Exception { * @return * @throws IOException */ - @Post + @Post(subscribeToken = "account") public Boundary iconupload() throws IOException { AccountLogic logic = AccountLogic.get(); - UploadResults results = new UploadResults(); - List files = new ArrayList(); - Object obj = getParam("files[]", Object.class); - if (obj instanceof FileItem) { - FileItem fileItem = (FileItem) obj; - ValidateError error = checkFile(fileItem); - if (error != null) { + String fileimg = getParam("fileimg"); + if (StringUtils.isEmpty(fileimg)) { + ValidateError error = new ValidateError("errors.required", "Image"); + Msg msg = new Msg(error.getMsg(HttpUtil.getLocale(getRequest()))); + return send(HttpStatus.SC_400_BAD_REQUEST, msg); + } + + if (fileimg.startsWith("data:image/png;base64,")) { + fileimg = fileimg.substring("data:image/png;base64,".length()); + byte[] img = Base64.decodeBase64(fileimg); + + if (img.length > 5 * 1024 * 1024) { + ValidateError error = new ValidateError("errors.maxfilesize", "5MB"); Msg msg = new Msg(error.getMsg(HttpUtil.getLocale(getRequest()))); return send(HttpStatus.SC_400_BAD_REQUEST, msg); } - UploadFile file = logic.saveIconImage(fileItem, getLoginedUser(), getRequest().getContextPath()); - files.add(file); - } else if (obj instanceof List) { - @SuppressWarnings("unchecked") - List fileItems = (List) obj; - for (FileItem fileItem : fileItems) { - ValidateError error = checkFile(fileItem); - if (error != null) { - Msg msg = new Msg(error.getMsg(HttpUtil.getLocale(getRequest()))); - return send(HttpStatus.SC_400_BAD_REQUEST, msg); - } - UploadFile file = logic.saveIconImage(fileItem, getLoginedUser(), getRequest().getContextPath()); - files.add(file); - } - } - results.setFiles(files); - return send(HttpStatus.SC_200_OK, results); - } - - /** - * アップロードされたファイルのチェック アイコン画像の拡張子チェック - * - * @param name - * @return - */ - private ValidateError checkFile(FileItem fileItem) { - if (fileItem.getSize() > 5 * 1024 * 1024) { - ValidateError error = new ValidateError("errors.maxfilesize", "5MB"); - return error; + + UploadFile file = logic.saveIconImage(img, getLoginedUser(), getRequest().getContextPath()); + return send(HttpStatus.SC_200_OK, file); } - - String name = fileItem.getName(); - Validator validator = ValidatorFactory.getInstance(Validator.EXTENSION); - return validator.validate(name, "icon", "png", "jpg", "jpeg", "gif"); + + return send(HttpStatus.SC_400_BAD_REQUEST, "data error"); } /** @@ -254,7 +234,7 @@ private ValidateError checkFile(FileItem fileItem) { * * @return */ - @Get + @Get(publishToken = "changekey") public Boundary changekey() { SystemConfigsDao dao = SystemConfigsDao.get(); SystemConfigsEntity userAddType = dao.selectOnKey(SystemConfig.USER_ADD_TYPE, AppConfig.get().getSystemName()); @@ -266,7 +246,6 @@ public Boundary changekey() { return sendError(HttpStatus.SC_403_FORBIDDEN, "FORBIDDEN"); } // ダブルオプトインでユーザ登録をしている場合のみ、メールアドレス変更通知にてアドレスを変更する - return forward("changekey.jsp"); } @@ -275,7 +254,7 @@ public Boundary changekey() { * * @return */ - @Post + @Post(subscribeToken = "changekey", checkReqToken = true) public Boundary changerequest() { SystemConfigsDao dao = SystemConfigsDao.get(); SystemConfigsEntity userAddType = dao.selectOnKey(SystemConfig.USER_ADD_TYPE, AppConfig.get().getSystemName()); @@ -305,7 +284,7 @@ public Boundary changerequest() { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary confirm_mail() throws InvalidParamException { // メールアドレス変更ができるのは、ダブルオプトインでユーザ登録する設定になっている場合のみ SystemConfigsDao dao = SystemConfigsDao.get(); @@ -337,7 +316,7 @@ public Boundary confirm_mail() throws InvalidParamException { * デフォルトの公開範囲を表示 * @return */ - @Get + @Get(publishToken = "knowledge") public Boundary targets() { UserConfigsEntity publicFlag = UserConfigsDao.get().physicalSelectOnKey( "DEFAULT_PUBLIC_FLAG", AppConfig.get().getSystemName(), getLoginUserId()); @@ -357,7 +336,7 @@ public Boundary targets() { } - @Post + @Post(subscribeToken = "knowledge") public Boundary savetargets() { String publicFlag = getParam("publicFlag"); String viewers = getParam("viewers"); diff --git a/src/main/java/org/support/project/knowledge/control/protect/DraftControl.java b/src/main/java/org/support/project/knowledge/control/protect/DraftControl.java new file mode 100644 index 000000000..1ccf8f8dd --- /dev/null +++ b/src/main/java/org/support/project/knowledge/control/protect/DraftControl.java @@ -0,0 +1,93 @@ +package org.support.project.knowledge.control.protect; + +import java.util.List; + +import org.support.project.knowledge.control.KnowledgeControlBase; +import org.support.project.knowledge.dao.DraftItemValuesDao; +import org.support.project.knowledge.dao.DraftKnowledgesDao; +import org.support.project.knowledge.entity.DraftKnowledgesEntity; +import org.support.project.web.boundary.Boundary; +import org.support.project.web.common.HttpStatus; +import org.support.project.web.config.MessageStatus; +import org.support.project.web.control.service.Delete; +import org.support.project.web.control.service.Get; +import org.support.project.web.exception.InvalidParamException; + +public class DraftControl extends KnowledgeControlBase { + /** 一覧の表示件数 */ + public static final int PAGE_LIMIT = 20; + + /** + * 下書きの一覧 + * @return + * @throws InvalidParamException + */ + @Get(publishToken = "knowledge") + public Boundary list() throws InvalidParamException { + Integer page = super.getPathInteger(0); + int previous = page - 1; + if (previous < 0) { + previous = 0; + } + setAttribute("offset", page); + setAttribute("previous", previous); + setAttribute("next", page + 1); + int offset = page * PAGE_LIMIT; + + List drafts = DraftKnowledgesDao.get().selectOnUser(super.getLoginUserId(), PAGE_LIMIT, offset); + setAttribute("drafts", drafts); + + return forward("drafts.jsp"); + } + + + /** + * 下書きの表示 + * @return + * @throws InvalidParamException + */ + @Get(publishToken = "knowledge") + public Boundary view() throws InvalidParamException { + Long draftId = super.getPathLong(new Long(0)); + DraftKnowledgesEntity draft = DraftKnowledgesDao.get().selectOnKey(draftId); + // アクセス可能かチェック + if (draft == null) { + return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND"); + } + if (draft.getInsertUser().intValue() != getLoginUserId().intValue()) { + // 下書きは自分が登録したもののみ(他人と下書きは共有しない) TODO 共有したいことがあるかも?制御が複雑になるのでいったんはできない + addMsgWarn("message.authorize.error"); + return list(); + } + // ナレッジ編集画面を表示するために、必要な情報をそろえる + setAttributeForEditPage(); + + super.setDraftInfo(draft); + return forward("/protect/knowledge/edit.jsp"); + } + + /** + * 下書きの削除 + * @return + * @throws InvalidParamException + */ + @Delete(subscribeToken = "knowledge") + public Boundary delete() throws InvalidParamException { + Long draftId = super.getPathLong(new Long(0)); + DraftKnowledgesEntity draft = DraftKnowledgesDao.get().selectOnKey(draftId); + // アクセス可能かチェック + if (draft == null) { + sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND"); + } + if (draft.getInsertUser().intValue() != getLoginUserId().intValue()) { + return sendError(HttpStatus.SC_403_FORBIDDEN, "FORBIDDEN"); + } + DraftKnowledgesDao.get().physicalDelete(draft); + DraftItemValuesDao.get().deleteOnDraftId(draftId); + + return sendMsg(MessageStatus.Success, HttpStatus.SC_200_OK, + String.valueOf(draftId), "message.success.delete"); + + } + +} diff --git a/src/main/java/org/support/project/knowledge/control/protect/FileControl.java b/src/main/java/org/support/project/knowledge/control/protect/FileControl.java index 5790f8d8f..faefaf9bd 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/FileControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/FileControl.java @@ -7,11 +7,13 @@ import org.support.project.common.bean.ValidateError; import org.support.project.common.log.Log; import org.support.project.common.log.LogFactory; +import org.support.project.common.util.StringUtils; import org.support.project.di.DI; import org.support.project.di.Instance; import org.support.project.knowledge.control.Control; import org.support.project.knowledge.dao.KnowledgeFilesDao; import org.support.project.knowledge.entity.KnowledgeFilesEntity; +import org.support.project.knowledge.logic.KnowledgeLogic; import org.support.project.knowledge.logic.UploadedFileLogic; import org.support.project.knowledge.vo.UploadFile; import org.support.project.knowledge.vo.UploadResults; @@ -20,7 +22,7 @@ import org.support.project.web.boundary.JsonBoundary; import org.support.project.web.common.HttpStatus; import org.support.project.web.common.HttpUtil; -import org.support.project.web.control.service.Get; +import org.support.project.web.control.service.Delete; import org.support.project.web.control.service.Post; @DI(instance = Instance.Prototype) @@ -37,7 +39,7 @@ public class FileControl extends Control { * @return * @throws Exception */ - @Post + @Post(subscribeToken = "knowledge") public Boundary upload() throws Exception { UploadResults results = new UploadResults(); List files = new ArrayList(); @@ -68,27 +70,30 @@ public Boundary upload() throws Exception { return send(HttpStatus.SC_200_OK, results); } - @Get + @Delete(subscribeToken = "knowledge") public JsonBoundary delete() throws Exception { LOG.trace("delete()"); - - Long fileNo = getParam("fileNo", Long.class); + Long fileNo = getPathLong(); KnowledgeFilesEntity entity = filesDao.selectOnKeyWithoutBinary(fileNo); if (entity == null) { // 既に削除済 return send(HttpStatus.SC_200_OK, "success: " + fileNo); } - - if (!getLoginedUser().isAdmin()) { + + if (StringUtils.isEmpty(entity.getKnowledgeId()) || entity.getKnowledgeId() == 0) { + // 下書き中は、登録者のみ削除可能 if (entity.getInsertUser().intValue() != getLoginUserId().intValue()) { - // 登録者以外に削除はさせない + LOG.info("Login user is not created user."); + return send(HttpStatus.SC_400_BAD_REQUEST, "fail: " + fileNo); + } + } else { + if (!KnowledgeLogic.get().isEditor(getLoginedUser(), entity.getKnowledgeId())) { + // アクセス権が無い return send(HttpStatus.SC_400_BAD_REQUEST, "fail: " + fileNo); } } - // 削除実行 fileLogic.removeFile(fileNo, getLoginedUser()); - return send(HttpStatus.SC_200_OK, "success: " + fileNo); } diff --git a/src/main/java/org/support/project/knowledge/control/protect/GroupControl.java b/src/main/java/org/support/project/knowledge/control/protect/GroupControl.java index 3c6d2e598..18ca6139e 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/GroupControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/GroupControl.java @@ -50,7 +50,7 @@ public class GroupControl extends Control { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary mygroups() throws InvalidParamException { Integer offset = super.getPathInteger(0); @@ -75,7 +75,7 @@ public Boundary mygroups() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary list() throws InvalidParamException { Integer offset = super.getPathInteger(0); String keyword = super.getParam("keyword"); @@ -100,7 +100,7 @@ public Boundary list() throws InvalidParamException { * * @return */ - @Get + @Get(publishToken = "knowledge") public Boundary view_add() { return forward("add_group.jsp"); } @@ -113,7 +113,7 @@ public Boundary view_add() { * @throws ScanException * @throws PolicyException */ - @Post + @Post(subscribeToken = "knowledge") public Boundary add() throws ParseException { // 入力チェック GroupsEntity groupsEntity = new GroupsEntity(); @@ -144,7 +144,7 @@ public Boundary add() throws ParseException { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary view() throws InvalidParamException { Integer groupId = super.getPathInteger(0); GroupLogic groupLogic = GroupLogic.get(); @@ -194,7 +194,7 @@ public Boundary view() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary view_edit() throws InvalidParamException { Integer groupId = super.getPathInteger(0); GroupLogic groupLogic = GroupLogic.get(); @@ -215,7 +215,7 @@ public Boundary view_edit() throws InvalidParamException { * @throws ScanException * @throws PolicyException */ - @Post + @Post(subscribeToken = "knowledge") public Boundary update() throws ParseException { // 入力チェック GroupsEntity groupsEntity = new GroupsEntity(); @@ -248,7 +248,7 @@ public Boundary update() throws ParseException { * @return * @throws InvalidParamException */ - @Post + @Post(subscribeToken = "knowledge") public Boundary delete() throws InvalidParamException { Integer groupId = -1; String id = getParam("groupId"); @@ -275,7 +275,7 @@ public Boundary delete() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Get(subscribeToken = "knowledge") public Boundary unsubscribe() throws InvalidParamException { Integer groupId = super.getPathInteger(0); GroupLogic groupLogic = GroupLogic.get(); @@ -308,7 +308,7 @@ public Boundary unsubscribe() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Get(subscribeToken = "knowledge") public Boundary subscribe() throws InvalidParamException { Integer groupId = super.getPathInteger(0); GroupLogic groupLogic = GroupLogic.get(); @@ -338,7 +338,7 @@ public Boundary subscribe() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Get(subscribeToken = "knowledge") public Boundary request() throws InvalidParamException { Integer groupId = super.getPathInteger(0); GroupLogic groupLogic = GroupLogic.get(); @@ -363,7 +363,7 @@ public Boundary request() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Get(subscribeToken = "knowledge") public Boundary accept() throws InvalidParamException { Integer groupId = super.getPathInteger(0); String userIdstr = super.getParam("userId"); @@ -401,7 +401,7 @@ public Boundary accept() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Get(subscribeToken = "knowledge") public Boundary change() throws InvalidParamException { Integer groupId = super.getPathInteger(0); String userIdstr = super.getParam("userId"); @@ -503,7 +503,7 @@ public Boundary json() throws InvalidParamException { * * @return */ - @Post + @Post(subscribeToken = "knowledge") public Boundary addUsers() { Integer groupId = getParam("group", Integer.class); String users = getParam("users"); @@ -517,7 +517,7 @@ public Boundary addUsers() { * * @return */ - @Post + @Post(subscribeToken = "knowledge") public Boundary extractEmail() { String str = getParam("str"); Matcher m = Pattern.compile("[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+").matcher(str); @@ -537,7 +537,7 @@ public Boundary extractEmail() { * (メールアドレスの存在チェックができてしまうので、いったん管理者だけの機能にする) * @return */ - @Post + @Post(subscribeToken = "knowledge") @Auth(roles = "admin") public Boundary addUsersOnEmail() { Integer groupId = getParam("group", Integer.class); 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 1b9a5cccd..48a22e5d5 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 @@ -19,11 +19,13 @@ import org.support.project.knowledge.config.AppConfig; import org.support.project.knowledge.control.KnowledgeControlBase; import org.support.project.knowledge.dao.CommentsDao; +import org.support.project.knowledge.dao.DraftKnowledgesDao; import org.support.project.knowledge.dao.KnowledgesDao; import org.support.project.knowledge.dao.StockKnowledgesDao; 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.DraftKnowledgesEntity; import org.support.project.knowledge.entity.KnowledgesEntity; import org.support.project.knowledge.entity.StockKnowledgesEntity; import org.support.project.knowledge.entity.TagsEntity; @@ -33,6 +35,7 @@ import org.support.project.knowledge.logic.KnowledgeLogic; import org.support.project.knowledge.logic.TargetLogic; import org.support.project.knowledge.logic.UploadedFileLogic; +import org.support.project.knowledge.vo.KnowledgeData; import org.support.project.knowledge.vo.Stock; import org.support.project.knowledge.vo.UploadFile; import org.support.project.web.bean.LabelValue; @@ -46,6 +49,7 @@ import org.support.project.web.dao.UserConfigsDao; import org.support.project.web.entity.GroupsEntity; import org.support.project.web.entity.UserConfigsEntity; +import org.support.project.web.exception.AuthenticateException; import org.support.project.web.exception.InvalidParamException; import net.arnx.jsonic.JSON; @@ -63,25 +67,20 @@ public class KnowledgeControl extends KnowledgeControlBase { * * @return */ - @Get + @Get(publishToken = "knowledge") public Boundary view_add() { // 共通処理呼の表示条件の保持の呼び出し setViewParam(); + setAttributeForEditPage(); + setAttribute("typeId", KnowledgeLogic.TEMPLATE_TYPE_KNOWLEDGE); + String offset = super.getParam("offset", String.class); if (StringUtils.isEmpty(offset)) { offset = "0"; } setAttribute("offset", offset); - - List tagitems = TagsDao.get().selectAll(); - setAttribute("tagitems", tagitems); - - List templates = TemplateMastersDao.get().selectAll(); - setAttribute("templates", templates); - - setAttribute("typeId", KnowledgeLogic.TEMPLATE_TYPE_KNOWLEDGE); - + // グループが指定されてる場合はデフォルトで公開範囲と共同編集者を選択済みにする String groupId = super.getParam("group", String.class); if (StringUtils.isNotEmpty(groupId)) { @@ -115,7 +114,7 @@ public Boundary view_add() { setAttribute("publicFlag", KnowledgeLogic.PUBLIC_FLAG_PRIVATE); } } - return forward("view_add.jsp"); + return forward("edit.jsp"); } /** @@ -124,7 +123,7 @@ public Boundary view_add() { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary view_edit() throws InvalidParamException { // 共通処理呼の表示条件の保持の呼び出し setViewParam(); @@ -140,36 +139,39 @@ public Boundary view_edit() throws InvalidParamException { if (entity == null) { return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT_FOUND"); } - setAttributeOnProperty(entity); - - // ナレッジに紐づく添付ファイルを取得 - List files = fileLogic.selectOnKnowledgeIdWithoutCommentFiles(knowledgeId, getRequest().getContextPath()); - setAttribute("files", files); - - // 表示するグループを取得 - List groups = TargetLogic.get().selectTargetsOnKnowledgeId(knowledgeId); - setAttribute("groups", groups); - - // 共同編集者 - List editors = TargetLogic.get().selectEditorsOnKnowledgeId(knowledgeId); - setAttribute("editors", editors); - // 編集権限チェック - LoginedUser loginedUser = super.getLoginedUser(); - boolean edit = knowledgeLogic.isEditor(loginedUser, entity, editors); - if (!edit) { - setAttribute("edit", false); - addMsgWarn("knowledge.edit.noaccess"); - // return forward("/open/knowledge/view.jsp"); - return devolution(HttpMethod.get, "open.Knowledge/view", String.valueOf(knowledgeId)); + + // 下書きが保存されている場合、下書きの内容を読み込む + DraftKnowledgesEntity draft = DraftKnowledgesDao.get().selectOnKnowledgeAndUser(knowledgeId, getLoginUserId()); + if (draft != null) { + super.setDraftInfo(draft); + } else { + // ナレッジに紐づく添付ファイルを取得 + List files = fileLogic.selectOnKnowledgeIdWithoutCommentFiles(knowledgeId, getRequest().getContextPath()); + setAttribute("files", files); + + // 表示するグループを取得 + List groups = TargetLogic.get().selectTargetsOnKnowledgeId(knowledgeId); + setAttribute("groups", groups); + + // 共同編集者 + List editors = TargetLogic.get().selectEditorsOnKnowledgeId(knowledgeId); + setAttribute("editors", editors); + + // 編集権限チェック + LoginedUser loginedUser = super.getLoginedUser(); + boolean edit = knowledgeLogic.isEditor(loginedUser, entity, editors); + if (!edit) { + setAttribute("edit", false); + addMsgWarn("knowledge.edit.noaccess"); + // return forward("/open/knowledge/view.jsp"); + return devolution(HttpMethod.get, "open.Knowledge/view", String.valueOf(knowledgeId)); + } + setAttributeOnProperty(entity); } - - List tagitems = TagsDao.get().selectAll(); - setAttribute("tagitems", tagitems); - - List templates = TemplateMastersDao.get().selectAll(); - setAttribute("templates", templates); - - return forward("view_edit.jsp"); + + setAttributeForEditPage(); + + return forward("edit.jsp"); } /** @@ -179,38 +181,13 @@ public Boundary view_edit() throws InvalidParamException { * @throws Exception * @throws ParseException */ - @Post - public Boundary add(KnowledgesEntity entity) throws Exception, ParseException { - // 共通処理呼の表示条件の保持の呼び出し - setViewParam(); - - String groupsstr = super.getParam("groups"); - String[] targets = groupsstr.split(","); - // List groups = GroupLogic.get().selectGroups(targets); - List groups = TargetLogic.get().selectTargets(targets); - setAttribute("groups", groups); - - String editorsstr = super.getParam("editors"); - String[] editordids = editorsstr.split(","); - List editors = TargetLogic.get().selectTargets(editordids); - setAttribute("editors", editors); - - List tagitems = TagsDao.get().selectAll(); - setAttribute("tagitems", tagitems); - - List fileNos = new ArrayList(); - String[] filesArray = getParam("files", String[].class); - if (filesArray != null) { - for (String string : filesArray) { - if (StringUtils.isLong(string)) { - fileNos.add(new Long(string)); - } - } + private Boundary add(KnowledgesEntity entity) throws Exception, ParseException { + List errors = entity.validate(); + if (!errors.isEmpty()) { + // 入力エラー + return sendValidateError(errors); } - List templates = TemplateMastersDao.get().selectAll(); - setAttribute("templates", templates); - TemplateMastersEntity template = TemplateMastersDao.get().selectWithItems(entity.getTypeId()); List items = template.getItems(); for (TemplateItemsEntity item : items) { @@ -222,25 +199,17 @@ public Boundary add(KnowledgesEntity entity) throws Exception, ParseException { item.setItemValue(itemValue); } } - - List errors = entity.validate(); - if (!errors.isEmpty()) { - // 入力エラー - return sendValidateError(errors); - } + + KnowledgeData data = KnowledgeData.create( + entity, super.getParam("groups"), super.getParam("editors"), super.getParam("tagNames"), + getParam("files", String[].class), getParam("draftId", Long.class), template); + LOG.trace("save"); - String tags = super.getParam("tagNames"); - List tagList = knowledgeLogic.manegeTags(tags); - KnowledgesEntity insertedEntity = knowledgeLogic.insert(entity, tagList, fileNos, groups, editors, template, super.getLoginedUser()); - setAttributeOnProperty(insertedEntity); + KnowledgesEntity insertedEntity = knowledgeLogic.insert(data, super.getLoginedUser()); - List files = fileLogic.selectOnKnowledgeIdWithoutCommentFiles(insertedEntity.getKnowledgeId(), getRequest().getContextPath()); - setAttribute("files", files); - - addMsgSuccess("message.success.insert"); - // return forward("view_edit.jsp"); - return sendMsg(MessageStatus.Success, HttpStatus.SC_200_OK, String.valueOf(insertedEntity.getKnowledgeId()), "message.success.insert"); + return sendMsg(MessageStatus.Success, HttpStatus.SC_200_OK, + String.valueOf(insertedEntity.getKnowledgeId()), "message.success.insert"); } /** @@ -249,37 +218,13 @@ public Boundary add(KnowledgesEntity entity) throws Exception, ParseException { * @return * @throws Exception */ - @Post - public Boundary update(KnowledgesEntity entity) throws Exception { - // 共通処理呼の表示条件の保持の呼び出し - setViewParam(); - - String groupsstr = super.getParam("groups"); - String[] targets = groupsstr.split(","); - List groups = TargetLogic.get().selectTargets(targets); - setAttribute("groups", groups); - - String editorsstr = super.getParam("editors"); - String[] editordids = editorsstr.split(","); - List editors = TargetLogic.get().selectTargets(editordids); - setAttribute("editors", editors); - - List tagitems = TagsDao.get().selectAll(); - setAttribute("tagitems", tagitems); - - List fileNos = new ArrayList(); - String[] filesArray = getParam("files", String[].class); - if (filesArray != null) { - for (String string : filesArray) { - if (StringUtils.isLong(string)) { - fileNos.add(new Long(string)); - } - } + private Boundary update(KnowledgesEntity entity) throws Exception { + List errors = entity.validate(); + if (!errors.isEmpty()) { + // 入力エラー + return sendValidateError(errors); } - List templates = TemplateMastersDao.get().selectAll(); - setAttribute("templates", templates); - TemplateMastersEntity template = TemplateMastersDao.get().selectWithItems(entity.getTypeId()); List items = template.getItems(); for (TemplateItemsEntity item : items) { @@ -292,19 +237,17 @@ public Boundary update(KnowledgesEntity entity) throws Exception { } } + KnowledgeData data = KnowledgeData.create( + entity, super.getParam("groups"), super.getParam("editors"), super.getParam("tagNames"), + getParam("files", String[].class), getParam("draftId", Long.class), template); + KnowledgesDao dao = Container.getComp(KnowledgesDao.class); - List errors = entity.validate(); - if (!errors.isEmpty()) { - // 入力エラー - return sendValidateError(errors); - } - KnowledgesEntity check = dao.selectOnKey(entity.getKnowledgeId()); if (check == null) { return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT_FOUND"); } // 編集権限チェック - if (!knowledgeLogic.isEditor(super.getLoginedUser(), check, editors)) { + if (!knowledgeLogic.isEditor(super.getLoginedUser(), check, data.getEditors())) { setAttribute("edit", false); addMsgWarn("knowledge.edit.noaccess"); // return devolution(HttpMethod.get, "open.Knowledge/view", String.valueOf(entity.getKnowledgeId())); @@ -314,28 +257,82 @@ public Boundary update(KnowledgesEntity entity) throws Exception { return sendValidateError(errors); } - LOG.trace("save"); - String tags = super.getParam("tagNames"); - List tagList = knowledgeLogic.manegeTags(tags); - - KnowledgesEntity updatedEntity = knowledgeLogic.update(entity, tagList, fileNos, groups, editors, template, super.getLoginedUser()); - setAttributeOnProperty(updatedEntity); - addMsgSuccess("message.success.update"); - - List files = fileLogic.selectOnKnowledgeIdWithoutCommentFiles(updatedEntity.getKnowledgeId(), getRequest().getContextPath()); - setAttribute("files", files); + if (!StringUtils.isEmpty(getParam("updateContent")) && getParam("updateContent").toLowerCase().equals("true")) { + data.setUpdateContent(true); + LOG.debug("コンテンツを更新した"); + } else { + data.setUpdateContent(false); + LOG.debug("メタデータのみ更新"); + } + + KnowledgesEntity updatedEntity = knowledgeLogic.update(data, super.getLoginedUser()); + + if (data.isUpdateContent()) { + return sendMsg(MessageStatus.Success, HttpStatus.SC_200_OK, + String.valueOf(updatedEntity.getKnowledgeId()), "knowledge.edit.update.content"); + } else { + return sendMsg(MessageStatus.Success, HttpStatus.SC_200_OK, + String.valueOf(updatedEntity.getKnowledgeId()), "knowledge.edit.update.meta"); + } + } - // return forward("view_edit.jsp"); - return sendMsg(MessageStatus.Success, HttpStatus.SC_200_OK, String.valueOf(updatedEntity.getKnowledgeId()), "message.success.update"); + /** + * Knowledgeの保存 + * @param entity Knowledge information + * @return Boundary + * @throws Exception Exception + */ + @Post(subscribeToken = "knowledge") + public Boundary save(KnowledgesEntity entity) throws Exception { + if (entity.getKnowledgeId() != null && entity.getKnowledgeId() > 1) { + return update(entity); + } else { + return add(entity); + } } + /** + * 下書き保存 + * @param entity Knowledge information + * @return Boundary + * @throws Exception Exception + */ + @Post(subscribeToken = "knowledge") + public Boundary draft() throws Exception { + DraftKnowledgesEntity draft = getParamOnProperty(DraftKnowledgesEntity.class); + draft.setAccesses(super.getParam("groups")); + draft.setEditors(super.getParam("editors")); + draft.setTagNames(super.getParam("tagNames")); + String[] files = getParam("files", String[].class); + + TemplateMastersEntity template = TemplateMastersDao.get().selectWithItems(draft.getTypeId()); + List items = template.getItems(); + for (TemplateItemsEntity item : items) { + String itemValue = super.getParam("item_" + item.getItemNo()); + if (itemValue.startsWith("[") && itemValue.endsWith("]")) { + itemValue = itemValue.substring(1, itemValue.length() - 1); + item.setItemValue(itemValue); + } else { + item.setItemValue(itemValue); + } + } + try { + draft = knowledgeLogic.draft(draft, template, files, super.getLoginedUser()); + return sendMsg(MessageStatus.Success, HttpStatus.SC_200_OK, String.valueOf(draft.getDraftId()), "message.success.save"); + } catch (AuthenticateException e) { + // 編集権限が無い + return sendMsg(MessageStatus.Warning, HttpStatus.SC_403_FORBIDDEN, null, "knowledge.edit.noaccess"); + } + } + + /** * ナレッジを削除 * * @return * @throws Exception */ - @Post + @Post(subscribeToken = "knowledge") public Boundary delete() throws Exception { // 共通処理呼の表示条件の保持の呼び出し setViewParam(); @@ -382,7 +379,7 @@ public Boundary delete() throws Exception { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary view() throws InvalidParamException { // 共通処理呼の表示条件の保持の呼び出し setViewParam(); @@ -397,7 +394,7 @@ public Boundary view() throws InvalidParamException { * @return * @throws Exception */ - @Post + @Post(subscribeToken = "knowledge") public Boundary comment() throws Exception { // 共通処理呼の表示条件の保持の呼び出し String params = setViewParam(); @@ -455,7 +452,7 @@ public Boundary comment() throws Exception { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary view_targets() throws InvalidParamException { Long knowledgeId = super.getPathLong(Long.valueOf(-1)); List groups = TargetLogic.get().selectTargetsOnKnowledgeId(knowledgeId); @@ -468,7 +465,7 @@ public Boundary view_targets() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary edit_comment() throws InvalidParamException { Long commentNo = super.getPathLong(Long.valueOf(-1)); CommentsDao commentsDao = CommentsDao.get(); @@ -522,7 +519,7 @@ public Boundary edit_comment() throws InvalidParamException { * @return * @throws Exception */ - @Post + @Post(subscribeToken = "knowledge") public Boundary update_comment() throws Exception { List fileNos = new ArrayList(); Object obj = getParam("files", Object.class); @@ -600,7 +597,7 @@ public Boundary update_comment() throws Exception { * @return * @throws Exception */ - @Get + @Get(subscribeToken = "knowledge") public Boundary delete_comment() throws Exception { Long commentNo = super.getPathLong(Long.valueOf(-1)); CommentsDao commentsDao = CommentsDao.get(); @@ -640,7 +637,7 @@ public Boundary delete_comment() throws Exception { * @throws IOException * @throws InvalidParamException */ - @Post + @Post(subscribeToken = "knowledge") public Boundary stock() throws IOException, InvalidParamException { Long knowledgeId = getPathLong(); if (LOG.isTraceEnabled()) { @@ -694,7 +691,7 @@ public Boundary stock() throws IOException, InvalidParamException { * @throws IOException * @throws InvalidParamException */ - @Post + @Post(subscribeToken = "knowledge") public Boundary collapse() throws IOException, InvalidParamException { Long commentNo = getParam("commentNo", Long.class); Integer collapse = getParam("collapse", Integer.class); diff --git a/src/main/java/org/support/project/knowledge/control/protect/NotifyControl.java b/src/main/java/org/support/project/knowledge/control/protect/NotifyControl.java index 6435f54c2..333bfb719 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/NotifyControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/NotifyControl.java @@ -24,7 +24,7 @@ public class NotifyControl extends Control { * @see org.support.project.web.control.Control#index() */ @Override - @Get + @Get(publishToken = "knowledge") public Boundary index() { NotifyConfigsDao notifyConfigsDao = NotifyConfigsDao.get(); NotifyConfigsEntity notifyConfigsEntity = notifyConfigsDao.selectOnKey(getLoginUserId()); @@ -35,7 +35,7 @@ public Boundary index() { return super.index(); } - @Post + @Post(subscribeToken = "knowledge") public Boundary save() throws InstantiationException, IllegalAccessException, JSONException, IOException, InvalidParamException { NotifyConfigsEntity entity = super.getParamOnProperty(NotifyConfigsEntity.class); NotifyConfigsDao notifyConfigsDao = NotifyConfigsDao.get(); diff --git a/src/main/java/org/support/project/knowledge/control/protect/StockControl.java b/src/main/java/org/support/project/knowledge/control/protect/StockControl.java index 9ab0e0d04..45e8de057 100644 --- a/src/main/java/org/support/project/knowledge/control/protect/StockControl.java +++ b/src/main/java/org/support/project/knowledge/control/protect/StockControl.java @@ -35,7 +35,7 @@ public class StockControl extends Control { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary mylist() throws InvalidParamException { Integer offset = super.getPathInteger(0); StocksDao stocksDao = StocksDao.get(); @@ -60,7 +60,7 @@ public Boundary mylist() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary add() throws InvalidParamException { return forward("add.jsp"); } @@ -75,7 +75,7 @@ public Boundary add() throws InvalidParamException { * @throws IllegalAccessException * @throws InstantiationException */ - @Post + @Post(subscribeToken = "knowledge") public Boundary insert() throws InvalidParamException, InstantiationException, IllegalAccessException, JSONException, IOException { StocksEntity stocksEntity = super.getParamOnProperty(StocksEntity.class); stocksEntity.setStockType(StocksEntity.STOCKTYPE_PRIVATE); @@ -99,7 +99,7 @@ public Boundary insert() throws InvalidParamException, InstantiationException, I * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary edit() throws InvalidParamException { Long stockId = super.getPathLong(new Long(0)); StocksDao stocksDao = StocksDao.get(); @@ -120,7 +120,7 @@ public Boundary edit() throws InvalidParamException { * @throws IllegalAccessException * @throws InstantiationException */ - @Post + @Post(subscribeToken = "knowledge") public Boundary update() throws InvalidParamException, InstantiationException, IllegalAccessException, JSONException, IOException { StocksEntity stocksEntity = super.getParamOnProperty(StocksEntity.class); stocksEntity.setStockType(StocksEntity.STOCKTYPE_PRIVATE); @@ -148,7 +148,7 @@ public Boundary update() throws InvalidParamException, InstantiationException, I * @throws IllegalAccessException * @throws InstantiationException */ - @Post + @Post(subscribeToken = "knowledge") public Boundary delete() throws InvalidParamException, InstantiationException, IllegalAccessException, JSONException, IOException { StocksDao dao = StocksDao.get(); Long stockId = getParam("stockId", Long.class); @@ -165,7 +165,7 @@ public Boundary delete() throws InvalidParamException, InstantiationException, I * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary chooselist() throws InvalidParamException { Integer offset = super.getPathInteger(0); StocksDao stocksDao = StocksDao.get(); @@ -181,7 +181,7 @@ public Boundary chooselist() throws InvalidParamException { * @return * @throws InvalidParamException */ - @Get + @Get(publishToken = "knowledge") public Boundary knowledge() throws InvalidParamException { Long stockId = getParam("stockId", Long.class); Integer offset = getParam("offset", Integer.class); diff --git a/src/main/java/org/support/project/knowledge/dao/DraftItemValuesDao.java b/src/main/java/org/support/project/knowledge/dao/DraftItemValuesDao.java new file mode 100644 index 000000000..4e16779fa --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/DraftItemValuesDao.java @@ -0,0 +1,38 @@ +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.GenDraftItemValuesDao; + +/** + * ナレッジの項目値 + */ +@DI(instance = Instance.Singleton) +public class DraftItemValuesDao extends GenDraftItemValuesDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + /** + * Get instance from DI container. + * @return instance + */ + public static DraftItemValuesDao get() { + return Container.getComp(DraftItemValuesDao.class); + } + + /** + * 下書きのテンプレート拡張項目値を削除 + * @param draftId + * @return + */ + public int deleteOnDraftId(Long draftId) { + String sql = "DELETE FROM DRAFT_ITEM_VALUES WHERE DRAFT_ID = ?"; + return super.executeUpdate(sql, draftId); + } + + + + +} diff --git a/src/main/java/org/support/project/knowledge/dao/DraftKnowledgesDao.java b/src/main/java/org/support/project/knowledge/dao/DraftKnowledgesDao.java new file mode 100644 index 000000000..b8a38325f --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/DraftKnowledgesDao.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.GenDraftKnowledgesDao; +import org.support.project.knowledge.entity.DraftKnowledgesEntity; + +/** + * ナレッジの下書き + */ +@DI(instance = Instance.Singleton) +public class DraftKnowledgesDao extends GenDraftKnowledgesDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + /** + * Get instance from DI container. + * @return instance + */ + public static DraftKnowledgesDao get() { + return Container.getComp(DraftKnowledgesDao.class); + } + + public List selectOnUser(Integer loginUserId, int limit, int offset) { + String sql = "SELECT * FROM DRAFT_KNOWLEDGES WHERE INSERT_USER = ? limit ? offset ?"; + return super.executeQueryList(sql, DraftKnowledgesEntity.class, loginUserId, limit, offset); + } + + + public DraftKnowledgesEntity selectOnKnowledgeAndUser(Long knowledgeId, Integer loginUserId) { + String sql = "SELECT * FROM DRAFT_KNOWLEDGES WHERE INSERT_USER = ? AND KNOWLEDGE_ID = ?"; + return super.executeQuerySingle(sql, DraftKnowledgesEntity.class, loginUserId, knowledgeId); + } + + +} diff --git a/src/main/java/org/support/project/knowledge/dao/KnowledgeFilesDao.java b/src/main/java/org/support/project/knowledge/dao/KnowledgeFilesDao.java index 99d7b0d22..79d2f24e2 100644 --- a/src/main/java/org/support/project/knowledge/dao/KnowledgeFilesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/KnowledgeFilesDao.java @@ -38,19 +38,33 @@ public static KnowledgeFilesDao get() { */ public List selectOnKnowledgeId(Long knowledgeId) { StringBuilder sql = new StringBuilder(); - sql.append( - "SELECT FILE_NO, KNOWLEDGE_ID, COMMENT_NO, FILE_NAME, FILE_SIZE, PARSE_STATUS, " - + "INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG "); + sql.append("SELECT FILE_NO, KNOWLEDGE_ID, COMMENT_NO, DRAFT_ID, FILE_NAME, FILE_SIZE, PARSE_STATUS, "); + sql.append("INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG "); sql.append("FROM KNOWLEDGE_FILES WHERE KNOWLEDGE_ID = ?;"); return executeQueryList(sql.toString(), KnowledgeFilesEntity.class, knowledgeId); } - + + /** + * 下書きに紐づく添付ファイルを取得 + * @param draftId + * @return + */ + public List selectOnDraftId(Long draftId) { + StringBuilder sql = new StringBuilder(); + sql.append("SELECT FILE_NO, KNOWLEDGE_ID, COMMENT_NO, DRAFT_ID, FILE_NAME, FILE_SIZE, PARSE_STATUS, "); + sql.append("INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG "); + sql.append("FROM KNOWLEDGE_FILES WHERE DRAFT_ID = ?;"); + return executeQueryList(sql.toString(), KnowledgeFilesEntity.class, draftId); + } + + + /** * キーで1件取得 (ファイルのバイナリは取得しない) */ public KnowledgeFilesEntity selectOnKeyWithoutBinary(Long fileNo) { StringBuilder sql = new StringBuilder(); - sql.append("SELECT FILE_NO, KNOWLEDGE_ID, COMMENT_NO, FILE_NAME, FILE_SIZE, PARSE_STATUS, "); + sql.append("SELECT FILE_NO, KNOWLEDGE_ID, COMMENT_NO, DRAFT_ID, FILE_NAME, FILE_SIZE, PARSE_STATUS, "); sql.append("INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG "); sql.append("FROM KNOWLEDGE_FILES WHERE FILE_NO = ?;"); return executeQuerySingle(sql.toString(), KnowledgeFilesEntity.class, fileNo); @@ -74,11 +88,12 @@ public void connectKnowledge(Long fileNo, Long knowledgeId, Long commentNo, Logi /** * ナレッジに紐づいていないファイルで、かつ更新日が24時間前のものは削除する + * 下書きに紐付いているものも削除しない */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) public int deleteNotConnectFiles() { StringBuilder sql = new StringBuilder(); - sql.append("DELETE FROM KNOWLEDGE_FILES WHERE KNOWLEDGE_ID IS NULL AND UPDATE_DATETIME < ? "); + sql.append("DELETE FROM KNOWLEDGE_FILES WHERE KNOWLEDGE_ID IS NULL AND DRAFT_ID IS NULL AND UPDATE_DATETIME < ? "); Timestamp timestamp = new Timestamp(new Date().getTime() - (1000 * 60 * 60 * 24)); int count = executeUpdate(sql.toString(), timestamp); return count; @@ -91,8 +106,8 @@ public int deleteNotConnectFiles() { */ public List selectWaitStateFiles() { StringBuilder sql = new StringBuilder(); - sql.append( - "SELECT FILE_NO, KNOWLEDGE_ID, COMMENT_NO, FILE_NAME, FILE_SIZE, INSERT_USER, INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG "); + sql.append("SELECT FILE_NO, KNOWLEDGE_ID, COMMENT_NO, FILE_NAME, DRAFT_ID, FILE_SIZE, INSERT_USER, "); + sql.append("INSERT_DATETIME, UPDATE_USER, UPDATE_DATETIME, DELETE_FLAG "); sql.append("FROM KNOWLEDGE_FILES WHERE PARSE_STATUS = 0 AND KNOWLEDGE_ID IS NOT NULL"); return executeQueryList(sql.toString(), KnowledgeFilesEntity.class); } @@ -113,4 +128,20 @@ public void changeStatus(Long fileNo, int parseStatus, Integer updateUserId) { executeUpdate(sql.toString(), parseStatus, updateUserId, new Timestamp(new Date().getTime()), fileNo); } + /** + * 下書きIDのセット + * @param entity ファイルEntity + * @param updateUserId 更新者 + */ + public void updateDraftId(KnowledgeFilesEntity entity, Integer updateUserId) { + StringBuilder sql = new StringBuilder(); + sql.append("UPDATE KNOWLEDGE_FILES "); + sql.append("SET DRAFT_ID = ?, KNOWLEDGE_ID = ?, UPDATE_USER = ?, UPDATE_DATETIME = ? "); + sql.append("WHERE FILE_NO = ? "); + executeUpdate(sql.toString(), entity.getDraftId(), entity.getKnowledgeId(), + updateUserId, new Timestamp(new Date().getTime()), entity.getFileNo()); + + } + + } diff --git a/src/main/java/org/support/project/knowledge/dao/gen/DatabaseControlDao.java b/src/main/java/org/support/project/knowledge/dao/gen/DatabaseControlDao.java new file mode 100644 index 000000000..f7f788a4e --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/gen/DatabaseControlDao.java @@ -0,0 +1,98 @@ +package org.support.project.knowledge.dao.gen; + +import org.support.project.ormapping.dao.AbstractDao; +import org.support.project.common.log.Log; +import org.support.project.common.log.LogFactory; +import org.support.project.di.DI; +import org.support.project.di.Instance; + +/** + * テンプレートの項目 + * this class is auto generate and not edit. + */ +@DI(instance = Instance.Singleton) +public class DatabaseControlDao extends AbstractDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + /** LOG */ + private static final Log LOG = LogFactory.getLog(DatabaseControlDao.class); + + /** Drop all tables */ + public void dropAllTable() { + String[] sqls = new String[30]; + sqls[0] = "DROP TABLE IF EXISTS KNOWLEDGES CASCADE;"; + sqls[1] = "DROP TABLE IF EXISTS ACCOUNT_IMAGES CASCADE;"; + sqls[2] = "DROP TABLE IF EXISTS MAIL_POSTS CASCADE;"; + sqls[3] = "DROP TABLE IF EXISTS WEBHOOK_CONFIGS CASCADE;"; + sqls[4] = "DROP TABLE IF EXISTS VOTES CASCADE;"; + sqls[5] = "DROP TABLE IF EXISTS COMMENTS CASCADE;"; + sqls[6] = "DROP TABLE IF EXISTS KNOWLEDGE_GROUPS CASCADE;"; + sqls[7] = "DROP TABLE IF EXISTS MAIL_HOOK_CONDITIONS CASCADE;"; + sqls[8] = "DROP TABLE IF EXISTS LIKES CASCADE;"; + sqls[9] = "DROP TABLE IF EXISTS DRAFT_ITEM_VALUES CASCADE;"; + sqls[10] = "DROP TABLE IF EXISTS VIEW_HISTORIES CASCADE;"; + sqls[11] = "DROP TABLE IF EXISTS KNOWLEDGE_EDIT_GROUPS CASCADE;"; + sqls[12] = "DROP TABLE IF EXISTS WEBHOOKS CASCADE;"; + sqls[13] = "DROP TABLE IF EXISTS KNOWLEDGE_FILES CASCADE;"; + sqls[14] = "DROP TABLE IF EXISTS NOTIFY_QUEUES CASCADE;"; + sqls[15] = "DROP TABLE IF EXISTS TEMPLATE_MASTERS CASCADE;"; + sqls[16] = "DROP TABLE IF EXISTS ITEM_CHOICES CASCADE;"; + sqls[17] = "DROP TABLE IF EXISTS KNOWLEDGE_EDIT_USERS CASCADE;"; + sqls[18] = "DROP TABLE IF EXISTS PINS CASCADE;"; + sqls[19] = "DROP TABLE IF EXISTS KNOWLEDGE_HISTORIES CASCADE;"; + sqls[20] = "DROP TABLE IF EXISTS KNOWLEDGE_ITEM_VALUES CASCADE;"; + sqls[21] = "DROP TABLE IF EXISTS KNOWLEDGE_TAGS CASCADE;"; + sqls[22] = "DROP TABLE IF EXISTS NOTIFY_CONFIGS CASCADE;"; + sqls[23] = "DROP TABLE IF EXISTS MAIL_HOOKS CASCADE;"; + sqls[24] = "DROP TABLE IF EXISTS DRAFT_KNOWLEDGES CASCADE;"; + sqls[25] = "DROP TABLE IF EXISTS STOCKS CASCADE;"; + sqls[26] = "DROP TABLE IF EXISTS STOCK_KNOWLEDGES CASCADE;"; + sqls[27] = "DROP TABLE IF EXISTS KNOWLEDGE_USERS CASCADE;"; + sqls[28] = "DROP TABLE IF EXISTS TAGS CASCADE;"; + sqls[29] = "DROP TABLE IF EXISTS TEMPLATE_ITEMS CASCADE;"; + for (String sql : sqls) { + LOG.debug(sql); + executeUpdate(sql); + } + } + /** Delete all table data */ + public void dropAllData() { + String[] sqls = new String[30]; + sqls[0] = "TRUNCATE TABLE KNOWLEDGES;"; + sqls[1] = "TRUNCATE TABLE ACCOUNT_IMAGES;"; + sqls[2] = "TRUNCATE TABLE MAIL_POSTS;"; + sqls[3] = "TRUNCATE TABLE WEBHOOK_CONFIGS;"; + sqls[4] = "TRUNCATE TABLE VOTES;"; + sqls[5] = "TRUNCATE TABLE COMMENTS;"; + sqls[6] = "TRUNCATE TABLE KNOWLEDGE_GROUPS;"; + sqls[7] = "TRUNCATE TABLE MAIL_HOOK_CONDITIONS;"; + sqls[8] = "TRUNCATE TABLE LIKES;"; + sqls[9] = "TRUNCATE TABLE DRAFT_ITEM_VALUES;"; + sqls[10] = "TRUNCATE TABLE VIEW_HISTORIES;"; + sqls[11] = "TRUNCATE TABLE KNOWLEDGE_EDIT_GROUPS;"; + sqls[12] = "TRUNCATE TABLE WEBHOOKS;"; + sqls[13] = "TRUNCATE TABLE KNOWLEDGE_FILES;"; + sqls[14] = "TRUNCATE TABLE NOTIFY_QUEUES;"; + sqls[15] = "TRUNCATE TABLE TEMPLATE_MASTERS;"; + sqls[16] = "TRUNCATE TABLE ITEM_CHOICES;"; + sqls[17] = "TRUNCATE TABLE KNOWLEDGE_EDIT_USERS;"; + sqls[18] = "TRUNCATE TABLE PINS;"; + sqls[19] = "TRUNCATE TABLE KNOWLEDGE_HISTORIES;"; + sqls[20] = "TRUNCATE TABLE KNOWLEDGE_ITEM_VALUES;"; + sqls[21] = "TRUNCATE TABLE KNOWLEDGE_TAGS;"; + sqls[22] = "TRUNCATE TABLE NOTIFY_CONFIGS;"; + sqls[23] = "TRUNCATE TABLE MAIL_HOOKS;"; + sqls[24] = "TRUNCATE TABLE DRAFT_KNOWLEDGES;"; + sqls[25] = "TRUNCATE TABLE STOCKS;"; + sqls[26] = "TRUNCATE TABLE STOCK_KNOWLEDGES;"; + sqls[27] = "TRUNCATE TABLE KNOWLEDGE_USERS;"; + sqls[28] = "TRUNCATE TABLE TAGS;"; + sqls[29] = "TRUNCATE TABLE TEMPLATE_ITEMS;"; + for (String sql : sqls) { + LOG.debug(sql); + executeUpdate(sql); + } + } + +} diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenAccountImagesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenAccountImagesDao.java index 7556aceb2..ca9d49904 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenAccountImagesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenAccountImagesDao.java @@ -102,6 +102,14 @@ public AccountImagesEntity selectOnKey(Long imageId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/AccountImagesDao/AccountImagesDao_select_on_key.sql"); return executeQuerySingle(sql, AccountImagesEntity.class, imageId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM ACCOUNT_IMAGES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. 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 64c8d0ac0..58fe6004a 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 @@ -101,6 +101,14 @@ public CommentsEntity selectOnKey(Long commentNo) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_select_on_key.sql"); return executeQuerySingle(sql, CommentsEntity.class, commentNo); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM COMMENTS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenDraftItemValuesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenDraftItemValuesDao.java new file mode 100644 index 000000000..9ae137501 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenDraftItemValuesDao.java @@ -0,0 +1,450 @@ +package org.support.project.knowledge.dao.gen; + +import java.util.List; + +import java.sql.Timestamp; + + +import org.support.project.knowledge.entity.DraftItemValuesEntity; +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; + +/** + * ナレッジの項目値 + * this class is auto generate and not edit. + * if modify dao method, you can edit DraftItemValuesDao. + */ +@DI(instance = Instance.Singleton) +public class GenDraftItemValuesDao extends AbstractDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * Get instance from DI container. + * @return instance + */ + public static GenDraftItemValuesDao get() { + return Container.getComp(GenDraftItemValuesDao.class); + } + + /** + * Select all data. + * @return all data + */ + public List physicalSelectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_all.sql"); + return executeQueryList(sql, DraftItemValuesEntity.class); + } + /** + * Select all data with pager. + * @param limit limit + * @param offset offset + * @return all data on limit and offset + */ + public List physicalSelectAllWithPager(int limit, int offset) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_all_with_pager.sql"); + return executeQueryList(sql, DraftItemValuesEntity.class, limit, offset); + } + /** + * Select data on key. + * @param draftId draftId + * @param itemNo itemNo + * @param typeId typeId + * @return data + */ + public DraftItemValuesEntity physicalSelectOnKey(Long draftId, Integer itemNo, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_key.sql"); + return executeQuerySingle(sql, DraftItemValuesEntity.class, draftId, itemNo, typeId); + } + /** + * Select all data that not deleted. + * @return all data + */ + public List selectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_all.sql"); + return executeQueryList(sql, DraftItemValuesEntity.class); + } + /** + * Select all data that not deleted with pager. + * @param limit limit + * @param offset offset + * @return all data + */ + public List selectAllWidthPager(int limit, int offset) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_all_with_pager.sql"); + return executeQueryList(sql, DraftItemValuesEntity.class, limit, offset); + } + /** + * Select count that not deleted. + * @return count + */ + public Integer selectCountAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_count_all.sql"); + return executeQuerySingle(sql, Integer.class); + } + /** + * Select data that not deleted on key. + * @param draftId draftId + * @param itemNo itemNo + * @param typeId typeId + * @return data + */ + public DraftItemValuesEntity selectOnKey(Long draftId, Integer itemNo, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_key.sql"); + return executeQuerySingle(sql, DraftItemValuesEntity.class, draftId, itemNo, typeId); + } + /** + * Select data that not deleted on DRAFT_ID column. + * @param draftId draftId + * @return list + */ + public List selectOnDraftId(Long draftId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_draft_id.sql"); + return executeQueryList(sql, DraftItemValuesEntity.class, draftId); + } + /** + * Select data that not deleted on ITEM_NO column. + * @param itemNo itemNo + * @return list + */ + public List selectOnItemNo(Integer itemNo) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_item_no.sql"); + return executeQueryList(sql, DraftItemValuesEntity.class, itemNo); + } + /** + * Select data that not deleted on TYPE_ID column. + * @param typeId typeId + * @return list + */ + public List selectOnTypeId(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_type_id.sql"); + return executeQueryList(sql, DraftItemValuesEntity.class, typeId); + } + /** + * Select data on DRAFT_ID column. + * @param draftId draftId + * @return list + */ + public List physicalSelectOnDraftId(Long draftId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_draft_id.sql"); + return executeQueryList(sql, DraftItemValuesEntity.class, draftId); + } + /** + * Select data on ITEM_NO column. + * @param itemNo itemNo + * @return list + */ + public List physicalSelectOnItemNo(Integer itemNo) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_item_no.sql"); + return executeQueryList(sql, DraftItemValuesEntity.class, itemNo); + } + /** + * Select data on TYPE_ID column. + * @param typeId typeId + * @return list + */ + public List physicalSelectOnTypeId(Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_type_id.sql"); + return executeQueryList(sql, DraftItemValuesEntity.class, typeId); + } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM DRAFT_ITEM_VALUES"; + return executeQuerySingle(sql, Integer.class); + } + /** + * Physical Insert. + * it is not create key on database sequence. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftItemValuesEntity rawPhysicalInsert(DraftItemValuesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_raw_insert.sql"); + executeUpdate(sql, + entity.getDraftId(), + entity.getItemNo(), + entity.getTypeId(), + entity.getItemValue(), + entity.getItemStatus(), + entity.getInsertUser(), + entity.getInsertDatetime(), + entity.getUpdateUser(), + entity.getUpdateDatetime(), + entity.getDeleteFlag()); + return entity; + } + /** + * Physical Insert. + * if key column have sequence, key value create by database. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftItemValuesEntity physicalInsert(DraftItemValuesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_insert.sql"); + executeUpdate(sql, + entity.getDraftId(), + entity.getItemNo(), + entity.getTypeId(), + entity.getItemValue(), + entity.getItemStatus(), + entity.getInsertUser(), + entity.getInsertDatetime(), + entity.getUpdateUser(), + entity.getUpdateDatetime(), + entity.getDeleteFlag()); + return entity; + } + /** + * Insert. + * set saved user id. + * @param user saved userid + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftItemValuesEntity insert(Integer user, DraftItemValuesEntity 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); + } + /** + * Insert. + * saved user id is auto set. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftItemValuesEntity insert(DraftItemValuesEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return insert(userId, entity); + } + /** + * Physical Update. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftItemValuesEntity physicalUpdate(DraftItemValuesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_update.sql"); + executeUpdate(sql, + entity.getItemValue(), + entity.getItemStatus(), + entity.getInsertUser(), + entity.getInsertDatetime(), + entity.getUpdateUser(), + entity.getUpdateDatetime(), + entity.getDeleteFlag(), + entity.getDraftId(), + entity.getItemNo(), + entity.getTypeId()); + return entity; + } + /** + * Update. + * set saved user id. + * @param user saved userid + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftItemValuesEntity update(Integer user, DraftItemValuesEntity entity) { + DraftItemValuesEntity db = selectOnKey(entity.getDraftId(), 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); + } + /** + * Update. + * saved user id is auto set. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftItemValuesEntity update(DraftItemValuesEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return update(userId, entity); + } + /** + * Save. + * if same key data is exists, the data is update. otherwise the data is insert. + * set saved user id. + * @param user saved userid + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftItemValuesEntity save(Integer user, DraftItemValuesEntity entity) { + DraftItemValuesEntity db = selectOnKey(entity.getDraftId(), entity.getItemNo(), entity.getTypeId()); + if (db == null) { + return insert(user, entity); + } else { + return update(user, entity); + } + } + /** + * Save. + * if same key data is exists, the data is update. otherwise the data is insert. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftItemValuesEntity save(DraftItemValuesEntity entity) { + DraftItemValuesEntity db = selectOnKey(entity.getDraftId(), entity.getItemNo(), entity.getTypeId()); + if (db == null) { + return insert(entity); + } else { + return update(entity); + } + } + /** + * Physical Delete. + * @param draftId draftId + * @param itemNo itemNo + * @param typeId typeId + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(Long draftId, Integer itemNo, Integer typeId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_delete.sql"); + executeUpdate(sql, draftId, itemNo, typeId); + } + /** + * Physical Delete. + * @param entity entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(DraftItemValuesEntity entity) { + physicalDelete(entity.getDraftId(), entity.getItemNo(), entity.getTypeId()); + + } + /** + * Delete. + * if delete flag is exists, the data is logical delete. + * set saved user id. + * @param user saved userid + * @param draftId draftId + * @param itemNo itemNo + * @param typeId typeId + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, Long draftId, Integer itemNo, Integer typeId) { + DraftItemValuesEntity db = selectOnKey(draftId, itemNo, typeId); + db.setDeleteFlag(1); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * Delete. + * if delete flag is exists, the data is logical delete. + * @param draftId draftId + * @param itemNo itemNo + * @param typeId typeId + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void delete(Long draftId, Integer itemNo, Integer typeId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + delete(user, draftId, itemNo, typeId); + } + /** + * Delete. + * if delete flag is exists, the data is logical delete. + * set saved user id. + * @param user saved userid + * @param entity entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, DraftItemValuesEntity entity) { + delete(user, entity.getDraftId(), entity.getItemNo(), entity.getTypeId()); + + } + /** + * Delete. + * if delete flag is exists, the data is logical delete. + * set saved user id. + * @param entity entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void delete(DraftItemValuesEntity entity) { + delete(entity.getDraftId(), entity.getItemNo(), entity.getTypeId()); + + } + /** + * Ativation. + * if delete flag is exists and delete flag is true, delete flug is false to activate. + * set saved user id. + * @param user saved userid + * @param draftId draftId + * @param itemNo itemNo + * @param typeId typeId + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, Long draftId, Integer itemNo, Integer typeId) { + DraftItemValuesEntity db = physicalSelectOnKey(draftId, itemNo, typeId); + db.setDeleteFlag(0); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * Ativation. + * if delete flag is exists and delete flag is true, delete flug is false to activate. + * @param draftId draftId + * @param itemNo itemNo + * @param typeId typeId + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void activation(Long draftId, Integer itemNo, Integer typeId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + activation(user, draftId, itemNo, typeId); + } + /** + * Ativation. + * if delete flag is exists and delete flag is true, delete flug is false to activate. + * set saved user id. + * @param user saved userid + * @param entity entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, DraftItemValuesEntity entity) { + activation(user, entity.getDraftId(), entity.getItemNo(), entity.getTypeId()); + + } + /** + * Ativation. + * if delete flag is exists and delete flag is true, delete flug is false to activate. + * @param entity entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void activation(DraftItemValuesEntity entity) { + activation(entity.getDraftId(), entity.getItemNo(), entity.getTypeId()); + + } + +} diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenDraftKnowledgesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenDraftKnowledgesDao.java new file mode 100644 index 000000000..32e39228b --- /dev/null +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenDraftKnowledgesDao.java @@ -0,0 +1,400 @@ +package org.support.project.knowledge.dao.gen; + +import java.util.List; + +import java.sql.Timestamp; + + +import org.support.project.knowledge.entity.DraftKnowledgesEntity; +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; + +/** + * ナレッジの下書き + * this class is auto generate and not edit. + * if modify dao method, you can edit DraftKnowledgesDao. + */ +@DI(instance = Instance.Singleton) +public class GenDraftKnowledgesDao extends AbstractDao { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * Get instance from DI container. + * @return instance + */ + public static GenDraftKnowledgesDao get() { + return Container.getComp(GenDraftKnowledgesDao.class); + } + + /** + * Select all data. + * @return all data + */ + public List physicalSelectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_all.sql"); + return executeQueryList(sql, DraftKnowledgesEntity.class); + } + /** + * Select all data with pager. + * @param limit limit + * @param offset offset + * @return all data on limit and offset + */ + public List physicalSelectAllWithPager(int limit, int offset) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_all_with_pager.sql"); + return executeQueryList(sql, DraftKnowledgesEntity.class, limit, offset); + } + /** + * Select data on key. + * @param draftId draftId + * @return data + */ + public DraftKnowledgesEntity physicalSelectOnKey(Long draftId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_on_key.sql"); + return executeQuerySingle(sql, DraftKnowledgesEntity.class, draftId); + } + /** + * Select all data that not deleted. + * @return all data + */ + public List selectAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_all.sql"); + return executeQueryList(sql, DraftKnowledgesEntity.class); + } + /** + * Select all data that not deleted with pager. + * @param limit limit + * @param offset offset + * @return all data + */ + public List selectAllWidthPager(int limit, int offset) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_all_with_pager.sql"); + return executeQueryList(sql, DraftKnowledgesEntity.class, limit, offset); + } + /** + * Select count that not deleted. + * @return count + */ + public Integer selectCountAll() { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_count_all.sql"); + return executeQuerySingle(sql, Integer.class); + } + /** + * Select data that not deleted on key. + * @param draftId draftId + * @return data + */ + public DraftKnowledgesEntity selectOnKey(Long draftId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_on_key.sql"); + return executeQuerySingle(sql, DraftKnowledgesEntity.class, draftId); + } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM DRAFT_KNOWLEDGES"; + return executeQuerySingle(sql, Integer.class); + } + /** + * Physical Insert. + * it is not create key on database sequence. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftKnowledgesEntity rawPhysicalInsert(DraftKnowledgesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_raw_insert.sql"); + executeUpdate(sql, + entity.getDraftId(), + entity.getKnowledgeId(), + entity.getTitle(), + entity.getContent(), + entity.getPublicFlag(), + entity.getAccesses(), + entity.getEditors(), + entity.getTagNames(), + entity.getTypeId(), + 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('DRAFT_KNOWLEDGES_DRAFT_ID_seq', (select max(DRAFT_ID) from DRAFT_KNOWLEDGES));"; + executeQuerySingle(setValSql, Long.class); + } + return entity; + } + /** + * Physical Insert. + * if key column have sequence, key value create by database. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftKnowledgesEntity physicalInsert(DraftKnowledgesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_insert.sql"); + Class type = PropertyUtil.getPropertyType(entity, "draftId"); + Object key = executeInsert(sql, type, + entity.getKnowledgeId(), + entity.getTitle(), + entity.getContent(), + entity.getPublicFlag(), + entity.getAccesses(), + entity.getEditors(), + entity.getTagNames(), + entity.getTypeId(), + entity.getInsertUser(), + entity.getInsertDatetime(), + entity.getUpdateUser(), + entity.getUpdateDatetime(), + entity.getDeleteFlag()); + PropertyUtil.setPropertyValue(entity, "draftId", key); + return entity; + } + /** + * Insert. + * set saved user id. + * @param user saved userid + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftKnowledgesEntity insert(Integer user, DraftKnowledgesEntity 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); + } + /** + * Insert. + * saved user id is auto set. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftKnowledgesEntity insert(DraftKnowledgesEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return insert(userId, entity); + } + /** + * Physical Update. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftKnowledgesEntity physicalUpdate(DraftKnowledgesEntity entity) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_update.sql"); + executeUpdate(sql, + entity.getKnowledgeId(), + entity.getTitle(), + entity.getContent(), + entity.getPublicFlag(), + entity.getAccesses(), + entity.getEditors(), + entity.getTagNames(), + entity.getTypeId(), + entity.getInsertUser(), + entity.getInsertDatetime(), + entity.getUpdateUser(), + entity.getUpdateDatetime(), + entity.getDeleteFlag(), + entity.getDraftId()); + return entity; + } + /** + * Update. + * set saved user id. + * @param user saved userid + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftKnowledgesEntity update(Integer user, DraftKnowledgesEntity entity) { + DraftKnowledgesEntity db = selectOnKey(entity.getDraftId()); + 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); + } + /** + * Update. + * saved user id is auto set. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftKnowledgesEntity update(DraftKnowledgesEntity entity) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer userId = (Integer) pool.getUser(); + return update(userId, entity); + } + /** + * Save. + * if same key data is exists, the data is update. otherwise the data is insert. + * set saved user id. + * @param user saved userid + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftKnowledgesEntity save(Integer user, DraftKnowledgesEntity entity) { + DraftKnowledgesEntity db = selectOnKey(entity.getDraftId()); + if (db == null) { + return insert(user, entity); + } else { + return update(user, entity); + } + } + /** + * Save. + * if same key data is exists, the data is update. otherwise the data is insert. + * @param entity entity + * @return saved entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftKnowledgesEntity save(DraftKnowledgesEntity entity) { + DraftKnowledgesEntity db = selectOnKey(entity.getDraftId()); + if (db == null) { + return insert(entity); + } else { + return update(entity); + } + } + /** + * Physical Delete. + * @param draftId draftId + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(Long draftId) { + String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_delete.sql"); + executeUpdate(sql, draftId); + } + /** + * Physical Delete. + * @param entity entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void physicalDelete(DraftKnowledgesEntity entity) { + physicalDelete(entity.getDraftId()); + + } + /** + * Delete. + * if delete flag is exists, the data is logical delete. + * set saved user id. + * @param user saved userid + * @param draftId draftId + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, Long draftId) { + DraftKnowledgesEntity db = selectOnKey(draftId); + db.setDeleteFlag(1); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * Delete. + * if delete flag is exists, the data is logical delete. + * @param draftId draftId + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void delete(Long draftId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + delete(user, draftId); + } + /** + * Delete. + * if delete flag is exists, the data is logical delete. + * set saved user id. + * @param user saved userid + * @param entity entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void delete(Integer user, DraftKnowledgesEntity entity) { + delete(user, entity.getDraftId()); + + } + /** + * Delete. + * if delete flag is exists, the data is logical delete. + * set saved user id. + * @param entity entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void delete(DraftKnowledgesEntity entity) { + delete(entity.getDraftId()); + + } + /** + * Ativation. + * if delete flag is exists and delete flag is true, delete flug is false to activate. + * set saved user id. + * @param user saved userid + * @param draftId draftId + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, Long draftId) { + DraftKnowledgesEntity db = physicalSelectOnKey(draftId); + db.setDeleteFlag(0); + db.setUpdateUser(user); + db.setUpdateDatetime(new Timestamp(new java.util.Date().getTime())); + physicalUpdate(db); + } + /** + * Ativation. + * if delete flag is exists and delete flag is true, delete flug is false to activate. + * @param draftId draftId + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void activation(Long draftId) { + DBUserPool pool = Container.getComp(DBUserPool.class); + Integer user = (Integer) pool.getUser(); + activation(user, draftId); + } + /** + * Ativation. + * if delete flag is exists and delete flag is true, delete flug is false to activate. + * set saved user id. + * @param user saved userid + * @param entity entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void activation(Integer user, DraftKnowledgesEntity entity) { + activation(user, entity.getDraftId()); + + } + /** + * Ativation. + * if delete flag is exists and delete flag is true, delete flug is false to activate. + * @param entity entity + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void activation(DraftKnowledgesEntity entity) { + activation(entity.getDraftId()); + + } + +} 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 index bb54f05e0..3d45fed52 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenItemChoicesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenItemChoicesDao.java @@ -159,6 +159,14 @@ 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); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM ITEM_CHOICES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeEditGroupsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeEditGroupsDao.java index 9fed4374e..10293959e 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeEditGroupsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeEditGroupsDao.java @@ -139,6 +139,14 @@ public List physicalSelectOnKnowledgeId(Long knowledg String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_physical_select_on_knowledge_id.sql"); return executeQueryList(sql, KnowledgeEditGroupsEntity.class, knowledgeId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM KNOWLEDGE_EDIT_GROUPS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeEditUsersDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeEditUsersDao.java index 589782abf..f57274531 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeEditUsersDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeEditUsersDao.java @@ -139,6 +139,14 @@ public List physicalSelectOnUserId(Integer userId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_physical_select_on_user_id.sql"); return executeQueryList(sql, KnowledgeEditUsersEntity.class, userId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM KNOWLEDGE_EDIT_USERS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeFilesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeFilesDao.java index 3108f8db1..dd5f775b0 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeFilesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeFilesDao.java @@ -102,6 +102,14 @@ public KnowledgeFilesEntity selectOnKey(Long fileNo) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_select_on_key.sql"); return executeQuerySingle(sql, KnowledgeFilesEntity.class, fileNo); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM KNOWLEDGE_FILES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. @@ -115,6 +123,7 @@ public KnowledgeFilesEntity rawPhysicalInsert(KnowledgeFilesEntity entity) { entity.getFileNo(), entity.getKnowledgeId(), entity.getCommentNo(), + entity.getDraftId(), entity.getFileName(), entity.getFileSize(), entity.getFileBinary(), @@ -144,6 +153,7 @@ public KnowledgeFilesEntity physicalInsert(KnowledgeFilesEntity entity) { Object key = executeInsert(sql, type, entity.getKnowledgeId(), entity.getCommentNo(), + entity.getDraftId(), entity.getFileName(), entity.getFileSize(), entity.getFileBinary(), @@ -195,6 +205,7 @@ public KnowledgeFilesEntity physicalUpdate(KnowledgeFilesEntity entity) { executeUpdate(sql, entity.getKnowledgeId(), entity.getCommentNo(), + entity.getDraftId(), entity.getFileName(), entity.getFileSize(), entity.getFileBinary(), diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeGroupsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeGroupsDao.java index c5396a5f9..a2192177a 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeGroupsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeGroupsDao.java @@ -139,6 +139,14 @@ public List physicalSelectOnKnowledgeId(Long knowledgeId) String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_physical_select_on_knowledge_id.sql"); return executeQueryList(sql, KnowledgeGroupsEntity.class, knowledgeId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM KNOWLEDGE_GROUPS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeHistoriesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeHistoriesDao.java index 977340a73..46ad29627 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeHistoriesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeHistoriesDao.java @@ -139,6 +139,14 @@ public List physicalSelectOnKnowledgeId(Long knowledge String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_physical_select_on_knowledge_id.sql"); return executeQueryList(sql, KnowledgeHistoriesEntity.class, knowledgeId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM KNOWLEDGE_HISTORIES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. 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 index 6230502b6..8f1a94493 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeItemValuesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeItemValuesDao.java @@ -159,6 +159,14 @@ 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); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM KNOWLEDGE_ITEM_VALUES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeTagsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeTagsDao.java index a30e43055..f3ddcbeeb 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeTagsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeTagsDao.java @@ -139,6 +139,14 @@ public List physicalSelectOnTagId(Integer tagId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_physical_select_on_tag_id.sql"); return executeQueryList(sql, KnowledgeTagsEntity.class, tagId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM KNOWLEDGE_TAGS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeUsersDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeUsersDao.java index 6b9bb925a..3d246f340 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeUsersDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenKnowledgeUsersDao.java @@ -139,6 +139,14 @@ public List physicalSelectOnUserId(Integer userId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_physical_select_on_user_id.sql"); return executeQueryList(sql, KnowledgeUsersEntity.class, userId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM KNOWLEDGE_USERS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. 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 1e0239ae0..eed483399 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 @@ -101,6 +101,14 @@ public KnowledgesEntity selectOnKey(Long knowledgeId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_select_on_key.sql"); return executeQuerySingle(sql, KnowledgesEntity.class, knowledgeId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM KNOWLEDGES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. @@ -120,6 +128,7 @@ public KnowledgesEntity rawPhysicalInsert(KnowledgesEntity entity) { entity.getLikeCount(), entity.getCommentCount(), entity.getTypeId(), + entity.getNotifyStatus(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), @@ -151,6 +160,7 @@ public KnowledgesEntity physicalInsert(KnowledgesEntity entity) { entity.getLikeCount(), entity.getCommentCount(), entity.getTypeId(), + entity.getNotifyStatus(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), @@ -204,6 +214,7 @@ public KnowledgesEntity physicalUpdate(KnowledgesEntity entity) { entity.getLikeCount(), entity.getCommentCount(), entity.getTypeId(), + entity.getNotifyStatus(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenLikesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenLikesDao.java index c75d91f01..05791fe08 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenLikesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenLikesDao.java @@ -101,6 +101,14 @@ public LikesEntity selectOnKey(Long no) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/LikesDao/LikesDao_select_on_key.sql"); return executeQuerySingle(sql, LikesEntity.class, no); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM LIKES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenMailHookConditionsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenMailHookConditionsDao.java index 97f8e7a41..1f488fa5a 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenMailHookConditionsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenMailHookConditionsDao.java @@ -139,6 +139,14 @@ public List physicalSelectOnHookId(Integer hookId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_physical_select_on_hook_id.sql"); return executeQueryList(sql, MailHookConditionsEntity.class, hookId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM MAIL_HOOK_CONDITIONS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenMailHooksDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenMailHooksDao.java index 7dfcab703..68196a8ea 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenMailHooksDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenMailHooksDao.java @@ -101,6 +101,14 @@ public MailHooksEntity selectOnKey(Integer hookId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/MailHooksDao/MailHooksDao_select_on_key.sql"); return executeQuerySingle(sql, MailHooksEntity.class, hookId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM MAIL_HOOKS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenMailPostsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenMailPostsDao.java index c534b1c03..a5c5c8fc4 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenMailPostsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenMailPostsDao.java @@ -101,6 +101,14 @@ public MailPostsEntity selectOnKey(String messageId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/MailPostsDao/MailPostsDao_select_on_key.sql"); return executeQuerySingle(sql, MailPostsEntity.class, messageId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM MAIL_POSTS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenNotifyConfigsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenNotifyConfigsDao.java index ab3db9b5b..d5fe87ffc 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenNotifyConfigsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenNotifyConfigsDao.java @@ -101,6 +101,14 @@ public NotifyConfigsEntity selectOnKey(Integer userId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/NotifyConfigsDao/NotifyConfigsDao_select_on_key.sql"); return executeQuerySingle(sql, NotifyConfigsEntity.class, userId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM NOTIFY_CONFIGS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenNotifyQueuesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenNotifyQueuesDao.java index b958ebf86..1e6a56304 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenNotifyQueuesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenNotifyQueuesDao.java @@ -101,6 +101,14 @@ public NotifyQueuesEntity selectOnKey(String hash) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/NotifyQueuesDao/NotifyQueuesDao_select_on_key.sql"); return executeQuerySingle(sql, NotifyQueuesEntity.class, hash); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM NOTIFY_QUEUES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenPinsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenPinsDao.java index f04e7191e..948eeab27 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenPinsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenPinsDao.java @@ -101,6 +101,14 @@ public PinsEntity selectOnKey(Integer no) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/PinsDao/PinsDao_select_on_key.sql"); return executeQuerySingle(sql, PinsEntity.class, no); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM PINS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. 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 index 93dc30aa5..80c53a332 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenStockKnowledgesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenStockKnowledgesDao.java @@ -139,6 +139,14 @@ 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); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM STOCK_KNOWLEDGES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. 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 bc7514cf5..f63916e62 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 @@ -101,6 +101,14 @@ 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, stockId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM STOCKS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenTagsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenTagsDao.java index ced8f503f..ef6e4230b 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenTagsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenTagsDao.java @@ -101,6 +101,14 @@ public TagsEntity selectOnKey(Integer tagId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/TagsDao/TagsDao_select_on_key.sql"); return executeQuerySingle(sql, TagsEntity.class, tagId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM TAGS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. 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 index 41e01b67b..0fa446953 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateItemsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateItemsDao.java @@ -139,6 +139,14 @@ 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); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM TEMPLATE_ITEMS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. 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 index 5a988d507..3f00ac3d6 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateMastersDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenTemplateMastersDao.java @@ -101,6 +101,14 @@ 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); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM TEMPLATE_MASTERS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenViewHistoriesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenViewHistoriesDao.java index db20cef57..5341053d6 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenViewHistoriesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenViewHistoriesDao.java @@ -101,6 +101,14 @@ public ViewHistoriesEntity selectOnKey(Long historyNo) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/ViewHistoriesDao/ViewHistoriesDao_select_on_key.sql"); return executeQuerySingle(sql, ViewHistoriesEntity.class, historyNo); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM VIEW_HISTORIES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenVotesDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenVotesDao.java index 17bfbabb2..748de697d 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenVotesDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenVotesDao.java @@ -101,6 +101,14 @@ public VotesEntity selectOnKey(Long voteNo) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/VotesDao/VotesDao_select_on_key.sql"); return executeQuerySingle(sql, VotesEntity.class, voteNo); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM VOTES"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenWebhookConfigsDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenWebhookConfigsDao.java index 3e50ca873..ecbf46f84 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenWebhookConfigsDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenWebhookConfigsDao.java @@ -21,7 +21,7 @@ import org.support.project.aop.Aspect; /** - * Webhooks 設定 + * Webhook 設定 * this class is auto generate and not edit. * if modify dao method, you can edit WebhookConfigsDao. */ @@ -101,6 +101,14 @@ public WebhookConfigsEntity selectOnKey(Integer hookId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/WebhookConfigsDao/WebhookConfigsDao_select_on_key.sql"); return executeQuerySingle(sql, WebhookConfigsEntity.class, hookId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM WEBHOOK_CONFIGS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. diff --git a/src/main/java/org/support/project/knowledge/dao/gen/GenWebhooksDao.java b/src/main/java/org/support/project/knowledge/dao/gen/GenWebhooksDao.java index b0fffc6e3..b92181fa3 100644 --- a/src/main/java/org/support/project/knowledge/dao/gen/GenWebhooksDao.java +++ b/src/main/java/org/support/project/knowledge/dao/gen/GenWebhooksDao.java @@ -101,6 +101,14 @@ public WebhooksEntity selectOnKey(String webhookId) { String sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/WebhooksDao/WebhooksDao_select_on_key.sql"); return executeQuerySingle(sql, WebhooksEntity.class, webhookId); } + /** + * Count all data + * @return count + */ + public int physicalCountAll() { + String sql = "SELECT COUNT(*) FROM WEBHOOKS"; + return executeQuerySingle(sql, Integer.class); + } /** * Physical Insert. * it is not create key on database sequence. 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 bffe698b7..19af2bd7b 100644 --- a/src/main/java/org/support/project/knowledge/deploy/InitDB.java +++ b/src/main/java/org/support/project/knowledge/deploy/InitDB.java @@ -22,6 +22,8 @@ import org.support.project.knowledge.deploy.v1_5_0.Migrate_1_5_0; import org.support.project.knowledge.deploy.v1_5_0_2.Migrate_1_5_0_2; import org.support.project.knowledge.deploy.v1_6_0.Migrate_1_6_0; +import org.support.project.knowledge.deploy.v1_7_0.Migrate_1_7_0; +import org.support.project.knowledge.deploy.v1_7_0.Migrate_1_7_0_1; import org.support.project.web.dao.SystemsDao; import org.support.project.web.entity.SystemsEntity; @@ -33,7 +35,7 @@ public class InitDB { private static final Map MAP = new LinkedHashMap<>(); private static final Migrate INIT = InitializeSystem.get(); - public static final String CURRENT = "1.6.0"; + public static final String CURRENT = "1.7.0.1"; public InitDB() { super(); @@ -52,6 +54,8 @@ public InitDB() { MAP.put("1.5.0", Migrate_1_5_0.get()); MAP.put("1.5.0_2", Migrate_1_5_0_2.get()); MAP.put("1.6.0", Migrate_1_6_0.get()); + MAP.put("1.7.0", Migrate_1_7_0.get()); + MAP.put("1.7.0.1", Migrate_1_7_0_1.get()); } public static void main(String[] args) throws Exception { diff --git a/src/main/java/org/support/project/knowledge/deploy/v0_0_1/InitializeSystem.java b/src/main/java/org/support/project/knowledge/deploy/v0_0_1/InitializeSystem.java index 7faee326b..ee7e60722 100644 --- a/src/main/java/org/support/project/knowledge/deploy/v0_0_1/InitializeSystem.java +++ b/src/main/java/org/support/project/knowledge/deploy/v0_0_1/InitializeSystem.java @@ -1,5 +1,6 @@ package org.support.project.knowledge.deploy.v0_0_1; +import org.support.project.knowledge.dao.gen.DatabaseControlDao; import org.support.project.knowledge.deploy.Migrate; import org.support.project.ormapping.tool.dao.InitializeDao; import org.support.project.web.config.WebConfig; @@ -55,9 +56,13 @@ private void addInitDatas() { } private void createTables() { + DatabaseControlDao dao1 = new DatabaseControlDao(); + dao1.dropAllTable(); + org.support.project.web.dao.gen.DatabaseControlDao dao2 = new org.support.project.web.dao.gen.DatabaseControlDao(); + dao2.dropAllTable(); + // 存在するテーブルを全て削除 InitializeDao initializeDao = InitializeDao.get(); - initializeDao.dropAllTable(); String[] sqlpaths = { "/org/support/project/web/database/ddl.sql", diff --git a/src/main/java/org/support/project/knowledge/deploy/v1_7_0/Migrate_1_7_0.java b/src/main/java/org/support/project/knowledge/deploy/v1_7_0/Migrate_1_7_0.java new file mode 100644 index 000000000..789951380 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/deploy/v1_7_0/Migrate_1_7_0.java @@ -0,0 +1,21 @@ +package org.support.project.knowledge.deploy.v1_7_0; + +import org.support.project.knowledge.deploy.Migrate; +import org.support.project.ormapping.tool.dao.InitializeDao; + +public class Migrate_1_7_0 implements Migrate { + + public static Migrate_1_7_0 get() { + return org.support.project.di.Container.getComp(Migrate_1_7_0.class); + } + + @Override + public boolean doMigrate() throws Exception { + InitializeDao initializeDao = InitializeDao.get(); + String[] sqlpaths = { + "/org/support/project/knowledge/deploy/v1_7_0/migrate.sql", + }; + initializeDao.initializeDatabase(sqlpaths); + return true; + } +} \ No newline at end of file diff --git a/src/main/java/org/support/project/knowledge/deploy/v1_7_0/Migrate_1_7_0_1.java b/src/main/java/org/support/project/knowledge/deploy/v1_7_0/Migrate_1_7_0_1.java new file mode 100644 index 000000000..f3a974997 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/deploy/v1_7_0/Migrate_1_7_0_1.java @@ -0,0 +1,21 @@ +package org.support.project.knowledge.deploy.v1_7_0; + +import org.support.project.knowledge.deploy.Migrate; +import org.support.project.ormapping.tool.dao.InitializeDao; + +public class Migrate_1_7_0_1 implements Migrate { + + public static Migrate_1_7_0_1 get() { + return org.support.project.di.Container.getComp(Migrate_1_7_0_1.class); + } + + @Override + public boolean doMigrate() throws Exception { + InitializeDao initializeDao = InitializeDao.get(); + String[] sqlpaths = { + "/org/support/project/knowledge/deploy/v1_7_0_1/migrate.sql", + }; + initializeDao.initializeDatabase(sqlpaths); + return true; + } +} \ No newline at end of file diff --git a/src/main/java/org/support/project/knowledge/entity/DraftItemValuesEntity.java b/src/main/java/org/support/project/knowledge/entity/DraftItemValuesEntity.java new file mode 100644 index 000000000..666d46020 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/DraftItemValuesEntity.java @@ -0,0 +1,51 @@ +package org.support.project.knowledge.entity; + +import org.support.project.knowledge.entity.gen.GenDraftItemValuesEntity; + +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 DraftItemValuesEntity extends GenDraftItemValuesEntity { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * Get instance from DI container. + * @return instance + */ + public static DraftItemValuesEntity get() { + return Container.getComp(DraftItemValuesEntity.class); + } + + /** + * Constructor. + */ + public DraftItemValuesEntity() { + super(); + } + + /** + * Constructor + * @param draftId 下書きID + * @param itemNo 項目NO + * @param typeId テンプレートの種類ID + */ + + public DraftItemValuesEntity(Long draftId, Integer itemNo, Integer typeId) { + super( draftId, itemNo, typeId); + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/DraftKnowledgesEntity.java b/src/main/java/org/support/project/knowledge/entity/DraftKnowledgesEntity.java new file mode 100644 index 000000000..577cb8468 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/DraftKnowledgesEntity.java @@ -0,0 +1,49 @@ +package org.support.project.knowledge.entity; + +import org.support.project.knowledge.entity.gen.GenDraftKnowledgesEntity; + +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 DraftKnowledgesEntity extends GenDraftKnowledgesEntity { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * Get instance from DI container. + * @return instance + */ + public static DraftKnowledgesEntity get() { + return Container.getComp(DraftKnowledgesEntity.class); + } + + /** + * Constructor. + */ + public DraftKnowledgesEntity() { + super(); + } + + /** + * Constructor + * @param draftId 下書きID + */ + + public DraftKnowledgesEntity(Long draftId) { + super( draftId); + } + +} diff --git a/src/main/java/org/support/project/knowledge/entity/KnowledgesEntity.java b/src/main/java/org/support/project/knowledge/entity/KnowledgesEntity.java index b5bc92c52..3774ab2e9 100644 --- a/src/main/java/org/support/project/knowledge/entity/KnowledgesEntity.java +++ b/src/main/java/org/support/project/knowledge/entity/KnowledgesEntity.java @@ -43,6 +43,9 @@ public static KnowledgesEntity get() { */ public KnowledgesEntity() { super(); + // 初期値 + this.setNotifyStatus(0); + this.setDeleteFlag(0); } /** diff --git a/src/main/java/org/support/project/knowledge/entity/gen/GenDraftItemValuesEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenDraftItemValuesEntity.java new file mode 100644 index 000000000..73fdbb081 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenDraftItemValuesEntity.java @@ -0,0 +1,433 @@ +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 GenDraftItemValuesEntity implements Serializable { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * Get instance from DI container. + * @return instance + */ + public static GenDraftItemValuesEntity get() { + return Container.getComp(GenDraftItemValuesEntity.class); + } + + /** + * Constructor. + */ + public GenDraftItemValuesEntity() { + super(); + } + + /** + * Constructor + * @param draftId 下書きID + * @param itemNo 項目NO + * @param typeId テンプレートの種類ID + */ + + public GenDraftItemValuesEntity(Long draftId, Integer itemNo, Integer typeId) { + super(); + this.draftId = draftId; + this.itemNo = itemNo; + this.typeId = typeId; + } + /** 下書きID */ + private Long draftId; + /** テンプレートの種類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; + + /** + * Get 下書きID. + * @return 下書きID + */ + public Long getDraftId() { + return this.draftId; + } + /** + * Set 下書きID. + * @param draftId 下書きID + * @return this object */ + public GenDraftItemValuesEntity setDraftId(Long draftId) { + this.draftId = draftId; + return this; + } + + /** + * Get テンプレートの種類ID. + * @return テンプレートの種類ID + */ + public Integer getTypeId() { + return this.typeId; + } + /** + * Set テンプレートの種類ID. + * @param typeId テンプレートの種類ID + * @return this object */ + public GenDraftItemValuesEntity setTypeId(Integer typeId) { + this.typeId = typeId; + return this; + } + + /** + * Get 項目NO. + * @return 項目NO + */ + public Integer getItemNo() { + return this.itemNo; + } + /** + * Set 項目NO. + * @param itemNo 項目NO + * @return this object */ + public GenDraftItemValuesEntity setItemNo(Integer itemNo) { + this.itemNo = itemNo; + return this; + } + + /** + * Get 項目値. + * @return 項目値 + */ + public String getItemValue() { + return this.itemValue; + } + /** + * Set 項目値. + * @param itemValue 項目値 + * @return this object */ + public GenDraftItemValuesEntity setItemValue(String itemValue) { + this.itemValue = itemValue; + return this; + } + + /** + * Get ステータス. + * @return ステータス + */ + public Integer getItemStatus() { + return this.itemStatus; + } + /** + * Set ステータス. + * @param itemStatus ステータス + * @return this object */ + public GenDraftItemValuesEntity setItemStatus(Integer itemStatus) { + this.itemStatus = itemStatus; + return this; + } + + /** + * Get 登録ユーザ. + * @return 登録ユーザ + */ + public Integer getInsertUser() { + return this.insertUser; + } + /** + * Set 登録ユーザ. + * @param insertUser 登録ユーザ + * @return this object */ + public GenDraftItemValuesEntity setInsertUser(Integer insertUser) { + this.insertUser = insertUser; + return this; + } + + /** + * Get 登録日時. + * @return 登録日時 + */ + public Timestamp getInsertDatetime() { + return this.insertDatetime; + } + /** + * Set 登録日時. + * @param insertDatetime 登録日時 + * @return this object */ + public GenDraftItemValuesEntity setInsertDatetime(Timestamp insertDatetime) { + this.insertDatetime = insertDatetime; + return this; + } + + /** + * Get 更新ユーザ. + * @return 更新ユーザ + */ + public Integer getUpdateUser() { + return this.updateUser; + } + /** + * Set 更新ユーザ. + * @param updateUser 更新ユーザ + * @return this object */ + public GenDraftItemValuesEntity setUpdateUser(Integer updateUser) { + this.updateUser = updateUser; + return this; + } + + /** + * Get 更新日時. + * @return 更新日時 + */ + public Timestamp getUpdateDatetime() { + return this.updateDatetime; + } + /** + * Set 更新日時. + * @param updateDatetime 更新日時 + * @return this object */ + public GenDraftItemValuesEntity setUpdateDatetime(Timestamp updateDatetime) { + this.updateDatetime = updateDatetime; + return this; + } + + /** + * Get 削除フラグ. + * @return 削除フラグ + */ + public Integer getDeleteFlag() { + return this.deleteFlag; + } + /** + * Set 削除フラグ. + * @param deleteFlag 削除フラグ + * @return this object */ + public GenDraftItemValuesEntity setDeleteFlag(Integer deleteFlag) { + this.deleteFlag = deleteFlag; + return this; + } + + /** + * Get key values + * @return values + */ + public Object[] getKeyValues() { + Object[] keyValues = new Object[3]; + keyValues[0] = this.draftId; + keyValues[1] = this.itemNo; + keyValues[2] = this.typeId; + return keyValues; + } + /** + * Set key values + * @param draftId 下書きID + * @param itemNo 項目NO + * @param typeId テンプレートの種類ID + */ + public void setKeyValues(Long draftId, Integer itemNo, Integer typeId) { + this.draftId = draftId; + this.itemNo = itemNo; + this.typeId = typeId; + } + /** + * compare on key + * @param entity entity + * @return result + */ + public boolean equalsOnKey(GenDraftItemValuesEntity 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 + * @return string + */ + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("draftId = ").append(draftId).append("\n"); + builder.append("itemNo = ").append(itemNo).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(); + } + /** + * Convert label to display + * @param label label + * @return convert label + */ + protected String convLabelName(String label) { + return label; + } + /** + * validate + * @return validate error list + */ + public List validate() { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.draftId, convLabelName("Draft 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 + * @param values value map + * @return validate error list + */ + public List validate(Map values) { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("draftId"), convLabelName("Draft 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/GenDraftKnowledgesEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenDraftKnowledgesEntity.java new file mode 100644 index 000000000..7f769752d --- /dev/null +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenDraftKnowledgesEntity.java @@ -0,0 +1,469 @@ +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 GenDraftKnowledgesEntity implements Serializable { + + /** SerialVersion */ + private static final long serialVersionUID = 1L; + + /** + * Get instance from DI container. + * @return instance + */ + public static GenDraftKnowledgesEntity get() { + return Container.getComp(GenDraftKnowledgesEntity.class); + } + + /** + * Constructor. + */ + public GenDraftKnowledgesEntity() { + super(); + } + + /** + * Constructor + * @param draftId 下書きID + */ + + public GenDraftKnowledgesEntity(Long draftId) { + super(); + this.draftId = draftId; + } + /** 下書きID */ + private Long draftId; + /** ナレッジID */ + private Long knowledgeId; + /** タイトル */ + private String title; + /** 内容 */ + private String content; + /** 公開区分 */ + private Integer publicFlag; + /** 公開対象 */ + private String accesses; + /** 共同編集対象 */ + private String editors; + /** タグ名称一覧 */ + private String tagNames; + /** テンプレートの種類ID */ + private Integer typeId; + /** 登録ユーザ */ + private Integer insertUser; + /** 登録日時 */ + private Timestamp insertDatetime; + /** 更新ユーザ */ + private Integer updateUser; + /** 更新日時 */ + private Timestamp updateDatetime; + /** 削除フラグ */ + private Integer deleteFlag; + + /** + * Get 下書きID. + * @return 下書きID + */ + public Long getDraftId() { + return this.draftId; + } + /** + * Set 下書きID. + * @param draftId 下書きID + * @return this object */ + public GenDraftKnowledgesEntity setDraftId(Long draftId) { + this.draftId = draftId; + return this; + } + + /** + * Get ナレッジID. + * @return ナレッジID + */ + public Long getKnowledgeId() { + return this.knowledgeId; + } + /** + * Set ナレッジID. + * @param knowledgeId ナレッジID + * @return this object */ + public GenDraftKnowledgesEntity setKnowledgeId(Long knowledgeId) { + this.knowledgeId = knowledgeId; + return this; + } + + /** + * Get タイトル. + * @return タイトル + */ + public String getTitle() { + return this.title; + } + /** + * Set タイトル. + * @param title タイトル + * @return this object */ + public GenDraftKnowledgesEntity setTitle(String title) { + this.title = title; + return this; + } + + /** + * Get 内容. + * @return 内容 + */ + public String getContent() { + return this.content; + } + /** + * Set 内容. + * @param content 内容 + * @return this object */ + public GenDraftKnowledgesEntity setContent(String content) { + this.content = content; + return this; + } + + /** + * Get 公開区分. + * @return 公開区分 + */ + public Integer getPublicFlag() { + return this.publicFlag; + } + /** + * Set 公開区分. + * @param publicFlag 公開区分 + * @return this object */ + public GenDraftKnowledgesEntity setPublicFlag(Integer publicFlag) { + this.publicFlag = publicFlag; + return this; + } + + /** + * Get 公開対象. + * @return 公開対象 + */ + public String getAccesses() { + return this.accesses; + } + /** + * Set 公開対象. + * @param accesses 公開対象 + * @return this object */ + public GenDraftKnowledgesEntity setAccesses(String accesses) { + this.accesses = accesses; + return this; + } + + /** + * Get 共同編集対象. + * @return 共同編集対象 + */ + public String getEditors() { + return this.editors; + } + /** + * Set 共同編集対象. + * @param editors 共同編集対象 + * @return this object */ + public GenDraftKnowledgesEntity setEditors(String editors) { + this.editors = editors; + return this; + } + + /** + * Get タグ名称一覧. + * @return タグ名称一覧 + */ + public String getTagNames() { + return this.tagNames; + } + /** + * Set タグ名称一覧. + * @param tagNames タグ名称一覧 + * @return this object */ + public GenDraftKnowledgesEntity setTagNames(String tagNames) { + this.tagNames = tagNames; + return this; + } + + /** + * Get テンプレートの種類ID. + * @return テンプレートの種類ID + */ + public Integer getTypeId() { + return this.typeId; + } + /** + * Set テンプレートの種類ID. + * @param typeId テンプレートの種類ID + * @return this object */ + public GenDraftKnowledgesEntity setTypeId(Integer typeId) { + this.typeId = typeId; + return this; + } + + /** + * Get 登録ユーザ. + * @return 登録ユーザ + */ + public Integer getInsertUser() { + return this.insertUser; + } + /** + * Set 登録ユーザ. + * @param insertUser 登録ユーザ + * @return this object */ + public GenDraftKnowledgesEntity setInsertUser(Integer insertUser) { + this.insertUser = insertUser; + return this; + } + + /** + * Get 登録日時. + * @return 登録日時 + */ + public Timestamp getInsertDatetime() { + return this.insertDatetime; + } + /** + * Set 登録日時. + * @param insertDatetime 登録日時 + * @return this object */ + public GenDraftKnowledgesEntity setInsertDatetime(Timestamp insertDatetime) { + this.insertDatetime = insertDatetime; + return this; + } + + /** + * Get 更新ユーザ. + * @return 更新ユーザ + */ + public Integer getUpdateUser() { + return this.updateUser; + } + /** + * Set 更新ユーザ. + * @param updateUser 更新ユーザ + * @return this object */ + public GenDraftKnowledgesEntity setUpdateUser(Integer updateUser) { + this.updateUser = updateUser; + return this; + } + + /** + * Get 更新日時. + * @return 更新日時 + */ + public Timestamp getUpdateDatetime() { + return this.updateDatetime; + } + /** + * Set 更新日時. + * @param updateDatetime 更新日時 + * @return this object */ + public GenDraftKnowledgesEntity setUpdateDatetime(Timestamp updateDatetime) { + this.updateDatetime = updateDatetime; + return this; + } + + /** + * Get 削除フラグ. + * @return 削除フラグ + */ + public Integer getDeleteFlag() { + return this.deleteFlag; + } + /** + * Set 削除フラグ. + * @param deleteFlag 削除フラグ + * @return this object */ + public GenDraftKnowledgesEntity setDeleteFlag(Integer deleteFlag) { + this.deleteFlag = deleteFlag; + return this; + } + + /** + * Get key values + * @return values + */ + public Object[] getKeyValues() { + Object[] keyValues = new Object[1]; + keyValues[0] = this.draftId; + return keyValues; + } + /** + * Set key values + * @param draftId 下書きID + */ + public void setKeyValues(Long draftId) { + this.draftId = draftId; + } + /** + * compare on key + * @param entity entity + * @return result + */ + public boolean equalsOnKey(GenDraftKnowledgesEntity 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 + * @return string + */ + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("draftId = ").append(draftId).append("\n"); + builder.append("knowledgeId = ").append(knowledgeId).append("\n"); + builder.append("title = ").append(title).append("\n"); + builder.append("content = ").append(content).append("\n"); + builder.append("publicFlag = ").append(publicFlag).append("\n"); + builder.append("accesses = ").append(accesses).append("\n"); + builder.append("editors = ").append(editors).append("\n"); + builder.append("tagNames = ").append(tagNames).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"); + builder.append("updateDatetime = ").append(updateDatetime).append("\n"); + builder.append("deleteFlag = ").append(deleteFlag).append("\n"); + return builder.toString(); + } + /** + * Convert label to display + * @param label label + * @return convert label + */ + protected String convLabelName(String label) { + return label; + } + /** + * validate + * @return validate error list + */ + public List validate() { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(this.title, convLabelName("Title")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(this.title, convLabelName("Title"), 1024); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.publicFlag, convLabelName("Public Flag")); + 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.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 + * @param values value map + * @return validate error list + */ + public List validate(Map values) { + List errors = new ArrayList<>(); + Validator validator; + ValidateError error; + validator = ValidatorFactory.getInstance(Validator.REQUIRED); + error = validator.validate(values.get("title"), convLabelName("Title")); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH); + error = validator.validate(values.get("title"), convLabelName("Title"), 1024); + if (error != null) { + errors.add(error); + } + validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("publicFlag"), convLabelName("Public Flag")); + 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.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/GenKnowledgeFilesEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgeFilesEntity.java index 391b3a924..b188fce76 100644 --- a/src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgeFilesEntity.java +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenKnowledgeFilesEntity.java @@ -56,6 +56,8 @@ public GenKnowledgeFilesEntity(Long fileNo) { private Long knowledgeId; /** コメント番号 */ private Long commentNo; + /** 下書きID */ + private Long draftId; /** ファイル名 */ private String fileName; /** ファイルサイズ */ @@ -123,6 +125,22 @@ public GenKnowledgeFilesEntity setCommentNo(Long commentNo) { return this; } + /** + * Get 下書きID. + * @return 下書きID + */ + public Long getDraftId() { + return this.draftId; + } + /** + * Set 下書きID. + * @param draftId 下書きID + * @return this object */ + public GenKnowledgeFilesEntity setDraftId(Long draftId) { + this.draftId = draftId; + return this; + } + /** * Get ファイル名. * @return ファイル名 @@ -318,6 +336,7 @@ public String toString() { builder.append("fileNo = ").append(fileNo).append("\n"); builder.append("knowledgeId = ").append(knowledgeId).append("\n"); builder.append("commentNo = ").append(commentNo).append("\n"); + builder.append("draftId = ").append(draftId).append("\n"); builder.append("fileName = ").append(fileName).append("\n"); builder.append("fileSize = ").append(fileSize).append("\n"); builder.append("fileBinary = ").append(fileBinary).append("\n"); 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 5229c0a51..e63499d45 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 @@ -67,6 +67,8 @@ public GenKnowledgesEntity(Long knowledgeId) { private Integer commentCount; /** テンプレートの種類ID */ private Integer typeId; + /** 通知ステータス */ + private Integer notifyStatus; /** 登録ユーザ */ private Integer insertUser; /** 登録日時 */ @@ -222,6 +224,22 @@ public GenKnowledgesEntity setTypeId(Integer typeId) { return this; } + /** + * Get 通知ステータス. + * @return 通知ステータス + */ + public Integer getNotifyStatus() { + return this.notifyStatus; + } + /** + * Set 通知ステータス. + * @param notifyStatus 通知ステータス + * @return this object */ + public GenKnowledgesEntity setNotifyStatus(Integer notifyStatus) { + this.notifyStatus = notifyStatus; + return this; + } + /** * Get 登録ユーザ. * @return 登録ユーザ @@ -359,6 +377,7 @@ public String toString() { builder.append("likeCount = ").append(likeCount).append("\n"); builder.append("commentCount = ").append(commentCount).append("\n"); builder.append("typeId = ").append(typeId).append("\n"); + builder.append("notifyStatus = ").append(notifyStatus).append("\n"); builder.append("insertUser = ").append(insertUser).append("\n"); builder.append("insertDatetime = ").append(insertDatetime).append("\n"); builder.append("updateUser = ").append(updateUser).append("\n"); @@ -413,6 +432,11 @@ public List validate() { errors.add(error); } validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(this.notifyStatus, convLabelName("Notify 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); @@ -469,6 +493,11 @@ public List validate(Map values) { errors.add(error); } validator = ValidatorFactory.getInstance(Validator.INTEGER); + error = validator.validate(values.get("notifyStatus"), convLabelName("Notify 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/GenWebhookConfigsEntity.java b/src/main/java/org/support/project/knowledge/entity/gen/GenWebhookConfigsEntity.java index b9e16ddeb..c71baf43b 100644 --- a/src/main/java/org/support/project/knowledge/entity/gen/GenWebhookConfigsEntity.java +++ b/src/main/java/org/support/project/knowledge/entity/gen/GenWebhookConfigsEntity.java @@ -17,7 +17,7 @@ import org.support.project.di.Instance; /** - * Webhooks 設定 + * Webhook 設定 */ @DI(instance = Instance.Prototype) public class GenWebhookConfigsEntity implements Serializable { @@ -59,9 +59,9 @@ public GenWebhookConfigsEntity(Integer hookId) { private Integer insertUser; /** 登録日時 */ private Timestamp insertDatetime; - /** */ + /** 更新ユーザ */ private Integer updateUser; - /** */ + /** 更新日時 */ private Timestamp updateDatetime; /** 削除フラグ */ private Integer deleteFlag; @@ -147,15 +147,15 @@ public GenWebhookConfigsEntity setInsertDatetime(Timestamp insertDatetime) { } /** - * Get . - * @return + * Get 更新ユーザ. + * @return 更新ユーザ */ public Integer getUpdateUser() { return this.updateUser; } /** - * Set . - * @param updateUser + * Set 更新ユーザ. + * @param updateUser 更新ユーザ * @return this object */ public GenWebhookConfigsEntity setUpdateUser(Integer updateUser) { this.updateUser = updateUser; @@ -163,15 +163,15 @@ public GenWebhookConfigsEntity setUpdateUser(Integer updateUser) { } /** - * Get . - * @return + * Get 更新日時. + * @return 更新日時 */ public Timestamp getUpdateDatetime() { return this.updateDatetime; } /** - * Set . - * @param updateDatetime + * Set 更新日時. + * @param updateDatetime 更新日時 * @return this object */ public GenWebhookConfigsEntity setUpdateDatetime(Timestamp updateDatetime) { this.updateDatetime = updateDatetime; diff --git a/src/main/java/org/support/project/knowledge/listener/CronListener.java b/src/main/java/org/support/project/knowledge/listener/CronListener.java index 63a0632c5..4ad7cc514 100644 --- a/src/main/java/org/support/project/knowledge/listener/CronListener.java +++ b/src/main/java/org/support/project/knowledge/listener/CronListener.java @@ -46,13 +46,13 @@ public void contextInitialized(final ServletContextEvent sce) { @Override public void run() { LOG.trace("called. [fileClearfuture]"); - // Java を別のVMで実行(添付ファイルの定期的なクリア) JavaJob job = new JavaJob(); job.setCurrentDirectory(logDir); job.addjarDir(new File(sce.getServletContext().getRealPath("/WEB-INF/lib"))); job.addClassPathDir(new File(sce.getServletContext().getRealPath("/WEB-INF/classes"))); job.setMainClass(KnowledgeFileClearBat.class.getName()); + job.setXmx(256); if (StringUtils.isNotEmpty(envValue)) { job.addEnvironment(SystemConfig.KNOWLEDGE_ENV_KEY, envValue); } @@ -74,12 +74,13 @@ public void run() { @Override public void run() { LOG.trace("called. [parsefuture]"); - // Java を別のVMで実行(添付ファイルの中身を抽出し検索可能にする) + // 添付ファイルの中身を抽出し検索可能にする JavaJob job = new JavaJob(); job.setCurrentDirectory(logDir); job.addjarDir(new File(sce.getServletContext().getRealPath("/WEB-INF/lib"))); job.addClassPathDir(new File(sce.getServletContext().getRealPath("/WEB-INF/classes"))); job.setMainClass(FileParseBat.class.getName()); + job.setXmx(1024); if (StringUtils.isNotEmpty(envValue)) { job.addEnvironment(SystemConfig.KNOWLEDGE_ENV_KEY, envValue); } @@ -101,12 +102,13 @@ public void run() { @Override public void run() { LOG.trace("called. [mailfuture]"); - // Java を別のVMで実行(添付ファイルの中身を抽出し検索可能にする) + // メール送信 JavaJob job = new JavaJob(); job.setCurrentDirectory(logDir); job.addjarDir(new File(sce.getServletContext().getRealPath("/WEB-INF/lib"))); job.addClassPathDir(new File(sce.getServletContext().getRealPath("/WEB-INF/classes"))); job.setMainClass(MailSendBat.class.getName()); + job.setXmx(256); if (StringUtils.isNotEmpty(envValue)) { job.addEnvironment(SystemConfig.KNOWLEDGE_ENV_KEY, envValue); } @@ -128,12 +130,13 @@ public void run() { @Override public void run() { LOG.trace("called. [webhookfuture]"); - // Java を別のVMで実行 + // Webhook JavaJob job = new JavaJob(); job.setCurrentDirectory(logDir); job.addjarDir(new File(sce.getServletContext().getRealPath("/WEB-INF/lib"))); job.addClassPathDir(new File(sce.getServletContext().getRealPath("/WEB-INF/classes"))); job.setMainClass(WebhookBat.class.getName()); + job.setXmx(256); if (StringUtils.isNotEmpty(envValue)) { job.addEnvironment(SystemConfig.KNOWLEDGE_ENV_KEY, envValue); } @@ -155,12 +158,13 @@ public void run() { @Override public void run() { LOG.trace("called. [mailHookfuture]"); - // Java を別のVMで実行(添付ファイルの中身を抽出し検索可能にする) + // メールからの投稿用のメールの読み込み JavaJob job = new JavaJob(); job.setCurrentDirectory(logDir); job.addjarDir(new File(sce.getServletContext().getRealPath("/WEB-INF/lib"))); job.addClassPathDir(new File(sce.getServletContext().getRealPath("/WEB-INF/classes"))); job.setMainClass(MailReadBat.class.getName()); + job.setXmx(256); if (StringUtils.isNotEmpty(envValue)) { job.addEnvironment(SystemConfig.KNOWLEDGE_ENV_KEY, envValue); } diff --git a/src/main/java/org/support/project/knowledge/logic/AccountLogic.java b/src/main/java/org/support/project/knowledge/logic/AccountLogic.java index 8fc1090c1..a07d801f3 100644 --- a/src/main/java/org/support/project/knowledge/logic/AccountLogic.java +++ b/src/main/java/org/support/project/knowledge/logic/AccountLogic.java @@ -1,5 +1,6 @@ package org.support.project.knowledge.logic; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Date; @@ -40,14 +41,14 @@ public static AccountLogic get() { /** * アイコンの保存 * - * @param fileItem + * @param img * @param loginedUser * @param context * @return * @throws IOException */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) - public UploadFile saveIconImage(FileItem fileItem, LoginedUser loginedUser, String context) throws IOException { + public UploadFile saveIconImage(byte[] img, LoginedUser loginedUser, String context) throws IOException { LOG.trace("saveFile()"); AccountImagesDao dao = AccountImagesDao.get(); AccountImagesEntity entity = dao.selectOnUserId(loginedUser.getUserId()); @@ -55,9 +56,9 @@ public UploadFile saveIconImage(FileItem fileItem, LoginedUser loginedUser, Stri entity = new AccountImagesEntity(); } - entity.setFileName(fileItem.getName()); - entity.setFileSize(new Double(fileItem.getSize())); - entity.setFileBinary(fileItem.getInputStream()); + entity.setFileName("account-" + loginedUser.getUserId() + ".png"); + entity.setFileSize(new Double(img.length)); + entity.setFileBinary(new ByteArrayInputStream(img)); entity.setUserId(loginedUser.getUserId()); String extension = StringUtils.getExtension(entity.getFileName()); @@ -78,8 +79,6 @@ public UploadFile saveIconImage(FileItem fileItem, LoginedUser loginedUser, Stri entity.setContentType(contentType); entity = dao.save(entity); UploadFile file = convUploadFile(context, entity); - // 処理が完了したら、テンポラリのファイルを削除 - fileItem.delete(); return file; } diff --git a/src/main/java/org/support/project/knowledge/logic/DataTransferLogic.java b/src/main/java/org/support/project/knowledge/logic/DataTransferLogic.java index 00b630d3c..4015cfb5e 100644 --- a/src/main/java/org/support/project/knowledge/logic/DataTransferLogic.java +++ b/src/main/java/org/support/project/knowledge/logic/DataTransferLogic.java @@ -26,11 +26,12 @@ import org.support.project.knowledge.config.AppConfig; import org.support.project.knowledge.dao.TemplateItemsDao; import org.support.project.knowledge.dao.TemplateMastersDao; +import org.support.project.knowledge.dao.gen.DatabaseControlDao; import org.support.project.knowledge.deploy.InitDB; import org.support.project.ormapping.config.ConnectionConfig; +import org.support.project.ormapping.config.ORMappingParameter; import org.support.project.ormapping.connection.ConnectionManager; import org.support.project.ormapping.dao.AbstractDao; -import org.support.project.ormapping.tool.dao.InitializeDao; import org.support.project.ormapping.transaction.TransactionManager; import org.support.project.web.dao.GroupsDao; import org.support.project.web.dao.RolesDao; @@ -72,12 +73,15 @@ public void transferData(ConnectionConfig from, ConnectionConfig to) throws Exce InitDB initDB = new InitDB(); initDB.start(); - // コピー先のDBの初期化(テーブルを全て消し、マイグレーション実行) + // コピー先のDBの初期化 LOG.info("migrate to db"); ConnectionManager.getInstance().setDefaultConnectionName(to.getName()); - InitializeDao initializeDao = InitializeDao.get(); - initializeDao.setConnectionName(to.getName()); - initializeDao.dropAllTable(); + DatabaseControlDao dao1 = new DatabaseControlDao(); + org.support.project.web.dao.gen.DatabaseControlDao dao2 = new org.support.project.web.dao.gen.DatabaseControlDao(); + dao1.setConnectionName(to.getName()); + dao2.setConnectionName(to.getName()); + dao1.dropAllTable(); + dao2.dropAllTable(); initDB.start(); // データコピー先のDBに入っている、初期データを削除 @@ -96,10 +100,13 @@ public void transferData(ConnectionConfig from, ConnectionConfig to) throws Exce Method truncateMethods = targetDao.getClass().getMethod("truncate"); truncateMethods.invoke(targetDao); try { - Method resetSequenceMethods = targetDao.getClass().getMethod("resetSequence"); - resetSequenceMethods.invoke(targetDao); + String driverClass = ConnectionManager.getInstance().getDriverClass(to.getName()); + if (ORMappingParameter.DRIVER_NAME_POSTGRESQL.equals(driverClass)) { + Method resetSequenceMethods = targetDao.getClass().getMethod("resetSequence"); + resetSequenceMethods.invoke(targetDao); + } } catch (Exception e) { - LOG.info(e.getMessage()); + LOG.debug(e.getMessage()); } } @@ -117,28 +124,51 @@ public void transferData(ConnectionConfig from, ConnectionConfig to) throws Exce LOG.info("Data transfer : " + class1.getName()); Object dao = Container.getComp(class1); // From からデータ取得 - LOG.info(" -> load data from " + from.getName()); ConnectionManager.getInstance().setDefaultConnectionName(from.getName()); Method setConnectionNameMethods = class1.getMethod("setConnectionName", String.class); setConnectionNameMethods.invoke(dao, from.getName()); - - Method selectAllMethods = class1.getMethod("physicalSelectAll"); - List list = (List) selectAllMethods.invoke(dao); - - // Toへデータ登録 - LOG.info(" -> insert data to " + to.getName()); - ConnectionManager.getInstance().setDefaultConnectionName(to.getName()); - setConnectionNameMethods.invoke(dao, to.getName()); - TransactionManager transactionManager = Container.getComp(TransactionManager.class); - transactionManager.start(to.getName()); - for (Object entity : list) { - if (LOG.isTraceEnabled()) { - LOG.trace(entity); + + try { + int limit = 100; + Method countAllMethods = class1.getMethod("physicalCountAll"); + int count = (int) countAllMethods.invoke(dao); + if (count > 0) { + int loop = count / limit; + if (count % limit != 0) { + loop++; + } + for (int i = 0; i < loop; i++) { + ConnectionManager.getInstance().setDefaultConnectionName(from.getName()); + setConnectionNameMethods.invoke(dao, from.getName()); + // 100 件毎にデータ移行する + Object[] args = new Object[2]; + args[0] = limit; + args[1] = limit * i; + LOG.trace(" -> load data from " + from.getName()); + Method selectAllMethods = class1.getMethod("physicalSelectAllWithPager", int.class, int.class); + List list = (List) selectAllMethods.invoke(dao, args); + + // Toへデータ登録 + LOG.info(" -> insert data to " + to.getName()); + ConnectionManager.getInstance().setDefaultConnectionName(to.getName()); + setConnectionNameMethods.invoke(dao, to.getName()); + TransactionManager transactionManager = Container.getComp(TransactionManager.class); + transactionManager.start(to.getName()); + for (Object entity : list) { + if (LOG.isTraceEnabled()) { + LOG.trace(entity); + } + Method insertMethods = class1.getMethod("rawPhysicalInsert", entity.getClass()); + insertMethods.invoke(dao, entity); + } + transactionManager.commit(to.getName()); + } } - Method insertMethods = class1.getMethod("rawPhysicalInsert", entity.getClass()); - insertMethods.invoke(dao, entity); + } catch (NoSuchMethodException e) { + LOG.info("skip: " + class1.getName()); + LOG.info(e.getMessage()); + continue; } - transactionManager.commit(to.getName()); } } } 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 7d8c2655b..a45d69038 100644 --- a/src/main/java/org/support/project/knowledge/logic/KnowledgeLogic.java +++ b/src/main/java/org/support/project/knowledge/logic/KnowledgeLogic.java @@ -21,6 +21,8 @@ import org.support.project.knowledge.bat.FileParseBat; import org.support.project.knowledge.config.IndexType; import org.support.project.knowledge.dao.CommentsDao; +import org.support.project.knowledge.dao.DraftItemValuesDao; +import org.support.project.knowledge.dao.DraftKnowledgesDao; import org.support.project.knowledge.dao.ExGroupsDao; import org.support.project.knowledge.dao.KnowledgeEditGroupsDao; import org.support.project.knowledge.dao.KnowledgeEditUsersDao; @@ -37,6 +39,8 @@ 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.DraftItemValuesEntity; +import org.support.project.knowledge.entity.DraftKnowledgesEntity; import org.support.project.knowledge.entity.KnowledgeEditGroupsEntity; import org.support.project.knowledge.entity.KnowledgeEditUsersEntity; import org.support.project.knowledge.entity.KnowledgeFilesEntity; @@ -55,10 +59,13 @@ import org.support.project.knowledge.indexer.IndexingValue; import org.support.project.knowledge.searcher.SearchResultValue; import org.support.project.knowledge.searcher.SearchingValue; +import org.support.project.knowledge.vo.KnowledgeData; import org.support.project.knowledge.vo.StockKnowledge; import org.support.project.web.bean.LabelValue; import org.support.project.web.bean.LoginedUser; +import org.support.project.web.common.HttpStatus; import org.support.project.web.entity.GroupsEntity; +import org.support.project.web.exception.AuthenticateException; /** * Logic class for knowledge data @@ -153,40 +160,37 @@ public List manegeTags(String tags) { /** * ナレッジを登録 * - * @param entity - * @param tags - * @param fileNos - * @param targets - * @param editors - * @param template - * @param loginedUser - * @return - * @throws Exception + * @param data KnowledgeData + * @param loginedUser LoginedUser + * @return KnowledgesEntity + * @throws Exception Exception */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) - public KnowledgesEntity insert(KnowledgesEntity entity, List tags, List fileNos, List targets, - List editors, TemplateMastersEntity template, LoginedUser loginedUser) throws Exception { + public KnowledgesEntity insert(KnowledgeData data, LoginedUser loginedUser) throws Exception { // ナレッジを登録 - KnowledgesEntity insertedEntity = knowledgesDao.insert(entity); + KnowledgesEntity insertedEntity = knowledgesDao.insert(data.getKnowledge()); // アクセス権を登録 - saveAccessUser(insertedEntity, loginedUser, targets); + saveAccessUser(insertedEntity, loginedUser, data.getViewers()); // 編集権を登録 - saveEditorsUser(insertedEntity, loginedUser, editors); + saveEditorsUser(insertedEntity, loginedUser, data.getEditors()); // タグを登録 - setTags(insertedEntity, tags); + setTags(insertedEntity, data.getTags()); // 添付ファイルを更新(紐付けをセット) - fileLogic.setKnowledgeFiles(insertedEntity.getKnowledgeId(), fileNos, loginedUser); + fileLogic.setKnowledgeFiles(insertedEntity.getKnowledgeId(), data.getFileNos(), loginedUser); // 拡張項目の保存 - saveTemplateItemValue(insertedEntity.getKnowledgeId(), template, loginedUser); + saveTemplateItemValue(insertedEntity.getKnowledgeId(), data.getTemplate(), loginedUser); // 全文検索エンジンへ登録 - saveIndex(insertedEntity, tags, targets, template, loginedUser.getUserId()); + saveIndex(insertedEntity, data.getTags(), data.getViewers(), data.getTemplate(), loginedUser.getUserId()); // 一覧表示用の情報を更新 updateKnowledgeExInfo(insertedEntity); // 履歴登録 insertHistory(insertedEntity); // 通知 NotifyLogic.get().notifyOnKnowledgeInsert(insertedEntity); + + // 下書きがあったら消す + removeDraft(data.getDraftId(), loginedUser); return insertedEntity; } @@ -194,20 +198,18 @@ public KnowledgesEntity insert(KnowledgesEntity entity, List tags, L /** * ナレッジを更新 * - * @param entity - * @param fileNos - * @param targets - * @param editors - * @param template - * @param loginedUser - * @return - * @throws Exception + * @param data KnowledgeData + * @param loginedUser LoginedUser + * @return KnowledgesEntity + * @throws Exception Exception */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) - public KnowledgesEntity update(KnowledgesEntity entity, List tags, List fileNos, List targets, - List editors, TemplateMastersEntity template, LoginedUser loginedUser) throws Exception { + public KnowledgesEntity update(KnowledgeData data, LoginedUser loginedUser) throws Exception { + // 更新前の情報を保持 + KnowledgesEntity db = knowledgesDao.selectOnKey(data.getKnowledge().getKnowledgeId()); // ナレッッジを更新 - KnowledgesEntity updatedEntity = knowledgesDao.update(entity); + data.getKnowledge().setNotifyStatus(db.getNotifyStatus()); // 通知フラグはDBの値を引き継ぐ + KnowledgesEntity updatedEntity = knowledgesDao.update(data.getKnowledge()); // ユーザのアクセス権を解除 knowledgeUsersDao.deleteOnKnowledgeId(updatedEntity.getKnowledgeId()); // グループとナレッジのヒモ付を解除 @@ -220,35 +222,44 @@ public KnowledgesEntity update(KnowledgesEntity entity, List tags, L editGroupsDao.deleteOnKnowledgeId(updatedEntity.getKnowledgeId()); // アクセス権を登録 - saveAccessUser(updatedEntity, loginedUser, targets); + saveAccessUser(updatedEntity, loginedUser, data.getViewers()); // 編集権を登録 - saveEditorsUser(updatedEntity, loginedUser, editors); + saveEditorsUser(updatedEntity, loginedUser, data.getEditors()); // タグを登録 knowledgeTagsDao.deleteOnKnowledgeId(updatedEntity.getKnowledgeId()); - setTags(updatedEntity, tags); + setTags(updatedEntity, data.getTags()); // 拡張項目の保存 - saveTemplateItemValue(updatedEntity.getKnowledgeId(), template, loginedUser); + saveTemplateItemValue(updatedEntity.getKnowledgeId(), data.getTemplate(), loginedUser); // 添付ファイルを更新(紐付けをセット) - fileLogic.setKnowledgeFiles(updatedEntity.getKnowledgeId(), fileNos, loginedUser); - - // 全文検索エンジンへ登録 - saveIndex(updatedEntity, tags, targets, template, updatedEntity.getInsertUser()); + fileLogic.setKnowledgeFiles(updatedEntity.getKnowledgeId(), data.getFileNos(), loginedUser); // 一覧表示用の情報を更新 updateKnowledgeExInfo(updatedEntity); - // 履歴登録 - insertHistory(updatedEntity); - - // 通知 - NotifyLogic.get().notifyOnKnowledgeUpdate(updatedEntity); + if (data.isUpdateContent()) { + // 履歴登録 + insertHistory(updatedEntity); + // 通知 + NotifyLogic.get().notifyOnKnowledgeUpdate(updatedEntity); + } else { + // 更新ユーザ&更新日付を戻す + updatedEntity.setUpdateUser(db.getUpdateUser()); + updatedEntity.setUpdateDatetime(db.getUpdateDatetime()); + knowledgesDao.physicalUpdate(updatedEntity); + } + // 全文検索エンジンへ登録 + saveIndex(updatedEntity, data.getTags(), data.getViewers(), data.getTemplate(), updatedEntity.getInsertUser()); + // 下書きがあったら消す + removeDraft(data.getDraftId(), loginedUser); + return updatedEntity; } + /** * テンプレートにある拡張項目値を保存 * @@ -302,7 +313,7 @@ private void setTags(KnowledgesEntity entity, List tags) { if (tags != null) { for (TagsEntity tagsEntity : tags) { KnowledgeTagsEntity knowledgeTagsEntity = new KnowledgeTagsEntity(entity.getKnowledgeId(), tagsEntity.getTagId()); - knowledgeTagsDao.insert(knowledgeTagsEntity); + knowledgeTagsDao.save(knowledgeTagsEntity); } } } @@ -1258,7 +1269,23 @@ public void reindexing(KnowledgesEntity knowledgesEntity) throws Exception { filesDao.changeStatus(knowledgeFilesEntity.getFileNo(), FileParseBat.PARSE_STATUS_WAIT, FileParseBat.UPDATE_USER_ID); } } - + + /** + * ナレッジに対し編集権限があるかチェック + * @param loginedUser + * @param knowledgeId + * @return + */ + public boolean isEditor(LoginedUser loginedUser, Long knowledgeId) { + KnowledgesEntity check = KnowledgesDao.get().selectOnKey(knowledgeId); + if (check == null) { + return false; + } + List editors = TargetLogic.get().selectEditorsOnKnowledgeId(knowledgeId); + return isEditor(loginedUser, check, editors); + } + + /** * ナレッジに対し編集権限があるかチェック * @@ -1366,6 +1393,95 @@ public List setStockInfo(List knowledges, Logi } return list; } + + /** + * 下書き保存 + * @param draft + * @param template + * @param files + * @param loginedUser + * @return + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public DraftKnowledgesEntity draft(DraftKnowledgesEntity draft, TemplateMastersEntity template, String[] files, LoginedUser loginedUser) { + if (draft.getKnowledgeId() != null && draft.getKnowledgeId() > 0) { + // 権限チェック + KnowledgesEntity knowledge = KnowledgesDao.get().selectOnKey(draft.getKnowledgeId()); + String editorsstr = draft.getEditors(); + String[] editordids = editorsstr.split(","); + List editors = TargetLogic.get().selectTargets(editordids); + if (!isEditor(loginedUser, knowledge, editors)) { + throw new AuthenticateException("errors.noauthority"); + } + } + if (draft.getDraftId() == null || draft.getDraftId() <= 0) { + DraftKnowledgesDao.get().insert(draft); + } else { + DraftKnowledgesEntity saved = DraftKnowledgesDao.get().selectOnKey(draft.getDraftId()); + if (saved == null) { + // 既に別の画面で削除済 + DraftKnowledgesDao.get().insert(draft); + } else { + draft.setInsertUser(saved.getInsertUser()); + draft.setInsertDatetime(saved.getInsertDatetime()); + DraftKnowledgesDao.get().update(draft); + DraftItemValuesDao.get().deleteOnDraftId(draft.getDraftId()); + } + } + if (template != null && template.getItems() != null) { + for (TemplateItemsEntity item : template.getItems()) { + DraftItemValuesEntity val = new DraftItemValuesEntity(); + val.setDraftId(draft.getDraftId()); + val.setTypeId(template.getTypeId()); + val.setItemNo(item.getItemNo()); + val.setItemValue(item.getItemValue()); + val.setItemStatus(KnowledgeItemValuesEntity.STATUS_SAVED); + DraftItemValuesDao.get().save(val); + } + } + // 添付ファイルと下書きを紐付ける(紐付けを作るのみ、既存のKnowledgeの添付ファイルを削除はしない) + // 削除する場合は、「投稿する」を実施すること(制御を簡単にするため) + if (files != null) { + for (String string : files) { + if (StringUtils.isLong(string)) { + Long fileNo = new Long(string); + KnowledgeFilesEntity entity = KnowledgeFilesDao.get().selectOnKeyWithoutBinary(fileNo); + if (entity != null) { + if (entity.getKnowledgeId() == null || entity.getKnowledgeId().longValue() == 0) { + // 既にKnowledgeに紐付いているものは対象外 + entity.setDraftId(draft.getDraftId()); + entity.setKnowledgeId(null); + KnowledgeFilesDao.get().updateDraftId(entity, loginedUser.getUserId()); + } + } + } + } + } + return draft; + } + + /** + * 下書きを削除 + * @param draftId + * @param loginedUser + */ + @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) + public void removeDraft(Long draftId, LoginedUser loginedUser) { + DraftKnowledgesEntity draft = DraftKnowledgesDao.get().selectOnKey(draftId); + if (draft == null) { + // 既に削除済 + return; + } + if (draft.getInsertUser().intValue() != loginedUser.getUserId().intValue()) { + // 登録していない下書きを消そうとしているんで、何もしない + // TODO エラーにするべき? + return; + } + DraftKnowledgesDao.get().physicalDelete(draft); + DraftItemValuesDao.get().deleteOnDraftId(draftId); + } + + } diff --git a/src/main/java/org/support/project/knowledge/logic/MailhookLogic.java b/src/main/java/org/support/project/knowledge/logic/MailhookLogic.java index eacc733a8..477076daa 100644 --- a/src/main/java/org/support/project/knowledge/logic/MailhookLogic.java +++ b/src/main/java/org/support/project/knowledge/logic/MailhookLogic.java @@ -52,6 +52,7 @@ import org.support.project.knowledge.entity.MailHooksEntity; import org.support.project.knowledge.entity.MailPostsEntity; import org.support.project.knowledge.entity.TagsEntity; +import org.support.project.knowledge.vo.KnowledgeData; import org.support.project.ormapping.common.DBUserPool; import org.support.project.web.bean.LabelValue; import org.support.project.web.bean.LoginedUser; @@ -345,7 +346,13 @@ private void updateTargetsAndTags(KnowledgesEntity knowledge, MailHookConditions editors = existsEditors; } - KnowledgesEntity entity = KnowledgeLogic.get().update(knowledge, tagList, null, viewers, editors, null, loginedUser); + KnowledgeData data = new KnowledgeData(); + data.setKnowledge(knowledge); + data.setTags(tagList); + data.setViewers(viewers); + data.setEditors(editors); + + KnowledgesEntity entity = KnowledgeLogic.get().update(data, loginedUser); LOG.info("Knowledge[" + entity.getKnowledgeId() + "] " + entity.getTitle() + " was updated."); } @@ -407,7 +414,14 @@ private void addKnowkedge(Message msg, MailHookConditionsEntity condition, Login } List fileNos = addAtachFiles(msg); - entity = KnowledgeLogic.get().insert(entity, tagList, fileNos, viewers, editors, null, loginedUser); + KnowledgeData data = new KnowledgeData(); + data.setKnowledge(entity); + data.setTags(tagList); + data.setViewers(viewers); + data.setEditors(editors); + data.setFileNos(fileNos); + + entity = KnowledgeLogic.get().insert(data, loginedUser); MailPostsEntity post = new MailPostsEntity(); post.setMessageId(msgId); diff --git a/src/main/java/org/support/project/knowledge/logic/UploadedFileLogic.java b/src/main/java/org/support/project/knowledge/logic/UploadedFileLogic.java index 96858953b..fee14e083 100644 --- a/src/main/java/org/support/project/knowledge/logic/UploadedFileLogic.java +++ b/src/main/java/org/support/project/knowledge/logic/UploadedFileLogic.java @@ -34,7 +34,17 @@ public class UploadedFileLogic { public static UploadedFileLogic get() { return Container.getComp(UploadedFileLogic.class); } - + + /** アイコン画像の種類 */ + public static final String[] ICONS = { "_blank", "_page", "aac", "ai", "aiff", "avi", "bmp", "c", "cpp", + "css", "dat", "dmg", "doc", "dotx", "dwg", "dxf", "eps", "exe", "flv", "gif", "h", + "hpp", "html", "ics", "iso", "java", "jpg", "js", "key", "less", "mid", "mp3", "mp4", + "mpg", "odf", "ods", "odt", "otp", "ots", "ott", "pdf", "php", "png", "ppt", "psd", + "py", "qt", "rar", "rb", "rtf", "sass", "scss", "sql", "tga", "tgz", "tiff", "txt", + "wav", "xls", "xlsx", "xml", "yml", "zip" }; + + + /** * ファイルを保存する * @@ -66,23 +76,28 @@ public UploadFile saveFile(FileItem fileItem, LoginedUser loginedUser, String co * @param entity * @return */ - private UploadFile convUploadFile(String context, KnowledgeFilesEntity entity) { + public UploadFile convUploadFile(String context, KnowledgeFilesEntity entity) { UploadFile file = new UploadFile(); file.setFileNo(entity.getFileNo()); file.setUrl(context + "/open.file/download?fileNo=" + entity.getFileNo()); - // file.setThumbnailUrl(context + "/open.file/thumbnai?fileNo=" + entity.getFileNo()); - file.setThumbnailUrl(context + "/bower/teambox.free-file-icons/32px/_blank.png"); file.setName(entity.getFileName()); - //file.setType("-"); + String thumbnai = context + "/bower/teambox.free-file-icons/16px/_blank.png"; String extention = StringUtils.getExtension(entity.getFileName()); - if (StringUtils.contains(extention, ".png", ".jpg", ".jpeg", ".gif", ".bmp")) { - file.setType("image"); - } else if (StringUtils.contains(extention, ".pdf", ".pptx")) { - file.setType("slide"); - } else { - file.setType("file"); + if (StringUtils.isNotEmpty(extention)) { + extention = extention.substring(1); // 先頭の「.」を削除 + if (StringUtils.contains(extention, "png", "jpg", "jpeg", "gif", "bmp")) { + file.setType("image"); + } else if (StringUtils.contains(extention, "pdf", "pptx")) { + file.setType("slide"); + } else { + file.setType("file"); + } + if (StringUtils.contains(extention, ICONS)) { + thumbnai = context + "/bower/teambox.free-file-icons/16px/" + extention + ".png"; + } } + file.setThumbnailUrl(thumbnai); file.setSize(entity.getFileSize()); file.setDeleteUrl(context + "/protect.file/delete?fileNo=" + entity.getFileNo()); diff --git a/src/main/java/org/support/project/knowledge/logic/WebhookLogic.java b/src/main/java/org/support/project/knowledge/logic/WebhookLogic.java index f0b14dfb9..69a0f29bb 100644 --- a/src/main/java/org/support/project/knowledge/logic/WebhookLogic.java +++ b/src/main/java/org/support/project/knowledge/logic/WebhookLogic.java @@ -74,6 +74,15 @@ public Map getKnowledgeData(KnowledgesEntity knowledge, Integer jsonObject.put("comment_count", knowledge.getCommentCount()); jsonObject.put("type_id", knowledge.getTypeId()); jsonObject.put("link", NotifyLogic.get().makeURL(knowledge.getKnowledgeId())); + + boolean became_public = false; + if (knowledge.getNotifyStatus() == null || knowledge.getNotifyStatus().intValue() == 0) { + if (knowledge.getPublicFlag().intValue() != KnowledgeLogic.PUBLIC_FLAG_PRIVATE) { + // 今まで非公開だったものが、初めての通知になった + became_public = true; + } + } + jsonObject.put("became_public", became_public); if (type != null) { if (Notify.TYPE_KNOWLEDGE_INSERT == type) { diff --git a/src/main/java/org/support/project/knowledge/parser/impl/PdfSlideShowParserOnPdfbox.java b/src/main/java/org/support/project/knowledge/parser/impl/PdfSlideShowParserOnPdfbox.java index 896b1b06f..9a272b749 100644 --- a/src/main/java/org/support/project/knowledge/parser/impl/PdfSlideShowParserOnPdfbox.java +++ b/src/main/java/org/support/project/knowledge/parser/impl/PdfSlideShowParserOnPdfbox.java @@ -4,6 +4,8 @@ import java.io.File; import java.io.IOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.rendering.ImageType; import org.apache.pdfbox.rendering.PDFRenderer; @@ -12,6 +14,8 @@ import org.support.project.knowledge.parser.SlideShowParser; public class PdfSlideShowParserOnPdfbox implements SlideShowParser { + /** ログ */ + private static final Log LOG = LogFactory.getLog(PdfSlideShowParserOnPdfbox.class); @Override public void parse(File inputFile, File outputDir) throws ParseException { @@ -43,6 +47,9 @@ public void parse(File inputFile, File outputDir) throws ParseException { document.close(); } catch (IOException e) { throw new ParseException(e); + } catch (OutOfMemoryError e) { + LOG.error("OutOfMemoryError"); + throw e; } } diff --git a/src/main/java/org/support/project/knowledge/parser/impl/PptxSlideShowParser.java b/src/main/java/org/support/project/knowledge/parser/impl/PptxSlideShowParser.java index 1f4fa136b..78503b29a 100644 --- a/src/main/java/org/support/project/knowledge/parser/impl/PptxSlideShowParser.java +++ b/src/main/java/org/support/project/knowledge/parser/impl/PptxSlideShowParser.java @@ -8,11 +8,10 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; -import java.util.Locale; import java.util.Map; -import javax.imageio.ImageIO; - +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.pdfbox.tools.imageio.ImageIOUtil; import org.apache.poi.EncryptedDocumentException; import org.apache.poi.sl.draw.Drawable; @@ -24,6 +23,8 @@ import org.support.project.knowledge.parser.SlideShowParser; public class PptxSlideShowParser implements SlideShowParser { + /** ログ */ + private static final Log LOG = LogFactory.getLog(PptxSlideShowParser.class); @Override public void parse(File inputFile, File outputDir) throws ParseException { @@ -71,6 +72,9 @@ public void parse(File inputFile, File outputDir) throws ParseException { } } catch (EncryptedDocumentException | IOException e) { throw new ParseException(e); + } catch (OutOfMemoryError e) { + LOG.error("OutOfMemoryError"); + throw e; } } diff --git a/src/main/java/org/support/project/knowledge/vo/KnowledgeData.java b/src/main/java/org/support/project/knowledge/vo/KnowledgeData.java new file mode 100644 index 000000000..ff920f601 --- /dev/null +++ b/src/main/java/org/support/project/knowledge/vo/KnowledgeData.java @@ -0,0 +1,252 @@ +package org.support.project.knowledge.vo; + +import java.util.ArrayList; +import java.util.List; + +import org.support.project.common.util.StringUtils; +import org.support.project.knowledge.entity.KnowledgesEntity; +import org.support.project.knowledge.entity.TagsEntity; +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.web.bean.LabelValue; + +public class KnowledgeData { + private KnowledgesEntity knowledge; + private List tags; + private List viewers; + private List editors; + private List fileNos; + private TemplateMastersEntity template; + private Long draftId; + private boolean updateContent; + + private String viewersStr; + private String editorsStr; + private String tagsStr; + private String[] filesStrs; + + public static KnowledgeData create(KnowledgesEntity knowledge, String viewersStr, String editorsStr, + String tagsStr, String[] filesStrs, Long draftId, TemplateMastersEntity template) { + KnowledgeData data = new KnowledgeData(); + + data.setKnowledge(knowledge); + data.setViewers(viewersStr); + data.setEditors(editorsStr); + data.setTags(tagsStr); + data.setFileNos(filesStrs); + data.setDraftId(draftId); + data.setTemplate(template); + + return data; + } + + + public void setViewers(String viewersStr) { + this.viewersStr = viewersStr; + String[] targets = viewersStr.split(","); + this.viewers = TargetLogic.get().selectTargets(targets); + } + public void setEditors(String editorsStr) { + this.editorsStr = editorsStr; + String[] editordids = editorsStr.split(","); + this.editors = TargetLogic.get().selectTargets(editordids); + } + public void setTags(String tagsStr) { + this.tagsStr = tagsStr; + List tags = KnowledgeLogic.get().manegeTags(tagsStr); + this.tags = tags; + } + public void setFileNos(String[] filesStrs) { + this.filesStrs = filesStrs; + this.fileNos = new ArrayList(); + if (filesStrs != null) { + for (String string : filesStrs) { + if (StringUtils.isLong(string)) { + this.fileNos.add(new Long(string)); + } + } + } + } + + + + + + + /** + * Get knowledge + * @return the knowledge + */ + public KnowledgesEntity getKnowledge() { + return knowledge; + } + /** + * Set knowledge + * @param knowledge the knowledge to set + */ + public void setKnowledge(KnowledgesEntity knowledge) { + this.knowledge = knowledge; + } + /** + * Get tags + * @return the tags + */ + public List getTags() { + return tags; + } + /** + * Set tags + * @param tags the tags to set + */ + public void setTags(List tags) { + this.tags = tags; + } + /** + * Get viewers + * @return the viewers + */ + public List getViewers() { + return viewers; + } + /** + * Set viewers + * @param viewers the viewers to set + */ + public void setViewers(List viewers) { + this.viewers = viewers; + } + /** + * Get editors + * @return the editors + */ + public List getEditors() { + return editors; + } + /** + * Set editors + * @param editors the editors to set + */ + public void setEditors(List editors) { + this.editors = editors; + } + /** + * Get fileNos + * @return the fileNos + */ + public List getFileNos() { + return fileNos; + } + /** + * Set fileNos + * @param fileNos the fileNos to set + */ + public void setFileNos(List fileNos) { + this.fileNos = fileNos; + } + /** + * Get template + * @return the template + */ + public TemplateMastersEntity getTemplate() { + return template; + } + /** + * Set template + * @param template the template to set + */ + public void setTemplate(TemplateMastersEntity template) { + this.template = template; + } + /** + * Get draftId + * @return the draftId + */ + public Long getDraftId() { + return draftId; + } + /** + * Set draftId + * @param draftId the draftId to set + */ + public void setDraftId(Long draftId) { + this.draftId = draftId; + } + /** + * Get viewersStr + * @return the viewersStr + */ + public String getViewersStr() { + return viewersStr; + } + /** + * Set viewersStr + * @param viewersStr the viewersStr to set + */ + public void setViewersStr(String viewersStr) { + this.viewersStr = viewersStr; + } + /** + * Get editorsStr + * @return the editorsStr + */ + public String getEditorsStr() { + return editorsStr; + } + /** + * Set editorsStr + * @param editorsStr the editorsStr to set + */ + public void setEditorsStr(String editorsStr) { + this.editorsStr = editorsStr; + } + /** + * Get tagsStr + * @return the tagsStr + */ + public String getTagsStr() { + return tagsStr; + } + /** + * Set tagsStr + * @param tagsStr the tagsStr to set + */ + public void setTagsStr(String tagsStr) { + this.tagsStr = tagsStr; + } + /** + * Get filesStrs + * @return the filesStrs + */ + public String[] getFilesStrs() { + return filesStrs; + } + /** + * Set filesStrs + * @param filesStrs the filesStrs to set + */ + public void setFilesStrs(String[] filesStrs) { + this.filesStrs = filesStrs; + } + + + /** + * Get updateContent + * @return the updateContent + */ + public boolean isUpdateContent() { + return updateContent; + } + + + /** + * Set updateContent + * @param updateContent the updateContent to set + */ + public void setUpdateContent(boolean updateContent) { + this.updateContent = updateContent; + } + + + +} diff --git a/src/main/resources/appresource.properties b/src/main/resources/appresource.properties index 541092aaa..ed13b9d28 100644 --- a/src/main/resources/appresource.properties +++ b/src/main/resources/appresource.properties @@ -52,13 +52,14 @@ message.success.delete.target={1} was Removed. message.success.accept.target={1} was Accepted. message.success.save.target={1} was Saved. -message.allready.updated=Allready updated. -message.allready.started=Allready started. +message.allready.deleted=Already deleted. +message.allready.updated=Already updated. +message.allready.started=Already started. message.confirm.delete=Are you sure you want to delete? # Common Label -label.version=v1.6.0 +label.version=v1.7.0 label.login=Sign in label.previous = Previous label.next=Next @@ -106,6 +107,9 @@ label.hook=Hook label.enable=Enable label.disable=Disable label.submit=Submit +label.draft=Draft +label.release=Release +label.new=New label.public.view= [Public] label.protect.view= [Protection] @@ -267,6 +271,9 @@ knowledge.add.label.destination.select=Select Targets knowledge.add.label.editors=Editors knowledge.add.label.editors.select=Select Editors knowledge.add.label.groups.select=Select targets +knowledge.add.label.meta=Meta +knowledge.add.draft.flag=[Draft] +knowledge.add.draft.info=*Draft will delete at released. knowledge.edit.title=Edit Knowledge knowledge.edit.label.key=No / Date knowledge.edit.label.uploaded=Uploaded. @@ -275,8 +282,10 @@ knowledge.edit.label.delete.upload=Remove file knowledge.edit.label.fail.delete.upload=Fail remove file knowledge.edit.label.confirm.delete=Are you sure you want to delete? knowledge.edit.noaccess=You can't edit this knowledge -knowledge.edit.set.image.path=Add Image in this contents -knowledge.edit.set.slide.path=Add SlideShow in this contents +knowledge.edit.set.image.path=ShowImage +knowledge.edit.set.slide.path=SlideShow +knowledge.edit.update.content=updated a content +knowledge.edit.update.meta=Only meta information was updated (update notification is not sent) knowledge.delete.none=Knowledge to be deleted is not specified knowledge.likes.title=User list that was me press the "Like" @@ -301,7 +310,7 @@ knowledge.signup.done=User registration is now complete knowledge.tags.title=Tag list knowledge.account.title=My Account -knowledge.account.label.icon.drop=The icon image, here and drop +knowledge.account.label.icon.drop= knowledge.account.label.icon.select=Select icon knowledge.account.label.password.msg=(input to change password) knowledge.account.delete=Thank you for your use @@ -388,6 +397,7 @@ knowledge.config.highlight=Code Highlight knowledge.accept.title=List of users awaiting approval knowledge.accept.label.list.empty=There is no user waiting for approval knowledge.accept.label.accept=Approve +knowledge.accept.label.delete=Delete knowledge.user.list.title=User List knowledge.user.list.label.empty=The data corresponding to the condition does not exist. Please switch the page. knowledge.user.add.title=Add User @@ -624,20 +634,20 @@ knowledge.proxy.test.type.direct=Direct connect.(Not use proxy) knowledge.proxy.test.done=Connected to the url. please see result. knowledge.proxy.msg=When the type of Knowledge is "Bookmark", to get the contents written to the registered URL. -+knowledge.webhook.title=WebHook Config -+knowledge.webhook.msg=When articles and comments were posted, notify an external servers. -+knowledge.webhook.event.knowledge.title=Knowledge events -+knowledge.webhook.event.knowledge.description=It will hook into this URL when the article was posted. -+knowledge.webhook.event.comment.title=Comment events -+knowledge.webhook.event.comment.description=It will hook into this URL when the comment was posted. -+knowledge.webhook.list.title=Web hooks -+knowledge.webhook.test=Test hook -+knowledge.webhook.confirm.delete=Delete the webhook settings? -+knowledge.webhook.confirm.test=Test the webhook settings? -+knowledge.webhook.delete.error=Failed to delete the webhook settings. -+knowledge.webhook.delete.success=Deleted the setting of Webhooks. -+knowledge.webhook.test.error=Failed to test the webhook settings. -+knowledge.webhook.test.success=Test send of webhook was successful. +knowledge.webhook.title=WebHook Config +knowledge.webhook.msg=When articles and comments were posted, notify an external servers. +knowledge.webhook.event.knowledge.title=Knowledge events +knowledge.webhook.event.knowledge.description=It will hook into this URL when the article was posted. +knowledge.webhook.event.comment.title=Comment events +knowledge.webhook.event.comment.description=It will hook into this URL when the comment was posted. +knowledge.webhook.list.title=Web hooks +knowledge.webhook.test=Test hook +knowledge.webhook.confirm.delete=Delete the webhook settings? +knowledge.webhook.confirm.test=Test the webhook settings? +knowledge.webhook.delete.error=Failed to delete the webhook settings. +knowledge.webhook.delete.success=Deleted the setting of Webhooks. +knowledge.webhook.test.error=Failed to test the webhook settings. +knowledge.webhook.test.success=Test send of webhook was successful. knowledge.template.list.label.empty=Empty knowledge.template.add.title=Add template. @@ -726,3 +736,7 @@ knowledge.admin.mailhook.info.1=Post from e-mail is a automation function for ad knowledge.admin.mailhook.info.2=After the reception, all mails will delete in this mailbox. knowledge.admin.mailhook.info.3=For this reason, please prepare the e-mail address of this function only. +knowledge.draft.list.title=Draft List +knowledge.draft.list.empty=Empty List +knowledge.draft.list.empty.title=Empty Title +knowledge.draft.view.msg.not.editor=You are not editor this knowledge. because other knowledge editor clear your role on editors. diff --git a/src/main/resources/appresource_ja.properties b/src/main/resources/appresource_ja.properties index a81874681..05ed13280 100644 --- a/src/main/resources/appresource_ja.properties +++ b/src/main/resources/appresource_ja.properties @@ -52,13 +52,14 @@ message.success.delete.target={1} を削除しました。 message.success.accept.target={1} を承認しました。 message.success.save.target={1} 保存しました。 +message.allready.deleted=すでに削除されています message.allready.updated=すでに更新されています message.allready.started=すでに開始済です message.confirm.delete=本当に削除しますか? # Common Label -label.version=v1.6.0 +label.version=v1.7.0 label.login=サインイン label.previous = 前へ label.next = 次へ @@ -106,6 +107,9 @@ label.hook=Hook label.enable=有効 label.disable=無効 label.submit=実行 +label.draft=下書き +label.release=投稿する +label.new=新規作成 label.public.view= [公開] label.protect.view= [保護] @@ -267,6 +271,9 @@ knowledge.add.label.destination.select=公開先を選択 knowledge.add.label.editors=共同で編集する knowledge.add.label.editors.select=共同編集者を選択 knowledge.add.label.groups.select=公開先選択 +knowledge.add.label.meta=属性 +knowledge.add.draft.flag=[下書き保存中] +knowledge.add.draft.info=※「投稿する」と下書きは無くなります。 knowledge.edit.title=ナレッジを更新 knowledge.edit.label.key=番号 / 更新日 knowledge.edit.label.uploaded=ファイルをアップロードしました @@ -276,7 +283,9 @@ knowledge.edit.label.fail.delete.upload=ファイルの削除に失敗しまし knowledge.edit.label.confirm.delete=本当に削除しますか? knowledge.edit.noaccess=編集権限がありません knowledge.edit.set.image.path=画像を表示 -knowledge.edit.set.slide.path=スライドショー表示 +knowledge.edit.set.slide.path=スライドショー +knowledge.edit.update.content=内容を更新しました +knowledge.edit.update.meta=属性情報のみ更新しました(更新の通知は送られません) knowledge.delete.none=削除するナレッジが指定されていません knowledge.likes.title=「いいね!」を押してくれたユーザ一覧 @@ -301,7 +310,7 @@ knowledge.signup.done=ユーザ登録が完了しました knowledge.tags.title=タグ一覧 knowledge.account.title=アカウント情報 -knowledge.account.label.icon.drop=アイコン画像を、ここへドロップ(5MBまで) +knowledge.account.label.icon.drop= knowledge.account.label.icon.select=アイコンを選択 knowledge.account.label.password.msg=(変更する場合のみ入力してください) knowledge.account.delete=ご利用ありがとうございました @@ -388,6 +397,7 @@ knowledge.config.highlight=Code Highlight knowledge.accept.title=承認待ちのユーザの一覧 knowledge.accept.label.list.empty=承認待ちのユーザはいません knowledge.accept.label.accept=承認する +knowledge.accept.label.delete=削除する knowledge.user.list.title=ユーザ一覧 knowledge.user.list.label.empty=条件に該当するデータは存在しません。条件(ページ番号)を切り替えてください。 knowledge.user.add.title=ユーザの追加 @@ -726,4 +736,7 @@ knowledge.admin.mailhook.info.1=メールから投稿は以下に設定したメ knowledge.admin.mailhook.info.2=定期的に受信するメールボックスに届いたメールは、受信後に削除します。 knowledge.admin.mailhook.info.3=このため、メール投稿専用のメールアドレスを用意してください。 - +knowledge.draft.list.title=下書き一覧 +knowledge.draft.list.empty=このページに該当するデータは存在しませんでした。 +knowledge.draft.list.empty.title=タイトル未指定 +knowledge.draft.view.msg.not.editor=指定の下書きは、登録済のナレッジの編集情報ですが編集権限が無くなっており「投稿」でできなくなっています。ナレッジ編集者に、共同編集者に登録のリクエストを出してください。 diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/AccountImagesDao/AccountImagesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/AccountImagesDao/AccountImagesDao_select_on_key.sql index 3622e625c..7ff7ab812 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/AccountImagesDao/AccountImagesDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/AccountImagesDao/AccountImagesDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM ACCOUNT_IMAGES WHERE IMAGE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_select_on_key.sql index 6d8d016b3..e0c078dcd 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM COMMENTS WHERE COMMENT_NO = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_delete.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_delete.sql new file mode 100644 index 000000000..87f736ac0 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_delete.sql @@ -0,0 +1,6 @@ +DELETE FROM DRAFT_ITEM_VALUES +WHERE +DRAFT_ID = ? + AND ITEM_NO = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_insert.sql new file mode 100644 index 000000000..013e895f9 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_insert.sql @@ -0,0 +1,24 @@ +INSERT INTO DRAFT_ITEM_VALUES +( +DRAFT_ID + , ITEM_NO + , 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/DraftItemValuesDao/DraftItemValuesDao_physical_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_all.sql new file mode 100644 index 000000000..dc88dde4b --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_all.sql @@ -0,0 +1,2 @@ +SELECT * FROM DRAFT_ITEM_VALUES +ORDER BY INSERT_DATETIME DESC; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_all_with_pager.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_all_with_pager.sql new file mode 100644 index 000000000..4f4440c74 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_all_with_pager.sql @@ -0,0 +1,3 @@ +SELECT * FROM DRAFT_ITEM_VALUES +ORDER BY INSERT_DATETIME DESC +LIMIT ? OFFSET ?; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_draft_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_draft_id.sql new file mode 100644 index 000000000..a1dcac15e --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_draft_id.sql @@ -0,0 +1,4 @@ +SELECT * FROM DRAFT_ITEM_VALUES + WHERE +DRAFT_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_item_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_item_no.sql new file mode 100644 index 000000000..95286cc66 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_item_no.sql @@ -0,0 +1,4 @@ +SELECT * FROM DRAFT_ITEM_VALUES + WHERE +ITEM_NO = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_key.sql new file mode 100644 index 000000000..3862c0fc2 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_key.sql @@ -0,0 +1,6 @@ +SELECT * FROM DRAFT_ITEM_VALUES + WHERE +DRAFT_ID = ? + AND ITEM_NO = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_type_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_type_id.sql new file mode 100644 index 000000000..d1928fd9a --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_physical_select_on_type_id.sql @@ -0,0 +1,4 @@ +SELECT * FROM DRAFT_ITEM_VALUES + WHERE +TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_raw_insert.sql new file mode 100644 index 000000000..013e895f9 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_raw_insert.sql @@ -0,0 +1,24 @@ +INSERT INTO DRAFT_ITEM_VALUES +( +DRAFT_ID + , ITEM_NO + , 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/DraftItemValuesDao/DraftItemValuesDao_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_all.sql new file mode 100644 index 000000000..8a6863a14 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_all.sql @@ -0,0 +1,3 @@ +SELECT * FROM DRAFT_ITEM_VALUES +WHERE DELETE_FLAG = 0 +ORDER BY INSERT_DATETIME DESC; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_all_with_pager.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_all_with_pager.sql new file mode 100644 index 000000000..cc17a2082 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_all_with_pager.sql @@ -0,0 +1,4 @@ +SELECT * FROM DRAFT_ITEM_VALUES +WHERE DELETE_FLAG = 0 +ORDER BY INSERT_DATETIME DESC +LIMIT ? OFFSET ?; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_count_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_count_all.sql new file mode 100644 index 000000000..ffe1baa44 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_count_all.sql @@ -0,0 +1,2 @@ +SELECT COUNT(*) FROM DRAFT_ITEM_VALUES +WHERE DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_draft_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_draft_id.sql new file mode 100644 index 000000000..d9f345938 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_draft_id.sql @@ -0,0 +1,4 @@ +SELECT * FROM DRAFT_ITEM_VALUES + WHERE +DRAFT_ID = ? + AND DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_item_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_item_no.sql new file mode 100644 index 000000000..cbde26580 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_item_no.sql @@ -0,0 +1,4 @@ +SELECT * FROM DRAFT_ITEM_VALUES + WHERE +ITEM_NO = ? + AND DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_key.sql new file mode 100644 index 000000000..c8eb67161 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_key.sql @@ -0,0 +1,6 @@ +SELECT * FROM DRAFT_ITEM_VALUES + WHERE +DRAFT_ID = ? + AND ITEM_NO = ? + AND TYPE_ID = ? + AND DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_type_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_type_id.sql new file mode 100644 index 000000000..39b65ca79 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_select_on_type_id.sql @@ -0,0 +1,4 @@ +SELECT * FROM DRAFT_ITEM_VALUES + WHERE +TYPE_ID = ? + AND DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_update.sql new file mode 100644 index 000000000..3a3e5a24c --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftItemValuesDao/DraftItemValuesDao_update.sql @@ -0,0 +1,14 @@ +UPDATE DRAFT_ITEM_VALUES +SET + ITEM_VALUE = ? + , ITEM_STATUS = ? + , INSERT_USER = ? + , INSERT_DATETIME = ? + , UPDATE_USER = ? + , UPDATE_DATETIME = ? + , DELETE_FLAG = ? +WHERE +DRAFT_ID = ? + AND ITEM_NO = ? + AND TYPE_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_delete.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_delete.sql new file mode 100644 index 000000000..bd450b8f4 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_delete.sql @@ -0,0 +1,4 @@ +DELETE FROM DRAFT_KNOWLEDGES +WHERE +DRAFT_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_insert.sql new file mode 100644 index 000000000..5806f8720 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_insert.sql @@ -0,0 +1,32 @@ +INSERT INTO DRAFT_KNOWLEDGES +( +DRAFT_ID + , KNOWLEDGE_ID + , TITLE + , CONTENT + , PUBLIC_FLAG + , ACCESSES + , EDITORS + , TAG_NAMES + , TYPE_ID + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +DEFAULT + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_all.sql new file mode 100644 index 000000000..da016fc70 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_all.sql @@ -0,0 +1,2 @@ +SELECT * FROM DRAFT_KNOWLEDGES +ORDER BY INSERT_DATETIME DESC; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_all_with_pager.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_all_with_pager.sql new file mode 100644 index 000000000..8a6a8e269 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_all_with_pager.sql @@ -0,0 +1,3 @@ +SELECT * FROM DRAFT_KNOWLEDGES +ORDER BY INSERT_DATETIME DESC +LIMIT ? OFFSET ?; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_on_key.sql new file mode 100644 index 000000000..8c76c3284 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_physical_select_on_key.sql @@ -0,0 +1,4 @@ +SELECT * FROM DRAFT_KNOWLEDGES + WHERE +DRAFT_ID = ? +; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_raw_insert.sql new file mode 100644 index 000000000..6ef7331df --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_raw_insert.sql @@ -0,0 +1,32 @@ +INSERT INTO DRAFT_KNOWLEDGES +( +DRAFT_ID + , KNOWLEDGE_ID + , TITLE + , CONTENT + , PUBLIC_FLAG + , ACCESSES + , EDITORS + , TAG_NAMES + , TYPE_ID + , INSERT_USER + , INSERT_DATETIME + , UPDATE_USER + , UPDATE_DATETIME + , DELETE_FLAG +) VALUES ( +? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? + , ? +); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_all.sql new file mode 100644 index 000000000..5a120a2e3 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_all.sql @@ -0,0 +1,3 @@ +SELECT * FROM DRAFT_KNOWLEDGES +WHERE DELETE_FLAG = 0 +ORDER BY INSERT_DATETIME DESC; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_all_with_pager.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_all_with_pager.sql new file mode 100644 index 000000000..bef5717f9 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_all_with_pager.sql @@ -0,0 +1,4 @@ +SELECT * FROM DRAFT_KNOWLEDGES +WHERE DELETE_FLAG = 0 +ORDER BY INSERT_DATETIME DESC +LIMIT ? OFFSET ?; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_count_all.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_count_all.sql new file mode 100644 index 000000000..344bcd3d6 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_count_all.sql @@ -0,0 +1,2 @@ +SELECT COUNT(*) FROM DRAFT_KNOWLEDGES +WHERE DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_on_key.sql new file mode 100644 index 000000000..67dfc8799 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_select_on_key.sql @@ -0,0 +1,4 @@ +SELECT * FROM DRAFT_KNOWLEDGES + WHERE +DRAFT_ID = ? + AND DELETE_FLAG = 0; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_update.sql new file mode 100644 index 000000000..864a2562a --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/dao/sql/DraftKnowledgesDao/DraftKnowledgesDao_update.sql @@ -0,0 +1,18 @@ +UPDATE DRAFT_KNOWLEDGES +SET + KNOWLEDGE_ID = ? + , TITLE = ? + , CONTENT = ? + , PUBLIC_FLAG = ? + , ACCESSES = ? + , EDITORS = ? + , TAG_NAMES = ? + , TYPE_ID = ? + , INSERT_USER = ? + , INSERT_DATETIME = ? + , UPDATE_USER = ? + , UPDATE_DATETIME = ? + , DELETE_FLAG = ? +WHERE +DRAFT_ID = ? +; 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 index c92dd8b81..d7ddb4a57 100644 --- 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 @@ -2,4 +2,3 @@ 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 index d878584c4..3f37204cd 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM ITEM_CHOICES WHERE ITEM_NO = ? ; -; 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 index d15fd3584..c727e430e 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM ITEM_CHOICES WHERE TYPE_ID = ? ; -; 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 index 3fe328741..28458b5df 100644 --- 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 @@ -2,4 +2,3 @@ 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 index 566aa3fbc..e0901ed4d 100644 --- 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 @@ -2,4 +2,3 @@ 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 index 80f7c3a3b..2eaefbd73 100644 --- 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 @@ -4,4 +4,3 @@ 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 index 151483d4c..6ffae3c8b 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM ITEM_CHOICES WHERE TYPE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_physical_select_on_group_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_physical_select_on_group_id.sql index 280ea63f4..233b390fb 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_physical_select_on_group_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_physical_select_on_group_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_EDIT_GROUPS WHERE GROUP_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_physical_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_physical_select_on_knowledge_id.sql index 7c3856ee3..707835392 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_physical_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_physical_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_EDIT_GROUPS WHERE KNOWLEDGE_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_group_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_group_id.sql index f74943871..6f6f04b08 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_group_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_group_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_EDIT_GROUPS WHERE GROUP_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_key.sql index efe6c80a7..331459650 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_key.sql @@ -3,4 +3,3 @@ SELECT * FROM KNOWLEDGE_EDIT_GROUPS GROUP_ID = ? AND KNOWLEDGE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_knowledge_id.sql index 918f89781..03b3cfa8f 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditGroupsDao/KnowledgeEditGroupsDao_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_EDIT_GROUPS WHERE KNOWLEDGE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_physical_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_physical_select_on_knowledge_id.sql index c7c65809c..ada138dab 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_physical_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_physical_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_EDIT_USERS WHERE KNOWLEDGE_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_physical_select_on_user_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_physical_select_on_user_id.sql index de2daa31e..0727d74a5 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_physical_select_on_user_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_physical_select_on_user_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_EDIT_USERS WHERE USER_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_key.sql index 8d7aa9bcf..65a77ea11 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_key.sql @@ -3,4 +3,3 @@ SELECT * FROM KNOWLEDGE_EDIT_USERS KNOWLEDGE_ID = ? AND USER_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_knowledge_id.sql index 12775097c..1829abe13 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_EDIT_USERS WHERE KNOWLEDGE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_user_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_user_id.sql index 7c917adf2..d3e54dc94 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_user_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeEditUsersDao/KnowledgeEditUsersDao_select_on_user_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_EDIT_USERS WHERE USER_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_insert.sql index 43d474d05..f541a4989 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_insert.sql @@ -3,6 +3,7 @@ INSERT INTO KNOWLEDGE_FILES FILE_NO , KNOWLEDGE_ID , COMMENT_NO + , DRAFT_ID , FILE_NAME , FILE_SIZE , FILE_BINARY @@ -25,4 +26,5 @@ DEFAULT , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_raw_insert.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_raw_insert.sql index 9140096a1..cad8ac626 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_raw_insert.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_raw_insert.sql @@ -3,6 +3,7 @@ INSERT INTO KNOWLEDGE_FILES FILE_NO , KNOWLEDGE_ID , COMMENT_NO + , DRAFT_ID , FILE_NAME , FILE_SIZE , FILE_BINARY @@ -25,4 +26,5 @@ FILE_NO , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_select_on_key.sql index c91efe11b..72eb4e0fc 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_FILES WHERE FILE_NO = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_update.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_update.sql index f71f59174..816cd2c55 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_update.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeFilesDao/KnowledgeFilesDao_update.sql @@ -2,6 +2,7 @@ UPDATE KNOWLEDGE_FILES SET KNOWLEDGE_ID = ? , COMMENT_NO = ? + , DRAFT_ID = ? , FILE_NAME = ? , FILE_SIZE = ? , FILE_BINARY = ? diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_physical_select_on_group_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_physical_select_on_group_id.sql index 5a849db1f..17d8922c7 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_physical_select_on_group_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_physical_select_on_group_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_GROUPS WHERE GROUP_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_physical_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_physical_select_on_knowledge_id.sql index 0715dfab1..4755c00fc 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_physical_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_physical_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_GROUPS WHERE KNOWLEDGE_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_group_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_group_id.sql index 8e51cf106..f3044c65b 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_group_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_group_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_GROUPS WHERE GROUP_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_key.sql index 1fe71e892..a9075e20c 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_key.sql @@ -3,4 +3,3 @@ SELECT * FROM KNOWLEDGE_GROUPS GROUP_ID = ? AND KNOWLEDGE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_knowledge_id.sql index 987b036df..6fede0b3b 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeGroupsDao/KnowledgeGroupsDao_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_GROUPS WHERE KNOWLEDGE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_physical_select_on_history_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_physical_select_on_history_no.sql index 67e6b3181..50e413b2e 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_physical_select_on_history_no.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_physical_select_on_history_no.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_HISTORIES WHERE HISTORY_NO = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_physical_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_physical_select_on_knowledge_id.sql index f40da0386..ca4e9282e 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_physical_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_physical_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_HISTORIES WHERE KNOWLEDGE_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_history_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_history_no.sql index c9c0b17c4..2d773c54b 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_history_no.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_history_no.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_HISTORIES WHERE HISTORY_NO = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_key.sql index d9bfe2fa8..f5fe2a431 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_key.sql @@ -3,4 +3,3 @@ SELECT * FROM KNOWLEDGE_HISTORIES HISTORY_NO = ? AND KNOWLEDGE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_knowledge_id.sql index 7a80ca2a9..e9b362e8d 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_HISTORIES WHERE KNOWLEDGE_ID = ? AND DELETE_FLAG = 0; -; 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 index 29be1b53e..9343b83f2 100644 --- 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 @@ -2,4 +2,3 @@ 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_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeItemValuesDao/KnowledgeItemValuesDao_physical_select_on_knowledge_id.sql index 9ab34ce5e..269cd82a5 100644 --- 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 @@ -2,4 +2,3 @@ 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 index 816bc6df1..9dde583ff 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_ITEM_VALUES WHERE TYPE_ID = ? ; -; 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 index aefd30039..b25728ba1 100644 --- 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 @@ -2,4 +2,3 @@ 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 index 77d850a1c..376b52275 100644 --- 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 @@ -4,4 +4,3 @@ 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 index ae67699e4..898c398a3 100644 --- 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 @@ -2,4 +2,3 @@ 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 index d838bfcdb..fa0a38bfa 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_ITEM_VALUES WHERE TYPE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_physical_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_physical_select_on_knowledge_id.sql index 4d8257f89..25b2e5d2f 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_physical_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_physical_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_TAGS WHERE KNOWLEDGE_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_physical_select_on_tag_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_physical_select_on_tag_id.sql index 142325713..1da881d45 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_physical_select_on_tag_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_physical_select_on_tag_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_TAGS WHERE TAG_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_key.sql index cc9a19bf6..48cefdd8f 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_key.sql @@ -3,4 +3,3 @@ SELECT * FROM KNOWLEDGE_TAGS KNOWLEDGE_ID = ? AND TAG_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_knowledge_id.sql index c45d54367..b8650d137 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_TAGS WHERE KNOWLEDGE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_tag_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_tag_id.sql index 4aec23c4a..25627326b 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_tag_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeTagsDao/KnowledgeTagsDao_select_on_tag_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_TAGS WHERE TAG_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_physical_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_physical_select_on_knowledge_id.sql index 1adf3514b..889988d4b 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_physical_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_physical_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_USERS WHERE KNOWLEDGE_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_physical_select_on_user_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_physical_select_on_user_id.sql index df7bb24c6..a44bb46ad 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_physical_select_on_user_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_physical_select_on_user_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_USERS WHERE USER_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_key.sql index 4c1d5d9ac..dc8888d20 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_key.sql @@ -3,4 +3,3 @@ SELECT * FROM KNOWLEDGE_USERS KNOWLEDGE_ID = ? AND USER_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_knowledge_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_knowledge_id.sql index 4b0237bbb..568f23644 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_knowledge_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_knowledge_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_USERS WHERE KNOWLEDGE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_user_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_user_id.sql index 3ad80e093..4287397d8 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_user_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgeUsersDao/KnowledgeUsersDao_select_on_user_id.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGE_USERS WHERE USER_ID = ? AND DELETE_FLAG = 0; -; 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 ab3a5a9f4..b6d05f0b4 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 @@ -9,6 +9,7 @@ KNOWLEDGE_ID , LIKE_COUNT , COMMENT_COUNT , TYPE_ID + , NOTIFY_STATUS , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -29,4 +30,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 0ab555637..ad7d0565e 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 @@ -9,6 +9,7 @@ KNOWLEDGE_ID , LIKE_COUNT , COMMENT_COUNT , TYPE_ID + , NOTIFY_STATUS , INSERT_USER , INSERT_DATETIME , UPDATE_USER @@ -29,4 +30,5 @@ KNOWLEDGE_ID , ? , ? , ? + , ? ); diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_select_on_key.sql index f69871fde..2b8117507 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/KnowledgesDao/KnowledgesDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM KNOWLEDGES WHERE KNOWLEDGE_ID = ? AND DELETE_FLAG = 0; -; 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 902e468c2..e9e7eac9a 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 @@ -8,6 +8,7 @@ SET , LIKE_COUNT = ? , COMMENT_COUNT = ? , TYPE_ID = ? + , NOTIFY_STATUS = ? , INSERT_USER = ? , INSERT_DATETIME = ? , UPDATE_USER = ? diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/LikesDao/LikesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/LikesDao/LikesDao_select_on_key.sql index 4fbe99efc..070c8d79f 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/LikesDao/LikesDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/LikesDao/LikesDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM LIKES WHERE NO = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_physical_select_on_condition_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_physical_select_on_condition_no.sql index e087b88f3..fb879054d 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_physical_select_on_condition_no.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_physical_select_on_condition_no.sql @@ -2,4 +2,3 @@ SELECT * FROM MAIL_HOOK_CONDITIONS WHERE CONDITION_NO = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_physical_select_on_hook_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_physical_select_on_hook_id.sql index 238981daa..2e576630a 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_physical_select_on_hook_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_physical_select_on_hook_id.sql @@ -2,4 +2,3 @@ SELECT * FROM MAIL_HOOK_CONDITIONS WHERE HOOK_ID = ? ; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_condition_no.sql b/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_condition_no.sql index f9cc9778a..ee3752c33 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_condition_no.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_condition_no.sql @@ -2,4 +2,3 @@ SELECT * FROM MAIL_HOOK_CONDITIONS WHERE CONDITION_NO = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_hook_id.sql b/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_hook_id.sql index ade3d1c95..0833161d6 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_hook_id.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_hook_id.sql @@ -2,4 +2,3 @@ SELECT * FROM MAIL_HOOK_CONDITIONS WHERE HOOK_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_key.sql index 56f7350b4..a224eb795 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/MailHookConditionsDao/MailHookConditionsDao_select_on_key.sql @@ -3,4 +3,3 @@ SELECT * FROM MAIL_HOOK_CONDITIONS CONDITION_NO = ? AND HOOK_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/MailHooksDao/MailHooksDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/MailHooksDao/MailHooksDao_select_on_key.sql index 10ea18d8f..e55e0b29c 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/MailHooksDao/MailHooksDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/MailHooksDao/MailHooksDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM MAIL_HOOKS WHERE HOOK_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/MailPostsDao/MailPostsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/MailPostsDao/MailPostsDao_select_on_key.sql index 43b6d4818..010017db4 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/MailPostsDao/MailPostsDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/MailPostsDao/MailPostsDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM MAIL_POSTS WHERE MESSAGE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/NotifyConfigsDao/NotifyConfigsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/NotifyConfigsDao/NotifyConfigsDao_select_on_key.sql index c45575ff9..c4da74bcd 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/NotifyConfigsDao/NotifyConfigsDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/NotifyConfigsDao/NotifyConfigsDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM NOTIFY_CONFIGS WHERE USER_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/NotifyQueuesDao/NotifyQueuesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/NotifyQueuesDao/NotifyQueuesDao_select_on_key.sql index 049d26837..7190e10e0 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/NotifyQueuesDao/NotifyQueuesDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/NotifyQueuesDao/NotifyQueuesDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM NOTIFY_QUEUES WHERE HASH = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/PinsDao/PinsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/PinsDao/PinsDao_select_on_key.sql index c3652e94b..47d84d402 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/PinsDao/PinsDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/PinsDao/PinsDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM PINS WHERE NO = ? AND DELETE_FLAG = 0; -; 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 index ecd7f49e4..7169ca3be 100644 --- 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 @@ -2,4 +2,3 @@ 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 index 50401cbaf..958613148 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM STOCK_KNOWLEDGES WHERE STOCK_ID = ? ; -; 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 index 812ee23a7..f1298be81 100644 --- 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 @@ -3,4 +3,3 @@ SELECT * FROM STOCK_KNOWLEDGES 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 index e1537bbab..163e205cb 100644 --- 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 @@ -2,4 +2,3 @@ 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 index 02340081f..e5c909e23 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM STOCK_KNOWLEDGES WHERE STOCK_ID = ? AND DELETE_FLAG = 0; -; 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 0b7644e43..af4a64ef6 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 @@ -2,4 +2,3 @@ SELECT * FROM STOCKS WHERE STOCK_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/TagsDao/TagsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/TagsDao/TagsDao_select_on_key.sql index 846219ac1..73752c188 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/TagsDao/TagsDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/TagsDao/TagsDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM TAGS WHERE TAG_ID = ? AND DELETE_FLAG = 0; -; 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 index 270e28109..36f439533 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM TEMPLATE_ITEMS WHERE ITEM_NO = ? ; -; 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 index 00dad3849..aa3b3a9c9 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM TEMPLATE_ITEMS WHERE TYPE_ID = ? ; -; 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 index 325e89f84..4b8bab622 100644 --- 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 @@ -2,4 +2,3 @@ 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 index fd85d2d3a..96eee4aa7 100644 --- 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 @@ -3,4 +3,3 @@ SELECT * FROM TEMPLATE_ITEMS 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 index 88f2b5afc..6ce1fec30 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM TEMPLATE_ITEMS WHERE TYPE_ID = ? AND 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 index da512f65a..a9dd83ece 100644 --- 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 @@ -2,4 +2,3 @@ SELECT * FROM TEMPLATE_MASTERS WHERE TYPE_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/ViewHistoriesDao/ViewHistoriesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/ViewHistoriesDao/ViewHistoriesDao_select_on_key.sql index a3c614705..b23be176a 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/ViewHistoriesDao/ViewHistoriesDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/ViewHistoriesDao/ViewHistoriesDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM VIEW_HISTORIES WHERE HISTORY_NO = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/VotesDao/VotesDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/VotesDao/VotesDao_select_on_key.sql index 87514a848..582c4e1d4 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/VotesDao/VotesDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/VotesDao/VotesDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM VOTES WHERE VOTE_NO = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/WebhookConfigsDao/WebhookConfigsDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/WebhookConfigsDao/WebhookConfigsDao_select_on_key.sql index d932293df..01d834f96 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/WebhookConfigsDao/WebhookConfigsDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/WebhookConfigsDao/WebhookConfigsDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM WEBHOOK_CONFIGS WHERE HOOK_ID = ? AND DELETE_FLAG = 0; -; diff --git a/src/main/resources/org/support/project/knowledge/dao/sql/WebhooksDao/WebhooksDao_select_on_key.sql b/src/main/resources/org/support/project/knowledge/dao/sql/WebhooksDao/WebhooksDao_select_on_key.sql index a43cc21dd..4215632ed 100644 --- a/src/main/resources/org/support/project/knowledge/dao/sql/WebhooksDao/WebhooksDao_select_on_key.sql +++ b/src/main/resources/org/support/project/knowledge/dao/sql/WebhooksDao/WebhooksDao_select_on_key.sql @@ -2,4 +2,3 @@ SELECT * FROM WEBHOOKS WHERE WEBHOOK_ID = ? AND DELETE_FLAG = 0; -; 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 d15312007..2c9e5336b 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,93 @@ +-- ピン +drop table if exists PINS cascade; + +create table PINS ( + NO serial not null + , KNOWLEDGE_ID bigint not null + , ROW_ID character varying(64) + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint PINS_PKC primary key (NO) +) ; + +create index IDX_PINS_INSERT_USER + on PINS(INSERT_USER); + +-- Webhooks +drop table if exists WEBHOOKS cascade; + +create table WEBHOOKS ( + WEBHOOK_ID character varying(64) not null + , STATUS integer not null + , HOOK character varying(20) + , CONTENT text + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint WEBHOOKS_PKC primary key (WEBHOOK_ID) +) ; + +create index IDX_WEBHOOKS_STATUS + on WEBHOOKS(STATUS); + +-- Webhook 設定 +drop table if exists WEBHOOK_CONFIGS cascade; + +create table WEBHOOK_CONFIGS ( + HOOK_ID serial not null + , HOOK character varying(20) not null + , URL character varying(256) not null + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint WEBHOOK_CONFIGS_PKC primary key (HOOK_ID) +) ; + +-- ナレッジの項目値 +drop table if exists DRAFT_ITEM_VALUES cascade; + +create table DRAFT_ITEM_VALUES ( + DRAFT_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 DRAFT_ITEM_VALUES_PKC primary key (DRAFT_ID,TYPE_ID,ITEM_NO) +) ; + +-- ナレッジの下書き +drop table if exists DRAFT_KNOWLEDGES cascade; + +create table DRAFT_KNOWLEDGES ( + DRAFT_ID BIGSERIAL not null + , KNOWLEDGE_ID bigint + , TITLE character varying(1024) not null + , CONTENT text + , PUBLIC_FLAG integer + , ACCESSES text + , EDITORS text + , TAG_NAMES text + , TYPE_ID integer + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint DRAFT_KNOWLEDGES_PKC primary key (DRAFT_ID) +) ; + -- メールから投稿 drop table if exists MAIL_POSTS cascade; @@ -400,6 +490,7 @@ create table KNOWLEDGE_FILES ( FILE_NO BIGSERIAL not null , KNOWLEDGE_ID bigint , COMMENT_NO bigint + , DRAFT_ID bigint , FILE_NAME character varying(256) , FILE_SIZE double precision , FILE_BINARY BYTEA @@ -428,6 +519,7 @@ create table KNOWLEDGES ( , LIKE_COUNT bigint , COMMENT_COUNT integer , TYPE_ID integer + , NOTIFY_STATUS integer , INSERT_USER integer , INSERT_DATETIME timestamp , UPDATE_USER integer @@ -436,57 +528,64 @@ create table KNOWLEDGES ( , constraint KNOWLEDGES_PKC primary key (KNOWLEDGE_ID) ) ; --- Webhook 設定 -drop table if exists WEBHOOK_CONFIGS cascade; - -create table WEBHOOK_CONFIGS ( - HOOK_ID serial not null - , HOOK character varying(20) not null - , URL character varying(256) not null - , INSERT_USER integer - , INSERT_DATETIME timestamp - , UPDATE_USER integer - , UPDATE_DATETIME timestamp - , DELETE_FLAG integer - , constraint WEBHOOK_CONFIGS_PKC primary key (HOOK_ID) -) ; - --- Webhooks -drop table if exists WEBHOOKS cascade; - -create table WEBHOOKS ( - WEBHOOK_ID character varying(64) not null - , STATUS integer not null - , HOOK character varying(20) - , CONTENT text - , INSERT_USER integer - , INSERT_DATETIME timestamp - , UPDATE_USER integer - , UPDATE_DATETIME timestamp - , DELETE_FLAG integer - , constraint WEBHOOKS_PKC primary key (WEBHOOK_ID) -) ; - -create index IDX_WEBHOOKS_STATUS - on WEBHOOKS(STATUS); +comment on table PINS is 'ピン'; +comment on column PINS.NO is 'NO'; +comment on column PINS.KNOWLEDGE_ID is 'ナレッジID'; +comment on column PINS.ROW_ID is '行ID'; +comment on column PINS.INSERT_USER is '登録ユーザ'; +comment on column PINS.INSERT_DATETIME is '登録日時'; +comment on column PINS.UPDATE_USER is '更新ユーザ'; +comment on column PINS.UPDATE_DATETIME is '更新日時'; +comment on column PINS.DELETE_FLAG is '削除フラグ'; --- ピン -drop table if exists PINS cascade; +comment on table WEBHOOKS is 'Webhooks'; +comment on column WEBHOOKS.WEBHOOK_ID is 'WEBHOOK ID'; +comment on column WEBHOOKS.STATUS is 'ステータス'; +comment on column WEBHOOKS.HOOK is 'HOOK'; +comment on column WEBHOOKS.CONTENT is '通知用json文字列'; +comment on column WEBHOOKS.INSERT_USER is '登録ユーザ'; +comment on column WEBHOOKS.INSERT_DATETIME is '登録日時'; +comment on column WEBHOOKS.UPDATE_USER is '更新ユーザ'; +comment on column WEBHOOKS.UPDATE_DATETIME is '更新日時'; +comment on column WEBHOOKS.DELETE_FLAG is '削除フラグ'; -create table PINS ( - NO SERIAL not null - , KNOWLEDGE_ID bigint not null - , ROW_ID character varying(64) - , INSERT_USER integer - , INSERT_DATETIME timestamp - , UPDATE_USER integer - , UPDATE_DATETIME timestamp - , DELETE_FLAG integer - , constraint PINS_PKC primary key (NO) -) ; +comment on table WEBHOOK_CONFIGS is 'Webhook 設定'; +comment on column WEBHOOK_CONFIGS.HOOK_ID is 'HOOK ID'; +comment on column WEBHOOK_CONFIGS.HOOK is 'HOOK'; +comment on column WEBHOOK_CONFIGS.URL is 'URL'; +comment on column WEBHOOK_CONFIGS.INSERT_USER is '登録ユーザ'; +comment on column WEBHOOK_CONFIGS.INSERT_DATETIME is '登録日時'; +comment on column WEBHOOK_CONFIGS.UPDATE_USER is '更新ユーザ'; +comment on column WEBHOOK_CONFIGS.UPDATE_DATETIME is '更新日時'; +comment on column WEBHOOK_CONFIGS.DELETE_FLAG is '削除フラグ'; -create index insert_user - on PINS (INSERT_USER) ; +comment on table DRAFT_ITEM_VALUES is 'ナレッジの項目値'; +comment on column DRAFT_ITEM_VALUES.DRAFT_ID is '下書きID'; +comment on column DRAFT_ITEM_VALUES.TYPE_ID is 'テンプレートの種類ID'; +comment on column DRAFT_ITEM_VALUES.ITEM_NO is '項目NO'; +comment on column DRAFT_ITEM_VALUES.ITEM_VALUE is '項目値'; +comment on column DRAFT_ITEM_VALUES.ITEM_STATUS is 'ステータス'; +comment on column DRAFT_ITEM_VALUES.INSERT_USER is '登録ユーザ'; +comment on column DRAFT_ITEM_VALUES.INSERT_DATETIME is '登録日時'; +comment on column DRAFT_ITEM_VALUES.UPDATE_USER is '更新ユーザ'; +comment on column DRAFT_ITEM_VALUES.UPDATE_DATETIME is '更新日時'; +comment on column DRAFT_ITEM_VALUES.DELETE_FLAG is '削除フラグ'; + +comment on table DRAFT_KNOWLEDGES is 'ナレッジの下書き'; +comment on column DRAFT_KNOWLEDGES.DRAFT_ID is '下書きID'; +comment on column DRAFT_KNOWLEDGES.KNOWLEDGE_ID is 'ナレッジID'; +comment on column DRAFT_KNOWLEDGES.TITLE is 'タイトル'; +comment on column DRAFT_KNOWLEDGES.CONTENT is '内容'; +comment on column DRAFT_KNOWLEDGES.PUBLIC_FLAG is '公開区分'; +comment on column DRAFT_KNOWLEDGES.ACCESSES is '公開対象'; +comment on column DRAFT_KNOWLEDGES.EDITORS is '共同編集対象'; +comment on column DRAFT_KNOWLEDGES.TAG_NAMES is 'タグ名称一覧'; +comment on column DRAFT_KNOWLEDGES.TYPE_ID is 'テンプレートの種類ID'; +comment on column DRAFT_KNOWLEDGES.INSERT_USER is '登録ユーザ'; +comment on column DRAFT_KNOWLEDGES.INSERT_DATETIME is '登録日時'; +comment on column DRAFT_KNOWLEDGES.UPDATE_USER is '更新ユーザ'; +comment on column DRAFT_KNOWLEDGES.UPDATE_DATETIME is '更新日時'; +comment on column DRAFT_KNOWLEDGES.DELETE_FLAG is '削除フラグ'; comment on table MAIL_POSTS is 'メールから投稿'; comment on column MAIL_POSTS.MESSAGE_ID is 'Message-ID'; @@ -757,6 +856,7 @@ comment on table KNOWLEDGE_FILES is '添付ファイル'; comment on column KNOWLEDGE_FILES.FILE_NO is '添付ファイル番号'; comment on column KNOWLEDGE_FILES.KNOWLEDGE_ID is 'ナレッジID'; comment on column KNOWLEDGE_FILES.COMMENT_NO is 'コメント番号'; +comment on column KNOWLEDGE_FILES.DRAFT_ID is '下書きID'; comment on column KNOWLEDGE_FILES.FILE_NAME is 'ファイル名'; comment on column KNOWLEDGE_FILES.FILE_SIZE is 'ファイルサイズ'; comment on column KNOWLEDGE_FILES.FILE_BINARY is 'バイナリ'; @@ -777,37 +877,9 @@ 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.NOTIFY_STATUS is '通知ステータス'; comment on column KNOWLEDGES.INSERT_USER is '登録ユーザ'; comment on column KNOWLEDGES.INSERT_DATETIME is '登録日時'; comment on column KNOWLEDGES.UPDATE_USER is '更新ユーザ'; comment on column KNOWLEDGES.UPDATE_DATETIME is '更新日時'; comment on column KNOWLEDGES.DELETE_FLAG is '削除フラグ'; - -comment on table WEBHOOK_CONFIGS is 'Webhooks 設定'; -comment on column WEBHOOK_CONFIGS.HOOK_ID is 'HOOK ID'; -comment on column WEBHOOK_CONFIGS.HOOK is 'HOOK'; -comment on column WEBHOOK_CONFIGS.URL is 'URL'; -comment on column WEBHOOK_CONFIGS.INSERT_USER is '登録ユーザ'; -comment on column WEBHOOK_CONFIGS.INSERT_DATETIME is '登録日時'; -comment on column WEBHOOK_CONFIGS.DELETE_FLAG is '削除フラグ'; - -comment on table WEBHOOKS is 'Webhooks'; -comment on column WEBHOOKS.WEBHOOK_ID is 'WEBHOOK ID'; -comment on column WEBHOOKS.STATUS is 'ステータス'; -comment on column WEBHOOKS.HOOK is 'HOOK'; -comment on column WEBHOOKS.CONTENT is '通知用json文字列'; -comment on column WEBHOOKS.INSERT_USER is '登録ユーザ'; -comment on column WEBHOOKS.INSERT_DATETIME is '登録日時'; -comment on column WEBHOOKS.UPDATE_USER is '更新ユーザ'; -comment on column WEBHOOKS.UPDATE_DATETIME is '更新日時'; -comment on column WEBHOOKS.DELETE_FLAG is '削除フラグ'; - -comment on table PINS is 'ピン'; -comment on column PINS.NO is 'NO'; -comment on column PINS.KNOWLEDGE_ID is 'ナレッジID'; -comment on column PINS.ROW_ID is '行ID'; -comment on column PINS.INSERT_USER is '登録ユーザ'; -comment on column PINS.INSERT_DATETIME is '登録日時'; -comment on column PINS.UPDATE_USER is '更新ユーザ'; -comment on column PINS.UPDATE_DATETIME is '更新日時'; -comment on column PINS.DELETE_FLAG is '削除フラグ'; \ No newline at end of file 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 47b41a425..a5d18a62c 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 @@ -10,7 +10,7 @@ VALUES 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); +(-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 diff --git a/src/main/resources/org/support/project/knowledge/deploy/v1_7_0/migrate.sql b/src/main/resources/org/support/project/knowledge/deploy/v1_7_0/migrate.sql new file mode 100644 index 000000000..abe925fb1 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/deploy/v1_7_0/migrate.sql @@ -0,0 +1,82 @@ +ALTER TABLE KNOWLEDGES DROP COLUMN IF EXISTS NOTIFY_STATUS; +ALTER TABLE KNOWLEDGES ADD COLUMN NOTIFY_STATUS integer; +comment on column KNOWLEDGES.NOTIFY_STATUS is '通知ステータス'; + + +ALTER TABLE KNOWLEDGE_FILES DROP COLUMN IF EXISTS DRAFT_ID; +ALTER TABLE KNOWLEDGE_FILES ADD COLUMN DRAFT_ID bigint; +comment on column KNOWLEDGE_FILES.DRAFT_ID is '下書きID'; + + +-- ナレッジの項目値 +drop table if exists DRAFT_ITEM_VALUES cascade; + +create table DRAFT_ITEM_VALUES ( + DRAFT_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 DRAFT_ITEM_VALUES_PKC primary key (DRAFT_ID,TYPE_ID,ITEM_NO) +) ; + +-- ナレッジの下書き +drop table if exists DRAFT_KNOWLEDGES cascade; + +create table DRAFT_KNOWLEDGES ( + DRAFT_ID BIGSERIAL not null + , KNOWLEDGE_ID bigint + , TITLE character varying(1024) not null + , CONTENT text + , PUBLIC_FLAG integer + , ACCESSES text + , EDITORS text + , TAG_NAMES text + , TYPE_ID integer + , INSERT_USER integer + , INSERT_DATETIME timestamp + , UPDATE_USER integer + , UPDATE_DATETIME timestamp + , DELETE_FLAG integer + , constraint DRAFT_KNOWLEDGES_PKC primary key (DRAFT_ID) +) ; + +comment on table DRAFT_ITEM_VALUES is 'ナレッジの項目値'; +comment on column DRAFT_ITEM_VALUES.DRAFT_ID is '下書きID'; +comment on column DRAFT_ITEM_VALUES.TYPE_ID is 'テンプレートの種類ID'; +comment on column DRAFT_ITEM_VALUES.ITEM_NO is '項目NO'; +comment on column DRAFT_ITEM_VALUES.ITEM_VALUE is '項目値'; +comment on column DRAFT_ITEM_VALUES.ITEM_STATUS is 'ステータス'; +comment on column DRAFT_ITEM_VALUES.INSERT_USER is '登録ユーザ'; +comment on column DRAFT_ITEM_VALUES.INSERT_DATETIME is '登録日時'; +comment on column DRAFT_ITEM_VALUES.UPDATE_USER is '更新ユーザ'; +comment on column DRAFT_ITEM_VALUES.UPDATE_DATETIME is '更新日時'; +comment on column DRAFT_ITEM_VALUES.DELETE_FLAG is '削除フラグ'; + +comment on table DRAFT_KNOWLEDGES is 'ナレッジの下書き'; +comment on column DRAFT_KNOWLEDGES.DRAFT_ID is '下書きID'; +comment on column DRAFT_KNOWLEDGES.KNOWLEDGE_ID is 'ナレッジID'; +comment on column DRAFT_KNOWLEDGES.TITLE is 'タイトル'; +comment on column DRAFT_KNOWLEDGES.CONTENT is '内容'; +comment on column DRAFT_KNOWLEDGES.PUBLIC_FLAG is '公開区分'; +comment on column DRAFT_KNOWLEDGES.ACCESSES is '公開対象'; +comment on column DRAFT_KNOWLEDGES.EDITORS is '共同編集対象'; +comment on column DRAFT_KNOWLEDGES.TAG_NAMES is 'タグ名称一覧'; +comment on column DRAFT_KNOWLEDGES.TYPE_ID is 'テンプレートの種類ID'; +comment on column DRAFT_KNOWLEDGES.INSERT_USER is '登録ユーザ'; +comment on column DRAFT_KNOWLEDGES.INSERT_DATETIME is '登録日時'; +comment on column DRAFT_KNOWLEDGES.UPDATE_USER is '更新ユーザ'; +comment on column DRAFT_KNOWLEDGES.UPDATE_DATETIME is '更新日時'; +comment on column DRAFT_KNOWLEDGES.DELETE_FLAG is '削除フラグ'; + + + + + + + diff --git a/src/main/resources/org/support/project/knowledge/deploy/v1_7_0_1/migrate.sql b/src/main/resources/org/support/project/knowledge/deploy/v1_7_0_1/migrate.sql new file mode 100644 index 000000000..4f710f9c3 --- /dev/null +++ b/src/main/resources/org/support/project/knowledge/deploy/v1_7_0_1/migrate.sql @@ -0,0 +1,3 @@ +UPDATE KNOWLEDGES SET NOTIFY_STATUS = 1 WHERE PUBLIC_FLAG = 0 OR PUBLIC_FLAG = 2; + + diff --git a/src/main/webapp/WEB-INF/views/admin/config/system.jsp b/src/main/webapp/WEB-INF/views/admin/config/system.jsp index cd104d2d9..e4d03d1d9 100644 --- a/src/main/webapp/WEB-INF/views/admin/config/system.jsp +++ b/src/main/webapp/WEB-INF/views/admin/config/system.jsp @@ -1,8 +1,9 @@ -<%@page import="org.support.project.knowledge.config.SystemConfig"%> +<%@page pageEncoding="UTF-8" isELIgnored="false" session="false" errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> <%@page import="org.support.project.common.config.INT_FLAG"%> -<%@page import="org.support.project.knowledge.vo.Roles"%> +<%@page import="org.support.project.web.logic.HttpRequestCheckLogic"%> <%@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"%> +<%@page import="org.support.project.knowledge.config.SystemConfig"%> +<%@page import="org.support.project.knowledge.vo.Roles"%> <%@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"%> @@ -14,7 +15,7 @@ @@ -28,28 +29,30 @@

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

-
- - " /> -
- - -
-
- -
- -
- - + +
+ + " /> +
+ + +
+
+ +
+ +
+ +
diff --git a/src/main/webapp/WEB-INF/views/admin/database/connection.jsp b/src/main/webapp/WEB-INF/views/admin/database/connection.jsp index bac7fdfcb..b9168ae8f 100644 --- a/src/main/webapp/WEB-INF/views/admin/database/connection.jsp +++ b/src/main/webapp/WEB-INF/views/admin/database/connection.jsp @@ -44,6 +44,7 @@ console.log(result); if (result.message.lastIndexOf('Processing has been completed', 0) === 0) { $.notify(result.message, 'info'); + $("#transfer_msg").alert('close'); } }; webSocket.onerror = function(message) { @@ -113,11 +114,16 @@
+ +
diff --git a/src/main/webapp/WEB-INF/views/admin/database/index.jsp b/src/main/webapp/WEB-INF/views/admin/database/index.jsp index c8bbf6716..a00a379d4 100644 --- a/src/main/webapp/WEB-INF/views/admin/database/index.jsp +++ b/src/main/webapp/WEB-INF/views/admin/database/index.jsp @@ -14,14 +14,19 @@ - + + + - + + + + @@ -63,12 +68,12 @@ $("#input-id").fileinput(); <% if (jspUtil.is(Boolean.TRUE, "active")) { %> <%= jspUtil.label("knowledge.data.label.active.status.active") %> -  <%= jspUtil.label("knowledge.data.label.active.status.to.stop") %> +  <%= jspUtil.label("knowledge.data.label.active.status.to.stop") %> <% } else { %> <%= jspUtil.label("knowledge.data.label.active.status.stop") %> -  <%= jspUtil.label("knowledge.data.label.active.status.to.active") %> +  <%= jspUtil.label("knowledge.data.label.active.status.to.active") %> <% } %> @@ -82,7 +87,7 @@ $("#input-id").fileinput(); <%= jspUtil.label("knowledge.data.label.backup.msg") %>
-  <%= jspUtil.label("label.backup") %> +  <%= jspUtil.label("label.backup") %> @@ -97,10 +102,10 @@ $("#input-id").fileinput(); -
- -
- +
+ +
+ diff --git a/src/main/webapp/WEB-INF/views/admin/mailhook/hook.jsp b/src/main/webapp/WEB-INF/views/admin/mailhook/hook.jsp index c994562a6..ac46bb979 100644 --- a/src/main/webapp/WEB-INF/views/admin/mailhook/hook.jsp +++ b/src/main/webapp/WEB-INF/views/admin/mailhook/hook.jsp @@ -13,13 +13,17 @@ - + + + - - - + + + + + - - - - - - + + + + + + + + + @@ -41,9 +45,9 @@ @@ -51,9 +55,9 @@ diff --git a/src/main/webapp/WEB-INF/views/admin/proxy/config.jsp b/src/main/webapp/WEB-INF/views/admin/proxy/config.jsp index 44ad0a089..7a30c8f82 100644 --- a/src/main/webapp/WEB-INF/views/admin/proxy/config.jsp +++ b/src/main/webapp/WEB-INF/views/admin/proxy/config.jsp @@ -16,15 +16,15 @@ @@ -32,12 +32,12 @@ @@ -48,85 +48,84 @@ function deleteConfig() {

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

-
- - " /> -
-
- - " /> -
-
-
- - - -
-
- - " /> -
-
- - " /> -
-
- - " /> -
-
- - " /> -
- - -
-
- - -
- - -
- - " /> -
- - " /> - - - - - - +
+ + " /> +
+
+ + " /> +
+
+
+ + + +
+
+ + " /> +
+
+ + " /> +
+
+ + " /> +
+
+ + " /> +
+ + +
+
+ + +
+ +
+ + " /> +
+ + " /> + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/admin/template/view_add.jsp b/src/main/webapp/WEB-INF/views/admin/template/view_add.jsp index 7fbd36356..31aecd8e1 100644 --- a/src/main/webapp/WEB-INF/views/admin/template/view_add.jsp +++ b/src/main/webapp/WEB-INF/views/admin/template/view_add.jsp @@ -10,11 +10,15 @@ -" /> + + + - + + + + + + @@ -47,120 +51,120 @@ function deleteUser() {

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

- - - - + + + + -
- - " /> -
-
- - " /> -
-
- - -
- -
<%= jspUtil.label("knowledge.template.label.item") %>
- <% if(jspUtil.is(Boolean.TRUE, "editable")) { %> - - <% } %> -
- -
" class="add_item"> -
- <% if (jspUtil.is(String.valueOf(TemplateLogic.ITEM_TYPE_TEXT), "item.itemType")) { %> -  <%= jspUtil.label("knowledge.template.label.item.text") %> - - <% } else if (jspUtil.is(String.valueOf(TemplateLogic.ITEM_TYPE_RADIO), "item.itemType")) { %> -  <%= jspUtil.label("knowledge.template.label.item.radio") %> -   - -   - - <% } else if (jspUtil.is(String.valueOf(TemplateLogic.ITEM_TYPE_CHECKBOX), "item.itemType")) { %> -  <%= jspUtil.label("knowledge.template.label.item.checkbox") %> -   - -   - - <% } %> - - _item<%= jspUtil.out("item.itemNo") %>"/> -
-
- - " id="title_item<%= jspUtil.out("item.itemNo") %>" - value="<%= jspUtil.out("item.itemName") %>" /> -
-
- - " id="description_item<%= jspUtil.out("item.itemNo") %>" - value="<%= jspUtil.out("item.description") %>" /> -
- - <% if ( - jspUtil.is(String.valueOf(TemplateLogic.ITEM_TYPE_RADIO), "item.itemType") - || jspUtil.is(String.valueOf(TemplateLogic.ITEM_TYPE_CHECKBOX), "item.itemType") - ) { %> -
" class="choice_item_list"> +
+ + " /> +
+
+ + " /> +
+
+ + +
+ +
<%= jspUtil.label("knowledge.template.label.item") %>
+ <% if(jspUtil.is(Boolean.TRUE, "editable")) { %> + + <% } %> +
+ +
" class="add_item"> +
+ <% if (jspUtil.is(String.valueOf(TemplateLogic.ITEM_TYPE_TEXT), "item.itemType")) { %> +  <%= jspUtil.label("knowledge.template.label.item.text") %> + + <% } else if (jspUtil.is(String.valueOf(TemplateLogic.ITEM_TYPE_RADIO), "item.itemType")) { %> +  <%= jspUtil.label("knowledge.template.label.item.radio") %> +   + +   + + <% } else if (jspUtil.is(String.valueOf(TemplateLogic.ITEM_TYPE_CHECKBOX), "item.itemType")) { %> +  <%= jspUtil.label("knowledge.template.label.item.checkbox") %> +   + +   + + <% } %> + + _item<%= jspUtil.out("item.itemNo") %>"/> +
+
+ + " id="title_item<%= jspUtil.out("item.itemNo") %>" + value="<%= jspUtil.out("item.itemName") %>" /> +
+
+ + " id="description_item<%= jspUtil.out("item.itemNo") %>" + value="<%= jspUtil.out("item.description") %>" /> +
+ + <% if ( + jspUtil.is(String.valueOf(TemplateLogic.ITEM_TYPE_RADIO), "item.itemType") + || jspUtil.is(String.valueOf(TemplateLogic.ITEM_TYPE_CHECKBOX), "item.itemType") + ) { %> +
" class="choice_item_list"> -
- - " - id="label_item<%= jspUtil.out("item.itemNo") %>_<%= jspUtil.out("choice.choiceNo") %>" - value="<%= jspUtil.out("choice.choiceLabel") %>"/> -
- -
- - " - id="value_item<%= jspUtil.out("item.itemNo") %>_<%= jspUtil.out("choice.choiceNo") %>" - value="<%= jspUtil.out("choice.choiceLabel") %>"/> -
+
+ + " + id="label_item<%= jspUtil.out("item.itemNo") %>_<%= jspUtil.out("choice.choiceNo") %>" + value="<%= jspUtil.out("choice.choiceLabel") %>"/> +
+ +
+ + " + id="value_item<%= jspUtil.out("item.itemNo") %>_<%= jspUtil.out("choice.choiceNo") %>" + value="<%= jspUtil.out("choice.choiceLabel") %>"/> +
-
- <% } %> -
-
-
- - " id="typeId"/> - - - - - - " - class="btn btn-success" role="button"> <%= jspUtil.label("label.backlist") %> - +
+ <% } %> +
+
+
+ + " id="typeId"/> + + + + + + " + class="btn btn-success" role="button"> <%= jspUtil.label("label.backlist") %> +
diff --git a/src/main/webapp/WEB-INF/views/admin/users/accept_list.jsp b/src/main/webapp/WEB-INF/views/admin/users/accept_list.jsp index 1f1d7a382..c4a26567a 100644 --- a/src/main/webapp/WEB-INF/views/admin/users/accept_list.jsp +++ b/src/main/webapp/WEB-INF/views/admin/users/accept_list.jsp @@ -24,10 +24,16 @@
- " class="btn btn-primary"> -  <%= jspUtil.label("knowledge.accept.label.accept") %> - -

<%= jspUtil.out("entry.userName") %> (<%= jspUtil.out("entry.userKey") %>)

+

<%= jspUtil.label("label.regist.datetime") %>  <%= jspUtil.date("user.insertDatetime")%> / diff --git a/src/main/webapp/WEB-INF/views/commons/errors/badrequest.jsp b/src/main/webapp/WEB-INF/views/commons/errors/badrequest.jsp index f41b3247e..32aa14da2 100644 --- a/src/main/webapp/WEB-INF/views/commons/errors/badrequest.jsp +++ b/src/main/webapp/WEB-INF/views/commons/errors/badrequest.jsp @@ -8,26 +8,26 @@ <% JspUtil jspUtil = new JspUtil(request, pageContext); %> - -

-

Error

-

- - - -

- - <%= jspUtil.out(CommonWebParameter.ERROR_ATTRIBUTE) %> -

- Back to Top -

- -
- - - - - + +
+

Error

+

+ + + +

+ + <%= jspUtil.out(CommonWebParameter.ERROR_ATTRIBUTE) %> +

+ Back to Top +

+ +
+ + + + +
diff --git a/src/main/webapp/WEB-INF/views/commons/errors/error.jsp b/src/main/webapp/WEB-INF/views/commons/errors/error.jsp index 1142d43f3..5af5d8582 100644 --- a/src/main/webapp/WEB-INF/views/commons/errors/error.jsp +++ b/src/main/webapp/WEB-INF/views/commons/errors/error.jsp @@ -6,22 +6,22 @@

Error

- - - + + +

<% if (request.getRemoteAddr().startsWith("192.168.") || request.getRemoteAddr().equals("127.0.0.1")) { - if (exception == null && request.getAttribute("SERVER_EXCEPTION") != null) { - exception = (Throwable) request.getAttribute("SERVER_EXCEPTION"); - } - if (exception != null) { - java.io.PrintWriter pw = new java.io.PrintWriter(out); - pw.println("
");
-		exception.printStackTrace(pw);
-		pw.println("
"); - } + if (exception == null && request.getAttribute("SERVER_EXCEPTION") != null) { + exception = (Throwable) request.getAttribute("SERVER_EXCEPTION"); + } + if (exception != null) { + java.io.PrintWriter pw = new java.io.PrintWriter(out); + pw.println("
");
+        exception.printStackTrace(pw);
+        pw.println("
"); + } } %> diff --git a/src/main/webapp/WEB-INF/views/commons/errors/forbidden.jsp b/src/main/webapp/WEB-INF/views/commons/errors/forbidden.jsp index 7ec1c730c..4439ec602 100644 --- a/src/main/webapp/WEB-INF/views/commons/errors/forbidden.jsp +++ b/src/main/webapp/WEB-INF/views/commons/errors/forbidden.jsp @@ -8,23 +8,23 @@ <% JspUtil jspUtil = new JspUtil(request, pageContext); %> - -
-

Error

-

- - - -

- - <%= jspUtil.out(CommonWebParameter.ERROR_ATTRIBUTE) %> -

- Back to Top -

- -
- -
+ +
+

Error

+

+ + + +

+ + <%= jspUtil.out(CommonWebParameter.ERROR_ATTRIBUTE) %> +

+ Back to Top +

+ +
+ +
diff --git a/src/main/webapp/WEB-INF/views/commons/errors/jsp_error.jsp b/src/main/webapp/WEB-INF/views/commons/errors/jsp_error.jsp index 9f1498d1a..915ff8394 100644 --- a/src/main/webapp/WEB-INF/views/commons/errors/jsp_error.jsp +++ b/src/main/webapp/WEB-INF/views/commons/errors/jsp_error.jsp @@ -8,14 +8,14 @@

Error

- - - + + +

<% if (request.getRemoteAddr().startsWith("192.168.") || request.getRemoteAddr().equals("127.0.0.1")) { - exception.printStackTrace(new java.io.PrintWriter(out)); + exception.printStackTrace(new java.io.PrintWriter(out)); } %> diff --git a/src/main/webapp/WEB-INF/views/commons/errors/not_found.jsp b/src/main/webapp/WEB-INF/views/commons/errors/not_found.jsp index 68bc82a8a..f4ceececb 100644 --- a/src/main/webapp/WEB-INF/views/commons/errors/not_found.jsp +++ b/src/main/webapp/WEB-INF/views/commons/errors/not_found.jsp @@ -8,23 +8,23 @@ <% JspUtil jspUtil = new JspUtil(request, pageContext); %> - -
-

Error

-

- - - -

- - <%= jspUtil.out(CommonWebParameter.ERROR_ATTRIBUTE) %> -

- Back to Top -

- -
- -
+ +
+

Error

+

+ + + +

+ + <%= jspUtil.out(CommonWebParameter.ERROR_ATTRIBUTE) %> +

+ Back to Top +

+ +
+ +
diff --git a/src/main/webapp/WEB-INF/views/commons/errors/server_error.jsp b/src/main/webapp/WEB-INF/views/commons/errors/server_error.jsp index 1e58bbf26..d407750a3 100644 --- a/src/main/webapp/WEB-INF/views/commons/errors/server_error.jsp +++ b/src/main/webapp/WEB-INF/views/commons/errors/server_error.jsp @@ -8,15 +8,16 @@ <% JspUtil jspUtil = new JspUtil(request, pageContext); %> - -
+ + +

Server Error

- - - + + +

<%= jspUtil.out(CommonWebParameter.ERROR_ATTRIBUTE) %> @@ -24,17 +25,17 @@ <% if (request.getRemoteAddr().startsWith("192.168.") - || request.getRemoteAddr().equals("127.0.0.1") - || request.getRemoteAddr().equals("0:0:0:0:0:0:0:1")) { - if (exception == null && request.getAttribute("SERVER_EXCEPTION") != null) { - exception = (Throwable) request.getAttribute("SERVER_EXCEPTION"); - } - if (exception != null) { - java.io.PrintWriter pw = new java.io.PrintWriter(out); - pw.println("
");
-		exception.printStackTrace(pw);
-		pw.println("
"); - } + || request.getRemoteAddr().equals("127.0.0.1") + || request.getRemoteAddr().equals("0:0:0:0:0:0:0:1")) { + if (exception == null && request.getAttribute("SERVER_EXCEPTION") != null) { + exception = (Throwable) request.getAttribute("SERVER_EXCEPTION"); + } + if (exception != null) { + java.io.PrintWriter pw = new java.io.PrintWriter(out); + pw.println("
");
+        exception.printStackTrace(pw);
+        pw.println("
"); + } } %> @@ -43,8 +44,8 @@ if (request.getRemoteAddr().startsWith("192.168.")

-
-
+
+
diff --git a/src/main/webapp/WEB-INF/views/commons/errors/unauthorized.jsp b/src/main/webapp/WEB-INF/views/commons/errors/unauthorized.jsp index c22415e37..0114b7427 100644 --- a/src/main/webapp/WEB-INF/views/commons/errors/unauthorized.jsp +++ b/src/main/webapp/WEB-INF/views/commons/errors/unauthorized.jsp @@ -8,23 +8,23 @@ <% JspUtil jspUtil = new JspUtil(request, pageContext); %> - -
-

Error

-

- - - -

- - <%= jspUtil.out(CommonWebParameter.ERROR_ATTRIBUTE) %> -

- Back to Top -

- -
- -
+ +
+

Error

+

+ + + +

+ + <%= jspUtil.out(CommonWebParameter.ERROR_ATTRIBUTE) %> +

+ Back to Top +

+ +
+ +
diff --git a/src/main/webapp/WEB-INF/views/commons/layout/commonFooter.jsp b/src/main/webapp/WEB-INF/views/commons/layout/commonFooter.jsp index 13148f20e..06ef5aca9 100644 --- a/src/main/webapp/WEB-INF/views/commons/layout/commonFooter.jsp +++ b/src/main/webapp/WEB-INF/views/commons/layout/commonFooter.jsp @@ -7,34 +7,34 @@ <% JspUtil jspUtil = new JspUtil(request, pageContext); %> - - - + + + diff --git a/src/main/webapp/WEB-INF/views/commons/layout/commonHeader.jsp b/src/main/webapp/WEB-INF/views/commons/layout/commonHeader.jsp index 2319d92a1..16290c9c8 100644 --- a/src/main/webapp/WEB-INF/views/commons/layout/commonHeader.jsp +++ b/src/main/webapp/WEB-INF/views/commons/layout/commonHeader.jsp @@ -33,27 +33,33 @@ - + + + <% if (StringUtils.isNotEmpty(jspUtil.out("thema"))) { %> -/bootstrap.min.css" /> +/bootstrap.min.css" /> <% } else { %> -/bootstrap.min.css" /> +/bootstrap.min.css" /> <% } %> - - - - <% if (StringUtils.isNotEmpty(jspUtil.out("highlight"))) { %> -.css" /> +.css" /> <% } else { %> -.css" /> +.css" /> <% } %> + + + + + + + + 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 dd060b310..b7d417181 100644 --- a/src/main/webapp/WEB-INF/views/commons/layout/commonNavbar.jsp +++ b/src/main/webapp/WEB-INF/views/commons/layout/commonNavbar.jsp @@ -11,119 +11,119 @@ <% JspUtil jspUtil = new JspUtil(request, pageContext); %> diff --git a/src/main/webapp/WEB-INF/views/commons/layout/commonScripts.jsp b/src/main/webapp/WEB-INF/views/commons/layout/commonScripts.jsp index 993802b13..c67366f40 100644 --- a/src/main/webapp/WEB-INF/views/commons/layout/commonScripts.jsp +++ b/src/main/webapp/WEB-INF/views/commons/layout/commonScripts.jsp @@ -9,25 +9,26 @@ <% JspUtil jspUtil = new JspUtil(request, pageContext); %> - - - + + + - + - - - + + + - - + + - + - - + + - + + - + + + +
-
-

- " - width="64" height="64" />  - <%= jspUtil.out("userName") %> -

-
-
-
-
-  <%= jspUtil.label("knowledge.account.label.knowledge.count") %> -
-
-  <%= jspUtil.out("knowledgeCount") %> -
-
-
-
-  <%= jspUtil.label("knowledge.account.label.like.count") %> -
-
-  <%= jspUtil.out("likeCount") %> -
-
-
-
-  <%= jspUtil.label("knowledge.account.label.stock.count") %> -
-
-  <%= jspUtil.out("stockCount") %> -
-
-
+
+

+ " + width="64" height="64" />  + <%= jspUtil.out("userName") %> +

+
+
+
+
+  <%= jspUtil.label("knowledge.account.label.knowledge.count") %> +
+
+  <%= jspUtil.out("knowledgeCount") %> +
+
+
+
+  <%= jspUtil.label("knowledge.account.label.like.count") %> +
+
+  <%= jspUtil.out("likeCount") %> +
+
+
+
+  <%= jspUtil.label("knowledge.account.label.stock.count") %> +
+
+  <%= jspUtil.out("stockCount") %> +
+
+

@@ -66,26 +70,26 @@
- <% request.setAttribute("list_data", jspUtil.getValue("knowledges", List.class)); %> - + <% request.setAttribute("list_data", jspUtil.getValue("knowledges", List.class)); %> +
- - + + diff --git a/src/main/webapp/WEB-INF/views/open/emoji/nature.jsp b/src/main/webapp/WEB-INF/views/open/emoji/nature.jsp index 0be0db75e..6803f7b79 100644 --- a/src/main/webapp/WEB-INF/views/open/emoji/nature.jsp +++ b/src/main/webapp/WEB-INF/views/open/emoji/nature.jsp @@ -1,944 +1,944 @@ <%@page pageEncoding="UTF-8" isELIgnored="false" session="false" - errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> + errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> diff --git a/src/main/webapp/WEB-INF/views/open/emoji/objects.jsp b/src/main/webapp/WEB-INF/views/open/emoji/objects.jsp index d2c680eee..13ebecbc1 100644 --- a/src/main/webapp/WEB-INF/views/open/emoji/objects.jsp +++ b/src/main/webapp/WEB-INF/views/open/emoji/objects.jsp @@ -1,2105 +1,2105 @@ <%@page pageEncoding="UTF-8" isELIgnored="false" session="false" - errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> + errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> diff --git a/src/main/webapp/WEB-INF/views/open/emoji/people.jsp b/src/main/webapp/WEB-INF/views/open/emoji/people.jsp index 1702c7a4c..563aa5ca3 100644 --- a/src/main/webapp/WEB-INF/views/open/emoji/people.jsp +++ b/src/main/webapp/WEB-INF/views/open/emoji/people.jsp @@ -1,1562 +1,1562 @@ <%@page pageEncoding="UTF-8" isELIgnored="false" session="false" - errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> + errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> diff --git a/src/main/webapp/WEB-INF/views/open/emoji/places.jsp b/src/main/webapp/WEB-INF/views/open/emoji/places.jsp index 299c40c87..fd3f78998 100644 --- a/src/main/webapp/WEB-INF/views/open/emoji/places.jsp +++ b/src/main/webapp/WEB-INF/views/open/emoji/places.jsp @@ -1,787 +1,787 @@ <%@page pageEncoding="UTF-8" isELIgnored="false" session="false" - errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> + errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/open/emoji/symbols.jsp b/src/main/webapp/WEB-INF/views/open/emoji/symbols.jsp index d8b778a80..ba3267cae 100644 --- a/src/main/webapp/WEB-INF/views/open/emoji/symbols.jsp +++ b/src/main/webapp/WEB-INF/views/open/emoji/symbols.jsp @@ -1,1449 +1,1449 @@ <%@page pageEncoding="UTF-8" isELIgnored="false" session="false" - errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> + errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/histories.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/histories.jsp index 64ac5303c..dd2baee17 100644 --- a/src/main/webapp/WEB-INF/views/open/knowledge/histories.jsp +++ b/src/main/webapp/WEB-INF/views/open/knowledge/histories.jsp @@ -1,100 +1,102 @@ <%@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"%> + 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 jspUtil = new JspUtil(request, pageContext); %> - - + + - - - - + + + + + + - -

<%= jspUtil.label("knowledge.histories.title") %> - page[<%= jspUtil.getValue("page", Integer.class) + 1 %>] -

- - - - + +

<%= jspUtil.label("knowledge.histories.title") %> + page[<%= jspUtil.getValue("page", Integer.class) + 1 %>] +

+ + + + - - - - - <%= jspUtil.out("params") %>" - class="btn btn-warning" role="button"> <%= jspUtil.label("label.back") %> - - - <%= jspUtil.out("params") %>" - class="btn btn-success" role="button"> <%= jspUtil.label("knowledge.view.back.list") %> - - -
+ + + + + <%= jspUtil.out("params") %>" + class="btn btn-warning" role="button"> <%= jspUtil.label("label.back") %> + + + <%= jspUtil.out("params") %>" + class="btn btn-success" role="button"> <%= jspUtil.label("knowledge.view.back.list") %> + + +
diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/history.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/history.jsp index 3b66b1c22..c664046f0 100644 --- a/src/main/webapp/WEB-INF/views/open/knowledge/history.jsp +++ b/src/main/webapp/WEB-INF/views/open/knowledge/history.jsp @@ -1,33 +1,35 @@ <%@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"%> + 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 jspUtil = new JspUtil(request, pageContext); %> - - + + - - - - + + + + + + - +

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

" - alt="icon" width="36" height="36" style="float:left" /> + data-echo="<%= request.getContextPath()%>/open.account/icon/<%= jspUtil.out("history.updateUser") %>" + alt="icon" width="36" height="36" style="float:left" />
 <%= jspUtil.out("history.userName") %>   <%= jspUtil.date("history.updateDatetime")%> @@ -41,24 +43,24 @@

<%= jspUtil.label("knowledge.histories.label.history") %>
- - + +

<%= jspUtil.label("knowledge.histories.label.now") %>
- - + +
<%= jspUtil.out("params") %>&page=<%= jspUtil.out("page") %>" - class="btn btn-warning" role="button"> <%= jspUtil.label("label.back") %> + class="btn btn-warning" role="button"> <%= jspUtil.label("label.back") %> -
+
diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/list.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/list.jsp index 146fcec69..17b39adf2 100644 --- a/src/main/webapp/WEB-INF/views/open/knowledge/list.jsp +++ b/src/main/webapp/WEB-INF/views/open/knowledge/list.jsp @@ -16,27 +16,11 @@ - - " /> + - - - - - - - - - - - + <% if (jspUtil.logined()) { diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/partials/common_list.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/partials/common_list.jsp index 5e138e15a..9eea1f61a 100644 --- a/src/main/webapp/WEB-INF/views/open/knowledge/partials/common_list.jsp +++ b/src/main/webapp/WEB-INF/views/open/knowledge/partials/common_list.jsp @@ -73,7 +73,7 @@   - <%=jspUtil.out("target.label")%> + <%=jspUtil.out("target.label")%>   diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/partials/common_sub_list.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/partials/common_sub_list.jsp index 3d8f2635c..c71ed5af6 100644 --- a/src/main/webapp/WEB-INF/views/open/knowledge/partials/common_sub_list.jsp +++ b/src/main/webapp/WEB-INF/views/open/knowledge/partials/common_sub_list.jsp @@ -10,52 +10,52 @@ <% JspUtil jspUtil = new JspUtil(request, pageContext); %> - - + + diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-list-scripts.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-list-scripts.jsp new file mode 100644 index 000000000..6a8316b59 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-list-scripts.jsp @@ -0,0 +1,14 @@ +<%@page pageEncoding="UTF-8" isELIgnored="false" session="false" errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> +<%@page import="org.support.project.web.util.JspUtil"%> +<%@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); %> + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-list-styles.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-list-styles.jsp new file mode 100644 index 000000000..5546932d4 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-list-styles.jsp @@ -0,0 +1,13 @@ +<%@page pageEncoding="UTF-8" isELIgnored="false" session="false" errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> +<%@page import="org.support.project.web.util.JspUtil"%> +<%@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); %> + + + + + + diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-attach-files.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-attach-files.jsp index 68746c071..57c38b7f8 100644 --- a/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-attach-files.jsp +++ b/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-attach-files.jsp @@ -12,7 +12,7 @@ <% int MAX_COUNT = 5; %>
-
+

 <%= jspUtil.label("knowledge.view.label.attach") %>     @@ -50,7 +50,7 @@

diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-menu-buttons.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-menu-buttons.jsp index b698f014d..5e470f8c8 100644 --- a/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-menu-buttons.jsp +++ b/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-menu-buttons.jsp @@ -61,7 +61,7 @@
- diff --git a/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-modal-stock.jsp b/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-modal-stock.jsp index 2bf642a7b..702536be8 100644 --- a/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-modal-stock.jsp +++ b/src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-modal-stock.jsp @@ -19,9 +19,9 @@ <%-- コンテンツ --%>