/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: JspC/ApacheTomcat9
 * Generated at: 2026-06-22 10:19:33 UTC
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */
package org.apache.jsp.webSites.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.silverpeas.components.websites.servlets.WebSitesRequestRouter;
import org.silverpeas.components.websites.control.WebSiteSessionController;
import org.silverpeas.components.websites.model.FolderDetail;
import org.silverpeas.components.websites.model.IconDetail;
import org.silverpeas.components.websites.model.SiteDetail;
import org.silverpeas.core.admin.user.model.UserDetail;
import org.silverpeas.core.contribution.publication.model.PublicationDetail;
import org.silverpeas.core.node.model.NodeDetail;
import org.silverpeas.core.node.model.NodePK;
import org.silverpeas.core.util.MultiSilverpeasBundle;
import org.silverpeas.core.util.URLUtil;
import org.silverpeas.core.util.WebEncodeHelper;
import org.silverpeas.core.web.util.viewgenerator.html.Encode;
import org.silverpeas.core.web.util.viewgenerator.html.GraphicElementFactory;
import org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayColumn;
import org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayLine;
import org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayPane;
import org.silverpeas.core.web.util.viewgenerator.html.board.Board;
import org.silverpeas.core.web.util.viewgenerator.html.browsebars.BrowseBar;
import org.silverpeas.core.web.util.viewgenerator.html.buttonpanes.ButtonPane;
import org.silverpeas.core.web.util.viewgenerator.html.buttons.Button;
import org.silverpeas.core.web.util.viewgenerator.html.frame.Frame;
import org.silverpeas.core.web.util.viewgenerator.html.iconpanes.IconPane;
import org.silverpeas.core.web.util.viewgenerator.html.icons.Icon;
import org.silverpeas.core.web.util.viewgenerator.html.operationpanes.OperationPane;
import org.silverpeas.core.web.util.viewgenerator.html.tabs.TabbedPane;
import org.silverpeas.core.web.util.viewgenerator.html.window.Window;
import java.io.IOException;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import org.silverpeas.components.websites.control.WebSiteSessionController;
import org.silverpeas.components.websites.service.WebSitesException;
import org.silverpeas.core.node.model.NodeDetail;
import org.silverpeas.core.util.WebEncodeHelper;
import org.silverpeas.core.web.util.viewgenerator.html.navigationlist.Link;
import org.silverpeas.core.web.util.viewgenerator.html.navigationlist.NavigationList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

