<!--
 *
 *      NAME
 *       patchRulesTable.uix
 *
 *      NOTES
 *       Rules Table displaying list of Advisory Rules for update or delete
 *
 *
 *  @author  kChiasson
 *
-->

<page xmlns="http://bali.us.oracle.com/cabo/baja"
      xmlns:baja="http://bali.us.oracle.com/cabo/baja"
      xmlns:uix="http://bali.us.oracle.com/cabo/marlin"
      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:head xmlns="http://www.w3.org/TR/REC-html40">
    <title>Oracle Enterprise Manager - Patch Advisory Rules</title>
  </baja:head>

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

        <pageLayout xmlns="http://bali.us.oracle.com/cabo/marlin" >
          <mediumAdvertisement>
            <include baja:node="../../oemBanner" />
          </mediumAdvertisement>
          <globalButtons>
            <include baja:node="../../globalButtonBar" />
          </globalButtons>
          <marlin:tabs>
            <include baja:node="../../globalTabs" />
          </marlin:tabs>

          <marlin:pageHeader>
            <include baja:node="../../globalHeader" />
          </marlin:pageHeader>

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

          <copyright>Copyright 2001, Oracle Corp.</copyright>


<!-- *************  End Standard Header ************* -->

          <contents>
          <messageBox automatic="true" />

            <form name="patchRulesTable" >
              <contents>


                  <stackLayout>
                  <contents>

                    <spacer height="5"/>
                    <header text="Patch Advisory Rules"/>
                    <spacer height="1"/>

                  <tableLayout>
                  <contents>

                    <rowLayout hAlign="right" vAlign="bottom">
                    <contents>
                        <submitButton name="event" value="createRule" text="Create New Rule"/>
                    </contents>
                    </rowLayout>
                    <rowLayout>
                    <contents>
                    <spacer height="5"/>
                    </contents>
                    </rowLayout>


                    <rowLayout>
                    <contents>

                     <switcher marlin:childName="status@rulesList">
                      <case name="failure">
                        <messageBox automatic="false"
                                    message="Unable to retrieve rules.  Check log file for error details."
                                    messageType="error" />
                      </case>
                      <case name="success">




                      <table name="rulesTable" width="100%"
                            formSubmitted="true"
                            minValue="1"
                            uix:value="value@rulesList"
                            uix:maxValue="maxValue@rulesList"
                            uix:blockSize="blockSize@rulesList"
                            alternateText="No Rules Defined"
                            uix:tableData="tabledata@rulesList">
                          <tableFormat tableBanding="rowBanding"/>
                          <columnHeaderStamp>
                            <sortableHeader uix:text="columnHeaderText"
                                            sortable="no"
                                            uix:value="value"
                                            uix:sortable="sort"/>
                          </columnHeaderStamp>
                          <columnHeaderData>
                                <column uix:sort="sortName@rulesList" value="RULE_NAME" uix:columnHeaderText="PR_COLHDR_NAME@ResourceBundle"/>
                                <column uix:sort="sortDesc@rulesList" value="DESCRIPTION" uix:columnHeaderText="PR_COLHDR_DESC@ResourceBundle"/>
                                <column uix:sort="sortCreator@rulesList" value="CREATOR" uix:columnHeaderText="PR_COLHDR_CREATOR@ResourceBundle"/>
                                <column uix:sort="sortLastMod@rulesList" value="LAST_MODIFIED" uix:columnHeaderText="PR_COLHDR_LASTMOD@ResourceBundle"/>
                                <column uix:columnHeaderText="PR_COLHDR_ADMINS@ResourceBundle"/>
                          </columnHeaderData>

                          <tableSelection>
                          <singleSelection uix:selectedIndex = "selected@rulesList">
                            <contents>
                              <submitButton name="event" value="editRule" text="Modify"/>
                              <spacer width="3"/>
                              <submitButton name="event" value="deleteRule" text="Delete"/>
                            </contents>
                          </singleSelection>
                          </tableSelection>

                          <contents>
                           <link name="ruleName" uix:text="ruleName" uix:destination="destination"/>
                           <styledText uix:text="ruleDesc"/>
                           <styledText uix:text="ruleCreator"/>
                           <styledText uix:text="ruleLastMod"/>
                           <styledText uix:text="ruleAdmins"/>
                         </contents>

                        </table>

                      </case>
                     </switcher>

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

            </contents>
            </form>
            <spacer height="20"/>

          </contents>
        </pageLayout>
      </contents>

      <provider>
        <data name="ResourceBundle">
           <bundle class = "oracle.sysman.eml.ecm.patch.util.PatchResourceBundle"/>
        </data>

        <data xmlns="http://bali.us.oracle.com/cabo/marlin" name="rulesList">
           <method class="oracle.sysman.eml.ecm.patch.PatchRulesData" method="populateRulesTable"/>
        </data>

     </provider>

    </dataScope>

  </baja:content>


    <handlers>

      <event name="sort">
        <method class="oracle.sysman.eml.ecm.patch.PatchRulesHandler"
          method="doSort"/>
      </event>

      <event name="createRule">
        <method class="oracle.sysman.eml.ecm.patch.PatchRulesHandler"
          method="createRule"/>
      </event>

      <event name="deleteRule">
        <method class="oracle.sysman.eml.ecm.patch.PatchRulesHandler"
          method="deleteRuleConfirm"/>
      </event>

      <event name="editRule">
        <method class="oracle.sysman.eml.ecm.patch.PatchRulesHandler"
          method="editRule"/>
      </event>

    <!-- This handles the next/prev buttons in the admin table -->
      <event name="goto">
        <method class="oracle.sysman.eml.ecm.patch.PatchRulesHandler"
          method ="tableGoto"/>
      </event>


    </handlers>


</page>
