⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 containerlistproperties.jsp

📁 java 写的一个新闻发布系统
💻 JSP
字号:
<%@ page language="java" %><%@ page import="org.jahia.data.*" %><%@ page import="org.jahia.data.fields.*" %><%@ page import="org.jahia.data.containers.*" %><%@ page import="org.jahia.services.pages.*" %><%@ page import="org.jahia.params.*" %><%@ page import="org.jahia.services.*" %><%@ page import="org.jahia.services.usermanager.*" %><%@ page import="java.util.*" %><%@ taglib uri="JahiaLib" prefix="jahia" %><jsp:useBean id="URL" class="java.lang.String" scope="request"/><jsp:useBean id="engineTitle" class="java.lang.String" scope="request"/><jsp:useBean id="javaScriptPath" class="java.lang.String" scope="request"/><%    HashMap engineMap   = (HashMap) request.getAttribute( "org.jahia.engines.EngineHashMap" );    JahiaContainerList theContainerList  = (JahiaContainerList) engineMap.get( "theContainerList" );    String CListName = "";    if (theContainerList != null) {        CListName    = theContainerList.getDefinition().getName();    }    String fieldForm    = (String) engineMap.get( "fieldForm" );    String logForm      = (String) engineMap.get( "logForm" );    List logData        = (List) engineMap.get( "logData" );    String engineUrl    = (String) engineMap.get( "engineUrl" );    String theScreen    = (String) engineMap.get( "screen" );    ParamBean jParams   = (ParamBean) engineMap.get( "jParams" );    Vector containers   = (Vector) engineMap.get("containers");    Vector fields       = (Vector) engineMap.get("fields");    String autSort      = (String) engineMap.get("automatic");    if (autSort == null)    {        autSort = "";    }    Integer cursorField   = (Integer) engineMap.get("cursorField");    int cursorFieldInt = 0;    if (cursorField != null)    {        cursorFieldInt   = cursorField.intValue();    }    Integer containerSelectedStr   = (Integer) engineMap.get("containerSelected");    int containerSelected = 0;    if (containerSelectedStr != null)    {        containerSelected   = containerSelectedStr.intValue();    }    Vector fieldInfoToDisplay = (Vector) engineMap.get("fieldInfoToDisplay");    int pageDefID = jParams.getPage().getPageTemplateID();%><!-- Used by container list field acl settings //-->	    <% 	String aclFieldName = (String)engineMap.get( "aclfieldname" );%><!-- Used by container list field acl settings //-->	    <script language="javascript"><!--function handleActionChange(){    var theAction = document.selector.theaction.selectedIndex;    var actionUrl = "<%=engineUrl%><% if ("".equals(aclFieldName)) { %>&lastaclfield=<%=aclFieldName%><% } %>";	if (handleActionChange.arguments.length > 0) {	   actionUrl += handleActionChange.arguments[0];	}    document.mainForm.method = "POST";    document.mainForm.action = actionUrl + "&screen=" +                                document.selector.theaction[theAction].value;    if ((theAction >= '1') && (theAction <= '4')) {        if (document.mainForm.lastscreen.value == "edit") {            for ( var i = 0 ; i < document.mainForm.manRank.length ; i++ ) {                document.mainForm.manRank.options[i].selected = true;            }        }    }    document.mainForm.submit();}function check() {    if (document.mainForm.lastscreen.value == "edit")    {        for ( var i = 0 ; i< document.mainForm.manRank.length ; i++ )        {        document.mainForm.manRank.options[i].selected 	= true;        }    }    return true;}function sendForm(){    if (document.mainForm.lastscreen.value == "edit")    {        for ( var i = 0 ; i< document.mainForm.manRank.length ; i++ )        {        document.mainForm.manRank.options[i].selected 	= true;        }    }    document.mainForm.method = "POST";    document.mainForm.action = "<%=engineUrl%>&screen=save";    document.mainForm.submit();}document.onkeydown = keyDown;function keyDown() {    if (document.all) {        var ieKey = event.keyCode;        if (ieKey == 13 && event.ctrlKey) { sendForm(); }        if (ieKey == 87 && event.ctrlKey) { window.close(); }    }}function changeCursorField (){    document.mainForm.method = "POST";    document.mainForm.action = "<%=engineUrl%>&screen=edit&updMode=cursor";    document.mainForm.submit();}function automaticRanking(){    document.mainForm.method = "POST";    document.mainForm.action = "<%=engineUrl%>&screen=edit&updMode=automatic";    document.mainForm.submit();}function manualRanking(move){    document.mainForm.method = "POST";    document.mainForm.action = "<%=engineUrl%>&screen=edit&updMode=manual&move="+move;    document.mainForm.submit();}function moveUp(){    moveItem(document.mainForm.manRank,"up");}function moveDown(){    moveItem(document.mainForm.manRank,"down");}function moveTop(){    moveItem(document.mainForm.manRank,"top");}function moveBottom(){    moveItem(document.mainForm.manRank,"bottom");}function moveItem(element,move){    index = element.selectedIndex;    if (index != -1 && element.options[index].value > "") {        aText = element.options[index].text;        aValue = element.options[index].value;        if (element.options[index].value > "" && index > 0 && move == "up")        {            element.options[index].text = element.options[index-1].text;            element.options[index].value = element.options[index-1].value;            element.options[index-1].text = aText;            element.options[index-1].value = aValue;            element.selectedIndex--;        }        else if (index < element.length-1 && element.options[index+1].value > "" && move == "down")        {            element.options[index].text = element.options[index+1].text;            element.options[index].value = element.options[index+1].value;            element.options[index+1].text = aText;            element.options[index+1].value = aValue;            element.selectedIndex++;        }        else if (index > 0 && move == "top")        {            element.options[element.length] = new Option(aText, aValue, false, false);            for(var i=element.length-2; i>=0; i--)            {                element.options[i+1].text = element.options[i].text;                element.options[i+1].value = element.options[i].value;                element.options[i+1].selected = false;            }            element.options[0] = new Option(aText, aValue, false, true);            element.options[index+1] = null;        }        else if (index < element.length && move == "bottom")        {            element.options[element.length] = new Option(aText, aValue, false, true);            element.options[index] = null;        }    }    else    {        alert("Please select a value");    }}//--></script><table class="text" width="95%" align="center" border="0" cellspacing="0" cellpadding="0"><tr>    <td><img src="<%=URL%>images/pix.gif" width="1" height="18"></td>    <td>        <b>Container list settings</b>    </td>    <td>        <b>Container list title : </b><span class="text2"><%=theContainerList.getDefinition().getTitle(pageDefID)%></span>    </td>    <td>&nbsp;</td></tr><tr>    <td><img src="<%=URL%>images/pix.gif" width="1" height="18"></td>    <td>&nbsp;</td>    <td><b>Container list name : </b><%=theContainerList.getDefinition().getName()%></td>    <td><b>Container list ID : </b>[<%=theContainerList.getID()%>]</td></tr></table><!-- include actions selector form start --><jsp:include page="../include/actions_selector.jsp" flush="true"/><!-- include actions selector form ends --><script language="javascript">if (screen.availHeight <= 600) {    window.moveTo(0,0);    window.resizeTo(640, screen.availHeight);} else {    window.resizeTo(640, 740);}</script><form name="mainForm" method="POST" action="<%=engineUrl%>"><%//------------------------------------------------------------------------------// Container list field acls//Set fieldnames = null;HashMap fieldAcls = (HashMap) engineMap.get( "fieldAcls" );if (fieldAcls != null) {    fieldnames = fieldAcls.keySet();}   if ( theScreen.equals("ctneditview_rights") && (fieldnames != null) ) { %>    <table width="95%" height="2" border="0" cellspacing="0" cellpadding="0" align="center">        <tr>            <td>                <img src="<jahia:serverHttpPath /><jahia:engineResourceBundle resourceName="pixImg" />" width="1" height="24">            </td>            <td class="text">                <b>Current&nbsp;Field&nbsp;:&nbsp;</b>                <select class="input" name="aclfieldname"                         onChange="handleActionChange('&aclfieldname='+this.options[this.options.selectedIndex].value)">                    <% for (int i = 0; i < fields.size(); i++) {                         String name = ((JahiaField)fields.get(i)).getDefinition().getName(); %>                        <option value="<%=name%>"                            <% if (aclFieldName.equals(name)) { %> selected <% } %>>                            <%=((JahiaField)fields.get(i)).getDefinition().getTitle(pageDefID)%>                    <% } %>                </select>            </td>        </tr>    </table><% } //------------------------------------------------------------------------------%><input type="hidden" name="lastscreen" value="<%=theScreen%>"><table border="0" width="90%" align="center"><%if (theScreen.equals("edit")) {    if (!CListName.equals("PortletList") && containers != null && fieldInfoToDisplay != null) { %><tr>    <td width="40%" class="text">        Container list title :    </td>    <td width="60%" class="text2">        <b><%=theContainerList.getDefinition().getTitle(pageDefID)%></b>    </td></tr><tr>    <td width="40%" class="text">        Cursor field :    </td>    <td width="60%" class="input">        <select class="input" name="cursorField" onChange="changeCursorField()">            <%            for (int i=0; i < fields.size(); i++) { %>            <option value="<%=i%>"            <% if(cursorFieldInt ==  i ){%> selected <%}%>>                <%=((JahiaField)fields.get(i)).getDefinition().getTitle(pageDefID)%>            <% } %>        </select>    </td></tr><tr>    <td>        &nbsp;    </td></tr><tr>    <td width="40%" class="text">        <b>Automatic Ranking </b>    </td></tr><tr>    <td width="40%" class="text">        Sort by :    </td>    <td width="60%" class="input">        <select class="input" name="autRank" onChange="automaticRanking()">            <option value="none">                Choose an automatic sort            <option value="alphAsc" <% if (autSort.equals("alphAsc")) {%>selected<%}%>>                Alphabetical, ascending            <option value="alphDesc" <% if (autSort.equals("alphDesc")) {%>selected<%}%>>                Alphabetical, descending            <option value="insertAsc" <% if (autSort.equals("insertAsc")) {%>selected<%}%>>                Insertion order, ascending            <option value="insertDesc" <% if (autSort.equals("insertDesc")) {%>selected<%}%>>                Insertion order, descending        </select>    </td></tr><tr>    <td>        &nbsp;    </td></tr><tr>    <td width="40%" class="text">        <b>Manual Ranking </b>    </td></tr><tr>    <td width="40%" class="text" valign="top">        Move a container up or down :    </td>    <td width="50%" class="input" rowspan="2">        <select class="input" name="manRank" size="10" multiple>            <%            for (int i=0; i < containers.size(); i++) { %>            <option value="<%=i%>"            <% if (i == containerSelected) {%>selected<%}%>>                <%=(String)fieldInfoToDisplay.get(i)%>                <% } %>        </select>    </td></tr><tr>    <td width="40%" class="text" align="right" valign="top">        <a href="javascript:moveTop()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Top','','<jahia:serverHttpPath /><jahia:engineResourceBundle resourceName="moveTopOnButtonImg" />',1)"><img name="Top" src="<jahia:serverHttpPath /><jahia:engineResourceBundle resourceName="moveTopOffButtonImg" />" width="16" height="16" border="0" alt="Move on top"></a>        <br>        <a href="javascript:moveUp()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Up','','<jahia:serverHttpPath /><jahia:engineResourceBundle resourceName="moveUpOnButtonImg" />',1)"><img name="Up" src="<jahia:serverHttpPath /><jahia:engineResourceBundle resourceName="moveUpOffButtonImg" />" width="16" height="16" border="0" alt="Move up"></a>        <br>        <a href="javascript:moveDown()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Down','','<jahia:serverHttpPath /><jahia:engineResourceBundle resourceName="moveDownOnButtonImg" />',1)"><img name="Down" src="<jahia:serverHttpPath /><jahia:engineResourceBundle resourceName="moveDownOffButtonImg" />" width="16" height="16" border="0" alt="Move down"></a>        <br>        <a href="javascript:moveBottom()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Bottom','','<jahia:serverHttpPath /><jahia:engineResourceBundle resourceName="moveBottomOnButtonImg" />',1)"><img name="Bottom" src="<jahia:serverHttpPath /><jahia:engineResourceBundle resourceName="moveBottomOffButtonImg" />" width="16" height="16" border="0" alt="Move at bottom"></a>        <br>    </td></tr><% }} else if ( theScreen.equals("rightsMgmt") || theScreen.equals("ctneditview_rights") ) { %><tr>    <td width="100%" valign="top" class="input">        <%=fieldForm%>    		    </td></tr><% } else if (theScreen.equals("logs")) { %><tr>    <td width="100%" valign="top" class="input">        <%=logForm%>    </td></tr><% } %></table></form>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -