﻿<html   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:xf="http://www.w3.org/2002/xforms"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
   xmlns:ev="http://www.w3.org/2001/xml-events"
   xmlns:oai="http://www.openarchives.org/OAI/2.0/"
   xmlns:rs="http://www.stsci.edu/registrysupport">
  <head>
    <title>STScI Directory Registration and Resource Management </title>
    <link href="http://www.us-vo.org/app_templates/usvo_template.css" type="text/css" rel="stylesheet"/>
    <style type="text/css">
      .section	{MARGIN-TOP: 2px; MARGIN-BOTTOM: 2px; BACKGROUND-COLOR:#DDDDDD;}
      .searchbox	{WIDTH: 85px;}
      .nvoapptitle  { color: #243a6d;
      font-weight: bolder; font-size: 14pt;
      text-align: center; margin-left: 2px; margin-right: 2px; }
      p 		{MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px;}

      #header	{POSITION: absolute; TOP:  0px; LEFT:  2px;}
      #search	{POSITION: absolute; TOP: 26px; LEFT:648px; WIDTH:160PX;}
      #navibar	{MARGIN-TOP: 0px;POSITION: absolute; TOP: 96px; LEFT:154px;
      WIDTH: 450px; PADDING:0px }
      #menubar	{POSITION: absolute; TOP: 96px; LEFT:  0px; WIDTH: 132px;
      PADDING:4px; BACKGROUND-COLOR:#EEEEEE;}

      #features	{POSITION: absolute; TOP:128px; LEFT:646px; WIDTH: 132px;}
      #main		{POSITION: absolute; TOP:128px; LEFT:153px; WIDTH: 641px;
      PADDING:8px;}
      .th           {font-weight:800; background-color:#DDDDEF;}
      .td           {background-color:#EEEEEE;}
      p,tr,td,dt,dd {FONT-WEIGHT: normal; FONT-SIZE: 9pt; FONT-STYLE: normal; }
    </style>
    <link rel="stylesheet" type="text/css" href="./js/regview.css"/>
    <link rel="stylesheet" type="text/css" href="./js/styles.css"/>
    <style type="text/css">
      h1,h2,h3,h4,h5,h6,p, body, tr, td, ul, li {FONT-FAMILY: arial,helvetica,sans-serif}

      UNKNOWN {
      BACKGROUND-COLOR: white; MARGIN: 0.12in; WORD-SPACING: 1em; COLOR: black; LETTER-SPACING: 0.1em
      }
      H1 {
      FONT-WEIGHT: 700; FONT-SIZE: 18pt; COLOR: #003366; FONT-STYLE: normal;
      }
      H1.custom {
      FONT-WEIGHT: normal; FONT-SIZE: 36pt; FONT-STYLE: normal;
      }
      H1.custom2 {
      FONT-WEIGHT: normal; FONT-SIZE: 42pt; FONT-STYLE: normal;
      }
      H1.custom3 {
      FONT-WEIGHT: normal; FONT-SIZE: 6pt; FONT-STYLE: normal;
      }
      H2 {
      FONT-WEIGHT: 700; FONT-SIZE: 16pt; COLOR: #003366; FONT-STYLE: normal;
      }
      H3 {
      FONT-WEIGHT: 700; FONT-SIZE: 14pt; COLOR: #003366; FONT-STYLE: normal;
      }
      H4 {
      FONT-WEIGHT: 700; FONT-SIZE: 12pt; COLOR: #003366; FONT-STYLE: normal;
      }
      H5 {
      FONT-WEIGHT: 700; FONT-SIZE: 10pt; COLOR: #003366; FONT-STYLE: normal;
      }
      H6 {
      FONT-WEIGHT: 700; FONT-SIZE: 8pt; COLOR: #003366; FONT-STYLE: normal;
      }
      DIV {
      FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal;
      }
      SPAN {
      FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal;
      }
      P,TR, TD {
      FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-STYLE: normal;
      }
      HR {
      COLOR: #ffcc00
      }

      LI {
      MARGIN-TOP:0px;  MARGIN-BOTTOM:0px;
      }
      UL, P {
      MARGIN-TOP:4px;  MARGIN-BOTTOM:4px;
      }
      H3, H4 {
      MARGIN-TOP:8px;  MARGIN-BOTTOM:6px;
      }
      .tiny		{FONT-SIZE: 7pt;}
      .tinylink	{FONT-SIZE: 7pt; COLOR:#aaaaff;}
      .navlink	{MARGIN-TOP: 0px; MARGIN-BOTTOM: 1px; FONT-SIZE:9pt;
      BACKGROUND-COLOR:#6ba5d7; text-align: center}
      .navlink A	{ TEXT-DECORATION:none;COLOR:#FFFFFF;}
      .navlink A:hover { BACKGROUND-COLOR:#6ba5d7; TEXT-DECORATION:none; COLOR: #99FFCC; }
      .helplink	{MARGIN-TOP: 0px; MARGIN-BOTTOM: 1px; FONT-SIZE:9pt;
      BACKGROUND-COLOR:#24386d; text-align: center}
      .helplink A	{TEXT-DECORATION:none;COLOR:#FFFFFF;}
      .helplink A:hover { COLOR: #99FFCC; }
      .nvolink	{MARGIN-TOP: 0px; MARGIN-BOTTOM: 1px; FONT-SIZE:9pt;
      PADDING-LEFT: 2px;
      PADDING-RIGHT: 2px; }
      .nvolink A	{TEXT-DECORATION:none;COLOR:#6ba5d7;}
      .nvolink A:hover { COLOR: #99FFCC; }
      .nvolinktiny A {FONT-SIZE:7PT;}
      .section	{MARGIN-TOP: 2px; MARGIN-BOTTOM: 2px; BACKGROUND-COLOR:#DDDDDD;}
      .searchbox	{WIDTH: 85px;}
      .nvoapptitle  { color: #24386d;
      font-weight: bolder; font-size: 14pt;
      text-align: center; margin-left: 2px; margin-right: 2px; }
      p 		{MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px;}

      #header	{POSITION: absolute; TOP:  0px; LEFT:  2px;}
      #search	{POSITION: absolute; TOP: 26px; LEFT:648px; WIDTH:160PX;}
      #navibar	{MARGIN-TOP: 0px;POSITION: absolute; TOP: 96px; LEFT:154px;
      WIDTH: 450px; PADDING:0px }
      #menubar	{POSITION: absolute; TOP: 96px; LEFT:  0px; WIDTH: 132px;
      PADDING:4px; BACKGROUND-COLOR:#EEEEEE;}

      #features	{POSITION: absolute; TOP:128px; LEFT:646px; WIDTH: 132px;}
      #main		{POSITION: absolute; TOP:128px; LEFT:153px; WIDTH: 641px;
      PADDING:8px;}
      .th           {font-weight:800; background-color:#DDDDEF;}
      .td           {background-color:#EEEEEE;}
      P,TR,TD,DT,DD {FONT-WEIGHT: normal; FONT-SIZE: 9pt; FONT-STYLE: normal; }
    </style>
    <style type="text/css">
      @namespace xf url("http://www.w3.org/2002/xforms");
      xf|input, xf|secret {
      display: table-row;
      }

      xf|label {
      display: table-cell;
      font-family: Ariel, Helvetica, sans-serif;
      font-size: small;
      }

      <!--*:required::after { content: "*"; color:red; }-->

      *:required {
      color:firebrick;
      }


      *:invalid  {
      background-color: firebrick;
      }
    </style>
  </head>
  <body>

    <xf:model id="stoai">
      <xf:instance id="Request">
        <Login xmlns="http://www.stsci.edu/registrysupport">
          <username></username>
          <password></password>
        </Login>
      </xf:instance>

      <xf:instance id="NewUserRequest">
        <User xmlns="http://www.stsci.edu/registrysupport">
          <name></name>
          <email></email>
          <username></username>
          <password></password>
          <confirmpassword></confirmpassword>
          <associatedauthority></associatedauthority>
        </User>
      </xf:instance>

      <xf:instance id="SetupAuthority">
        <Authority xmlns="http://www.stsci.edu/registrysupport">
          <newauthority></newauthority>
          <lastauthority></lastauthority>
          <hasnew></hasnew>
        </Authority>
      </xf:instance>

      <xf:instance id="Response">
        <dummy xmlns="">
        </dummy>
      </xf:instance>

      <xf:instance id="AuthorityResponse">
        <dummy xmlns="">
        </dummy>
      </xf:instance>

      <xf:instance id="statedata" xmlns="">
        <data>
          <success></success>
          <failure></failure>
          <authoritysuccess></authoritysuccess>
          <authorityfailure></authorityfailure>
          <noxforms></noxforms>
        </data>
      </xf:instance>

      <xf:submission id="SubmitRequest"
            method="post"
            ref="instance('Request')"
            replace="instance"
            instance="Response"
            omit-xml-declaration="yes"
            action="http://nvo.stsci.edu/publishing/managereg.asmx/Login" />

      <xf:submission id="SubmitNewUserRequest"
            method="post"
            ref="instance('NewUserRequest')"
            replace="instance"
            instance="Response"
            omit-xml-declaration="yes"
            action="http://nvo.stsci.edu/publishing/usermanagement.asmx/CreateNewUser" />

      <xf:submission id="GetAuthorityList"
            method="get"
            ref="instance('statedata')"
            replace="instance"
            instance="AuthorityResponse"
            omit-xml-declaration="yes"
            action="http://nvo.stsci.edu/publishing/managereg.asmx/GetAuthorityList" />

      <xf:bind id="lusername" model="stoai" nodeset="instance('Request')//rs:username" required="true()"/>
      <xf:bind id="lpassword" model="stoai" nodeset="instance('Request')//rs:password" required="true()"/>

      <xf:bind id="name" nodeset="instance('NewUserRequest')//rs:name" required="true()"/>
      <xf:bind id="email" nodeset="instance('NewUserRequest')//rs:email" required="true()"/>
      <xf:bind id="username" nodeset="instance('NewUserRequest')//rs:username" required="true()"/>
      <xf:bind id="password" nodeset="instance('NewUserRequest')//rs:password" required="true()"/>
      <xf:bind id="confirmpassword" nodeset="instance('NewUserRequest')//rs:confirmpassword" required="true()"/>

      <xf:bind nodeset="instance('statedata')//success" relevant="instance('Response')//rs:returncode = '0'" />
      <xf:bind nodeset="instance('statedata')//failure" relevant="not(instance('Response')//rs:returncode = '0')" />

      <xf:bind nodeset="instance('statedata')//authoritysuccess" relevant="instance('AuthorityResponse')//rs:returncode = '0'" />
      <xf:bind nodeset="instance('statedata')//authorityfailure" relevant="not(instance('AuthorityResponse')//rs:returncode = '0')" />
      <xf:bind nodeset="instance('statedata')//noxforms" relevant="false()" />
    </xf:model>

    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="112" height="32" align="center" valign="top">
          <a
href="http://www.us-vo.org" class="nvolink" target="_top">
            <img
        src="http://www.us-vo.org/images/NVO_100pixels.jpg" border="0"/>
          </a>
          <span class="nvolink">
            <a
href="http://www.us-vo.org/" target="_top">National Virtual Observatory</a>
          </span>
        </td>
        <td width="50" align="center" valign="middle">
          <img src="images/directory50.png" alt="ICON" width="50" height="50" />
        </td>
        <td valign="top">
          <table  width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="2" height="30" bgcolor="white"></td>
              <td width="678" height="39" align="center"
                        valign="middle"
                        background="images/stars.jpg"
                        bgcolor="#CFE5FC"  class="nvoapptitle" style="background-repeat: repeat-y;">
                <span class="nvoapptitle" style="background-repeat: repeat-y;">NVO Registry</span>
              </td>
              <td bgcolor="white" width="2"></td>
            </tr>
            <tr>
              <td bgcolor="white" width="2"></td>
              <td bgcolor="white" width="2"></td>
            </tr>
            <tr>
              <td align="center" valign="top" colspan="3">
                <table cellspacing="2" cellpadding="0" border="0" width="100%"
                style="margin: 0pt;">
                  <tr>
                    <!-- the local links -->
                    <td class="navlink">
                      <a href="http://www.us-vo.org/">NVO Home</a>
                    </td>
                    <td class="navlink">
                      <a href="http://nvo.stsci.edu/vor10/keywordsearch.aspx">Search</a>
                    </td>
                    <td class="navlink">
                      <a href="http://nvo.stsci.edu/vor10/xpublish.aspx">Publish</a>
                    </td>
                    <td class="navlink">
                      <a href="http://nvo.stsci.edu/vor10/riws.aspx">Developers</a>
                    </td>
                    <td class="navlink">
                      <a href="http://nvo.stsci.edu/vor10/helpnew.aspx">Help</a>
                    </td>
                    <td class="helplink">
                      <a href="http://www.us-vo.org/feedback/">Contact Us</a>
                    </td>

                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
        <td width="140" align="center" valign="top">
          <!-- local logo and link -->
          <span class="tiny">Hosted By</span>
          <br/>
          <a href="http://www.stsci.edu">
            <img height="54"
         src="images/hst.gif"
         alt="STScI Home" border="0"/>
          </a>
          <br />
          <span class="nvolink">
            <span class="tiny">
              <a
            href="http://www.stsci.edu">
                Space Telescope<br/> Science
                Institute
              </a>
            </span>
          </span>
        </td>
      </tr>

    </table>
    <table>
      <tr>
        <td width="112"></td>
        <td>

          <xf:group model="stoai" ref="instance('statedata')//noxforms">
            <h2>This page requires XForms browser support.</h2>
            <p>
              If you can see this message, your web browser does support xforms.
              Most web browsers now have XForms support natively or through plugins.
            </p>
            <br/>
            <p>
              The XForms plugin for Firefox 3 is currently in development, but is publicly available.
              The NVO Directory Registration and Resource Creation interface
              has been tested with it, and does function properly. The plugin (for Windows, Linux, and MacOS)
              can be downloaded from mozilla.org <a href="https://addons.mozilla.org/en-US/firefox/addon/824" target="new">here</a>.<br/>
              <br/>The latest version of Firefox 3 for use with the plugin can be downloaded from mozilla.org <a href="http://www.mozilla.com/en-US/firefox/all.html" target="new">here</a>.
            </p>
            <br/>
            <br/>
            <p>
              The plugin for Firefox 2.0.0.15 (or higher Firefox 2 version) can be
              downloaded from mozilla.org <a href="https://addons.mozilla.org/en-US/seamonkey/addons/versions/824#version-0.8.6ff2" target="new">here</a>.<br/>
              <br/>Firefox 2.0.0.16 for use with the plugin can be downloaded from mozilla.org <a href="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.16/win32/en-US/Firefox%20Setup%202.0.0.16.exe" target="new">here</a>.
            </p>
            <table height="1000">
              <tr>
                <td></td>
              </tr>
            </table>
          </xf:group>

          <xf:switch>
            <xf:case id="login">
              <h2>STScI Directory Registration and Resource Management: Login Page</h2>
              <p>
                <xf:output ref="instance('statedata')//failure" value="">
                  If you do not already have an account, you will need to create one before you can register resources.<br/>
                  <xf:trigger>
                    <xf:label>Create New Account</xf:label>
                    <xf:action ev:event="DOMActivate">
                      <xf:toggle case="newuser" />
                      <xf:toggle case="firstrun" />
                      <xf:send submission="GetAuthorityList"></xf:send>
                    </xf:action>
                  </xf:trigger>
                </xf:output>
              </p>
              <br/>
              <p>Please enter your details below.</p>

              <xf:input bind="lusername">
                <xf:label>Username: </xf:label>
              </xf:input>
              <xf:secret bind="lpassword">
                <xf:label>Password: </xf:label>
              </xf:secret>
              <br/>
              <xf:output ref="instance('statedata')//failure" value="">
                <xf:trigger style="display:block">
                  <xf:label>Submit</xf:label>
                  <xf:action ev:event="DOMActivate">
                    <xf:send submission="SubmitRequest"/>
                    <xf:toggle case="submitted"/>
                  </xf:action>
                </xf:trigger>
              </xf:output>
            </xf:case>
            <xf:case id="newuser">
              <h2>STScI Directory Registration and Resource Management: New User Creation</h2>
              <xf:output ref="instance('statedata')//failure" value="">
                <p>
                  If you already have an account, you may simply log in.<br/>
                  <xf:trigger>
                    <xf:label>Login</xf:label>
                    <xf:action ev:event="DOMActivate">
                      <xf:toggle case="login" />
                      <xf:toggle case="firstrun" />
                      <xf:setvalue bind="lusername" value=""/>
                      <xf:setvalue bind="lpassword" value=""/>
                    </xf:action>
                  </xf:trigger>
                </p>
              </xf:output>
              <br/>
              <p>Please enter your details below. All fields in red are required.</p>

                    <table bgcolor="white">
                      <tr>
                        <td>
                          <xf:input bind="name">
                            <xf:label>Name: </xf:label>
                            <xf:message ev:event="xforms-invalid" >xforms-invalid</xf:message>
                          </xf:input>
                          <xf:input bind="email">
                            <xf:label>Email: </xf:label>
                          </xf:input>
                          <xf:input bind="username">
                            <xf:label>Username: </xf:label>
                          </xf:input>
                          <xf:secret bind="password">
                            <xf:label>Password: </xf:label>
                          </xf:secret>
                          <xf:secret bind="confirmpassword">
                            <xf:label>Confirm Password: </xf:label>
                          </xf:secret>
                        </td>
                      </tr>
                      <tr>
                        <td>
                          <xf:output ref="instance('statedata')//authoritysuccess" value="">
                            <br/>Select the project or organisational division with which you are associated.
                            <xf:select1 ref="instance('NewUserRequest')//rs:associatedauthority" selection="closed" appearance="minimal">
                              <xf:itemset nodeset="instance('AuthorityResponse')//rs:ResourceInfo">
                                <xf:label ref="rs:title"/>
                                <xf:value ref="rs:ivoId"/>
                              </xf:itemset>
                              <xf:action ev:event="xforms-value-changed">
                                <xf:setvalue ref="instance('SetupAuthority')//rs:hasnew" value="false"/>
                                <xf:rebuild/>
                              </xf:action>
                            </xf:select1>
                            <br/>
                          </xf:output>
                        </td>
                      </tr>
                      <tr>
                        <td>
                          <xf:output ref="instance('statedata')//authoritysuccess" value="">
                            <xf:select ref="instance('SetupAuthority')//rs:hasnew"
                                   selection="closed"
                                   appearance="full" >
                              <xf:item>
                                Not Listed <xf:value>true</xf:value>
                              </xf:item>
                            </xf:select>
                          </xf:output>
                        </td>
                      </tr>
                    </table>
              <br/> 
              <xf:action ev:event="xforms-select">
                <xf:setvalue ref="instance('SetupAuthority')//rs:lastauthority" value="instance('NewUserRequest')//rs:associatedauthority" />
                <xf:setvalue ref="instance('NewUserRequest')//rs:associatedauthority" value=""/>
              </xf:action>
              <xf:action ev:event="xforms-deselect">
                <xf:setvalue ref="instance('NewUserRequest')//rs:associatedauthority" value="instance('SetupAuthority')//rs:lastauthority" />
              </xf:action>


              <xf:output ref="instance('statedata')//failure" value="">
                <xf:trigger style="display:block">
                  <xf:label>Submit</xf:label>
                  <xf:action ev:event="DOMActivate">
                    <xf:send submission="SubmitNewUserRequest"/>
                    <xf:toggle case="submitted"/>
                  </xf:action>
                </xf:trigger>
              </xf:output>
            </xf:case>
            <xf:case id="loggedin">
            </xf:case>
          </xf:switch>
          
          <br/>
          <xf:switch>
            <xf:case id="firstrun">
            </xf:case>
            <xf:case id="submitted">
              <xf:group ref="instance('statedata')//failure">
                <xf:output value="instance('Response')//rs:message"></xf:output>
                <br/>
              </xf:group>
            </xf:case>
            </xf:switch>
          <xf:output ref="instance('statedata')//success" value="">
            You have successfully logged in.
            <br/>
                <xf:trigger>
                  <xf:label>Continue</xf:label>
                  <xf:load resource="http://nvo.stsci.edu/publishing/recordstartpage.xhtml"
                           ev:event="DOMActivate" show="replace" />
                </xf:trigger>
            <br />
            </xf:output>
          
          
        </td>
        <td width="147"></td>
      </tr>
    </table>
    <br />
    <hr align="left" noshade=""/>
    <table width="100%"  border="0" align="center" cellpadding="4" cellspacing="0">
      <tr align="center" valign="top">

        <td width="16%" valign="top">
          <div align="center" class="style10">
            <a href="http://www.nsf.gov">
              <img src="http://www.us-vo.org/images/nsf_logo.gif" alt="NSF HOME" width="50" height="50" border="0"/>
            </a>
            <a href="http://www.nasa.gov">
              <img src="http://www.us-vo.org/images/nasa_logo_sm.gif" alt="NASA HOME" width="50" height="47" border="0"/>
            </a>
          </div>
        </td>
        <td width="76%">
          <div align="center">
            <p class="style10">
              Developed with the support of the <a href="http://www.nsf.gov">National Science Foundation</a> <br/>

              under Cooperative Agreement AST0122449 with the Johns Hopkins University <br/>
              The NVO is a member of the <a href="http://www.ivoa.net">International Virtual Observatory Alliance</a>
            </p>
            <p class="style10">
              This NVO Application is hosted by the <a href="http://www.stsci.edu">Space Telescope Science Institute</a>
            </p>
          </div>
        </td>
        <td width="8%">
          <div align="center">
            <span class="tiny">
              Member<br/>
            </span>
            <a href="http://www.ivoa.net">
              <img src="images/ivoa_small.jpg" alt="ivoa logo" width="68" height="39" border="0" align="top"/>
            </a>
          </div>
        </td>

        <td width="8%">
          <span class="style4">
            <span class="tiny"><a href="http://nvo.stsci.edu/vor10/contactus.aspx">Meet the Developers</a></span>
            <br/>
            <img src="http://www.us-vo.org/images/bee_hammer.gif" alt="MEET THE DEVELOPERS" width="50" border="0"/>
          </span>
        </td>
      </tr>
    </table>
  </body>
</html>

