diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 000000000..3ae32116b
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,9 @@
+.dockerignore
+Dockerfile
+docker-compose.yml
+
+.git/
+.gitignore/
+
+target/
+
diff --git a/.gitignore b/.gitignore
index 8e24992a0..7a0cb9db2 100755
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,6 @@ target
.eclipse-pmd
.checkstyle
node
+.idea
+.m2
+knowledge.iml
diff --git a/.travis.yml b/.travis.yml
index d03d18c3c..1e77d5617 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,5 @@
language: java
jdk: oraclejdk8
-
-install: mvn install -DskipTests=true
-script: mvn test site
+install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dmaven.exec.skip=true -B -V
+script: mvn clean test
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..5f9bf8ba9
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,71 @@
+FROM node:8.6-alpine
+
+# Default to UTF-8 file.encoding
+ENV LANG C.UTF-8
+
+# install git
+RUN apk update && apk upgrade && \
+ apk add --no-cache bash git openssh
+
+# install jdk
+RUN { \
+ echo '#!/bin/sh'; \
+ echo 'set -e'; \
+ echo; \
+ echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
+ } > /usr/local/bin/docker-java-home \
+ && chmod +x /usr/local/bin/docker-java-home
+ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
+ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
+
+ENV JAVA_VERSION 8u131
+ENV JAVA_ALPINE_VERSION 8.131.11-r2
+
+RUN set -x \
+ && apk add --no-cache \
+ openjdk8="$JAVA_ALPINE_VERSION" \
+ && [ "$JAVA_HOME" = "$(docker-java-home)" ]
+
+# install maven
+RUN apk add --no-cache curl tar bash
+
+ARG MAVEN_VERSION=3.5.0
+ARG USER_HOME_DIR="/root"
+ARG SHA=beb91419245395bd69a4a6edad5ca3ec1a8b64e41457672dc687c173a495f034
+ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
+
+RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
+ && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
+ && echo "${SHA} /tmp/apache-maven.tar.gz" | sha256sum -c - \
+ && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
+ && rm -f /tmp/apache-maven.tar.gz \
+ && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
+
+ENV MAVEN_HOME /usr/share/maven
+ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
+
+COPY mvn-entrypoint.sh /usr/local/bin/mvn-entrypoint.sh
+COPY settings-docker.xml /usr/share/maven/ref/
+
+VOLUME "$USER_HOME_DIR/.m2"
+
+ENTRYPOINT ["/usr/local/bin/mvn-entrypoint.sh"]
+CMD ["mvn"]
+
+# RUN knowledge tool install
+RUN npm install -g bower
+RUN npm install -g gulp
+
+COPY package.json /usr/src/mymaven/
+COPY bower.json /usr/src/mymaven/
+COPY .bowerrc /usr/src/mymaven/
+
+WORKDIR /usr/src/mymaven
+
+RUN npm install
+RUN bower install --allow-root
+
+
+#### RUN on docker-compose
+# docker-compose build dev
+# docker-compose run --rm dev mvn clean test
diff --git a/README.md b/README.md
index 19ea962db..3dfb099e3 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,12 @@
## About
- Free Knowledge Management System
+- [landing page and Online manual](https://information-knowledge.support-project.org/)
+## Support
+- **日本語での質問は、以下のサイトに登録してください(海外からのアクセスが多くなったため)**
+- **For questions in Japanese, please register below**
+- https://service-knowledge.support-project.org/
## Live Demo
- [https://test-knowledge.support-project.org](https://test-knowledge.support-project.org)
@@ -23,13 +28,3 @@
## How to initial set up
- Please show the [wiki page](https://github.com/support-project/knowledge/wiki)
-
-## Project website (more info)
-- [landing page and Online manual](https://information-knowledge.support-project.org/)
-
-
-
-
-
-
-
diff --git a/Third_party_license.txt b/Third_party_license.txt
index de0235b13..d8fc9e003 100644
--- a/Third_party_license.txt
+++ b/Third_party_license.txt
@@ -202,5 +202,11 @@
- License: [BSD License] https://github.com/kpdecker/jsdiff/blob/master/LICENSE
- project-url: https://github.com/kpdecker/jsdiff
+- Chart.js
+ - License: [MIT License] https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
+ - project-url: https://github.com/chartjs/Chart.js
+- Vue.js
+ - License: [MIT License] https://github.com/vuejs/vue/blob/master/LICENSE
+ - project-url: https://jp.vuejs.org/index.html
\ No newline at end of file
diff --git a/bower.json b/bower.json
index b223fe2b6..3e425746a 100644
--- a/bower.json
+++ b/bower.json
@@ -35,7 +35,9 @@
"bootstrap-table": "1.11.1",
"tableExport.jquery.plugin": "1.8.1",
"diff2html": "2.3.0",
- "jsdiff": "3.2.0"
+ "jsdiff": "3.2.0",
+ "chart.js": "2.6.0",
+ "vue": "2.4.2"
},
"devDependencies": {},
"resolutions": {
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 000000000..23286514e
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,25 @@
+version: '2.1'
+
+services:
+ dev:
+ image: knowledge-maven
+ build:
+ context: .
+ args:
+ - https_proxy
+ - http_proxy
+ links:
+ - mailcatcher
+ environment:
+ KNOWLEDGE_TEST_MAIL: 'false'
+ volumes:
+ - $PWD:/usr/src/mymaven
+ - $PWD/.m2:/root/.m2
+
+ mailcatcher:
+ image: "zolweb/docker-mailcatcher"
+ ports:
+ - "1025:1025"
+ - "1080:1080"
+ expose:
+ - "1080"
diff --git a/document/database/A5M2_knowledge.pdf b/document/database/A5M2_knowledge.pdf
index a6ef73af7..70de5485b 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 34604e0ca..603346399 100755
--- a/document/database/knowledge.a5er
+++ b/document/database/knowledge.a5er
@@ -46,14 +46,395 @@ SqlSeparator=0
ShowTag=1
ShowCommonAttributes=0
+[Entity]
+PName=NOTIFICATION_STATUS
+LName=いいねの通知状態
+Comment=
+TableOption=
+Page=MAIN
+Left=2000
+Top=1450
+Field="種類","TYPE","@INT","NOT NULL",0,"","",$FFFFFFFF,""
+Field="ターゲットのID","TARGET_ID","bigint","NOT NULL",1,"","",$FFFFFFFF,""
+Field="登録者","USER_ID","@INT","NOT NULL",2,"","",$FFFFFFFF,""
+Field="通知の状態","STATUS","@INT",,,"","",$FFFFFFFF,""
+EffectMode=None
+Color=$000000
+BkColor=$FFFFFF
+ModifiedDateTime=20171002133707
+Position="MAIN",2000,1450
+
+[Relation]
+Entity1=MAIL_HOOK_CONDITIONS
+Entity2=MAIL_HOOK_IGNORE_CONDITIONS
+RelationType1=2
+RelationType2=3
+Fields1=HOOK_ID,CONDITION_NO
+Fields2=HOOK_ID,CONDITION_NO
+Cardinarity1=
+Cardinarity2=
+Position="MAIN",0,4923,4436,4098,R,R
+Dependence=1
+Caption=
+PName=
+LineMode=0
+Bar1=492
+Bar2=444
+Bar3=410
+TermPos1=R
+TermPos2=R
+
+[Entity]
+PName=MAIL_HOOK_IGNORE_CONDITIONS
+LName=メールから投稿の際の除外条件
+Comment=
+TableOption=
+Page=MAIN
+Left=3400
+Top=2500
+Field="HOOK_ID","HOOK_ID","INTEGER","NOT NULL",0,"","",$FFFFFFFF,""
+Field="CONDITION_NO","CONDITION_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,""
+Field="IGNORE_CONDITION_NO","IGNORE_CONDITION_NO","@INT","NOT NULL",2,"","",$FFFFFFFF,""
+Field="条件の種類","CONDITION_KIND","@INT","NOT NULL",,"","1:宛先が「条件文字」であった場合",$FFFFFFFF,""
+Field="条件の文字","CONDITION","@VARCHAR(256)",,,"","",$FFFFFFFF,""
+EffectMode=None
+Color=$000000
+BkColor=$FFFFFF
+ModifiedDateTime=20170929133334
+Position="MAIN",3400,2500
+
+[Comment]
+Comment=TODO 初期値追加
+FontName=Tahoma
+FontBold=0
+FontItalic=0
+FontUnderline=0
+FontSize=5
+FontColor=$000000
+LineColor=$000000
+BkColor=$FFFFFF
+Page=Main
+Left=1900
+Top=850
+Width=209
+Height=50
+
+[Relation]
+Entity1=ACTIVITIES
+Entity2=POINT_USER_HISTORIES
+RelationType1=1
+RelationType2=3
+Fields1=ACTIVITY_NO
+Fields2=ACTIVITY_NO
+Cardinarity1=
+Cardinarity2=
+Position="MAIN",0,5105,3901,4800,R,R
+Dependence=0
+Caption=
+PName=
+LineMode=0
+Bar1=510
+Bar2=390
+Bar3=480
+TermPos1=R
+TermPos2=R
+
+[Relation]
+Entity1=USERS
+Entity2=POINT_USER_HISTORIES
+RelationType1=4
+RelationType2=3
+Fields1=USER_ID
+Fields2=USER_ID
+Cardinarity1=
+Cardinarity2=
+Position="MAIN",0,3607,6398,4351,R,R
+Dependence=0
+Caption=
+PName=
+ModifiedDateTime=20170831112338
+LineMode=0
+Bar1=361
+Bar2=640
+Bar3=435
+TermPos1=R
+TermPos2=R
+
+[Entity]
+PName=POINT_USER_HISTORIES
+LName=ユーザのポイント獲得履歴
+Comment=
+TableOption=
+Page=MAIN
+Left=3500
+Top=850
+Field="ユーザID","USER_ID","INTEGER","NOT NULL",0,"","",$FFFFFFFF,""
+Field="履歴番号","HISTORY_NO","BIGINT","NOT NULL",1,"","",$FFFFFFFF,""
+Field="アクティビティ番号","ACTIVITY_NO","BIGINT","NOT NULL",,"","",$FFFFFFFF,""
+Field="獲得のタイプ","TYPE","@INT","NOT NULL",,"","",$FFFFFFFF,""
+Field="獲得ポイント","POINT","@INT","NOT NULL",,"","",$FFFFFFFF,""
+Field="獲得前ポイント","BEFORE_TOTAL","@INT","NOT NULL",,"","",$FFFFFFFF,""
+Field="トータルポイント","TOTAL","@INT","NOT NULL",,"","",$FFFFFFFF,""
+Index=IDX_POINT_USER_HISTORIES_INSERT_DATETIME=0,INSERT_DATETIME
+EffectMode=None
+Color=$000000
+BkColor=$FFFFFF
+ModifiedDateTime=20170907135513
+Position="MAIN",3500,850
+
+[Relation]
+Entity1=ACTIVITIES
+Entity2=POINT_KNOWLEDGE_HISTORIES
+RelationType1=4
+RelationType2=3
+Fields1=ACTIVITY_NO
+Fields2=ACTIVITY_NO
+Cardinarity1=
+Cardinarity2=
+Position="MAIN",0,6576,4612,6570,R,R
+Dependence=0
+Caption=
+PName=
+ModifiedDateTime=20170831112218
+LineMode=0
+Bar1=658
+Bar2=461
+Bar3=657
+TermPos1=R
+TermPos2=R
+
+[Relation]
+Entity1=KNOWLEDGES
+Entity2=POINT_KNOWLEDGE_HISTORIES
+RelationType1=4
+RelationType2=3
+Fields1=KNOWLEDGE_ID
+Fields2=KNOWLEDGE_ID
+Cardinarity1=
+Cardinarity2=
+Position="MAIN",0,2911,5347,7802,R,R
+Dependence=0
+Caption=
+PName=
+ModifiedDateTime=20170831112209
+LineMode=0
+Bar1=291
+Bar2=535
+Bar3=780
+TermPos1=R
+TermPos2=R
+
+[Entity]
+PName=POINT_KNOWLEDGE_HISTORIES
+LName=ナレッジのポイント獲得履歴
+Comment=
+TableOption=
+Page=MAIN
+Left=2450
+Top=1050
+Field="ナレッジID","KNOWLEDGE_ID","BIGINT","NOT NULL",0,"","",$FFFFFFFF,""
+Field="履歴番号","HISTORY_NO","BIGINT","NOT NULL",1,"","",$FFFFFFFF,""
+Field="アクティビティ番号","ACTIVITY_NO","BIGINT","NOT NULL",,"","",$FFFFFFFF,""
+Field="獲得のタイプ","TYPE","@INT","NOT NULL",,"","",$FFFFFFFF,""
+Field="獲得ポイント","POINT","@INT","NOT NULL",,"","",$FFFFFFFF,""
+Field="獲得前ポイント","BEFORE_TOTAL","@INT","NOT NULL",,"","",$FFFFFFFF,""
+Field="トータルポイント","TOTAL","@INT","NOT NULL",,"","",$FFFFFFFF,""
+Index=IDX_POINT_KNOWLEDGE_HISTORIES_INSERT_DATETIME=0,INSERT_DATETIME
+EffectMode=None
+Color=$000000
+BkColor=$FFFFFF
+ModifiedDateTime=20170907135426
+Position="MAIN",2450,1050
+
+[Relation]
+Entity1=BADGES
+Entity2=USER_BADGES
+RelationType1=2
+RelationType2=3
+Fields1=NO
+Fields2=NO
+Cardinarity1=
+Cardinarity2=
+Position="MAIN",0,4598,5968,5732,R,R
+Dependence=1
+Caption=
+PName=
+ModifiedDateTime=20170829163644
+LineMode=0
+Bar1=460
+Bar2=597
+Bar3=573
+TermPos1=R
+TermPos2=R
+
+[Relation]
+Entity1=USERS
+Entity2=USER_BADGES
+RelationType1=1
+RelationType2=3
+Fields1=USER_ID
+Fields2=USER_ID
+Cardinarity1=
+Cardinarity2=
+Position="MAIN",0,4363,7074,3229,R,R
+Dependence=1
+Caption=
+PName=
+LineMode=0
+Bar1=436
+Bar2=707
+Bar3=323
+TermPos1=R
+TermPos2=R
+
+[Entity]
+PName=USER_BADGES
+LName=ユーザの称号
+Comment=
+TableOption=
+Page=MAIN
+Left=2900
+Top=800
+Field="ユーザID","USER_ID","INTEGER","NOT NULL",0,"","",$FFFFFFFF,""
+Field="番号","NO","INTEGER","NOT NULL",1,"","",$FFFFFFFF,""
+EffectMode=None
+Color=$000000
+BkColor=$FFFFFF
+ModifiedDateTime=20170829163555
+Position="MAIN",2900,800
+
+[Relation]
+Entity1=USERS
+Entity2=ACTIVITIES
+RelationType1=2
+RelationType2=3
+Fields1=USER_ID
+Fields2=USER_ID
+Cardinarity1=
+Cardinarity2=
+Position="MAIN",3,9500,5578,9500,R,R
+Dependence=1
+Caption=
+PName=
+ModifiedDateTime=20170831112359
+LineMode=3
+Bar1=950
+Bar2=558
+Bar3=950
+TermPos1=R
+TermPos2=R
+
+[Entity]
+PName=ACTIVITIES
+LName=アクティビティ
+Comment=
+TableOption=
+Page=MAIN
+Left=3450
+Top=1100
+Field="アクティビティ番号","ACTIVITY_NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,""
+Field="イベントをおこしたユーザ","USER_ID","INTEGER","NOT NULL",,"","",$FFFFFFFF,""
+Field="アクティビティの種類","KIND","@INT","NOT NULL",,"","",$FFFFFFFF,""
+Field="ターゲットID","TARGET","@VARCHAR(64)","NOT NULL",,"","",$FFFFFFFF,""
+Index=IDX_ACTIVITIES_USER_ID=0,USER_ID
+Index=IDX_ACTIVITIES_KIND_TARGET=0,KIND,TARGET
+EffectMode=None
+Color=$000000
+BkColor=$FFFFFF
+ModifiedDateTime=20170831112153
+Position="MAIN",3450,1100
+
+[Entity]
+PName=USERS
+LName=ユーザ
+Comment=
+TableOption=
+Page=MAIN
+Left=3500
+Top=500
+Field="ユーザID","USER_ID","SERIAL","NOT NULL",0,"","",$FFFFFFFF,""
+Field="ユーザKEY","USER_KEY","@VARCHAR(256)","NOT NULL",,"","ユニーク",$FFFFFFFF,""
+Field="ユーザ名","USER_NAME","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,""
+Field="パスワード","PASSWORD","@VARCHAR(1024)","NOT NULL",,"","ハッシュ(不可逆)",$FFFFFFFF,""
+Field="SALT","SALT","@VARCHAR(1024)",,,"","",$FFFFFFFF,""
+Field="ロケール","LOCALE_KEY","@VARCHAR(12)",,,"","",$FFFFFFFF,""
+Field="メールアドレス","MAIL_ADDRESS","@VARCHAR(256)",,,"","",$FFFFFFFF,""
+Field="LDAP認証ユーザかどうか","AUTH_LDAP","@INT",,,"","",$FFFFFFFF,""
+Index=IDX_USERS_USER_KEY=1,USER_KEY
+NoDDL=1
+UsingCommonColumns=0
+EffectMode=None
+Color=$000000
+BkColor=$FFFFFF
+ModifiedDateTime=20170829160846
+Position="MAIN",3500,500
+
+[Entity]
+PName=BADGES
+LName=称号
+Comment=
+TableOption=
+Page=MAIN
+Left=2900
+Top=450
+Field="番号","NO","SERIAL","NOT NULL",0,"","",$FFFFFFFF,""
+Field="名称","NAME","@VARCHAR(128)","NOT NULL",,"","",$FFFFFFFF,""
+Field="表示名","DISPLAY_TEXT","@VARCHAR(32)","NOT NULL",,"","",$FFFFFFFF,""
+Field="説明","DESCRIPTION","text",,,"","",$FFFFFFFF,""
+Field="画像","IMAGE","@VARCHAR(64)",,,"","",$FFFFFFFF,""
+Field="獲得ポイント","POINT","@INT",,,"","",$FFFFFFFF,""
+EffectMode=None
+Color=$000000
+BkColor=$FFFFFF
+ModifiedDateTime=20170831113107
+Position="MAIN",2900,450
+
+[Relation]
+Entity1=COMMENTS
+Entity2=LIKE_COMMENTS
+RelationType1=1
+RelationType2=3
+Fields1=COMMENT_NO
+Fields2=COMMENT_NO
+Cardinarity1=
+Cardinarity2=
+Position="MAIN",0,3695,3149,4099,R,R
+Dependence=0
+Caption=
+PName=
+LineMode=0
+Bar1=370
+Bar2=315
+Bar3=410
+TermPos1=R
+TermPos2=R
+
+[Entity]
+PName=LIKE_COMMENTS
+LName=コメントのイイネ
+Comment=
+TableOption=
+Page=MAIN
+Left=1500
+Top=1450
+Field="NO","NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,""
+Field="コメント番号","COMMENT_NO","bigint","NOT NULL",,"","",$FFFFFFFF,""
+Field="種類","LIKE_CLASS","@INT",,,"1","",$FFFFFFFF,""
+Index=IDX_LIKE_COMMENTS_COMMENT_NO=0,COMMENT_NO
+EffectMode=None
+Color=$000000
+BkColor=$FFFFFF
+ModifiedDateTime=20170809123907
+Position="MAIN",1500,1450
+
[Entity]
PName=TOKENS
LName=認証トークン
Comment=
TableOption=
Page=MAIN
-Left=1600
-Top=50
+Left=3600
+Top=300
Field="TOKEN","TOKEN","@VARCHAR(128)","NOT NULL",0,"","",$FFFFFFFF,""
Field="ユーザID","USER_ID","@INT","NOT NULL",,"","",$FFFFFFFF,""
Field="有効期限","EXPIRES","@DATETIME","NOT NULL",,"","",$FFFFFFFF,""
@@ -62,7 +443,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170620125822
-Position="MAIN",1600,50
+Position="MAIN",3600,300
[Relation]
Entity1=MAIL_HOOKS
@@ -73,14 +454,14 @@ Fields1=HOOK_ID
Fields2=HOOK_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,1836,5081,4896,R,R
+Position="MAIN",0,4930,5081,4887,R,R
Dependence=1
Caption=
PName=
LineMode=0
-Bar1=184
+Bar1=493
Bar2=508
-Bar3=490
+Bar3=489
TermPos1=R
TermPos2=R
@@ -90,8 +471,8 @@ LName=メール受信設定
Comment=
TableOption=
Page=MAIN
-Left=2950
-Top=50
+Left=3400
+Top=1600
Field="HOOK_ID","HOOK_ID","INTEGER","NOT NULL",0,"","",$FFFFFFFF,""
Field="PROPERTY_KEY","PROPERTY_KEY","@VARCHAR(128)","NOT NULL",1,"","",$FFFFFFFF,""
Field="PROPERTY_VALUE","PROPERTY_VALUE","@VARCHAR(256)",,,"","",$FFFFFFFF,""
@@ -99,7 +480,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170616214751
-Position="MAIN",2950,50
+Position="MAIN",3400,1600
[Relation]
Entity1=LOCALES
@@ -110,14 +491,14 @@ Fields1=KEY
Fields2=KEY
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,5226,5024,4720,R,R
+Position="MAIN",0,6268,5024,4481,R,R
Dependence=1
Caption=
PName=
LineMode=0
-Bar1=523
+Bar1=627
Bar2=502
-Bar3=472
+Bar3=448
TermPos1=R
TermPos2=R
@@ -130,14 +511,14 @@ Fields1=TEMPLATE_ID
Fields2=TEMPLATE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,4464,5489,4842,R,R
+Position="MAIN",0,4464,5489,3348,R,R
Dependence=1
Caption=
PName=
LineMode=0
Bar1=446
Bar2=549
-Bar3=484
+Bar3=335
TermPos1=R
TermPos2=R
@@ -147,8 +528,8 @@ LName=ロケール毎のメールテンプレート
Comment=
TableOption=
Page=MAIN
-Left=3600
-Top=300
+Left=2950
+Top=100
Field="テンプレートID","TEMPLATE_ID","@VARCHAR(32)","NOT NULL",0,"","",$FFFFFFFF,""
Field="キー","KEY","@VARCHAR(12)","NOT NULL",1,"","",$FFFFFFFF,""
Field=" タイトル","TITLE","text","NOT NULL",,"","",$FFFFFFFF,""
@@ -157,7 +538,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170228163618
-Position="MAIN",3600,300
+Position="MAIN",2950,100
[Entity]
PName=LOCALES
@@ -187,8 +568,8 @@ LName=メールテンプレート
Comment=
TableOption=
Page=MAIN
-Left=2950
-Top=200
+Left=2250
+Top=100
Field="テンプレートID","TEMPLATE_ID","@VARCHAR(32)","NOT NULL",0,"","",$FFFFFFFF,""
Field="テンプレートタイトル","TEMPLATE_TITLE","@VARCHAR(128)","NOT NULL",,"","",$FFFFFFFF,""
Field="説明文","DESCRIPTION","text",,,"","",$FFFFFFFF,""
@@ -196,7 +577,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170301131519
-Position="MAIN",2950,200
+Position="MAIN",2250,100
[Relation]
Entity1=SURVEY_ANSWERS
@@ -207,15 +588,15 @@ Fields1=KNOWLEDGE_ID,ANSWER_ID
Fields2=KNOWLEDGE_ID,ANSWER_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,5908,4092,2954,R,R
+Position="MAIN",0,7787,4092,1607,R,R
Dependence=1
Caption=
PName=
ModifiedDateTime=20170220204743
LineMode=0
-Bar1=591
+Bar1=779
Bar2=409
-Bar3=295
+Bar3=161
TermPos1=R
TermPos2=R
@@ -228,15 +609,15 @@ Fields1=KNOWLEDGE_ID
Fields2=ITEM_NO
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,4194,5115,6185,R,R
+Position="MAIN",0,4774,5115,5968,R,R
Dependence=0
Caption=
PName=
ModifiedDateTime=20170220204434
LineMode=0
-Bar1=419
+Bar1=477
Bar2=512
-Bar3=618
+Bar3=597
TermPos1=R
TermPos2=R
@@ -246,8 +627,8 @@ LName=アンケートの回答の値
Comment=
TableOption=
Page=MAIN
-Left=2450
-Top=1600
+Left=1800
+Top=2400
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,""
Field="回答ID","ANSWER_ID","@INT","NOT NULL",1,"","",$FFFFFFFF,""
Field="項目NO","ITEM_NO","@INT","NOT NULL",2,"","",$FFFFFFFF,""
@@ -256,7 +637,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170222220138
-Position="MAIN",2450,1600
+Position="MAIN",1800,2400
[Relation]
Entity1=SURVEYS
@@ -267,14 +648,14 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,4662,4335,5351,R,R
+Position="MAIN",0,4662,4335,6993,R,R
Dependence=0
Caption=
PName=
LineMode=0
Bar1=466
Bar2=434
-Bar3=535
+Bar3=699
TermPos1=R
TermPos2=R
@@ -284,15 +665,15 @@ LName=アンケートの回答
Comment=
TableOption=
Page=MAIN
-Left=1950
-Top=1600
+Left=1550
+Top=2100
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,""
Field="回答ID","ANSWER_ID","@INT","NOT NULL",1,"","",$FFFFFFFF,""
EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170222215330
-Position="MAIN",1950,1600
+Position="MAIN",1550,2100
[Relation]
Entity1=SURVEY_ITEMS
@@ -303,7 +684,7 @@ Fields1=KNOWLEDGE_ID,ITEM_NO
Fields2=KNOWLEDGE_ID,ITEM_NO
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,4139,4896,5177,R,R
+Position="MAIN",0,4139,4896,3096,R,R
Dependence=1
Caption=
PName=
@@ -311,7 +692,7 @@ ModifiedDateTime=20170220203851
LineMode=0
Bar1=414
Bar2=490
-Bar3=518
+Bar3=310
TermPos1=R
TermPos2=R
@@ -321,8 +702,8 @@ LName=アンケートの選択肢の値
Comment=
TableOption=
Page=MAIN
-Left=2450
-Top=1100
+Left=1250
+Top=2650
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,""
Field="項目NO","ITEM_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,""
Field="選択肢番号","CHOICE_NO","@INT","NOT NULL",2,"","",$FFFFFFFF,""
@@ -332,7 +713,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170220203842
-Position="MAIN",2450,1100
+Position="MAIN",1250,2650
[Relation]
Entity1=SURVEYS
@@ -343,15 +724,15 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,4567,5433,6677,R,R
+Position="MAIN",0,6505,5433,1090,R,R
Dependence=1
Caption=
PName=
ModifiedDateTime=20170220203540
LineMode=0
-Bar1=457
+Bar1=650
Bar2=543
-Bar3=668
+Bar3=109
TermPos1=R
TermPos2=R
@@ -361,8 +742,8 @@ LName=アンケート項目
Comment=
TableOption=
Page=MAIN
-Left=2500
-Top=1350
+Left=1200
+Top=2400
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,""
Field="項目NO","ITEM_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,""
Field="項目名","ITEM_NAME","@VARCHAR(32)","NOT NULL",,"","",$FFFFFFFF,""
@@ -372,7 +753,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170220203458
-Position="MAIN",2500,1350
+Position="MAIN",1200,2400
[Relation]
Entity1=KNOWLEDGES
@@ -383,14 +764,14 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,6731,2055,3130,R,R
+Position="MAIN",0,6893,2055,3184,R,R
Dependence=1
Caption=
PName=
LineMode=0
-Bar1=673
+Bar1=689
Bar2=206
-Bar3=313
+Bar3=318
TermPos1=R
TermPos2=R
@@ -400,8 +781,8 @@ LName=アンケート
Comment=
TableOption=
Page=MAIN
-Left=1950
-Top=1400
+Left=950
+Top=2100
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,""
Field="タイトル","TITLE","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,""
Field="説明","DESCRIPTION","text",,,"","",$FFFFFFFF,""
@@ -409,7 +790,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170220203309
-Position="MAIN",1950,1400
+Position="MAIN",950,2100
[Relation]
Entity1=EVENTS
@@ -441,13 +822,13 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,8507,5008,6901,R,R
+Position="MAIN",0,2626,3251,6901,R,R
Dependence=1
Caption=
PName=
LineMode=0
-Bar1=851
-Bar2=501
+Bar1=263
+Bar2=325
Bar3=690
TermPos1=R
TermPos2=R
@@ -458,8 +839,8 @@ LName=イベント
Comment=
TableOption=
Page=MAIN
-Left=1350
-Top=1500
+Left=50
+Top=900
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,""
Field="開催日","START_DATE_TIME","@DATETIME","NOT NULL",,"","UTC",$FFFFFFFF,""
Field="タイムゾーン","TIME_ZONE","@VARCHAR(64)",,,"","",$FFFFFFFF,""
@@ -468,7 +849,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170307155432
-Position="MAIN",1350,1500
+Position="MAIN",50,900
[Entity]
PName=PARTICIPANTS
@@ -476,8 +857,8 @@ LName=参加者
Comment=
TableOption=
Page=MAIN
-Left=1350
-Top=1750
+Left=50
+Top=750
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,""
Field="ユーザID","USER_ID","@INT","NOT NULL",1,"","",$FFFFFFFF,""
Field="ステータス","STATUS","@INT","NOT NULL",,"","",$FFFFFFFF,""
@@ -485,7 +866,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170222215215
-Position="MAIN",1350,1750
+Position="MAIN",50,750
[Relation]
Entity1=SERVICE_CONFIGS
@@ -515,7 +896,7 @@ Comment=
TableOption=
Page=MAIN
Left=1600
-Top=400
+Top=300
Field="サービス名","SERVICE_NAME","@VARCHAR(64)","NOT NULL",0,"","",$FFFFFFFF,""
Field="ロケールキー","LOCALE_KEY","@VARCHAR(12)","NOT NULL",1,"","",$FFFFFFFF,""
Field="トップページのHTML","PAGE_HTML","text",,,"","",$FFFFFFFF,""
@@ -523,7 +904,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170130131057
-Position="MAIN",1600,400
+Position="MAIN",1600,300
[Entity]
PName=SERVICE_CONFIGS
@@ -532,7 +913,7 @@ Comment=
TableOption=
Page=MAIN
Left=1600
-Top=200
+Top=100
Field="サービス名","SERVICE_NAME","@VARCHAR(64)","NOT NULL",0,"","",$FFFFFFFF,""
Field="表示名","SERVICE_LABEL","@VARCHAR(24)","NOT NULL",,"","",$FFFFFFFF,""
Field="アイコン文字列","SERVICE_ICON","@VARCHAR(24)","NOT NULL",,"","",$FFFFFFFF,""
@@ -541,7 +922,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20170131001923
-Position="MAIN",1600,200
+Position="MAIN",1600,100
[Entity]
PName=PINS
@@ -549,8 +930,8 @@ LName=ピン
Comment=
TableOption=
Page=MAIN
-Left=50
-Top=1900
+Left=700
+Top=2700
Field="NO","NO","serial","NOT NULL",0,"","",$FFFFFFFF,""
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",,"","",$FFFFFFFF,""
Field="行ID","ROW_ID","@VARCHAR(64)",,,"","",$FFFFFFFF,""
@@ -559,7 +940,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20161206105257
-Position="MAIN",50,1900
+Position="MAIN",700,2700
[Relation]
Entity1=WEBHOOK_CONFIGS
@@ -570,7 +951,7 @@ Fields1=HOOK_ID
Fields2=HOOK
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,4124,4194,3050,R,R
+Position="MAIN",0,4124,4194,3971,R,R
Dependence=0
Caption=
PName=
@@ -578,7 +959,7 @@ ModifiedDateTime=20161206104307
LineMode=0
Bar1=412
Bar2=419
-Bar3=305
+Bar3=397
TermPos1=R
TermPos2=R
@@ -589,7 +970,7 @@ Comment=
TableOption=
Page=MAIN
Left=50
-Top=2250
+Top=2700
Field="WEBHOOK ID","WEBHOOK_ID","@VARCHAR(64)","NOT NULL",0,"","",$FFFFFFFF,""
Field="ステータス","STATUS","@INT","NOT NULL",,"","",$FFFFFFFF,""
Field="HOOK","HOOK","@VARCHAR(20)",,,"","",$FFFFFFFF,""
@@ -599,7 +980,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20161206105158
-Position="MAIN",50,2250
+Position="MAIN",50,2700
[Entity]
PName=WEBHOOK_CONFIGS
@@ -607,8 +988,8 @@ LName=Webhook 設定
Comment=
TableOption=
Page=MAIN
-Left=50
-Top=2050
+Left=100
+Top=2500
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,""
@@ -616,7 +997,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20161206103902
-Position="MAIN",50,2050
+Position="MAIN",100,2500
[Relation]
Entity1=DRAFT_KNOWLEDGES
@@ -686,7 +1067,7 @@ Comment=
TableOption=
Page=MAIN
Left=1600
-Top=750
+Top=700
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,""
@@ -696,7 +1077,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20161118154223
-Position="MAIN",1600,750
+Position="MAIN",1600,700
[Entity]
PName=DRAFT_KNOWLEDGES
@@ -727,8 +1108,8 @@ LName=メールから投稿
Comment=
TableOption=
Page=MAIN
-Left=2950
-Top=350
+Left=2250
+Top=300
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,""
@@ -737,7 +1118,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20160611082117
-Position="MAIN",2950,350
+Position="MAIN",2250,300
[Relation]
Entity1=MAIL_HOOKS
@@ -766,8 +1147,8 @@ LName=メールから投稿する条件
Comment=
TableOption=
Page=MAIN
-Left=2300
-Top=350
+Left=3400
+Top=2050
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,""
@@ -784,7 +1165,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20160720194529
-Position="MAIN",2300,350
+Position="MAIN",3400,2050
[Entity]
PName=MAIL_HOOKS
@@ -792,8 +1173,8 @@ LName=受信したメールからの処理
Comment=
TableOption=
Page=MAIN
-Left=2300
-Top=50
+Left=3400
+Top=1750
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,""
@@ -806,7 +1187,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20160603171116
-Position="MAIN",2300,50
+Position="MAIN",3400,1750
[Relation]
Entity1=STOCKS
@@ -817,7 +1198,7 @@ Fields1=STOCK_ID
Fields2=STOCK_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,4450,5090,4490,R,R
+Position="MAIN",0,4450,5090,5933,R,R
Dependence=1
Caption=
PName=
@@ -825,7 +1206,7 @@ ModifiedDateTime=20150910042933
LineMode=0
Bar1=445
Bar2=509
-Bar3=449
+Bar3=593
TermPos1=R
TermPos2=R
@@ -835,8 +1216,8 @@ LName=ストック
Comment=
TableOption=
Page=MAIN
-Left=50
-Top=1550
+Left=100
+Top=2250
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,""
@@ -845,7 +1226,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20150910042830
-Position="MAIN",50,1550
+Position="MAIN",100,2250
[Relation]
Entity1=TEMPLATE_ITEMS
@@ -935,7 +1316,7 @@ Comment=
TableOption=
Page=MAIN
Left=950
-Top=300
+Top=100
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,""
@@ -945,7 +1326,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20150910041119
-Position="MAIN",950,300,542,135
+Position="MAIN",950,100,542,135
[Relation]
Entity1=TEMPLATE_MASTERS
@@ -956,7 +1337,7 @@ Fields1=TYPE_ID
Fields2=TYPE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,4460,6903,3568,R,R
+Position="MAIN",0,4460,6903,3717,R,R
Dependence=1
Caption=
PName=
@@ -964,7 +1345,7 @@ ModifiedDateTime=20150910034230
LineMode=0
Bar1=446
Bar2=690
-Bar3=357
+Bar3=372
TermPos1=R
TermPos2=R
@@ -977,14 +1358,14 @@ Fields1=TYPE_ID
Fields2=TYPE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,3334,5475,2219,R,R
+Position="MAIN",0,3334,5475,2295,R,R
Dependence=0
Caption=
PName=
LineMode=0
Bar1=333
Bar2=548
-Bar3=222
+Bar3=230
TermPos1=R
TermPos2=R
@@ -1000,10 +1381,11 @@ Field="テンプレートの種類ID","TYPE_ID","serial","NOT NULL",0,"","",$FFF
Field="テンプレート名","TYPE_NAME","@VARCHAR(256)","NOT NULL",,"","",$FFFFFFFF,""
Field="アイコン","TYPE_ICON","@VARCHAR(64)",,,"","",$FFFFFFFF,""
Field="説明","DESCRIPTION","@VARCHAR(1024)",,,"","",$FFFFFFFF,""
+Field="本文の初期値","INITIAL_VALUE","text",,,"","",$FFFFFFFF,""
EffectMode=None
Color=$000000
BkColor=$FFFFFF
-ModifiedDateTime=20150912014311
+ModifiedDateTime=20170915171119
Position="MAIN",650,550
[Entity]
@@ -1013,17 +1395,18 @@ Comment=
TableOption=
Page=MAIN
Left=1350
-Top=550
+Top=450
Field="テンプレートの種類ID","TYPE_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,""
Field="項目NO","ITEM_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,""
Field="項目名","ITEM_NAME","@VARCHAR(32)","NOT NULL",,"","",$FFFFFFFF,""
Field="項目の種類","ITEM_TYPE","@INT","NOT NULL",,"","",$FFFFFFFF,""
Field="説明","DESCRIPTION","@VARCHAR(1024)",,,"","",$FFFFFFFF,""
+Field="初期値","INITIAL_VALUE","text",,,"","",$FFFFFFFF,""
EffectMode=None
Color=$000000
BkColor=$FFFFFF
-ModifiedDateTime=20151027035632
-Position="MAIN",1350,550
+ModifiedDateTime=20170915171315
+Position="MAIN",1350,450
[Relation]
Entity1=KNOWLEDGES
@@ -1034,13 +1417,13 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",3,8366,5077,5634,R,R
+Position="MAIN",3,1165,5077,5634,R,R
Dependence=1
Caption=
PName=
ModifiedDateTime=20161206103019
LineMode=3
-Bar1=837
+Bar1=116
Bar2=508
Bar3=563
TermPos1=R
@@ -1052,15 +1435,15 @@ LName=編集可能なグループ
Comment=
TableOption=
Page=MAIN
-Left=650
-Top=1900
+Left=150
+Top=1800
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",650,1900
+Position="MAIN",150,1800
[Relation]
Entity1=KNOWLEDGES
@@ -1071,13 +1454,13 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",3,7515,3356,9481,R,R
+Position="MAIN",3,500,3356,9481,R,R
Dependence=1
Caption=
PName=
ModifiedDateTime=20170307155611
LineMode=3
-Bar1=752
+Bar1=50
Bar2=336
Bar3=948
TermPos1=R
@@ -1089,15 +1472,15 @@ LName=編集可能なユーザ
Comment=
TableOption=
Page=MAIN
-Left=650
-Top=1800
+Left=150
+Top=1700
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",650,1800
+Position="MAIN",150,1700
[Relation]
Entity1=KNOWLEDGES
@@ -1108,7 +1491,7 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,5026,7091,5584,R,R
+Position="MAIN",0,5026,7091,6103,R,R
Dependence=1
Caption=
PName=
@@ -1116,7 +1499,7 @@ ModifiedDateTime=20150910041644
LineMode=0
Bar1=503
Bar2=709
-Bar3=558
+Bar3=610
TermPos1=R
TermPos2=R
@@ -1127,7 +1510,7 @@ Comment=
TableOption=
Page=MAIN
Left=50
-Top=1100
+Top=1400
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,""
Field="履歴番号","HISTORY_NO","@INT","NOT NULL",1,"","",$FFFFFFFF,""
Field="タイトル","TITLE","@VARCHAR(1024)","NOT NULL",,"","",$FFFFFFFF,""
@@ -1141,7 +1524,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20150507141708
-Position="MAIN",50,1100
+Position="MAIN",50,1400
[Entity]
PName=NOTIFY_QUEUES
@@ -1150,7 +1533,7 @@ Comment=
TableOption=
Page=MAIN
Left=50
-Top=500
+Top=450
Field="HASH","HASH","@VARCHAR(32)","NOT NULL",0,"","",$FFFFFFFF,""
Field="種類","TYPE","@INT","NOT NULL",,"","",$FFFFFFFF,""
Field="通知する種類のID","ID","bigint","NOT NULL",,"","",$FFFFFFFF,""
@@ -1158,7 +1541,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20150331055404
-Position="MAIN",50,500
+Position="MAIN",50,450
[Entity]
PName=NOTIFY_CONFIGS
@@ -1167,7 +1550,7 @@ Comment=
TableOption=
Page=MAIN
Left=50
-Top=140
+Top=100
Field="ユーザID","USER_ID","@INT","NOT NULL",0,"","",$FFFFFFFF,""
Field="メール通知する","NOTIFY_MAIL","@INT",,,"","",$FFFFFFFF,""
Field="デスクトップ通知する","NOTIFY_DESKTOP","@INT",,,"","",$FFFFFFFF,""
@@ -1183,7 +1566,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20150328062820
-Position="MAIN",50,140
+Position="MAIN",50,100
[Relation]
Entity1=COMMENTS
@@ -1194,14 +1577,14 @@ Fields1=COMMENT_NO
Fields2=COMMENT_NO
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,5486,4072,4707,R,R
+Position="MAIN",0,5554,4072,2816,R,R
Dependence=0
Caption=
PName=
LineMode=0
-Bar1=549
+Bar1=555
Bar2=407
-Bar3=471
+Bar3=282
TermPos1=R
TermPos2=R
@@ -1211,8 +1594,8 @@ LName=アカウントの画像
Comment=
TableOption=
Page=MAIN
-Left=900
-Top=50
+Left=3500
+Top=1300
Field="IMAGE_ID","IMAGE_ID","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,""
Field="ユーザID","USER_ID","@INT",,,"","",$FFFFFFFF,""
Field="ファイル名","FILE_NAME","@VARCHAR(256)",,,"","",$FFFFFFFF,""
@@ -1225,7 +1608,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20150416234339
-Position="MAIN",900,50
+Position="MAIN",3500,1300
[Relation]
Entity1=KNOWLEDGES
@@ -1236,14 +1619,14 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,1535,6913,5217,R,R
+Position="MAIN",0,6168,6867,1373,R,R
Dependence=0
Caption=
PName=
LineMode=0
-Bar1=154
-Bar2=691
-Bar3=522
+Bar1=617
+Bar2=687
+Bar3=137
TermPos1=R
TermPos2=R
@@ -1253,16 +1636,17 @@ LName=いいね
Comment=
TableOption=
Page=MAIN
-Left=50
-Top=650
+Left=1500
+Top=1600
Field="NO","NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,""
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",,"","",$FFFFFFFF,""
+Field="種類","LIKE_CLASS","@INT",,,"1","",$FFFFFFFF,""
Index=IDX_LIKES_KNOWLEDGE_ID=0,KNOWLEDGE_ID
EffectMode=None
Color=$000000
BkColor=$FFFFFF
-ModifiedDateTime=20150416233511
-Position="MAIN",50,650
+ModifiedDateTime=20170809123852
+Position="MAIN",1500,1600
[Relation]
Entity1=KNOWLEDGES
@@ -1291,7 +1675,7 @@ LName=コメント
Comment=
TableOption=
Page=MAIN
-Left=1600
+Left=1500
Top=1250
Field="コメント番号","COMMENT_NO","BIGSERIAL","NOT NULL",0,"","",$FFFFFFFF,""
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",,"","",$FFFFFFFF,""
@@ -1302,7 +1686,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20150910035117
-Position="MAIN",1600,1250
+Position="MAIN",1500,1250
[Relation]
Entity1=KNOWLEDGES
@@ -1313,14 +1697,14 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",3,6828,5116,5997,R,R
+Position="MAIN",2,500,6854,5997,R,R
Dependence=0
Caption=
PName=
-ModifiedDateTime=20161118152345
-LineMode=3
-Bar1=683
-Bar2=512
+ModifiedDateTime=20171002125604
+LineMode=2
+Bar1=50
+Bar2=685
Bar3=600
TermPos1=R
TermPos2=R
@@ -1332,7 +1716,7 @@ Comment=
TableOption=
Page=MAIN
Left=50
-Top=1700
+Top=600
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,""
@@ -1341,7 +1725,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20150416233659
-Position="MAIN",50,1700,435,89
+Position="MAIN",50,600,435,89
[Relation]
Entity1=KNOWLEDGES
@@ -1352,14 +1736,14 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,7005,6407,5990,R,R
+Position="MAIN",3,2678,6446,5990,R,R
Dependence=1
Caption=
PName=
-ModifiedDateTime=20141204130740
-LineMode=0
-Bar1=700
-Bar2=641
+ModifiedDateTime=20171002130417
+LineMode=3
+Bar1=268
+Bar2=645
Bar3=599
TermPos1=R
TermPos2=R
@@ -1370,17 +1754,19 @@ LName=ナレッジの参照履歴
Comment=
TableOption=
Page=MAIN
-Left=50
-Top=1400
+Left=100
+Top=2100
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,""
Index=IDX_VIEW_HISTORIES_KNOWLEDGE_ID=0,KNOWLEDGE_ID
+Index=IDX_VIEW_HISTORIES_INSERT_USER=0,INSERT_USER
+Index=IDX_VIEW_HISTORIES_KNOWLEDGE_ID_INSERT_USER=0,KNOWLEDGE_ID,INSERT_USER
EffectMode=None
Color=$000000
BkColor=$FFFFFF
-ModifiedDateTime=20150416233623
-Position="MAIN",50,1400
+ModifiedDateTime=20170705135644
+Position="MAIN",100,2100
[Relation]
Entity1=KNOWLEDGES
@@ -1391,15 +1777,15 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,2082,5725,4629,R,R
+Position="MAIN",0,3762,5725,4566,R,R
Dependence=1
Caption=
PName=
ModifiedDateTime=20150910042925
LineMode=0
-Bar1=208
+Bar1=376
Bar2=572
-Bar3=463
+Bar3=457
TermPos1=R
TermPos2=R
@@ -1409,8 +1795,8 @@ LName=ストックしたナレッジ
Comment=
TableOption=
Page=MAIN
-Left=600
-Top=1550
+Left=700
+Top=2250
Field="STOCK ID","STOCK_ID","bigint","NOT NULL",0,"","",$FFFFFFFF,""
Field="ナレッジID","KNOWLEDGE_ID","bigint","NOT NULL",1,"","",$FFFFFFFF,""
Field="コメント","COMMENT","@VARCHAR(1024)",,,"","",$FFFFFFFF,""
@@ -1418,7 +1804,7 @@ EffectMode=None
Color=$000000
BkColor=$FFFFFF
ModifiedDateTime=20150910042912
-Position="MAIN",600,1550
+Position="MAIN",700,2250
[Relation]
Entity1=KNOWLEDGES
@@ -1429,13 +1815,13 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",3,9499,4332,5676,R,R
+Position="MAIN",3,2265,4332,5676,R,R
Dependence=1
Caption=
PName=
ModifiedDateTime=20161206103135
LineMode=3
-Bar1=950
+Bar1=226
Bar2=433
Bar3=568
TermPos1=R
@@ -1447,15 +1833,15 @@ LName=アクセス可能なグループ
Comment=
TableOption=
Page=MAIN
-Left=650
-Top=2100
+Left=150
+Top=2000
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",650,2100
+Position="MAIN",150,2000
[Relation]
Entity1=KNOWLEDGES
@@ -1466,13 +1852,13 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",3,8922,5233,1847,R,R
+Position="MAIN",3,1715,5233,1847,R,R
Dependence=1
Caption=
PName=
ModifiedDateTime=20170307155631
LineMode=3
-Bar1=892
+Bar1=172
Bar2=523
Bar3=185
TermPos1=R
@@ -1484,15 +1870,15 @@ LName=アクセス可能なユーザ
Comment=
TableOption=
Page=MAIN
-Left=650
-Top=2000
+Left=150
+Top=1900
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",650,2000
+Position="MAIN",150,1900
[Relation]
Entity1=TAGS
@@ -1503,14 +1889,14 @@ Fields1=TAG_ID
Fields2=TAG_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,4552,5672,4658,R,R
+Position="MAIN",0,4552,5672,4653,R,R
Dependence=1
Caption=
PName=
LineMode=0
Bar1=455
Bar2=567
-Bar3=466
+Bar3=465
TermPos1=R
TermPos2=R
@@ -1523,12 +1909,12 @@ Fields1=KNOWLEDGE_ID
Fields2=KNOWLEDGE_ID
Cardinarity1=
Cardinarity2=
-Position="MAIN",0,2923,5592,6381,R,R
+Position="MAIN",0,4015,5592,6381,R,R
Dependence=1
Caption=
PName=
LineMode=0
-Bar1=292
+Bar1=402
Bar2=559
Bar3=638
TermPos1=R
@@ -1541,14 +1927,14 @@ Comment=
TableOption=
Page=MAIN
Left=50
-Top=950
+Top=1250
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",50,950
+Position="MAIN",50,1250,407,50
[Entity]
PName=TAGS
@@ -1557,14 +1943,14 @@ Comment=
TableOption=
Page=MAIN
Left=50
-Top=750
+Top=1100
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",50,750
+Position="MAIN",50,1100
[Relation]
Entity1=KNOWLEDGES
@@ -1626,12 +2012,14 @@ Field="タグID一覧","TAG_IDS","@VARCHAR(1024)",,,"","",$FFFFFFFF,""
Field="タグ名称一覧","TAG_NAMES","text",,,"","",$FFFFFFFF,""
Field="いいね件数","LIKE_COUNT","bigint",,,"","",$FFFFFFFF,""
Field="コメント件数","COMMENT_COUNT","@INT",,,"","",$FFFFFFFF,""
+Field="参照件数","VIEW_COUNT","bigint",,,"","",$FFFFFFFF,""
Field="テンプレートの種類ID","TYPE_ID","@INT",,,"","",$FFFFFFFF,""
Field="通知ステータス","NOTIFY_STATUS","@INT",,,"","",$FFFFFFFF,""
+Field="ポイント","POINT","@INT","NOT NULL",,"0","",$FFFFFFFF,""
EffectMode=None
Color=$000000
BkColor=$FFFFFF
-ModifiedDateTime=20161118153424
+ModifiedDateTime=20170829164715
Position="MAIN",700,1100
[Comment]
diff --git a/gulpfile.js b/gulpfile.js
index 28e36ec58..12a580126 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -14,6 +14,7 @@ gulp.task('min', function() {
.pipe(replace('href="<%= request.getContextPath() %>/css', 'href="/css'))
.pipe(replace('src="<%= request.getContextPath() %>/bower', 'src="/bower'))
.pipe(replace('src="<%= request.getContextPath() %>/js', 'src="/js'))
+ .pipe(replace('<%= request.getContextPath() %>/EasyWizard', '/EasyWizard'))
.pipe(usemin({
css: [rev],
htmlmin: [ function () {return minifyHtml({ empty: true });} ],
diff --git a/mvn-entrypoint.sh b/mvn-entrypoint.sh
new file mode 100755
index 000000000..b80c27886
--- /dev/null
+++ b/mvn-entrypoint.sh
@@ -0,0 +1,39 @@
+#! /bin/bash -eu
+
+set -o pipefail
+
+# Copy files from /usr/share/maven/ref into ${MAVEN_CONFIG}
+# So the initial ~/.m2 is set with expected content.
+# Don't override, as this is just a reference setup
+copy_reference_file() {
+ local root="${1}"
+ local f="${2%/}"
+ local logfile="${3}"
+ local rel="${f/${root}/}" # path relative to /usr/share/maven/ref/
+ echo "$f" >> "$logfile"
+ echo " $f -> $rel" >> "$logfile"
+ if [[ ! -e ${MAVEN_CONFIG}/${rel} || $f = *.override ]]
+ then
+ echo "copy $rel to ${MAVEN_CONFIG}" >> "$logfile"
+ mkdir -p "${MAVEN_CONFIG}/$(dirname "${rel}")"
+ cp -r "${f}" "${MAVEN_CONFIG}/${rel}";
+ fi;
+}
+
+copy_reference_files() {
+ local log="$MAVEN_CONFIG/copy_reference_file.log"
+
+ if (touch "${log}" > /dev/null 2>&1)
+ then
+ echo "--- Copying files at $(date)" >> "$log"
+ find /usr/share/maven/ref/ -type f -exec bash -eu -c 'copy_reference_file /usr/share/maven/ref/ "$1" "$2"' _ {} "$log" \;
+ else
+ echo "Can not write to ${log}. Wrong volume permissions? Carrying on ..."
+ fi
+}
+
+export -f copy_reference_file
+copy_reference_files
+unset MAVEN_CONFIG
+
+exec "$@"
diff --git a/package.json b/package.json
index 582d9e6cb..b62efa4e9 100644
--- a/package.json
+++ b/package.json
@@ -7,15 +7,14 @@
"url": "https://github.com/support-project/knowledge"
},
"dependencies": {
- "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"
+ "bower": "1.8.2",
+ "gulp": "3.9.1",
+ "gulp-usemin": "0.3.28",
+ "gulp-uglify": "0.3.2",
+ "gulp-minify-html": "0.1.8",
+ "gulp-minify-css": "0.3.13",
+ "gulp-rev": "7.1.2",
+ "gulp-replace": "0.5.4"
},
"devDependencies": {},
"scripts": {
diff --git a/pom.xml b/pom.xml
index 0b38d7c14..871c61cd2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.support-project
knowledge
- 1.10.0
+ 1.11.0
war
knowledge
@@ -59,7 +59,7 @@
org.support-project
web
- 1.10.0
+ 1.11.1
@@ -194,38 +194,47 @@
- org.apache.maven.plugins
- maven-war-plugin
- 2.6
-
- false
-
-
- WEB-INF/views/**/*.jsp,bower/**/*
-
-
-
-
- org.apache.maven.plugins
- maven-dependency-plugin
- 2.3
+ org.jacoco
+ jacoco-maven-plugin
+ 0.7.9
- package
- copy
+ default-prepare-agent
+
+ prepare-agent
+
+
+
+ default-report
+ prepare-package
+
+ report
+
+
+
+ default-check
+
+ check
+
-
-
- com.github.jsimone
- webapp-runner
- 8.0.33.4
- webapp-runner.jar
-
-
+
+
+ BUNDLE
+
+
+ COMPLEXITY
+ COVEREDRATIO
+ 0.01
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+ ${maven.exec.skip}
+
+
+
+ npm
+ generate-resources
+
+ npm
+
+ install
+
+
+
+
+ bower
+ generate-resources
+
+ bower
+
+ install
+
+
+
+
+ gulp
+ prepare-package
+
+ gulp
+
+ default
+
+
+
+ exec
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ 2.6
+
+ false
+
+ WEB-INF/views/**/*.jsp,bower/**/*
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+ 2.3
+
+
+ package
+ copy
+
+
+
+ com.github.jsimone
+ webapp-runner
+ 8.0.33.4
+ webapp-runner.jar
+
+
+
+
+
+
+
@@ -321,6 +408,24 @@
+
+ org.jacoco
+ jacoco-maven-plugin
+
+
+
+ report
+
+
+
+
+
+ **/gen/**
+ **/deploy/**
+
+
+
+
diff --git a/settings-docker.xml b/settings-docker.xml
new file mode 100755
index 000000000..586c587c1
--- /dev/null
+++ b/settings-docker.xml
@@ -0,0 +1,6 @@
+
+ /usr/share/maven/ref/repository
+
diff --git a/src/main/java/org/support/project/knowledge/bat/AggregateBat.java b/src/main/java/org/support/project/knowledge/bat/AggregateBat.java
new file mode 100644
index 000000000..b9070b654
--- /dev/null
+++ b/src/main/java/org/support/project/knowledge/bat/AggregateBat.java
@@ -0,0 +1,36 @@
+package org.support.project.knowledge.bat;
+
+import org.apache.commons.lang.ClassUtils;
+import org.support.project.common.log.Log;
+import org.support.project.common.log.LogFactory;
+import org.support.project.knowledge.logic.AggregateLogic;
+
+public class AggregateBat extends AbstractBat {
+ /** ログ */
+ private static final Log LOG = LogFactory.getLog(AggregateBat.class);
+
+ public static void main(String[] args) throws Exception {
+ try {
+ initLogName("AggregateBat.log");
+ configInit(ClassUtils.getShortClassName(AggregateBat.class));
+
+ AggregateBat bat = new AggregateBat();
+ bat.dbInit();
+ bat.start();
+
+ finishInfo();
+ } catch (Exception e) {
+ LOG.error("any error", e);
+ throw e;
+ }
+ }
+
+ /**
+ * 処理の実行
+ * @throws Exception Exception
+ */
+ public void start() throws Exception {
+ AggregateLogic aggregateLogic = AggregateLogic.get();
+ aggregateLogic.startAggregate();
+ }
+}
diff --git a/src/main/java/org/support/project/knowledge/bat/MailSendBat.java b/src/main/java/org/support/project/knowledge/bat/MailSendBat.java
index 3aa05dedb..d6f56a2a8 100644
--- a/src/main/java/org/support/project/knowledge/bat/MailSendBat.java
+++ b/src/main/java/org/support/project/knowledge/bat/MailSendBat.java
@@ -13,6 +13,7 @@
import org.support.project.common.log.Log;
import org.support.project.common.log.LogFactory;
import org.support.project.knowledge.logic.MailLogic;
+import org.support.project.web.dao.MailsDao;
/**
* メールの送信処理は、時間がかかるため、バッチ処理の中で処理する
@@ -54,6 +55,8 @@ public static void main(String[] args) throws Exception {
public void start() throws UnsupportedEncodingException, MessagingException, InvalidKeyException, NoSuchAlgorithmException,
NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException {
MailLogic.get().startSendMails();
+ int deletecount = MailsDao.get().physicalDeleteOnOldData();
+ LOG.info("delete old mails. [count]" + deletecount);
}
}
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 81780c874..504617199 100644
--- a/src/main/java/org/support/project/knowledge/bat/NotifyMailBat.java
+++ b/src/main/java/org/support/project/knowledge/bat/NotifyMailBat.java
@@ -9,8 +9,11 @@
import org.support.project.knowledge.dao.NotifyQueuesDao;
import org.support.project.knowledge.entity.NotifyQueuesEntity;
import org.support.project.knowledge.logic.MailEventLogic;
-import org.support.project.knowledge.logic.MailLogic;
-import org.support.project.knowledge.vo.Notify;
+import org.support.project.knowledge.logic.notification.CommentInsertNotification;
+import org.support.project.knowledge.logic.notification.CommentLikedNotification;
+import org.support.project.knowledge.logic.notification.KnowledgeUpdateNotification;
+import org.support.project.knowledge.logic.notification.LikeInsertNotification;
+import org.support.project.knowledge.logic.notification.QueueNotification;
/**
* メッセージ処理を処理する定期的なバッチプログラム
@@ -50,13 +53,15 @@ private void start() throws Exception {
NotifyQueuesDao notifyQueuesDao = NotifyQueuesDao.get();
List notifyQueuesEntities = notifyQueuesDao.selectAll();
for (NotifyQueuesEntity notifyQueuesEntity : notifyQueuesEntities) {
- if (notifyQueuesEntity.getType() == Notify.TYPE_KNOWLEDGE_INSERT
- || notifyQueuesEntity.getType() == Notify.TYPE_KNOWLEDGE_UPDATE) {
- MailLogic.get().notifyKnowledgeUpdate(notifyQueuesEntity);
- } else if (notifyQueuesEntity.getType() == Notify.TYPE_KNOWLEDGE_COMMENT) {
- MailLogic.get().notifyCommentInsert(notifyQueuesEntity);
- } else if (notifyQueuesEntity.getType() == Notify.TYPE_KNOWLEDGE_LIKE) {
- MailLogic.get().notifyLikeInsert(notifyQueuesEntity);
+ if (notifyQueuesEntity.getType() == QueueNotification.TYPE_KNOWLEDGE_INSERT
+ || notifyQueuesEntity.getType() == QueueNotification.TYPE_KNOWLEDGE_UPDATE) {
+ KnowledgeUpdateNotification.get().notify(notifyQueuesEntity);
+ } else if (notifyQueuesEntity.getType() == QueueNotification.TYPE_KNOWLEDGE_COMMENT) {
+ CommentInsertNotification.get().notify(notifyQueuesEntity);
+ } else if (notifyQueuesEntity.getType() == QueueNotification.TYPE_KNOWLEDGE_LIKE) {
+ LikeInsertNotification.get().notify(notifyQueuesEntity);
+ } else if (notifyQueuesEntity.getType() == QueueNotification.TYPE_COMMENT_LIKE) {
+ CommentLikedNotification.get().notify(notifyQueuesEntity);
}
// 通知のキューから削除
//notifyQueuesDao.delete(notifyQueuesEntity);
diff --git a/src/main/java/org/support/project/knowledge/config/AppConfig.java b/src/main/java/org/support/project/knowledge/config/AppConfig.java
index ed82a5101..3cb6fd6c7 100644
--- a/src/main/java/org/support/project/knowledge/config/AppConfig.java
+++ b/src/main/java/org/support/project/knowledge/config/AppConfig.java
@@ -22,6 +22,8 @@ public static AppConfig get() {
private boolean convSlidePath = false;
+ private boolean maintenanceMode = false;
+
/**
* @return the indexPath
@@ -71,4 +73,18 @@ public void setSlidePath(String slidePath) {
this.slidePath = slidePath;
}
+ /**
+ * @return the maintenanceMode
+ */
+ public boolean isMaintenanceMode() {
+ return maintenanceMode;
+ }
+
+ /**
+ * @param maintenanceMode the maintenanceMode to set
+ */
+ public void setMaintenanceMode(boolean maintenanceMode) {
+ this.maintenanceMode = maintenanceMode;
+ }
+
}
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 27e880533..ba27710cc 100644
--- a/src/main/java/org/support/project/knowledge/config/SystemConfig.java
+++ b/src/main/java/org/support/project/knowledge/config/SystemConfig.java
@@ -17,6 +17,8 @@ public class SystemConfig {
//public static final String KNOWLEDGE_ENV_KEY = "KNOWLEDGE_HOME";
+ public static final int SYSTEM_USER_ID = -1;
+
/** システム設定情報 */
private static ServiceConfigsEntity serviceConfigsEntity = null;
/** 言語毎のシステム設定情報 */
@@ -59,6 +61,13 @@ public class SystemConfig {
/** 全ての機能は、ログインしないとアクセス出来ない */
public static final String SYSTEM_EXPOSE_TYPE_CLOSE = "CLOSE";
+ /** いいね!の登録制限の設定キー */
+ public static final String LIKE_CONFIG = "LIKE_CONFIG";
+ /** いいね!の登録制限の値:複数回押せる */
+ public static final String LIKE_CONFIG_MANY = "MANY";
+ /** いいね!の登録制限の値:1回のみ押せる(ログイン必須) */
+ public static final String LIKE_CONFIG_ONLY_ONE = "ONLY_ONE";
+
/** UIのテーマの設定のキー */
public static final String CONFIG_KEY_THEMA = "THEMA";
/** Cookieにセットする際のキー:参照履歴 */
diff --git a/src/main/java/org/support/project/knowledge/config/UserConfig.java b/src/main/java/org/support/project/knowledge/config/UserConfig.java
new file mode 100644
index 000000000..6c50a7b75
--- /dev/null
+++ b/src/main/java/org/support/project/knowledge/config/UserConfig.java
@@ -0,0 +1,17 @@
+package org.support.project.knowledge.config;
+
+/** ユーザー設定(USER_CONFIGSテーブル)の設定キーを管理 */
+public class UserConfig {
+ public static final String REQUEST_USER_CONFIG_KEY = "REQUEST_USER_CONFIG_KEY";
+
+ public static final String DEFAULT_PUBLIC_FLAG = "DEFAULT_PUBLIC_FLAG";
+ public static final String DEFAULT_TARGET = "DEFAULT_TARGET";
+ public static final String POINT = "POINT";
+
+ public static final String TIMEZONE = "TIMEZONE";
+ public static final String TIME_ZONE_OFFSET = "TIME_ZONE_OFFSET";
+ public static final String THEMA = "THEMA";
+ public static final String HIGHLIGHT = "HIGHLIGHT";
+
+
+}
diff --git a/src/main/java/org/support/project/knowledge/control/Control.java b/src/main/java/org/support/project/knowledge/control/Control.java
index 6d7a6f147..79cf3f7ad 100644
--- a/src/main/java/org/support/project/knowledge/control/Control.java
+++ b/src/main/java/org/support/project/knowledge/control/Control.java
@@ -2,6 +2,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.TimeZone;
import javax.servlet.http.HttpServletRequest;
@@ -13,13 +14,20 @@
import org.support.project.common.log.LogFactory;
import org.support.project.common.log.LogLevel;
import org.support.project.common.util.HtmlUtils;
+import org.support.project.common.util.StringUtils;
import org.support.project.di.DI;
import org.support.project.di.Instance;
+import org.support.project.knowledge.config.UserConfig;
import org.support.project.knowledge.dao.NotifyConfigsDao;
import org.support.project.knowledge.entity.NotifyConfigsEntity;
+import org.support.project.knowledge.vo.UserConfigs;
+import org.support.project.web.bean.LoginedUser;
import org.support.project.web.boundary.ForwardBoundary;
import org.support.project.web.common.HttpUtil;
+import org.support.project.web.logic.DateConvertLogic;
+import org.support.project.web.logic.NotificationLogic;
import org.support.project.web.logic.SanitizingLogic;
+import org.support.project.web.util.JspUtil;
@DI(instance = Instance.Prototype)
public abstract class Control extends org.support.project.web.control.Control {
@@ -30,6 +38,7 @@ public abstract class Control extends org.support.project.web.control.Control {
public static final String MSG_SUCCESS = "NOTIFY_MSG_SUCCESS";
public static final String MSG_WARN = "NOTIFY_MSG_WARN";
public static final String MSG_ERROR = "NOTIFY_MSG_ERROR";
+ public static final String NOTIFY_UNREAD_COUNT = "NOTIFY_UNREAD_COUNT";
private List infos = null;
private List successes = null;
@@ -48,6 +57,19 @@ public void setRequest(HttpServletRequest request) {
request.setAttribute(MSG_SUCCESS, successes);
request.setAttribute(MSG_WARN, warns);
request.setAttribute(MSG_ERROR, errors);
+
+ // 通知の件数を取得
+ if (getLoginedUser() != null) {
+ try {
+ Integer count = NotificationLogic.get().countUnRead(getLoginUserId());
+ if (count == null) {
+ count = 0;
+ }
+ request.setAttribute(NOTIFY_UNREAD_COUNT, count);
+ } catch (Exception e) {
+ LOG.warn("Error on get user notification count. " + e.getClass().getSimpleName());
+ }
+ }
}
protected String getResource(String key) {
@@ -168,5 +190,29 @@ private boolean flagCheck(Integer check) {
}
return false;
}
+
+ protected UserConfigs getUserConfigs() {
+ UserConfigs userConfigs = (UserConfigs) getRequest().getAttribute(UserConfig.REQUEST_USER_CONFIG_KEY);
+ if (userConfigs == null) {
+ userConfigs = new UserConfigs();
+ }
+ LoginedUser login = getLoginedUser();
+ if (login != null) {
+ userConfigs.setLocale(login.getLocale());
+ } else {
+ userConfigs.setLocale(getLocale());
+ }
+
+ if (userConfigs.getTimezone().equals("UTC")) {
+ String offset = HttpUtil.getCookie(getRequest(), JspUtil.TIME_ZONE_OFFSET);
+ if (StringUtils.isInteger(offset)) {
+ int off = Integer.parseInt(offset);
+ userConfigs.setTimezoneOffset(off);
+ TimeZone zone = DateConvertLogic.get().getTimezone(getLocale(), off);
+ userConfigs.setTimezone(zone.getDisplayName());
+ }
+ }
+ return userConfigs;
+ }
}
diff --git a/src/main/java/org/support/project/knowledge/control/admin/AggregateControl.java b/src/main/java/org/support/project/knowledge/control/admin/AggregateControl.java
new file mode 100644
index 000000000..30464ea17
--- /dev/null
+++ b/src/main/java/org/support/project/knowledge/control/admin/AggregateControl.java
@@ -0,0 +1,10 @@
+package org.support.project.knowledge.control.admin;
+
+import org.support.project.di.DI;
+import org.support.project.di.Instance;
+import org.support.project.knowledge.control.Control;
+
+@DI(instance = Instance.Prototype)
+public class AggregateControl extends Control {
+
+}
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 8e286a968..e75525723 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
@@ -21,10 +21,12 @@
import org.support.project.web.dao.MailConfigsDao;
import org.support.project.web.dao.SystemAttributesDao;
import org.support.project.web.dao.SystemConfigsDao;
+import org.support.project.web.dao.SystemsDao;
import org.support.project.web.entity.LdapConfigsEntity;
import org.support.project.web.entity.MailConfigsEntity;
import org.support.project.web.entity.SystemAttributesEntity;
import org.support.project.web.entity.SystemConfigsEntity;
+import org.support.project.web.entity.SystemsEntity;
@DI(instance = Instance.Prototype)
public class ConfigControl extends Control {
@@ -76,8 +78,7 @@ public Boundary save() {
String type = getParam("userAddType");
String notify = getParam("userAddNotify");
// メール送信の場合、メールの設定が完了しているかチェック
- if ((type != null && type.equals(SystemConfig.USER_ADD_TYPE_VALUE_MAIL))
- || (notify != null && notify.equals(SystemConfig.USER_ADD_NOTIFY_ON))) {
+ if (type != null && type.equals(SystemConfig.USER_ADD_TYPE_VALUE_MAIL)) {
MailConfigsDao mailConfigsDao = MailConfigsDao.get();
MailConfigsEntity mailConfigsEntity = mailConfigsDao.selectOnKey(AppConfig.get().getSystemName());
if (mailConfigsEntity == null) {
@@ -135,6 +136,16 @@ public Boundary system() {
setAttribute("uploadMaxMBSize", "10"); // default
}
+ config = dao.selectOnKey(SystemConfig.LIKE_CONFIG, AppConfig.get().getSystemName());
+ if (config != null) {
+ setAttribute("like_config", config.getConfigValue());
+ }
+
+ SystemsEntity entity = SystemsDao.get().selectOnKey(AppConfig.get().getSystemName());
+ if (entity != null) {
+ setAttribute("db_version", entity.getVersion());
+ }
+
return forward("system.jsp");
}
@@ -191,7 +202,14 @@ public Boundary save_params() {
config = new SystemConfigsEntity(SystemConfig.UPLOAD_MAX_MB_SIZE, AppConfig.get().getSystemName());
config.setConfigValue(uploadMaxMBSize);
dao.save(config);
-
+
+ String like_config = getParam("like_config");
+ if (StringUtils.isNotEmpty(like_config)) {
+ config = new SystemConfigsEntity(SystemConfig.LIKE_CONFIG, AppConfig.get().getSystemName());
+ config.setConfigValue(like_config);
+ dao.save(config);
+ }
+
String successMsg = "message.success.save";
setResult(successMsg, errors);
diff --git a/src/main/java/org/support/project/knowledge/control/api/AttachControl.java b/src/main/java/org/support/project/knowledge/control/api/AttachControl.java
index 4ac6ecaf8..38fad5617 100644
--- a/src/main/java/org/support/project/knowledge/control/api/AttachControl.java
+++ b/src/main/java/org/support/project/knowledge/control/api/AttachControl.java
@@ -14,7 +14,7 @@ public class AttachControl extends ApiControl {
/** ログ */
private static final Log LOG = LogFactory.getLog(AttachControl.class);
- @Get(path="api/attachments")
+ @Get(path="api/attachments", publishToken="")
public Boundary index() {
return get();
}
diff --git a/src/main/java/org/support/project/knowledge/control/api/GroupsControl.java b/src/main/java/org/support/project/knowledge/control/api/GroupsControl.java
index 52e97db82..902dc9309 100644
--- a/src/main/java/org/support/project/knowledge/control/api/GroupsControl.java
+++ b/src/main/java/org/support/project/knowledge/control/api/GroupsControl.java
@@ -22,14 +22,13 @@
import org.support.project.web.control.ApiControl;
import org.support.project.web.control.service.Get;
import org.support.project.web.entity.GroupsEntity;
-import org.support.project.web.entity.UsersEntity;
@DI(instance = Instance.Prototype)
public class GroupsControl extends ApiControl {
/**
* List groups
*/
- @Get(path="api/groups")
+ @Get(path="api/groups", publishToken="")
public Boundary index() {
return get();
}
diff --git a/src/main/java/org/support/project/knowledge/control/api/KnowledgesControl.java b/src/main/java/org/support/project/knowledge/control/api/KnowledgesControl.java
index 5ef8d6778..e76bbb1e4 100644
--- a/src/main/java/org/support/project/knowledge/control/api/KnowledgesControl.java
+++ b/src/main/java/org/support/project/knowledge/control/api/KnowledgesControl.java
@@ -32,7 +32,7 @@ public class KnowledgesControl extends ApiControl {
/** ログ */
private static Log LOG = LogFactory.getLog(ControlManagerFilter.class);
- @Get(path="api/knowledges")
+ @Get(path="api/knowledges", publishToken="")
public Boundary index() {
return get();
}
@@ -71,7 +71,7 @@ public Boundary getSingle(String id) {
/**
* Post knowledges
*/
- @Post(path="api/knowledges", checkReferer=false)
+ @Post(path="api/knowledges", checkReferer=false, subscribeToken="")
public Boundary post() {
try {
KnowledgeDetail data = getJsonObject(KnowledgeDetail.class);
@@ -91,7 +91,7 @@ public Boundary post() {
/**
* Put knowledges
*/
- @Put(path="api/knowledges", checkReferer=false)
+ @Put(path="api/knowledges", checkReferer=false, subscribeToken="")
public Boundary put() {
try {
Long id = getPathLong();
@@ -114,7 +114,7 @@ public Boundary put() {
/**
* Delete knowledges
*/
- @Delete(path="api/knowledges", checkReferer=false)
+ @Delete(path="api/knowledges", checkReferer=false, subscribeToken="")
public Boundary delete() {
try {
Long id = getPathLong();
diff --git a/src/main/java/org/support/project/knowledge/control/api/SampleControl.java b/src/main/java/org/support/project/knowledge/control/api/SampleControl.java
index b73af7b5d..5611fb8bd 100644
--- a/src/main/java/org/support/project/knowledge/control/api/SampleControl.java
+++ b/src/main/java/org/support/project/knowledge/control/api/SampleControl.java
@@ -12,7 +12,7 @@ public class SampleControl extends Control {
/**
* サンプル
*/
- @Get(path="api/sample")
+ @Get(path="api/sample", publishToken="")
public Boundary index() {
Msg msg = new Msg("Hi, " + getLoginedUser().getLoginUser().getUserName() + ", this is api sample.");
return send(msg);
diff --git a/src/main/java/org/support/project/knowledge/control/api/UsersControl.java b/src/main/java/org/support/project/knowledge/control/api/UsersControl.java
index 0013a42fc..06f140f13 100644
--- a/src/main/java/org/support/project/knowledge/control/api/UsersControl.java
+++ b/src/main/java/org/support/project/knowledge/control/api/UsersControl.java
@@ -24,7 +24,7 @@ public class UsersControl extends ApiControl {
/**
* List users
*/
- @Get(path="api/users")
+ @Get(path="api/users", publishToken="")
public Boundary index() {
return get();
}
diff --git a/src/main/java/org/support/project/knowledge/control/open/AccountControl.java b/src/main/java/org/support/project/knowledge/control/open/AccountControl.java
index 67b1c1aa9..3208f3bf2 100644
--- a/src/main/java/org/support/project/knowledge/control/open/AccountControl.java
+++ b/src/main/java/org/support/project/knowledge/control/open/AccountControl.java
@@ -21,12 +21,18 @@
import org.support.project.knowledge.entity.AccountImagesEntity;
import org.support.project.knowledge.entity.KnowledgesEntity;
import org.support.project.knowledge.entity.TemplateMastersEntity;
+import org.support.project.knowledge.logic.AccountLogic;
import org.support.project.knowledge.logic.IdenticonLogic;
import org.support.project.knowledge.logic.KnowledgeLogic;
+import org.support.project.knowledge.logic.activity.ActivityLogic;
import org.support.project.knowledge.vo.AccountInfo;
+import org.support.project.knowledge.vo.ActivityHistory;
+import org.support.project.knowledge.vo.ContributionPointHistory;
import org.support.project.knowledge.vo.StockKnowledge;
import org.support.project.web.boundary.Boundary;
import org.support.project.web.control.service.Get;
+import org.support.project.web.dao.UsersDao;
+import org.support.project.web.entity.UsersEntity;
import org.support.project.web.exception.InvalidParamException;
@DI(instance = Instance.Prototype)
@@ -93,6 +99,7 @@ public Boundary info() throws Exception {
}
List knowledges = KnowledgeLogic.get().showKnowledgeOnUser(userId, getLoginedUser(), offset * PAGE_LIMIT, PAGE_LIMIT);
List stocks = KnowledgeLogic.get().setStockInfo(knowledges, getLoginedUser());
+ KnowledgeLogic.get().setViewed(stocks, getLoginedUser());
setAttribute("knowledges", stocks);
int previous = offset - 1;
@@ -110,7 +117,58 @@ public Boundary info() throws Exception {
}
setAttribute("templates", templates);
+ long point = AccountLogic.get().getPoint(userId);
+ setAttribute("point", point);
+
+
return forward("account.jsp");
}
+
+ @Get
+ public Boundary cp() throws Exception {
+ Integer userId = getPathInteger(-1);
+ UsersEntity account = UsersDao.get().selectOnKey(userId);
+ if (account == null) {
+ return send(HttpStatus.SC_NOT_FOUND, "NOT FOUND");
+ }
+ List list = ActivityLogic.get().getUserPointHistoriesByDate(userId, getUserConfigs());
+ return send(list);
+ }
+
+ @Get
+ public Boundary knowledge() throws Exception {
+ Integer userId = getPathInteger(-1);
+ UsersEntity account = UsersDao.get().selectOnKey(userId);
+ if (account == null) {
+ return send(HttpStatus.SC_NOT_FOUND, "NOT FOUND");
+ }
+ // そのユーザが登録したナレッジを取得
+ int offset = 0;
+ if (StringUtils.isInteger(getParam("offset"))) {
+ offset = getParam("offset", Integer.class);
+ }
+ List knowledges = KnowledgeLogic.get().showKnowledgeOnUser(userId, getLoginedUser(), offset * PAGE_LIMIT, PAGE_LIMIT);
+ List stocks = KnowledgeLogic.get().setStockInfo(knowledges, getLoginedUser());
+ KnowledgeLogic.get().setViewed(stocks, getLoginedUser());
+ return send(stocks);
+ }
+
+ @Get
+ public Boundary activity() throws Exception {
+ Integer userId = getPathInteger(-1);
+ UsersEntity account = UsersDao.get().selectOnKey(userId);
+ if (account == null) {
+ return send(HttpStatus.SC_NOT_FOUND, "NOT FOUND");
+ }
+ int limit = 20;
+ int offset = 0;
+ if (StringUtils.isInteger(getParam("offset"))) {
+ offset = getParam("offset", Integer.class);
+ }
+ List list = ActivityLogic.get().getUserPointHistoriese(userId, limit, offset, getUserConfigs());
+ setSendEscapeHtml(false);
+ return send(list);
+ }
+
}
diff --git a/src/main/java/org/support/project/knowledge/control/open/IntervalControl.java b/src/main/java/org/support/project/knowledge/control/open/IntervalControl.java
index 06449e903..855d7e708 100644
--- a/src/main/java/org/support/project/knowledge/control/open/IntervalControl.java
+++ b/src/main/java/org/support/project/knowledge/control/open/IntervalControl.java
@@ -2,14 +2,13 @@
import org.support.project.di.DI;
import org.support.project.di.Instance;
-import org.support.project.knowledge.control.Control;
import org.support.project.web.bean.Msg;
import org.support.project.web.boundary.Boundary;
import org.support.project.web.control.service.Get;
import org.support.project.web.exception.InvalidParamException;
@DI(instance = Instance.Prototype)
-public class IntervalControl extends Control {
+public class IntervalControl extends org.support.project.web.control.Control {
@Get
public Boundary access() throws InvalidParamException {
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 40ccb4300..461ff938a 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
@@ -11,6 +11,7 @@
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.DateUtils;
import org.support.project.common.util.StringUtils;
import org.support.project.di.DI;
import org.support.project.di.Instance;
@@ -23,6 +24,7 @@
import org.support.project.knowledge.dao.KnowledgeHistoriesDao;
import org.support.project.knowledge.dao.KnowledgeItemValuesDao;
import org.support.project.knowledge.dao.KnowledgesDao;
+import org.support.project.knowledge.dao.LikeCommentsDao;
import org.support.project.knowledge.dao.LikesDao;
import org.support.project.knowledge.dao.StocksDao;
import org.support.project.knowledge.dao.TagsDao;
@@ -32,6 +34,7 @@
import org.support.project.knowledge.entity.KnowledgeHistoriesEntity;
import org.support.project.knowledge.entity.KnowledgeItemValuesEntity;
import org.support.project.knowledge.entity.KnowledgesEntity;
+import org.support.project.knowledge.entity.LikeCommentsEntity;
import org.support.project.knowledge.entity.LikesEntity;
import org.support.project.knowledge.entity.StocksEntity;
import org.support.project.knowledge.entity.TagsEntity;
@@ -42,12 +45,15 @@
import org.support.project.knowledge.logic.GroupLogic;
import org.support.project.knowledge.logic.KeywordLogic;
import org.support.project.knowledge.logic.KnowledgeLogic;
+import org.support.project.knowledge.logic.LikeLogic;
import org.support.project.knowledge.logic.MarkdownLogic;
import org.support.project.knowledge.logic.TagLogic;
import org.support.project.knowledge.logic.TargetLogic;
import org.support.project.knowledge.logic.TemplateLogic;
import org.support.project.knowledge.logic.TimeZoneLogic;
import org.support.project.knowledge.logic.UploadedFileLogic;
+import org.support.project.knowledge.logic.activity.Activity;
+import org.support.project.knowledge.logic.activity.ActivityLogic;
import org.support.project.knowledge.vo.LikeCount;
import org.support.project.knowledge.vo.ListData;
import org.support.project.knowledge.vo.MarkDown;
@@ -186,18 +192,22 @@ public Boundary view() throws InvalidParamException, ParseException {
for (CommentsEntity commentsEntity : comments) {
MarkDown markDown2 = MarkdownLogic.get().markdownToHtml(commentsEntity.getComment());
commentsEntity.setComment(markDown2.getHtml());
+
+ Long likeCount = LikeCommentsDao.get().selectOnCommentNo(commentsEntity.getCommentNo());
+ commentsEntity.setLikeCount(likeCount);
}
setAttribute("comments", comments);
// 表示するグループを取得
// List groups = GroupLogic.get().selectGroupsOnKnowledgeId(knowledgeId);
- List groups = TargetLogic.get().selectTargetsOnKnowledgeId(knowledgeId);
+ List groups = TargetLogic.get().selectTargetsViewOnKnowledgeId(knowledgeId, loginedUser);
setAttribute("groups", groups);
// 編集権限
- List editors = TargetLogic.get().selectEditorsOnKnowledgeId(knowledgeId);
+ List editors = TargetLogic.get().selectEditorsViewOnKnowledgeId(knowledgeId, loginedUser);
setAttribute("editors", editors);
- boolean edit = knowledgeLogic.isEditor(loginedUser, entity, editors);
+ List editors2 = TargetLogic.get().selectEditorsOnKnowledgeId(knowledgeId);
+ boolean edit = knowledgeLogic.isEditor(loginedUser, entity, editors2);
setAttribute("edit", edit);
ArrayList knowledgeIds = new ArrayList();
@@ -210,6 +220,10 @@ public Boundary view() throws InvalidParamException, ParseException {
List stocks = StocksDao.get().selectStockOnKnowledge(entity, loginedUser);
setAttribute("stocks", stocks);
+ ActivityLogic.get().processActivity(Activity.KNOWLEDGE_SHOW, getLoginedUser(), DateUtils.now(), entity);
+ long point = KnowledgesDao.get().selectPoint(entity.getKnowledgeId());
+ setAttribute("point", point);
+
return forward("view.jsp");
}
@@ -310,7 +324,7 @@ public Boundary list() throws Exception {
// ログインユーザ情報を最新化
// TODO 毎回最新化するのは、パフォーマンスが悪い?グループ情報が更新になった場合に、影響があるユーザの一覧を保持しておき、
// そのユーザのみを更新した方が良いかも。いったんは、ナレッジの一覧を表示する際に、毎回更新してみる(それほど負荷が高くなさそうなので)
- super.updateLoginInfo();
+ updateLoginInfo();
// 共通処理呼の表示条件の保持の呼び出し
setViewParam();
@@ -470,6 +484,7 @@ public Boundary list() throws Exception {
}
List stocks = knowledgeLogic.setStockInfo(knowledges, loginedUser);
+ KnowledgeLogic.get().setViewed(stocks, getLoginedUser());
setAttribute("knowledges", stocks);
LOG.trace("検索終了");
@@ -489,7 +504,7 @@ public Boundary list() throws Exception {
}
/**
- * 閲覧履歴の表示
+ * イベント一覧
*
* @return
* @throws InvalidParamException
@@ -516,6 +531,7 @@ public Boundary events() throws InvalidParamException {
Participations participations = EventsLogic.get().isParticipation(stock.getKnowledgeId(), getLoginUserId());
stock.setParticipations(participations);
}
+ KnowledgeLogic.get().setViewed(stocks, getLoginedUser());
setAttribute("knowledges", stocks);
} catch (java.text.ParseException e) {
return sendError(HttpStatus.SC_400_BAD_REQUEST, "BAD REQUEST");
@@ -561,6 +577,7 @@ public Boundary show_history() throws InvalidParamException {
}
List histories = knowledgeLogic.getKnowledges(historyIds, loginedUser);
List stocks = knowledgeLogic.setStockInfo(histories, loginedUser);
+ KnowledgeLogic.get().setViewed(stocks, getLoginedUser());
setAttribute("histories", stocks);
LOG.trace("履歴取得完了");
@@ -585,6 +602,7 @@ public Boundary show_popularity() throws InvalidParamException {
List list = knowledgeLogic.getPopularityKnowledges(loginedUser, 0, 20);
List stocks = knowledgeLogic.setStockInfo(list, loginedUser);
+ KnowledgeLogic.get().setViewed(stocks, getLoginedUser());
setAttribute("popularities", stocks);
LOG.trace("取得完了");
// ナレッジの公開先の情報を取得
@@ -623,7 +641,7 @@ public Boundary stocks() throws InvalidParamException {
KnowledgeLogic knowledgeLogic = KnowledgeLogic.get();
List list = knowledgeLogic.getStocks(loginedUser, offset * PAGE_LIMIT, PAGE_LIMIT, stockid);
List stocks = knowledgeLogic.setStockInfo(list, loginedUser);
-// setAttribute("stocks", list);
+ KnowledgeLogic.get().setViewed(stocks, getLoginedUser());
setAttribute("popularities", stocks);
LOG.trace("取得完了");
@@ -635,27 +653,34 @@ public Boundary stocks() throws InvalidParamException {
return forward("stocks.jsp");
}
-
-
-
-
-
/**
* いいねを押下
*
* @return
* @throws InvalidParamException
*/
- @Post
+ @Post(subscribeToken="knowledge")
public Boundary like() throws InvalidParamException {
Long knowledgeId = super.getPathLong(Long.valueOf(-1));
- KnowledgeLogic knowledgeLogic = KnowledgeLogic.get();
- Long count = knowledgeLogic.addLike(knowledgeId, getLoginedUser());
+ Long count = LikeLogic.get().addLike(knowledgeId, getLoginedUser(), getLocale());
LikeCount likeCount = new LikeCount();
likeCount.setKnowledgeId(knowledgeId);
likeCount.setCount(count);
return send(likeCount);
}
+ /**
+ * コメントにイイネを押下
+ * @return
+ * @throws InvalidParamException
+ */
+ @Post(subscribeToken="knowledge")
+ public Boundary likecomment() throws InvalidParamException {
+ Long commentNo = super.getPathLong(Long.valueOf(-1));
+ Long count = LikeLogic.get().addLikeComment(commentNo, getLoginedUser(), getLocale());
+ LikeCount likeCount = new LikeCount();
+ likeCount.setCount(count);
+ return send(likeCount);
+ }
/**
* タイトルとコンテンツの危険なタグをエスケープした結果を返す
@@ -664,7 +689,7 @@ public Boundary like() throws InvalidParamException {
* @return
* @throws ParseException
*/
- @Post
+ @Post(subscribeToken = "")
public Boundary escape(KnowledgesEntity entity) throws ParseException {
super.setSendEscapeHtml(false);
entity.setTitle(sanitize(entity.getTitle()));
@@ -679,7 +704,7 @@ public Boundary escape(KnowledgesEntity entity) throws ParseException {
* @return
* @throws ParseException
*/
- @Post
+ @Post(subscribeToken = "")
public Boundary marked(KnowledgesEntity entity) throws ParseException {
super.setSendEscapeHtml(false);
entity.setTitle(sanitize(entity.getTitle()));
@@ -764,6 +789,46 @@ public Boundary likes() throws InvalidParamException {
return forward("likes.jsp");
}
+
+ /**
+ * いいねを押したユーザを一覧表示(コメントに対し)
+ *
+ * @return
+ * @throws InvalidParamException
+ */
+ @Get
+ public Boundary likecomments() throws InvalidParamException {
+ // 共通処理呼の表示条件の保持の呼び出し
+ setViewParam();
+
+ Long commentNo = super.getPathLong(Long.valueOf(-1));
+ CommentsEntity comment = CommentsDao.get().selectOnKey(commentNo);
+ if (comment == null) {
+ return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND");
+ }
+ setAttribute("knowledgeId", comment.getKnowledgeId());
+ setAttribute("commentNo", comment.getKnowledgeId());
+
+ Integer page = 0;
+ String p = getParamWithDefault("page", "");
+ if (StringUtils.isInteger(p)) {
+ page = Integer.parseInt(p);
+ }
+
+ List likes = LikeCommentsDao.get().selectOnCommentNo(commentNo, page * PAGE_LIMIT, PAGE_LIMIT);
+ setAttribute("likes", likes);
+
+ int previous = page - 1;
+ if (previous < 0) {
+ previous = 0;
+ }
+ setAttribute("page", page);
+ setAttribute("previous", previous);
+ setAttribute("next", page + 1);
+
+ return forward("likes.jsp");
+ }
+
/**
* 編集履歴の表示
*
@@ -916,4 +981,5 @@ public Boundary items() throws ParseException {
return super.send(listdata);
}
+
}
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 e31a0d33c..ae41653b2 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
@@ -5,6 +5,7 @@
import java.util.List;
import org.support.project.common.bean.ValidateError;
+import org.support.project.common.util.DateUtils;
import org.support.project.common.util.StringUtils;
import org.support.project.common.validate.Validator;
import org.support.project.common.validate.ValidatorFactory;
@@ -91,7 +92,7 @@ public Boundary init() throws InvalidParamException {
return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND");
}
- long now = new Date().getTime();
+ long now = DateUtils.now().getTime();
if (now - resetsEntity.getInsertDatetime().getTime() > 1000 * 60 * 60) {
return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND");
}
@@ -113,7 +114,7 @@ public Boundary change() {
if (resetsEntity == null) {
return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND");
}
- long now = new Date().getTime();
+ long now = DateUtils.now().getTime();
if (now - resetsEntity.getInsertDatetime().getTime() > 1000 * 60 * 60) {
return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND");
}
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 7fb8e8ddf..ff1f53391 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
@@ -6,6 +6,7 @@
import org.support.project.aop.Aspect;
import org.support.project.common.bean.ValidateError;
+import org.support.project.common.util.DateUtils;
import org.support.project.common.util.StringUtils;
import org.support.project.common.validate.Validator;
import org.support.project.common.validate.ValidatorFactory;
@@ -15,7 +16,10 @@
import org.support.project.knowledge.config.AppConfig;
import org.support.project.knowledge.config.SystemConfig;
import org.support.project.knowledge.control.Control;
+import org.support.project.knowledge.logic.KnowledgeAuthenticationLogic;
import org.support.project.knowledge.logic.MailLogic;
+import org.support.project.knowledge.logic.notification.AcceptCheckUserNotification;
+import org.support.project.knowledge.logic.notification.AddUserNotification;
import org.support.project.web.bean.LoginedUser;
import org.support.project.web.boundary.Boundary;
import org.support.project.web.common.HttpStatus;
@@ -32,7 +36,6 @@
import org.support.project.web.entity.UsersEntity;
import org.support.project.web.logic.AuthenticationLogic;
import org.support.project.web.logic.UserLogic;
-import org.support.project.web.logic.impl.DefaultAuthenticationLogicImpl;
@DI(instance = Instance.Prototype)
public class SignupControl extends Control {
@@ -81,7 +84,7 @@ public Boundary save() {
ProvisionalRegistrationsDao dao = ProvisionalRegistrationsDao.get();
List check = dao.selectOnUserKey(getParam("userKey"));
if (!check.isEmpty()) {
- long now = new Date().getTime();
+ long now = DateUtils.now().getTime();
for (ProvisionalRegistrationsEntity entity : check) {
if (now - entity.getInsertDatetime().getTime() > 1000 * 60 * 60) {
// 無効なものなので、削除
@@ -116,8 +119,7 @@ public Boundary save() {
// 仮登録を行う
ProvisionalRegistrationsEntity entity = addProvisionalRegistration();
// 管理者へメール通知
- MailLogic mailLogic = MailLogic.get();
- mailLogic.sendNotifyAcceptUser(entity);
+ AcceptCheckUserNotification.get().sendNotifyAcceptUser(entity);
return forward("provisional_registration.jsp");
}
@@ -133,7 +135,7 @@ public Boundary save() {
@Aspect(advice = org.support.project.ormapping.transaction.Transaction.class)
private ProvisionalRegistrationsEntity addProvisionalRegistration() {
ProvisionalRegistrationsEntity entity = super.getParams(ProvisionalRegistrationsEntity.class);
- String id = UUID.randomUUID().toString() + "-" + new Date().getTime() + "-" + UUID.randomUUID().toString();
+ String id = UUID.randomUUID().toString() + "-" + DateUtils.now() + "-" + UUID.randomUUID().toString();
entity.setId(id);
ProvisionalRegistrationsDao dao = ProvisionalRegistrationsDao.get();
// 既に仮登録が行われたユーザ(メールアドレス)でも、再度仮登録できる
@@ -154,13 +156,12 @@ private void addUser() {
user = UserLogic.get().insert(user, roles);
setAttributeOnProperty(user);
- // 管理者へユーザが追加されたことを通知
- MailLogic mailLogic = MailLogic.get();
- mailLogic.sendNotifyAddUser(user);
+ // 管理者にユーザが追加されたことを通知
+ AddUserNotification.get().sendNotifyAddUser(user);
// ログイン処理
- AuthenticationLogic logic = Container.getComp(DefaultAuthenticationLogicImpl.class);
- logic.setSession(user.getUserKey(), getRequest());
+ AuthenticationLogic logic = Container.getComp(KnowledgeAuthenticationLogic.class);
+ logic.setSession(user.getUserKey(), getRequest(), getResponse());
}
/**
@@ -212,7 +213,7 @@ public Boundary activate() {
return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND");
}
- long now = new Date().getTime();
+ long now = DateUtils.now().getTime();
if (now - entity.getInsertDatetime().getTime() > 1000 * 60 * 60) {
return sendError(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND");
}
@@ -221,13 +222,12 @@ public Boundary activate() {
UsersEntity user = UserLogic.get().activate(entity);
// 管理者へユーザが追加されたことを通知
if (user != null) {
- MailLogic mailLogic = MailLogic.get();
- mailLogic.sendNotifyAddUser(user);
-
+ // 管理者にユーザが追加されたことを通知
+ AddUserNotification.get().sendNotifyAddUser(user);
}
// ログイン処理
- AuthenticationLogic logic = Container.getComp(DefaultAuthenticationLogicImpl.class);
- logic.setSession(entity.getUserKey(), getRequest());
+ AuthenticationLogic logic = Container.getComp(KnowledgeAuthenticationLogic.class);
+ logic.setSession(entity.getUserKey(), getRequest(), getResponse());
addMsgInfo("knowledge.signup.done");
return devolution(HttpMethod.get, "Index/index");
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 18970dab0..c58f74e8d 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
@@ -16,8 +16,10 @@
import org.support.project.di.Instance;
import org.support.project.knowledge.config.AppConfig;
import org.support.project.knowledge.config.SystemConfig;
+import org.support.project.knowledge.config.UserConfig;
import org.support.project.knowledge.control.Control;
import org.support.project.knowledge.logic.AccountLogic;
+import org.support.project.knowledge.logic.KnowledgeAuthenticationLogic;
import org.support.project.knowledge.logic.TargetLogic;
import org.support.project.knowledge.logic.UserLogicEx;
import org.support.project.knowledge.vo.UploadFile;
@@ -38,7 +40,6 @@
import org.support.project.web.entity.UsersEntity;
import org.support.project.web.exception.InvalidParamException;
import org.support.project.web.logic.AuthenticationLogic;
-import org.support.project.web.logic.impl.DefaultAuthenticationLogicImpl;
@DI(instance = Instance.Prototype)
public class AccountControl extends Control {
@@ -184,7 +185,7 @@ public Boundary delete() throws Exception {
UserLogicEx.get().withdrawal(getLoginUserId(), knowledgeRemove, HttpUtil.getLocale(getRequest()));
// セッションを破棄
- AuthenticationLogic authenticationLogic = Container.getComp(DefaultAuthenticationLogicImpl.class);
+ AuthenticationLogic authenticationLogic = Container.getComp(KnowledgeAuthenticationLogic.class);
authenticationLogic.clearSession(getRequest());
addMsgInfo("knowledge.account.delete");
@@ -315,11 +316,11 @@ public Boundary confirm_mail() throws InvalidParamException {
@Get(publishToken = "knowledge")
public Boundary targets() {
UserConfigsEntity publicFlag = UserConfigsDao.get().physicalSelectOnKey(
- "DEFAULT_PUBLIC_FLAG", AppConfig.get().getSystemName(), getLoginUserId());
+ UserConfig.DEFAULT_PUBLIC_FLAG, AppConfig.get().getSystemName(), getLoginUserId());
if (publicFlag != null) {
setAttribute("publicFlag", publicFlag.getConfigValue());
UserConfigsEntity targets = UserConfigsDao.get().physicalSelectOnKey(
- "DEFAULT_TARGET", AppConfig.get().getSystemName(), getLoginUserId());
+ UserConfig.DEFAULT_TARGET, AppConfig.get().getSystemName(), getLoginUserId());
if (targets != null) {
if (StringUtils.isNotEmpty(targets.getConfigValue())) {
String[] targetKeys = targets.getConfigValue().split(",");
@@ -336,11 +337,11 @@ public Boundary targets() {
public Boundary savetargets() {
String publicFlag = getParam("publicFlag");
String viewers = getParam("viewers");
- UserConfigsEntity publicFlagEntiry = new UserConfigsEntity("DEFAULT_PUBLIC_FLAG", AppConfig.get().getSystemName(), getLoginUserId());
+ UserConfigsEntity publicFlagEntiry = new UserConfigsEntity(UserConfig.DEFAULT_PUBLIC_FLAG, AppConfig.get().getSystemName(), getLoginUserId());
publicFlagEntiry.setConfigValue(publicFlag);
UserConfigsDao.get().save(publicFlagEntiry);
- UserConfigsEntity targetsEntity = new UserConfigsEntity("DEFAULT_TARGET", AppConfig.get().getSystemName(), getLoginUserId());
+ UserConfigsEntity targetsEntity = new UserConfigsEntity(UserConfig.DEFAULT_TARGET, AppConfig.get().getSystemName(), getLoginUserId());
targetsEntity.setConfigValue(viewers);
List results = targetsEntity.validate();
diff --git a/src/main/java/org/support/project/knowledge/control/protect/ConnectControl.java b/src/main/java/org/support/project/knowledge/control/protect/ConnectControl.java
index b5c189bef..b05664406 100644
--- a/src/main/java/org/support/project/knowledge/control/protect/ConnectControl.java
+++ b/src/main/java/org/support/project/knowledge/control/protect/ConnectControl.java
@@ -40,7 +40,7 @@ public Boundary index() {
* 指定のユーザのLdap認証設定を設定する
* @return
*/
- @Get
+ @Get(publishToken="csrf")
public Boundary config() {
String key = getParam("key");
if (StringUtils.isEmpty(key)) {
@@ -67,7 +67,7 @@ public Boundary config() {
return forward("config.jsp");
}
- @Post
+ @Post(subscribeToken="csrf")
public Boundary connect() {
String key = getParam("key");
if (StringUtils.isEmpty(key)) {
@@ -133,7 +133,7 @@ public Boundary connect() {
}
}
- @Post
+ @Post(subscribeToken="csrf")
public Boundary disconnect() {
String key = getParam("key");
if (StringUtils.isEmpty(key)) {
@@ -153,7 +153,7 @@ public Boundary disconnect() {
return index();
}
- @Post
+ @Post(subscribeToken="csrf")
public Boundary update() {
String key = getParam("key");
if (StringUtils.isEmpty(key)) {
diff --git a/src/main/java/org/support/project/knowledge/control/protect/EventControl.java b/src/main/java/org/support/project/knowledge/control/protect/EventControl.java
index c783d28e9..51cce0c80 100644
--- a/src/main/java/org/support/project/knowledge/control/protect/EventControl.java
+++ b/src/main/java/org/support/project/knowledge/control/protect/EventControl.java
@@ -1,9 +1,13 @@
package org.support.project.knowledge.control.protect;
+import org.support.project.common.util.DateUtils;
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.KnowledgesDao;
import org.support.project.knowledge.logic.EventsLogic;
+import org.support.project.knowledge.logic.activity.Activity;
+import org.support.project.knowledge.logic.activity.ActivityLogic;
import org.support.project.web.bean.LabelValue;
import org.support.project.web.boundary.Boundary;
import org.support.project.web.control.service.Delete;
@@ -18,7 +22,7 @@ public class EventControl extends Control {
* @return
* @throws InvalidParamException
*/
- @Put
+ @Put(subscribeToken = "knowledge")
public Boundary participation() throws InvalidParamException {
Long knowledgeId = getPathLong();
Boolean result = EventsLogic.get().participation(knowledgeId, getLoginUserId());
@@ -29,6 +33,10 @@ public Boundary participation() throws InvalidParamException {
} else {
labelValue.setLabel(getResource("knowledge.view.msg.wait.cansel"));
}
+
+ ActivityLogic.get().processActivity(Activity.KNOWLEDGE_EVENT_ADD, getLoginedUser(), DateUtils.now(),
+ KnowledgesDao.get().selectOnKey(knowledgeId));
+
return send(labelValue);
}
/**
@@ -36,10 +44,14 @@ public Boundary participation() throws InvalidParamException {
* @return
* @throws InvalidParamException
*/
- @Delete
+ @Delete(subscribeToken = "knowledge")
public Boundary nonparticipation() throws InvalidParamException {
Long knowledgeId = getPathLong();
EventsLogic.get().removeParticipation(knowledgeId, getLoginUserId());
+
+ ActivityLogic.get().processActivity(Activity.KNOWLEDGE_EVENT_DELETE, getLoginedUser(), DateUtils.now(),
+ KnowledgesDao.get().selectOnKey(knowledgeId));
+
return send(getResource("knowledge.view.msg.participate.delete"));
}
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 18ca6139e..2b372511a 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
@@ -16,7 +16,6 @@
import org.support.project.knowledge.logic.GroupLogic;
import org.support.project.knowledge.vo.GroupUser;
import org.support.project.knowledge.vo.StringList;
-import org.support.project.web.annotation.Auth;
import org.support.project.web.bean.LabelValue;
import org.support.project.web.bean.LoginedUser;
import org.support.project.web.bean.MessageResult;
@@ -534,13 +533,17 @@ public Boundary extractEmail() {
/**
* メールアドレスの一覧から、グループのユーザを一括登録
- * (メールアドレスの存在チェックができてしまうので、いったん管理者だけの機能にする)
* @return
*/
@Post(subscribeToken = "knowledge")
- @Auth(roles = "admin")
public Boundary addUsersOnEmail() {
Integer groupId = getParam("group", Integer.class);
+ GroupsEntity group = GroupLogic.get().getEditAbleGroup(groupId, getLoginedUser());
+ if (group == null) {
+ // 編集可能なグループが存在しない
+ return sendError(HttpStatus.SC_403_FORBIDDEN, "");
+ }
+
String emails = getParam("emails");
String[] mails = emails.split("\n");
MessageResult result = new MessageResult(MessageStatus.Success, HttpStatus.SC_200_OK, "", "");
@@ -571,10 +574,4 @@ public Boundary addUsersOnEmail() {
return send(result);
}
-
-
-
-
-
-
}
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 b030278c0..ca718c00c 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
@@ -12,12 +12,14 @@
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.DateUtils;
import org.support.project.common.util.PropertyUtil;
import org.support.project.common.util.StringUtils;
import org.support.project.di.Container;
import org.support.project.di.DI;
import org.support.project.di.Instance;
import org.support.project.knowledge.config.AppConfig;
+import org.support.project.knowledge.config.UserConfig;
import org.support.project.knowledge.control.KnowledgeControlBase;
import org.support.project.knowledge.dao.CommentsDao;
import org.support.project.knowledge.dao.DraftKnowledgesDao;
@@ -37,6 +39,8 @@
import org.support.project.knowledge.logic.TargetLogic;
import org.support.project.knowledge.logic.TemplateLogic;
import org.support.project.knowledge.logic.UploadedFileLogic;
+import org.support.project.knowledge.logic.activity.Activity;
+import org.support.project.knowledge.logic.activity.ActivityLogic;
import org.support.project.knowledge.vo.KnowledgeData;
import org.support.project.knowledge.vo.Stock;
import org.support.project.knowledge.vo.UploadFile;
@@ -100,11 +104,11 @@ public Boundary view_add() {
if (getAttribute("publicFlag") == null) {
UserConfigsEntity publicFlag = UserConfigsDao.get().physicalSelectOnKey(
- "DEFAULT_PUBLIC_FLAG", AppConfig.get().getSystemName(), getLoginUserId());
+ UserConfig.DEFAULT_PUBLIC_FLAG, AppConfig.get().getSystemName(), getLoginUserId());
if (publicFlag != null) {
setAttribute("publicFlag", publicFlag.getConfigValue());
UserConfigsEntity targets = UserConfigsDao.get().physicalSelectOnKey(
- "DEFAULT_TARGET", AppConfig.get().getSystemName(), getLoginUserId());
+ UserConfig.DEFAULT_TARGET, AppConfig.get().getSystemName(), getLoginUserId());
if (targets != null) {
if (StringUtils.isNotEmpty(targets.getConfigValue())) {
String[] targetKeys = targets.getConfigValue().split(",");
@@ -149,20 +153,21 @@ public Boundary view_edit() throws InvalidParamException {
if (draft != null) {
super.setDraftInfo(draft);
} else {
+ // 編集権限チェック
+ LoginedUser loginedUser = super.getLoginedUser();
+
// ナレッジに紐づく添付ファイルを取得
List files = fileLogic.selectOnKnowledgeIdWithoutCommentFiles(knowledgeId, getRequest().getContextPath());
setAttribute("files", files);
// 表示するグループを取得
- List groups = TargetLogic.get().selectTargetsOnKnowledgeId(knowledgeId);
+ List groups = TargetLogic.get().selectTargetsViewOnKnowledgeId(knowledgeId, loginedUser);
setAttribute("groups", groups);
// 共同編集者
- List editors = TargetLogic.get().selectEditorsOnKnowledgeId(knowledgeId);
+ List editors = TargetLogic.get().selectEditorsViewOnKnowledgeId(knowledgeId, loginedUser);
setAttribute("editors", editors);
-
- // 編集権限チェック
- LoginedUser loginedUser = super.getLoginedUser();
+
boolean edit = knowledgeLogic.isEditor(loginedUser, entity, editors);
if (!edit) {
setAttribute("edit", false);
@@ -209,7 +214,7 @@ private Boundary add(KnowledgesEntity entity) throws Exception, ParseException {
LOG.trace("save");
KnowledgesEntity insertedEntity = knowledgeLogic.insert(data, super.getLoginedUser());
-
+
return sendMsg(MessageStatus.Success, HttpStatus.SC_200_OK,
String.valueOf(insertedEntity.getKnowledgeId()), "message.success.insert");
}
@@ -278,8 +283,16 @@ private Boundary update(KnowledgesEntity entity) throws Exception {
return sendValidateError(errors);
}
+ // 明示的にユーザが、タイムラインの上にもっていきたくないと指定した
+ if ("true".equals(super.getAttribute("notUpdateTimeline", "false"))) {
+ data.setDonotUpdateTimeline(true);
+ }
if (!StringUtils.isEmpty(getParam("updateContent")) && getParam("updateContent").toLowerCase().equals("true")) {
+ // コンテンツの内容が更新されている
data.setUpdateContent(true);
+ if (!data.isDonotUpdateTimeline()) {
+ data.setNotifyUpdate(true);
+ }
LOG.debug("コンテンツを更新した");
} else {
// メタデータのみ更新
@@ -289,13 +302,12 @@ private Boundary update(KnowledgesEntity entity) throws Exception {
if (check.getPublicFlag().intValue() == KnowledgeLogic.PUBLIC_FLAG_PRIVATE &&
check.getPublicFlag().intValue() != data.getKnowledge().getPublicFlag().intValue()) {
// まだ通知を一度も出しておらず、かつ、「非公開」になっていたものを、それ以外の区分に変更した場合は、通知を出す
- data.setUpdateContent(true);
+ data.setNotifyUpdate(true);
LOG.debug("メタデータのみ更新であったが、非公開から公開などへ変更した");
}
}
}
-
-
+ // 更新実行
KnowledgesEntity updatedEntity = knowledgeLogic.update(data, super.getLoginedUser());
if (data.isUpdateContent()) {
@@ -316,6 +328,9 @@ private Boundary update(KnowledgesEntity entity) throws Exception {
@Post(subscribeToken = "knowledge", checkReqToken = true)
public Boundary save(KnowledgesEntity entity) throws Exception {
try {
+ if (entity.getPoint() == null) {
+ entity.setPoint(0); // 初期値
+ }
if (entity.getKnowledgeId() != null && entity.getKnowledgeId() >= 1) {
return update(entity);
} else {
@@ -472,12 +487,9 @@ public Boundary comment() throws Exception {
}
}
setAttribute("comment_files", files);
-
return super.devolution(HttpMethod.get, "open.Knowledge/view", String.valueOf(knowledgeId));
}
-
KnowledgeLogic.get().saveComment(knowledgeId, comment, fileNos, getLoginedUser());
-
return super.redirect(getRequest().getContextPath() + "/open.knowledge/view/" + knowledgeId + params);
}
@@ -659,6 +671,7 @@ public Boundary delete_comment() throws Exception {
}
KnowledgeLogic.get().deleteComment(db, getLoginedUser());
+
addMsgSuccess("message.success.delete.target", getResource("label.comment"));
setAttribute("comment", null);
return devolution(HttpMethod.get, "open.Knowledge/view", String.valueOf(db.getKnowledgeId()));
@@ -715,6 +728,9 @@ public Boundary stock() throws IOException, InvalidParamException {
dao.physicalDelete(entity);
}
}
+ ActivityLogic.get().processActivity(Activity.KNOWLEDGE_STOCK, getLoginedUser(), DateUtils.now(),
+ KnowledgesDao.get().selectOnKey(knowledgeId));
+
return sendMsg(MessageStatus.Success, HttpStatus.SC_200_OK, "saved", "message.success.save");
};
diff --git a/src/main/java/org/support/project/knowledge/control/protect/NotificationControl.java b/src/main/java/org/support/project/knowledge/control/protect/NotificationControl.java
new file mode 100644
index 000000000..02d22b122
--- /dev/null
+++ b/src/main/java/org/support/project/knowledge/control/protect/NotificationControl.java
@@ -0,0 +1,91 @@
+package org.support.project.knowledge.control.protect;
+
+import java.util.List;
+
+import org.support.project.knowledge.control.Control;
+import org.support.project.knowledge.logic.NotificationLogic;
+import org.support.project.web.boundary.Boundary;
+import org.support.project.web.common.HttpStatus;
+import org.support.project.web.control.service.Get;
+import org.support.project.web.control.service.Post;
+import org.support.project.web.entity.NotificationsEntity;
+import org.support.project.web.exception.InvalidParamException;
+
+public class NotificationControl extends Control {
+
+ @Get(publishToken = "knowledge")
+ public Boundary list() throws InvalidParamException {
+ int offset = getPathInteger(0);
+ boolean all = "true".equals(getAttribute("all", "false"));
+ List notifications = NotificationLogic.get().getNotification(getLoginedUser(), offset, all);
+ setAttribute("notifications", notifications);
+
+ int previous = offset - 1;
+ if (previous < 0) {
+ previous = 0;
+ }
+ setAttribute("offset", offset);
+ setAttribute("previous", previous);
+ setAttribute("next", offset + 1);
+
+ return forward("list.jsp");
+ }
+
+ @Get
+ public Boundary view() throws InvalidParamException {
+ long no = getPathLong(new Long(-1));
+ NotificationsEntity notification = NotificationLogic.get().load(no, getLoginedUser());
+ if (notification == null) {
+ return sendError(HttpStatus.SC_403_FORBIDDEN, "FORBIDDEN");
+ }
+ NotificationLogic.get().setStatus(getLoginUserId(), no, NotificationLogic.STATUS_READED);
+ notification.setStatus(NotificationLogic.STATUS_READED);
+ setAttributeOnProperty(notification);
+ setAttribute("no", no);
+ return forward("view.jsp");
+ }
+
+ @Get
+ public Boundary previous() throws InvalidParamException {
+ long no = getPathLong(new Long(-1));
+ boolean all = "true".equals(getAttribute("all", "false"));
+ NotificationsEntity notification = NotificationLogic.get().previous(no, getLoginedUser(), all);
+ if (notification == null) {
+ setAttribute("method", getResource("label.previous"));
+ setAttribute("no", no);
+ return forward("not_found.jsp");
+ }
+ no = notification.getNo();
+ NotificationLogic.get().setStatus(getLoginUserId(), no, NotificationLogic.STATUS_READED);
+ notification.setStatus(NotificationLogic.STATUS_READED);
+ setAttributeOnProperty(notification);
+ setAttribute("no", no);
+ return forward("view.jsp");
+ }
+ @Get
+ public Boundary next() throws InvalidParamException {
+ long no = getPathLong(new Long(-1));
+ boolean all = "true".equals(getAttribute("all", "false"));
+ NotificationsEntity notification = NotificationLogic.get().next(no, getLoginedUser(), all);
+ if (notification == null) {
+ setAttribute("method", getResource("label.next"));
+ setAttribute("no", no);
+ return forward("not_found.jsp");
+ }
+ no = notification.getNo();
+ NotificationLogic.get().setStatus(getLoginUserId(), no, NotificationLogic.STATUS_READED);
+ notification.setStatus(NotificationLogic.STATUS_READED);
+ setAttributeOnProperty(notification);
+ setAttribute("no", no);
+ return forward("view.jsp");
+ }
+
+ @Post(subscribeToken = "knowledge")
+ public Boundary markread() {
+ String no = getAttribute("no", "");
+ NotificationLogic.get().markAllAsRead(no, getLoginUserId());
+ return send("OK");
+ }
+
+
+}
diff --git a/src/main/java/org/support/project/knowledge/control/protect/SurveyControl.java b/src/main/java/org/support/project/knowledge/control/protect/SurveyControl.java
index afe817e91..7b5724c01 100644
--- a/src/main/java/org/support/project/knowledge/control/protect/SurveyControl.java
+++ b/src/main/java/org/support/project/knowledge/control/protect/SurveyControl.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.DateUtils;
import org.support.project.common.util.PropertyUtil;
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.admin.TemplateControl;
+import org.support.project.knowledge.dao.KnowledgesDao;
import org.support.project.knowledge.entity.ItemChoicesEntity;
import org.support.project.knowledge.entity.KnowledgesEntity;
import org.support.project.knowledge.entity.SurveyAnswersEntity;
@@ -23,7 +25,11 @@
import org.support.project.knowledge.entity.TemplateMastersEntity;
import org.support.project.knowledge.logic.KnowledgeLogic;
import org.support.project.knowledge.logic.SurveyLogic;
+import org.support.project.knowledge.logic.TargetLogic;
+import org.support.project.knowledge.logic.activity.Activity;
+import org.support.project.knowledge.logic.activity.ActivityLogic;
import org.support.project.knowledge.vo.SurveyReport;
+import org.support.project.web.bean.LabelValue;
import org.support.project.web.boundary.Boundary;
import org.support.project.web.common.HttpStatus;
import org.support.project.web.config.MessageStatus;
@@ -68,7 +74,8 @@ public Boundary save() throws InstantiationException, IllegalAccessException, JS
return sendError(HttpStatus.SC_400_BAD_REQUEST, "BAD_REQUEST");
}
KnowledgesEntity knowledge = KnowledgeLogic.get().select(knowledgeId, getLoginedUser());
- if (knowledge == null || !KnowledgeLogic.get().isEditor(super.getLoginedUser(), knowledge, null)) {
+ List editors = TargetLogic.get().selectEditorsOnKnowledgeId(knowledgeId);
+ if (knowledge == null || !KnowledgeLogic.get().isEditor(super.getLoginedUser(), knowledge, editors)) {
return sendError(HttpStatus.SC_403_FORBIDDEN, "FORBIDDEN");
}
// テンプレートと同じ構造にしているが、アンケートに変換して保存する
@@ -133,12 +140,24 @@ public Boundary list() throws InvalidParamException {
* @return
* @throws InvalidParamException
*/
- @Get
+ @Get(publishToken = "survey")
public Boundary load() throws InvalidParamException {
Long id = super.getPathLong(new Long(-1));
SurveysEntity entity = SurveyLogic.get().loadSurvey(id, getLoginUserId());
if (entity == null) {
- return sendError(404, null);
+ entity = new SurveysEntity();
+ entity.setDescription("");
+ entity.setItems(new ArrayList<>());
+ entity.setExist(false);
+ } else {
+ entity.setExist(true);
+ }
+ KnowledgesEntity knowledge = KnowledgeLogic.get().select(id, getLoginedUser());
+ List editors = TargetLogic.get().selectEditorsOnKnowledgeId(id);
+ if (knowledge != null && KnowledgeLogic.get().isEditor(super.getLoginedUser(), knowledge, editors)) {
+ entity.setEditable(true);
+ } else {
+ entity.setEditable(false);
}
return send(entity);
}
@@ -148,7 +167,7 @@ public Boundary load() throws InvalidParamException {
* @return
* @throws InvalidParamException
*/
- @Delete
+ @Delete(subscribeToken = "survey")
public Boundary delete() throws InvalidParamException {
Long id = super.getPathLong(new Long(-1));
SurveyLogic.get().deleteSurvey(id);
@@ -167,7 +186,7 @@ public Boundary delete() throws InvalidParamException {
* @throws IllegalAccessException
* @throws InstantiationException
*/
- @Post(subscribeToken = "knowledge", checkReqToken = true)
+ @Post(subscribeToken = "survey", checkReqToken = true)
public Boundary answer() throws InstantiationException, IllegalAccessException, JSONException, IOException, InvalidParamException {
String id = getParam("knowledgeId");
if (!StringUtils.isLong(id)) {
@@ -222,6 +241,8 @@ public Boundary answer() throws InstantiationException, IllegalAccessException,
LOG.debug(PropertyUtil.reflectionToString(answer));
}
SurveyLogic.get().saveAnswer(answer, getLoginUserId());
+ ActivityLogic.get().processActivity(Activity.KNOWLEDGE_ANSWER, getLoginedUser(), DateUtils.now(),
+ KnowledgesDao.get().selectOnKey(knowledgeId));
// メッセージ送信
return sendMsg(MessageStatus.Success, HttpStatus.SC_200_OK, "saved", "message.success.save");
diff --git a/src/main/java/org/support/project/knowledge/control/protect/TokenControl.java b/src/main/java/org/support/project/knowledge/control/protect/TokenControl.java
index 53a7734ea..83ae702e0 100644
--- a/src/main/java/org/support/project/knowledge/control/protect/TokenControl.java
+++ b/src/main/java/org/support/project/knowledge/control/protect/TokenControl.java
@@ -8,7 +8,6 @@
import org.support.project.common.log.Log;
import org.support.project.common.log.LogFactory;
-import org.support.project.common.util.DateUtils;
import org.support.project.common.util.RandomUtil;
import org.support.project.common.util.StringUtils;
import org.support.project.di.DI;
@@ -33,8 +32,9 @@ private DateFormat gateDayFormat() {
/**
* 現在のTokenの状態を見る
*/
- @Get
+ @Get(publishToken = "csrf")
public Boundary index() {
+ LOG.trace("access to index");
String expires = "";
TokensEntity entity = TokensDao.get().selectOnUserId(getLoginUserId());
if (entity == null) {
@@ -52,8 +52,9 @@ public Boundary index() {
/**
* Tokenの発行/更新
*/
- @Post
+ @Post(subscribeToken = "csrf")
public Boundary save() {
+ LOG.trace("access to save");
String expires = getParam("expires");
if (StringUtils.isEmpty(expires)) {
expires = "9999-12-31";
@@ -80,7 +81,7 @@ public Boundary save() {
/**
* Tokenの削除
*/
- @Post
+ @Post(subscribeToken = "csrf")
public Boundary delete() {
TokensEntity entity = TokensDao.get().selectOnUserId(getLoginUserId());
if (entity != null) {
diff --git a/src/main/java/org/support/project/knowledge/dao/AccountImagesDao.java b/src/main/java/org/support/project/knowledge/dao/AccountImagesDao.java
index 8a7111e71..6f24511f7 100644
--- a/src/main/java/org/support/project/knowledge/dao/AccountImagesDao.java
+++ b/src/main/java/org/support/project/knowledge/dao/AccountImagesDao.java
@@ -1,5 +1,6 @@
package org.support.project.knowledge.dao;
+import org.support.project.aop.Aspect;
import org.support.project.di.Container;
import org.support.project.di.DI;
import org.support.project.di.Instance;
@@ -24,6 +25,7 @@ public static AccountImagesDao get() {
return Container.getComp(AccountImagesDao.class);
}
+ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class)
public AccountImagesEntity selectOnUserId(Integer userId) {
String sql = "SELECT * FROM ACCOUNT_IMAGES WHERE USER_ID = ?";
return executeQuerySingle(sql, AccountImagesEntity.class, userId);
diff --git a/src/main/java/org/support/project/knowledge/dao/ActivitiesDao.java b/src/main/java/org/support/project/knowledge/dao/ActivitiesDao.java
new file mode 100644
index 000000000..57fa54746
--- /dev/null
+++ b/src/main/java/org/support/project/knowledge/dao/ActivitiesDao.java
@@ -0,0 +1,96 @@
+package org.support.project.knowledge.dao;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.support.project.aop.Aspect;
+import org.support.project.common.log.Log;
+import org.support.project.common.log.LogFactory;
+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.GenActivitiesDao;
+import org.support.project.knowledge.entity.ActivitiesEntity;
+
+/**
+ * アクティビティ
+ */
+@DI(instance = Instance.Singleton)
+public class ActivitiesDao extends GenActivitiesDao {
+ /** ログ */
+ private static final Log LOG = LogFactory.getLog(ActivitiesDao.class);
+
+ /** SerialVersion */
+ private static final long serialVersionUID = 1L;
+ /**
+ * Get instance from DI container.
+ * @return instance
+ */
+ public static ActivitiesDao get() {
+ return Container.getComp(ActivitiesDao.class);
+ }
+ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class)
+ public ActivitiesEntity select(int userId, int type, String target) {
+ String sql = "SELECT * FROM ACTIVITIES WHERE USER_ID = ? AND KIND = ? AND TARGET = ?";
+ return executeQuerySingle(sql, ActivitiesEntity.class, userId, type, target);
+ }
+ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class)
+ public List selectOnNos(List activityNos) {
+ StringBuilder sql = new StringBuilder();
+ sql.append("SELECT *, USERS.USER_NAME FROM ACTIVITIES INNER JOIN USERS ON (ACTIVITIES.USER_ID = USERS.USER_ID) ");
+ sql.append("WHERE ACTIVITY_NO IN (");
+ boolean appended = false;
+ for (@SuppressWarnings("unused") Long no : activityNos) {
+ if (appended) {
+ sql.append(", ");
+ }
+ sql.append("?");
+ appended = true;
+ }
+ sql.append(");");
+ return executeQueryList(sql.toString(), ActivitiesEntity.class, activityNos.toArray(new Object[0]));
+ }
+
+ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class)
+ public ActivitiesEntity selectBefore(Integer userId, String target, int... kinds) {
+ StringBuilder sql = new StringBuilder();
+ List