<%@page contentType="text/html" session="true"%>
<jsp:useBean id="conf" scope="application"
	class="org.injac.indexing.ConfInfos" />
<jsp:useBean id="httpsUrl" scope="application"
	class="java.lang.String" />	

<%! private String testSelected(int test){
	org.injac.indexing.ConfInfos conf =(org.injac.indexing.ConfInfos) getServletContext().getAttribute("conf"); 
	return (conf.getModeInt() == test ? "selected=\"selected\"" : "");
}
%>
<%

if(!request.getRequestURL().substring(0,5).equalsIgnoreCase("https")
		&& conf.forceSSL.equalsIgnoreCase("true"))
{

%>
<h2>Page accesible uniquement en HTTPS</h2>
<p>Veuillez réaccéder à la page en cliquant <a href="<%= httpsUrl %>?menu=newIndex">ici</a></p>
<%}else { %>
<form method="POST"
		action="servletIndexation">
<table>	
		<tr><td>Nom de l'index : </td><td><input size="30" type="text" name="name" /></td></tr>
		<tr><td>url (a indexer): </td><td><input size="50" type="text" name="url" value="<%= conf.defaultUrl %>"/></td></tr>
		<tr><td>utilisateur:	 </td><td><input size="30" type="text" name="user" value="<%= conf.defaultUser %>"/></td></tr>
		<tr><td>mot de passe:    </td><td><input size="30" type="password" name="pass" value="<%= conf.defaultPassword %>"/></td></tr>
		<tr><td>mode indexation metadata:    </td><td>
			<select name="mode" />
				<option <%=testSelected(0) %> value="0">aucune m&eacute;tadonn&eacute;e</option>
				<option <%=testSelected(1) %> value="1">toutes les m&eacute;tadonn&eacute;es inJAC</option>
				<option <%=testSelected(2) %> value="2">les m&eacute;tadonn&eacute;es inJAC de l'espace racine</option>
			</select>			
		</td></tr>
		<tr>
			<td colspan="2"><input type="submit" value="Indexer" /></td>
		   
		</tr>    
</table>
</form>
<%}  %>
