<%@  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("ProductName") %></TITLE>
   <LINK rel='stylesheet' href='<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>'>
   <SCRIPT LANGUAGE="JavaScript">
      function isPageValid()
      {
         if(document.form.rbsCollection.value=="" || document.form.taskName.value=="")
         {
            alert("<%= c.string("TaskBuilder.MustEnterTaskName") %>");
            return false;
         }

         var roleName = document.form.role.value.toUpperCase();
         var collectionName = document.form.rbsCollection.value.toUpperCase();
         if(roleName!="" && roleName.indexOf(collectionName)==-1)
         {
            alert("<%= c.string("TemplateBuilder.roleMustbeInCollection") %>");
            return false;
         }
         else
         {
            return true;
         }
      }
      function init()
      {
         parent.setFooterButtons(parent.finishButton | parent.backButton | parent.cancelButton);

         <%
            String title = null;
            if(c.var("pluginType").equals("delete"))
            {
               title = c.string("TemplateBuilder.InstallDeleteTask");
            }
            else
            {
               title = c.string("TaskBuilder.Install");
            }
         %>

         parent.setHeader("<%= c.string("TaskBuilder.title") %>", "<%= title %>", "fw/studio_installdeletetask.html");
         document.form.taskName.focus();
      }
   </SCRIPT>
   <jsp:include page='<%= c.getPath("dev/eMFrameScripts_inc.jsp") %>' flush="true" />
   <jsp:include page='<%= c.getPath("dev/OSScripts_inc.jsp") %>' flush="true" />
</HEAD>

<body text="#000000" bgcolor="#ffffff" onLoad="init();<% if (session.getAttribute("DeviceType").equals("default")) { %>returnFromOS();"<% } %>">
<FORM name="form" method=post action="webacc" onSubmit="return isPageValid();" >

   <!-- Variables -->
   <INPUT type=hidden name="objectTypeName" value="<%= c.toHTML(c.var("objectTypeName")) %>">
   <INPUT type=hidden name="taskId"         value="<%= c.var("taskId") %>">
   <INPUT type=hidden name="merge"          value="fw.TemplateBuilder_message">
   <INPUT type=hidden name="nextState"      value="InstallTask">
   <INPUT type=hidden name="templateName"   value="<%= c.var("templateName") %>">
   <INPUT type=hidden name="client"         value="<%= c.var("client") %>">
   <INPUT type=hidden name="error"          value="fw.TemplateBuilder_message">
   <INPUT type=hidden name="pluginType"     value="<%= c.var("pluginType") %>">


   <DIV class=instructions><%= c.string("TaskBuilder.installInstructions") %></DIV><BR>

   <TABLE border=0>
      <TR><TD><%= c.string("TaskBuilder.TaskName") %></TD><TD><INPUT type=text name=taskName size=25></TD></TR>

      <% c.set("OS.TypeFilter", "rbsCollection2");
         c.set("OS.Control", "rbsCollection");
         c.set("OS.Mode", "search");
         c.set("OS.History", "true"); %>
      <TR><TD><%= c.string("TaskBuilder.RbsCollection") %></TD><TD><INPUT type=text name=rbsCollection size=25><jsp:include page='<%= c.getPath("dev/OS_inc.jsp") %>' flush="true" /></TD></TR>

      <% c.set("OS.TypeFilter", "rbsRole2");
         c.set("OS.Control", "role");
         c.set("OS.Mode", "search");
         c.set("OS.History", "true"); %>
      <TR><TD><%= c.string("TaskBuilder.Role") %></TD><TD><INPUT type=text name=role size=25><jsp:include page='<%= c.getPath("dev/OS_inc.jsp") %>' flush="true" /> &nbsp; <SPAN class=smalltext2d><%= c.string("TaskBuilder.RoleIsOptional") %></SPAN></TD></TR>
      <TR><TD>&nbsp;</TD></TR>

      <% if (!c.var("pluginType").equals("create") && !c.var("pluginType").equals("delete")) { %>
         <TR><TD colspan="2"><INPUT type=checkbox name=mooEnabled checked size=25>&nbsp;<%= c.string("TaskBuilder.MultipleObjectEnabled") %></TD></TR>
         </TABLE>
      <% } else { %>
         </TABLE>
         <INPUT type="hidden" name="mooEnabled" value="false">
      <% } %>

</FORM>
<jsp:include page='<%= c.getPath("dev/OSFooter_inc.jsp") %>' flush="true" />
</BODY>
</HTML>
