%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ page import="org.crosswire.community.projects.ntmss.data.Institution" %>
<%@ page import="org.crosswire.xml.XMLBlock" %>
<%@ page import="org.crosswire.webtools.annotation.*" %>
<%@ page import="org.crosswire.webtools.*" %>
<%@ page import="javax.validation.constraints.NotNull" %>
<%!
@Description(value = "Retrieve detailed information about an institute.", name = "institute/get")
public static class MyParameters extends Parameters {
@NotNull
@Description(value = "id of the institute to retrieve", example = "47")
public Integer instID;
}
%>
<%
MyParameters params = new MyParameters().loadFromRequest(request, response, false);
if (params.getErrors().size() == 0) {
Institution inst = Institution.getInstitution(params.instID);
if (inst == null) {
params.addError(-5, "instID: " + params.instID + " not found.");
}
else {
Serializer.output(response, out, params, XMLBlock.createXMLBlock(inst.toFormattedXML()));
return;
}
}
else params.format = "html";
Serializer.reportErrors(request, response, out, params, true);
%>