<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils,
                                                                             com.novell.emframe.fw.FwUtils,
                                                                             com.novell.emframe.dev.eMFrameFactory,
                                                                             com.novell.emframe.dev.MContext,
                                                                             com.novell.application.console.snapin.ObjectEntry,
                                                                             com.novell.emframe.fw.RBSUtil" %>
<%   JSPConduit c = JSPConduit.getJSPConduit(request);
   MContext context = eMFrameFactory.getMContext(request);
   ObjectEntry treeOE = RBSUtil.getTreeOE(context);
   boolean isLDAP = treeOE.getAdminNamespace().getUniqueID().equalsIgnoreCase("LDAP");

   c.stringTable("DevResources");
   c.stringTable("FwResources"); %>
<HTML>
<HEAD>
<TITLE><%= c.string("CreateRBSCollection.Title") %></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 setFocusToFormElement()
   {
      document.CreateRBSCollectionForm.Collection_Name.focus();
   }

   /*******************
    * FUNCTION HEADER *
    *******************/
    function onPageSubmit()
    {
      if(checkCollectionRequiredFields() == false)
      {
        return false;
      }

      return true;
    }

    function checkCollectionRequiredFields()
    {
        var collName = document.CreateRBSCollectionForm.Collection_Name.value;
        if ((collName == null) || (collName.length == 0))
        {
            alert("<%= c.string("CreateRBSCollection.NameField") %>");
            return false;
        }
        var contextName = document.CreateRBSCollectionForm.CollectionContext_Name.value;
        if ((contextName == null) || (contextName.length == 0))
        {
            alert("<%= c.string("CreateRBSCollection.ContainerField") %>");
            return false;
        }
        return true;
    }

</script>
</HEAD>

<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF" onLoad="returnFromOS();setFocusToFormElement()">
<form   name="CreateRBSCollectionForm"
        method=post
        action="webacc"
        onSubmit="return(onPageSubmit())">
   <input type=hidden name="taskId" value="<%= c.var("taskId") %>">
   <input type=hidden name="merge" value="dev.GenConf">
   <input type=hidden name="error" value="dev.GenErr">
   <input type=hidden name="User.context" value="<%= c.var("User.context") %>">
   <input type=hidden name="nextState" value="doCreateRBSCollection">

   <% c.set("TaskHeader.title", c.string("CreateRBSCollection.TaskHeaderTitle"));
      c.set("TaskHeader.iconUrl", "dir/rbsCollection.gif");
      c.set("TaskHeader.helpFile", "base/createcollection.html");
      c.set("TaskHeader.HelpWindowWidth", "500");
      c.set("TaskHeader.HelpWindowHeight", "500"); %>
   <jsp:include page='<%= c.getPath("dev/TaskHeader_inc.jsp") %>' flush="true" /><BR>

    <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
            <TD class="mediumtext" valign=bottom>
                    <%= c.string("CreateRBSCollection.Name") %><br>
                <input  type="text"
                        name="Collection_Name"
                        <%
                           if(isLDAP == true)
                           {
                        %>value="cn=Role Based Service 2"
                        <%
                           }
                           else
                           {
                        %>value="Role Based Service 2"
                        <%
                           }
                        %>
                        maxlength="64"
                        size="30">
            </td>
        </tr>
        <TR>
            <TD class="mediumtext">
                &nbsp;
            </td>
        </TR>
        <tr>
            <td class="mediumtext" valign=bottom>
                <%= c.string("CreateRBSCollection.Container") %><br>
                <input  type="text"
                        name="CollectionContext_Name"
                        value="<%= c.var("SearchResults") %>"
                        size="30">
                <%
                  c.set("OS.TypeFilter", c.var("CollectionContainmentTypes"));
	               c.set("OS.Control", "CollectionContext_Name");
	               c.set("OS.Mode", "Browse");
                  c.set("OS.History", "true"); %>
                <jsp:include page='<%= c.getPath("dev/OS_inc.jsp") %>' flush="true" />
            </td>
        </tr>
        <TR>
            <TD class="mediumtext">
                &nbsp;
            </td>
        </TR>
    </table>
    <jsp:include page='<%= c.getPath("dev/Bar_inc.jsp") %>' flush="true" />
    <input   type=image
            name="OkButton"
            alt="<%= c.string("Button.OK.alt") %>"
            title="<%= c.string("Button.OK.alt") %>"
            src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.OK.image") %>"
            border=0>
            <jsp:include page='<%= c.getPath("dev/Cancel_inc.jsp") %>' flush="true" />
</form>
<jsp:include page='<%= c.getPath("dev/OSFooter_inc.jsp") %>' flush="true" />
</BODY></HTML>
