<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils" %>
<%   JSPConduit c = JSPConduit.getJSPConduit(request);
   c.stringTable("DevResources");
   c.stringTable("FwResources"); %>
<HTML>
<HEAD>
<TITLE><%= c.string("RBAInstall.RBATitle") %></TITLE>

<LINK rel='stylesheet' href='<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>'>

<jsp:include page='<%= c.getPath("dev/eMFrameScripts_inc.jsp") %>' flush="true" />
<jsp:include page='<%= c.getPath("dev/OSScripts_inc.jsp") %>' flush="true" />

<script language="JavaScript">

   function doExtendSchema()
   {
      var strURL = "webacc";
      strURL += "?taskId=fw.RBSInstall";
      strURL += "&merge=dev.GenConf";
      strURL += "&error=dev.GenConf";
      strURL += "&User.context=<%= c.var("User.context") %>";
      strURL += "&nextState=doExtendSchema";

      document.RBSInstallForm.target = "Content";
      document.RBSInstallForm.action = strURL;
      document.RBSInstallForm.submit();
   }

   function doCreateCannedTasks()
   {
      if(checkRequiredFields() == false)
      {
        return;
      }

      var iSelectedIndex = document.RBSInstallForm.List.selectedIndex;
      var iSelectedValue = document.RBSInstallForm.List.options[iSelectedIndex].value;
      document.RBSInstallForm.elements["Selected_Item"].value=iSelectedValue;

      var strURL = "webacc";
      strURL += "?taskId=fw.RBSInstall";
      strURL += "&merge=dev.GenConf";
      strURL += "&error=dev.GenConf";
      strURL += "&User.context=<%= c.var("User.context") %>";
      strURL += "&nextState=doCreateCannedTasks";

      document.RBSInstallForm.target = "Content";
      document.RBSInstallForm.action = strURL;
      document.RBSInstallForm.submit();
   }

   function doCreateCollection()
   {
      if(checkCollectionRequiredFields() == false)
      {
        return;
      }

      var strURL = "webacc";
      strURL += "?taskId=fw.RBSInstall";
      strURL += "&merge=dev.GenConf";
      strURL += "&error=dev.GenConf";
      strURL += "&User.context=<%= c.var("User.context") %>";
      strURL += "&nextState=doCreateCollection";

      document.RBSInstallForm.target = "Content";
      document.RBSInstallForm.action = strURL;
      document.RBSInstallForm.submit();
   }

   function setFocusToFormElement()
   {
      if( document.RBSInstallForm.List.length > 0 )
      {
        document.RBSInstallForm.List.options[0].selected=true;
      }
   }

    function checkRequiredFields()
    {
        var contextName = document.RBSInstallForm.InstallContext_Name.value;
        if ((contextName == null) || (contextName.length == 0))
        {
            alert("rbsCollection Container needs to have a value entered.");
            return false;
        }
        return true;
    }

    function checkCollectionRequiredFields()
    {
        var collName = document.RBSInstallForm.Collection_Name.value;
        if ((collName == null) || (collName.length == 0))
        {
            alert("rbsCollection name needs to have a value entered.");
            return false;
        }
        var contextName = document.RBSInstallForm.CollectionContext_Name.value;
        if ((contextName == null) || (contextName.length == 0))
        {
            alert("Container needs to have a value entered.");
            return false;
        }
        return true;
    }
</script>
</HEAD>

