/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: JspC/ApacheTomcat9
 * Generated at: 2025-10-23 06:52:38 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.kmelia.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.io.File;
import java.text.SimpleDateFormat;
import java.sql.SQLException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Collection;
import java.util.Iterator;
import java.util.Collections;
import org.silverpeas.core.web.util.viewgenerator.html.GraphicElementFactory;
import org.silverpeas.core.util.MultiSilverpeasBundle;
import org.silverpeas.core.util.URLUtil;
import org.silverpeas.core.persistence.jdbc.DBUtil;
import org.silverpeas.kernel.bundle.ResourceLocator;
import org.silverpeas.core.util.file.FileRepositoryManager;
import org.silverpeas.core.web.util.viewgenerator.html.buttons.Button;
import org.silverpeas.core.web.util.viewgenerator.html.buttonpanes.ButtonPane;
import org.silverpeas.core.web.util.viewgenerator.html.operationpanes.OperationPane;
import org.silverpeas.core.web.util.viewgenerator.html.browsebars.BrowseBar;
import org.silverpeas.core.web.util.viewgenerator.html.window.Window;
import org.silverpeas.core.web.util.viewgenerator.html.frame.Frame;
import org.silverpeas.core.web.util.viewgenerator.html.tabs.TabbedPane;
import org.silverpeas.core.web.util.viewgenerator.html.board.Board;
import org.silverpeas.core.web.util.viewgenerator.html.navigationlist.NavigationList;
import org.silverpeas.core.web.util.viewgenerator.html.pagination.Pagination;
import org.silverpeas.core.web.util.viewgenerator.html.iconpanes.IconPane;
import org.silverpeas.core.web.util.viewgenerator.html.icons.Icon;
import org.silverpeas.core.contribution.publication.model.PublicationDetail;
import org.silverpeas.core.contribution.publication.model.PublicationPK;
import org.silverpeas.core.contribution.publication.model.CompletePublication;
import org.silverpeas.core.contribution.publication.model.ValidationStep;
import org.silverpeas.core.node.model.NodePK;
import org.silverpeas.core.node.model.NodeDetail;
import org.silverpeas.core.node.model.NodeI18NDetail;
import org.silverpeas.core.admin.user.model.UserDetail;
import org.silverpeas.components.kmelia.control.KmeliaSessionController;
import org.silverpeas.components.kmelia.KmeliaException;
import org.silverpeas.components.kmelia.service.KmeliaHelper;
import org.silverpeas.components.kmelia.jstl.KmeliaDisplayHelper;
import org.silverpeas.core.comment.model.Comment;
import org.silverpeas.core.contribution.content.wysiwyg.service.WysiwygController;
import org.silverpeas.core.contribution.content.wysiwyg.WysiwygException;
import org.silverpeas.core.ResourceReference;
import org.silverpeas.kernel.util.StringUtil;
import org.silverpeas.core.util.WebEncodeHelper;
import org.silverpeas.core.contribution.template.publication.PublicationTemplate;
import org.silverpeas.core.silverstatistics.access.model.HistoryByUser;
import org.silverpeas.components.kmelia.KmeliaConstants;
import org.silverpeas.kernel.bundle.SettingBundle;
import org.silverpeas.core.util.URLUtil;
import org.silverpeas.core.contribution.publication.model.PublicationDetail;
import org.silverpeas.components.kmelia.control.KmeliaSessionController;
import org.silverpeas.components.kmelia.model.KmeliaPublication;
import org.silverpeas.core.index.search.model.MatchingIndexEntry;
import org.silverpeas.core.util.MultiSilverpeasBundle;
import java.text.NumberFormat;
import java.util.Collection;
import java.util.Iterator;
import org.silverpeas.core.admin.user.model.User;
import org.silverpeas.core.util.WebEncodeHelper;
import org.silverpeas.core.util.DateUtil;
import org.silverpeas.core.node.model.NodeDetail;
import java.util.Collection;
import java.util.Iterator;
import org.silverpeas.components.kmelia.control.KmeliaSessionController;
import org.silverpeas.core.web.util.viewgenerator.html.GraphicElementFactory;
import org.silverpeas.core.web.util.viewgenerator.html.board.Board;
import org.silverpeas.core.web.util.viewgenerator.html.buttons.Button;
import org.silverpeas.core.web.util.viewgenerator.html.buttonpanes.ButtonPane;
import org.silverpeas.core.util.MultiSilverpeasBundle;
import org.silverpeas.core.i18n.I18NHelper;
import org.silverpeas.kernel.bundle.LocalizationBundle;
import java.util.ArrayList;
import org.owasp.encoder.Encode;

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


String getUserName(KmeliaPublication kmeliaPub, KmeliaSessionController kmeliaScc)
{
	User user		= kmeliaPub.getCreator(); //contains creator
	PublicationDetail	pub			= kmeliaPub.getDetail();
	String 				updaterId	= pub.getUpdaterId();
	User			updater		= null;
	if (updaterId != null && !updaterId.isEmpty())
		updater = kmeliaScc.getUserDetail(updaterId);
	if (updater == null)
		updater = user;

	String userName = "";
	if (updater != null && (!updater.getFirstName().isEmpty() || !updater.getLastName().isEmpty()))
		userName = updater.getFirstName() + " " + updater.getLastName();
	else
		userName = kmeliaScc.getString("kmelia.UnknownUser");

	return userName;
}

