}
}
private void populatePage() {
if (project == null) {
UserReportableException error = new UserReportableException(
"Null project supplied.", ProjectDetailPage.class);
setResponsePage(new ErrorReportPage(error));
return;
}
add(new DeleteLink("deleteProjectActionLink", project));
try {
RESTCommand cmd = RESTCommand.createGetProject(project.getSimalID(),
RESTCommand.TYPE_SIMAL, RESTCommand.FORMAT_XML);
add(new ExternalLink("doapLink", cmd.getURL()));
String rdfLink = "<link href=\"" + cmd.getURL()
+ "\" rel=\"meta\" title=\"DOAP\" type=\"application/rdf+xml\" />";
add(new StringHeaderContributor(rdfLink));
cmd = RESTCommand.createGetProject(project.getSimalID(),
RESTCommand.TYPE_SIMAL, RESTCommand.FORMAT_JSON);
add(new ExternalLink("jsonLink", cmd.getURL()));
String jsonLink = "<link href=\"" + cmd.getURL()
+ "\" rel=\"meta\" title=\"JSON\" type=\"application/json\" />";
add(new StringHeaderContributor(rdfLink));
} catch (SimalRepositoryException e) {
UserReportableException error = new UserReportableException(
"Unable to get new person ID from the repository",
ExhibitProjectBrowserPage.class, e);
setResponsePage(new ErrorReportPage(error));
} catch (SimalAPIException e) {
UserReportableException error = new UserReportableException(
"Unable to get a RESTful URI for the project RDF/XML document",
ProjectDetailPage.class, e);
setResponsePage(new ErrorReportPage(error));
}