<%--
  Copyright 2003 Sun Microsystems, Inc. All rights reserved 
  Use is subject to license terms.
 --%>
<%-- Indexing.jsp --%>

<%@page info="RobotIndexing" language="java"%>
<%@taglib uri="/WEB-INF/jato.tld" prefix="jato"%>
<%@taglib uri="/WEB-INF/console.tld" prefix="console"%>
<%@taglib uri="/WEB-INF/searchadmin.tld" prefix="searchadmin"%>

<jato:useViewBean className="com.sun.portal.search.admin.IndexingViewBean"> 
<jsp:useBean id="viewBean" type="com.sun.portal.search.admin.IndexingViewBean" />
<script type="text/javascript" language="JavaScript">
    function validateData() {
	if (isPageCompletelyLoad()) {
	    var timeoutStr = document.forms['Indexing'].elements['Indexing.ConTimeOutText'].value;
	    if (timeoutStr.length > 0) {
		var timeoutInt = parseInt(timeoutStr);
		if (isNaN(timeoutInt)) {
		    alert("<searchadmin:text key="robot.indexing.error.invalid_timeout"/>");
		    return false;
		}
		else {
		    if (timeoutInt < 0) { 
			alert("<searchadmin:text key="robot.indexing.error.invalid_timeout"/>");
			return false;
		    }
		    else {

			document.forms['Indexing'].elements['Indexing.ConTimeOutText'].value = timeoutInt;
		    }
		}
	    }
	    else {
		alert("<searchadmin:text key="robot.indexing.error.invalid_timeout"/>");
		return false;
	    }

	    var sizeStr = document.forms['Indexing'].elements['Indexing.IndexingText'].value;
	    var partialChecked = document.forms['Indexing'].elements['Indexing.IndexingRadio'][1].checked;
	    if (partialChecked) {
		if (sizeStr.length > 0) {
		    var sizeInt = parseInt(sizeStr);
		    if (isNaN(sizeInt)) {
			alert("<searchadmin:text key="robot.indexing.error.invalid_indexsize"/>");
			return false;
		    }
		    else {
			if (sizeInt <= 0) {
			    alert("<searchadmin:text key="robot.indexing.error.cannotbeless1"/>");
			    return false;
			}
			else {

			    document.forms['Indexing'].elements['Indexing.IndexingText'].value = sizeInt;
			}
		    }
		}
		else {
		    alert("<searchadmin:text key="robot.indexing.error.invalid_indexsize"/>");
		    return false;
		}
	    }

	    return true;
	    
	}
	return false;
    }
</script>
<HTML>
<TITLE><searchadmin:text key="robot.indexing"/></TITLE>
<%@include file="/ps/searchadmin/CSHeader.jsp"%>
<script language="javascript">
if (parent.headerFrame) {
    parent.headerFrame.helpDocURL = "<jato:text name="helpDocURL"/>";
    parent.headerFrame.helpPage = "<searchadmin:text key="help.robot.indexing"/>";
}
</script>

<searchadmin:AdminMenu selected="Indexing" images="../ps/searchadmin/images"/>

<console:form name="Indexing">
<TABLE width="100%" border=0>
    <TR> 
      <TD width="50%" height="2">&nbsp;</TD>
      <TD align="right" width="50%" height="2"> 
        <TABLE border="0" cellpadding="0" cellspacing="0">
          <TR> 
            <TD><console:button name="SubmitButton" onClick="return validateData();"/></TD>
            <TD width="5"><IMG src="../ps/searchadmin/images/blank.gif" width="10" height="1" alt=""></TD>
            <TD><console:button name="ResetButton" /></TD>
            <TD><IMG src="../ps/searchadmin/images/blank.gif" width="10" height="1" alt=""></TD>
          </TR>
        </TABLE></TD>
    </TR>
</TABLE>
<TABLE width=100% border=0> 
<TR>
    <TD colspan="2" height="2">
    <DIV class="help-text"><searchadmin:text key="robot.indexing.desc"/></DIV>
    </TD>
</TR>
<TR>
      <TD colspan="2" height="2"> 
        <TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
          <TR> 
            <TD nowrap> 
              <DIV class="properties-level1-label-text"><searchadmin:text key="robot.indexing.extraction"/></DIV>
            </TD>
            <TD valign="bottom" width="99%"> 
		<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
		    <TR> 
		    <TD valign="bottom" class="properties-separator"><IMG src="../ps/searchadmin/images/blank.gif" width="1" height="2" alt=""></TD>
		    </TR>
		</TABLE>
            </TD>
          </TR>
        </TABLE>
      </TD>
