<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:head xmlns="http://www.w3.org/TR/REC-html40">
    <html:meta http-equiv="Cache-Control" content="max-age=0"/>
  </baja:head>
  <baja:head xmlns="http://bali.us.oracle.com/cabo/marlin"
	     xmlns:uix="http://bali.us.oracle.com/cabo/marlin"
	     xmlns:html="http://www.w3.org/TR/REC-html40">
    <dataScope>
      <contents>
        <html:title>
          <text data:text="title@mpData"/>
        </html:title>
      </contents>
      
      <provider>
	<data name="mpData">
	  <method class="oracle.sysman.emx.ui.ImportController"
		  method="getImportData"/>
	</data>
	<data name="mpBundle">
	  <bundle class="oracle.sysman.emx.ui.MPMsg"/>
	</data>
      </provider>
    </dataScope>
  </baja:head>

  <baja:content xmlns="http://bali.us.oracle.com/cabo/marlin">
    <dataScope>
      <contents>
	<pageLayout data:title="IMPORT_TITLE@mpBundle">
	  <mediumAdvertisement>
	    <include baja:node="../oemBanner" />
	  </mediumAdvertisement>
	  <marlin:globalButtons>
	    <include baja:node="../globalButtonBar" />
	  </marlin: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>
	    <include baja:node="../copyright" />
	  </copyright>

	  <pageStatus>
	    <flowLayout>
	      <contents>
		<styledText styleClass="OraInstructionText"
			    data:text="IMPORT_SUMMARY@mpBundle"/>
	      </contents>
	    </flowLayout>
	  </pageStatus>

	  <pageButtons>
	    <pageButtonBar>
	      <contents>
                <submitButton data:text="CANCEL@mpBundle"
                              data:shortDesc="CANCEL@mpBundle"
                              name="event"
                              value="cancel"
                              formName="importForm"/>
		<submitButton data:text="OK@mpBundle"
			      name="event"
			      value="import"
			      formName="importForm"
                              data:shortDesc="IMPORT_TITLE@mpBundle"/>
	      </contents>
	    </pageButtonBar>
	  </pageButtons>

	  <contents>
	    <stackLayout>
	      <contents>
		<header data:text="IMPORT_SELECT_HEADER@mpBundle" size="1">
		  <contents>
                    <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="uploadForm" usesUpload="true" method="POST" destination="?event=list">
		      <contents>
			<labeledFieldLayout labelWidth="20%"
					    fieldWidth="80%"
					    width="100%">
			  <contents>
			    <styledText styleClass="OraInstructionText"
					data:text="MANAGEMENT_PLUGIN_ARCHIVE@mpBundle"/>
			    <fileUpload name="filename" columns="30" required="yes"/>
			    <spacer height="1"/>
			    <submitButton data:text="LIST_ARCHIVE@mpBundle"
					  name="event"
					  value="list"
					  formName="uploadForm"
                                          data:shortDesc="LIST_MPA@mpBundle"/>
			  </contents>
			</labeledFieldLayout>
                        <tip>
                         <contents>
                          <text data:text="IMPORT_WARNING@mpBundle"/>
                         </contents>
                        </tip>
		      </contents>
		    </form>
		  </contents>
		</header>
		<spacer height="10"/>
		<form name="importForm" usesUpload="false"
	              method="POST">
		  <contents>
		    <header data:text="listHeader@mpData" size="1">
		      <contents>
			<switcher data:childName="uploaded@mpData">
			  <case name="false">
			    <switcher data:childName="node@mpData">
			      <case name="errNode">
				<messageBox data:message="errMsg@mpData"
					    messageType="error"
					    longDescURL="unimpl"
					    data:text="ERR_OCCUR@mpBundle">
				</messageBox>
			      </case>
			      <case name="okNode">
				<table partialRenderMode="self"
				       data:summary="IMPORT_TABLE_SUMMARY@mpBundle"
				       id="importTable"
				       data:alternateText="NO_TARGETS_FOUND@mpBundle"
				       formSubmitted="true"
				       width="100%"
				       data:tableData="row@mpData">
				  <tableFormat tableBanding="rowBanding"/>
				  <tableSelection>
				    <multipleSelection>
				    </multipleSelection>
				  </tableSelection>
				  <contents>
				    <text data:text="mpType"/>
				  </contents>
				</table>
			      </case>
			    </switcher>
			  </case>
			  <case name="true">
			    <table partialRenderMode="self"
				   id="importTable" 
				   data:alternateText="NO_TARGETS_FOUND@mpBundle"
				   width="100%"
				   formSubmitted="true"
				   data:tableData="row@mpData">

			      <tableFormat tableBanding="rowBanding"/>

			      <tableSelection>
				<multipleSelection data:selection="row@mpData"
						   data:selected="selected"
						   data:disabled="disabled">
				</multipleSelection>
			      </tableSelection>
			      <contents>
				<column>
				  <columnHeader>
				    <text data:text="NAME@mpBundle"/>
				  </columnHeader>
				  <contents>
				    <styledText data:text="mpType"/>
				  </contents>
				</column>
				<column>
				  <columnHeader>
				    <text data:text="VERSION@mpBundle"/>
				  </columnHeader>
				  <contents>
				    <styledText data:text="mpVersion"/>
				  </contents>
				</column>
				<column>
				  <columnHeader>
				    <text data:text="OMS_VERSION@mpBundle"/>
				  </columnHeader>
				  <contents>
				    <styledText data:text="mpOmsVersion"/>
				  </contents>
				</column>
				<column>
				  <columnHeader>
				    <text data:text="DESCRIPTION@mpBundle"/>
				  </columnHeader>
				  <contents>
				    <styledText data:text="description"/>
				  </contents>
				</column>
				<column>
				  <columnHeader>
				    <text data:text="DEPLOY_REQS@mpBundle"/>
				  </columnHeader>
				  <contents>
				    <styledText data:text="deploymentRequirements"/>
				  </contents>
				</column>
			      </contents>
			    </table>
			  </case>
			</switcher>
		      </contents>
		    </header>
		    <spacer height="10"/>
		    <header data:text="groupHeader@mpData" size="1">
		      <contents>
			<switcher data:childName="uploaded@mpData">
			  <case name="false">
			    <switcher data:childName="node@mpData">
			      <case name="errNode">
				<messageBox data:message="errMsg@mpData"
					    messageType="error"
					    longDescURL="unimpl"
					    data:text="ERR_OCCUR@mpBundle">
				</messageBox>
			      </case>
			      <case name="okNode">
				<table partialRenderMode="self"
				       data:summary="IMPORT_TABLE_SUMMARY@mpBundle"
				       id="groupsTable"
				       data:alternateText="NO_GROUPS_FOUND@mpBundle"
				       formSubmitted="true"
				       width="100%"
				       data:tableData="groups@mpData">
				  <tableFormat tableBanding="rowBanding"/>
				  <tableSelection>
				    <multipleSelection>
				    </multipleSelection>
				  </tableSelection>
				  <contents>
				    <text data:text="mpType"/>
				  </contents>
				</table>
			      </case>
			    </switcher>
			  </case>
			  <case name="true">
			    <table partialRenderMode="self"
				   id="groupsTable" 
				   data:alternateText="NO_GROUPS_FOUND@mpBundle"
				   width="100%"
				   formSubmitted="true"
				   data:tableData="groups@mpData">

			      <tableFormat tableBanding="rowBanding"/>

			      <tableSelection>
				<multipleSelection data:selection="groups@mpData"
						   data:selected="selected"
						   data:disabled="disabled">
				</multipleSelection>
			      </tableSelection>
			      <contents>
				<column>
				  <columnHeader>
				    <text data:text="NAME@mpBundle"/>
				  </columnHeader>
				  <contents>
				    <styledText data:text="mpType" data:shortDesc="groupMembers"/>
				  </contents>
				</column>
				<column>
				  <columnHeader>
				    <text data:text="DESCRIPTION@mpBundle"/>
				  </columnHeader>
				  <contents>
				    <styledText data:text="description"/>
				  </contents>
				</column>
			      </contents>
			    </table>
			  </case>
			</switcher>
		      </contents>
		    </header>
		  </contents>
		</form>
	      </contents>
	    </stackLayout>
	  </contents>
	</pageLayout>
      </contents>
      <provider>
	<data name="mpData">
	  <method class="oracle.sysman.emx.ui.ImportController"
		  method="getImportData"/>
	</data>
	<data name="mpBundle">
	  <bundle class="oracle.sysman.emx.ui.MPMsg"/>
	</data>
      </provider>

    </dataScope>
  </baja:content>

  <handlers>
    <event name="list">
      <method class="oracle.sysman.emx.ui.ImportController" method="startUpload"/>
    </event>
    <event name="import">
      <method class="oracle.sysman.emx.ui.ImportController" method="startImport"/>
    </event>
    <event name="cancel">
      <method class="oracle.sysman.emx.ui.ImportController" method="cancelImport"/>
    </event>
  </handlers>

</page>
