Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
solo-1
Commits
b93deb7e
Unverified
Commit
b93deb7e
authored
Sep 26, 2018
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
💥
#12530
parent
2ce472df
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
16 additions
and
356 deletions
+16
-356
src/main/java/org/b3log/solo/processor/FeedProcessor.java
src/main/java/org/b3log/solo/processor/FeedProcessor.java
+5
-261
src/main/java/org/b3log/solo/service/PermalinkQueryService.java
...in/java/org/b3log/solo/service/PermalinkQueryService.java
+2
-3
src/main/webapp/plugins/kanbanniang/assert/index.js
src/main/webapp/plugins/kanbanniang/assert/index.js
+1
-1
src/main/webapp/robots.txt
src/main/webapp/robots.txt
+0
-2
src/main/webapp/skins
src/main/webapp/skins
+1
-1
src/test/java/org/b3log/solo/processor/FeedProcessorTestCase.java
.../java/org/b3log/solo/processor/FeedProcessorTestCase.java
+3
-64
src/test/resources/robots.txt
src/test/resources/robots.txt
+0
-20
src/test/resources/skins/Medium/macro-head.ftl
src/test/resources/skins/Medium/macro-head.ftl
+1
-1
src/test/resources/skins/Medium/nav.ftl
src/test/resources/skins/Medium/nav.ftl
+1
-1
src/test/resources/skins/mobile/header.ftl
src/test/resources/skins/mobile/header.ftl
+1
-1
src/test/resources/skins/mobile/macro-head.ftl
src/test/resources/skins/mobile/macro-head.ftl
+1
-1
No files found.
src/main/java/org/b3log/solo/processor/FeedProcessor.java
View file @
b93deb7e
This diff is collapsed.
Click to expand it.
src/main/java/org/b3log/solo/service/PermalinkQueryService.java
View file @
b93deb7e
...
@@ -35,7 +35,7 @@ import java.util.regex.Pattern;
...
@@ -35,7 +35,7 @@ import java.util.regex.Pattern;
* Permalink query service.
* Permalink query service.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.
4, Sep 7
, 2018
* @version 1.0.0.
5, Sep 26
, 2018
* @since 0.6.1
* @since 0.6.1
*/
*/
@Service
@Service
...
@@ -62,8 +62,7 @@ public class PermalinkQueryService {
...
@@ -62,8 +62,7 @@ public class PermalinkQueryService {
* Reserved permalinks.
* Reserved permalinks.
*/
*/
public
static
final
String
[]
RESERVED_LINKS
=
new
String
[]{
public
static
final
String
[]
RESERVED_LINKS
=
new
String
[]{
"/"
,
"/article"
,
"/tags.html"
,
"/tags"
,
"/page"
,
"/blog-articles-feed.do"
,
"/tag-articles-feed.do"
,
"/blog-articles-rss.do"
,
"/"
,
"/article"
,
"/tags.html"
,
"/tags"
,
"/page"
,
"/atom.xml"
,
"/rss.xml"
,
"/get-random-articles.do"
,
"/captcha.do"
,
"/kill-browser"
,
"/tag-articles-rss.do"
,
"/get-random-articles.do"
,
"/captcha.do"
,
"/kill-browser"
,
"/add-article-comment.do"
,
"/add-article-from-symphony-comment.do"
,
"/add-page-comment.do"
,
"/get-article-content"
,
"/sitemap.xml"
,
"/add-article-comment.do"
,
"/add-article-from-symphony-comment.do"
,
"/add-page-comment.do"
,
"/get-article-content"
,
"/sitemap.xml"
,
"/login"
,
"/logout"
,
"/forgot"
,
"/get-article-content"
,
"/admin-index.do"
,
"/admin-article.do"
,
"/admin-article-list.do"
,
"/login"
,
"/logout"
,
"/forgot"
,
"/get-article-content"
,
"/admin-index.do"
,
"/admin-article.do"
,
"/admin-article-list.do"
,
"/admin-link-list.do"
,
"/admin-preference.do"
,
"/admin-file-list.do"
,
"/admin-page-list.do"
,
"/admin-others.do"
,
"/admin-link-list.do"
,
"/admin-preference.do"
,
"/admin-file-list.do"
,
"/admin-page-list.do"
,
"/admin-others.do"
,
...
...
src/main/webapp/plugins/kanbanniang/assert/index.js
View file @
b93deb7e
...
@@ -117,7 +117,7 @@ var soloKanbanniang = {
...
@@ -117,7 +117,7 @@ var soloKanbanniang = {
});
});
$
(
'
#soloKanbanniangRSS
'
).
click
(
function
()
{
$
(
'
#soloKanbanniangRSS
'
).
click
(
function
()
{
window
.
location
=
latkeConfig
.
servePath
+
'
/
blog-articles-rss.do
'
;
window
.
location
=
latkeConfig
.
servePath
+
'
/
rss.xml
'
;
});
});
$
(
'
#soloKanbanniangGithub
'
).
click
(
function
()
{
$
(
'
#soloKanbanniangGithub
'
).
click
(
function
()
{
...
...
src/main/webapp/robots.txt
View file @
b93deb7e
User-agent: *
User-agent: *
Allow: /blog-articles-feed.do
Allow: /tag-articles-feed.do*
Disallow: /*.do
Disallow: /*.do
Disallow: /login
Disallow: /login
Disallow: /logout
Disallow: /logout
...
...
skins
@
f197f142
Subproject commit
c2c29ee93631faf3b69292de03345cc8740e5b8c
Subproject commit
f197f14243b60c389a334fa39dabd563ea6e039a
src/test/java/org/b3log/solo/processor/FeedProcessorTestCase.java
View file @
b93deb7e
...
@@ -18,9 +18,7 @@
...
@@ -18,9 +18,7 @@
package
org
.
b3log
.
solo
.
processor
;
package
org
.
b3log
.
solo
.
processor
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.model.User
;
import
org.b3log.latke.model.User
;
import
org.b3log.latke.repository.Query
;
import
org.b3log.solo.AbstractTestCase
;
import
org.b3log.solo.AbstractTestCase
;
import
org.b3log.solo.service.InitService
;
import
org.b3log.solo.service.InitService
;
import
org.b3log.solo.service.UserQueryService
;
import
org.b3log.solo.service.UserQueryService
;
...
@@ -41,7 +39,7 @@ import static org.mockito.Mockito.when;
...
@@ -41,7 +39,7 @@ import static org.mockito.Mockito.when;
* {@link FeedProcessor} test case.
* {@link FeedProcessor} test case.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.
2, Oct 21, 2017
* @version 1.0.0.
3, Sep 26, 2018
* @since 1.7.0
* @since 1.7.0
*/
*/
@Test
(
suiteName
=
"processor"
)
@Test
(
suiteName
=
"processor"
)
...
@@ -76,7 +74,7 @@ public class FeedProcessorTestCase extends AbstractTestCase {
...
@@ -76,7 +74,7 @@ public class FeedProcessorTestCase extends AbstractTestCase {
public
void
blogArticlesAtom
()
throws
Exception
{
public
void
blogArticlesAtom
()
throws
Exception
{
final
HttpServletRequest
request
=
mock
(
HttpServletRequest
.
class
);
final
HttpServletRequest
request
=
mock
(
HttpServletRequest
.
class
);
when
(
request
.
getServletContext
()).
thenReturn
(
mock
(
ServletContext
.
class
));
when
(
request
.
getServletContext
()).
thenReturn
(
mock
(
ServletContext
.
class
));
when
(
request
.
getRequestURI
()).
thenReturn
(
"/
blog-articles-feed.do
"
);
when
(
request
.
getRequestURI
()).
thenReturn
(
"/
atom.xml
"
);
when
(
request
.
getMethod
()).
thenReturn
(
"GET"
);
when
(
request
.
getMethod
()).
thenReturn
(
"GET"
);
final
MockDispatcherServlet
dispatcherServlet
=
new
MockDispatcherServlet
();
final
MockDispatcherServlet
dispatcherServlet
=
new
MockDispatcherServlet
();
...
@@ -94,36 +92,6 @@ public class FeedProcessorTestCase extends AbstractTestCase {
...
@@ -94,36 +92,6 @@ public class FeedProcessorTestCase extends AbstractTestCase {
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
}
}
/**
* tagArticlesAtom.
*
* @throws Exception exception
*/
@Test
(
dependsOnMethods
=
"init"
)
public
void
tagArticlesAtom
()
throws
Exception
{
final
HttpServletRequest
request
=
mock
(
HttpServletRequest
.
class
);
when
(
request
.
getServletContext
()).
thenReturn
(
mock
(
ServletContext
.
class
));
when
(
request
.
getRequestURI
()).
thenReturn
(
"/tag-articles-feed.do"
);
when
(
request
.
getMethod
()).
thenReturn
(
"GET"
);
final
JSONObject
tag
=
getTagRepository
().
get
(
new
Query
()).
optJSONArray
(
Keys
.
RESULTS
).
optJSONObject
(
0
);
when
(
request
.
getParameter
(
Keys
.
OBJECT_ID
)).
thenReturn
(
tag
.
optString
(
Keys
.
OBJECT_ID
));
final
MockDispatcherServlet
dispatcherServlet
=
new
MockDispatcherServlet
();
dispatcherServlet
.
init
();
final
StringWriter
stringWriter
=
new
StringWriter
();
final
PrintWriter
printWriter
=
new
PrintWriter
(
stringWriter
);
final
HttpServletResponse
response
=
mock
(
HttpServletResponse
.
class
);
when
(
response
.
getWriter
()).
thenReturn
(
printWriter
);
dispatcherServlet
.
service
(
request
,
response
);
final
String
content
=
stringWriter
.
toString
();
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
}
/**
/**
* blogArticlesRSS.
* blogArticlesRSS.
*
*
...
@@ -133,7 +101,7 @@ public class FeedProcessorTestCase extends AbstractTestCase {
...
@@ -133,7 +101,7 @@ public class FeedProcessorTestCase extends AbstractTestCase {
public
void
blogArticlesRSS
()
throws
Exception
{
public
void
blogArticlesRSS
()
throws
Exception
{
final
HttpServletRequest
request
=
mock
(
HttpServletRequest
.
class
);
final
HttpServletRequest
request
=
mock
(
HttpServletRequest
.
class
);
when
(
request
.
getServletContext
()).
thenReturn
(
mock
(
ServletContext
.
class
));
when
(
request
.
getServletContext
()).
thenReturn
(
mock
(
ServletContext
.
class
));
when
(
request
.
getRequestURI
()).
thenReturn
(
"/
blog-articles-rss.do
"
);
when
(
request
.
getRequestURI
()).
thenReturn
(
"/
rss.xml
"
);
when
(
request
.
getMethod
()).
thenReturn
(
"GET"
);
when
(
request
.
getMethod
()).
thenReturn
(
"GET"
);
final
MockDispatcherServlet
dispatcherServlet
=
new
MockDispatcherServlet
();
final
MockDispatcherServlet
dispatcherServlet
=
new
MockDispatcherServlet
();
dispatcherServlet
.
init
();
dispatcherServlet
.
init
();
...
@@ -149,33 +117,4 @@ public class FeedProcessorTestCase extends AbstractTestCase {
...
@@ -149,33 +117,4 @@ public class FeedProcessorTestCase extends AbstractTestCase {
final
String
content
=
stringWriter
.
toString
();
final
String
content
=
stringWriter
.
toString
();
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
}
}
/**
* tagArticlesRSS.
*
* @throws Exception exception
*/
@Test
(
dependsOnMethods
=
"init"
)
public
void
tagArticlesRSS
()
throws
Exception
{
final
HttpServletRequest
request
=
mock
(
HttpServletRequest
.
class
);
when
(
request
.
getServletContext
()).
thenReturn
(
mock
(
ServletContext
.
class
));
when
(
request
.
getRequestURI
()).
thenReturn
(
"/tag-articles-rss.do"
);
when
(
request
.
getMethod
()).
thenReturn
(
"GET"
);
final
JSONObject
tag
=
getTagRepository
().
get
(
new
Query
()).
optJSONArray
(
Keys
.
RESULTS
).
optJSONObject
(
0
);
when
(
request
.
getParameter
(
Keys
.
OBJECT_ID
)).
thenReturn
(
tag
.
optString
(
Keys
.
OBJECT_ID
));
final
MockDispatcherServlet
dispatcherServlet
=
new
MockDispatcherServlet
();
dispatcherServlet
.
init
();
final
StringWriter
stringWriter
=
new
StringWriter
();
final
PrintWriter
printWriter
=
new
PrintWriter
(
stringWriter
);
final
HttpServletResponse
response
=
mock
(
HttpServletResponse
.
class
);
when
(
response
.
getWriter
()).
thenReturn
(
printWriter
);
dispatcherServlet
.
service
(
request
,
response
);
final
String
content
=
stringWriter
.
toString
();
Assert
.
assertTrue
(
StringUtils
.
startsWith
(
content
,
"<?xml version=\"1.0\""
));
}
}
}
src/test/resources/robots.txt
View file @
b93deb7e
====
Solo - A small and beautiful blogging system written in Java.
Copyright (c) 2010-2018, b3log.org & hacpai.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
====
User-agent: *
User-agent: *
Allow: /blog-articles-feed.do
Allow: /tag-articles-feed.do*
Disallow: /*.do
Disallow: /*.do
Disallow: /login
Disallow: /login
Disallow: /logout
Disallow: /logout
...
...
src/test/resources/skins/Medium/macro-head.ftl
View file @
b93deb7e
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<meta name="copyright" content="B3log" />
<meta name="copyright" content="B3log" />
<meta http-equiv="Window-target" content="_top" />
<meta http-equiv="Window-target" content="_top" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/skins/${skinDirName}/css/base${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/skins/${skinDirName}/css/base${miniPostfix}.css?${staticResourceVersion}" charset="utf-8" />
<link href="${servePath}/
blog-articles-rss.do
" title="RSS" type="application/rss+xml" rel="alternate" />
<link href="${servePath}/
rss.xml
" title="RSS" type="application/rss+xml" rel="alternate" />
<link rel="icon" type="image/png" href="${servePath}/favicon.png" />
<link rel="icon" type="image/png" href="${servePath}/favicon.png" />
<link rel="manifest" href="${servePath}/manifest.json">
<link rel="manifest" href="${servePath}/manifest.json">
<link rel="search" type="application/opensearchdescription+xml" title="${title}" href="/opensearch.xml">
<link rel="search" type="application/opensearchdescription+xml" title="${title}" href="/opensearch.xml">
...
...
src/test/resources/skins/Medium/nav.ftl
View file @
b93deb7e
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
</svg> ${linkLabel}
</svg> ${linkLabel}
</a>
</a>
<a rel="alternate" href="${servePath}/
blog-articles-rss.do
" rel="section">
<a rel="alternate" href="${servePath}/
rss.xml
" rel="section">
<svg>
<svg>
<use xlink:href="#icon-feed"></use>
<use xlink:href="#icon-feed"></use>
</svg>
</svg>
...
...
src/test/resources/skins/mobile/header.ftl
View file @
b93deb7e
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
<#list pageNavigations as page>
<#list pageNavigations as page>
<li><a href="${page.pagePermalink}" target="${page.pageOpenTarget}"><#if page.pageIcon != ''><img class="page-icon" src="${page.pageIcon}"></#if>${page.pageTitle}</a></li>
<li><a href="${page.pagePermalink}" target="${page.pageOpenTarget}"><#if page.pageIcon != ''><img class="page-icon" src="${page.pageIcon}"></#if>${page.pageTitle}</a></li>
</#list>
</#list>
<li><a rel="alternate" href="${servePath}/
blog-articles-rss.do
"><img src="${staticServePath}/skins/${skinDirName}/images/icon-pool/RSS.png" alt="" />RSS Feed</a></li>
<li><a rel="alternate" href="${servePath}/
rss.xml
"><img src="${staticServePath}/skins/${skinDirName}/images/icon-pool/RSS.png" alt="" />RSS Feed</a></li>
<li><a href="${servePath}/search?keyword=">Search</a></li>
<li><a href="${servePath}/search?keyword=">Search</a></li>
</ul>
</ul>
<ul id="head-tags">
<ul id="head-tags">
...
...
src/test/resources/skins/mobile/macro-head.ftl
View file @
b93deb7e
...
@@ -63,7 +63,7 @@ overflow: hidden;
...
@@ -63,7 +63,7 @@ overflow: hidden;
}
}
</style>
</style>
<link href="${servePath}/
blog-articles-rss.do
" title="RSS" type="application/rss+xml" rel="alternate" />
<link href="${servePath}/
rss.xml
" title="RSS" type="application/rss+xml" rel="alternate" />
<link rel="icon" type="image/png" href="${servePath}/favicon.png" />
<link rel="icon" type="image/png" href="${servePath}/favicon.png" />
<script type='text/javascript' src='${staticServePath}/skins/${skinDirName}/js/l10n${miniPostfix}.js?${staticResourceVersion}'></script>
<script type='text/javascript' src='${staticServePath}/skins/${skinDirName}/js/l10n${miniPostfix}.js?${staticResourceVersion}'></script>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
...
...
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