<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>
          <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="notifRule" 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"
                                       data:shortDesc="REVERT@commonResourceBundle" />
                          <submitButton data:text="APPLY@commonResourceBundle" 
                                        data:shortDesc="APPLY@commonResourceBundle" 
                                        name="event" 
                                        value="Apply" />
                        </contents>
                      </flowLayout>
                    </contents>
                  </pageButtonBar>
                </contentFooter>

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

                <contents>
                  <stackLayout>
                    <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>

                      <header data:text="notifRulesHeader@notifRulesData" width="100%"/> 

                      <tableLayout width="100%">
                        <contents>
                          <rowLayout>
                            <contents>
                              <cellFormat vAlign="top">
                                <contents>
                                  <styledText data:text="NOTIF_RULES_HDR_MSG@notifResourceBundle"
                                              styleClass="OraInstructionText"/>
                                </contents>
                              </cellFormat>
                              <spacer width="5"/>
                              <cellFormat vAlign="center" hAlign="right">
                                <contents>
                                  <resetButton data:text="REVERT@commonResourceBundle" 
                                                data:shortDesc="REVERT@commonResourceBundle" />
                                  <spacer width="5"/>
                                  <submitButton data:text="APPLY@commonResourceBundle" 
                                                data:shortDesc="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>
                               <switcher data:childName="privilegedUser@notifRulesData">
                                 <case name="true">
                                   <table name="notifRuleTable" 
                                          data:alternateText="NO_NOTIF_RULES_DEFINED_MSG@notifResourceBundle"
                                          data:summary="NOTIF_RULES_HDR@notifResourceBundle"
                                          width="100%" 
                                          formSubmitted="true" 
                                          showAll="yes"
                                          id="notifRuleTable"
                                          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> 
                                     <tableSelection>
                                       <singleSelection selectedIndex="0" data:shortDesc="SELECT@commonResourceBundle" data:id="notifRuleName" >
                                         <contents>
                                           <submitButton data:text="CREATE_LIKE@commonResourceBundle" 
                                                         data:shortDesc="CREATE_LIKE@commonResourceBundle" 
                                                         name="event"
                                                         value="CreateLike" />   
                                           <spacer width="5"/>
                                           <submitButton data:text="VIEW@commonResourceBundle" 
                                                         data:shortDesc="VIEW@commonResourceBundle" 
                                                         name="event"
                                                         value="View" />   
                                           <spacer width="5"/>
                                           <submitButton data:text="EDIT@commonResourceBundle" 
                                                         data:shortDesc="EDIT@commonResourceBundle" 
                                                         name="event"
                                                         value="Edit" />   
                                           <spacer width="5"/>
                                           <submitButton data:text="DELETE@commonResourceBundle" 
                                                         data:shortDesc="DELETE@commonResourceBundle" 
                                                         name="event"
                                                         value="Remove" />
                                         </contents>
                                       </singleSelection>
                                     </tableSelection>
                                     <tableActions>
                                       <rowLayout >
                                         <contents>
                                           <submitButton data:text="CREATE@commonResourceBundle" 
                                                         data:shortDesc="CREATE@commonResourceBundle" 
                                                name="event"
                                                value="CreateNew" />
                                           <spacer width="5"/>
                                           <submitButton data:text="ASSIGN_DEVICES_TO_RULES@notifResourceBundle" 
                                                         data:shortDesc="ASSIGN_DEVICES_TO_RULES@notifResourceBundle" 
                                                name="event" 
                                                value="Assign" />
                                         </contents>
                                       </rowLayout >
                                     </tableActions>
                                     <columnFormats>
                                       <columnFormat width="20%" columnDataFormat="textFormat"/>
                                       <columnFormat width="15%" columnDataFormat="textFormat"/>
                                       <columnFormat width="50%" columnDataFormat="textFormat"/>
                                       <columnFormat width="7%" columnDataFormat="iconButtonFormat"/>
                                       <columnFormat width="8%" 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="makePublicCheckbox"
                                                 data:shortDesc="RULE_PUBLIC@notifResourceBundle"
                                                 data:disabled="publicDisabled"
                                                 value="true"
                                                 data:checked="publicChecked"/>  
                                       <checkBox name="emailCheckbox"
                                                 data:shortDesc="RULE_PUBLIC@notifResourceBundle"
                                                 data:disabled="noEmailAddr"
                                                 value="true"
                                                 data:checked="sendEmail"/>  
                                       <formValue name="notifRuleName" data:value="notifRuleName" />  
                                       <formValue name="notifRuleOwner" data:value="notifRuleOwner" />  
                                     </contents>
                                   </table>
                                 </case>
                                 <case name="false">
                                   <table name="notifRuleTable" 
                                          data:alternateText="NO_NOTIF_RULES_DEFINED_MSG@notifResourceBundle"
                                          data:summary="MY_NOTIF_RULES_HDR@notifResourceBundle"
                                          id="notifRuleTable"
                                          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> 
                                     <tableSelection>
                                       <singleSelection selectedIndex="0" data:shortDesc="SELECT@commonResourceBundle" data:id="notifRuleName">
                                         <contents>
                                           <submitButton data:text="CREATE_LIKE@commonResourceBundle" 
                                                         data:shortDesc="CREATE_LIKE@commonResourceBundle" 
                                                         name="event"
                                                         value="CreateLike" />   
                                           <spacer width="5"/>
                                           <submitButton data:text="VIEW@commonResourceBundle" 
                                                         data:shortDesc="VIEW@commonResourceBundle" 
                                                         name="event"
                                                         value="View" />   
                                           <spacer width="5"/>
                                           <submitButton data:text="EDIT@commonResourceBundle" 
                                                         data:shortDesc="EDIT@commonResourceBundle" 
                                                         name="event"
                                                         value="Edit" />   
                                           <spacer width="5"/>
                                           <submitButton data:text="DELETE@commonResourceBundle" 
                                                         data:shortDesc="DELETE@commonResourceBundle" 
                                                         name="event"
                                                         value="Remove" />
                                         </contents>
                                       </singleSelection>
                                     </tableSelection>
                                     <tableActions>
                                       <rowLayout >
                                         <contents>
                                           <submitButton data:text="CREATE@commonResourceBundle"
                                                         data:shortDesc="CREATE@commonResourceBundle" 
                                                name="event"
                                                value="CreateNew" />
                                           <spacer width="5"/>
                                           <submitButton data:text="ASSIGN_DEVICES_TO_RULES@notifResourceBundle"
                                                         data:shortDesc="ASSIGN_DEVICES_TO_RULES@notifResourceBundle" 
                                                name="event"
                                                value="Assign" />
                                         </contents>
                                       </rowLayout >
                                     </tableActions>

                                     <columnFormats>
                                       <columnFormat width="20%" columnDataFormat="textFormat"/>
                                       <columnFormat width="60%" columnDataFormat="textFormat"/>
                                       <columnFormat width="8%" columnDataFormat="iconButtonFormat"/>
                                       <columnFormat width="12%" columnDataFormat="iconButtonFormat"/>
                                     </columnFormats>
                                     <contents>
                                       <link data:text="notifRuleName"
                                             data:shortDesc="RULE_NAME@notifResourceBundle" 
                                             data:destination="notifRuleNameDest"/>
                                       <rowLayout>
                                         <contents>
                                           <cellFormat wrappingDisabled="false">
                                             <contents>
                                               <styledText data:text="notifRuleDesc"
                                                           data:shortDesc="RULE_DESCRIPTION@notifResourceBundle" 
                                                           styleClass="OraInstructionText"/>
                                             </contents>
                                           </cellFormat>
                                         </contents>
                                       </rowLayout>
                                       <checkBox name="makePublicCheckbox"
                                                 data:shortDesc="RULE_PUBLIC@notifResourceBundle"
                                                 data:disabled="publicDisabled"
                                                 value="true"
                                                 data:checked="publicChecked"/>  
                                       <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>
                                 </case>
                               </switcher>
                             </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="getMyNotifRules" />
          </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="View">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="viewNotifRule"/>
      </event> 
      <event name="CreateNew">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="createNewNotifRule"/>
      </event> 
      <event name="CreateLike">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="createLikeNotifRule"/>
      </event> 
      <event name="Edit">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="editNotifRule"/>
      </event> 
      <event name="Remove">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="confirmDelete"/>
      </event> 
      <event name="Apply">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="updateNotifRulesOverviewData"/>
      </event>  
      <event name="Assign">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="assignDevices"/>
      </event> 
      <event name="goto">
        <method class="oracle.sysman.eml.pref.NotifRuleEvents" 
                method="doGotoForTable"/>
      </event>
    </baja:handlers>
</page>
