package com.dianping.cat.report.page.home;

import org.unidal.lookup.util.StringUtils;
import org.unidal.web.mvc.ActionContext;
import org.unidal.web.mvc.payload.annotation.FieldMeta;

import com.dianping.cat.report.ReportPage;
import com.dianping.cat.report.page.AbstractReportPayload;

public class Payload extends AbstractReportPayload<Action> {
	@FieldMeta("op")
	private Action m_action;

	@FieldMeta("docName")
	private String m_docName;
	
	@FieldMeta("subDocName")
	private String m_subDocName;
	
	public Payload() {
		super(ReportPage.HOME);
	}

	@Override
	public Action getAction() {
		return m_action;
	}

	public String getSubDocName() {
   	return m_subDocName;
   }

	public void setSubDocName(String subDocName) {
   	m_subDocName = subDocName;
   }

	public void setAction(Action action) {
   	m_action = action;
   }

	public String getDocName() {
		if (StringUtils.isEmpty(m_docName)) {
			return "index";
		} else {
			return m_docName;
		}
	}

	public void setAction(String action) {
		m_action = Action.getByName(action, Action.VIEW);
	}

	public void setDocName(String docName) {
		m_docName = docName;
	}

	@Override
	public void validate(ActionContext<?> ctx) {
		if (m_action == null) {
			m_action = Action.VIEW;
		}
	}
}

@@ -435,19 +435,34 @@
 _docName
+ = %22userMonitor%22
 ;%0A
-%09
 %0A%09@Field
@@ -514,10 +514,9 @@
 me;%0A
-%09
 %0A
+
 %09pub
@@ -657,19 +657,17 @@
 ame() %7B%0A
-   
+%09
 %09return 
@@ -672,35 +672,33 @@
 n m_subDocName;%0A
-   
+%09
 %7D%0A%0A%09public void 
@@ -732,19 +732,17 @@
 Name) %7B%0A
-   
+%09
 %09m_subDo
@@ -761,19 +761,17 @@
 ocName;%0A
-   
+%09
 %7D%0A%0A%09publ
@@ -805,19 +805,17 @@
 tion) %7B%0A
-   
+%09
 %09m_actio
@@ -830,11 +830,9 @@
 on;%0A
-   
+%09
 %7D%0A%0A%09
@@ -864,79 +864,8 @@
 ) %7B%0A
-%09%09if (StringUtils.isEmpty(m_docName)) %7B%0A%09%09%09return %22index%22;%0A%09%09%7D else %7B%0A%09
 %09%09re
@@ -880,20 +880,16 @@
 ocName;%0A
-%09%09%7D%0A
 %09%7D%0A%0A%09pub

modify the default page