public final class classifyDeclassify_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent,
                 org.apache.jasper.runtime.JspSourceImports {


  /**
   * Centralizing the rendering of topic navigation.<br/>
   * <p>
   * <u>In JAVASCRIPT context:</u><br/>
   * An instance of WebSiteManager MUST have been instantiated and registered into 'wsm' variable name.<br/>
   * This variable MUST be scoped into window.
   * </p>
   */
  public String renderTopicNavigation(final WebSiteSessionController scc,
      final GraphicElementFactory gef, final FolderDetail currentFolder)
      throws WebSitesException {
    final Collection<NodeDetail> topics = currentFolder.getNodeDetail().getChildrenDetails();
    final Collection<Integer> nbSitesByTopic = currentFolder.getNbPubByTopic();
    if (topics.isEmpty()) {
      return "";
    }
    final NavigationList navList = gef.getNavigationList();
    final Iterator<Integer> nbSiteIt = nbSitesByTopic.iterator();
    for (final NodeDetail topic : topics) {
      final String topicName = topic.getName();
      final String topicId = topic.getNodePK().getId();
      final FolderDetail folder = scc.getFolder(topicId);
      final Collection<NodeDetail> subTopics = folder.getNodeDetail().getChildrenDetails();
      final List<Link> subTopicLinks = subTopics.stream()
          .map(t -> new Link(t.getName(), "javascript:wsm.goToAppTopic('" + t.getNodePK().getId() + "')"))
          .collect(Collectors.toList());
      final int nbSites = nbSiteIt.hasNext() ? nbSiteIt.next() : 0;
      navList.addItemSubItem(topicName, "javascript:wsm.goToAppTopic('" + topicId + "')", nbSites, subTopicLinks);
    }
    return navList.print();
  }

  /**
   * Centralizing the rendering of sites of a topic.<br/>
   * <p>
   * <u>In JAVASCRIPT context:</u><br/>
   * An instance of WebSiteManager MUST have been instantiated and registered into 'wsm' variable name.<br/>
   * This variable MUST be scoped into window.
   * </p>
   */
  public String renderTopicSites(final WebSiteSessionController scc,
      final FolderDetail currentFolder) throws WebSitesException {
    final String pxmag = URLUtil.getApplicationURL() + "/util/icons/colorPix/1px.gif";
    final String redFlag = URLUtil.getApplicationURL() + "/util/icons/urgent.gif";
    final StringBuilder htmlList = new StringBuilder();
    final Collection<PublicationDetail> siteList = currentFolder.getPublicationDetails();
    if (!siteList.isEmpty()) {
      htmlList.append("<TABLE CELLPADDING=3 CELLSPACING=0 ALIGN=CENTER BORDER=0 WIDTH=\"98%\"><tr><td>\n");
      for (final PublicationDetail site : siteList) {
        final String siteId = site.getVersion();
        final String siteName = site.getName();
        final String siteDescription = WebEncodeHelper.javaStringToHtmlParagraphe(site.getDescription());
        final StringBuilder iconList = new StringBuilder();
        final Collection<IconDetail> icons = scc.getIcons(siteId);
        boolean rouge = false;
        htmlList.append("<tr>\n");
        for (final IconDetail icon : scc.getAllIcons()) {
          if (isIconIncludedIn(icon, icons)) {
            if (icon.getName().equals("Icon0")) {
              rouge = true;
            } else {
              iconList
                  .append("<A href=\"javascript:void(0)\" onclick=\"wsm.openIconDictionary()\"><img src=\"")
                  .append(icon.getAddress()).append("\" alt=\"")
                  .append(scc.getString(icon.getName()))
                  .append("\" border=0 align=absmiddle title=\"")
                  .append(scc.getString(icon.getName())).append("\"></A>&nbsp;\n");
            }
          }
        }
        if (rouge) {
          htmlList.append("<td valign=\"top\"><img src=\"").append(redFlag).append("\" border=\"0\" align=absmiddle></td>\n");
        } else {
          htmlList.append("<td valign=\"top\">&nbsp;</td>\n");
        }
        htmlList.append(
            "<td valign=\"top\" align=left nowrap>&#149;&nbsp;<a class=\"textePetitBold\" href=\"javascript:onClick=wsm.goToSite('")
            .append(siteId).append("')\">").append(siteName)
            .append("</a></td><td align=left>\n");
        htmlList.append(iconList);
        htmlList.append(
            "</td></tr><tr><td class=intfdcolor51>&nbsp;</td><td colspan=2 width=\"100%\" class=intfdcolor51><span class=\"txtnote\">")
            .append(siteDescription).append("</span></td></tr><tr><td colspan=3><img src=\"")
            .append(pxmag).append("\" height=3 width=200></td>\n");
      }
      htmlList.append("</td></tr></table>\n");
    } else {
      htmlList.append("<div class='inlineMessage'>").append(scc.getString("NoLinkAvailable")).append("</div>");
    }
    return htmlList.toString();
  }

  private boolean isIconIncludedIn(IconDetail iconDetail, Collection<IconDetail> c) {
    final String iconId = iconDetail.getIconPK().getId();
    return c.stream().map(i -> i.getIconPK().getId()).anyMatch(i -> i.equals(iconId));
  }

  /* doubleAntiSlash */
  public String doubleAntiSlash(String path) {
    StringBuilder res = new StringBuilder(path);
    int k = 0;
    for (int i = 0, j = 1; i < path.length(); i++, j++) {
      if (path.charAt(i) == '\\') {
        boolean hasNotAntiSlashAfter = j < path.length() && path.charAt(j) != '\\';
        boolean hasNotAntiSlashBefore = i > 0 && path.charAt(i - 1) != '\\';
        if (hasNotAntiSlashAfter && hasNotAntiSlashBefore) {
          res.insert(k+i, '\\');
          k++;
        }
      }
    }
    return res.toString();
  }

  private String ignoreSlash(String chemin)
  {
    /* ex : /rep1/rep2/rep3 */
    /* res = rep1/rep2/rep3 */

      String res = chemin;
      boolean ok = false;
      while (!ok) {
          char car = res.charAt(0);
          if (car == '/') {
              res = res.substring(1);
          }
          else ok = true;
      }
      return res;
  }

  /* node */
  private String node(String path) {
      /* ex : ....\\id\\rep1\\rep2\\rep3 */
      /* res : rep3 */

      int index = path.lastIndexOf("/");
      /* finChemin = \\rep3 */
      String finChemin = path.substring(index);
      return ignoreSlash(finChemin);
  }


  /* supprAntiSlashFin */
  private String supprAntiSlashFin(String path) {
      /* ex : ....\\id\\rep1\\rep2\\rep3\\  */
      /* res : ....\\id\\rep1\\rep2\\rep3 */

      int longueur = path.length();
      /*if (path.substring(longueur - 2).equals("\\\\"))
          return path.substring(0, longueur - 2);
      else */
      if (path.substring(longueur - 1).equals("/"))
          return path.substring(0, longueur - 1);
      else return path;
  }

 /* affichageChemin */
  private Collection affichageChemin(WebSiteSessionController scc, String currentPath) {
      /* retourne la liste des noeuds par lesquels on passe */
      /* ex : c:\\j2sdk\\public_html\\WAwebSiteUploads\\webSite17\\3\\rep1\\rep11\\ */
      /* res = */
      /* collection[0] = c:\\j2sdk\\public_html\\WAwebSiteUploads\\webSite17\\3 : toujours */
      /* collection[1] = c:\\j2sdk\\public_html\\WAwebSiteUploads\\webSite17\\3\\rep1 */
      /* collection[1] = c:\\j2sdk\\public_html\\WAwebSiteUploads\\webSite17\\3\\rep1\\rep11 */

      List<String> liste = new ArrayList<>();
      boolean ok = true;
      String deb;
      String finChemin;

      String chemin = currentPath;
      if (chemin != null) {
          chemin = supprAntiSlashFin(chemin); /* c:\\j2sdk\\public_html\\WAwebSiteUploads\\webSite17\\3\\rep1\\rep11 */

          int longueur = scc.getComponentId().length();
          int index = chemin.lastIndexOf(scc.getComponentId());
          /* index de fin de webSite15 dans le chemin */
          index = index + longueur;
          /* finChemin = "\\id\\rep\\ ..." */
          finChemin = chemin.substring(index);
          /* saute les antiSlash, finChemin = id\\rep\\ ... */
          finChemin = ignoreSlash(finChemin);

          index = finChemin.indexOf("/");

          if (index == -1) {
                liste.add(chemin); /* la racine id */
          }

          else {
              /* deb */
              int indexRacine = chemin.indexOf(finChemin);
              int indexAntiSlashSuivant = finChemin.indexOf("/");
              deb = chemin.substring(0, indexRacine + indexAntiSlashSuivant);
              liste.add(deb); /* ajoute la racine */

              /* finChemin = \rep\\ ... */
	      finChemin = finChemin.substring(index + 1);
              /* saute les antiSlash s'il y en a, finChemin = rep\\rep1\\rep2\\ ... */
              finChemin = ignoreSlash(finChemin);

              if (! finChemin.equals("")) {
                  index = chemin.indexOf(finChemin);
                  /* deb */
                  deb = chemin.substring(0, index);

                  String fin = finChemin;
                  while (ok) {
                      index = fin.indexOf("/");
                      if (index == -1) { /* on a un noeud */
                          if (deb.endsWith("/"))
                            deb = deb + fin;
                          else deb = deb + "/" + fin;
                          liste.add(deb);

                          ok = false;
                      }
                      else {
                        String node = fin.substring(0, index);
                        if (deb.endsWith("/"))
                            deb = deb + node;
                        else deb = deb + "/" + node;
                        liste.add(deb);

                        fin = fin.substring(index);
                        fin = ignoreSlash(fin);
                      }
                  } //fin while
              } //fin if
          } //fin else
      } //fin if
      return liste;
  }

/* navigPath */
String navigPath(Collection path, boolean linked, int beforeAfter) {
      StringBuilder linkedPathString = new StringBuilder();
      StringBuilder pathString = new StringBuilder();
      int nbItemInPath = path.size();
      Iterator iterator = path.iterator();
      boolean alreadyCut = false;
      int i = 0;
      while (iterator.hasNext()) {
            NodeDetail nodeInPath = (NodeDetail) iterator.next();
            if (! nodeInPath.getNodePK().getId().equals("0")) { // on n'affiche pas le theme acceuil
                if ((i <= beforeAfter) || (i + beforeAfter >= nbItemInPath - 1)) {
                    String name = nodeInPath.getName();
                    if (name.length() > 20)
                            name = name.substring(0, 20) + "...";
                    linkedPathString.append("<a href=\"javascript:wsm.goToAppTopic('")
                        .append(nodeInPath.getNodePK().getId()).append("')\">")
                        .append(WebEncodeHelper.javaStringToHtmlString(name)).append("</a>");
                    pathString.append(WebEncodeHelper.javaStringToHtmlString(nodeInPath.getName()));
                    if (iterator.hasNext()) {
                            linkedPathString.append(" > ");
                            pathString.append(" > ");
                    }
            } else {
                    if (!alreadyCut) {
                            linkedPathString.append(" ... > ");
                            pathString.append(" ... > ");
                            alreadyCut = true;
                    }
            }
           }
           i++;
      }
      if (linked) {
        return linkedPathString.toString();
      } else {
        return pathString.toString();
      }
}


  /* displayPath */
  private String displayPath(Collection path, boolean linked, int beforeAfter, String lien, String racine) {
      StringBuilder linkedPathString = new StringBuilder();
      StringBuilder pathString = new StringBuilder();
      int nbItemInPath = path.size();
      Iterator iterator = path.iterator();
      boolean alreadyCut = false;
      boolean first = true;
      int i = 0;

      while (iterator.hasNext()) {
            String aPath = (String) iterator.next(); /* chemin complet */
            if ((i <= beforeAfter) || (i + beforeAfter >= nbItemInPath - 1)) {
                if (first) {
                    linkedPathString.append("<a href=\"").append(lien).append(aPath).append("\">")
                        .append(racine).append("</a>");
                    pathString.append(racine);
                    first = false;
                }
                else {
                    linkedPathString.append("<a href=\"").append(lien).append(aPath).append("\">")
                        .append(node(aPath)).append("</a>");
                    pathString.append(node(aPath));
                }
                if (iterator.hasNext()) {
                      linkedPathString.append(" > ");
                      pathString.append(" > ");
                }
           } else {
                if (!alreadyCut) {
                      linkedPathString.append(" ... > ");
                      pathString.append(" ... > ");
                      alreadyCut = true;
                }
           }
           i++;
      }
      if (linked) {
        return linkedPathString.toString();
      } else {
        return pathString.toString();
      }
  }



  /**
    * Called on :
    *
    */
    private boolean dejaPublie(String siteId, Collection<SiteDetail> liste) {
      for (final SiteDetail site : liste) {
        String id = site.getSitePK().getId();
        if (id.equals(siteId)) {
          return true;
        }
      }
      return false;
    }

  /**
    * Called on :
    *
    */
    private Collection remove(Collection<SiteDetail> c, SiteDetail site) {
      String theId = site.getSitePK().getId();
      List<SiteDetail> resultat = new ArrayList<>();
      for (final SiteDetail sitedetail : c) {
        String id = sitedetail.getSitePK().getId();
        if (!id.equals(theId)) {
          resultat.add(sitedetail);
        }
      }
      return resultat;
    }

  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;

  static {
    _jspx_dependants = new java.util.LinkedHashMap<java.lang.String,java.lang.Long>(4);
    _jspx_dependants.put("/webSites/jsp/checkScc.jsp", Long.valueOf(1777829049922L));
    _jspx_dependants.put("/webSites/jsp/util.jsp", Long.valueOf(1705522061060L));
    _jspx_dependants.put("uri:silverpeas.tags.viewGenerator", Long.valueOf(1782120262148L));
    _jspx_dependants.put("uri:silverpeas.tags.viewGenerator!/META-INF/viewGenerator.tld", Long.valueOf(1782120236000L));
  }

  private static final java.util.Set<java.lang.String> _jspx_imports_packages;

  private static final java.util.Set<java.lang.String> _jspx_imports_classes;

  static {
    _jspx_imports_packages = new java.util.LinkedHashSet<>(4);
    _jspx_imports_packages.add("javax.servlet");
    _jspx_imports_packages.add("javax.servlet.http");
    _jspx_imports_packages.add("javax.servlet.jsp");
    _jspx_imports_classes = new java.util.LinkedHashSet<>(50);
    _jspx_imports_classes.add("org.silverpeas.components.websites.servlets.WebSitesRequestRouter");
    _jspx_imports_classes.add("org.silverpeas.components.websites.control.WebSiteSessionController");
    _jspx_imports_classes.add("org.silverpeas.components.websites.model.FolderDetail");
    _jspx_imports_classes.add("org.silverpeas.components.websites.model.IconDetail");
    _jspx_imports_classes.add("org.silverpeas.components.websites.model.SiteDetail");
    _jspx_imports_classes.add("org.silverpeas.core.admin.user.model.UserDetail");
    _jspx_imports_classes.add("org.silverpeas.core.contribution.publication.model.PublicationDetail");
    _jspx_imports_classes.add("org.silverpeas.core.node.model.NodeDetail");
    _jspx_imports_classes.add("org.silverpeas.core.node.model.NodePK");
    _jspx_imports_classes.add("org.silverpeas.core.util.MultiSilverpeasBundle");
    _jspx_imports_classes.add("org.silverpeas.core.util.URLUtil");
    _jspx_imports_classes.add("org.silverpeas.core.util.WebEncodeHelper");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.Encode");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.GraphicElementFactory");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayColumn");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayLine");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayPane");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.board.Board");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.browsebars.BrowseBar");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.buttonpanes.ButtonPane");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.buttons.Button");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.frame.Frame");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.iconpanes.IconPane");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.icons.Icon");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.operationpanes.OperationPane");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.tabs.TabbedPane");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.window.Window");
    _jspx_imports_classes.add("java.io.IOException");
    _jspx_imports_classes.add("java.util.Collection");
    _jspx_imports_classes.add("java.util.Date");
    _jspx_imports_classes.add("java.util.Iterator");
    _jspx_imports_classes.add("org.silverpeas.components.websites.service.WebSitesException");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.navigationlist.Link");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.navigationlist.NavigationList");
    _jspx_imports_classes.add("java.util.ArrayList");
    _jspx_imports_classes.add("java.util.List");
    _jspx_imports_classes.add("java.util.stream.Collectors");
  }

  private volatile javax.el.ExpressionFactory _el_expressionfactory;
  private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

  public java.util.Set<java.lang.String> getPackageImports() {
    return _jspx_imports_packages;
  }

  public java.util.Set<java.lang.String> getClassImports() {
    return _jspx_imports_classes;
  }

  public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
    if (_el_expressionfactory == null) {
      synchronized (this) {
        if (_el_expressionfactory == null) {
          _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
        }
      }
    }
    return _el_expressionfactory;
  }

  public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
    if (_jsp_instancemanager == null) {
      synchronized (this) {
        if (_jsp_instancemanager == null) {
          _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
        }
      }
    }
    return _jsp_instancemanager;
  }

  public void _jspInit() {
  }

  public void _jspDestroy() {
  }

  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
      throws java.io.IOException, javax.servlet.ServletException {

    if (!javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
      final java.lang.String _jspx_method = request.getMethod();
      if ("OPTIONS".equals(_jspx_method)) {
        response.setHeader("Allow","GET, HEAD, POST, OPTIONS");
        return;
      }
      if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method)) {
        response.setHeader("Allow","GET, HEAD, POST, OPTIONS");
        response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET, POST or HEAD. Jasper also permits OPTIONS");
        return;
      }
    }

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html; charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"../../admin/jsp/errorpageMain.jsp", true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n\n\n\n");

