opencms右键菜单

配置文件 opencms-workplace.xml 中的 <explorertypes> ……</explorertypes> 节点中配置的是右键菜单。

 

<explorertype name="folder" key="fileicon.folder" icon="folder.gif">
……
</explorertype>

 

其中配置的文件夹的右键菜单(name="folder"),可以选择相应的类型进行配置。

 

<explorertype name="folder" key="fileicon.folder" icon="folder.gif">
……
    <contextmenu>
          ……

       <!-- Add -->
           <separator/>
           <entry key="GUI_EXPLORER_CONTEXT_EP" uri="commons/enforcePublish.jsp" rule="nondeleted"/>
      </contextmenu>
……
</explorertype>

 

<entry />节点是菜单项,key 是显示的名称可以在/system/workplace/locales/zh/messages/org/opencms/workplace/explorer/下的messages_zh.properties文件中配置,uri是相应jsp页面的路径,一般存放在/system/workplace/commons/下

<separator/>是分割线。

rule是使用规则

<menurules>
<menurule name="lock">
    		<menuitemrule class="org.opencms.workplace.explorer.menu.CmsMirPrOnlineInvisible" />
    		<menuitemrule class="org.opencms.workplace.explorer.menu.CmsMirPrOtherInvisible" />
    		<menuitemrule class="org.opencms.workplace.explorer.menu.CmsMirPrSameUnlockedActive" />
    		<menuitemrule class="org.opencms.workplace.explorer.menu.CmsMirAlwaysInvisible" />
    	</menurule>
</menurules>

 这是lock规则的制定,也可以根据自己的需求扩展。

 

 

菜单的级联

<entry key="" rule="">
		<entry key="" uri="" rule=""/>
</entry>

 

另:如果想做一个简单的菜单,不想实现一些接口的话可以直接在jsp页面中进行操作。

CmsJspActionElement cms =  new CmsJspActionElement(pageContext, request, response);
	CmsObject cmsObject = cms.getCmsObject();
	String path = request.getParameter("resource");
	//当前文件路径
	……
	CmsDialog dialog = new CmsDialog(cms);
	dialog.actionCloseDialog();//退出,返回目录

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值