create.jsp
来自「jboss服务器! java开发员必备! 一般与sqlserver数据库组合」· JSP 代码 · 共 130 行
JSP
130 行
<%@ page import="org.jboss.portal.core.portlet.cms.admin.AdminCMSConstants,
java.util.Vector,
org.jboss.portal.core.portlet.cms.WebDAVUtil"%>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored ="false" %>
<portlet:defineObjects/>
<script language="JavaScript" type="text/javascript">
function fillform(val)
{
saveform.savetopath.value = val;
saveform.showsavetopath.value = val;
}
</script>
<%
Vector collList = (Vector)request.getAttribute("collList");
WebDAVUtil wdUtil = new WebDAVUtil();
String sCurrPath = (String)request.getAttribute("currpath");
String sParentPath = wdUtil.fetchParentPath(sCurrPath + "/");
String sRootPath = (String)request.getAttribute("rootpath");
String sPath = (String)request.getAttribute("path");
String sBaseURL = (String)request.getAttribute("contenturl");
String sCSSURL = (String)request.getAttribute("cssurl");
%>
<!-- tinyMCE -->
<script language="javascript" type="text/javascript" src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH %>/tiny_mce/tiny_mce_src.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash",
theme_advanced_buttons1_add : "fontselect,fontsizeselect,forecolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom",
theme_advanced_buttons3_add : "iespell,flash,advhr",
content_css : "<%= sCSSURL %>",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
relative_urls : "true",
document_base_url : "<%= sBaseURL %>",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],font[face|size|color],hr[class|width|size|noshade]"
});
</script>
<!-- /tinyMCE -->
<form name="saveform" method="post" action="<portlet:actionURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_SAVENEWTEXT %>"/>
<portlet:param name="path" value="<%= sPath %>"/>
</portlet:actionURL>">
<input type="hidden" name="savetopath" value="<%= sPath %>">
<table width="100%">
<th class="portlet-section-header">${n:i18n("TITLE_HEAD")} :: ${n:i18n("TITLE_CREATE")}</th>
<tr><td height="10"></td></tr>
<tr><td>
<table>
<tr>
<td valign="top">
<font class="portlet-font">FileName:</font> <input type="text" name="filename" class="portlet-form-input-field"><br>
<font class="portlet-font">Creating File in directory:</font> <input type="text" name="showsavetopath" size="35" value="<%= sPath %>" class="portlet-form-input-field" DISABLED>
</td>
<td width="10"></td>
<td valign="top">
<font class="portlet-font">Select a directory to save resource to, or browse to the destination directory.</font>
<br>
<font class="portlet-font">You are currently browsing: <%= sCurrPath %></font>
<br>
<a class="portlet-menu-item" href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CREATENEWTEXT %>"/>
<portlet:param name="path" value="<%= sPath %>"/>
<portlet:param name="navpath" value="<%= sParentPath %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/upfolder.gif" alt="up" border="0"> Up to Parent Directory</a>
<br>
<%
// special case for root, so people can copy/move resources to it.
if (sRootPath.equals(sCurrPath))
{
%>
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/plus.gif" alt="expand" border="0">
<a class="portlet-menu-item" href="javascript:fillform('<%= wdUtil.cleanDoubleSlashes(sCurrPath) %>')">Root Directory</a>
<br>
<%
}
for (int i=0; i < collList.size(); i++)
{
String[] sAItem = (String[])collList.elementAt(i);
String sDisplayname = sAItem[0];
String sIsColl = sAItem[2];
if ("COLLECTION".equals(sIsColl))
{
%>
<a href="<portlet:renderURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CREATENEWTEXT %>"/>
<portlet:param name="path" value="<%= sPath %>"/>
<portlet:param name="navpath" value="<%= sCurrPath + "/" + sDisplayname %>"/>
</portlet:renderURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/plus.gif" alt="expand" border="0"></a>
<a class="portlet-menu-item" href="javascript:fillform('<%= wdUtil.cleanDoubleSlashes(sCurrPath + "/" + sDisplayname) %>')"><%= sDisplayname %></a>
<br>
<%
}
}
%>
</td></tr>
</table>
</td></tr>
<tr><td height="10"></td></tr>
<tr><td align="center">
<textarea id="elm1" name="elm1" rows="20" cols="80" style="width: 100%"></textarea>
<br>
<input type="submit" name="save" value="Create" class="portlet-form-input-field"/>
<input type="reset" name="reset" value="Reset" class="portlet-form-input-field"/>
</td></tr>
</table>
</form>
<!--
<a href="<portlet:actionURL>
<portlet:param name="op" value="<%= AdminCMSConstants.OP_CHANGE_DIR %>"/>
<portlet:param name="path" value="<%= sPath %>"/>
</portlet:actionURL>">
<img src="<%= renderRequest.getContextPath() + AdminCMSConstants.DEFAULT_IMAGES_PATH%>/up.gif" alt="Back to directory view" border="0"><br>Back to directory view
</a>
-->
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?