Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
99269891
Commit
99269891
authored
Jun 12, 2014
by
Matija Obreza
Browse files
Fixed
#25
article edit in selected locale
parent
08bfc37a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/ContentServiceImpl.java
View file @
99269891
...
...
@@ -93,7 +93,7 @@ public class ContentServiceImpl implements ContentService {
}
@Override
@Cacheable
(
value
=
"contentcache"
,
key
=
"'globalarticle-' + #slug + '-' + #locale.language"
)
@Cacheable
(
value
=
"contentcache"
,
key
=
"'globalarticle-' + #slug + '-' + #locale.language
+ '-' + #useDefault
"
)
public
Article
getGlobalArticle
(
String
slug
,
Locale
locale
,
boolean
useDefault
)
{
return
getArticle
(
Article
.
class
,
null
,
slug
,
locale
,
useDefault
);
}
...
...
@@ -114,7 +114,7 @@ public class ContentServiceImpl implements ContentService {
}
@Override
@Cacheable
(
value
=
"contentcache"
,
key
=
"'article-' + #clazz.name + '-' + #id + '-' + #slug + '-' + #locale.language"
)
@Cacheable
(
value
=
"contentcache"
,
key
=
"'article-' + #clazz.name + '-' + #id + '-' + #slug + '-' + #locale.language
+ '-' + #useDefault
"
)
public
Article
getArticle
(
Class
<?>
clazz
,
Long
id
,
String
slug
,
Locale
locale
,
boolean
useDefault
)
{
Article
article
=
articleRepository
.
findByClassPkAndTargetIdAndSlugAndLang
(
getClassPk
(
clazz
),
id
,
slug
,
locale
.
getLanguage
());
if
(
article
==
null
&&
useDefault
&&
!
locale
.
getLanguage
().
equals
(
getDefaultLocale
().
getLanguage
()))
{
...
...
Write
Preview
Supports
Markdown
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