<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF" onLoad="setFocusToFormElement()">
<form name="RBSInstallForm" method=post action="webacc">
        <input  type=hidden
                name="Selected_Item"
                value="">

    <!-- ############################## -->
    <!-- Form Header -->
    <!-- ############################## -->
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
            <th nowrap colspan="2" class="formhead1">Role Based Services Install</th>
        </tr>
        <tr height="10"></tr>
    </table>

    <!-- ############################## -->
    <!-- Step One -->
    <!-- ############################## -->
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
            <td class="tablesubhead1" height="20" colspan="2">Step 1 - Extend Schema</td>
        </tr>
        <tr height="10"></tr>
        <tr>
            <td class="instructions" colspan="2">Extend the schema to include the new Role Based Services extensions.</td>
        </tr>
        <tr height="10"></tr>
        <tr>
            <td><a href="javascript:doExtendSchema()"><IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Extend.image") %>" alt="<%= c.string("Button.Extend.alt") %>" title="<%= c.string("Button.Extend.alt") %>" border=0></a></td>
        </tr>
        </tr>
        <tr height="10"></tr>
        <tr>
    </table>

    <!-- ############################## -->
    <!-- Step Two -->
    <!-- ############################## -->
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
            <td class="tablesubhead1" height="20" colspan="2">Step 2 - Create rbsCollection Object</td>
        </tr>
        <tr height="10"></tr>
        <tr>
            <td class="instructions" colspan="2">Create a rbsCollection container to install the product packages into.</td>
        </tr>
        <tr height="10"></tr>
        <tr>
            <td>Name:</td>
        </tr>
        <tr>
            <td>
                <input  type="text"
                        name="Collection_Name"
                        value="Role Based Service"
                        size="30">
            </td>
        </tr>
        <tr>
            <td>Container:</td>
        </tr>
        <tr>
            <td>
                <input  type="text"
                        name="CollectionContext_Name"
                        value="<%= c.var("SearchResults") %>"
                        size="30">
                <% c.set("OS.TypeFilter", "Organization,Organizational Unit,Country,Locality,domain");
	                c.set("OS.Control", "CollectionContext_Name");
                   c.set("OS.History", "true"); %>
                <jsp:include page='<%= c.getPath("dev/OS_inc.jsp") %>' flush="true" />
            </td>
        </tr>
        <tr height="10"></tr>
        <tr>
            <td>
                <a href="javascript:doCreateCollection()"><IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Create.image") %>" alt="<%= c.string("Button.Create.alt") %>" title="<%= c.string("Button.Create.alt") %>" border=0></a>
            </td>
        </tr>
        </tr>
        <tr height="10"></tr>
        <tr>
    </table>

    <!-- ############################## -->
    <!-- Step Three -->
    <!-- ############################## -->
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
            <td class="tablesubhead1" height="20" colspan="2">Step 3 - Install to eDirectory</td>
        </tr>
        <tr height="10"></tr>
        <tr>
            <td class="instructions" colspan="2">Each package will create the neccessary objects in the tree.</td>
        </tr>
        <tr>
            <td class="instructions" colspan="2">Note: Each package needs to be installed separately to insure proper installation.</td>
        </tr>
        <tr height="10"></tr>
        <tr>
            <td>Select the package to install:</td>
        </tr>
        <tr>
            <td><select size="8" name="List" style="WIDTH: 220px">
                    <% c.set("i", "0");
                       while (c.lt(c.var("i"), c.var("FileList.Count"))) { %>
                        <OPTION value="<%= c.var("FileList.Element."+c.var("i")) %>"><%= c.var("FileList.Element."+c.var("i")) %>
                        <% c.inc("i");
                       } %>
                </select>
            </td>
        </tr>
        <tr>
            <td>rbsCollection Container:</td>
        </tr>
        <tr>
            <td><input  type="text"
                        name="InstallContext_Name"
                        value="<%= c.var("SearchResults") %>"
                        size="30">
	            <% c.set("OS.TypeFilter", "rbsCollection2");
	               c.set("OS.Control", "InstallContext_Name");
		       c.set("OS.Mode", "search"); %>
		    <jsp:include page='<%= c.getPath("dev/OS_inc.jsp") %>' flush="true" />
	        </td>
        </tr>
        <tr height="10"></tr>
        <tr>
            <td>
                <a href="javascript:doCreateCannedTasks()"><IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Install.image") %>" alt="<%= c.string("Button.Install.alt") %>" title="<%= c.string("Button.Install.alt") %>" border=0></a>
            </td>
        </tr>
        <tr height="10"></tr>
    </table>

    <!-- ############################## -->
    <!-- Step Four -->
    <!-- ############################## -->
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
            <td class="tablesubhead1" height="20" colspan="2">Step 4 - Role Association</td>
        </tr>
        <tr height="10"></tr>
        <tr>
            <td class="instructions" colspan="2">Now proceed to the Role Management Role on the left and select the Modify a role task to associate members to the role.</td>
        </tr>
        <tr>
	      <td colspan="2">
	        <hr noshade size="2">
	      </td>
    	</tr>
  </table>
</form>
<jsp:include page='<%= c.getPath("dev/OSFooter_inc.jsp") %>' flush="true" />
</BODY></HTML>
<!-- <a href="webacc?taskId=fw.Body&merge=fw.HomePage&User.context=<%= c.var("User.context") %>"><IMG alt="<%= c.string("Button.Done.alt") %>" title="<%= c.string("Button.Done.alt") %>" src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Done.image") %>" border=0></a> -->
