提交 27f39e9c 编写于 作者: K kezhu.wu

Merge branch 'master' of https://github.com/ainilife/cat into abtest2

......@@ -34,6 +34,14 @@ public class ABTestEntity {
public String getName() {
return m_entity.getName();
}
public Date getEndDate() {
return m_entity.getEndDate();
}
public Date getStartDate() {
return m_entity.getStartDate();
}
public boolean isEligible(Date date) {
if (m_entity.getDisabled() != null && m_entity.getDisabled()) {
......
......@@ -10,6 +10,7 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
import org.unidal.lookup.ContainerHolder;
import com.dianping.cat.Cat;
import com.dianping.cat.abtest.ABTestId;
import com.dianping.cat.abtest.model.entity.Abtest;
import com.dianping.cat.abtest.model.entity.Entity;
......@@ -53,12 +54,18 @@ public class DefaultABTestEntityManager extends ContainerHolder implements ABTes
abtest.accept(visitor);
for (ABTestEntity entity : m_entityList) {
ABTestGroupStrategy groupStrategy = this.lookup(ABTestGroupStrategy.class, entity.getGroupStrategyName());
entity.setGroupStrategy(groupStrategy);
try {
ABTestGroupStrategy groupStrategy = lookup(ABTestGroupStrategy.class, entity.getGroupStrategyName());
entity.setGroupStrategy(groupStrategy);
} catch (Exception e) {
Cat.logError(e);
//TODO un-comment the following line later!
//entity.setDisabled(true);
}
}
} catch (Exception e) {
throw new InitializationException("Error when loading resource(abtest.xml)", e);
throw new InitializationException("Error when loading resource(abtest.xml)!", e);
}
}
......
......@@ -6,13 +6,16 @@ import java.util.List;
import org.unidal.lookup.configuration.AbstractResourceConfigurator;
import org.unidal.lookup.configuration.Component;
import com.dianping.cat.abtest.spi.ABTestEntityManager;
import com.dianping.cat.abtest.spi.ABTestGroupStrategy;
import com.dianping.cat.abtest.spi.internal.DefaultABTestEntityManager;
public class ABTestServerConfigurator extends AbstractResourceConfigurator {
@Override
public List<Component> defineComponents() {
List<Component> all = new ArrayList<Component>();
all.add(C(ABTestEntityManager.class, DefaultABTestEntityManager.class));
all.add(C(ABTestGroupStrategy.class, "roundrobin", RoundRobinGroupStrategy.class));
return all;
......
<plexus>
<components>
<component>
<role>com.dianping.cat.abtest.spi.ABTestEntityManager</role>
<implementation>com.dianping.cat.abtest.spi.internal.DefaultABTestEntityManager</implementation>
</component>
<component>
<role>com.dianping.cat.abtest.spi.ABTestGroupStrategy</role>
<role-hint>roundrobin</role-hint>
......
......@@ -7,9 +7,36 @@
<domain>Cat</domain>
<domain>TuanGouWeb</domain>
</entity>
<entity id="1002" name="Mock2" start-date="2013-04-11 17:00:00" end-date="2013-04-03 18:00:00" disabled="false">
<group-strategy name="roundrobin">
<configuration><![CDATA[This is the configuration]]></configuration>
</group-strategy>
<entity id="1002" name="Mock2" start-date="2013-04-11 17:00:00" disabled="true">
</entity>
<entity id="1003" name="Mock3" start-date="2013-12-30 17:00:00" disabled="false">
</entity>
<entity id="1004" name="Mock4" end-date="2013-04-03 18:00:00" disabled="false">
</entity>
<entity id="1005" name="Mock5" start-date="2013-04-11 17:00:00" disabled="true">
</entity>
<entity id="1006" name="Mock6" start-date="2013-12-30 17:00:00" disabled="false">
</entity>
<entity id="1007" name="Mock7" end-date="2013-04-03 18:00:00" disabled="false">
</entity>
<entity id="1008" name="Mock8" start-date="2013-04-11 17:00:00" disabled="true">
</entity>
<entity id="1009" name="Mock9" start-date="2013-12-30 17:00:00" disabled="false">
</entity>
<entity id="1010" name="Mock10" end-date="2013-04-03 18:00:00" disabled="false">
</entity>
<entity id="1011" name="Mock11" start-date="2013-04-11 17:00:00" disabled="true">
</entity>
<entity id="1012" name="Mock12" start-date="2013-12-30 17:00:00" disabled="false">
</entity>
<entity id="1013" name="Mock13" end-date="2013-04-03 18:00:00" disabled="false">
</entity>
<entity id="1014" name="Mock14" start-date="2013-12-30 17:00:00" disabled="false">
</entity>
<entity id="1015" name="Mock15" end-date="2013-04-03 18:00:00" disabled="false">
</entity>
<entity id="1016" name="Mock16" start-date="2013-04-11 17:00:00" disabled="true">
</entity>
<entity id="1017" name="Mock17" start-date="2013-12-30 17:00:00" disabled="false">
</entity>
</abtest>
\ No newline at end of file
......@@ -115,6 +115,11 @@
<scope>${test-framework.scope}</scope>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.unidal.framework</groupId>
<artifactId>dal-jdbc</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
<build>
<finalName>cat</finalName>
......@@ -181,7 +186,7 @@
<configuration>
<manifest><![CDATA[${basedir}/src/main/resources/META-INF/dal/jdbc/report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/jdbc/alarm-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/jdbc/user-manifest.xml,]]></manifest>
${basedir}/src/main/resources/META-INF/dal/jdbc/user-manifest.xml,]]> <![CDATA[${basedir}/src/main/resources/META-INF/dal/jdbc/abtest-manifest.xml,]]></manifest>
</configuration>
</execution>
</executions>
......@@ -230,9 +235,9 @@ org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.compliance=1.6org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.compliance=1.6]]><![CDATA[org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.compliance=1.6org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.compliance=1.6]]></content>
</file>
</additionalConfig>
......
......@@ -19,6 +19,9 @@ final class CatDatabaseConfigurator extends AbstractJdbcResourceConfigurator {
defineSimpleTableProviderComponents(all, "cat", com.dianping.cat.home.dal.alarm._INDEX.getEntityClasses());
defineDaoComponents(all, com.dianping.cat.home.dal.alarm._INDEX.getDaoClasses());
defineSimpleTableProviderComponents(all, "cat", com.dianping.cat.home.dal.abtest._INDEX.getEntityClasses());
defineDaoComponents(all, com.dianping.cat.home.dal.abtest._INDEX.getDaoClasses());
return all;
}
}
......@@ -16,6 +16,7 @@ import com.dainping.cat.consumer.dal.report.ReportDao;
import com.dainping.cat.consumer.dal.report.TaskDao;
import com.dianping.cat.CatHomeModule;
import com.dianping.cat.configuration.ServerConfigManager;
import com.dianping.cat.home.dal.abtest.AbtestDao;
import com.dianping.cat.home.dal.report.DailygraphDao;
import com.dianping.cat.home.dal.report.DailyreportDao;
import com.dianping.cat.home.dal.report.GraphDao;
......@@ -206,6 +207,8 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
// for alarm module
all.addAll(new AlarmComponentConfigurator().defineComponents());
// for abtest module
return all;
}
}
package com.dianping.cat.system.page.abtest;
public enum ABTestEntityStatus {
RUNNING(0), STOPPED(1), READY(2), DISABLED(3),DEFALUT(4);
public static ABTestEntityStatus getByName(String name, ABTestEntityStatus defaultStatus) {
for (ABTestEntityStatus status : ABTestEntityStatus.values()) {
if (status.getName().equalsIgnoreCase(name)) {
return status;
}
}
return defaultStatus;
}
private int m_status;
private static final String[] s_status = { "Running", "Stopped", "Ready", "Disabled", "Default" };
private ABTestEntityStatus(int status) {
m_status = status;
}
public int getStatus() {
return m_status;
}
private String getName() {
return s_status[m_status];
}
}
package com.dianping.cat.system.page.abtest;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import com.dianping.cat.home.dal.abtest.Abtest;
public class ABTestReport {
private static Date s_startTime;
private static Date s_endTime;
static{
Calendar calendar = Calendar.getInstance();
calendar.set(2000, 1, 1);
s_startTime = calendar.getTime();
calendar.set(2100, 1, 1);
s_endTime = calendar.getTime();
}
private Abtest m_entity;
private ABTestEntityStatus m_status;
private Map<String, String> m_items;
public ABTestReport(Abtest entity){
m_entity = entity;
}
public ABTestReport(Abtest entity, Date now) {
m_entity = entity;
if (m_entity.getStartDate() == null) {
m_entity.setStartDate(s_startTime);
}
if (m_entity.getEndDate() == null) {
m_entity.setEndDate(s_endTime);
}
setStatus(now);
// TODO m_items
}
private void setStatus(Date now) {
if (now.before(m_entity.getStartDate())) {
m_status = ABTestEntityStatus.READY;
} else if (now.before(m_entity.getEndDate())) {
if (m_entity.isDisabled()) {
m_status = ABTestEntityStatus.STOPPED;
} else {
m_status = ABTestEntityStatus.RUNNING;
}
} else {
m_status = ABTestEntityStatus.DISABLED;
}
}
public Abtest getEntity() {
return m_entity;
}
public void setStatus(ABTestEntityStatus status) {
m_status = status;
}
public ABTestEntityStatus getStatus() {
return m_status;
}
public Map<String, String> getItems() {
return m_items;
}
}
package com.dianping.cat.system.page.abtest;
public enum Action implements org.unidal.web.mvc.Action {
VIEW("view");
VIEW("view"),
LIST("list"),
REPORT("report");
private String m_name;
......
package com.dianping.cat.system.page.abtest;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.servlet.ServletException;
import com.dianping.cat.system.SystemPage;
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;
import com.dianping.cat.Cat;
import com.dianping.cat.home.dal.abtest.Abtest;
import com.dianping.cat.home.dal.abtest.AbtestDao;
import com.dianping.cat.home.dal.abtest.AbtestEntity;
import com.dianping.cat.system.SystemPage;
public class Handler implements PageHandler<Context> {
private final int m_pageSize = 5;
@Inject
private JspViewer m_jspViewer;
@Inject
private AbtestDao m_abtestDao;
@Override
@PayloadMeta(Payload.class)
@InboundActionMeta(name = "abtest")
public void handleInbound(Context ctx) throws ServletException, IOException {
// display only, no action here
// TODO
}
@Override
@OutboundActionMeta(name = "abtest")
public void handleOutbound(Context ctx) throws ServletException, IOException {
Model model = new Model(ctx);
Payload payload = ctx.getPayload();
Action action = payload.getAction();
if (action == Action.LIST) {
renderListView(model, payload);
} else if (action == Action.VIEW) {
} else if (action == Action.REPORT) {
}
model.setAction(Action.VIEW);
model.setAction(action);
model.setPage(SystemPage.ABTEST);
m_jspViewer.view(ctx, model);
}
private void renderListView(Model model, Payload payload) {
List<ABTestReport> reports = new ArrayList<ABTestReport>();
List<Abtest> entities = new ArrayList<Abtest>();
ABTestEntityStatus status = ABTestEntityStatus.getByName(payload.getStatus(), ABTestEntityStatus.DEFALUT);
Date now = new Date();
try {
entities = m_abtestDao.findAllAbtest(AbtestEntity.READSET_FULL);
} catch (DalException e) {
Cat.logError(e);
}
List<Abtest> filterTests = new ArrayList<Abtest>();
int runningCount = 0, stoppedCount = 0, readyCount = 0, disableCount = 0;
for (Abtest abtest : entities) {
ABTestReport report = new ABTestReport(abtest, now);
if (report.getStatus() == status) {
filterTests.add(abtest);
}
switch (report.getStatus()) {
case RUNNING:
runningCount++;
break;
case STOPPED:
stoppedCount++;
break;
case READY:
readyCount++;
break;
case DISABLED:
disableCount++;
break;
}
}
model.setReadyCount(readyCount);
model.setRunningCount(runningCount);
model.setStoppedCount(stoppedCount);
model.setDisabledCount(disableCount);
if (status != ABTestEntityStatus.DEFALUT) {
entities = filterTests;
}
int totalSize = entities.size();
int totalPages = totalSize % m_pageSize == 0 ? (totalSize / m_pageSize) : (totalSize / m_pageSize + 1);
// safe guarder for pageNum
if (payload.getPageNum() >= totalPages) {
if (totalPages == 0) {
payload.setPageNum(1);
} else {
payload.setPageNum(totalPages);
}
} else if (payload.getPageNum() <= 0) {
payload.setPageNum(1);
}
int fromIndex = (payload.getPageNum() - 1) * m_pageSize;
int toIndex = (fromIndex + m_pageSize) <= totalSize ? (fromIndex + m_pageSize) : totalSize;
for(int i = fromIndex ; i < toIndex ; i++){
reports.add(new ABTestReport(entities.get(i), now));
}
model.setTotalPages(totalPages);
model.setDate(now);
model.setReports(reports);
}
}
......@@ -3,6 +3,9 @@ package com.dianping.cat.system.page.abtest;
public enum JspFile {
VIEW("/jsp/system/abtest.jsp"),
ALLTESTVIEW("/jsp/system/abtestAllTest.jsp"),
REPORT("/jsp/system/abtestReport.jsp")
;
private String m_path;
......
......@@ -11,6 +11,10 @@ public class JspViewer extends BaseJspViewer<SystemPage, Action, Context, Model>
switch (action) {
case VIEW:
return JspFile.VIEW.getPath();
case LIST:
return JspFile.ALLTESTVIEW.getPath();
case REPORT:
return JspFile.REPORT.getPath();
}
throw new RuntimeException("Unknown action: " + action);
......
package com.dianping.cat.system.page.abtest;
import java.util.Date;
import java.util.List;
import org.unidal.web.mvc.ViewModel;
import com.dianping.cat.abtest.spi.ABTestEntity;
import com.dianping.cat.system.SystemPage;
public class Model extends ViewModel<SystemPage, Action, Context> {
private String m_domain;
private Date m_date;
private ABTestEntity m_entity;
private List<ABTestReport> m_reports;
private int m_totalPages;
private int m_runningCount;
private int m_readyCount;
private int m_stoppedCount;
private int m_disabledCount;
public Model(Context ctx) {
super(ctx);
}
......@@ -35,4 +51,61 @@ public class Model extends ViewModel<SystemPage, Action, Context> {
public void setDomain(String domain) {
m_domain = domain;
}
public ABTestEntity getEntity() {
return m_entity;
}
public void setEntity(ABTestEntity entity) {
m_entity = entity;
}
public List<ABTestReport> getReports() {
return m_reports;
}
public void setReports(List<ABTestReport> reports) {
m_reports = reports;
}
public int getTotalPages() {
return m_totalPages;
}
public void setTotalPages(int totalPages) {
m_totalPages = totalPages;
}
public int getRunningCount() {
return m_runningCount;
}
public void setRunningCount(int runningCount) {
m_runningCount = runningCount;
}
public int getReadyCount() {
return m_readyCount;
}
public void setReadyCount(int readyCount) {
m_readyCount = readyCount;
}
public int getStoppedCount() {
return m_stoppedCount;
}
public void setStoppedCount(int stoppedCount) {
m_stoppedCount = stoppedCount;
}
public int getDisabledCount() {
return m_disabledCount;
}
public void setDisabledCount(int disabledCount) {
m_disabledCount = disabledCount;
}
}
package com.dianping.cat.system.page.abtest;
import com.dianping.cat.system.SystemPage;
import org.codehaus.plexus.util.StringUtils;
import org.unidal.web.mvc.ActionContext;
import org.unidal.web.mvc.ActionPayload;
import org.unidal.web.mvc.payload.annotation.FieldMeta;
......@@ -10,15 +12,47 @@ public class Payload implements ActionPayload<SystemPage, Action> {
@FieldMeta("op")
private Action m_action;
@FieldMeta("status")
private String m_status;
@FieldMeta("pageNum")
private int m_pageNum;
public void setAction(String action) {
m_action = Action.getByName(action, Action.VIEW);
if(action.equalsIgnoreCase(Action.REPORT.getName())){
m_action = Action.getByName(action, Action.REPORT);
}else if(action.equalsIgnoreCase(Action.LIST.getName())){
m_action = Action.getByName(action, Action.LIST);
}else{
m_action = Action.getByName(action, Action.VIEW);
}
}
@Override
public Action getAction() {
return m_action;
}
public String getStatus() {
return m_status;
}
public void setStatus(String status) {
if(StringUtils.isBlank(status)){
m_status = ABTestEntityStatus.DEFALUT.name();
}else{
m_status = status;
}
}
public int getPageNum() {
return m_pageNum;
}
public void setPageNum(int pageNum) {
m_pageNum = pageNum;
}
@Override
public SystemPage getPage() {
......
<?xml version="1.0" encoding="UTF-8"?>
<entities>
<entity name="abtest" table="abtest" alias="a">
<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="45" nullable="false" />
<member name="start-date" field="start_date" value-type="Date" />
<member name="end-date" field="end_date" value-type="Date" />
<member name="is-disabled" field="isDisabled" value-type="int" length="3" nullable="false" />
<member name="domains" field="domains" value-type="String" length="100" nullable="false" />
<member name="strategy-id" field="strategy_id" value-type="int" length="10" nullable="false" />
<member name="description" field="description" value-type="String" length="100" />
<member name="creation-date" field="creation_date" value-type="Date" nullable="false" />
<member name="modify-date" field="modify_date" value-type="Date" />
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
<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="group-strategy" table="groupStrategy" alias="g">
<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="45" nullable="false" />
<member name="alias" field="alias" value-type="String" length="45" nullable="false" />
<member name="class-name" field="className" value-type="String" length="45" nullable="false" />
<member name="description" field="description" value-type="String" length="45" />
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
<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>
</entities>
<?xml version="1.0" encoding="UTF-8"?>
<entities do-package="com.dianping.cat.home.dal.abtest" gen="true"
alias="a">
<entity name="abtest" table="abtest" alias="a">
<member name="creation-date" insert-expr="NOW()" />
<member name="modify-date" insert-expr="NOW()" update-expr="NOW()" />
<member name="disabled" field="isDisabled" value-type="boolean" length="3" nullable="false" />
<query-defs>
<query name="find-all-abtest" type="SELECT" multiple="true">
<statement><![CDATA[
SELECT <FIELDS/>
FROM <TABLE/> ORDER BY <FIELD name='creation-date'/> DESC
]]></statement>
</query>
</query-defs>
</entity>
</entities>
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<file path="abtest-codegen.xml" />
<file path="abtest-dal.xml" />
</manifest>
<?xml version="1.0" encoding="UTF-8"?>
<entities>
<entity name="alarm-template" table="alarmTemplate" alias="a">
<entity name="alarm-rule" table="alarmRule" alias="a">
<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="64" />
<member name="template-id" field="template_id" value-type="int" length="10" nullable="false" />
<member name="domain" field="domain" value-type="String" length="64" />
<member name="content" field="content" value-type="String" length="65535" />
<member name="creation-date" field="creation_date" value-type="Date" />
<member name="modify-date" field="modify_date" value-type="Date" />
......@@ -17,30 +18,34 @@
<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>
<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>
<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>
<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>
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='id'/> = ${key-id}]]></statement>
</query>
</query-defs>
</entity>
<entity name="alarm-rule" table="alarmRule" alias="a2">
<member name="id" field="id" value-type="int" length="10" nullable="false" key="true" auto-increment="true" />
<member name="template-id" field="template_id" value-type="int" length="10" nullable="false" />
<member name="domain" field="domain" value-type="String" length="64" />
<member name="content" field="content" value-type="String" length="65535" />
<entity name="alarm-rule-subscription" table="alarmRuleSubscription" alias="a2">
<member name="alarm-rule-id" field="alarm_rule_id" value-type="int" length="10" nullable="false" key="true" />
<member name="user-id" field="user_id" value-type="int" length="10" nullable="false" key="true" />
<member name="creation-date" field="creation_date" value-type="Date" />
<member name="modify-date" field="modify_date" value-type="Date" />
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
<var name="key-alarm-rule-id" value-type="int" key-member="alarm-rule-id" />
<var name="key-user-id" value-type="int" key-member="user-id" />
<primary-key name="PRIMARY" members="alarm_rule_id, user_id" />
<readsets>
<readset name="FULL" all="true" />
</readsets>
......@@ -49,29 +54,39 @@
</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>
<param name="key-alarm-rule-id" />
<param name="key-user-id" />
<statement><![CDATA[SELECT <FIELDS/>
FROM <TABLE/>
WHERE <FIELD name='alarm-rule-id'/> = ${key-alarm-rule-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
</query>
<query name="insert" type="INSERT">
<statement><![CDATA[INSERT INTO <TABLE/>(<FIELDS/>) VALUES(<VALUES/>)]]></statement>
<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>
<param name="key-alarm-rule-id" />
<param name="key-user-id" />
<statement><![CDATA[UPDATE <TABLE/>
SET <FIELDS/>
WHERE <FIELD name='alarm-rule-id'/> = ${key-alarm-rule-id} AND <FIELD name='user-id'/> = ${key-user-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>
<param name="key-alarm-rule-id" />
<param name="key-user-id" />
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='alarm-rule-id'/> = ${key-alarm-rule-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
</query>
</query-defs>
</entity>
<entity name="alarm-rule-subscription" table="alarmRuleSubscription" alias="a3">
<member name="alarm-rule-id" field="alarm_rule_id" value-type="int" length="10" nullable="false" key="true" />
<member name="user-id" field="user_id" value-type="int" length="10" nullable="false" key="true" />
<entity name="alarm-template" table="alarmTemplate" alias="a3">
<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="64" />
<member name="content" field="content" value-type="String" length="65535" />
<member name="creation-date" field="creation_date" value-type="Date" />
<var name="key-alarm-rule-id" value-type="int" key-member="alarm-rule-id" />
<var name="key-user-id" value-type="int" key-member="user-id" />
<primary-key name="PRIMARY" members="alarm_rule_id, user_id" />
<member name="modify-date" field="modify_date" value-type="Date" />
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
<readsets>
<readset name="FULL" all="true" />
</readsets>
......@@ -80,22 +95,25 @@
</updatesets>
<query-defs>
<query name="find-by-PK" type="SELECT">
<param name="key-alarm-rule-id" />
<param name="key-user-id" />
<statement><![CDATA[SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='alarm-rule-id'/> = ${key-alarm-rule-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
<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>
<statement><![CDATA[INSERT INTO <TABLE/>(<FIELDS/>)
VALUES(<VALUES/>)]]></statement>
</query>
<query name="update-by-PK" type="UPDATE">
<param name="key-alarm-rule-id" />
<param name="key-user-id" />
<statement><![CDATA[UPDATE <TABLE/> SET <FIELDS/> WHERE <FIELD name='alarm-rule-id'/> = ${key-alarm-rule-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
<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-alarm-rule-id" />
<param name="key-user-id" />
<statement><![CDATA[DELETE FROM <TABLE/> WHERE <FIELD name='alarm-rule-id'/> = ${key-alarm-rule-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
<param name="key-id" />
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='id'/> = ${key-id}]]></statement>
</query>
</query-defs>
</entity>
......@@ -119,18 +137,24 @@
<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>
<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>
<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>
<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>
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='id'/> = ${key-id}]]></statement>
</query>
</query-defs>
</entity>
......@@ -151,18 +175,24 @@
<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>
<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>
<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>
<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>
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='id'/> = ${key-id}]]></statement>
</query>
</query-defs>
</entity>
......@@ -183,20 +213,26 @@
<query name="find-by-PK" type="SELECT">
<param name="key-scheduled-report-id" />
<param name="key-user-id" />
<statement><![CDATA[SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
<statement><![CDATA[SELECT <FIELDS/>
FROM <TABLE/>
WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
</query>
<query name="insert" type="INSERT">
<statement><![CDATA[INSERT INTO <TABLE/>(<FIELDS/>) VALUES(<VALUES/>)]]></statement>
<statement><![CDATA[INSERT INTO <TABLE/>(<FIELDS/>)
VALUES(<VALUES/>)]]></statement>
</query>
<query name="update-by-PK" type="UPDATE">
<param name="key-scheduled-report-id" />
<param name="key-user-id" />
<statement><![CDATA[UPDATE <TABLE/> SET <FIELDS/> WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
<statement><![CDATA[UPDATE <TABLE/>
SET <FIELDS/>
WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
</query>
<query name="delete-by-PK" type="DELETE">
<param name="key-scheduled-report-id" />
<param name="key-user-id" />
<statement><![CDATA[DELETE FROM <TABLE/> WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
</query>
</query-defs>
</entity>
......
......@@ -4,7 +4,7 @@
<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="20" nullable="false" />
<member name="ip" field="ip" value-type="String" length="20" />
<member name="domain" field="domain" value-type="String" length="20" nullable="false" />
<member name="domain" field="domain" value-type="String" length="50" nullable="false" />
<member name="period" field="period" value-type="Date" nullable="false" />
<member name="type" field="type" value-type="int" length="3" nullable="false" />
<member name="detail-content" field="detail_content" value-type="String" length="16777215" nullable="false" />
......@@ -22,18 +22,24 @@
<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>
<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>
<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>
<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>
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='id'/> = ${key-id}]]></statement>
</query>
</query-defs>
</entity>
......@@ -41,7 +47,7 @@
<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="20" nullable="false" />
<member name="ip" field="ip" value-type="String" length="20" nullable="false" />
<member name="domain" field="domain" value-type="String" length="20" nullable="false" />
<member name="domain" field="domain" value-type="String" length="50" nullable="false" />
<member name="period" field="period" value-type="Date" nullable="false" />
<member name="type" field="type" value-type="int" length="3" nullable="false" />
<member name="content" field="content" value-type="String" length="16777215" nullable="false" />
......@@ -49,7 +55,6 @@
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
<index name="period" unique="true" members="period ASC, domain ASC, name ASC" />
<index name="type" members="type ASC" />
<readsets>
<readset name="FULL" all="true" />
</readsets>
......@@ -59,18 +64,24 @@
<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>
<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>
<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>
<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>
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='id'/> = ${key-id}]]></statement>
</query>
</query-defs>
</entity>
......@@ -78,7 +89,7 @@
<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="20" nullable="false" />
<member name="ip" field="ip" value-type="String" length="20" />
<member name="domain" field="domain" value-type="String" length="20" nullable="false" />
<member name="domain" field="domain" value-type="String" length="50" nullable="false" />
<member name="period" field="period" value-type="Date" nullable="false" />
<member name="type" field="type" value-type="int" length="3" nullable="false" />
<member name="detail-content" field="detail_content" value-type="String" length="16777215" nullable="false" />
......@@ -96,33 +107,37 @@
<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>
<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>
<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>
<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>
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='id'/> = ${key-id}]]></statement>
</query>
</query-defs>
</entity>
<entity name="weeklyreport" table="weeklyreport" alias="w">
<entity name="location" table="location" alias="l">
<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="20" nullable="false" />
<member name="ip" field="ip" value-type="String" length="20" nullable="false" />
<member name="domain" field="domain" value-type="String" length="20" nullable="false" />
<member name="period" field="period" value-type="Date" nullable="false" />
<member name="type" field="type" value-type="int" length="3" nullable="false" />
<member name="content" field="content" value-type="String" length="16777215" nullable="false" />
<member name="lat" field="lat" value-type="double" length="22" nullable="false" />
<member name="lng" field="lng" value-type="double" length="22" nullable="false" />
<member name="total" field="total" value-type="int" length="10" nullable="false" />
<member name="transaction-date" field="transaction_date" value-type="Date" nullable="false" />
<member name="creation-date" field="creation_date" value-type="Date" nullable="false" />
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
<index name="period" unique="true" members="period ASC, domain ASC, name ASC" />
<index name="transaction_date_lat_lng" unique="true" members="transaction_date ASC, lat ASC, lng ASC" />
<readsets>
<readset name="FULL" all="true" />
</readsets>
......@@ -132,18 +147,24 @@
<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>
<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>
<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>
<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>
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='id'/> = ${key-id}]]></statement>
</query>
</query-defs>
</entity>
......@@ -151,7 +172,7 @@
<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="20" nullable="false" />
<member name="ip" field="ip" value-type="String" length="20" nullable="false" />
<member name="domain" field="domain" value-type="String" length="20" nullable="false" />
<member name="domain" field="domain" value-type="String" length="50" nullable="false" />
<member name="period" field="period" value-type="Date" nullable="false" />
<member name="type" field="type" value-type="int" length="3" nullable="false" />
<member name="content" field="content" value-type="String" length="16777215" nullable="false" />
......@@ -168,31 +189,39 @@
<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>
<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>
<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>
<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>
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='id'/> = ${key-id}]]></statement>
</query>
</query-defs>
</entity>
<entity name="location" table="location" alias="l">
<entity name="weeklyreport" table="weeklyreport" alias="w">
<member name="id" field="id" value-type="int" length="10" nullable="false" key="true" auto-increment="true" />
<member name="lat" field="lat" value-type="double" length="22" nullable="false" />
<member name="lng" field="lng" value-type="double" length="22" nullable="false" />
<member name="total" field="total" value-type="int" length="10" nullable="false" />
<member name="transaction-date" field="transaction_date" value-type="Date" nullable="false" />
<member name="name" field="name" value-type="String" length="20" nullable="false" />
<member name="ip" field="ip" value-type="String" length="20" nullable="false" />
<member name="domain" field="domain" value-type="String" length="50" nullable="false" />
<member name="period" field="period" value-type="Date" nullable="false" />
<member name="type" field="type" value-type="int" length="3" nullable="false" />
<member name="content" field="content" value-type="String" length="16777215" nullable="false" />
<member name="creation-date" field="creation_date" value-type="Date" nullable="false" />
<var name="key-id" value-type="int" key-member="id" />
<primary-key name="PRIMARY" members="id" />
<index name="transaction_date_lat_lng" unique="true" members="transaction_date ASC, lat ASC, lng ASC" />
<index name="period" unique="true" members="period ASC, domain ASC, name ASC" />
<readsets>
<readset name="FULL" all="true" />
</readsets>
......@@ -202,18 +231,24 @@
<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>
<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>
<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>
<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>
<statement><![CDATA[DELETE FROM <TABLE/>
WHERE <FIELD name='id'/> = ${key-id}]]></statement>
</query>
</query-defs>
</entity>
......
......@@ -1204,11 +1204,11 @@
</component>
<component>
<role>org.unidal.dal.jdbc.mapping.TableProvider</role>
<role-hint>weeklyreport</role-hint>
<role-hint>location</role-hint>
<implementation>org.unidal.dal.jdbc.mapping.SimpleTableProvider</implementation>
<configuration>
<logical-table-name>weeklyreport</logical-table-name>
<physical-table-name>weeklyreport</physical-table-name>
<logical-table-name>location</logical-table-name>
<physical-table-name>location</physical-table-name>
<data-source-name>cat</data-source-name>
</configuration>
</component>
......@@ -1224,11 +1224,11 @@
</component>
<component>
<role>org.unidal.dal.jdbc.mapping.TableProvider</role>
<role-hint>location</role-hint>
<role-hint>weeklyreport</role-hint>
<implementation>org.unidal.dal.jdbc.mapping.SimpleTableProvider</implementation>
<configuration>
<logical-table-name>location</logical-table-name>
<physical-table-name>location</physical-table-name>
<logical-table-name>weeklyreport</logical-table-name>
<physical-table-name>weeklyreport</physical-table-name>
<data-source-name>cat</data-source-name>
</configuration>
</component>
......@@ -1260,8 +1260,8 @@
</requirements>
</component>
<component>
<role>com.dianping.cat.home.dal.report.WeeklyreportDao</role>
<implementation>com.dianping.cat.home.dal.report.WeeklyreportDao</implementation>
<role>com.dianping.cat.home.dal.report.LocationDao</role>
<implementation>com.dianping.cat.home.dal.report.LocationDao</implementation>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.QueryEngine</role>
......@@ -1278,8 +1278,8 @@
</requirements>
</component>
<component>
<role>com.dianping.cat.home.dal.report.LocationDao</role>
<implementation>com.dianping.cat.home.dal.report.LocationDao</implementation>
<role>com.dianping.cat.home.dal.report.WeeklyreportDao</role>
<implementation>com.dianping.cat.home.dal.report.WeeklyreportDao</implementation>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.QueryEngine</role>
......@@ -1288,31 +1288,31 @@
</component>
<component>
<role>org.unidal.dal.jdbc.mapping.TableProvider</role>
<role-hint>alarm-template</role-hint>
<role-hint>alarm-rule</role-hint>
<implementation>org.unidal.dal.jdbc.mapping.SimpleTableProvider</implementation>
<configuration>
<logical-table-name>alarm-template</logical-table-name>
<physical-table-name>alarmTemplate</physical-table-name>
<logical-table-name>alarm-rule</logical-table-name>
<physical-table-name>alarmRule</physical-table-name>
<data-source-name>cat</data-source-name>
</configuration>
</component>
<component>
<role>org.unidal.dal.jdbc.mapping.TableProvider</role>
<role-hint>alarm-rule</role-hint>
<role-hint>alarm-rule-subscription</role-hint>
<implementation>org.unidal.dal.jdbc.mapping.SimpleTableProvider</implementation>
<configuration>
<logical-table-name>alarm-rule</logical-table-name>
<physical-table-name>alarmRule</physical-table-name>
<logical-table-name>alarm-rule-subscription</logical-table-name>
<physical-table-name>alarmRuleSubscription</physical-table-name>
<data-source-name>cat</data-source-name>
</configuration>
</component>
<component>
<role>org.unidal.dal.jdbc.mapping.TableProvider</role>
<role-hint>alarm-rule-subscription</role-hint>
<role-hint>alarm-template</role-hint>
<implementation>org.unidal.dal.jdbc.mapping.SimpleTableProvider</implementation>
<configuration>
<logical-table-name>alarm-rule-subscription</logical-table-name>
<physical-table-name>alarmRuleSubscription</physical-table-name>
<logical-table-name>alarm-template</logical-table-name>
<physical-table-name>alarmTemplate</physical-table-name>
<data-source-name>cat</data-source-name>
</configuration>
</component>
......@@ -1347,8 +1347,8 @@
</configuration>
</component>
<component>
<role>com.dianping.cat.home.dal.alarm.AlarmTemplateDao</role>
<implementation>com.dianping.cat.home.dal.alarm.AlarmTemplateDao</implementation>
<role>com.dianping.cat.home.dal.alarm.AlarmRuleDao</role>
<implementation>com.dianping.cat.home.dal.alarm.AlarmRuleDao</implementation>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.QueryEngine</role>
......@@ -1356,8 +1356,8 @@
</requirements>
</component>
<component>
<role>com.dianping.cat.home.dal.alarm.AlarmRuleDao</role>
<implementation>com.dianping.cat.home.dal.alarm.AlarmRuleDao</implementation>
<role>com.dianping.cat.home.dal.alarm.AlarmRuleSubscriptionDao</role>
<implementation>com.dianping.cat.home.dal.alarm.AlarmRuleSubscriptionDao</implementation>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.QueryEngine</role>
......@@ -1365,8 +1365,8 @@
</requirements>
</component>
<component>
<role>com.dianping.cat.home.dal.alarm.AlarmRuleSubscriptionDao</role>
<implementation>com.dianping.cat.home.dal.alarm.AlarmRuleSubscriptionDao</implementation>
<role>com.dianping.cat.home.dal.alarm.AlarmTemplateDao</role>
<implementation>com.dianping.cat.home.dal.alarm.AlarmTemplateDao</implementation>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.QueryEngine</role>
......@@ -1400,6 +1400,44 @@
</requirement>
</requirements>
</component>
<component>
<role>org.unidal.dal.jdbc.mapping.TableProvider</role>
<role-hint>abtest</role-hint>
<implementation>org.unidal.dal.jdbc.mapping.SimpleTableProvider</implementation>
<configuration>
<logical-table-name>abtest</logical-table-name>
<physical-table-name>abtest</physical-table-name>
<data-source-name>cat</data-source-name>
</configuration>
</component>
<component>
<role>org.unidal.dal.jdbc.mapping.TableProvider</role>
<role-hint>group-strategy</role-hint>
<implementation>org.unidal.dal.jdbc.mapping.SimpleTableProvider</implementation>
<configuration>
<logical-table-name>group-strategy</logical-table-name>
<physical-table-name>groupStrategy</physical-table-name>
<data-source-name>cat</data-source-name>
</configuration>
</component>
<component>
<role>com.dianping.cat.home.dal.abtest.AbtestDao</role>
<implementation>com.dianping.cat.home.dal.abtest.AbtestDao</implementation>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.QueryEngine</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.home.dal.abtest.GroupStrategyDao</role>
<implementation>com.dianping.cat.home.dal.abtest.GroupStrategyDao</implementation>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.QueryEngine</role>
</requirement>
</requirements>
</component>
<component>
<role>org.unidal.dal.jdbc.datasource.DataSource</role>
<role-hint>user</role-hint>
......@@ -1474,6 +1512,11 @@
<component>
<role>com.dianping.cat.report.page.home.JspViewer</role>
<implementation>com.dianping.cat.report.page.home.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.consumer.RealtimeConsumer</role>
......@@ -1556,6 +1599,11 @@
<component>
<role>com.dianping.cat.report.page.problem.JspViewer</role>
<implementation>com.dianping.cat.report.page.problem.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.configuration.ServerConfigManager</role>
......@@ -1605,6 +1653,11 @@
<component>
<role>com.dianping.cat.report.page.transaction.JspViewer</role>
<implementation>com.dianping.cat.report.page.transaction.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.transaction.XmlViewer</role>
......@@ -1651,6 +1704,11 @@
<component>
<role>com.dianping.cat.report.page.event.JspViewer</role>
<implementation>com.dianping.cat.report.page.event.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.heartbeat.Handler</role>
......@@ -1693,6 +1751,11 @@
<component>
<role>com.dianping.cat.report.page.heartbeat.JspViewer</role>
<implementation>com.dianping.cat.report.page.heartbeat.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.logview.Handler</role>
......@@ -1714,6 +1777,11 @@
<component>
<role>com.dianping.cat.report.page.logview.JspViewer</role>
<implementation>com.dianping.cat.report.page.logview.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.ip.Handler</role>
......@@ -1735,6 +1803,11 @@
<component>
<role>com.dianping.cat.report.page.ip.JspViewer</role>
<implementation>com.dianping.cat.report.page.ip.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.model.Handler</role>
......@@ -1808,6 +1881,11 @@
<component>
<role>com.dianping.cat.report.page.model.JspViewer</role>
<implementation>com.dianping.cat.report.page.model.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.model.event.LocalEventService</role>
......@@ -2032,32 +2110,12 @@
<component>
<role>com.dianping.cat.report.page.sql.JspViewer</role>
<implementation>com.dianping.cat.report.page.sql.JspViewer</implementation>
</component>
<component>
<role>com.dianping.cat.report.page.heatmap.Handler</role>
<implementation>com.dianping.cat.report.page.heatmap.Handler</implementation>
<requirements>
<requirement>
<role>com.dianping.cat.job.sql.dal.LocationRecordDao</role>
</requirement>
<requirement>
<role>com.dianping.cat.report.page.heatmap.JspViewer</role>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.job.sql.dal.LocationRecordDao</role>
<implementation>com.dianping.cat.job.sql.dal.LocationRecordDao</implementation>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.QueryEngine</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.heatmap.JspViewer</role>
<implementation>com.dianping.cat.report.page.heatmap.JspViewer</implementation>
</component>
<component>
<role>com.dianping.cat.report.page.dashboard.Handler</role>
<implementation>com.dianping.cat.report.page.dashboard.Handler</implementation>
......@@ -2085,6 +2143,11 @@
<component>
<role>com.dianping.cat.report.page.dashboard.JspViewer</role>
<implementation>com.dianping.cat.report.page.dashboard.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.task.Handler</role>
......@@ -2104,6 +2167,11 @@
<component>
<role>com.dianping.cat.report.page.task.JspViewer</role>
<implementation>com.dianping.cat.report.page.task.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.task.spi.ReportFacade</role>
......@@ -2579,6 +2647,11 @@
<component>
<role>com.dianping.cat.report.page.matrix.JspViewer</role>
<implementation>com.dianping.cat.report.page.matrix.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.health.Handler</role>
......@@ -2601,6 +2674,11 @@
<component>
<role>com.dianping.cat.report.page.health.JspViewer</role>
<implementation>com.dianping.cat.report.page.health.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.health.HistoryGraphs</role>
......@@ -2637,6 +2715,11 @@
<component>
<role>com.dianping.cat.report.page.cross.JspViewer</role>
<implementation>com.dianping.cat.report.page.cross.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.cache.Handler</role>
......@@ -2666,6 +2749,11 @@
<component>
<role>com.dianping.cat.report.page.cache.JspViewer</role>
<implementation>com.dianping.cat.report.page.cache.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.database.Handler</role>
......@@ -2687,6 +2775,11 @@
<component>
<role>com.dianping.cat.report.page.database.JspViewer</role>
<implementation>com.dianping.cat.report.page.database.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.state.Handler</role>
......@@ -2714,6 +2807,11 @@
<component>
<role>com.dianping.cat.report.page.state.JspViewer</role>
<implementation>com.dianping.cat.report.page.state.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.state.StateGraphs</role>
......@@ -2739,6 +2837,11 @@
<component>
<role>com.dianping.cat.report.page.query.JspViewer</role>
<implementation>com.dianping.cat.report.page.query.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.report.page.top.Handler</role>
......@@ -2763,6 +2866,11 @@
<component>
<role>com.dianping.cat.report.page.top.JspViewer</role>
<implementation>com.dianping.cat.report.page.top.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.system.SystemModule</role>
......@@ -2792,6 +2900,11 @@
<component>
<role>com.dianping.cat.system.page.alarm.JspViewer</role>
<implementation>com.dianping.cat.system.page.alarm.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.system.page.alarm.RecordManager</role>
......@@ -2928,6 +3041,11 @@
<component>
<role>com.dianping.cat.system.page.login.JspViewer</role>
<implementation>com.dianping.cat.system.page.login.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.system.page.login.service.SigninService</role>
......@@ -2988,6 +3106,11 @@
<component>
<role>com.dianping.cat.system.page.project.JspViewer</role>
<implementation>com.dianping.cat.system.page.project.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dainping.cat.consumer.dal.report.ProjectDao</role>
......@@ -3017,11 +3140,28 @@
<requirement>
<role>com.dianping.cat.system.page.abtest.JspViewer</role>
</requirement>
<requirement>
<role>com.dianping.cat.home.dal.abtest.AbtestDao</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.system.page.abtest.JspViewer</role>
<implementation>com.dianping.cat.system.page.abtest.JspViewer</implementation>
<requirements>
<requirement>
<role>org.unidal.web.mvc.view.model.ModelHandler</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.home.dal.abtest.AbtestDao</role>
<implementation>com.dianping.cat.home.dal.abtest.AbtestDao</implementation>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.QueryEngine</role>
</requirement>
</requirements>
</component>
<component>
<role>com.dianping.cat.system.alarm.AlarmRuleCreator</role>
......
<?xml version="1.0" encoding="utf-8"?>
<wizard package="com.dianping.cat">
<jdbc package="com.dianping.cat.home.dal" name="cat">
<datasource>
......@@ -23,6 +24,10 @@
<table name="scheduledReport"/>
<table name="scheduledReportSubscription"/>
</group>
<group name="abtest" package="com.dianping.cat.home.dal.abtest">
<table name="abtest"/>
<table name="groupStrategy"/>
</group>
</jdbc>
<jdbc package="com.dainping.cat.home.dal" name="user">
<datasource>
......
/*!
* Bootstrap v2.3.1-j6
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world by @mdo and @fat, extended by @ArnoldDaniels.
*/
.clearfix {
*zoom: 1;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
line-height: 0;
}
.clearfix:after {
clear: both;
}
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.input-block-level {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
tr.rowlink td {
cursor: pointer;
}
tr.rowlink td.nolink {
cursor: auto;
}
.table tbody tr.rowlink:hover td {
background-color: #cfcfcf;
}
a.rowlink {
color: inherit;
font: inherit;
text-decoration: inherit;
}
/*!
* Bootstrap v2.3.1-j6
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world by @mdo and @fat, extended by @ArnoldDaniels.
*/
.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0;}
.clearfix:after{clear:both;}
.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}
.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
tr.rowlink td{cursor:pointer;}tr.rowlink td.nolink{cursor:auto;}
.table tbody tr.rowlink:hover td{background-color:#cfcfcf;}
a.rowlink{color:inherit;font:inherit;text-decoration:inherit;}
$(document).ready(function() {
$('#ckall').click(function() {
if ($('#ckall').is(':checked')) {
$(".table input[type='checkbox']").prop('checked', true);
} else {
$(".table input[type='checkbox']").prop('checked', false);
}
});
$("#prevNavigation").click(function(){
//$(".pager .disabled").not("#prevNavigation").not("nextNavigation").next()
});
});
\ No newline at end of file
/* ============================================================
* bootstrap-rowlink.js j1
* http://jasny.github.com/bootstrap/javascript.html#rowlink
* ============================================================
* Copyright 2012 Jasny BV, Netherlands.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function ($) {
"use strict"; // jshint ;_;
var Rowlink = function (element, options) {
options = $.extend({}, $.fn.rowlink.defaults, options)
var tr = element.nodeName.toLowerCase() == 'tr' ? $(element) : $(element).find('tr:has(td)')
tr.each(function() {
var link = $(this).find(options.target).first()
if (!link.length) return
var href = link.attr('href')
$(this).find('td').not('.nolink').click(function() {
window.location = href;
})
$(this).addClass('rowlink')
link.replaceWith(link.html())
})
}
/* ROWLINK PLUGIN DEFINITION
* =========================== */
$.fn.rowlink = function (options) {
return this.each(function () {
var $this = $(this)
, data = $this.data('rowlink')
if (!data) $this.data('rowlink', (data = new Rowlink(this, options)))
})
}
$.fn.rowlink.defaults = {
target: "a"
}
$.fn.rowlink.Constructor = Rowlink
/* ROWLINK DATA-API
* ================== */
$(function () {
$('[data-provide="rowlink"],[data-provides="rowlink"]').each(function () {
$(this).rowlink($(this).data())
})
})
}(window.jQuery);
/**
* Bootstrap.js by @mdo and @fat, extended by @ArnoldDaniels.
* plugins: bootstrap-rowlink.js
* Copyright 2012 Twitter, Inc.
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/
!function(e){var t=function(t,n){n=e.extend({},e.fn.rowlink.defaults,n);var r=t.nodeName.toLowerCase()=="tr"?e(t):e(t).find("tr:has(td)");r.each(function(){var t=e(this).find(n.target).first();if(!t.length)return;var r=t.attr("href");e(this).find("td").not(".nolink").click(function(){window.location=r}),e(this).addClass("rowlink"),t.replaceWith(t.html())})};e.fn.rowlink=function(n){return this.each(function(){var r=e(this),i=r.data("rowlink");i||r.data("rowlink",i=new t(this,n))})},e.fn.rowlink.defaults={target:"a"},e.fn.rowlink.Constructor=t,e(function(){e('[data-provide="rowlink"],[data-provides="rowlink"]').each(function(){e(this).rowlink(e(this).data())})})}(window.jQuery)
\ No newline at end of file
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="a" uri="/WEB-INF/app.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="res" uri="http://www.unidal.org/webres"%>
<%@ taglib prefix="w" uri="http://www.unidal.org/web/core"%>
<jsp:useBean id="ctx" type="com.dianping.cat.system.page.abtest.Context" scope="request" />
<jsp:useBean id="payload" type="com.dianping.cat.system.page.abtest.Payload" scope="request" />
<jsp:useBean id="model" type="com.dianping.cat.system.page.abtest.Model" scope="request" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<a:body>
<res:useCss value="${res.css.local['bootstrap.css']}" target="head-css" />
<res:useJs value="${res.js.local['bootstrap.min.js']}" target="head-js" />
<res:useCss value="${res.css.local['bootstrap-rowlink.css']}" target="head-css" />
<res:useJs value="${res.js.local['bootstrap-rowlink.min.js']}" target="head-js" />
<res:useJs value="${res.js.local['abtestAllTest.js']}" target="head-js" />
<style>
.statusSpan {
float: right;
margin-right: 0.5em;
padding-right: 5px;
padding-left: 5px;
}
.selected {
background-color: #D8DFEA;
border-radius: 5px;
font-weight: bold;
padding-left: 4px;
}
.liHover > li {
line-height: 1.3em;
}
input.search-query {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
#search-submit {
position: absolute;
top: 6px;
right: 10px;
display: inline-block;
width: 14px;
height: 14px;
*margin-right: .3em;
line-height: 14px;
text-indent: -9999px;
vertical-align: text-top;
cursor: pointer;
background-color: transparent;
background-image: url("${model.webapp}/img/glyphicons-halflings.png");
background-position: -48px 0;
background-repeat: no-repeat;
border: 0 none;
opacity: 0.75;
}
tr.middle > td {
vertical-align: middle;
padding-bottom: 0;
}
tr.center > td{
text-align: center;
}
tr.centerth > th{
text-align: center;
}
</style>
<br>
<div class="row-fluid clearfix">
<div class="span2 column">
<form class="navbar-search" action="">
<input name="q" id="search" class="search-query"
placeholder="Search..."> <input type="submit"
value="Search" id="search-submit">
</form>
<div style="margin-top: 40px;">
<ul class="nav nav-list well liHover">
<li class="nav-header">ABTest Status</li>
<li class="divider" />
<li${payload.status eq 'running' ? ' class="selected"' : ''}>
<a href="?op=list&status=running">
<img height="12" width="12" src="${res.img.local['RUNNING_black_small.png']}"> running
<span class="badge statusSpan">${model.runningCount}</span>
</a>
</li>
<li${payload.status eq 'disabled' ? ' class="selected"' : ''}>
<a href="?op=list&status=disabled">
<img height="12" width="12" src="${res.img.local['PAUSED_black_small.png']}"> disabled
<span class="badge statusSpan">${model.disabledCount}</span>
</a>
</li>
<li${payload.status eq 'ready' ? ' class="selected"' : ''}>
<a href="?op=list&status=ready">
<img height="12" width="12" src="${res.img.local['READY_black_small.png']}"> ready to start
<span class="badge statusSpan">${model.readyCount}</span>
</a>
</li>
<li${payload.status eq 'stopped' ? ' class="selected"' : ''}>
<a href="?op=list&status=stopped">
<img height="12" width="12" src="${res.img.local['STOPPED_black_small.png']}"> stopped
<span class="badge statusSpan">${model.stoppedCount}</span>
</a>
</li>
</ul>
</div>
</div>
<div class="span10 column">
<div style="margin-bottom: 10px;">
<button class="btn" type="button">
<label class="checkbox"> <input id="ckall" type="checkbox"></input></label>
</button>
<button id="btnStart" class="btn" type="button">Start</button>
<button id="btnDisable" class="btn" type="button">Disable</button>
<button id="btnStop" class="btn" type="button">Stop</button>
</div>
<table class="table table-striped table-format table-hover" data-provides="rowlink">
<thead>
<tr class="centerth">
<th width="1%"></th>
<th width="6%">ID</th>
<th>Name</th>
<th>PV</th>
<th>ConversionRate</th>
<th>Status</th>
<th>Created On</th>
</tr>
</thead>
<tbody>
<c:forEach var="item" items="${model.reports}">
<tr class="middle center rowlink">
<td class="nolink" style="padding-bottom: 8px"><input type="checkbox"/></td>
<td><a href="abtest?op=report&id=${item.entity.id}">${item.entity.id}</a></td>
<td>${item.entity.name}</td>
<td>1000</td>
<td>10%</td>
<td>
<c:choose>
<c:when test="${item.status.status == 0}">
<div>
<img src="${res.img.local['RUNNING_colored_big.png']}" />
</div> <small>Running</small>
</c:when>
<c:when test="${item.status.status == 1}">
<div>
<img src="${res.img.local['STOPPED_colored_big.png']}">
</div> <small>Stopped</small>
</c:when>
<c:when test="${item.status.status == 2}">
<div>
<img src="${res.img.local['READY_colored_big.png']}">
</div> <small>Ready to start</small>
</c:when>
<c:when test="${item.status.status == 3}">
<div>
<img src="${res.img.local['PAUSED_colored_big.png']}">
</div> <small>Disabled</small>
</c:when>
</c:choose>
</td>
<td>Apr 1, 2013</td>
</tr>
</c:forEach>
</tbody>
</table>
<div style="margin-top: 0px">
<ul class="pager">
<li ${payload.pageNum <= 1 ? ' class="disabled"' : ''}>
<a href="?op=list&status=${payload.status}&pageNum=1">First</a>
</li>
<li id="prev" ${payload.pageNum <= 1 ? ' class="disabled"' : ''}>
<a href="?op=list&status=${payload.status}&pageNum=${payload.pageNum > 1 ? (payload.pageNum - 1) : 1}">&larr; Prev</a>
</li>
<fmt:parseNumber var="beginPage" integerOnly="true" value="${payload.pageNum / 5}" />
<fmt:parseNumber var="pageRemainder" integerOnly="true" value="${payload.pageNum % 5}" />
<c:if test="${pageRemainder == 0}">
<fmt:parseNumber var="beginPage" integerOnly="true" value="${beginPage - 1}" />
</c:if>
<c:forEach var="pageNum" step="1"
begin="${(beginPage * 5 + 1)<= model.totalPages ? (beginPage * 5 + 1) : model.totalPages }"
end="${(beginPage + 1) * 5 <= model.totalPages ? (beginPage + 1) * 5 : model.totalPages}">
<li ${payload.pageNum == pageNum ? ' class="disabled"' : ''}>
<a href="?op=list&status=${payload.status}&pageNum=${pageNum}">${pageNum}</a>
</li>
</c:forEach>
<li id="next" ${payload.pageNum >= model.totalPages ? ' class="disabled"' : ''}>
<a href="?op=list&status=${payload.status}&pageNum=${payload.pageNum < model.totalPages ? (payload.pageNum + 1) : model.totalPages}">Next &rarr;</a>
</li>
<li ${payload.pageNum >= model.totalPages ? ' class="disabled"' : ''}>
<a href="?op=list&status=${payload.status}&pageNum=${model.totalPages}">Last</a>
</li>
</ul>
</div>
</div>
</div>
</a:body>
\ No newline at end of file
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="a" uri="/WEB-INF/app.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="res" uri="http://www.unidal.org/webres"%>
<%@ taglib prefix="w" uri="http://www.unidal.org/web/core"%>
<jsp:useBean id="ctx" type="com.dianping.cat.system.page.abtest.Context" scope="request" />
<jsp:useBean id="payload" type="com.dianping.cat.system.page.abtest.Payload" scope="request" />
<jsp:useBean id="model" type="com.dianping.cat.system.page.abtest.Model" scope="request" />
<a:body>
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<res:useCss value="${res.css.local['bootstrap.css']}" target="head-css" />
<res:useJs value="${res.js.local['bootstrap.min.js']}" target="head-js" />
<div class="row-fluid">
<div class="span12 column">
<div class="page-header">
<h1>
Report <small>#1001</small>
</h1>
</div>
<ul class="nav nav-tabs">
<li class="active">
<a href="#">
<img style="vertical-align: text-bottom;" height="15" width="15" src="${res.img.local['star_black_small.png']}">
Summary
</a>
</li>
<li>
<a href="#detail">
<img style="vertical-align: text-bottom;" height="15" width="15" src="${res.img.local['details_black_small.png']}">
Detail Report
</a>
</li>
<li>
<a href="#ve">
<img style="vertical-align: text-bottom;" height="15" width="15" src="${res.img.local['settings_black_small.png']}">
View/ Edit ABTest Details
</a>
</li>
</ul>
</div>
</div>
</a:body>
\ No newline at end of file
<plexus>
<components>
<component>
<role>com.dianping.cat.system.page.abtest.ABTestDaoTest</role>
<implementation>com.dianping.cat.system.page.abtest.ABTestDaoTest</implementation>
<requirements>
<requirement>
<role>com.dianping.cat.home.dal.abtest.AbtestDao</role>
</requirement>
</requirements>
</component>
</components>
</plexus>
......@@ -245,6 +245,33 @@ CREATE TABLE `project` (
PRIMARY KEY (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目基本信息';
CREATE TABLE `groupStrategy` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL COMMENT 'GroupStrategy的名字',
`alias` varchar(45) NOT NULL COMMENT 'GroupStrategy的英文名',
`className` varchar(45) NOT NULL COMMENT 'GroupStrategy的class名字',
`description` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8$$
CREATE TABLE `abtest` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(45) NOT NULL COMMENT 'abtest的名字',
`start_date` datetime DEFAULT NULL COMMENT '开始时间',
`end_date` datetime DEFAULT NULL COMMENT '结束时间',
`isDisabled` tinyint(4) NOT NULL COMMENT '是否有效',
`domains` varchar(100) NOT NULL COMMENT '属于的domain,用分号分割',
`strategy_id` int(11) NOT NULL COMMENT '分组策略ID',
`description` varchar(100) DEFAULT NULL COMMENT '实验描述',
`creation_date` datetime NOT NULL COMMENT '创建时间',
`modify_date` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8$$
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册