public void service(HttpServletRequest request, HttpServletResponse response) throws FormatterException {
try {
WorkspaceImpl workspace = (WorkspaceImpl) getSectionsPropertiesHandler().getWorkspace();
setAttribute("sectionTitle", getLocalizedValue(workspace.getSection(Long.decode(getSectionsPropertiesHandler().getSelectedSectionId())).getTitle()));
renderFragment("outputStart");
WorkspacePermission sectionPerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_CREATE_PAGE);
if (UserStatus.lookup().hasPermission(sectionPerm)) {
Panel[] panels = workspace.getSection(Long.decode(getSectionsPropertiesHandler().getSelectedSectionId())).getAllPanels();
TreeSet panelInstances = new TreeSet();
for (int i = 0; i < panels.length; i++) {
Panel panel = panels[i];
panelInstances.add(panel.getInstanceId());
}
if (!panelInstances.isEmpty()) {
setAttribute("sectionTitle", LocaleManager.lookup().localize(workspace.getSection(Long.decode(getSectionsPropertiesHandler().getSelectedSectionId())).getTitle()));
renderFragment("outputMode");
renderFragment("outputHeaders");
Iterator it = panelInstances.iterator();
int counter = 0;
while (it.hasNext()) {
String instanceId = it.next().toString();
PanelInstance instance = workspace.getPanelInstance(instanceId);
setAttribute("instanceId", instanceId);
setAttribute("group", instance.getResource(instance.getProvider().getGroup(), getLocale()));
setAttribute("description", instance.getResource(instance.getProvider().getDescription(), getLocale()));
setAttribute("title", getLocalizedValue(instance.getTitle()));
setAttribute("counter", counter);