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

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

          <html:title>
            <text data:text="title@notifRulesData" />
          </html:title>

          <form name="publicNotifRule" method="POST" > 
            <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>
                      <flowLayout>
                        <contents>
                          <resetButton data:text="REVERT@commonResourceBundle" />
                          <submitButton data:text="APPLY@commonResourceBundle"
                                        name="event"
                                        value="Apply" />
                        </contents>
                      </flowLayout>
                    </contents>
                  </pageButtonBar>
                </contentFooter>

                <copyright>
                 <include baja:node="../copyright" />
                </copyright>

                <contents>

                  <tableLayout width="100%">
                    <contents>
                      <switcher data:childName="updateSucceeded@notifRulesData">
                        <case name="true">
                          <rowLayout vAlign="top">
                            <contents>
                              <cellFormat vAlign="top">
                                <contents>
                                  <messageBox messageType="info"
                                              longDescURL="unimpl"
                                              data:message="updateSucceededMessage@notifRulesData"
                                              data:text="updateMessage@notifRulesData">
                                  </messageBox>
                                </contents>
                              </cellFormat>
                            </contents>
                          </rowLayout>
                        </case>
                        <case name="false">
                          <rowLayout vAlign="top">
                            <contents>
                              <cellFormat vAlign="top">
                                <contents>
                                  <messageBox messageType="error"
                                              longDescURL="unimpl"
                                              data:message="updateFailedMessage@notifRulesData"
                                              data:text="updateMessage@notifRulesData">
                                  </messageBox>
                                </contents>
                              </cellFormat>
                            </contents>
                          </rowLayout>
                        </case>
                      </switcher>
                    </contents>
                  </tableLayout>

                  <stackLayout>
                    <contents>
                      <header data:text="PUBLIC_NOTIF_RULES_HDR@notifResourceBundle" width="100%"/> 

                      <tableLayout width="100%">
                        <contents>                      
                          <rowLayout >
                            <contents>

                              <cellFormat vAlign="top">
                                <contents>
                                  <styledText data:text="PUBLIC_NOTIF_RULES_HDR_MSG@notifResourceBundle"
                                              styleClass="OraInstructionText"/>
                                </contents>
                              </cellFormat>
                              <spacer width="5"/>
                              <cellFormat vAlign="center" hAlign="right">
                                <contents>

                                  <resetButton data:text="REVERT@commonResourceBundle" />
                                  <spacer width="5"/>
                                  <submitButton data:text="APPLY@commonResourceBundle"
                                                name="event"
                                                value="Apply" />
                                </contents>
                              </cellFormat>                                                
                            </contents>
                          </rowLayout>
                        </contents>
                      </tableLayout>
    
                      <spacer height="5"/>

                      <switcher data:childName="node@notifRulesData">
                       <case name="okNode">
                        <stackLayout>
                         <contents>

                           <borderLayout>
                             <contents>
                               <table name="notifRuleTable" 
                                      data:alternateText="NO_PUBLIC_NOTIF_RULES_DEFINED_MSG@notifResourceBundle"
                                      data:summary="PUBLIC_NOTIF_RULES_HDR@notifResourceBundle"
                                      width="100%" 
                                      formSubmitted="true" 
                                      showAll="yes" 
                                      data:tableData="row@notifRulesData" 
                                      data:columnHeaderData="column@notifRulesData" 
                                      data:value="value@notifRulesData"
                                      data:minValue="minValue@notifRulesData"
                                      data:blockSize="blockSize@notifRulesData"
                                      data:maxValue="maxValue@notifRulesData"
                                      data:destination="tableDestination@notifRulesData" >
                                 <tableFormat tableBanding="rowBanding"/>
                                 <columnHeaderStamp>
                                   <sortableHeader data:text="text" 
                                                   data:sortable="sortable" />  
                                 </columnHeaderStamp> 
                                 <columnFormats>
                                   <columnFormat width="23%" columnDataFormat="textFormat"/>
                                   <columnFormat width="10%" columnDataFormat="textFormat"/>
                                   <columnFormat width="55%" columnDataFormat="textFormat"/>
                                   <columnFormat width="12%" columnDataFormat="iconButtonFormat"/>
                                 </columnFormats>
                                 <contents>
                                   <link data:text="notifRuleName"
                                         data:shortDesc="RULE_NAME@notifResourceBundle"
                                         data:destination="notifRuleNameDest"/>
                                   <styledText data:text="notifRuleOwner"
                                               data:shortDesc="RULE_OWNER@notifResourceBundle" />
                                   <rowLayout>
                                     <contents>
                                       <cellFormat wrappingDisabled="false">
                                         <contents>
                                           <styledText data:text="notifRuleDesc"
                                                       data:shortDesc="RULE_DESCRIPTION@notifResourceBundle" 
                                                       styleClass="OraInstructionText"/>
                                         </contents>
                                       </cellFormat>
                                     </contents>
                                   </rowLayout>
                                   <checkBox name="emailCheckbox"
                                             data:shortDesc="SEND_EMAIL@notifResourceBundle"
                                             data:disabled="noEmailAddr"
                                             value="true"
                                             data:checked="sendEmail"/>
                                   <formValue name="notifRuleName" data:value="notifRuleName" />  
                                   <formValue name="notifRuleOwner" data:value="notifRuleOwner" />  
                                 </contents>
                               </table>
                             </contents>
                           </borderLayout>

                         </contents>
                        </stackLayout>
                       </case>
                       <case name="errNode">
                        <messageBox data:message="errMsg@notifRulesData"
                                    messageType="error"
                                    longDescURL="unimpl"
                                    data:text="ERROR_OCCURRED_MSG@notifResourceBundle">
                        </messageBox>
                       </case>
                      </switcher>
    
                    </contents>
                  </stackLayout>
                </contents>
              </pageLayout>

            </contents>
          </form>  

        </contents>
       
        <provider>           
          <data name="commonResourceBundle">
            <bundle class="oracle.sysman.resources.CommonResourceBundle"/>
          </data>
          <data name="notifResourceBundle">
            <bundle class="oracle.sysman.resources.NotifMsg"/>
          </data>
          <data name="notifRulesData">
            <method class="oracle.sysman.eml.pref.NotifRulesPref"
                    method="getPublicNotifRules" />
          </data>           
        </provider>
      </dataScope>
    </baja:content>
    <baja:handlers>
      <event name="*">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="doLoad"/>
      </event>
      <event name="sort">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="doSort"/>
      </event>
      <event name="goto">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="doGotoForTable"/>
      </event>
      <event name="Apply">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="updateNotifRulesOverviewData"/>
      </event>
    </baja:handlers>
</page>
