<?xml version="1.0" encoding="utf-8" ?>
<jsp:root version="1.2" 
  xmlns:jsp="http://java.sun.com/JSP/Page"
   xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:ice="http://www.icesoft.com/icefaces/component">
<jsp:directive.page contentType="text/html;charset=utf-8" />
<f:view>
  <ice:outputDeclaration doctypeRoot="HTML" doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN" doctypeSystem="http://www.w3.org/TR/html4/loose.dtd"/>
  <html>
    <head>
     <title>Van Helsing</title>
     <ice:outputStyle href="./xmlhttp/css/rime/rime.css" />
     <ice:outputStyle href="./css/tree.css" />
     
    </head>
    <body>
    <ice:outputText style="color:grey; font-size:32px" value="Van Helsing"/>
    <ice:form>
    
	<ice:panelTabSet>
	        <ice:panelTab  label="Configuration">
			    <ice:panelGroup style="float:top">
			        <ice:commandButton id="newRes" 
			            value="create resource" 
			            actionListener="#{configurationBean.newResourceListener}"/>
					<ice:commandButton id="reloadRes"
						value="reload Tree"
						actionListener="#{configurationBean.reloadResourceButtonListener}" />
					<ice:commandButton id="saveRes"
				    	value="update resource"
				        actionListener="#{configurationBean.saveButtonListener}"/>
					<ice:commandButton id="deleteRes"
						value="delete resource"
						actionListener="#{configurationBean.deleteResourceButtonListener}" />
			 	</ice:panelGroup>
	        
	        	<ice:panelDivider style="height:600px;width:85%" dividerPosition="30">
	        	<f:facet name="first">
		    	<ice:tree id="baum"	
		    			value="#{configurationBean.tree}" 
		    			var="item"
		    			hideRootNode = "false"
		    			hideNavigation ="false"
		    			imageDir = "css/images/">
		    				
		    		<ice:treeNode id="knoten">
		    			<f:facet name="icon">
		    					<ice:panelGroup style="display: inline" >
			                    <ice:graphicImage
			                         value="/css/images/#{item.userObject.icon}"/>
              					</ice:panelGroup>
		    			</f:facet>
		    			<f:facet name="content">
		    			<ice:panelGroup  styleClass="selectedNode#{item.userObject.userObject.resId eq configurationBean.selectedId} selectedComponent#{item.userObject.selected}"
							style="display:inline" > 

						<ice:commandLink actionListener="#{configurationBean.userObjectItemNodeSelected}">
		    				<f:param name="userObject.resId" value="#{item.userObject.userObject.resId}"/>
		    			    <ice:outputText id="knoten" value="#{item.userObject.userObject.value}"/>
							</ice:commandLink>
		    			</ice:panelGroup> 
		    			</f:facet>
		    		</ice:treeNode>
		    	</ice:tree>
		    	</f:facet>
		    	<f:facet name="second">
			<ice:panelGrid cellpadding="0" cellspacing="3" 
				columns="2" rendered="#{configurationBean.selectedObject != null}">
				<ice:dataTable
				        var="item"
				         value="#{configurationBean.selectedObject}"
				         style="float:left,bottom; width:90%"
				         >
				        <ice:column>
				                <f:facet name="header">
				                         <ice:outputText value="Key" />
				                 </f:facet>
				                <ice:outputText style="color:red" rendered="#{item.required eq true}" value="#{item.key}" />
				                <ice:outputText style="color:green" rendered="#{item.required eq false}" value="#{item.key}" />
				        </ice:column>
				        <ice:column>
				                <f:facet name="header">
				                         <ice:outputText value="Value" />
				                </f:facet>
				                <ice:inputText required="#{item.required eq true}" rendered="#{item.inputText != null}" partialSubmit="true" value="#{item.keyValue}" />
								<ice:panelGroup>
									<ice:selectOneMenu id="KeyValue"
										rendered="#{item.selectOneMenu != null}"
	                        			valueChangeListener="#{configurationBean.userObjectItemOptionSelected}"
	                        			value="#{item.keyValue}"
	                        			partialSubmit="true">
	                    				<f:selectItems id="KeyValueItems"
	                                   		value="#{item.keyValueList}"/>
	                				</ice:selectOneMenu>
                					<ice:commandButton id="newRes" 
							            value="+" 
							            rendered="#{item.selectOneMenu != null}"
							            actionListener="#{configurationBean.newResourceButtonListener}"/>
                				</ice:panelGroup>				                
				        </ice:column>
				</ice:dataTable>
			</ice:panelGrid>
		    	</f:facet>
		    	</ice:panelDivider>
	        </ice:panelTab>
	 
	        <ice:panelTab label="Job / Schedule">
	        	<ice:commandButton id="createNode"
	        		value="create"
	        		actionListener="#{jobScheduleBean.createNodeListener}" />

	        	<ice:commandButton id="updateNode"
	        		value="update"
	        		actionListener="#{jobScheduleBean.updateNodeListener}" />

	        	<ice:commandButton id="deleteNode" 
	        		value="delete" actionListener="#{jobScheduleBean.deleteNodeListener}">
	   				<f:param name="userObject.resId" value="#{item.userObject.userObject.resId}"/>
	   				<f:param name="userObject.resName" value="#{item.userObject.userObject.resName}" />
				</ice:commandButton>	        		
	        	<ice:commandButton id="reloadTree"
	        		value="reloadTree"
	        		actionListener="#{jobScheduleBean.reloadTreeListener}" />
	        	
	        	<ice:panelDivider style="height:600px;width:85%" dividerPosition="30">
					<f:facet name="first">
			    	<ice:tree id="baum2"	
		    			value="#{jobScheduleBean.dataTree.tree}" 
		    			var="item"
		    			hideRootNode = "false"
		    			hideNavigation ="false"
		    			imageDir = "css/images/">
							<ice:treeNode id="knoten">
								<f:facet name="icon">
			    					<ice:panelGroup style="display: inline" >
				                    <ice:graphicImage
				                         value="/css/images/#{item.userObject.icon}"/>
	              					</ice:panelGroup>
								</f:facet>
								<f:facet name="content">
									<ice:commandLink actionListener="#{jobScheduleBean.selectNode}">
					    				<f:param name="userObject.resId" value="#{item.userObject.userObject.resId}"/>
					    				<f:param name="userObject.resName" value="#{item.userObject.userObject.resName}" />
					    			    <ice:outputText id="knoten" value="#{item.userObject.userObject.resName}" />
									</ice:commandLink>
								</f:facet>
							</ice:treeNode>
						</ice:tree>
					</f:facet>
					<f:facet name="second">
						
					</f:facet>
			</ice:panelDivider>	        	
	        </ice:panelTab>
	 
	        <ice:panelTab label="Topology">
	        </ice:panelTab>

			<ice:panelTab label="Dependencies">
			</ice:panelTab>
	</ice:panelTabSet>
	
    </ice:form>
    <ice:form>
		<ice:messages />
	</ice:form>
    </body>
  </html>
</f:view>
</jsp:root>