use of org.mifos.framework.struts.tags.XmlBuilder in project head by mifos.
the class Dispatcher method doPost.
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String pathInfo = request.getPathInfo();
if (isCreateReport(pathInfo)) {
String url = new CreateReport().post();
response.setStatus(CREATED);
response.setHeader("Location", absolutify(url, request));
} else {
XmlBuilder html = new XmlBuilder();
/*
* Normally a POST should result in a redirect to a GET. But I guess
* this is an exception (?). It doesn't seem like users would get to
* this page nearly as often as the GET 404.
*/
errorPage(html, pathInfo);
response.setStatus(404);
response.getWriter().write(html.getOutput());
}
}
use of org.mifos.framework.struts.tags.XmlBuilder in project head by mifos.
the class OfficeListTagTest method setUp.
@Before
public void setUp() throws Exception {
result = new XmlBuilder();
userContext = TestUtils.makeUser();
}
use of org.mifos.framework.struts.tags.XmlBuilder in project head by mifos.
the class CustomFieldCategoryListTag method getCustomFieldCategoryList.
String getCustomFieldCategoryList(UserContext userContext) throws Exception {
XmlBuilder html = new XmlBuilder();
html.startTag("table", "width", "95%", "border", "0", "cellspacing", "0", "cellpadding", "0");
html.endTag("table");
return html.getOutput();
}
use of org.mifos.framework.struts.tags.XmlBuilder in project head by mifos.
the class CustomFieldCategoryListTag method getCategoryRow.
XmlBuilder getCategoryRow(String category, String categoryName) {
String urlencodedCategoryName = replaceSpaces(categoryName);
XmlBuilder html = new XmlBuilder();
String url = (actionName + "?method=" + methodName + "&category=" + category + "&categoryName=" + urlencodedCategoryName + "¤tFlowKey=" + flowKey);
html.startTag("tr", "class", "fontnormal");
bullet(html);
html.startTag("td");
html.startTag("a", "href", url);
html.text(categoryName);
html.endTag("a");
html.endTag("td");
html.endTag("tr");
return html;
}
use of org.mifos.framework.struts.tags.XmlBuilder in project head by mifos.
the class CustomFieldsListTag method getRow.
public XmlBuilder getRow(CustomFieldDefinitionEntity customField, UserContext userContext, int index) {
XmlBuilder html = new XmlBuilder();
String url = (actionName + "?method=" + methodName + "&customFieldIdStr=" + customField.getFieldId() + "¤tFlowKey=" + flowKey);
html.startTag("tr");
html.newline();
html.startTag("td", "width", "11%", "class", "drawtablerow");
html.text(Integer.toString(index));
html.endTag("td");
html.newline();
html.startTag("td", "width", "22%", "class", "drawtablerow");
String label = customField.getLookUpEntity().findLabel();
html.text(label);
html.endTag("td");
html.newline();
html.startTag("td", "width", "21%", "class", "drawtablerow");
html.text(ApplicationContextProvider.getBean(MessageLookup.class).lookup(CustomFieldType.fromInt(customField.getFieldType())));
html.endTag("td");
html.newline();
html.startTag("td", "width", "21%", "class", "drawtablerow");
if (customField.getDefaultValue() == null || "".equals(customField.getDefaultValue())) {
html.nonBreakingSpace();
} else {
html.text(getDefaultValue(customField, userContext));
}
html.endTag("td");
html.newline();
html.startTag("td", "width", "17%", "class", "drawtablerow");
html.text(customField.getMandatoryStringValue());
html.endTag("td");
html.newline();
html.endTag("tr");
html.newline();
return html;
}
Aggregations