response.setHeader("Cache-Control","no-store"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires",-1); //prevents caching at the proxy server

      out.write('\n');
      out.write('\n');
      out.write("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
      if (_jspx_meth_view_005ftimeout_005f0(_jspx_page_context))
        return;
      out.write('\n');

    WebSiteSessionController 	scc 		= (WebSiteSessionController) request.getAttribute("webSites");
    GraphicElementFactory 		gef 		= (GraphicElementFactory) session.getAttribute("SessionGraphicElementFactory");
    MultiSilverpeasBundle resources 	= (MultiSilverpeasBundle)request.getAttribute("resources");
	String[] 					browseContext 	= (String[]) request.getAttribute("browseContext");

	String m_context = URLUtil.getApplicationURL();
	String spaceLabel = browseContext[0];
	String componentLabel = browseContext[1];
	String spaceId = browseContext[2];
	String componentId = browseContext[3];

  pageContext.setAttribute("componentLabel", componentLabel);

	boolean bookmarkMode = componentId.startsWith("bookmark");

      out.write('\n');
      out.write('\n');
      out.write('\n');
      out.write('\n');
      out.write('\n');

response.setHeader("Cache-Control","no-store"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires",-1); //prevents caching at the proxy server

      out.write("\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
      out.write('\n');
      out.write('\n');
      out.write('\n');
      out.write('\n');
      out.write('\n');
      out.write('\n');


String checkSite=m_context+"/util/icons/ok.gif";
String addSite=m_context+"/util/icons/webSites_to_add.gif";
String declass=m_context+"/util/icons/webSites_trash.gif";

//Recuperation des parametres
String id = request.getParameter("TopicId");//jamais null
String linkedPathString = request.getParameter("Path");//jamais null
Collection<SiteDetail> listeSites = (Collection) request.getAttribute("ListSites");
FolderDetail webSitesCurrentFolder =
    (FolderDetail) request.getAttribute(WebSitesRequestRouter.CURRENT_FOLDER_PARAM);

      out.write("\n\n<!-- classifyDeclassify -->\n\n");
      //  view:sp-page
      org.silverpeas.core.web.util.viewgenerator.html.layout.HtmlLayoutTag _jspx_th_view_005fsp_002dpage_005f0 = new org.silverpeas.core.web.util.viewgenerator.html.layout.HtmlLayoutTag();
      _jsp_getInstanceManager().newInstance(_jspx_th_view_005fsp_002dpage_005f0);
      try {
        _jspx_th_view_005fsp_002dpage_005f0.setPageContext(_jspx_page_context);
        _jspx_th_view_005fsp_002dpage_005f0.setParent(null);
        int _jspx_eval_view_005fsp_002dpage_005f0 = _jspx_th_view_005fsp_002dpage_005f0.doStartTag();
        if (_jspx_eval_view_005fsp_002dpage_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
          out.write('\n');
          if (_jspx_meth_view_005fsp_002dhead_002dpart_005f0(_jspx_th_view_005fsp_002dpage_005f0, _jspx_page_context))
            return;
          out.write('\n');
          //  view:sp-body-part
          org.silverpeas.core.web.util.viewgenerator.html.layout.BodyPartLayoutTag _jspx_th_view_005fsp_002dbody_002dpart_005f0 = new org.silverpeas.core.web.util.viewgenerator.html.layout.BodyPartLayoutTag();
          _jsp_getInstanceManager().newInstance(_jspx_th_view_005fsp_002dbody_002dpart_005f0);
          try {
            _jspx_th_view_005fsp_002dbody_002dpart_005f0.setPageContext(_jspx_page_context);
            _jspx_th_view_005fsp_002dbody_002dpart_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_view_005fsp_002dpage_005f0);
            int _jspx_eval_view_005fsp_002dbody_002dpart_005f0 = _jspx_th_view_005fsp_002dbody_002dpart_005f0.doStartTag();
            if (_jspx_eval_view_005fsp_002dbody_002dpart_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
              out.write("\n<form name=\"topicDetailForm\" action=\"organize.jsp\" method=POST >\n  <input type=\"hidden\" name=\"Action\">\n  <input type=\"hidden\" name=\"Id\" value=\"");
              out.print(id);
              out.write("\">\n  <input type=\"hidden\" name=\"SiteList\">\n</form>\n\n<form name=\"liste\">\n\n");

	Collection<PublicationDetail> listeSitesPublies = webSitesCurrentFolder.getPublicationDetails();
	if (listeSitesPublies.size() > 0) {
    for (final PublicationDetail sitepublieTheme : listeSitesPublies) {
      String siteId = sitepublieTheme.getVersion();
      if (dejaPublie(siteId, listeSites)) {
        SiteDetail siteToDelete = scc.getWebSite(siteId);
        List<SiteDetail> a = new ArrayList<>(listeSites);
        listeSites = remove(a, siteToDelete);
      }
    }
	}

	List<SiteDetail> arraySites = new ArrayList<>(listeSites);

    Window window = gef.getWindow();
    String bodyPart="";

    // La barre de naviagtion
    BrowseBar browseBar = window.getBrowseBar();
	  browseBar.setDomainName(spaceLabel);
    browseBar.setComponentName(componentLabel, "organize.jsp");
    if (linkedPathString.equals(""))
        browseBar.setPath(resources.getString("ClasserDeclasser"));
    else browseBar.setPath(linkedPathString+" - "+resources.getString("ClasserDeclasser"));


    //Les operations
    OperationPane operationPane = window.getOperationPane();
    operationPane.addOperation(addSite, resources.getString("AjouterSites"), "javascript:onClick=classify('"+arraySites.size()+"')");
    operationPane.addLine();
    operationPane.addOperation(declass, resources.getString("DeclasserSites"), "javascript:onClick=declassify('"+listeSitesPublies.size()+"')");

    //Le cadre
    Frame frame = gef.getFrame();

    //Le tableau de tri
    ArrayPane arrayPane = gef.getArrayPane("siteList", "classifyDeclassify.jsp?Action=View&TopicId="+id+"&Path="+Encode.javaStringToHtmlString(linkedPathString), request, session);
    arrayPane.setVisibleLineNumber(1000);
    arrayPane.setTitle(resources.getString("ListeSitesNonPubliesTheme"));
    //D�finition des colonnes du tableau
    arrayPane.addArrayColumn(resources.getString("GML.name"));
    arrayPane.addArrayColumn(resources.getString("GML.description"));
    ArrayColumn arrayColumnStatus = arrayPane.addArrayColumn(resources.getString("GML.status"));
    arrayColumnStatus.setSortable(false);
    ArrayColumn arrayColumnDel = arrayPane.addArrayColumn("&nbsp;");
    arrayColumnDel.setSortable(false);

    for (SiteDetail site : arraySites) {
	    /* ecriture des lignes du tableau */
	    String theId = site.getSitePK().getId();
	    String nom = site.getName();
	    String theDescription = site.getDescription();
		if (theDescription == null)
			theDescription = "";

	    int theEtat = site.getState();

		ArrayLine arrayLine = arrayPane.addArrayLine();

	    if (nom.length() > 40)
	          nom = nom.substring(0, 40) + "...";

      arrayLine.addArrayCellLink(nom, "javascript:onClick=wsm.goToSite('"+theId+"')");

	    if (theDescription.length() > 80)
	          theDescription = theDescription.substring(0, 80) + "...";
	    arrayLine.addArrayCellText(theDescription);

		if (theEtat == 1) {
			//Ajout de l'icones publie
			IconPane iconPanePub1 = gef.getIconPane();
			Icon checkIcon1 = iconPanePub1.addIcon();
			checkIcon1.setProperties(checkSite,resources.getString("SitePublie"));
			arrayLine.addArrayCellIconPane(iconPanePub1);
		}
		else {
			arrayLine.addArrayCellText("");
		}
		arrayLine.addArrayCellText("<input type=\"checkbox\" name=\"classifySite\" value=\""+theId+"\">");
	}

    //Recuperation du tableau dans le haut du cadre
    frame.addTop(arrayPane.print());

	//Le board
	Board board = gef.getBoard();

	String liste = "";

	if (listeSitesPublies.size() > 0) {
		liste += "<table border=\"0\">\n";
		//Récup des sites
    for (final PublicationDetail sitepublie : listeSitesPublies) {
      String pubId = sitepublie.getPK().getId();
      String siteName = sitepublie.getName();
      String siteDescription = sitepublie.getDescription();
      if (siteDescription == null) {
        siteDescription = "";
      }

      String siteId = sitepublie.getVersion();

      liste += "<tr>\n";
      liste += "<td valign=\"top\" width=\"5%\"><input type=\"checkbox\" name=\"declassSite\" value=\"" + pubId + "\"></td>\n";

      liste +=
          "<td valign=\"top\"><a class=\"textePetitBold\" href=\"javascript:onClick=wsm.goToSite('" + siteId + "')\">" + siteName + "</a><br>\n";

      liste += "<span class=\"txtnote\">" + siteDescription + "</span><br><br></td>\n";
    }

		liste += "</table>\n";
		board.addBody(liste);
	}

    //Recuperation de la liste des sites dans le cadre
	if(listeSitesPublies.size() > 0) {
		frame.addBottom(board.print());
	}

    //On crache le HTML ;o)
    bodyPart+=frame.print();
    window.addBody(bodyPart);
	out.println(window.print());

              out.write("\n</form>\n");
            }
            if (_jspx_th_view_005fsp_002dbody_002dpart_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
              return;
            }
          } finally {
            org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_view_005fsp_002dbody_002dpart_005f0, _jsp_getInstanceManager());
          }
          out.write('\n');
        }
        if (_jspx_th_view_005fsp_002dpage_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
          return;
        }
      } finally {
        org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_view_005fsp_002dpage_005f0, _jsp_getInstanceManager());
      }
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              out.clearBuffer();
            }
          } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }

  private boolean _jspx_meth_view_005ftimeout_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  view:timeout
    org.silverpeas.core.web.util.viewgenerator.html.security.SessionTimeoutTag _jspx_th_view_005ftimeout_005f0 = new org.silverpeas.core.web.util.viewgenerator.html.security.SessionTimeoutTag();
    _jsp_getInstanceManager().newInstance(_jspx_th_view_005ftimeout_005f0);
    try {
      _jspx_th_view_005ftimeout_005f0.setPageContext(_jspx_page_context);
      _jspx_th_view_005ftimeout_005f0.setParent(null);
      int _jspx_eval_view_005ftimeout_005f0 = _jspx_th_view_005ftimeout_005f0.doStartTag();
      if (_jspx_th_view_005ftimeout_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        return true;
      }
    } finally {
      org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_view_005ftimeout_005f0, _jsp_getInstanceManager());
    }
    return false;
  }

  private boolean _jspx_meth_view_005fsp_002dhead_002dpart_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_view_005fsp_002dpage_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  view:sp-head-part
    org.silverpeas.core.web.util.viewgenerator.html.layout.HeadLayoutPartTag _jspx_th_view_005fsp_002dhead_002dpart_005f0 = new org.silverpeas.core.web.util.viewgenerator.html.layout.HeadLayoutPartTag();
    _jsp_getInstanceManager().newInstance(_jspx_th_view_005fsp_002dhead_002dpart_005f0);
    try {
      _jspx_th_view_005fsp_002dhead_002dpart_005f0.setPageContext(_jspx_page_context);
      _jspx_th_view_005fsp_002dhead_002dpart_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_view_005fsp_002dpage_005f0);
      int _jspx_eval_view_005fsp_002dhead_002dpart_005f0 = _jspx_th_view_005fsp_002dhead_002dpart_005f0.doStartTag();
      if (_jspx_eval_view_005fsp_002dhead_002dpart_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
        out.write('\n');
        if (_jspx_meth_view_005fscript_005f0(_jspx_th_view_005fsp_002dhead_002dpart_005f0, _jspx_page_context))
          return true;
        out.write("\n<script type=\"text/javascript\">\n\n/******************************************************************************************/\n\nfunction classify(nbSite) {\n    listeSiteToBePublished = \"\";\n\n    if (nbSite == 1) {\n        if (document.liste.classifySite.checked)\n            listeSiteToBePublished += document.liste.classifySite.value + \",\";\n    }\n    else {\n        for (i=0; i<nbSite; i++) {\n          if (document.liste.classifySite[i].checked)\n                      listeSiteToBePublished += document.liste.classifySite[i].value + \",\";\n         }\n    }\n\n    document.topicDetailForm.Action.value = \"classify\";\n    document.topicDetailForm.SiteList.value = listeSiteToBePublished;\n    document.topicDetailForm.submit();\n}\n\n/******************************************************************************************/\n\nfunction declassify(nbSite) {\n    listeSiteToBeDePublished = \"\";\n\n    if (nbSite == 1) {\n        if (document.liste.declassSite.checked)\n            listeSiteToBeDePublished += document.liste.declassSite.value + \",\";\n");
        out.write("    }\n    else {\n        for (i=0; i<nbSite; i++) {\n          if (document.liste.declassSite[i].checked)\n                      listeSiteToBeDePublished += document.liste.declassSite[i].value + \",\";\n         }\n    }\n\n    document.topicDetailForm.Action.value = \"declassify\";\n    document.topicDetailForm.SiteList.value = listeSiteToBeDePublished;\n    document.topicDetailForm.submit();\n}\n\nwindow.wsm = new WebSiteManager({\n  contextUrl : 'organize.jsp',\n  forceSitePopupOpening : true\n});\n</script>\n");
      }
      if (_jspx_th_view_005fsp_002dhead_002dpart_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        return true;
      }
    } finally {
      org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_view_005fsp_002dhead_002dpart_005f0, _jsp_getInstanceManager());
    }
    return false;
  }

  private boolean _jspx_meth_view_005fscript_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_view_005fsp_002dhead_002dpart_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  view:script
    org.silverpeas.core.web.util.viewgenerator.html.override.ScriptTag _jspx_th_view_005fscript_005f0 = new org.silverpeas.core.web.util.viewgenerator.html.override.ScriptTag();
    _jsp_getInstanceManager().newInstance(_jspx_th_view_005fscript_005f0);
    try {
      _jspx_th_view_005fscript_005f0.setPageContext(_jspx_page_context);
      _jspx_th_view_005fscript_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_view_005fsp_002dhead_002dpart_005f0);
      // /webSites/jsp/classifyDeclassify.jsp(89,0) name = src type = java.lang.String reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
      _jspx_th_view_005fscript_005f0.setSrc("javaScript/commons.js");
      int _jspx_eval_view_005fscript_005f0 = _jspx_th_view_005fscript_005f0.doStartTag();
      if (_jspx_th_view_005fscript_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        return true;
      }
    } finally {
      org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_view_005fscript_005f0, _jsp_getInstanceManager());
    }
    return false;
  }
}
