renderFragment("outputEndRow");
}
int n = 0;
for (String workspaceId : getWorkspacesManager().getAllWorkspacesIdentifiers()) {
WorkspaceImpl workspace = (WorkspaceImpl) getWorkspacesManager().getWorkspace(workspaceId);
WorkspacePermission viewPerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_LOGIN);
if (workspace == null) continue;
if (!UserStatus.lookup().hasPermission(viewPerm)) continue;
String estilo;
if (n % 2 == 0) estilo = "skn-odd_row";
else estilo = "skn-even_row";
renderFragment("outputStartRow");
setAttribute("value", workspaceId);
setAttribute("estilo", estilo);
WorkspacePermission deletePerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_DELETE);
boolean canDelete = getUserStatus().hasPermission(deletePerm);
if (getWorkspacesManager().getAvailableWorkspacesIds().size() < 2)
canDelete = false;
renderFragment(canDelete ? "outputDelete" : "outputCantDelete");
setAttribute("value", StringEscapeUtils.escapeHtml((String) LocaleManager.lookup().localize(workspace.getName())));
setAttribute("workspaceId", workspaceId);
setAttribute("estilo", estilo);
WorkspacePermission editWorkspacePerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_EDIT);
boolean canEdit = getUserStatus().hasPermission(editWorkspacePerm);
renderFragment(canEdit ? "outputName" : "outputNameDisabled");
setAttribute("value", StringEscapeUtils.escapeHtml((String) LocaleManager.lookup().localize(workspace.getTitle())));