if (site == null)
throw new WebApplicationException(Status.NOT_FOUND);
// Return the editor
ResourceURI uri = new PageURIImpl(site, null, pageURI, Resource.WORK);
PageletEditor editor;
try {
editor = workbench.getEditor(site, uri, composerId, pagelet, language, environment);
} catch (IOException e) {
throw new WebApplicationException(e);
}
if (editor == null)
throw new WebApplicationException(Status.NOT_FOUND);
return Response.ok(editor.toXml()).build();
}