<!--
// ==============================================================================
// File Name           : indvidual_index_database.htm 
// Description         : Indvidual Index Database
// Author(s)           : Baskaran V
// Date created        : 2009.01.05
// Last reviewed by    : 
// Last date of review : 
// Copyright           : (c) 2008, Sharp Software Development India Pvt Ltd., All rights reserved.
//                       All rights are reserved. Reproduction or transmission in whole or in part, in
//                       any form or by an means, electronic, mechanical or otherwise, is prohibited
//                       without the prior written consent of the copyright owner.

// ==============================================================================

-->

<html xmlns:sds="">
<head>
	<title>Index Database</title>
	<style>
	@media all
	{
		  sds\:checklist {behavior:url(checklist.htc)}
	}
	</style>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
	<link rel="stylesheet" href="search.css"/>
	<script language="JavaScript" src="search_errors.js"></script>
	<script language="VBScript" src="vb_utils.js"></script>
	<script language="JavaScript" src="external_io.js"></script>
	<script language="JavaScript" src="ui_utils.js"></script>
	<script language="JavaScript" src="math_utils.js"></script>
	<link href="style.css" rel="stylesheet" type="text/css" />
	<script defer type="text/javascript" src="pngfix.js"></script>
	<script type="text/javascript" src="Themes.js"></script>


</head>

<body leftmargin="0" topmargin="0" class="Centerbg">
<script language="JavaScript" src="search_index.js"></script>
<script language="JavaScript">
var database_name;

function OnLoadPage()
{
  // get database name appended at the end of location.search 
  database_name = unescape(location.search.substring(8));
  
  // set title area with selected database name
  document.all.page_title_area.innerHTML =
     Tag("b") + /*IDS_EDITING_DATABASE*/"Modification de la base de donnes '" + database_name + "'" + Tag("/b");
	
  // set currently active index database
  SetActiveIndex(database_name);

  // retrieve all values associated with index dbs
  LoadIndexProperties();
  
  document.all.index_path.readOnly = true;
  document.all.index_path.disabled = true;
}

function LoadIndexProperties()
{
  LoadIndexInfo(database_name);
  
  // get all properties associated with this index
  SetTextBox(document.all.index_path, GetIndexPath());
  SetCheckListItems(document.all.extension_list, GetExtensions());
  SelectCheckListItems(document.all.extension_list, GetIncludedExtensions());
  document.all.folder_tree.paths = GetIncludedPaths();
  document.all.folder_tree.excludedPaths = GetExcludedPaths();
}

function SaveIndexProperties()
{
  // save all properties associated with this index
  SetIndexPath(GetTextBox(document.all.index_path));
  SetIncludedExtensions(GetSelectedCheckListItems(document.all.extension_list));
  SetIncludedPaths(document.all.folder_tree.paths);
  SetExcludedPaths(document.all.folder_tree.excludedPaths);
  
  SaveIndexInfo(database_name);
}

function OnAllButtonClick()
{
  SelectAllCheckListItems(document.all.extension_list);
}

function OnNoneButtonClick()
{
  ClearAllCheckListItems(document.all.extension_list);
}

function OnDefaultButtonClick()
{
  // clear the entire list first
  ClearAllCheckListItems(document.all.extension_list);
  
  // select all extensions in the default list
  SelectCheckListItems(document.all.extension_list,
    GetDefaultExtensions());
}

function OnBrowseButtonClick()
{
  // display dialog in which path to the index file is specified
  var path = ShowDialog("local_folder_selection_dialog.htm", "",
  						"help:no; status:no;");

  // update path selection only when valid path is selected
  if(path != "")
    document.all.index_path.value = path;
}

function OnClearButtonClick()
{
  document.all.folder_tree.ClearAllSelection();
}
</script>

<script language="JavaScript" for="window" event="onload()">
OnLoadPage();
</script>

<script language="JavaScript" for="clear_button" event="onclick()">
OnClearButtonClick();
</script>

<script language="JavaScript" for="all_button" event="onclick()">
OnAllButtonClick();
</script>

<script language="JavaScript" for="none_button" event="onclick()">
OnNoneButtonClick();
</script>

<script language="JavaScript" for="set_to_default_button" event="onclick()">
OnDefaultButtonClick();
</script>

<script language="JavaScript" for="browse_button" event="onclick()">
OnBrowseButtonClick();
</script>

<script language="JavaScript" for="save_button" event="onclick()">
if(!IsIncludedPathSelected(document.all.folder_tree.paths))
{
  //alert("At least one folder must be selected in 'Folders to Index' area.");
  alert(/*IDS_E_NO_FOLDER*/"Au moins un dossier doit tre slectionn dans la zone de 'Dossier d'index'.");
  event.returnValue = false;
}

