<%
/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
%>

<%
DLFolder curFolder = null;
DLFileEntry fileEntry = null;
DLFileShortcut fileShortcut = null;

if (result instanceof AssetEntry) {
	AssetEntry assetEntry = (AssetEntry)result;

	if (assetEntry.getClassName().equals(DLFileEntry.class.getName())) {
		fileEntry = DLFileEntryLocalServiceUtil.getFileEntry(assetEntry.getClassPK());

		fileEntry = fileEntry.toEscapedModel();
	}
	else {
		fileShortcut = DLFileShortcutLocalServiceUtil.getFileShortcut(assetEntry.getClassPK());

		fileShortcut = fileShortcut.toEscapedModel();

		fileEntry = DLFileEntryLocalServiceUtil.getFileEntry(fileShortcut.getGroupId(), fileShortcut.getToFolderId(), HtmlUtil.unescape(fileShortcut.getToName()));

		fileEntry = fileEntry.toEscapedModel();
	}
}
else if (result instanceof DLFolder) {
	curFolder = (DLFolder)result;

	curFolder = curFolder.toEscapedModel();
}
else if (result instanceof DLFileEntry) {
	fileEntry = (DLFileEntry)result;

	fileEntry = fileEntry.toEscapedModel();
}
else {
	fileShortcut = (DLFileShortcut)result;

	fileShortcut = fileShortcut.toEscapedModel();

	fileEntry = DLFileEntryLocalServiceUtil.getFileEntry(fileShortcut.getGroupId(), fileShortcut.getToFolderId(), HtmlUtil.unescape(fileShortcut.getToName()));

	fileEntry = fileEntry.toEscapedModel();
}
%>