<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:f="http://java.sun.com/jsf/core" 
	xmlns:t="http://myfaces.apache.org/tomahawk" 
	xmlns:h="http://java.sun.com/jsf/html" version="2.0">
	
	<jsp:directive.page language="java"
		contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" />
	<jsp:text>
		<![CDATA[ <?xml version="1.0" encoding="UTF-8" ?> ]]>
	</jsp:text>
	<jsp:text>
		<![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ]]>
	</jsp:text>
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<jsp:include page='../includes/header.jsp'>
		<jsp:param name="title" value="add paper page" />
	</jsp:include>
	</head>
	<body>	
	<f:view>
		<jsp:include page='../includes/header_body.jsp' />
		<jsp:include page='../includes/topMenu.jsp' />
		<jsp:include page='../includes/leftMenu.jsp' />	
		<div id="CONTENT" class="content" >		
		<h:form id="addEditPaperForm" enctype="multipart/form-data">
			<h:panelGrid border="0" columns="3">
				<f:facet name="header">
					<h:outputText value="#{ empty visitBean.currentPaper.id ? resources['addEditPaper.form.label.add'] : resources['addEditPaper.form.label.edit'] }"></h:outputText>					
				</f:facet>
				<h:outputLabel value="#{resources['addEditPaper.field.label.authors']}" for="authors"/>
				<h:inputText id="authors" required="true" value="#{visitBean.currentPaper.authors}">
					<f:validateLength  maximum="255"/>
				</h:inputText>
				<h:message for="authors"></h:message>
				
				<h:outputLabel value="#{resources['addEditUser.field.label.title']}" for="title"/>
				<h:inputText id="title" required="true" value="#{visitBean.currentPaper.title}">
					<f:validateLength  maximum="255"/>
				</h:inputText>
				<h:message for="title"></h:message>
				
				<h:outputLabel value="#{resources['addEditPaper.field.label.acronym']}" for="acronym"/>
				<h:inputText id="acronym" required="true" value="#{visitBean.currentPaper.acronym}">
					<f:validateLength  maximum="255"/>
				</h:inputText>
				<h:message for="acronym"></h:message>
				
				<h:outputLabel value="#{resources['addEditPaper.field.label.abstract']}" for="abstract"/>
				<h:inputTextarea id="abstract" required="true" value="#{visitBean.currentPaper.abstract_}">					
				</h:inputTextarea>
				<h:message for="abstract"></h:message>
				
				<h:outputLabel for="file" value="#{resources['addEditPaper.field.label.file']}" rendered="#{empty visitBean.currentPaper.id}"/>
                <t:inputFileUpload id="file" value="#{addEditPaperBean.uploadedFile}"  required="true" rendered="#{empty visitBean.currentPaper.id}"/>
                <h:message for="file" rendered="#{empty visitBean.currentPaper.id}" />
										
				
				<h:panelGroup />
					<h:commandButton value="#{resources['addEditPaper.button.label.add']}" action="#{addEditPaperBean.addPaper}" rendered="#{empty visitBean.currentPaper.id}"/>
					<h:commandButton value="#{resources['addEditPaper.button.label.edit']}" action="#{addEditPaperBean.editPaper}" rendered="#{! empty visitBean.currentPaper.id}"/>
				<h:panelGroup />			
			</h:panelGrid>
		</h:form>	
		</div>
		<jsp:include page='../includes/footer2.jsp' />
	</f:view>
	</body>
	</html>
</jsp:root>