if(!IsIncludedExtensionSelected(GetSelectedCheckListItems(document.all.extension_list)))
{
  //alert("At least one extension must be selected in 'File Extensions to Index' area.");
  alert(/*IDS_E_NO_EXTENSION*/"Au moins un dossier doit tre slectionn dans la zone 'Dossiers  indexer'.");
  event.returnValue = false;
}

if(event.returnValue == false)
  return;

SaveIndexProperties();
//window.location = "index_databases.htm";
GoToPage('index_databases');
</script>

<script language="JavaScript" for="cancel_button" event="onclick()">
//window.location = "index_databases.htm";
GoToPage('index_databases');
</script>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="53" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="Default_top" height="53">
  <tr> 
    <td width="6%" align="center">
	  <a id="home_link" onClick="GoToPage('default')" class="Normaltext">
	    <img src="Images/search_home.png" border="0"  title="Retour  la page d'accueil de la recherche" width="32" height="32"  style="position:relative; top:2;" loc="title:id=IDS_BACK_TO_SEARCH_HOME"/> 
      </a>
	</td>
    <td> 
      <div id="page_title_area" align="center">
	  <b>Bases de donnes d'index</b>
	  </div>
    </td>
    <td width="180"> 
      <div id="page_link_area" align="right">
	  <a  onClick="GoToPage('index_databases')" class="Normaltext"><loc id="IDS_INDEX_DATABASES">Bases de donnes d'index</loc></a>
	  </div>
    </td>
  </tr>
</table></td>
  </tr>
  <tr>
    <td  class="bgcolor_2" height="1" align="left" valign="top"></td>
  </tr>
  <tr>
    <td height="42" align="left" valign="top"><blockquote> 
  <blockquote> 
    <p>
      <loc id="IDS_EDIT_INDEX_LOCATION">Emplacement de l'index:</loc> 
      <input type="text" name="index_path" size="50"/>
      <!-- <input type="button" name="browse_button" value="Browse..."/> -->
    </p>
    <fieldset><legend><loc id="IDS_GROUP_FOLDERS">Dossiers  indexer:</loc></legend> 
    <table width="95%" border="0" cellpadding="5" cellspacing="5">
      <tr> 
        <td width="75%">
		  <object id="folder_tree" classid="CLSID:574B123E-F15A-11D4-BC75-006008C79300" width="100%" height="160">
            <param name="FixedDrives" value="TRUE"/>
            <param name="RemoteDrives" value="TRUE"/>
            <param name="CDROMDrives" value="FALSE"/>
            <param name="RemovableDrives" value="FALSE"/>
            <param name="MultiSelect" value="TRUE"/>
          </object>
		</td>
        <td width="25%"> 
          <div align="center"> 
            <input type="button" class="button_style" name="clear_button" value="Effacer" loc="value:id=IDS_BUTTON_CLEAR"/>
          </div>
        </td>
      </tr>
    </table>
    </fieldset><br/>
    <fieldset><legend><loc id="IDS_GROUP_FILE_EXTENTIONS">Extensions de fichier  indexer:</loc></legend> 
    <table width="95%" border="0" cellspacing="5" cellpadding="5">
      <tr> 
        <td rowspan="3" width="59%" height="100"> 
		  <sds:checklist id="extension_list" width="160" height="100" />
        </td>
        <td width="41%"> 
          <div align="center"> 
             <input type="button" class="button_style" name="all_button" value="Toutes" loc="value:id=IDS_BUTTON_ALL"/>
          </div>
        </td>
      </tr>
      <tr> 
        <td width="41%"> 
          <div align="center"> 
           <input type="button" class="button_style" name="none_button" value="Aucune" loc="value:id=IDS_BUTTON_NONE"/>
          </div>
        </td>
      </tr>
      <tr> 
        <td width="41%"> 
          <div align="center"> 
             <input type="button" class="button_style" name="set_to_default_button" value="Par dfaut" loc="value:id=IDS_BUTTON_DEFAULT"/>
          </div>
        </td>
      </tr>
    </table>
    </fieldset> </blockquote>
</blockquote>
<hr/>
<table width="100%" border="0" cellspacing="5" cellpadding="5">
  <tr> 
    <td width="47%"> 
      <div align="right"> 
        <input type="button" class="button_style" name="save_button" value="Enregistrer" loc="value:id=IDS_BUTTON_SAVE"/>
      </div>
    </td>
	<td width="6%">
	</td>
    <td width="47%"> 
      <div align="left"> 
       <input type="button" class="button_style" name="cancel_button" value="Annuler" loc="value:id=IDS_BUTTON_CANCEL"/>
      </div>
    </td>
  </tr>
</table>
</td>
  </tr>
  
</table>
</body>
</html>
