NewsSectionParserHelper.java
18.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.parser;
import java.util.HashMap;
import java.util.Map;
import com.people.component.comp.layoutdata.channel.AdvSection;
import com.people.component.comp.layoutdata.channel.CompFollowSection;
import com.people.component.comp.layoutdata.channel.ImageSection;
import com.people.component.comp.layoutdata.channel.LineSection;
import com.people.component.comp.layoutdata.channel.OneKeyPlaySection;
import com.people.component.comp.layoutdata.channel.TitleLabelSection;
import com.people.component.comp.layoutmanager.channel.CompActivity01;
import com.people.component.comp.layoutmanager.channel.CompAdvGuanMI;
import com.people.component.comp.layoutmanager.channel.CompAdvLongImageLan;
import com.people.component.comp.layoutmanager.channel.CompAdvVideoEx;
import com.people.component.comp.layoutmanager.channel.CompAllResultPeoplesAccount;
import com.people.component.comp.layoutmanager.channel.CompAllSearchActivityCard;
import com.people.component.comp.layoutmanager.channel.CompAllSearchMessageCard;
import com.people.component.comp.layoutmanager.channel.CompAllSearchPeoplesAccount;
import com.people.component.comp.layoutmanager.channel.CompBanner01;
import com.people.component.comp.layoutmanager.channel.CompBanner02;
import com.people.component.comp.layoutmanager.channel.CompBigImage01;
import com.people.component.comp.layoutmanager.channel.CompBigImage02;
import com.people.component.comp.layoutmanager.channel.CompBigImage03;
import com.people.component.comp.layoutmanager.channel.CompDefaultView;
import com.people.component.comp.layoutmanager.channel.CompGridLayout01;
import com.people.component.comp.layoutmanager.channel.CompLabel02;
import com.people.component.comp.layoutmanager.channel.CompLine01;
import com.people.component.comp.layoutmanager.channel.CompMoreImage01;
import com.people.component.comp.layoutmanager.channel.CompMoreImage02;
import com.people.component.comp.layoutmanager.channel.CompNewsImage01;
import com.people.component.comp.layoutmanager.channel.CompNewsOnePlayer01;
import com.people.component.comp.layoutmanager.channel.CompRecommendChannelWz;
import com.people.component.comp.layoutmanager.channel.CompSearchRecommendationsTop;
import com.people.component.comp.layoutmanager.channel.CompShopSettled;
import com.people.component.comp.layoutmanager.channel.CompSingleMessageBoard;
import com.people.component.comp.layoutmanager.channel.CompSingleRow01;
import com.people.component.comp.layoutmanager.channel.CompSingleRow02;
import com.people.component.comp.layoutmanager.channel.CompSingleRow04;
import com.people.component.comp.layoutmanager.channel.CompSingleRow05;
import com.people.component.comp.layoutmanager.channel.CompSingleRow06;
import com.people.component.comp.layoutmanager.channel.CompSingleRow07;
import com.people.component.comp.layoutmanager.channel.CompSingleRow08;
import com.people.component.comp.layoutmanager.channel.CompSingleRow09;
import com.people.component.comp.layoutmanager.channel.CompSingleRowFollow;
import com.people.component.comp.layoutmanager.channel.CompSingleRowGolden;
import com.people.component.comp.layoutmanager.channel.CompSingleRowRecommendFollow;
import com.people.component.comp.layoutmanager.channel.CompSingleRowTheme;
import com.people.component.comp.layoutmanager.channel.CompSmallImage01;
import com.people.component.comp.layoutmanager.channel.CompSmallImage02;
import com.people.component.comp.layoutmanager.channel.CompSmallImage03;
import com.people.component.comp.layoutmanager.channel.CompTimeline;
import com.people.component.comp.layoutmanager.channel.CompTxt01;
import com.people.component.comp.layoutmanager.channel.HighQualityCommentsPageCard;
import com.people.component.comp.layoutmanager.channel.PoliticsLeaveWord;
/**
* 首页模板section、layoutManager注册集合类<BR>
* 智慧融媒中心首页楼层注册池
*
* @author zhangbo
* @version [V1.0.0, 2022/3/25]
* @since V1.0.0
*/
public class NewsSectionParserHelper {
/**
* section集合
*/
public static final Map<String, Class<?>> SECTION_TYPE_MAP;
/**
* layoutManger集合
*/
public static final Map<String, Class<?>> LAYOUT_MANGER_MAP;
static {
// 没有特殊处理,可以多个LayoutManager公用一个section,直接注册compType为key
// 若需要单独出section,则注册compType$compStyle为key
SECTION_TYPE_MAP = new HashMap<>();
// ----组件----//
// 轮播卡
SECTION_TYPE_MAP.put("ZH_CAROUSEL_LAYOUT$Zh_Carousel_Layout-01", ImageSection.class);
// 横划卡
SECTION_TYPE_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-01", ImageSection.class);
// 小视频横划卡
SECTION_TYPE_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-02", ImageSection.class);
// 直播预约卡
SECTION_TYPE_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-03", ImageSection.class);
// 地方精选卡
SECTION_TYPE_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-04", ImageSection.class);
// 人民号账号横滑卡
SECTION_TYPE_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-05", ImageSection.class);
// 评论卡
SECTION_TYPE_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-06", ImageSection.class);
//双流小视频卡(一行两卡)
SECTION_TYPE_MAP.put("ZH_GRID_LAYOUT$Zh_Grid_Layout-02", ImageSection.class);
//金刚卡
SECTION_TYPE_MAP.put("ZH_GRID_LAYOUT$Zh_Grid_Layout-03", ImageSection.class);
// 头图卡
SECTION_TYPE_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-02", ImageSection.class);
// 正在直播大图卡
SECTION_TYPE_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-03", ImageSection.class);
// 人民号主题卡
SECTION_TYPE_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-04", ImageSection.class);
// 人民号入驻卡
SECTION_TYPE_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-05", ImageSection.class);
// 本地问政
SECTION_TYPE_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-06", ImageSection.class);
// 热门留言
SECTION_TYPE_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-07", ImageSection.class);
// 留言板卡 以及 我的问政-我的留言头部
SECTION_TYPE_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-08", ImageSection.class);
// 兴趣询问卡
SECTION_TYPE_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-09", ImageSection.class);
// ----本地自定义样式----//
// 广告组件 -- 顶部长通栏
SECTION_TYPE_MAP.put("customStyle$Comp_Ad_01", ImageSection.class);
// 广告组件 -- 冠名广告
SECTION_TYPE_MAP.put("customStyle$Comp_Ad_02", AdvSection.class);
// 广告组件 -- 视频展会广告
SECTION_TYPE_MAP.put("customStyle$Comp_Ad_03", AdvSection.class);
// 人民号主推荐卡
SECTION_TYPE_MAP.put("customStyle$Rmh_Master_Recommend", CompFollowSection.class);
//人民号关注横滑卡(本地)
SECTION_TYPE_MAP.put("customStyle$Rmh_Follow", CompFollowSection.class);
// 专题页面坂本名称稿件
// SECTION_TYPE_MAP.put("customStyle$CompLabel01", TitleLabelSection.class);
// 组件标题
SECTION_TYPE_MAP.put("customStyle$CompLabel02", TitleLabelSection.class);
// 组件线
SECTION_TYPE_MAP.put("customStyle$CompLine01", LineSection.class);
// 更多按钮
// SECTION_TYPE_MAP.put("customStyle$CompButton01", ImageSection.class);
// 早晚报专题 特殊稿件
SECTION_TYPE_MAP.put("customStyle$CompNewsImageTxt01", ImageSection.class);
// 早晚报专题 一键播放
SECTION_TYPE_MAP.put("customStyle$CompNewsPlayerView01", OneKeyPlaySection.class);
// 预约大图卡
SECTION_TYPE_MAP.put("customStyle$CompBigImage01", ImageSection.class);
//优质评论页-优质评论列表子项
SECTION_TYPE_MAP.put("customStyle$HighQualityCommentsPageCard", ImageSection.class);
//搜索-人民号更多-全部结果页- 人民号卡
SECTION_TYPE_MAP.put("customStyle$CompAllResultPeoplesAccount", ImageSection.class);
//搜索-全部tab下- 人民号卡(带头部更多)
SECTION_TYPE_MAP.put("customStyle$CompAllSearchPeoplesAccount", ImageSection.class);
//搜索-全部tab下-留言板卡 迭代三新增
SECTION_TYPE_MAP.put("customStyle$CompAllSearchMessageCard", ImageSection.class);
//搜索-推荐顶部无内容布局
SECTION_TYPE_MAP.put("customStyle$SearchRrecommendationsTop", ImageSection.class);
//搜索-活动列表
SECTION_TYPE_MAP.put("customStyle$CompAllSearchActivityCard", ImageSection.class);
//活动
SECTION_TYPE_MAP.put("customStyle$CompActivity01", ImageSection.class);
//暂无内容卡、缺省页
SECTION_TYPE_MAP.put("customStyle$CompDefaultView", ImageSection.class);
// ----稿件----//
// // 小图卡
// SECTION_TYPE_MAP.put("appStyle$1", ImageSection.class);
// 大图卡
SECTION_TYPE_MAP.put("appStyle$2", ImageSection.class);
// 无图卡(全标题)
SECTION_TYPE_MAP.put("appStyle$3", ImageSection.class);
// 三图卡
SECTION_TYPE_MAP.put("appStyle$4", ImageSection.class);
// 头图卡
SECTION_TYPE_MAP.put("appStyle$5", ImageSection.class);
// 小视频卡
SECTION_TYPE_MAP.put("appStyle$6", ImageSection.class);
// // 作者卡
// SECTION_TYPE_MAP.put("appStyle$7", ImageSection.class);
// // 财经快讯卡
// SECTION_TYPE_MAP.put("appStyle$8", ImageSection.class);
// 时间轴卡
SECTION_TYPE_MAP.put("appStyle$9", ImageSection.class);
// 大专题卡
SECTION_TYPE_MAP.put("appStyle$10", ImageSection.class);
// 无图卡(标题缩略)
SECTION_TYPE_MAP.put("appStyle$11", ImageSection.class);
// 无图卡(标题缩略)-人民号
SECTION_TYPE_MAP.put("appStyle$12", ImageSection.class);
// 单图卡
SECTION_TYPE_MAP.put("appStyle$13", ImageSection.class);
// 单图卡-人民号
SECTION_TYPE_MAP.put("appStyle$14", ImageSection.class);
// 大图卡-人民号
SECTION_TYPE_MAP.put("appStyle$15", ImageSection.class);
// 三图卡-人民号
SECTION_TYPE_MAP.put("appStyle$16", ImageSection.class);
// 图集卡
SECTION_TYPE_MAP.put("appStyle$17", ImageSection.class);
// 图集卡-人民号
//SECTION_TYPE_MAP.put("appStyle$18", ImageSection.class);
// 动态图文卡-人民号
SECTION_TYPE_MAP.put("appStyle$19", ImageSection.class);
// 动态视频卡-人民号
SECTION_TYPE_MAP.put("appStyle$20", ImageSection.class);
// 小视频卡-人民号
SECTION_TYPE_MAP.put("appStyle$21", ImageSection.class);
//问政问答卡/问政问题卡 我的问政-我的留言/关注留言
SECTION_TYPE_MAP.put("appStyle$23", ImageSection.class);
// 推荐问政卡
SECTION_TYPE_MAP.put("appStyle$24", ImageSection.class);
}
static {
LAYOUT_MANGER_MAP = new HashMap<>();
// ----组件----//
// 迭代一
// 轮播卡
LAYOUT_MANGER_MAP.put("ZH_CAROUSEL_LAYOUT$Zh_Carousel_Layout-01", CompBanner02.class);
// 横划卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-01", CompSingleRow01.class);
// 小视频横划卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-02", CompSingleRow02.class);
// 直播预约卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-03", CompSingleRow06.class);
// 双流小视频卡 (一行两图卡)
LAYOUT_MANGER_MAP.put("ZH_GRID_LAYOUT$Zh_Grid_Layout-02", CompSmallImage02.class);
// 头图卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-02", CompBanner01.class);
// 正在直播大图卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-03", CompBigImage01.class);
// 迭代二
// 金刚位横滑卡
LAYOUT_MANGER_MAP.put("ZH_GRID_LAYOUT$Zh_Grid_Layout-03", CompSingleRowGolden.class);
// 留言板卡 以及 我的问政-我的留言头部
LAYOUT_MANGER_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-08", CompSingleMessageBoard.class);
// 本地问政卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-06", CompSingleRow09.class);
// 人民留言卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-07", CompSingleRow04.class);
// 迭代三
// 地方精选卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-04", CompSingleRow07.class);
// 人民账号横滑卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-05", CompSingleRowRecommendFollow.class);
// 热门评论卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_ROW$Zh_Single_Row-06", CompSingleRow08.class);
// 人民号主题卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-04", CompSingleRowTheme.class);
// 人民号入驻卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-05", CompShopSettled.class);
// 兴趣询问卡
LAYOUT_MANGER_MAP.put("ZH_SINGLE_COLUMN$Zh_Single_Column-09", CompSingleRow05.class);
// ----本地自定义样式----//
// 广告组件 -- 顶部长通栏
LAYOUT_MANGER_MAP.put("customStyle$Comp_Ad_01", CompAdvLongImageLan.class);
// 广告组件 -- 冠名广告
LAYOUT_MANGER_MAP.put("customStyle$Comp_Ad_02", CompAdvGuanMI.class);
// 广告组件 -- 视频展会广告
LAYOUT_MANGER_MAP.put("customStyle$Comp_Ad_03", CompAdvVideoEx.class);
// 人民号主推荐卡(本地)
LAYOUT_MANGER_MAP.put("customStyle$Rmh_Master_Recommend", CompGridLayout01.class);
//人民号关注横滑卡(本地)
LAYOUT_MANGER_MAP.put("customStyle$Rmh_Follow", CompSingleRowFollow.class);
// 专题页面坂本名称稿件 (弃用)
//LAYOUT_MANGER_MAP.put("customStyle$CompLabel01", CompLabel01.class);
// 组件标题
LAYOUT_MANGER_MAP.put("customStyle$CompLabel02", CompLabel02.class);
// 组件线
LAYOUT_MANGER_MAP.put("customStyle$CompLine01", CompLine01.class);
// 更多按钮
// LAYOUT_MANGER_MAP.put("customStyle$CompButton01", CompButton01.class);
// 早晚报专题 特殊稿件
LAYOUT_MANGER_MAP.put("customStyle$CompNewsImageTxt01", CompNewsImage01.class);
// 早晚报专题 一键播放
LAYOUT_MANGER_MAP.put("customStyle$CompNewsPlayerView01", CompNewsOnePlayer01.class);
// 直播预约大图卡
LAYOUT_MANGER_MAP.put("customStyle$CompBigImage01", CompBigImage02.class);
//优质评论页-优质评论列表子项 迭代三新增
LAYOUT_MANGER_MAP.put("customStyle$HighQualityCommentsPageCard", HighQualityCommentsPageCard.class);
//搜索-人民号更多-全部结果页- 人民号卡
LAYOUT_MANGER_MAP.put("customStyle$CompAllResultPeoplesAccount", CompAllResultPeoplesAccount.class);
//搜索-全部tab下- 人民号卡(带头部更多)
LAYOUT_MANGER_MAP.put("customStyle$CompAllSearchPeoplesAccount", CompAllSearchPeoplesAccount.class);
//搜索-全部tab下-留言板卡 迭代三新增
LAYOUT_MANGER_MAP.put("customStyle$CompAllSearchMessageCard", CompAllSearchMessageCard.class);
//搜索-推荐顶部无内容布局
LAYOUT_MANGER_MAP.put("customStyle$SearchRrecommendationsTop", CompSearchRecommendationsTop.class);
//搜索-活动列表
LAYOUT_MANGER_MAP.put("customStyle$CompAllSearchActivityCard", CompAllSearchActivityCard.class);
// 活动卡
LAYOUT_MANGER_MAP.put("customStyle$CompActivity01", CompActivity01.class);
//暂无内容卡、缺省页
LAYOUT_MANGER_MAP.put("customStyle$CompDefaultView", CompDefaultView.class);
//
// ----稿件----//
// 1:小图卡,2:大图卡,3:无图卡(全标题),4:三图卡,5:头图卡,6:小视频卡,7:作者卡,8:财经快讯卡,9:时间轴卡,
// 10:大专题卡,11.无图卡(标题缩略),12.无图卡(标题缩略)-人民号,13.单图卡,14.单图卡-人民号,
// 15.大图卡-人民号,16.三图卡-人民号,17.图集卡,18.图集卡-人民号,19.动态图文卡-人民号,20.动态视频卡-人民号
// 21.小视频卡-人民号,22.时间链,23.问政卡,24.推荐问政卡
// 大图卡
LAYOUT_MANGER_MAP.put("appStyle$2", CompBigImage01.class);
// 无图卡(全标题)
LAYOUT_MANGER_MAP.put("appStyle$3", CompTxt01.class);
// 三图卡
LAYOUT_MANGER_MAP.put("appStyle$4", CompMoreImage01.class);
// 头图卡
LAYOUT_MANGER_MAP.put("appStyle$5", CompBanner01.class);
// 小视频卡
LAYOUT_MANGER_MAP.put("appStyle$6", CompSmallImage03.class);
// 时间链卡
LAYOUT_MANGER_MAP.put("appStyle$9", CompTimeline.class);
// 大专题卡
LAYOUT_MANGER_MAP.put("appStyle$10", CompBigImage03.class);
// 无图卡(标题缩略)
LAYOUT_MANGER_MAP.put("appStyle$11", CompTxt01.class);
// 无图卡(标题缩略)-人民号
LAYOUT_MANGER_MAP.put("appStyle$12", CompTxt01.class);
// 单图卡
LAYOUT_MANGER_MAP.put("appStyle$13", CompSmallImage01.class);
// 单图卡-人民号
LAYOUT_MANGER_MAP.put("appStyle$14", CompSmallImage01.class);
// 大图卡-人民号
LAYOUT_MANGER_MAP.put("appStyle$15", CompBigImage01.class);
// 三图卡-人民号
LAYOUT_MANGER_MAP.put("appStyle$16", CompMoreImage01.class);
// 图集卡
LAYOUT_MANGER_MAP.put("appStyle$17", CompMoreImage02.class);
// 图集卡-人民号
// LAYOUT_MANGER_MAP.put("appStyle$18", CompMoreImage02.class);
// 动态图文卡-人民号
LAYOUT_MANGER_MAP.put("appStyle$19", CompMoreImage01.class);
// 动态视频卡-人民号
LAYOUT_MANGER_MAP.put("appStyle$20", CompBigImage01.class);
// 小视频卡-人民号
LAYOUT_MANGER_MAP.put("appStyle$21", CompSmallImage03.class);
//问政问答卡/问政问题卡 我的问政-我的留言/关注留言
LAYOUT_MANGER_MAP.put("appStyle$23", PoliticsLeaveWord.class);
//推荐问政卡
LAYOUT_MANGER_MAP.put("appStyle$24", CompRecommendChannelWz.class);
// -----配置的comp end----//
}
private static String getCompKey(String compType, String compStyle) {
return compType + "$" + compStyle;
}
private NewsSectionParserHelper() {
}
/**
* 获取 ColumnCache
*
* @return
*/
public static int getColumnCacheSize() {
int compSizeTotal = LAYOUT_MANGER_MAP.size() -9;
if(compSizeTotal > 20){
compSizeTotal = 20;
}
return compSizeTotal;
}
}