<%@ page import="com.novell.emframe.fw.Registry,
                 java.util.List,
                 java.util.Iterator,
                 org.jdom.Document,
                 org.jdom.Element,
                 com.novell.emframe.dev.eMFrameUtils,
                 com.novell.emframe.dev.eMFrameFactory,
                 com.novell.emframe.fw.PageComparator"%>
<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" %>

<%@ taglib uri="/WEB-INF/iman.tld" prefix="iman" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<iman:stringtable bundle="FwResources"/>
<iman:stringtable bundle="DevResources"/>


<html>
<head>
   <LINK rel="stylesheet" href="<c:out value="${ContextPath}" />/portal/modules/dev/css/hf_style.css">
   <script src="<c:out value="${ContextPath}" />/portal/modules/fw/javascripts/Studio.js"></script>
   <iman:eMFrameScripts/>
   <iman:mvedScripts/>
   <iman:osScripts/>

   <script>
      function onExit()
      {
         window.close();
      }

      function doInit()
      {
      }
   </script>
</head>

<body onLoad="doInit()">
<form name="form">

   <iman:taskHeader titleKey="Studio.pageOrderTitle" titleBundle="FwResources"/><BR>

   <table border="1">
      <tr>
         <td><b><iman:string key="Studio.pageDisplayName"/></b></td>
         <td><b><iman:string key="Studio.pageId"/></b></td>
         <td><b><iman:string key="Studio.pageOrder"/></b></td>
      </tr>

   <%
      List docs = Registry.getRegistry("Global").getAllPages();
      for(Iterator iter=docs.iterator(); iter.hasNext();)
      {
         Document doc=(Document) iter.next();
         Element root = doc.getRootElement();

         String displayName=eMFrameUtils.getDisplayName(root, eMFrameFactory.getMContext(request));
         out.print("<tr><td>" + displayName + "</td>");
         out.print("<td>" + root.getChildTextTrim("id") + "</td>");

         int orderNum=PageComparator.getPageOrderNum(doc);
         out.print("<td>" + orderNum + "</td></tr>");
      }
   %>

      <tr>
         <td></td>
      </tr>
   </table>

   <br/>
   <iman:bar/>
   <iman:button key="OK" onClick="window.close()"/>

</form>
</body>
</html>
