<%
  import javax.jcr.Node;
  import org.exoplatform.web.application.Parameter;

  def rcontext = _ctx.getRequestContext() ;

  Node locationNode = uicomponent.getNode();
%>

<div class="uiForm">
<%uiform.begin()%>

<%/* start render action*/%>
    <% if (uiform.isShowActionsOnTop()) {
              uiform.processRenderAction()
           }
    %>

    <%/* end render action*/%>

    <div class="form-horizontal">
      <div class="control-group">
          <label class="control-label"><%=_ctx.appRes("GoogleMap.dialog.label.name")%>:</label>
          <div class="controls">
            <%
              String[] locationFieldName = ["jcrPath=/node", "nodetype=exo:googleMap", "mixintype=mix:votable,mix:commentable,mix:i18n", "editable=if-null","validate=empty"];
              uicomponent.addTextField("name", locationFieldName);
            %>

          </div>
      </div>

      <div class="control-group">
        <label class="control-label"><%=_ctx.appRes("GoogleMap.dialog.label.Location")%>:</label>
        <div class="controls">
          <%
            String location = "";
            if (locationNode != null && locationNode.hasProperty("exo:location")) {
              location = locationNode.getProperty("exo:location").getValue().getString();
            }
            String[] fieldLocation = ["jcrPath=/node/exo:location", "editable=if-null", location] ;
            uicomponent.addTextField("exo:location", fieldLocation);
          %>
        </div>
      </div>
    </div>
  <% if (!uiform.isShowActionsOnTop()) {
           uiform.processRenderAction()
    }
  %>

  <%uiform.end()%>
</div>