void displaySameSubjectPublications(Collection pubs, String publicationLabel, KmeliaSessionController kmeliaScc, String currentPubId, boolean checkboxAllowed, MultiSilverpeasBundle resources, JspWriter out) throws IOException {

    PublicationDetail 	pub;
    KmeliaPublication 	kmeliaPub;
    User 			user;
   	String				language = kmeliaScc.getCurrentLanguage();

    Iterator iterator = pubs.iterator();

	out.println("<table border=\"0\" width=\"98%\" align=center>");
	out.println("<form name=\"seeAlsoForm\" Action=\"DeleteSeeAlso\" method=\"Post\"/>");
	out.println("<input type=\"hidden\" name=\"PubId\" value=\"\"/>");
    out.println("<tr>");
          out.println("<td>");
          out.println("<!-- Publications Header -->");
          out.println("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
            out.println("<tr>");
                out.println("<td width=\"40\"><img src=\""+resources.getIcon("kmelia.publication")+"\" border=0></td>");
                out.println("<td align=\"left\" width=\"100%\"><b>"+publicationLabel+"</b></td>");
            out.println("</tr>");
          if (iterator.hasNext()) {
           	out.println("<tr><td colspan=\"2\">&nbsp;</td></tr>");
            out.println("<!-- Publications Header End -->");
            while (iterator.hasNext()) {
                kmeliaPub = (KmeliaPublication) iterator.next();
                pub = kmeliaPub.getDetail();
                user = kmeliaPub.getCreator();
                out.println("<!-- Publication Body -->");
                  if ( pub.getStatus() != null && pub.getStatus().equals("Valid") && !pub.getPK().getId().equals(currentPubId)) {
                      out.println("<tr class=\"important\""+pub.getImportance()+">");
                        out.print("<td valign=\"top\" colspan=\"2\">");
                      	out.print("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr valign=\"middle\">");
                      	if (checkboxAllowed)
                      		out.print("<td align=\"center\"><input type=\"checkbox\" name=\"PubIds\" value=\""+pub.getPK().getId()+"-"+pub.getPK().getInstanceId()+"\"></td>");
						out.print("<td width=\"1\">&#149;&nbsp;</td><td nowrap>");
						out.print("<a href=\""+
                URLUtil.getSimpleURL(URLUtil.URL_PUBLI, pub.getPK().getId(), pub.getPK().getInstanceId())+"\"><b>"+
                WebEncodeHelper.javaStringToHtmlString(pub.getName(language))+"</b></a>");
						out.print("&nbsp;</td><td width=\"100%\">");
						out.print("&nbsp;");
						out.println("</td>");
						out.println("</tr>");
						out.println("<tr>");
						if (checkboxAllowed)
							out.println("<td width=\"1\">&nbsp;</td>");
						out.println("<td width=\"1\">&nbsp;</td>");
						out.println("<td colspan=\"3\">"+getUserName(kmeliaPub, kmeliaScc)+" - "+resources.getOutputDate(pub.getLastUpdateDate())+"<br/>");
						out.println(WebEncodeHelper.javaStringToHtmlParagraphe(pub.getDescription(language))+"<br/><br/></td>");
						out.println("</td></tr></table>");
						out.println("</td>");
                      out.println("</tr>");
                  }
                out.println("<!-- Publication Body End -->");
            } // End while
            out.println("</table>");
          } // End if
          else
		  {
              out.println("<tr>");
              out.println("<td>&nbsp;</td>");
              out.println("<td>"+kmeliaScc.getString("PubAucune")+"</td>");
              out.println("</tr>");
              out.println("</table>");
          }
          out.println("</td>");
          out.println("<td valign=\"top\" colspan=\"2\" width=\"80\">");
					out.println("&nbsp;");
          out.println("</td>");
          out.println("</tr>");
          out.println("</form>");
out.println("</table>");
}

void displaySearchResults(List<MatchingIndexEntry> pubs, String publicationLabel, KmeliaSessionController kmeliaScc, String currentPubId, MultiSilverpeasBundle resources, JspWriter out) throws IOException, java.text.ParseException {

      out.println("<!-- Publications Header -->");
          out.println("<table width=\"98%\" align=center border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
            out.println("<tr>");
                out.println("<td width=\"80\"><img src=\""+resources.getIcon("kmelia.publication")+"\" border=0></td>");
                out.println("<td align=\"left\"><b>"+publicationLabel+"</b></td>");
          if (pubs!=null && !pubs.isEmpty()) {
                out.println("<td align=\"right\" valign=\"middle\">");
                out.println("&nbsp;");
                out.println("</td>");
            out.println("</tr>");
            out.println("<tr><td colspan=\"2\" >&nbsp;</td></tr>");
            out.println("<!-- Publications Header End -->");
            for (MatchingIndexEntry pub : pubs) {
                  out.println("<!-- Publication Body -->");
                  if (!pub.getObjectId().equals(currentPubId)) {
                      if (pub.getObjectType().equals("Publication")) {
							String userName = "";
							User user = User.getById(pub.getCreationUser());
							if (user != null) {
                userName = user.getDisplayedName();
              } else{
                userName = kmeliaScc.getString("UnknownAuthor");
              }
                          out.println("<tr>");
                            out.println("<td valign=\"top\" width=\"80\" align=\"center\"></td>");
                            out.println("<td valign=\"top\" colspan=\"2\">");
                             out.println("<p>&#149; <a href=\"javascript:onClick=publicationGoTo('"+pub.getObjectId()+"')\"><b>"+pub.getTitle()+"</b></a><br> "+userName+" - "+resources.getOutputDate(
                                 DateUtil.parseFromLucene(pub.getLastModificationDate()))+"<br/>");
                             out.println(""+Encode.forHtml(pub.getPreview())+"</p>");
                            out.println("</td>");
                          out.println("</tr>");
                      }
                   }
                  out.println("<!-- Publication Body End -->");
            } // End while
            out.println("</table>");
          } // End if
          else {
              out.println("<td align=\"right\" valign=\"middle\">&nbsp;</td>");
              out.println("<tr>");
              out.println("<td>&nbsp;</td>");
              out.println("<td>"+kmeliaScc.getString("PubAucune")+"</td>");
              out.println("</tr>");
              out.println("</table>");
          }
}



String m_context = ResourceLocator.getGeneralSettingBundle().getString("ApplicationURL");
//Icons
String axisUpdate = m_context + "/util/icons/update.gif";

String getAxisAllLabel(int valueMaxLength, KmeliaSessionController kmeliaScc) {

      int nbSpaces = (valueMaxLength - kmeliaScc.getString("AllComponents").length()) / 2;
      String allLabel = "";
      for (int i = 1; i <= nbSpaces; i++)
          allLabel += ".";
      allLabel = kmeliaScc.getString("AllComponents");
      for (int j = 1; j <= nbSpaces; j++)
          allLabel += ".";
      return allLabel;
}

String getTimeAxis(KmeliaSessionController kmeliaScc, LocalizationBundle timeSettings, String defaultValue) {

      List keys = kmeliaScc.getTimeAxisKeys();
      StringBuffer axis = new StringBuffer(1000);
			axis.append("<div class=\"oneAxis\"  id=\"axisTime\">");
				axis.append("<label for=\"timeAxis\">"+kmeliaScc.getString("TimeAxis")+"</label>");
					axis.append("<select id=\"timeAxis\" name=\"\" size=\"1\">");
						String key = "";
						StringBuffer values = new StringBuffer(1000);
						String value = "";
						String selectValue = ""; 
						int valueMaxLength = 0;
						
						for (int i = 0; i < keys.size(); i++) {
						selectValue = "";
						key = ((Integer) keys.get(i)).toString();
						value = timeSettings.getString(key);
						
						if (value.length() > valueMaxLength)
							valueMaxLength = value.length();
						
						if (key.equals(defaultValue))
							selectValue = "selected";
						   
						values.append("<option value=\""+key+"\""+selectValue+">"+value+"</option>");
						}
						
						axis.append("<option value=\"X\">"+kmeliaScc.getString("AllComponents")+"</option>");
						axis.append(values);
					axis.append("</select>");

			axis.append("</div>");
    return axis.toString();
}

List getAxis(KmeliaSessionController kmeliaScc, boolean axisLinked, List combination, String translation) {
      List list = kmeliaScc.getAxis();
      Iterator iterator = list.iterator();
      ArrayList axisList = new ArrayList();
      if (iterator.hasNext()) {
            String axisName = "";
            int axisNb = 0;
            StringBuffer axis = new StringBuffer(1000);
            String selectValue = "";
            while (iterator.hasNext()) {
                  NodeDetail node = (NodeDetail) iterator.next();
                  if (node.getLevel() == 2) {
                      //It's an axis
                      axisName = node.getName(translation);
                      axisNb++;
                      if (axis.length()>0) {
						axis.append("</select>");
			
				axis.append("</div>");
                          axisList.add(axis.toString());
                          axis = new StringBuffer(1000);
                      }
                      axis.append("<div  class=\"oneAxis\" id=\"axis"+node.getNodePK().getId()+"\">");
                              if (axisLinked)
                                  axis.append("<label onclick=\"axisManage('"+node.getNodePK().getId()+"')\" for=\"axe"+node.getNodePK().getId()+"\">"+ Encode.forHtml(node.getName(translation))+"</label><a  title=\""+kmeliaScc.getString("Update")+" \"  href=\"javaScript:axisManage('"+node.getNodePK().getId()+"')\" class=\"action\"><img alt=\""+kmeliaScc.getString("Update")+" \" src=\""+axisUpdate+"\"/></a>");
                              else
                                  axis.append("<label for=\"axe"+node.getNodePK().getId()+"\">"+
										  Encode.forHtml(node.getName(translation))+"</label>");
                              
                                        if (axisLinked)
                                          axis.append("<select class=\"axis\" id=\"axe"+node.getNodePK().getId()+"\" name=\""+node.getNodePK().getId()+"\" size=\"1\" onchange=\"positionManage(this)\">");
                                        else
                                          axis.append("<select class=\"axis\" id=\"axe"+node.getNodePK().getId()+"\" name=\""+node.getNodePK().getId()+"\" size=\"1\">");
                                        axis.append("<option value=\""+node.getPath()+node.getNodePK().getId()+"\">"+kmeliaScc.getString("AllComponents")+"</option>");
                  } else if (node.getLevel() == 3) {
                      selectValue = "";
										  if (combination.contains(node.getPath()+node.getId()))
                           selectValue = "selected";
						 				  axis.append("<option value=\""+node.getPath()+node.getNodePK().getId()+"|"+Encode.forHtml(axisName)+"\" class=\"intfdcolor51\" "+selectValue+">"+Encode.forHtml(node.getName(translation))+"</option>");
	                  } else {
	                      String spaces = "";
	                      for (int i=0; i<node.getLevel()-3; i++)
	                        spaces += "&nbsp;&nbsp;&nbsp;&nbsp;";
		                    selectValue = "";
											  if (combination.contains(node.getPath()+node.getId()))
	                            selectValue = "selected";
											  axis.append("<option value=\""+node.getPath()+node.getNodePK().getId()+"|"+Encode.forHtml(axisName)+"\" class=\"intfdcolor5\" "+selectValue+">"+spaces+Encode.forHtml(node.getName(translation))+"</option>");
	                  }
 			           }
						axis.append("</select>");
			
				axis.append("</div>");
      axisList.add(axis.toString());
      }

      return axisList;
}

String displayAxisCombinationToUsers(KmeliaSessionController kmeliaScc, GraphicElementFactory gef, List combination, String timeCriteria, String translation) {
    String result = displayAxis(kmeliaScc, gef, false, true, combination, timeCriteria, kmeliaScc.isTimeAxisUsed(), null, translation);
    return result;
}

String displayAxisToUsers(KmeliaSessionController kmeliaScc, GraphicElementFactory gef, String translation) {
    String result = displayAxis(kmeliaScc, gef, false, true, new ArrayList(), null, kmeliaScc.isTimeAxisUsed(), null, translation);
    return result;
}

String displayAxisToPublish(KmeliaSessionController kmeliaScc, GraphicElementFactory gef, String translation) {
	String result;
	List currentCombination = new ArrayList();
	if (kmeliaScc.getCurrentCombination() != null)
		currentCombination = kmeliaScc.getCurrentCombination();
    result = displayAxis(kmeliaScc, gef, false, true, currentCombination, null, false, null, translation);
    return result;
}

String displayAxisToAdmins(KmeliaSessionController kmeliaScc, GraphicElementFactory gef, String translation) {
    String result = displayAxis(kmeliaScc, gef, true, false, new ArrayList(), null, false, kmeliaScc.getString("AdminExplaination"), translation);
    return result;
}

String displayAxis(KmeliaSessionController kmeliaScc, GraphicElementFactory gef, boolean axisLinked, boolean searchEnabled, List combination,  String timeCriteriaValue, boolean timeAxisEnabled, String explaination, String translation) {
    StringBuffer result = new StringBuffer(1000);
    List axisList = getAxis(kmeliaScc, axisLinked, combination, translation);
    
    if (timeAxisEnabled && axisList.size() > 0) {
        //get the time axis
        LocalizationBundle timeSettings = ResourceLocator.getLocalizationBundle("org.silverpeas.kmelia.multilang.timeAxisBundle", kmeliaScc.getLanguage());
        axisList.add(getTimeAxis(kmeliaScc, timeSettings,  timeCriteriaValue));
    }
    
    Board board = gef.getBoard();

    int nbCol = 3;
    result.append("<form name=\"axisForm\" action=\"\" method=\"post\">");
	if (axisLinked) {
		result.append("<div class=\"axisManagment\">");
	} else {
		result.append("<div class=\"sousNavBulle\">");
	}
	    
			    Iterator i = axisList.iterator();
			    if (i.hasNext()) {
			        
			          while (i.hasNext()) {
			            String axis = (String) i.next();
			            result.append(axis);
			          }
			         
			    }
			

	
		if (searchEnabled && (axisList.size() > 0)) {
	    ButtonPane lebouton = gef.getButtonPane();
        Button validerButton = gef.getFormButton(kmeliaScc.getString("Validate"), "javaScript:search()", false);
        lebouton.addButton(validerButton);
        lebouton.setVerticalPosition();
        lebouton.setHorizontalPosition();
		result.append("<div id=\"btnForm\">");
		result.append(lebouton.print());
		result.append("</div>");}
	
	result.append("<br clear=\"all\"/>");
	result.append("</div>");
	


	result.append("</form>");
	result.append("<br clear=\"all\"/>");
	return result.toString();
}

String displayAxisManageView(KmeliaSessionController kmeliaScc, GraphicElementFactory gef, String axisId, String mandatoryFieldSrc, MultiSilverpeasBundle resources, String translation) {
    NodeDetail axis = kmeliaScc.getNodeHeader(axisId);
    StringBuffer result = new StringBuffer(1000);
    
    Board board = gef.getBoard();
    result.append(board.printBefore());

		result.append("<form name=\"axisManagerForm\" method=\"post\">");
			result.append("<input type=\"hidden\" name=\"Id\" value=\""+axisId+"\"/>");
			
			result.append("<table align=\"center\" cellpading=\"5\" cellspacing=\"5\" border=\"0\" width=\"100%\">");
				result.append("<tr>");
					result.append("<td>&nbsp;</td><td colspan=\"5\" class=\"txtnav\"><b>"+kmeliaScc.getString("AxisInformations")+" </b></td>");
	            result.append("</tr>");
	
	            result.append(I18NHelper.getFormLine(resources, axis, translation));
	            
	            result.append("<tr>");
					result.append("<td width=\"20%\" class=\"txtlibform\">"+kmeliaScc.getString("AxisTitle")+" : </td>");
					result.append("<td>"); 
						result.append("<input type=\"text\" id=\"nodeNameValue\" name=\"Name\" value=\""+Encode.forHtml(axis.getName(translation))+"\" size=\"61\" maxlength=\"50\">&nbsp;<img alt=\"\" src=\""+mandatoryFieldSrc+"\" border=\"0\"  width=\"5px\"  height=\"5px\" />");
					result.append("</td>");
					result.append("<td>&nbsp;</td>");
					result.append("<td>&nbsp;</td>");
					result.append("<td>&nbsp;</td>");
					result.append("<td>&nbsp;</td>");
				result.append("</tr>");
	            result.append("<tr>"); 
					result.append("<td width=\"20%\" class=\"txtlibform\">"+kmeliaScc.getString("AxisDescription")+" : </td>");
					result.append("<td>"); 
						result.append("<textarea id=\"nodeDesc\" name=\"Description\" cols=\"60\" rows=\"5\" wrap=\"physical\">"+axis.getDescription(translation)+"</textarea>");
					result.append("</td>");
					result.append("<td colspan=\"4\">&nbsp;");
					result.append("</td>");
				result.append("</tr>");
	            result.append("<tr>");
					result.append("<td colspan=\"6\"t>( <img alt=\" \" border=\"0\" src=\""+mandatoryFieldSrc+"\" width=\"5px\" height=\"5px\" /> : "+kmeliaScc.getString("ChampsObligatoires")+" ) </td>");
	            result.append("</tr>");
	            result.append("<tr>"); 
					result.append("<td colspan=\"6\">"); 
	
	                ButtonPane lebouton = gef.getButtonPane();
	                Button ajouterButton = gef.getFormButton(kmeliaScc.getString("AddComponent"), "javaScript:addPositionToAxis('"+axisId+"')", false);
	                Button validerButton = gef.getFormButton(kmeliaScc.getString("Validate"), "javaScript:axisUpdate()", false);
	                Button supprimerButton = gef.getFormButton(kmeliaScc.getString("DeleteAxis"), "javaScript:axisDelete()", false);
	
	                lebouton.addButton(validerButton);
	                lebouton.addButton(ajouterButton);
	                lebouton.addButton(supprimerButton);
	
	                lebouton.setVerticalPosition();
	                lebouton.setHorizontalPosition();
	
					result.append("</td>");
				result.append("</tr>");
			result.append("</table>");
		
		result.append("</form>");

        result.append(board.printAfter());
          
	result.append("<center><br/>");
	result.append(lebouton.print());
	result.append("</br></center>");
	result.append("<script language=\"javascript\">document.axisManagerForm.Name.focus();</script>");
    return result.toString();
}

String displayComponentManageView(KmeliaSessionController kmelia, GraphicElementFactory gef, String componentId, String path, String mandatoryFieldSrc, MultiSilverpeasBundle resources, String translation) {
    NodeDetail nodeDetail = kmelia.getNodeHeader(componentId);
    StringBuffer result = new StringBuffer(1000);
    Board board = gef.getBoard();
    result.append(board.printBefore());
		
    result.append("<form name=\"axisManagerForm\" method=\"post\">");
		result.append("<input type=\"hidden\" name=\"Id\" value=\""+componentId+"\">");
		result.append("<table align=\"center\" cellpading=\"5\" cellspacing=\"5\" border=\"0\" width=\"100%\">");
			result.append("<tr>");
				result.append("<td>&nbsp;</td><td colspan=\"5\"  class=\"txtnav\"><b>"+kmelia.getString("ComponentInformations")+" </b></td>");
			result.append("</tr>");
            result.append("<tr>"); 
				result.append("<td width=\"20%\" class=\"txtlibform\">"+kmelia.getString("ComponentFather")+ " : </td>");
				result.append("<td>"); 
				result.append(path);
				result.append("</td>");
				result.append("<td>&nbsp;</td>");
				result.append("<td>&nbsp;</td>");
				result.append("<td>&nbsp;</td>");
				result.append("<td>&nbsp;</td>");
            result.append("</tr>");
            result.append(I18NHelper.getFormLine(resources, nodeDetail, translation));
            result.append("<tr>"); 
				result.append("<td width=\"20%\" class=\"txtlibform\">"+kmelia.getString("ComponentTitle")+" : </td>");
				result.append("<td>"); 
					result.append("<input type=\"text\" id=\"nodeNameValue\" name=\"Name\" value=\""+Encode.forHtml(nodeDetail.getName(translation))+"\" size=\"61\" maxlength=\"50\">&nbsp;<img alt=\"  \" src=\""+mandatoryFieldSrc+"\" border=\"0\"  width=\"5px\" height=\"5px\" />");
				result.append("</td>");
				result.append("<td>&nbsp;</td>");
				result.append("<td>&nbsp;</td>");
				result.append("<td>&nbsp;</td>");
				result.append("<td>&nbsp;</td>");
            result.append("</tr>");
            result.append("<tr>"); 
				result.append("<td width=\"20%\" class=\"txtlibform\">"+kmelia.getString("ComponentDescription")+" : </td>");
				result.append("<td>"); 
					result.append("<textarea id=\"nodeDesc\" name=\"Description\" cols=\"60\" rows=\"5\" wrap=\"PHYSICAL\">"+nodeDetail.getDescription(translation)+"</textarea>");
				result.append("</td>");
				result.append("<td colspan=\"4\">&nbsp;");
				result.append("</td>");
			result.append("</tr>");
            result.append("<tr>");
				result.append("<td colspan=\"6\" >( <img  alt=\" \"  border=\"0\" src=\""+mandatoryFieldSrc+"\" width=\"5px\" height=\"5px\" /> : "+kmelia.getString("ChampsObligatoires")+" ) </td>");
            result.append("</tr>");
          
            result.append("<tr>");
				result.append("<td colspan=\"6\">"); 

                ButtonPane lebouton = gef.getButtonPane();
                Button ajouterButton = gef.getFormButton(kmelia.getString("AddComponent"), "javaScript:addPositionToPosition('"+componentId+"')", false);
                Button validerButton = gef.getFormButton(kmelia.getString("Validate"), "javaScript:positionUpdate()", false);
                Button supprimerButton = gef.getFormButton(kmelia.getString("DeleteComponent"), "javaScript:positionDelete()", false);

                lebouton.addButton(validerButton);
                lebouton.addButton(ajouterButton);
                lebouton.addButton(supprimerButton);

                lebouton.setVerticalPosition();
                lebouton.setHorizontalPosition();

                result.append("</td>");
            result.append("</tr>");
   		 result.append("</table>");
	result.append("</form>");

    result.append(board.printAfter());
	result.append("<center><br>");
	result.append(lebouton.print());
	result.append("</br></center>");
	result.append("<script language=\"javascript\">document.axisManagerForm.Name.focus();</script>");
    return result.toString();
}

String displayPath(Collection path, boolean linked, int beforeAfter, String translation) {
      String linkedPathString = new String();
      String pathString = new String();
      int nbItemInPath = path.size();
      Iterator iterator = path.iterator();
      boolean alreadyCut = false;
      int i = 0;
      while (iterator.hasNext()) {
            NodeDetail nodeInPath = (NodeDetail) iterator.next();
            if (nodeInPath.getLevel() != 1) {
              if ((i <= beforeAfter) || (i + beforeAfter >= nbItemInPath - 1)){
                  linkedPathString +=
						  "<a href=\"javascript:onClick=topicGoTo('"+nodeInPath.getNodePK().getId()+"')\">"+Encode.forHtml(nodeInPath.getName(translation))+"</a>";
                  pathString += Encode.forHtml(nodeInPath.getName(translation));
                  if (iterator.hasNext()) {
                        linkedPathString += " > ";
                        pathString += " > ";
                  }
             } else {
                  if (!alreadyCut) {
                        linkedPathString += " ... > ";
                        pathString += " ... > ";
                        alreadyCut = true;
                  }
             }
             i++;
           }
      }
      if (linked)
          return linkedPathString;
      else
          return pathString;
}



  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.HashMap<java.lang.String,java.lang.Long>(5);
    _jspx_dependants.put("/kmelia/jsp/publicationsList.jsp", Long.valueOf(1740030367196L));
    _jspx_dependants.put("/kmelia/jsp/kmax_axisReport.jsp", Long.valueOf(1731908768236L));
    _jspx_dependants.put("/kmelia/jsp/checkKmelia.jsp", Long.valueOf(1731908768235L));
    _jspx_dependants.put("jar:file:/home/silverbuild/.m2/repository/org/silverpeas/core/silverpeas-core-web/6.4.5-build251023/silverpeas-core-web-6.4.5-build251023.jar!/META-INF/viewGenerator.tld", Long.valueOf(1761199156000L));
    _jspx_dependants.put("file:/home/silverbuild/.m2/repository/org/silverpeas/core/silverpeas-core-web/6.4.5-build251023/silverpeas-core-web-6.4.5-build251023.jar", Long.valueOf(1761199178975L));
  }

  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<>(82);
    _jspx_imports_classes.add("org.silverpeas.core.contribution.content.wysiwyg.service.WysiwygController");
    _jspx_imports_classes.add("java.io.ObjectInputStream");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.navigationlist.NavigationList");
    _jspx_imports_classes.add("org.silverpeas.core.util.MultiSilverpeasBundle");
    _jspx_imports_classes.add("org.silverpeas.core.persistence.jdbc.DBUtil");
    _jspx_imports_classes.add("org.silverpeas.core.contribution.publication.model.PublicationPK");
    _jspx_imports_classes.add("org.silverpeas.core.util.URLUtil");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.window.Window");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.board.Board");
    _jspx_imports_classes.add("org.silverpeas.components.kmelia.control.KmeliaSessionController");
    _jspx_imports_classes.add("org.silverpeas.core.comment.model.Comment");
    _jspx_imports_classes.add("org.silverpeas.core.admin.user.model.UserDetail");
    _jspx_imports_classes.add("org.silverpeas.kernel.bundle.LocalizationBundle");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.tabs.TabbedPane");
    _jspx_imports_classes.add("java.io.PrintWriter");
    _jspx_imports_classes.add("org.silverpeas.core.ResourceReference");
    _jspx_imports_classes.add("org.silverpeas.kernel.util.StringUtil");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.operationpanes.OperationPane");
    _jspx_imports_classes.add("java.util.Collection");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.GraphicElementFactory");
    _jspx_imports_classes.add("org.silverpeas.kernel.bundle.ResourceLocator");
    _jspx_imports_classes.add("org.silverpeas.components.kmelia.jstl.KmeliaDisplayHelper");
    _jspx_imports_classes.add("java.util.List");
    _jspx_imports_classes.add("org.silverpeas.core.util.DateUtil");
    _jspx_imports_classes.add("org.silverpeas.components.kmelia.model.KmeliaPublication");
    _jspx_imports_classes.add("org.silverpeas.core.i18n.I18NHelper");
    _jspx_imports_classes.add("org.silverpeas.components.kmelia.KmeliaException");
    _jspx_imports_classes.add("org.silverpeas.core.silverstatistics.access.model.HistoryByUser");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.pagination.Pagination");
    _jspx_imports_classes.add("org.silverpeas.core.contribution.publication.model.ValidationStep");
    _jspx_imports_classes.add("org.silverpeas.core.util.WebEncodeHelper");
    _jspx_imports_classes.add("org.silverpeas.components.kmelia.KmeliaConstants");
    _jspx_imports_classes.add("java.text.SimpleDateFormat");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.iconpanes.IconPane");
    _jspx_imports_classes.add("java.text.NumberFormat");
    _jspx_imports_classes.add("org.silverpeas.core.node.model.NodeDetail");
    _jspx_imports_classes.add("java.util.ArrayList");
    _jspx_imports_classes.add("org.silverpeas.core.contribution.publication.model.CompletePublication");
    _jspx_imports_classes.add("org.silverpeas.core.contribution.template.publication.PublicationTemplate");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.buttonpanes.ButtonPane");
    _jspx_imports_classes.add("org.silverpeas.core.contribution.content.wysiwyg.WysiwygException");
    _jspx_imports_classes.add("java.sql.SQLException");
    _jspx_imports_classes.add("org.silverpeas.core.admin.user.model.User");
    _jspx_imports_classes.add("org.owasp.encoder.Encode");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.buttons.Button");
    _jspx_imports_classes.add("org.silverpeas.core.node.model.NodePK");
    _jspx_imports_classes.add("org.silverpeas.components.kmelia.service.KmeliaHelper");
    _jspx_imports_classes.add("java.util.Iterator");
    _jspx_imports_classes.add("org.silverpeas.core.node.model.NodeI18NDetail");
    _jspx_imports_classes.add("org.silverpeas.core.index.search.model.MatchingIndexEntry");
    _jspx_imports_classes.add("org.silverpeas.core.util.file.FileRepositoryManager");
    _jspx_imports_classes.add("java.io.IOException");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.icons.Icon");
    _jspx_imports_classes.add("java.io.FileInputStream");
    _jspx_imports_classes.add("org.silverpeas.kernel.bundle.SettingBundle");
    _jspx_imports_classes.add("java.io.File");
    _jspx_imports_classes.add("java.net.URLEncoder");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.frame.Frame");
    _jspx_imports_classes.add("java.util.Collections");
    _jspx_imports_classes.add("org.silverpeas.core.contribution.publication.model.PublicationDetail");
    _jspx_imports_classes.add("org.silverpeas.core.web.util.viewgenerator.html.browsebars.BrowseBar");
  }

  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/errorpage.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");
      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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");

	KmeliaSessionController kmeliaScc = (KmeliaSessionController) request.getAttribute("kmelia");
	GraphicElementFactory gef = (GraphicElementFactory) session.getAttribute("SessionGraphicElementFactory");

	if (kmeliaScc == null) {
	    // No session controller in the request -> security exception
	    String sessionTimeout = ResourceLocator.getGeneralSettingBundle().getString("sessionTimeout");
	    getServletConfig().getServletContext().getRequestDispatcher(sessionTimeout).forward(request, response);
	    return;
	}

	MultiSilverpeasBundle resources = (MultiSilverpeasBundle)request.getAttribute("resources");

	String[] browseContext = (String[]) request.getAttribute("browseContext");
	String spaceLabel = browseContext[0];
	String componentLabel = browseContext[1];
	String spaceId = browseContext[2];
	String componentId = browseContext[3];

	String routerUrl = URLUtil.getApplicationURL() + URLUtil.getURL("kmelia", spaceId, componentId);

	String m_context = ResourceLocator.getGeneralSettingBundle().getString("ApplicationURL");

	boolean kmaxMode 	= (componentId != null && componentId.startsWith("kmax"));
	boolean toolboxMode = (componentId != null && componentId.startsWith("toolbox"));
	boolean kmeliaMode 	= (componentId != null && componentId.startsWith("kmelia"));

  boolean isAccessGuest 	= kmeliaScc.getUserDetail().isAccessGuest();

	SettingBundle settings = ResourceLocator.getSettingBundle("org.silverpeas.kmelia.settings.kmeliaSettings");

      out.write('\n');
      out.write("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
      out.write('\n');
      out.write("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
      out.write('\n');
      out.write('\n');
 
String rootId = "0";

//Recuperation des parametres
String translation = (String) request.getAttribute("Translation");
if (translation == null)
	translation = kmeliaScc.getLanguage();

//Icons
String publicationSrc = m_context + "/util/icons/publication.gif";

      out.write("\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html>\n<head>\n<title></title>\n");
      if (_jspx_meth_view_005flooknfeel_005f0(_jspx_page_context))
        return;
      out.write("\n<script language=\"JavaScript1.2\">\nfunction search() {\n    z = \"\";\n    nbSelectedAxis = 0;\n    timeCriteria = \"X\";\n    timeCriteriaUsed = 0;\n	");
 if (kmeliaScc.isTimeAxisUsed()) { 
      out.write("\n      // -2 instead of -1 because of security tokens\n      // before, it was :\n      //  - document.axisForm.elements[document.axisForm.length - 1].value\n      //  - timeCriteriaUsed = 1;\n      timeCriteria = document.axisForm.elements[document.axisForm.length - 2].value;\n	    timeCriteriaUsed = 2;\n	");
 } 
      out.write("\n	for (var i=0; i<document.axisForm.length - timeCriteriaUsed; i++) {\n    	if (document.axisForm.elements[i].value.length != 0) {\n            if (nbSelectedAxis != 0)\n                z += \",\";\n            nbSelectedAxis = 1;\n            truc = document.axisForm.elements[i].value.split(\"|\");\n            z += truc[0];\n        }\n    }\n    if (nbSelectedAxis != 1) {\n      jQuery.popup.error(\"Vous devez s�lectionnez au moins un axe !\");\n    } else {\n		document.managerForm.TimeCriteria.value = timeCriteria;\n		document.managerForm.SearchCombination.value = z;\n		document.managerForm.action = \"KmaxSearch\";\n		document.managerForm.submit();\n    }\n}\n\n</script>\n</head>\n<body>\n");

	Window window = gef.getWindow();
	
	BrowseBar browseBar = window.getBrowseBar();
	browseBar.setDomainName(kmeliaScc.getSpaceLabel());
	browseBar.setComponentName(kmeliaScc.getComponentLabel(), "KmaxMain");
	browseBar.setExtraInformation(kmeliaScc.getString("PublicationAxis"));

    //Instanciation du cadre avec le view generator
    Frame frame = gef.getFrame();

    out.println(window.printBefore());
    
    frame.addTop(displayAxisToUsers(kmeliaScc, gef, translation));
    frame.addBottom("");

    out.println(frame.print());
    out.println(window.printAfter());

      out.write("\n\n<form name=\"managerForm\" action= \"KmaxAxisManager\" method=\"post\" target=\"MyMain\">\n	<input type=\"hidden\" name=\"SearchCombination\"/>\n	<input type=\"hidden\" name=\"TimeCriteria\"/>\n</form>\n\n</body>\n</html>");
    } 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_005flooknfeel_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:looknfeel
    org.silverpeas.core.web.util.viewgenerator.html.LookAndStyleTag _jspx_th_view_005flooknfeel_005f0 = new org.silverpeas.core.web.util.viewgenerator.html.LookAndStyleTag();
    _jsp_getInstanceManager().newInstance(_jspx_th_view_005flooknfeel_005f0);
    _jspx_th_view_005flooknfeel_005f0.setPageContext(_jspx_page_context);
    _jspx_th_view_005flooknfeel_005f0.setParent(null);
    int _jspx_eval_view_005flooknfeel_005f0 = _jspx_th_view_005flooknfeel_005f0.doStartTag();
    if (_jspx_th_view_005flooknfeel_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      return true;
    }
    org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(_jspx_th_view_005flooknfeel_005f0, _jsp_getInstanceManager());
    return false;
  }
}
