Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
fd764fdb
Commit
fd764fdb
authored
Nov 27, 2020
by
guwd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、优化解析过程,分页size的获取方式采用正则
2、移除不需要的业务流程,提高解析效率
parent
631574fe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
22 deletions
+25
-22
GeneraterAction.java
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
+0
-0
MCmsAction.java
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
+0
-0
ContentBean.java
src/main/java/net/mingsoft/cms/bean/ContentBean.java
+1
-7
ContentBizImpl.java
src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java
+1
-1
CmsParserUtil.java
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
+23
-14
No files found.
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
View file @
fd764fdb
This diff is collapsed.
Click to expand it.
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
View file @
fd764fdb
This diff is collapsed.
Click to expand it.
src/main/java/net/mingsoft/cms/bean/ContentBean.java
View file @
fd764fdb
...
@@ -37,13 +37,7 @@ public class ContentBean extends ContentEntity {
...
@@ -37,13 +37,7 @@ public class ContentBean extends ContentEntity {
*/
*/
private
String
noflag
;
private
String
noflag
;
// public String getStaticUrl() {
// return staticUrl;
// }
//
// public void setStaticUrl(String staticUrl) {
// this.staticUrl = staticUrl;
// }
public
String
getBeginTime
()
{
public
String
getBeginTime
()
{
return
beginTime
;
return
beginTime
;
...
...
src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java
View file @
fd764fdb
...
@@ -229,7 +229,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
...
@@ -229,7 +229,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
if
(
BasicUtil
.
getWebsiteApp
()
!=
null
){
if
(
BasicUtil
.
getWebsiteApp
()
!=
null
){
map
.
put
(
ParserUtil
.
APP_ID
,
BasicUtil
.
getWebsiteApp
().
getAppId
());
map
.
put
(
ParserUtil
.
APP_ID
,
BasicUtil
.
getWebsiteApp
().
getAppId
());
}
}
String
read
=
ParserUtil
.
re
ad
(
templatePath
,
map
);
String
read
=
ParserUtil
.
re
ndering
(
templatePath
,
map
);
FileUtil
.
writeString
(
read
,
ParserUtil
.
buildHtmlPath
(
targetPath
),
net
.
mingsoft
.
base
.
constant
.
Const
.
UTF8
);
FileUtil
.
writeString
(
read
,
ParserUtil
.
buildHtmlPath
(
targetPath
),
net
.
mingsoft
.
base
.
constant
.
Const
.
UTF8
);
}
}
...
...
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
View file @
fd764fdb
...
@@ -71,25 +71,36 @@ public class CmsParserUtil extends ParserUtil {
...
@@ -71,25 +71,36 @@ public class CmsParserUtil extends ParserUtil {
throws
TemplateNotFoundException
,
MalformedTemplateNameException
,
ParseException
,
IOException
{
throws
TemplateNotFoundException
,
MalformedTemplateNameException
,
ParseException
,
IOException
{
try
{
try
{
// 文章的栏目模型编号
// 文章的栏目模型编号
Integer
columnContentModelId
=
column
.
getMdiyModelId
();
PageBean
page
=
new
PageBean
();
PageBean
page
=
new
PageBean
();
page
.
setSize
(
10
);
//获取分页数量
//获取列表页显示的文章数量
//获取列表中的size
//获取总数
page
.
setSize
(
ParserUtil
.
getPageSize
(
column
.
getCategoryListUrl
(),
20
));
page
.
setRcount
(
articleIdTotal
);
int
totalPageSize
=
PageUtil
.
totalPage
(
articleIdTotal
,
page
.
getSize
());
page
.
setTotal
(
totalPageSize
);
//获取模板中列表标签中的条件
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
BasicUtil
.
getWebsiteApp
()
!=
null
)
{
map
.
put
(
ParserUtil
.
APP_ID
,
BasicUtil
.
getWebsiteApp
().
getAppId
());
}
map
.
put
(
ParserUtil
.
HTML
,
ParserUtil
.
HTML
);
map
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
map
.
put
(
ParserUtil
.
PAGE
,
page
);
String
columnListPath
;
String
columnListPath
;
ModelEntity
contentModel
=
null
;
ModelEntity
contentModel
=
null
;
// 判断当前栏目是否有自定义模型
// 判断当前栏目是否有自定义模型
if
(
column
ContentModelId
!=
null
)
{
if
(
column
.
getMdiyModelId
()
!=
null
)
{
// 通过栏目模型编号获取自定义模型实体
// 通过栏目模型编号获取自定义模型实体
contentModel
=
(
ModelEntity
)
SpringUtil
.
getBean
(
ModelBizImpl
.
class
).
getEntity
(
column
ContentModelId
);
contentModel
=
(
ModelEntity
)
SpringUtil
.
getBean
(
ModelBizImpl
.
class
).
getEntity
(
column
.
getMdiyModelId
()
);
}
}
int
pageNo
=
1
;
//全局参数设置
//全局参数设置
Map
<
String
,
Object
>
parserParams
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
parserParams
=
new
HashMap
<
String
,
Object
>();
parserParams
.
put
(
ParserUtil
.
PAGE
,
page
);
parserParams
.
put
(
COLUMN
,
column
);
parserParams
.
put
(
COLUMN
,
column
);
//标签中使用field获取当前栏目
//标签中使用field获取当前栏目
parserParams
.
put
(
FIELD
,
column
);
parserParams
.
put
(
FIELD
,
column
);
...
@@ -106,17 +117,15 @@ public class CmsParserUtil extends ParserUtil {
...
@@ -106,17 +117,15 @@ public class CmsParserUtil extends ParserUtil {
if
(
ParserUtil
.
IS_SINGLE
)
{
if
(
ParserUtil
.
IS_SINGLE
)
{
parserParams
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
parserParams
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
}
}
parserParams
.
put
(
ParserUtil
.
PAGE
,
page
);
ParserUtil
.
read
(
File
.
separator
+
column
.
getCategoryListUrl
(),
parserParams
,
page
);
int
pageNo
=
1
;
int
totalPageSize
=
PageUtil
.
totalPage
(
articleIdTotal
,
page
.
getSize
());
page
.
setTotal
(
totalPageSize
);
//文章列表页没有写文章列表标签,总数为0
//文章列表页没有写文章列表标签,总数为0
if
(
totalPageSize
<=
0
)
{
if
(
totalPageSize
<=
0
)
{
// 数据库中第一页是从开始0*size
// 数据库中第一页是从开始0*size
columnListPath
=
ParserUtil
.
buildHtmlPath
(
column
.
getCategoryPath
()
+
File
.
separator
+
ParserUtil
.
INDEX
);
columnListPath
=
ParserUtil
.
buildHtmlPath
(
column
.
getCategoryPath
()
+
File
.
separator
+
ParserUtil
.
INDEX
);
// 设置分页的起始位置
// 设置分页的起始位置
page
.
setPageNo
(
pageNo
);
page
.
setPageNo
(
pageNo
);
String
read
=
ParserUtil
.
re
ad
(
File
.
separator
+
column
.
getCategoryListUrl
(),
parserParams
);
String
read
=
ParserUtil
.
re
ndering
(
File
.
separator
+
column
.
getCategoryListUrl
(),
parserParams
);
FileUtil
.
writeString
(
read
,
columnListPath
,
Const
.
UTF8
);
FileUtil
.
writeString
(
read
,
columnListPath
,
Const
.
UTF8
);
}
else
{
}
else
{
...
@@ -134,7 +143,7 @@ public class CmsParserUtil extends ParserUtil {
...
@@ -134,7 +143,7 @@ public class CmsParserUtil extends ParserUtil {
}
}
// 设置分页的起始位置
// 设置分页的起始位置
page
.
setPageNo
(
pageNo
);
page
.
setPageNo
(
pageNo
);
String
read
=
ParserUtil
.
re
ad
(
File
.
separator
+
column
.
getCategoryListUrl
(),
parserParams
);
String
read
=
ParserUtil
.
re
ndering
(
File
.
separator
+
column
.
getCategoryListUrl
(),
parserParams
);
FileUtil
.
writeString
(
read
,
columnListPath
,
Const
.
UTF8
);
FileUtil
.
writeString
(
read
,
columnListPath
,
Const
.
UTF8
);
pageNo
++;
pageNo
++;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment