<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<%@ include file="/document_library/init.jsp" %>

<%
Portlet portlet = PortletLocalServiceUtil.getPortletById(portletDisplay.getId());

String refererWebDAVToken = WebDAVUtil.getStorageToken(portlet);

DLEditDDMStructureDisplayContext dlEditDDMStructureDisplayContext = new DLEditDDMStructureDisplayContext(request, liferayPortletResponse);

com.liferay.dynamic.data.mapping.model.DDMStructure ddmStructure = dlEditDDMStructureDisplayContext.getDDMStructure();
%>

<aui:model-context bean="<%= ddmStructure %>" model="<%= com.liferay.dynamic.data.mapping.model.DDMStructure.class %>" />

<clay:row
	cssClass="lfr-ddm-types-form-column"
>
	<aui:input name="storageType" type="hidden" value="<%= StorageType.DEFAULT.getValue() %>" />
</clay:row>

<aui:input name="description" />

<c:if test="<%= ddmStructure != null %>">
	<portlet:resourceURL id="/dynamic_data_mapping/get_structure" var="getStructureURL">
		<portlet:param name="structureId" value="<%= String.valueOf(ddmStructure.getStructureId()) %>" />
	</portlet:resourceURL>

	<aui:input name="url" type="resource" value="<%= getStructureURL.toString() %>" />

	<c:if test="<%= Validator.isNotNull(refererWebDAVToken) %>">
		<aui:input name="webDavURL" type="resource" value="<%= ddmStructure.getWebDavURL(themeDisplay, refererWebDAVToken) %>" />
	</c:if>
</c:if>