<%
  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"><label for="name"><%=_ctx.appRes("Kofax.dialog.label.name")%></label></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"><label for="categories"><%=_ctx.appRes("Kofax.dialog.label.categories")%></label></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"><label for="content-lang"><%=_ctx.appRes("ElementSet.dialog.label.language")%></label></td>
				<td class="FieldComponent">
				<%
				  String lang = org.exoplatform.portal.webui.util.Util.getPortalRequestContext().getLocale().toString();
				  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)) {
	          String compid = "component_" + i;
	        %>
	        <tr>		 
	        	<td class="FieldLabel"><label for="$compid"><%=propertyName.substring(namespace.length(), propertyName.length())%></label></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>