<%
  def node = uicomponent.getCurrentNode() ;
  String namespace = "kfx:" ;
%>
<div class="UIForm FormLayout FormScrollLayout">  
	<% uiform.begin() %>
	<%/* start render action*/%>
  <% if (uiform.isShowActionsOnTop()) {
            uiform.processRenderAction()
         }
  %>
	<%/* end render action*/%>
  <div class="HorizontalLayout">
		<table class="UIFormGrid">			
			<tr>
			  <td class="FieldLabel"><%=_ctx.appRes("Kofax.dialog.label.name")%></td>
			  <td class="FieldComponent">
	      <%
	        String[] fieldName = ["jcrPath=/node", "mixintype=mix:votable,mix:commentable,mix:i18n", "editable=if-null", "validate=empty,name"] ;
	        uicomponent.addTextField("name", fieldName) ; 
	      %>			  
			  </td>
			</tr>
			<%if(!uicomponent.getId().equals("UILanguageDialogForm")){%>		
				<tr>
		      <td class="FieldLabel"><%=_ctx.appRes("Kofax.dialog.label.categories")%></td>
		      <td class="FieldComponent">
			      <% 
			        String[] fieldCategories = ["jcrPath=/node/exo:category", "multiValues=true", "reference=true", "editable=false"];
			        uicomponent.addTextField("categories", fieldCategories);
			      %>
			    </td>
			  </tr>
		  <%}%>
			<tr>
        		<td class="FieldLabel"><%=_ctx.appRes("ElementSet.dialog.label.language")%></td>
				<td class="FieldComponent">
				<%
				  String lang = org.exoplatform.portal.webui.util.Util.getPortalRequestContext().getLocale().getLanguage();
				  String[] fieldLang = ["jcrPath=/node/exo:language", "script=ecm-explorer/widget/FillSelectBoxWithLanguage.groovy", lang] ;
				  uicomponent.addSelectBoxField("content-lang", fieldLang) ;
				%>
				</td>
			</tr>
	    <%
	      int i = 1;
	      for(property in node.getProperties()) {
	        def propertyName = property.getName() ;
	        if(propertyName.startsWith(namespace)) { %>
	        <tr>		 
	        	<td class="FieldLabel"><%=propertyName.substring(namespace.length(), propertyName.length())%></td>         					
	        	<td class="FieldComponent">
			      <%
			        String[] param = ["jcrPath=/node/" + propertyName] ;
			        uicomponent.addTextField("component_" + i, param) ; 
			      %>
			      </td>
	        </tr>
	    <%
	        }
	        i++ ;
	      }
	    %>
		</table>	    
  </div>
  <% if (!uiform.isShowActionsOnTop()) {
            uiform.processRenderAction()
         }
  %>
  <%uiform.end()%>
</div>