添加期刊文章时,里面的类型及类型的解决方案

//portal.properties 配置

journal.article.types=

如果在期刊文章里类型特别多时,维护是非常麻烦的事情,需要进行portal.properties文件的配置,国际化语言包的维护.

找到了一个解决此问题的方法:

在我们欢迎的首页面会有很多的标签(最上面首页的那些功能)我们可以根据这棵树生成这个类型.

页设置中还有一个针对PORTLET的隐藏的功能. 可以在这下面建一些隐藏类别.

修的文件及代码:

Html/portlet/journal_articles/edit_configuration.jsp(举例说明,此文件为期刊列表里面配置页面)

<%

//开头部分加入

LayoutLister layoutLister = new LayoutLister();

 

LayoutView layoutView = layoutLister.getLayoutView("PUB.1", "Guest",locale);

 

List layoutList = layoutView.getList();

 

%>

//下面部分放在类型下

    <select name="<portlet:namespace />type">

                                <%

                                                            for (int i = 0; i < layoutList.size(); i++) {

                                                                   // id | parentId | ls | obj id | name | img | depth

                                                                   String layoutDesc = (String)layoutList.get(i);

                                                                   String[] nodeValues = StringUtil.split(layoutDesc, "|");

                                                                   String objId = Layout.getLayoutId(nodeValues[3]);

                                                                   String layoutName = nodeValues[4];

                                                                   int depth = 0;

                                                                   if (i != 0) {

                                                                          depth = GetterUtil.getInteger(nodeValues[6]);

                                                                   }

                                                                   String layoutName1 = layoutName;

                                                                   for (int j = 0; j < depth; j++) {

                                                                          layoutName = "-&nbsp;" + layoutName;

                                                                   }

                                       %>

<option <%= type.equals(layoutName1) ? "selected" : "" %> value="<%= layoutName1 %>"><%= layoutName %></option>

                                                            <%

                                                            }

                                                            %>

                                                     </select>

 

把所有能用到类型的地方都换了就可以了.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值