</TR>
<TR>
    <td valign=baseline><DIV class="properties-level3-label-text"><lABEL for="robot.indexing.extraction.index"><searchadmin:text key="robot.indexing.extraction.index"/>&nbsp;:&nbsp;</LABEL></DIV></td>
    <td><jato:radioButtons name="IndexingRadio" elementId="robot.indexing.extraction.index" />
	<DIV class="properties-level3-label-text"><LABEL for="robot.indexing.extraction.extract"><searchadmin:text key="robot.indexing.extraction.extract"/></LABEL> <jato:textField name="IndexingText" size ="6" elementId="robot.indexing.extraction.extract" /> <searchadmin:text key="robot.indexing.extraction.bytes"/></DIV></td>
</TR>
<TR>
    <td><DIV class="properties-level3-label-text"><LABEL for="robot.indexing.advanced.toc"><searchadmin:text key="robot.indexing.advanced.toc"/>&nbsp;:&nbsp;</LABEL></DIV></td>
    <td><jato:checkbox name="ExtractTOCCheck" elementId="robot.indexing.advanced.toc" /></td>
</tr>
<tr>
    <td><DIV class="properties-level3-label-text"><LABEL for="robot.indexing.advanced.meta"><searchadmin:text key="robot.indexing.advanced.meta"/>&nbsp;:&nbsp;</LABEL></DIV></td>
    <td><jato:checkbox name="ExtractMetaCheck" elementId="robot.indexing.advanced.meta" /></td>
</tr>
<tr>
    <td><DIV class="properties-level3-label-text"><searchadmin:text key="robot.indexing.allow.nonexistclass" label="robot.indexing.allow.nonexistclass"/>&nbsp;:&nbsp;</DIV></td>
    <td><jato:checkbox name="AllowNonexistClassCheck" elementId="robot.indexing.allow.nonexistclass" /></td>
</tr>

    <TR><TD><BR></TD><TD><BR></TD></TR>

<TR>
      <TD colspan="2" height="2"> 
        <TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
          <TR> 
            <TD nowrap> 
              <DIV class="properties-level1-label-text"><searchadmin:text key="robot.indexing.converters"/></DIV>
            </TD>
            <TD valign="bottom" width="99%"> 
		<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
		    <TR> 
		    <TD valign="bottom" class="properties-separator"><IMG src="../ps/searchadmin/images/blank.gif" width="1" height="2" alt=""></TD>
		    </TR>
		</TABLE>
            </TD>
          </TR>
        </TABLE>
      </TD>
</TR>
    <tr>
	<td valign=baseline><DIV class="properties-level3-label-text"><LABEL for="robot.indexing.converters.converters"><searchadmin:text key="robot.indexing.converters.converters"/>&nbsp;:&nbsp;</LABEL></DIV></td>
	<td>
	<jato:tiledView name="ConverterList">
	    <jato:hidden name="HiddenName"/>
	    <jato:checkbox name="DocCheckbox" elementId="robot.indexing.converters.converters" />
	    <jato:text name="DocLabel" /> <BR>
	</jato:tiledView></DIV></td>
    </tr>
    <tr>
	<td><DIV class="properties-level3-label-text"><LABEL FOR="ctol"><searchadmin:text key="robot.indexing.converters.timeout"/>&nbsp;:&nbsp;</LABEL></DIV></td>
	<td><jato:textField name="ConTimeOutText" size ="6" elementId="ctol" /> <searchadmin:text key="robot.indexing.converters.timeout.seconds"/></DIV></td>
    </tr>

    <TR><TD><BR></TD><TD><BR></TD></TR>

</table>

<TABLE width="100%" border=0>
    <TR> 
      <TD width="50%" height="2">&nbsp;</TD>
      <TD align="right" width="50%" height="2"> 
        <TABLE border="0" cellpadding="0" cellspacing="0">
          <TR> 
            <TD><console:button name="SubmitButton" onClick="return validateData();"/></TD>
            <TD width="5"><IMG src="../ps/searchadmin/images/blank.gif" width="10" height="1" alt=""></TD>
            <TD><console:button name="ResetButton" /></TD>
            <TD><IMG src="../ps/searchadmin/images/blank.gif" width="10" height="1" alt=""></TD>
          </TR>
        </TABLE></TD>
    </TR>
</TABLE>

</console:form>

</body>
<script language="javascript">
pageLoaded = 1;
</script>

</HTML>
</jato:useViewBean>
