Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
b8e6ccc6
C
cat
项目概览
梦中观雨
/
cat
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b8e6ccc6
编写于
4月 02, 2014
作者:
J
jialinsun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
complete homework, just test, ignore it.
上级
11461d3e
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
667 addition
and
11 deletion
+667
-11
cat-home/pom.xml
cat-home/pom.xml
+3
-1
cat-home/src/main/java/com/dianping/cat/build/CatDatabaseConfigurator.java
.../java/com/dianping/cat/build/CatDatabaseConfigurator.java
+2
-0
cat-home/src/main/java/com/dianping/cat/build/UserDatabaseConfigurator.java
...java/com/dianping/cat/build/UserDatabaseConfigurator.java
+2
-0
cat-home/src/main/java/com/dianping/cat/report/ReportModule.java
...e/src/main/java/com/dianping/cat/report/ReportModule.java
+3
-1
cat-home/src/main/java/com/dianping/cat/report/ReportPage.java
...ome/src/main/java/com/dianping/cat/report/ReportPage.java
+4
-2
cat-home/src/main/java/com/dianping/cat/report/page/test/Action.java
...c/main/java/com/dianping/cat/report/page/test/Action.java
+27
-0
cat-home/src/main/java/com/dianping/cat/report/page/test/Context.java
.../main/java/com/dianping/cat/report/page/test/Context.java
+7
-0
cat-home/src/main/java/com/dianping/cat/report/page/test/Handler.java
.../main/java/com/dianping/cat/report/page/test/Handler.java
+74
-0
cat-home/src/main/java/com/dianping/cat/report/page/test/JspFile.java
.../main/java/com/dianping/cat/report/page/test/JspFile.java
+16
-0
cat-home/src/main/java/com/dianping/cat/report/page/test/JspViewer.java
...ain/java/com/dianping/cat/report/page/test/JspViewer.java
+20
-0
cat-home/src/main/java/com/dianping/cat/report/page/test/Model.java
...rc/main/java/com/dianping/cat/report/page/test/Model.java
+46
-0
cat-home/src/main/java/com/dianping/cat/report/page/test/Payload.java
.../main/java/com/dianping/cat/report/page/test/Payload.java
+51
-0
cat-home/src/main/java/com/dianping/cat/report/page/test/testModelXml.java
.../java/com/dianping/cat/report/page/test/testModelXml.java
+114
-0
cat-home/src/main/resources/META-INF/dal/jdbc/report-codegen.xml
...e/src/main/resources/META-INF/dal/jdbc/report-codegen.xml
+37
-1
cat-home/src/main/resources/META-INF/dal/jdbc/report-dal.xml
cat-home/src/main/resources/META-INF/dal/jdbc/report-dal.xml
+40
-0
cat-home/src/main/resources/META-INF/dal/model/animal-codegen.xml
.../src/main/resources/META-INF/dal/model/animal-codegen.xml
+28
-0
cat-home/src/main/resources/META-INF/dal/model/animal-manifest.xml
...src/main/resources/META-INF/dal/model/animal-manifest.xml
+6
-0
cat-home/src/main/resources/META-INF/dal/model/animal-model.xml
...me/src/main/resources/META-INF/dal/model/animal-model.xml
+28
-0
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+97
-0
cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml
cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml
+3
-2
cat-home/src/main/resources/META-INF/wizard/model/wizard.xml
cat-home/src/main/resources/META-INF/wizard/model/wizard.xml
+3
-0
cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
...home/src/main/resources/META-INF/wizard/webapp/wizard.xml
+4
-1
cat-home/src/main/webapp/jsp/report/alteration.jsp
cat-home/src/main/webapp/jsp/report/alteration.jsp
+5
-0
cat-home/src/main/webapp/jsp/report/test.jsp
cat-home/src/main/webapp/jsp/report/test.jsp
+5
-0
cat-home/src/main/webapp/jsp/report/test2.jsp
cat-home/src/main/webapp/jsp/report/test2.jsp
+5
-0
cat-home/test.xml
cat-home/test.xml
+17
-0
script/Cat.sql
script/Cat.sql
+3
-3
test.xml
test.xml
+17
-0
未找到文件。
cat-home/pom.xml
浏览文件 @
b8e6ccc6
...
@@ -160,7 +160,9 @@
...
@@ -160,7 +160,9 @@
${basedir}/src/main/resources/META-INF/dal/model/utilization-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/utilization-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/utilization-config-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/utilization-config-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/domainGroup-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/domainGroup-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/metric-group-config-manifest.xml,
</manifest>
${basedir}/src/main/resources/META-INF/dal/model/metric-group-config-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/animal-manifest.xml,
</manifest>
</configuration>
</configuration>
</execution>
</execution>
<execution>
<execution>
...
...
cat-home/src/main/java/com/dianping/cat/build/CatDatabaseConfigurator.java
浏览文件 @
b8e6ccc6
...
@@ -11,6 +11,8 @@ final class CatDatabaseConfigurator extends AbstractJdbcResourceConfigurator {
...
@@ -11,6 +11,8 @@ final class CatDatabaseConfigurator extends AbstractJdbcResourceConfigurator {
public
List
<
Component
>
defineComponents
()
{
public
List
<
Component
>
defineComponents
()
{
List
<
Component
>
all
=
new
ArrayList
<
Component
>();
List
<
Component
>
all
=
new
ArrayList
<
Component
>();
all
.
add
(
defineJdbcDataSourceComponent
(
"cat"
,
"com.mysql.jdbc.Driver"
,
"jdbc:mysql://127.0.0.1:3306/cat"
,
"test"
,
"123"
,
"<![CDATA[useUnicode=true&autoReconnect=true]]>"
));
defineSimpleTableProviderComponents
(
all
,
"cat"
,
com
.
dianping
.
cat
.
home
.
dal
.
report
.
_INDEX
.
getEntityClasses
());
defineSimpleTableProviderComponents
(
all
,
"cat"
,
com
.
dianping
.
cat
.
home
.
dal
.
report
.
_INDEX
.
getEntityClasses
());
defineDaoComponents
(
all
,
com
.
dianping
.
cat
.
home
.
dal
.
report
.
_INDEX
.
getDaoClasses
());
defineDaoComponents
(
all
,
com
.
dianping
.
cat
.
home
.
dal
.
report
.
_INDEX
.
getDaoClasses
());
...
...
cat-home/src/main/java/com/dianping/cat/build/UserDatabaseConfigurator.java
浏览文件 @
b8e6ccc6
...
@@ -11,6 +11,8 @@ final class UserDatabaseConfigurator extends AbstractJdbcResourceConfigurator {
...
@@ -11,6 +11,8 @@ final class UserDatabaseConfigurator extends AbstractJdbcResourceConfigurator {
public
List
<
Component
>
defineComponents
()
{
public
List
<
Component
>
defineComponents
()
{
List
<
Component
>
all
=
new
ArrayList
<
Component
>();
List
<
Component
>
all
=
new
ArrayList
<
Component
>();
all
.
add
(
defineJdbcDataSourceComponent
(
"user"
,
"com.mysql.jdbc.Driver"
,
"jdbc:mysql://192.168.8.44:3306/hawk"
,
"hawk"
,
"hawk"
,
"<![CDATA[useUnicode=true&autoReconnect=true]]>"
));
defineSimpleTableProviderComponents
(
all
,
"user"
,
com
.
dianping
.
cat
.
home
.
dal
.
user
.
_INDEX
.
getEntityClasses
());
defineSimpleTableProviderComponents
(
all
,
"user"
,
com
.
dianping
.
cat
.
home
.
dal
.
user
.
_INDEX
.
getEntityClasses
());
defineDaoComponents
(
all
,
com
.
dianping
.
cat
.
home
.
dal
.
user
.
_INDEX
.
getDaoClasses
());
defineDaoComponents
(
all
,
com
.
dianping
.
cat
.
home
.
dal
.
user
.
_INDEX
.
getDaoClasses
());
...
...
cat-home/src/main/java/com/dianping/cat/report/ReportModule.java
浏览文件 @
b8e6ccc6
...
@@ -45,7 +45,9 @@ com.dianping.cat.report.page.statistics.Handler.class,
...
@@ -45,7 +45,9 @@ com.dianping.cat.report.page.statistics.Handler.class,
com
.
dianping
.
cat
.
report
.
page
.
alteration
.
Handler
.
class
,
com
.
dianping
.
cat
.
report
.
page
.
alteration
.
Handler
.
class
,
com
.
dianping
.
cat
.
report
.
page
.
monitor
.
Handler
.
class
com
.
dianping
.
cat
.
report
.
page
.
monitor
.
Handler
.
class
,
com
.
dianping
.
cat
.
report
.
page
.
test
.
Handler
.
class
})
})
public
class
ReportModule
extends
AbstractModule
{
public
class
ReportModule
extends
AbstractModule
{
...
...
cat-home/src/main/java/com/dianping/cat/report/ReportPage.java
浏览文件 @
b8e6ccc6
...
@@ -41,10 +41,12 @@ public enum ReportPage implements Page {
...
@@ -41,10 +41,12 @@ public enum ReportPage implements Page {
STATISTICS
(
"statistics"
,
"statistics"
,
"Statistics"
,
"Statistics"
,
true
),
STATISTICS
(
"statistics"
,
"statistics"
,
"Statistics"
,
"Statistics"
,
true
),
ALTERATION
(
"alteration"
,
"alteration"
,
"Alteration"
,
"Alteration"
,
true
),
MONITOR
(
"monitor"
,
"monitor"
,
"Monitor"
,
"Monitor"
,
true
),
MONITOR
(
"monitor"
,
"monitor"
,
"Monitor"
,
"Monitor"
,
true
),
ALTERATION
(
"alteration"
,
"alteration"
,
"Alteration"
,
"Alteration
"
,
true
);
TEST
(
"test"
,
"test"
,
"Test"
,
"Test
"
,
true
);
private
String
m_name
;
private
String
m_name
;
private
String
m_path
;
private
String
m_path
;
...
...
cat-home/src/main/java/com/dianping/cat/report/page/test/Action.java
0 → 100644
浏览文件 @
b8e6ccc6
package
com.dianping.cat.report.page.test
;
public
enum
Action
implements
org
.
unidal
.
web
.
mvc
.
Action
{
INSERT
(
"insert"
),
QUERY
(
"query"
);
private
String
m_name
;
private
Action
(
String
name
)
{
m_name
=
name
;
}
public
static
Action
getByName
(
String
name
,
Action
defaultAction
)
{
for
(
Action
action
:
Action
.
values
())
{
if
(
action
.
getName
().
equals
(
name
))
{
return
action
;
}
}
return
defaultAction
;
}
@Override
public
String
getName
()
{
return
m_name
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/test/Context.java
0 → 100644
浏览文件 @
b8e6ccc6
package
com.dianping.cat.report.page.test
;
import
com.dianping.cat.report.ReportContext
;
public
class
Context
extends
ReportContext
<
Payload
>
{
}
cat-home/src/main/java/com/dianping/cat/report/page/test/Handler.java
0 → 100644
浏览文件 @
b8e6ccc6
package
com.dianping.cat.report.page.test
;
import
java.io.IOException
;
import
java.util.List
;
import
javax.servlet.ServletException
;
import
com.dianping.cat.home.dal.report.Test
;
import
com.dianping.cat.home.dal.report.TestDao
;
import
com.dianping.cat.home.dal.report.TestEntity
;
import
com.dianping.cat.report.ReportPage
;
import
org.unidal.dal.jdbc.DalException
;
import
org.unidal.lookup.annotation.Inject
;
import
org.unidal.web.mvc.PageHandler
;
import
org.unidal.web.mvc.annotation.InboundActionMeta
;
import
org.unidal.web.mvc.annotation.OutboundActionMeta
;
import
org.unidal.web.mvc.annotation.PayloadMeta
;
public
class
Handler
implements
PageHandler
<
Context
>
{
@Inject
private
JspViewer
m_jspViewer
;
@Inject
private
TestDao
m_testDao
;
@Override
@PayloadMeta
(
Payload
.
class
)
@InboundActionMeta
(
name
=
"test"
)
public
void
handleInbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
// display only, no action here
}
@Override
@OutboundActionMeta
(
name
=
"test"
)
public
void
handleOutbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
Model
model
=
new
Model
(
ctx
);
Payload
payload
=
ctx
.
getPayload
();
Action
action
=
payload
.
getAction
();
Test
test
=
m_testDao
.
createLocal
();
String
name
=
payload
.
getName
();
test
.
setName
(
name
);
switch
(
action
)
{
case
INSERT:
try
{
m_testDao
.
insert
(
test
);
model
.
setName
(
name
);
}
catch
(
DalException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
break
;
case
QUERY:
try
{
Test
result
=
m_testDao
.
queryAll
(
TestEntity
.
READSET_FULL
);
model
.
setTestList
(
result
);
}
catch
(
DalException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
break
;
default
:
throw
new
RuntimeException
(
"Unknown action: "
+
action
);
}
model
.
setAction
(
action
);
model
.
setPage
(
ReportPage
.
TEST
);
if
(!
ctx
.
isProcessStopped
())
{
m_jspViewer
.
view
(
ctx
,
model
);
}
}
}
cat-home/src/main/java/com/dianping/cat/report/page/test/JspFile.java
0 → 100644
浏览文件 @
b8e6ccc6
package
com.dianping.cat.report.page.test
;
public
enum
JspFile
{
INSERT_VIEW
(
"/jsp/report/test.jsp"
),
QUERY_VIEW
(
"/jsp/report/test2.jsp"
);
private
String
m_path
;
private
JspFile
(
String
path
)
{
m_path
=
path
;
}
public
String
getPath
()
{
return
m_path
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/test/JspViewer.java
0 → 100644
浏览文件 @
b8e6ccc6
package
com.dianping.cat.report.page.test
;
import
com.dianping.cat.report.ReportPage
;
import
org.unidal.web.mvc.view.BaseJspViewer
;
public
class
JspViewer
extends
BaseJspViewer
<
ReportPage
,
Action
,
Context
,
Model
>
{
@Override
protected
String
getJspFilePath
(
Context
ctx
,
Model
model
)
{
Action
action
=
model
.
getAction
();
switch
(
action
)
{
case
INSERT:
return
JspFile
.
INSERT_VIEW
.
getPath
();
case
QUERY:
return
JspFile
.
QUERY_VIEW
.
getPath
();
}
throw
new
RuntimeException
(
"Unknown action: "
+
action
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/test/Model.java
0 → 100644
浏览文件 @
b8e6ccc6
package
com.dianping.cat.report.page.test
;
import
java.util.List
;
import
com.dianping.cat.home.dal.report.Test
;
import
com.dianping.cat.report.ReportPage
;
import
org.unidal.web.mvc.ViewModel
;
public
class
Model
extends
ViewModel
<
ReportPage
,
Action
,
Context
>
{
private
String
m_name
;
private
Test
m_testList
;
public
Model
(
Context
ctx
)
{
super
(
ctx
);
}
public
Test
getTestList
()
{
return
m_testList
;
}
public
void
setTestList
(
Test
testList
)
{
m_testList
=
testList
;
}
public
String
getName
()
{
return
m_name
;
}
public
void
setName
(
String
name
)
{
m_name
=
name
;
}
@Override
public
Action
getDefaultAction
()
{
return
Action
.
INSERT
;
}
@Override
public
String
toString
()
{
return
"Model [m_testList="
+
m_testList
.
toString
()
+
"]"
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/test/Payload.java
0 → 100644
浏览文件 @
b8e6ccc6
package
com.dianping.cat.report.page.test
;
import
com.dianping.cat.report.ReportPage
;
import
org.unidal.web.mvc.ActionContext
;
import
org.unidal.web.mvc.ActionPayload
;
import
org.unidal.web.mvc.payload.annotation.FieldMeta
;
public
class
Payload
implements
ActionPayload
<
ReportPage
,
Action
>
{
private
ReportPage
m_page
;
@FieldMeta
(
"op"
)
private
Action
m_action
;
@FieldMeta
(
"name"
)
private
String
m_name
;
public
void
setAction
(
String
action
)
{
m_action
=
Action
.
getByName
(
action
,
Action
.
INSERT
);
}
public
String
getName
()
{
return
m_name
;
}
public
void
setName
(
String
name
)
{
m_name
=
name
;
}
@Override
public
Action
getAction
()
{
return
m_action
;
}
@Override
public
ReportPage
getPage
()
{
return
m_page
;
}
@Override
public
void
setPage
(
String
page
)
{
m_page
=
ReportPage
.
getByName
(
page
,
ReportPage
.
TEST
);
}
@Override
public
void
validate
(
ActionContext
<?>
ctx
)
{
if
(
m_action
==
null
)
{
m_action
=
Action
.
INSERT
;
}
}
}
cat-home/src/main/java/com/dianping/cat/report/page/test/testModelXml.java
0 → 100644
浏览文件 @
b8e6ccc6
package
com.dianping.cat.report.page.test
;
import
java.io.IOException
;
import
org.xml.sax.SAXException
;
import
com.dianping.cat.home.animal.entity.*
;
import
com.dianping.cat.home.animal.transform.DefaultSaxParser
;
import
com.dianping.cat.home.animal.transform.DefaultXmlBuilder
;
import
org.junit.Assert
;
/*
<animal>
<dog name="jack" size="big">
<food name="chicken" time="morning"></food>
<food name="bone" time="noon"></food>
<food name="rice" time="evening"></food>
</dog>
<cat name="tom" size="medium">
<food name="rice" time="morning"></food>
<food name="fish" time="noon"></food>
<food name="mouse" time="evening"></food>
</cat>
<mouse name="jerry" size="small">
<food name="rice" time="morning"></food>
<food name="bread" time="noon"></food>
<food name="noodle" time="evening"></food>
</mouse>
</animal>
*/
public
class
testModelXml
{
public
static
void
main
(
String
[]
args
){
DefaultXmlBuilder
builder
=
new
DefaultXmlBuilder
();
DefaultSaxParser
parser
=
new
DefaultSaxParser
();
Animal
animal
=
getAnimal
();
String
xmlString
=
builder
.
buildXml
(
animal
);
System
.
out
.
println
(
xmlString
);
try
{
Animal
generatedAnimal
=
parser
.
parse
(
xmlString
);
Assert
.
assertEquals
(
animal
,
generatedAnimal
);
}
catch
(
SAXException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
public
static
Animal
getAnimal
(){
Animal
animal
=
new
Animal
();
Cat
cat
=
new
Cat
();
cat
.
setName
(
"tom"
);
cat
.
setSize
(
"medium"
);
Dog
dog
=
new
Dog
();
dog
.
setName
(
"jack"
);
dog
.
setSize
(
"big"
);
Mouse
mouse
=
new
Mouse
();
mouse
.
setName
(
"jerry"
);
mouse
.
setSize
(
"small"
);
Food
catFoodMorning
=
new
Food
();
catFoodMorning
.
setName
(
"rice"
);
catFoodMorning
.
setTime
(
"morning"
);
Food
catFoodNoon
=
new
Food
();
catFoodNoon
.
setName
(
"fish"
);
catFoodNoon
.
setTime
(
"noon"
);
Food
catFoodEvening
=
new
Food
();
catFoodEvening
.
setName
(
"mouse"
);
catFoodEvening
.
setTime
(
"evening"
);
Food
dogFoodMorning
=
new
Food
();
dogFoodMorning
.
setName
(
"chicken"
);
dogFoodMorning
.
setTime
(
"morning"
);
Food
dogFoodNoon
=
new
Food
();
dogFoodNoon
.
setName
(
"bone"
);
dogFoodNoon
.
setTime
(
"noon"
);
Food
dogFoodEvening
=
new
Food
();
dogFoodEvening
.
setName
(
"rice"
);
dogFoodEvening
.
setTime
(
"evening"
);
Food
mouseFoodMorning
=
new
Food
();
mouseFoodMorning
.
setName
(
"rice"
);
mouseFoodMorning
.
setTime
(
"morning"
);
Food
mouseFoodNoon
=
new
Food
();
mouseFoodNoon
.
setName
(
"bread"
);
mouseFoodNoon
.
setTime
(
"noon"
);
Food
mouseFoodEvening
=
new
Food
();
mouseFoodNoon
.
setName
(
"noodle"
);
mouseFoodNoon
.
setTime
(
"evening"
);
dog
.
addFood
(
dogFoodMorning
);
dog
.
addFood
(
dogFoodNoon
);
dog
.
addFood
(
dogFoodEvening
);
cat
.
addFood
(
catFoodMorning
);
cat
.
addFood
(
catFoodNoon
);
cat
.
addFood
(
catFoodEvening
);
mouse
.
addFood
(
mouseFoodMorning
);
mouse
.
addFood
(
mouseFoodNoon
);
mouse
.
addFood
(
mouseFoodEvening
);
animal
.
setCat
(
cat
);
animal
.
setDog
(
dog
);
animal
.
setMouse
(
mouse
);
return
animal
;
}
}
cat-home/src/main/resources/META-INF/dal/jdbc/report-codegen.xml
浏览文件 @
b8e6ccc6
...
@@ -254,7 +254,43 @@
...
@@ -254,7 +254,43 @@
</query>
</query>
</query-defs>
</query-defs>
</entity>
</entity>
<entity
name=
"topology-graph"
table=
"topologyGraph"
alias=
"t"
>
<entity
name=
"test"
table=
"test"
alias=
"t"
>
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"name"
field=
"name"
value-type=
"String"
length=
"100"
nullable=
"false"
/>
<var
name=
"key-id"
value-type=
"int"
key-member=
"id"
/>
<primary-key
name=
"PRIMARY"
members=
"id"
/>
<index
name=
"name"
unique=
"true"
members=
"name ASC"
/>
<readsets>
<readset
name=
"FULL"
all=
"true"
/>
</readsets>
<updatesets>
<updateset
name=
"FULL"
all=
"true"
/>
</updatesets>
<query-defs>
<query
name=
"find-by-PK"
type=
"SELECT"
>
<param
name=
"key-id"
/>
<statement>
<![CDATA[SELECT <FIELDS/>
FROM
<TABLE/>
WHERE
<FIELD
name=
'id'
/>
= ${key-id}]]>
</statement>
</query>
<query
name=
"insert"
type=
"INSERT"
>
<statement>
<![CDATA[INSERT INTO <TABLE/>
(
<FIELDS/>
)
VALUES(
<VALUES/>
)]]>
</statement>
</query>
<query
name=
"update-by-PK"
type=
"UPDATE"
>
<param
name=
"key-id"
/>
<statement>
<![CDATA[UPDATE <TABLE/>
SET
<FIELDS/>
WHERE
<FIELD
name=
'id'
/>
= ${key-id}]]>
</statement>
</query>
<query
name=
"delete-by-PK"
type=
"DELETE"
>
<param
name=
"key-id"
/>
<statement>
<![CDATA[DELETE FROM <TABLE/>
WHERE
<FIELD
name=
'id'
/>
= ${key-id}]]>
</statement>
</query>
</query-defs>
</entity>
<entity
name=
"topology-graph"
table=
"topologyGraph"
alias=
"t2"
>
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"ip"
field=
"ip"
value-type=
"String"
length=
"20"
/>
<member
name=
"ip"
field=
"ip"
value-type=
"String"
length=
"20"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
<member
name=
"period"
field=
"period"
value-type=
"Date"
nullable=
"false"
/>
...
...
cat-home/src/main/resources/META-INF/dal/jdbc/report-dal.xml
浏览文件 @
b8e6ccc6
...
@@ -81,6 +81,46 @@
...
@@ -81,6 +81,46 @@
</query>
</query>
</query-defs>
</query-defs>
</entity>
</entity>
<entity
name=
"test"
table=
"test"
alias=
"t"
>
<member
name=
"id"
field=
"id"
value-type=
"int"
length=
"10"
nullable=
"false"
key=
"true"
auto-increment=
"true"
/>
<member
name=
"name"
field=
"name"
value-type=
"String"
length=
"100"
nullable=
"false"
/>
<var
name=
"key-id"
value-type=
"int"
key-member=
"id"
/>
<primary-key
name=
"PRIMARY"
members=
"id"
/>
<index
name=
"name"
unique=
"true"
members=
"name ASC"
/>
<readsets>
<readset
name=
"FULL"
all=
"true"
/>
</readsets>
<updatesets>
<updateset
name=
"FULL"
all=
"true"
/>
</updatesets>
<query-defs>
<query
name=
"find-by-PK"
type=
"SELECT"
>
<param
name=
"key-id"
/>
<statement>
<![CDATA[SELECT <FIELDS/>
FROM
<TABLE/>
WHERE
<FIELD
name=
'id'
/>
= ${key-id}]]>
</statement>
</query>
<query
name=
"query-all"
type=
"SELECT"
>
<statement>
<![CDATA[SELECT <FIELDS/> FROM <TABLE/>]]>
</statement>
</query>
<query
name=
"insert"
type=
"INSERT"
>
<statement>
<![CDATA[INSERT INTO <TABLE/>
(
<FIELDS/>
)
VALUES(
<VALUES/>
)]]>
</statement>
</query>
<query
name=
"update-by-PK"
type=
"UPDATE"
>
<param
name=
"key-id"
/>
<statement>
<![CDATA[UPDATE <TABLE/>
SET
<FIELDS/>
WHERE
<FIELD
name=
'id'
/>
= ${key-id}]]>
</statement>
</query>
<query
name=
"delete-by-PK"
type=
"DELETE"
>
<param
name=
"key-id"
/>
<statement>
<![CDATA[DELETE FROM <TABLE/>
WHERE
<FIELD
name=
'id'
/>
= ${key-id}]]>
</statement>
</query>
</query-defs>
</entity>
</entities>
</entities>
...
...
cat-home/src/main/resources/META-INF/dal/model/animal-codegen.xml
0 → 100644
浏览文件 @
b8e6ccc6
<?xml version="1.0" encoding="UTF-8"?>
<model>
<entity
name=
"animal"
root=
"true"
>
<entity-ref
name=
"dog"
/>
<entity-ref
name=
"cat"
/>
<entity-ref
name=
"mouse"
/>
</entity>
<entity
name=
"dog"
>
<attribute
name=
"name"
value-type=
"String"
/>
<attribute
name=
"size"
value-type=
"String"
/>
<entity-ref
name=
"food"
type=
"list"
names=
"foods"
/>
</entity>
<entity
name=
"food"
>
<attribute
name=
"name"
value-type=
"String"
/>
<attribute
name=
"time"
value-type=
"String"
/>
</entity>
<entity
name=
"cat"
>
<attribute
name=
"name"
value-type=
"String"
/>
<attribute
name=
"size"
value-type=
"String"
/>
<entity-ref
name=
"food"
type=
"list"
names=
"foods"
/>
</entity>
<entity
name=
"mouse"
>
<attribute
name=
"name"
value-type=
"String"
/>
<attribute
name=
"size"
value-type=
"String"
/>
<entity-ref
name=
"food"
type=
"list"
names=
"foods"
/>
</entity>
</model>
cat-home/src/main/resources/META-INF/dal/model/animal-manifest.xml
0 → 100644
浏览文件 @
b8e6ccc6
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<file
path=
"animal-codegen.xml"
/>
<file
path=
"animal-model.xml"
/>
</manifest>
cat-home/src/main/resources/META-INF/dal/model/animal-model.xml
0 → 100644
浏览文件 @
b8e6ccc6
<?xml version="1.0" encoding="UTF-8"?>
<model
model-package=
"com.dianping.cat.home.animal"
enable-sax-parser=
"true"
>
<entity
name=
"animal"
root=
"true"
>
<entity-ref
name=
"dog"
/>
<entity-ref
name=
"cat"
/>
<entity-ref
name=
"mouse"
/>
</entity>
<entity
name=
"dog"
>
<attribute
name=
"name"
value-type=
"String"
/>
<attribute
name=
"size"
value-type=
"String"
/>
<entity-ref
name=
"food"
type=
"list"
names=
"foods"
/>
</entity>
<entity
name=
"food"
>
<attribute
name=
"name"
value-type=
"String"
/>
<attribute
name=
"time"
value-type=
"String"
/>
</entity>
<entity
name=
"cat"
>
<attribute
name=
"name"
value-type=
"String"
/>
<attribute
name=
"size"
value-type=
"String"
/>
<entity-ref
name=
"food"
type=
"list"
names=
"foods"
/>
</entity>
<entity
name=
"mouse"
>
<attribute
name=
"name"
value-type=
"String"
/>
<attribute
name=
"size"
value-type=
"String"
/>
<entity-ref
name=
"food"
type=
"list"
names=
"foods"
/>
</entity>
</model>
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
b8e6ccc6
...
@@ -1485,6 +1485,30 @@
...
@@ -1485,6 +1485,30 @@
<datasourceFile>
/data/appdatas/cat/datasources.xml
</datasourceFile>
<datasourceFile>
/data/appdatas/cat/datasources.xml
</datasourceFile>
</configuration>
</configuration>
</component>
</component>
<component>
<role>
org.unidal.dal.jdbc.datasource.DataSource
</role>
<role-hint>
cat
</role-hint>
<implementation>
org.unidal.dal.jdbc.datasource.JdbcDataSource
</implementation>
<configuration>
<id>
cat
</id>
<maximum-pool-size>
3
</maximum-pool-size>
<connection-timeout>
1s
</connection-timeout>
<idle-timeout>
10m
</idle-timeout>
<statement-cache-size>
1000
</statement-cache-size>
<properties>
<driver>
com.mysql.jdbc.Driver
</driver>
<url>
jdbc:mysql://127.0.0.1:3306/cat
</url>
<user>
test
</user>
<password>
123
</password>
<connectionProperties>
<![CDATA[useUnicode=true&autoReconnect=true]]>
</connectionProperties>
</properties>
</configuration>
<requirements>
<requirement>
<role>
org.unidal.dal.jdbc.datasource.JdbcDataSourceDescriptorManager
</role>
</requirement>
</requirements>
</component>
<component>
<component>
<role>
org.unidal.dal.jdbc.mapping.TableProvider
</role>
<role>
org.unidal.dal.jdbc.mapping.TableProvider
</role>
<role-hint>
alteration
</role-hint>
<role-hint>
alteration
</role-hint>
...
@@ -1545,6 +1569,16 @@
...
@@ -1545,6 +1569,16 @@
<data-source-name>
cat
</data-source-name>
<data-source-name>
cat
</data-source-name>
</configuration>
</configuration>
</component>
</component>
<component>
<role>
org.unidal.dal.jdbc.mapping.TableProvider
</role>
<role-hint>
test
</role-hint>
<implementation>
org.unidal.dal.jdbc.mapping.SimpleTableProvider
</implementation>
<configuration>
<logical-table-name>
test
</logical-table-name>
<physical-table-name>
test
</physical-table-name>
<data-source-name>
cat
</data-source-name>
</configuration>
</component>
<component>
<component>
<role>
org.unidal.dal.jdbc.mapping.TableProvider
</role>
<role>
org.unidal.dal.jdbc.mapping.TableProvider
</role>
<role-hint>
topology-graph
</role-hint>
<role-hint>
topology-graph
</role-hint>
...
@@ -1619,6 +1653,15 @@
...
@@ -1619,6 +1653,15 @@
</requirement>
</requirement>
</requirements>
</requirements>
</component>
</component>
<component>
<role>
com.dianping.cat.home.dal.report.TestDao
</role>
<implementation>
com.dianping.cat.home.dal.report.TestDao
</implementation>
<requirements>
<requirement>
<role>
org.unidal.dal.jdbc.QueryEngine
</role>
</requirement>
</requirements>
</component>
<component>
<component>
<role>
com.dianping.cat.home.dal.report.TopologyGraphDao
</role>
<role>
com.dianping.cat.home.dal.report.TopologyGraphDao
</role>
<implementation>
com.dianping.cat.home.dal.report.TopologyGraphDao
</implementation>
<implementation>
com.dianping.cat.home.dal.report.TopologyGraphDao
</implementation>
...
@@ -1694,6 +1737,30 @@
...
@@ -1694,6 +1737,30 @@
</requirement>
</requirement>
</requirements>
</requirements>
</component>
</component>
<component>
<role>
org.unidal.dal.jdbc.datasource.DataSource
</role>
<role-hint>
user
</role-hint>
<implementation>
org.unidal.dal.jdbc.datasource.JdbcDataSource
</implementation>
<configuration>
<id>
user
</id>
<maximum-pool-size>
3
</maximum-pool-size>
<connection-timeout>
1s
</connection-timeout>
<idle-timeout>
10m
</idle-timeout>
<statement-cache-size>
1000
</statement-cache-size>
<properties>
<driver>
com.mysql.jdbc.Driver
</driver>
<url>
jdbc:mysql://192.168.8.44:3306/hawk
</url>
<user>
hawk
</user>
<password>
hawk
</password>
<connectionProperties>
<![CDATA[useUnicode=true&autoReconnect=true]]>
</connectionProperties>
</properties>
</configuration>
<requirements>
<requirement>
<role>
org.unidal.dal.jdbc.datasource.JdbcDataSourceDescriptorManager
</role>
</requirement>
</requirements>
</component>
<component>
<component>
<role>
org.unidal.dal.jdbc.mapping.TableProvider
</role>
<role>
org.unidal.dal.jdbc.mapping.TableProvider
</role>
<role-hint>
dp-admin-login
</role-hint>
<role-hint>
dp-admin-login
</role-hint>
...
@@ -2889,6 +2956,36 @@
...
@@ -2889,6 +2956,36 @@
</requirement>
</requirement>
</requirements>
</requirements>
</component>
</component>
<component>
<role>
com.dianping.cat.report.page.test.Handler
</role>
<implementation>
com.dianping.cat.report.page.test.Handler
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.report.page.test.JspViewer
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.home.dal.report.TestDao
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.page.test.JspViewer
</role>
<implementation>
com.dianping.cat.report.page.test.JspViewer
</implementation>
<requirements>
<requirement>
<role>
org.unidal.web.mvc.view.model.ModelHandler
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.home.dal.report.TestDao
</role>
<implementation>
com.dianping.cat.home.dal.report.TestDao
</implementation>
<requirements>
<requirement>
<role>
org.unidal.dal.jdbc.QueryEngine
</role>
</requirement>
</requirements>
</component>
<component>
<component>
<role>
com.dianping.cat.system.SystemModule
</role>
<role>
com.dianping.cat.system.SystemModule
</role>
<implementation>
com.dianping.cat.system.SystemModule
</implementation>
<implementation>
com.dianping.cat.system.SystemModule
</implementation>
...
...
cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml
浏览文件 @
b8e6ccc6
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
<datasource>
<datasource>
<driver>
com.mysql.jdbc.Driver
</driver>
<driver>
com.mysql.jdbc.Driver
</driver>
<url>
jdbc:mysql://127.0.0.1:3306/cat
</url>
<url>
jdbc:mysql://127.0.0.1:3306/cat
</url>
<user>
roo
t
</user>
<user>
tes
t
</user>
<password>
root
</password>
<password>
123
</password>
<properties>
useUnicode=true
&
autoReconnect=true
</properties>
<properties>
useUnicode=true
&
autoReconnect=true
</properties>
</datasource>
</datasource>
<group
name=
"report"
package=
"com.dianping.cat.home.dal.report"
>
<group
name=
"report"
package=
"com.dianping.cat.home.dal.report"
>
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
<table
name=
"monthly_report_content"
/>
<table
name=
"monthly_report_content"
/>
<table
name=
"weekly_report_content"
/>
<table
name=
"weekly_report_content"
/>
<table
name=
"alteration"
/>
<table
name=
"alteration"
/>
<table
name=
"test"
/>
</group>
</group>
<group
name=
"alarm"
package=
"com.dianping.cat.home.dal.alarm"
>
<group
name=
"alarm"
package=
"com.dianping.cat.home.dal.alarm"
>
<table
name=
"mailRecord"
/>
<table
name=
"mailRecord"
/>
...
...
cat-home/src/main/resources/META-INF/wizard/model/wizard.xml
浏览文件 @
b8e6ccc6
...
@@ -36,4 +36,7 @@
...
@@ -36,4 +36,7 @@
<model
package=
"com.dianping.cat.home.metricGroup"
name=
"metric-group-config"
>
<model
package=
"com.dianping.cat.home.metricGroup"
name=
"metric-group-config"
>
<sample-model>
src/test/resources/com/dianping/cat/system/config/metricGroup.xml
</sample-model>
<sample-model>
src/test/resources/com/dianping/cat/system/config/metricGroup.xml
</sample-model>
</model>
</model>
<model
package=
"com.dianping.cat.home.animal"
name=
"animal"
>
<sample-model>
test.xml
</sample-model>
</model>
</wizard>
</wizard>
cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
浏览文件 @
b8e6ccc6
...
@@ -55,13 +55,16 @@
...
@@ -55,13 +55,16 @@
</page>
</page>
<page
name=
"statistics"
title=
"Statistics"
path=
"statistics"
view=
"/jsp/report/bug/bug.jsp"
template=
"default"
>
<page
name=
"statistics"
title=
"Statistics"
path=
"statistics"
view=
"/jsp/report/bug/bug.jsp"
template=
"default"
>
<description>
Statistics
</description>
<description>
Statistics
</description>
</page>
</page>
<page
name=
"alteration"
title=
"Alteration"
path=
"alteration"
template=
"default"
>
<page
name=
"alteration"
title=
"Alteration"
path=
"alteration"
template=
"default"
>
<description>
Alteration
</description>
<description>
Alteration
</description>
</page>
</page>
<page
name=
"monitor"
title=
"Monitor"
path=
"monitor"
template=
"default"
>
<page
name=
"monitor"
title=
"Monitor"
path=
"monitor"
template=
"default"
>
<description>
Monitor
</description>
<description>
Monitor
</description>
</page>
</page>
<page
name=
"test"
title=
"Test"
path=
"test"
template=
"default"
>
<description>
Test
</description>
</page>
</module>
</module>
<module
name=
"system"
path=
"s"
default=
"false"
>
<module
name=
"system"
path=
"s"
default=
"false"
>
<page
name=
"alarm"
title=
"Alarm"
default=
"true"
path=
"alarm"
view=
"/jsp/system/alarm/alarm.jsp"
>
<page
name=
"alarm"
title=
"Alarm"
default=
"true"
path=
"alarm"
view=
"/jsp/system/alarm/alarm.jsp"
>
...
...
cat-home/src/main/webapp/jsp/report/alteration.jsp
0 → 100644
浏览文件 @
b8e6ccc6
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.alteration.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.alteration.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.alteration.Model"
scope=
"request"
/>
View of alteration page under report
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/test.jsp
0 → 100644
浏览文件 @
b8e6ccc6
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.test.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.test.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.test.Model"
scope=
"request"
/>
insert data : ${model.name}
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/test2.jsp
0 → 100644
浏览文件 @
b8e6ccc6
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.test.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.test.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.test.Model"
scope=
"request"
/>
All data: ${model}
\ No newline at end of file
cat-home/test.xml
0 → 100644
浏览文件 @
b8e6ccc6
<animal>
<dog
name=
"jack"
size=
"big"
>
<food
name=
"chicken"
time=
"morning"
></food>
<food
name=
"bone"
time=
"noon"
></food>
<food
name=
"rice"
time=
"evening"
></food>
</dog>
<cat
name=
"tom"
size=
"medium"
>
<food
name=
"rice"
time=
"morning"
></food>
<food
name=
"fish"
time=
"noon"
></food>
<food
name=
"mouse"
time=
"evening"
></food>
</cat>
<mouse
name=
"jerry"
size=
"small"
>
<food
name=
"rice"
time=
"morning"
></food>
<food
name=
"bread"
time=
"noon"
></food>
<food
name=
"noodle"
time=
"evening"
></food>
</mouse>
</animal>
script/Cat.sql
浏览文件 @
b8e6ccc6
...
@@ -393,12 +393,12 @@ CREATE TABLE `alteration` (
...
@@ -393,12 +393,12 @@ CREATE TABLE `alteration` (
`hostname`
varchar
(
128
)
NOT
NULL
COMMENT
'变更机器名'
,
`hostname`
varchar
(
128
)
NOT
NULL
COMMENT
'变更机器名'
,
`ip`
varchar
(
128
)
DEFAULT
NULL
COMMENT
'变更机器IP'
,
`ip`
varchar
(
128
)
DEFAULT
NULL
COMMENT
'变更机器IP'
,
`date`
datetime
NOT
NULL
COMMENT
'变更时间'
,
`date`
datetime
NOT
NULL
COMMENT
'变更时间'
,
`user`
varchar
(
45
)
NOT
NULL
COMMENT
'变更用户
’
,
`user`
varchar
(
45
)
NOT
NULL
COMMENT
'变更用户
'
,
`alt_group` varchar(45) DEFAULT NULL COMMENT '
变更组别
’
,
`alt_group`
varchar
(
45
)
DEFAULT
NULL
COMMENT
'变更组别
'
,
`content`
text
NOT
NULL
COMMENT
'变更内容'
,
`content`
text
NOT
NULL
COMMENT
'变更内容'
,
`url`
varchar
(
200
)
DEFAULT
NULL
COMMENT
'变更链接'
,
`url`
varchar
(
200
)
DEFAULT
NULL
COMMENT
'变更链接'
,
`creation_date`
datetime
NOT
NULL
COMMENT
'数据库创建时间'
,
`creation_date`
datetime
NOT
NULL
COMMENT
'数据库创建时间'
,
PRIMARY
KEY
(
`id`
),
PRIMARY
KEY
(
`id`
),
KEY
`ind_date_domain_host`
(
`date`
,
`domain`
,
`hostname`
)
KEY
`ind_date_domain_host`
(
`date`
,
`domain`
,
`hostname`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1241
DEFAULT
CHARSET
=
utf8
COMMENT
=
'变更表
’
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1241
DEFAULT
CHARSET
=
utf8
COMMENT
=
'变更表
'
;
test.xml
0 → 100644
浏览文件 @
b8e6ccc6
<animal>
<dog
name=
"jack"
size=
"big"
>
<food
name=
"chicken"
time=
"morning"
></food>
<food
name=
"bone"
time=
"noon"
></food>
<food
name=
"rice"
time=
"evening"
></food>
</dog>
<cat
name=
"tom"
size=
"medium"
>
<food
name=
"rice"
time=
"morning"
></food>
<food
name=
"fish"
time=
"noon"
></food>
<food
name=
"mouse"
time=
"evening"
></food>
</cat>
<mouse
name=
"jerry"
size=
"small"
>
<food
name=
"rice"
time=
"morning"
></food>
<food
name=
"bread"
time=
"noon"
></food>
<food
name=
"noodle"
time=
"evening"
></food>
</mouse>
</animal>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录