From b8e6ccc6a39a1af17319f242e7c8094471716f3d Mon Sep 17 00:00:00 2001 From: jialinsun Date: Wed, 2 Apr 2014 21:25:46 +0800 Subject: [PATCH] complete homework, just test, ignore it. --- cat-home/pom.xml | 4 +- .../cat/build/CatDatabaseConfigurator.java | 2 + .../cat/build/UserDatabaseConfigurator.java | 2 + .../com/dianping/cat/report/ReportModule.java | 4 +- .../com/dianping/cat/report/ReportPage.java | 6 +- .../dianping/cat/report/page/test/Action.java | 27 +++++ .../cat/report/page/test/Context.java | 7 ++ .../cat/report/page/test/Handler.java | 74 ++++++++++++ .../cat/report/page/test/JspFile.java | 16 +++ .../cat/report/page/test/JspViewer.java | 20 +++ .../dianping/cat/report/page/test/Model.java | 46 +++++++ .../cat/report/page/test/Payload.java | 51 ++++++++ .../cat/report/page/test/testModelXml.java | 114 ++++++++++++++++++ .../META-INF/dal/jdbc/report-codegen.xml | 38 +++++- .../META-INF/dal/jdbc/report-dal.xml | 40 ++++++ .../META-INF/dal/model/animal-codegen.xml | 28 +++++ .../META-INF/dal/model/animal-manifest.xml | 6 + .../META-INF/dal/model/animal-model.xml | 28 +++++ .../resources/META-INF/plexus/components.xml | 97 +++++++++++++++ .../resources/META-INF/wizard/jdbc/wizard.xml | 5 +- .../META-INF/wizard/model/wizard.xml | 3 + .../META-INF/wizard/webapp/wizard.xml | 5 +- .../src/main/webapp/jsp/report/alteration.jsp | 5 + cat-home/src/main/webapp/jsp/report/test.jsp | 5 + cat-home/src/main/webapp/jsp/report/test2.jsp | 5 + cat-home/test.xml | 17 +++ script/Cat.sql | 6 +- test.xml | 17 +++ 28 files changed, 667 insertions(+), 11 deletions(-) create mode 100644 cat-home/src/main/java/com/dianping/cat/report/page/test/Action.java create mode 100644 cat-home/src/main/java/com/dianping/cat/report/page/test/Context.java create mode 100644 cat-home/src/main/java/com/dianping/cat/report/page/test/Handler.java create mode 100644 cat-home/src/main/java/com/dianping/cat/report/page/test/JspFile.java create mode 100644 cat-home/src/main/java/com/dianping/cat/report/page/test/JspViewer.java create mode 100644 cat-home/src/main/java/com/dianping/cat/report/page/test/Model.java create mode 100644 cat-home/src/main/java/com/dianping/cat/report/page/test/Payload.java create mode 100644 cat-home/src/main/java/com/dianping/cat/report/page/test/testModelXml.java create mode 100644 cat-home/src/main/resources/META-INF/dal/model/animal-codegen.xml create mode 100644 cat-home/src/main/resources/META-INF/dal/model/animal-manifest.xml create mode 100644 cat-home/src/main/resources/META-INF/dal/model/animal-model.xml create mode 100644 cat-home/src/main/webapp/jsp/report/alteration.jsp create mode 100644 cat-home/src/main/webapp/jsp/report/test.jsp create mode 100644 cat-home/src/main/webapp/jsp/report/test2.jsp create mode 100644 cat-home/test.xml create mode 100644 test.xml diff --git a/cat-home/pom.xml b/cat-home/pom.xml index 651bcb31b..165b11563 100755 --- a/cat-home/pom.xml +++ b/cat-home/pom.xml @@ -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-config-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, + ${basedir}/src/main/resources/META-INF/dal/model/metric-group-config-manifest.xml, + ${basedir}/src/main/resources/META-INF/dal/model/animal-manifest.xml, + diff --git a/cat-home/src/main/java/com/dianping/cat/build/CatDatabaseConfigurator.java b/cat-home/src/main/java/com/dianping/cat/build/CatDatabaseConfigurator.java index 0e0c5d4c2..83aca854a 100644 --- a/cat-home/src/main/java/com/dianping/cat/build/CatDatabaseConfigurator.java +++ b/cat-home/src/main/java/com/dianping/cat/build/CatDatabaseConfigurator.java @@ -11,6 +11,8 @@ final class CatDatabaseConfigurator extends AbstractJdbcResourceConfigurator { public List defineComponents() { List all = new ArrayList(); + all.add(defineJdbcDataSourceComponent("cat", "com.mysql.jdbc.Driver", "jdbc:mysql://127.0.0.1:3306/cat", "test", "123", "")); + defineSimpleTableProviderComponents(all, "cat", com.dianping.cat.home.dal.report._INDEX.getEntityClasses()); defineDaoComponents(all, com.dianping.cat.home.dal.report._INDEX.getDaoClasses()); diff --git a/cat-home/src/main/java/com/dianping/cat/build/UserDatabaseConfigurator.java b/cat-home/src/main/java/com/dianping/cat/build/UserDatabaseConfigurator.java index 5a5e19698..12ac09d6d 100644 --- a/cat-home/src/main/java/com/dianping/cat/build/UserDatabaseConfigurator.java +++ b/cat-home/src/main/java/com/dianping/cat/build/UserDatabaseConfigurator.java @@ -11,6 +11,8 @@ final class UserDatabaseConfigurator extends AbstractJdbcResourceConfigurator { public List defineComponents() { List all = new ArrayList(); + all.add(defineJdbcDataSourceComponent("user", "com.mysql.jdbc.Driver", "jdbc:mysql://192.168.8.44:3306/hawk", "hawk", "hawk", "")); + defineSimpleTableProviderComponents(all, "user", com.dianping.cat.home.dal.user._INDEX.getEntityClasses()); defineDaoComponents(all, com.dianping.cat.home.dal.user._INDEX.getDaoClasses()); diff --git a/cat-home/src/main/java/com/dianping/cat/report/ReportModule.java b/cat-home/src/main/java/com/dianping/cat/report/ReportModule.java index bfb01a9eb..efb7aef60 100755 --- a/cat-home/src/main/java/com/dianping/cat/report/ReportModule.java +++ b/cat-home/src/main/java/com/dianping/cat/report/ReportModule.java @@ -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.monitor.Handler.class +com.dianping.cat.report.page.monitor.Handler.class, + +com.dianping.cat.report.page.test.Handler.class }) public class ReportModule extends AbstractModule { diff --git a/cat-home/src/main/java/com/dianping/cat/report/ReportPage.java b/cat-home/src/main/java/com/dianping/cat/report/ReportPage.java index 2cd819b57..3875a403d 100755 --- a/cat-home/src/main/java/com/dianping/cat/report/ReportPage.java +++ b/cat-home/src/main/java/com/dianping/cat/report/ReportPage.java @@ -41,10 +41,12 @@ public enum ReportPage implements Page { STATISTICS("statistics", "statistics", "Statistics", "Statistics", true), + ALTERATION("alteration", "alteration", "Alteration", "Alteration", 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_path; diff --git a/cat-home/src/main/java/com/dianping/cat/report/page/test/Action.java b/cat-home/src/main/java/com/dianping/cat/report/page/test/Action.java new file mode 100644 index 000000000..0b4bb9573 --- /dev/null +++ b/cat-home/src/main/java/com/dianping/cat/report/page/test/Action.java @@ -0,0 +1,27 @@ +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; + } +} diff --git a/cat-home/src/main/java/com/dianping/cat/report/page/test/Context.java b/cat-home/src/main/java/com/dianping/cat/report/page/test/Context.java new file mode 100644 index 000000000..f9adb8a2b --- /dev/null +++ b/cat-home/src/main/java/com/dianping/cat/report/page/test/Context.java @@ -0,0 +1,7 @@ +package com.dianping.cat.report.page.test; + +import com.dianping.cat.report.ReportContext; + +public class Context extends ReportContext { + +} diff --git a/cat-home/src/main/java/com/dianping/cat/report/page/test/Handler.java b/cat-home/src/main/java/com/dianping/cat/report/page/test/Handler.java new file mode 100644 index 000000000..20624ccdc --- /dev/null +++ b/cat-home/src/main/java/com/dianping/cat/report/page/test/Handler.java @@ -0,0 +1,74 @@ +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 { + @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); + } + } +} diff --git a/cat-home/src/main/java/com/dianping/cat/report/page/test/JspFile.java b/cat-home/src/main/java/com/dianping/cat/report/page/test/JspFile.java new file mode 100644 index 000000000..cf366365d --- /dev/null +++ b/cat-home/src/main/java/com/dianping/cat/report/page/test/JspFile.java @@ -0,0 +1,16 @@ +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; + } +} diff --git a/cat-home/src/main/java/com/dianping/cat/report/page/test/JspViewer.java b/cat-home/src/main/java/com/dianping/cat/report/page/test/JspViewer.java new file mode 100644 index 000000000..45913431e --- /dev/null +++ b/cat-home/src/main/java/com/dianping/cat/report/page/test/JspViewer.java @@ -0,0 +1,20 @@ +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 { + @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); + } +} diff --git a/cat-home/src/main/java/com/dianping/cat/report/page/test/Model.java b/cat-home/src/main/java/com/dianping/cat/report/page/test/Model.java new file mode 100644 index 000000000..2151a1ad9 --- /dev/null +++ b/cat-home/src/main/java/com/dianping/cat/report/page/test/Model.java @@ -0,0 +1,46 @@ +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 { + + 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() + "]"; + } + + +} diff --git a/cat-home/src/main/java/com/dianping/cat/report/page/test/Payload.java b/cat-home/src/main/java/com/dianping/cat/report/page/test/Payload.java new file mode 100644 index 000000000..548128fc5 --- /dev/null +++ b/cat-home/src/main/java/com/dianping/cat/report/page/test/Payload.java @@ -0,0 +1,51 @@ +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 { + 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; + } + } +} diff --git a/cat-home/src/main/java/com/dianping/cat/report/page/test/testModelXml.java b/cat-home/src/main/java/com/dianping/cat/report/page/test/testModelXml.java new file mode 100644 index 000000000..e3a16dc72 --- /dev/null +++ b/cat-home/src/main/java/com/dianping/cat/report/page/test/testModelXml.java @@ -0,0 +1,114 @@ +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; +/* + + + + + + + + + + + + + + + + + +*/ + +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; + } +} diff --git a/cat-home/src/main/resources/META-INF/dal/jdbc/report-codegen.xml b/cat-home/src/main/resources/META-INF/dal/jdbc/report-codegen.xml index 6fe39106d..69a67503b 100644 --- a/cat-home/src/main/resources/META-INF/dal/jdbc/report-codegen.xml +++ b/cat-home/src/main/resources/META-INF/dal/jdbc/report-codegen.xml @@ -254,7 +254,43 @@ - + + + + + + + + + + + + + + + + + FROM + WHERE = ${key-id}]]> + + + () + VALUES()]]> + + + + + SET + WHERE = ${key-id}]]> + + + + + WHERE = ${key-id}]]> + + + + diff --git a/cat-home/src/main/resources/META-INF/dal/jdbc/report-dal.xml b/cat-home/src/main/resources/META-INF/dal/jdbc/report-dal.xml index 81561cbff..f69fbb0e5 100644 --- a/cat-home/src/main/resources/META-INF/dal/jdbc/report-dal.xml +++ b/cat-home/src/main/resources/META-INF/dal/jdbc/report-dal.xml @@ -81,6 +81,46 @@ + + + + + + + + + + + + + + + + + + FROM
+ WHERE = ${key-id}]]> + + + FROM
]]> + + + () + VALUES()]]> + + + + + SET + WHERE = ${key-id}]]> + + + + + WHERE = ${key-id}]]> + + + diff --git a/cat-home/src/main/resources/META-INF/dal/model/animal-codegen.xml b/cat-home/src/main/resources/META-INF/dal/model/animal-codegen.xml new file mode 100644 index 000000000..3ae54f8d0 --- /dev/null +++ b/cat-home/src/main/resources/META-INF/dal/model/animal-codegen.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cat-home/src/main/resources/META-INF/dal/model/animal-manifest.xml b/cat-home/src/main/resources/META-INF/dal/model/animal-manifest.xml new file mode 100644 index 000000000..70e569b3b --- /dev/null +++ b/cat-home/src/main/resources/META-INF/dal/model/animal-manifest.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/cat-home/src/main/resources/META-INF/dal/model/animal-model.xml b/cat-home/src/main/resources/META-INF/dal/model/animal-model.xml new file mode 100644 index 000000000..3316f6f73 --- /dev/null +++ b/cat-home/src/main/resources/META-INF/dal/model/animal-model.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cat-home/src/main/resources/META-INF/plexus/components.xml b/cat-home/src/main/resources/META-INF/plexus/components.xml index fbf3bb5fc..ecd58cfe5 100755 --- a/cat-home/src/main/resources/META-INF/plexus/components.xml +++ b/cat-home/src/main/resources/META-INF/plexus/components.xml @@ -1485,6 +1485,30 @@ /data/appdatas/cat/datasources.xml + + org.unidal.dal.jdbc.datasource.DataSource + cat + org.unidal.dal.jdbc.datasource.JdbcDataSource + + cat + 3 + 1s + 10m + 1000 + + com.mysql.jdbc.Driver + jdbc:mysql://127.0.0.1:3306/cat + test + 123 + + + + + + org.unidal.dal.jdbc.datasource.JdbcDataSourceDescriptorManager + + + org.unidal.dal.jdbc.mapping.TableProvider alteration @@ -1545,6 +1569,16 @@ cat + + org.unidal.dal.jdbc.mapping.TableProvider + test + org.unidal.dal.jdbc.mapping.SimpleTableProvider + + test + test + cat + + org.unidal.dal.jdbc.mapping.TableProvider topology-graph @@ -1619,6 +1653,15 @@ + + com.dianping.cat.home.dal.report.TestDao + com.dianping.cat.home.dal.report.TestDao + + + org.unidal.dal.jdbc.QueryEngine + + + com.dianping.cat.home.dal.report.TopologyGraphDao com.dianping.cat.home.dal.report.TopologyGraphDao @@ -1694,6 +1737,30 @@ + + org.unidal.dal.jdbc.datasource.DataSource + user + org.unidal.dal.jdbc.datasource.JdbcDataSource + + user + 3 + 1s + 10m + 1000 + + com.mysql.jdbc.Driver + jdbc:mysql://192.168.8.44:3306/hawk + hawk + hawk + + + + + + org.unidal.dal.jdbc.datasource.JdbcDataSourceDescriptorManager + + + org.unidal.dal.jdbc.mapping.TableProvider dp-admin-login @@ -2889,6 +2956,36 @@ + + com.dianping.cat.report.page.test.Handler + com.dianping.cat.report.page.test.Handler + + + com.dianping.cat.report.page.test.JspViewer + + + com.dianping.cat.home.dal.report.TestDao + + + + + com.dianping.cat.report.page.test.JspViewer + com.dianping.cat.report.page.test.JspViewer + + + org.unidal.web.mvc.view.model.ModelHandler + + + + + com.dianping.cat.home.dal.report.TestDao + com.dianping.cat.home.dal.report.TestDao + + + org.unidal.dal.jdbc.QueryEngine + + + com.dianping.cat.system.SystemModule com.dianping.cat.system.SystemModule diff --git a/cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml b/cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml index fef6e530f..360a1442e 100644 --- a/cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml +++ b/cat-home/src/main/resources/META-INF/wizard/jdbc/wizard.xml @@ -4,8 +4,8 @@ com.mysql.jdbc.Driver jdbc:mysql://127.0.0.1:3306/cat - root - root + test + 123 useUnicode=true&autoReconnect=true @@ -17,6 +17,7 @@
+
diff --git a/cat-home/src/main/resources/META-INF/wizard/model/wizard.xml b/cat-home/src/main/resources/META-INF/wizard/model/wizard.xml index 97e1ae507..301872105 100644 --- a/cat-home/src/main/resources/META-INF/wizard/model/wizard.xml +++ b/cat-home/src/main/resources/META-INF/wizard/model/wizard.xml @@ -36,4 +36,7 @@ src/test/resources/com/dianping/cat/system/config/metricGroup.xml + + test.xml + diff --git a/cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml b/cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml index 8c39a2916..ae5fc86c6 100755 --- a/cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml +++ b/cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml @@ -55,13 +55,16 @@ Statistics - + Alteration Monitor + + Test + diff --git a/cat-home/src/main/webapp/jsp/report/alteration.jsp b/cat-home/src/main/webapp/jsp/report/alteration.jsp new file mode 100644 index 000000000..69a923a8f --- /dev/null +++ b/cat-home/src/main/webapp/jsp/report/alteration.jsp @@ -0,0 +1,5 @@ +<%@ page contentType="text/html; charset=utf-8" %> + + + +View of alteration page under report \ No newline at end of file diff --git a/cat-home/src/main/webapp/jsp/report/test.jsp b/cat-home/src/main/webapp/jsp/report/test.jsp new file mode 100644 index 000000000..495955c4d --- /dev/null +++ b/cat-home/src/main/webapp/jsp/report/test.jsp @@ -0,0 +1,5 @@ +<%@ page contentType="text/html; charset=utf-8" %> + + + +insert data : ${model.name} \ No newline at end of file diff --git a/cat-home/src/main/webapp/jsp/report/test2.jsp b/cat-home/src/main/webapp/jsp/report/test2.jsp new file mode 100644 index 000000000..e911cce5e --- /dev/null +++ b/cat-home/src/main/webapp/jsp/report/test2.jsp @@ -0,0 +1,5 @@ +<%@ page contentType="text/html; charset=utf-8" %> + + + +All data: ${model} \ No newline at end of file diff --git a/cat-home/test.xml b/cat-home/test.xml new file mode 100644 index 000000000..ab705de47 --- /dev/null +++ b/cat-home/test.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/script/Cat.sql b/script/Cat.sql index 16957a814..3484b75c7 100644 --- a/script/Cat.sql +++ b/script/Cat.sql @@ -393,12 +393,12 @@ CREATE TABLE `alteration` ( `hostname` varchar(128) NOT NULL COMMENT '变更机器名', `ip` varchar(128) DEFAULT NULL COMMENT '变更机器IP', `date` datetime NOT NULL COMMENT '变更时间', - `user` varchar(45) NOT NULL COMMENT '变更用户’, - `alt_group` varchar(45) DEFAULT NULL COMMENT '变更组别’, + `user` varchar(45) NOT NULL COMMENT '变更用户', + `alt_group` varchar(45) DEFAULT NULL COMMENT '变更组别', `content` text NOT NULL COMMENT '变更内容', `url` varchar(200) DEFAULT NULL COMMENT '变更链接', `creation_date` datetime NOT NULL COMMENT '数据库创建时间', PRIMARY KEY (`id`), 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='变更表'; diff --git a/test.xml b/test.xml new file mode 100644 index 000000000..ab705de47 --- /dev/null +++ b/test.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + -- GitLab