<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="org.deegree.i18n.Messages" %>
<%@ page import="java.util.Locale" %>
<%
Locale loc = request.getLocale();
String id = request.getParameter( "id" );
String action = request.getParameter( "action" );
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
        <meta http-equiv="cache-control" content="no-cache" >
        <meta http-equiv="pragma" content="no-cache" >
        <title>deegree catalogueManager</title>
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/exception.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/utils.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/validation.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/json2.js"></SCRIPT>       
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/request_handler.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/iso19115.js"></SCRIPT>        
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/dialogs.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/metadata.js"></SCRIPT>        
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/metadatavalidation.js"></SCRIPT>      
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/metadatabean.js"></SCRIPT>        
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/uuid.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="./javascript/accordian.pack.js"></SCRIPT>
        <!-- SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript" src="http://getfirebug.com/releases/lite/latest/firebug-lite.js"></SCRIPT-->    
        <link href="./css/metadataclient.css"  type="text/css" rel="stylesheet">
        <script type="text/javascript">

        function initEditor() {
<%
           if ( id != null ) {
%>                   
                   fromTemplate = <%=action.equals( "new" ) %>;
                   loadMetadatasetByFileId( '<%=id %>' );
<%                                
           }
%>
        }
        
        </script>
    </head>
    <body onload="init(); initEditor()">
    <div id="box">
    
        <div class="topFrame">
            <table cellpadding="0" cellspacing="0" border="0" summary="">
                <tr>
                    <td><img border="0" src="./images/logo-deegree.png" alt="logo"/></td>
                    <td width="100"></td>
                    <td><h2>catalogueManager editor</h2></td>
                </tr>
            </table>            
        </div>
         
        <div class="menubarEditor">
              <a class="navi" href="md_search.jsp">search</a>
        </div>
        
        <div class="toolbarFrame">
            <a href="#" onclick="clearForm()" class="toolbarItem" style="position:absolute; left:0px;" title="<%=Messages.get( loc, "CATMANAGE_NEWMETADATSET" ) %>"><img border="0" src="./images/page_white_add.png"/></a>
            <a href="#" onclick="loadTemplateList()" class="toolbarItem" style="position:absolute; left:32px;" title="<%=Messages.get( loc, "CATMANAGE_LOADTEMPLATE" ) %>"><img border="0" src="./images/page_white_text.png"/></a>                 
            <a href="#" onclick="loadMetadataList(true)" class="toolbarItem" style="position:absolute; left:64px;" title="<%=Messages.get( loc, "CATMANAGE_LOADMDTEMPLATE" ) %>"><img border="0" src="./images/page_code.png"/></a>
            <a href="#" onclick="loadMetadataList(false)" class="toolbarItem" style="position:absolute; left:96px;" title="<%=Messages.get( loc, "CATMANAGE_EDITMETADATSET" ) %>"><img border="0" src="./images/page_white_edit.png"/></a>
            <a href="#" onclick="openUploadDialog()" class="toolbarItem" style="position:absolute; left:128px;" title="<%=Messages.get( loc, "CATMANAGE_UPLOAD_METADATASET" ) %>"><img border="0" src="./images/folder_database.png"/></a>            
            <a href="#" onclick="validateMetadata()" class="toolbarItem" style="position:absolute; left:170px;" title="<%=Messages.get( loc, "CATMANAGE_VALIDATEMETADATSET" ) %>"><img border="0" src="./images/page_white_gear.png"/></a>
            <a href="#" onclick="saveMetadataSet()" class="toolbarItem" style="position:absolute; left:202px;" title="<%=Messages.get( loc, "CATMANAGE_SAVEMETADATSET" ) %>"><img border="0" src="./images/page_white_save.png"/></a>
            <a href="#" onclick="deleteMetadataSet()" class="toolbarItem" style="position:absolute; left:234px;" title="<%=Messages.get( loc, "CATMANAGE_DELETEMETADATSET" ) %>"><img border="0" src="./images/page_white_delete.png"/></a>
            
        </div>
        
        <div id="main_content" class="mainFrame">       
            <!--Start of each accordion item sectionHeader-->
            <div id="test-header" class="accordion_headings header_highlight" ><%=Messages.get( loc, "CATMANAGE_HEAD_GENERAL" ) %></div>
