}
@Override
@SuppressWarnings("deprecation")
protected void doService(final ToolPageContext page) throws IOException, ServletException {
Page mainObject = Query.findById(Page.class, page.param(UUID.class, "id"));
page.writeHeader();
page.writeStart("div", "class", "widget");
page.writeStart("h1", "class", "icon icon-object-template").writeHtml("Editable Sections").writeEnd();
page.writeStart("ul", "class", "links");
page.writeStart("li");
page.writeStart("a",
"href", page.returnUrl("sectionId", null),
"target", "_top");
page.writeHtml("Layout");
page.writeEnd();
page.writeEnd();
if (mainObject != null) {
for (Section section : mainObject.findSections()) {
if (section instanceof ContentSection) {
State content = State.getInstance(((ContentSection) section).getContent());
if (content != null) {
page.writeStart("li");