<!--
 *
 *      NAME
 *       patchDepotTable.uix
 *
 *      NOTES
 *       Table to manage patch depot entries
 *
 *
 *  @author  kChiasson
 *
-->

<dataScope  xmlns="http://bali.us.oracle.com/cabo/marlin"
            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">

     <provider>

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

        <data xmlns="http://bali.us.oracle.com/cabo/marlin" name="patchList">
           <method class="oracle.sysman.eml.ecm.patch.PatchDepotData" method="populateDepotTable"/>
        </data>

     </provider>
     <contents>


                  <tableLayout>
                  <contents>

                    <rowLayout hAlign="right" vAlign="bottom">
                    <contents>
                        <button value="NewFile" text="New Patch File" destination="/console/ecm/patch/patchDepotAdd"/>
                    </contents>
                    </rowLayout>

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


                    <rowLayout>
                    <contents>

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


                      <table name="depotTable" width="100%"
                            formSubmitted="true"
                            minValue="1"
                            uix:value="value@patchList"
                            uix:maxValue="maxValue@patchList"
                            uix:blockSize="blockSize@patchList"
                            alternateText="No Patches"
                            uix:tableData="tabledata@patchList">
                          <tableFormat tableBanding="rowBanding"/>
                          <columnHeaderStamp>
                            <sortableHeader uix:text="columnHeaderText"
                                            uix:value="value"
                                            uix:sortable="sort"/>
                          </columnHeaderStamp>

                          <columnHeaderData>
                                <column uix:sort="sortEntryDate@patchList" value="PATCH_DATE" uix:columnHeaderText="PD_COLHDR_ENTRYDATE@ResourceBundle"/>
                                <column uix:sort="sortName@patchList" value="NAME" uix:columnHeaderText="PD_COLHDR_NAME@ResourceBundle"/>
                                <column uix:sort="sortType@patchList" value="TYPE" uix:columnHeaderText="PD_COLHDR_TYPE@ResourceBundle"/>
                                <column uix:sort="sortPlatform@patchList" value="PLATFORM_ID" uix:columnHeaderText="PD_COLHDR_PLATFORM@ResourceBundle"/>
                                <column uix:sort="sortDesc@patchList" value="DESCRIPTION" uix:columnHeaderText="PD_COLHDR_DESC@ResourceBundle"/>
                          </columnHeaderData>

                          <tableSelection>
                          <singleSelection uix:selectedIndex = "selected@patchList">
                            <contents>
                              <submitButton name="event" value="applyPatch" text="Apply"/>
                              <spacer width="3"/>
                              <submitButton name="event" value="viewDetails" text="View Details"/>
                              <spacer width="3"/>
                              <submitButton name="event" value="deletePatch" text="Delete Depot Entry"/>
                            </contents>
                          </singleSelection>
                          </tableSelection>

                          <contents>
                           <styledText uix:text="patchEntryDate"/>
                           <link name="patchName" uix:text="patchId" uix:destination="destination"/>
                           <styledText uix:text="patchType"/>
                           <styledText uix:text="patchPlatform"/>
                           <styledText uix:text="patchDescription"/>
                         </contents>

                        </table>

                      </case>
                     </switcher>

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