<jsp:include page="mdCommon.jsp"></jsp:include>         
            <!--End of each accordion item--> 
            
            <!--Start of each accordion item-->
            <div id="test1-header" class="accordion_headings" ><%=Messages.get( loc, "CATMANAGE_HEAD_CONTENT" ) %></div>
<jsp:include page="mdContent.jsp"></jsp:include>                
            <!--End of each accordion item--> 
            
            
            <!--Start of each accordion item-->
            <div id="test2-header" class="accordion_headings" ><%=Messages.get( loc, "CATMANAGE_HEAD_SPATIAL" ) %></div>
            <div id="test2-content">
                <div class="accordion_child">
                    <div class="line">
                        <a class="title" title="<%=Messages.get( loc, "CATMANAGE_SPATIAL_GEOGR_ID_TITLE" ) %>"><%=Messages.get( loc, "CATMANAGE_SPATIAL_GEOGR_ID" ) %></a>
                        <select id="geogrDescription"></select>
                    </div>      
                    <a href="javascript:openHelp('GeoExtent')" class="help"><img src="./images/help.png" title="<%=Messages.get( loc, "CATMANAGE_DESCRIPTION" ) %>" alt="" /></a>                           
                    <div class="line">
                        <a class="title" title="<%=Messages.get( loc, "CATMANAGE_SPATIAL_CRS_TITLE" ) %>"><%=Messages.get( loc, "CATMANAGE_SPATIAL_CRS" ) %></a>
                        <select id="CRS">
                            <optgroup>
                                <option value="EPSG:4326" selected="selected">WGS84</option>
                                <option value="EPSG:4314">DHDN</option>
                                <option value="EPSG:31466">Gau&szlig;/Kr&uuml;ger Streifen 2</option>
                                <option value="EPSG:31467">Gau&szlig;/Kr&uuml;ger Streifen 3</option>
                                <option value="EPSG:31468">Gau&szlig;/Kr&uuml;ger Streifen 4</option>
                                <option value="EPSG:25832">UTM Zone 32</option>                         
                                <option value="EPSG:25833">UTM Zone 33</option>
                            </optgroup>
                        </select>
                    </div>
                    <a href="javascript:openHelp('refSysInfo')" class="help"><img src="./images/help.png" title="<%=Messages.get( loc, "CATMANAGE_DESCRIPTION" ) %>" alt="" /></a>                  
                    <div class="line">
                        <a class="title" title="<%=Messages.get( loc, "CATMANAGE_SPATIAL_SCALE_TITLE" ) %>"><%=Messages.get( loc, "CATMANAGE_SPATIAL_SCALE" ) %></a>
                        <input id="scale" type="text" value=""></input>
                    </div>
                    <a href="javascript:openHelp('dataScale')" class="help"><img src="./images/help.png" title="<%=Messages.get( loc, "CATMANAGE_DESCRIPTION" ) %>" alt="" /></a>
                </div>
            </div>
            <!--End of each accordion item--> 
                
            <!--Start of each accordion item-->
            <div id="test3-header" class="accordion_headings" ><%=Messages.get( loc, "CATMANAGE_HEAD_TIME" ) %></div>
<jsp:include page="mdTime.jsp"></jsp:include>           
            <!--End of each accordion item--> 
        
            <!--Start of each accordion item-->
            <div id="test4-header" class="accordion_headings"><%=Messages.get( loc, "CATMANAGE_HEAD_RESP_PARTY" ) %></div>
<jsp:include page="mdPointOfContact.jsp"></jsp:include>             
            <!--End of each accordion item--> 

             <!--Start of each accordion item-->
            <div id="test5-header" class="accordion_headings"><%=Messages.get( loc, "CATMANAGE_HEAD_DISTRIBUTION" ) %></div>
<jsp:include page="mdDistribution.jsp"></jsp:include>             
            <!--End of each accordion item-->
        
        </div>
        </div>
        <div id="dialog" class="dialog"></div>
        <div id="uploadDialog" style="position:absolute; z-index: 2000; background: #FFFFFF; visibility:hidden; left: 0px; top: 90px; height:100%; width:100%;">
            <div style="position:relative; left:80px">
                <h2>Metadaten hochladen</h2>
                <form action="control?action=uploadMetadataset" enctype="multipart/form-data" method="POST">        
                  <input type="file" name="file1" size="50">&nbsp;
                  <input type="submit" name="action" value="uploadMetadataset" onclick="getElement('uploadDialog').style.visibility = 'hidden'">
                </form>
            </div>
        </div>
    </body>
</html>