<page xmlns="http://bali.us.oracle.com/cabo/baja" 
      xmlns:baja="http://bali.us.oracle.com/cabo/baja"
      xmlns:marlin="http://bali.us.oracle.com/cabo/marlin" 
      xmlns:html="http://www.w3.org/TR/REC-html40"
      xmlns:data="http://bali.us.oracle.com/cabo/marlin">

  <baja:content xmlns="http://bali.us.oracle.com/cabo/marlin">

    <dataScope>
      <contents>

        <html:title>
          <text data:text="pageTitle@schedule" />
        </html:title>
        <html:noScript>
          "This page uses JavaScript to perform the list of values lookup. Your browser either does not support JavaScript, or it is disabled.  Please enable JavaScript, or upgrade your browser."
        </html:noScript>

        <form name="schedule" method="GET" >
          <contents>

            <pageLayout> 
              <mediumAdvertisement>
                <include baja:node="../oemBanner" />
              </mediumAdvertisement>

              <globalButtons>
                <include baja:node="../globalButtonBar" />
              </globalButtons>

              <tabs>
                <include baja:node ="../globalTabs" />
              </tabs>

   <location>
      <include baja:node="/breadCrumbs"/>
   </location>


              <pageHeader>
                <include baja:node="header"/>
              </pageHeader>

              <data:start>
                <include baja:node="../prefSideNav" />
              </data:start>

              <contentFooter>
                <pageButtonBar>     
                  <contents>
                    <submitButton data:text="editLabel@schedule"
                                  name="event"
                                  value="edit" />
                  </contents>
                </pageButtonBar>
              </contentFooter>
   
              <copyright>
               <include baja:node="../copyright" />
              </copyright>

              <contents>

                <formValue name="userShown" data:value="userShown@schedule"/>
                <script>
                  <contents>
                    function myCallBack(lovwin, event)
                    {
                    // do nothing; mySelect on lov takes care of everything
                    }
                  </contents>
                </script>

                <!-- comment out; show it as instruction text
                <stackLayout rendered="false"
                             data:rendered="showNotDefinedErr@schedule">
                  <contents>
                    <messageBox data:message="SCHEDULE_NOT_DEFINED_MSG@notifResourceBundle"
                                messageType="warning"
                                data:text="SCHEDULE_NOT_DEFINED@notifResourceBundle"/>
                    <spacer height="20"/>
                  </contents>  
                </stackLayout>
                -->

                <stackLayout rendered="false"
                             data:rendered="noEmailErr@schedule">
                  <contents>
                    <messageBox data:message="noEmailErrMsg@schedule"
                                messageType="error"
                                data:text="NO_EMAIL_ADDRESSES@notifResourceBundle">
                      <contents>
                        <styledText data:text="CLICK_TO_SET_EMAIL_ADDRESSES@notifResourceBundle"
                                    data:destination="userPrefDest@schedule"/>
                      </contents>
                    </messageBox>
                    <spacer height="20"/>
                  </contents>  
                </stackLayout>

                <stackLayout rendered="false"
                             data:rendered="notDefinedErr@schedule">
                  <contents>
                    <messageBox data:message="SCHEDULE_NOT_DEFINED_MSG@notifResourceBundle"
                                messageType="error"
                                data:text="SCHEDULE_NOT_DEFINED@notifResourceBundle"/>
                    <spacer height="20"/>
                  </contents>  
                </stackLayout>

                <stackLayout rendered="false"
                             data:rendered="invalidUserErr@schedule">
                  <contents>
                    <messageBox data:message="invalidUserMsg@schedule"
                                messageType="error"
                                data:text="INVALID_USER@notifResourceBundle"/>
                    <spacer height="20"/>
                  </contents>  
                </stackLayout>

                <stackLayout rendered="false"
                             data:rendered="showConfirmMsg@schedule">
                  <contents>
                    <messageBox data:message="confirmMsg@schedule"
                                messageType="info" />
                    <spacer height="20"/>
                  </contents>
                </stackLayout>

                <header data:text="header@schedule" >
                  <contents>
                    <tableLayout width="100%">
                      <contents>
                        <rowLayout>
                          <contents>
                            <cellFormat vAlign="top">
                              <contents>
                                <styledText data:text="scheduleText@schedule"
                                            styleClass="OraInstructionText"/>
                              </contents>
                            </cellFormat>

                            <spacer width="8"/>

                            <cellFormat vAlign="center" hAlign="right">
                              <contents>
                                <submitButton data:text="editLabel@schedule"
                                              name="event"
                                              value="edit" />
                              </contents>
                            </cellFormat>
                          </contents>
                        </rowLayout>
                        <rowLayout>
                          <contents>
                            <spacer height="10"/>
                          </contents>
                        </rowLayout>

                      </contents>
                    </tableLayout>

                    <!-- for priviledged user only -->
                    <flowLayout rendered="false" 
                                data:rendered="showAllUsers@schedule" >
                      <contents>
                        <inlineMessage data:prompt="ADMINISTRATOR_NAME@notifResourceBundle" labeledNodeId="userChoice">
                          <contents>
 
                            <lovField name="userChoice"
                                      onClick="setSearchPage(); openWindow(window, document.schedule.selectUsersPage.value, 'lovWindow', {width:500, height:430}, true, 'dialog', myCallBack); return false;"
                                      data:text="userShown@schedule"
                                      id="userChoice"
                                      columns="10"
                                      data:searchDesc="CLICK_TO_SELECT_ADMIN@notifResourceBundle"
                                      data:shortDesc="CLICK_TO_SELECT_ADMIN@notifResourceBundle" />
                            <formValue name="selectUsersPage"/>
                            <script>
                              <contents>
                                function setSearchPage()
                                {
                                  var userEntered = "";
                                  var selectUsersPage = "selectUsers$userShown=" + document.schedule.userShown.value + "?userChoice="+userEntered;
                                  document.schedule.selectUsersPage.value = selectUsersPage;
                                  window.myData = 'userChoice';
                                }
                              </contents>
                            </script>
                            
                            <spacer width="5" />
                            <submitButton data:text="CHANGE@notifResourceBundle"
                                          name="event"
                                          value="changeUser" />
                          </contents>
                        </inlineMessage> 
                      </contents>
                    </flowLayout>

                    <tableLayout width="100%" 
                                 rendered="false"
                                 data:rendered="scheduleDefined@schedule" >
                      <contents>

                        <rowLayout>
                          <contents>
                            <spacer height="10"/>
                          </contents>
                        </rowLayout>

                        <rowLayout>
                          <contents>
                            <!-- Suspended Notification -->
                            <cellFormat wrappingDisabled="true" >
                              <contents>
                                <styledText data:text="SUSPEND_NOTIFICATION@notifResourceBundle" 
                                            styleClass="OraInstructionText"/>

                                <spacer width="3"/>

                                <styledText data:text="disablePeriod@schedule"
                                            styleClass="OraInstructionTextStrong"/>

                                <spacer width="5"/>
                                <submitButton rendered="true"
                                              data:text="EDIT@notifResourceBundle"
                                              name="event"
                                              value="disPeriod" />

                                <spacer width="5"/>
                                <submitButton rendered="false"
                                              data:rendered="hasDisPeriod@schedule"
                                              data:text="CLEAR@notifResourceBundle"
                                              name="event"
                                              value="clearDisPeriod" />
                                      </contents>
                                    </cellFormat>

                            <spacer width="8"/>
                            <cellFormat vAlign="top" hAlign="right">
                              <contents>
                                <inlineMessage data:prompt="VIEW_WEEK_CONTAINING@notifResourceBundle"
                                               labeledNodeId="dateShown"
                                               data:message="sample@sampleDate" >
                                  <contents>
                                    <dateField name="dateShown"
                                               id="dateShown"
                                               data:shortDesc="VIEW_WEEK_CONTAINING@notifResourceBundle"
                                               required="yes"
                                               data:value="dateShown@schedule" >
                                      <onSubmitValidater>
                                        <date dateStyle="medium" />
                                      </onSubmitValidater>
                                    </dateField>

                                    <spacer width="10" />
                                    <submitButton data:text="GO@notifResourceBundle"
                                                  name="event"
                                                  value="changeDate" />
                                  </contents>
                                </inlineMessage> 
                              </contents>
                            </cellFormat>

                          </contents>
                        </rowLayout>
                      </contents>
                    </tableLayout>

                    <labeledFieldLayout rendered="false"
                                        data:rendered="scheduleDefined@schedule" 
                                        labelWidth="20%" fieldWidth="80%" >
                      <contents>
                        <styledText data:text="DURATION@notifResourceBundle"
                                    styleClass="OraInstructionText"/>
                        <styledText data:text="duration@schedule"
                                    styleClass="OraInstructionTextStrong"/>
                        <styledText data:text="CURRENT_WEEK@notifResourceBundle"
                                    styleClass="OraInstructionText"/>
                        <styledText data:text="currentWeek@schedule"
                                    styleClass="OraInstructionTextStrong"/>
                        <styledText data:text="TIMEZONE@commonResourceBundle"
                                    styleClass="OraInstructionText"/>
                        <styledText data:text="timezone@schedule"
                                    styleClass="OraInstructionTextStrong"/>
                      </contents>
                    </labeledFieldLayout>

                    <tableLayout rendered="false"
                                 data:rendered="scheduleDefined@schedule" >
                      <contents>

                        <rowLayout hAlign="right">
                          <contents>
                            <spacer width="5" />
                          </contents>
                        </rowLayout>

                        <rowLayout vAlign="center" >
                          <contents>
                            <cellFormat vAlign="center" >
                              <contents>
                                <table name="hasEmailLegend" 
                                       data:summary="LEGEND_WITH_EMAIL@notifResourceBundle" 
                                       width="35"
                                       height="15" >
                                  <tableData>
                                    <row name="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" />
                                  </tableData>
                                  <contents>
                                    <styledText data:text="name"
                                                data:shortDesc="LEGEND_WITH_EMAIL@notifResourceBundle"
                                                data:styleClass="hasEmailAddr@schedule"/>
                                  </contents>
                                </table>
                              </contents>
                            </cellFormat>
                            <cellFormat vAlign="center" >
                              <contents>
                                <spacer width="5" />
                                <styledText data:text="LEGEND_WITH_EMAIL@notifResourceBundle"
                                            styleClass="OraInstructionText" />
                              </contents>
                            </cellFormat>

                            <cellFormat vAlign="center" >
                              <contents>
                                <spacer width="25" />
                              </contents>
                            </cellFormat>

                            <cellFormat vAlign="center" >
                              <contents>
                                <table name="disabledNotif" 
                                       data:summary="LEGEND_SUSPENDED_NOTIF@notifResourceBundle" 
                                       width="35"
                                       height="15" >
                                  <tableData>
                                    <row name="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" />
                                  </tableData>
                                  <contents>
                                    <styledText data:text="name"
                                                data:shortDesc="LEGEND_SUSPENDED_NOTIF@notifResourceBundle"
                                                data:styleClass="disabledAddr@schedule"/>
                                  </contents>
                                </table>
                              </contents>
                            </cellFormat>
                            <cellFormat vAlign="center" >
                              <contents>
                                <spacer width="5" />
                                <styledText data:text="LEGEND_SUSPENDED_NOTIF@notifResourceBundle"
                                            styleClass="OraInstructionText" />
                              </contents>
                            </cellFormat>
                          </contents>
                        </rowLayout>

                        <rowLayout >
                          <contents>
                            <spacer height="5" />
                          </contents>
                        </rowLayout>
                      </contents>
                    </tableLayout>

                    <table name="scheduleTable"
                           width="100%"
                           rendered="false"
                           data:summary="NOTIFICATION_SCHEDULE@notifResourceBundle" 
                           data:rendered="scheduleDefined@schedule" 
                           data:columnHeaderData="colLabels@schedule"
                           data:rowHeaderData="rowHeader@schedule"
                           data:tableData="row@schedule" >
                      <columnHeaderStamp>
                        <sortableHeader data:text="colLabel"
                                        data:sortable="sortable" />
                      </columnHeaderStamp>
                      <columnFormats>
                        <columnFormat columnDataFormat="iconButtonFormat"
                                      width="14%" />
                        <columnFormat columnDataFormat="iconButtonFormat"
                                      width="14%" />
                        <columnFormat columnDataFormat="iconButtonFormat"
                                      width="14%" />
                        <columnFormat columnDataFormat="iconButtonFormat"
                                      width="14%" />
                        <columnFormat columnDataFormat="iconButtonFormat"
                                      width="14%" />
                        <columnFormat columnDataFormat="iconButtonFormat"
                                      width="14%" />
                        <columnFormat columnDataFormat="iconButtonFormat"
                                      width="14%" />
                      </columnFormats>
                      <rowHeaderFormats>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                        <rowHeaderFormat cellNoWrapFormat="true"/>
                      </rowHeaderFormats>
                      <rowHeaderStamp>
                        <text data:text="header"/>
                      </rowHeaderStamp>
                      <contents>

                        <switcher data:childName="lovMonShowLink" defaultCase="true">
                          <case name="true"> 
                            <styledText data:styleClass="lovMonStyle"
                                        data:text="lovMonEmailsDisplay"
                                        data:shortDesc="lovMonEmails"
                                        data:destination="lovMonDest" />
                          </case>
                          <case name="false"> 
                            <styledText text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
                                        data:styleClass="lovMonStyle"
                                        data:shortDesc="lovMonEmails" />
                          </case>
                        </switcher>

                        <switcher data:childName="lovTueShowLink" defaultCase="true">
                          <case name="true"> 
                            <styledText data:styleClass="lovTueStyle"
                                        data:text="lovTueEmailsDisplay"
                                        data:shortDesc="lovTueEmails"
                                        data:destination="lovTueDest" />
                          </case>
                          <case name="false"> 
                            <styledText text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
                                        data:styleClass="lovTueStyle"
                                        data:shortDesc="lovTueEmails" />
                          </case>
                        </switcher>

                        <switcher data:childName="lovWedShowLink" defaultCase="true">
                          <case name="true">
                            <styledText data:styleClass="lovWedStyle"
                                        data:text="lovWedEmailsDisplay"
                                        data:shortDesc="lovWedEmails"
                                        data:destination="lovWedDest" />
                          </case>
                          <case name="false"> 
                            <styledText text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
                                        data:styleClass="lovWedStyle"
                                        data:shortDesc="lovWedEmails" />
                          </case>
                        </switcher>

                        <switcher data:childName="lovThuShowLink" defaultCase="true">
                          <case name="true">
                            <styledText data:styleClass="lovThuStyle"
                                        data:text="lovThuEmailsDisplay"
                                        data:shortDesc="lovThuEmails"
                                        data:destination="lovThuDest" />
                          </case>
                          <case name="false"> 
                            <styledText text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
                                        data:styleClass="lovThuStyle"
                                        data:shortDesc="lovThuEmails" />
                          </case>
                        </switcher>

                        <switcher data:childName="lovFriShowLink" defaultCase="true">
                          <case name="true">
                            <styledText data:styleClass="lovFriStyle"
                                        data:text="lovFriEmailsDisplay"
                                        data:shortDesc="lovFriEmails"
                                        data:destination="lovFriDest" />
                          </case>
                          <case name="false"> 
                            <styledText text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
                                        data:styleClass="lovFriStyle"
                                        data:shortDesc="lovFriEmails" />
                          </case>
                        </switcher>

                        <switcher data:childName="lovSatShowLink" defaultCase="true">
                          <case name="true">
                            <styledText data:styleClass="lovSatStyle"
                                        data:text="lovSatEmailsDisplay"
                                        data:shortDesc="lovSatEmails"
                                        data:destination="lovSatDest" />
                          </case>
                          <case name="false"> 
                            <styledText text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
                                        data:styleClass="lovSatStyle"
                                        data:shortDesc="lovSatEmails" />
                          </case>
                        </switcher>

                        <switcher data:childName="lovSunShowLink" defaultCase="true">
                          <case name="true">
                            <styledText data:styleClass="lovSunStyle"
                                        data:text="lovSunEmailsDisplay"
                                        data:shortDesc="lovSunEmails"
                                        data:destination="lovSunDest" />
                          </case>
                          <case name="false"> 
                            <styledText text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
                                        data:styleClass="lovSunStyle"
                                        data:shortDesc="lovSunEmails" />
                          </case>
                        </switcher>

                      </contents>
                    </table>

                  </contents>
                </header>
              </contents>         
            </pageLayout>
          </contents>
        </form> 
      </contents>

      <provider>
        <data name="notifResourceBundle">
          <bundle class="oracle.sysman.resources.NotifMsg"/>
        </data>
        <data name="commonResourceBundle">
          <bundle class="oracle.sysman.resources.CommonResourceBundle"/>
        </data>
        <data name="schedule">
          <method class="oracle.sysman.eml.pref.NotifScheduleData"
                  method="getScheduleData" />
        </data>         
        <data name="sampleDate">
          <method class="oracle.sysman.eml.pref.NotifScheduleData"
                  method="getSampleDate" />
        </data>         
      </provider>
    </dataScope>

  </baja:content>

  <handlers> 
    <event name="*">
      <method class="oracle.sysman.eml.pref.NotifScheduleData"
              method="doNull"/>
    </event>
    <event name="cancel">
      <method class="oracle.sysman.eml.pref.NotifScheduleData"
              method="doCancel"/>
    </event>
    <event name="edit">
      <method class="oracle.sysman.eml.pref.NotifScheduleData"
              method="doEdit"/>
    </event>
    <event name="view">
      <method class="oracle.sysman.eml.pref.NotifScheduleData"
              method="doView"/>
    </event>
    <event name="disPeriod">
      <method class="oracle.sysman.eml.pref.NotifScheduleData"
              method="doView"/>
    </event>
    <event name="clearDisPeriod">
      <method class="oracle.sysman.eml.pref.NotifScheduleData"
              method="doView"/>
    </event>
    <event name="changeDate">
      <method class="oracle.sysman.eml.pref.NotifScheduleData"
              method="doChangeDate"/>
    </event>
    <event name="changeUser">
      <method class="oracle.sysman.eml.pref.NotifScheduleData"
              method="doChangeUser"/>
    </event>
  </handlers>

</page>

