Skip to content
GitLab
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
8b48d5ea
Commit
8b48d5ea
authored
Oct 02, 2017
by
Andrey Lugovskiy
Committed by
Matija Obreza
Oct 06, 2017
Browse files
Article#template are not indexed in ES
- added template to Article
parent
decc3ef4
Changes
28
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/model/elastic/FullTextDocument.java
View file @
8b48d5ea
...
...
@@ -53,9 +53,20 @@ public class FullTextDocument {
@Field
(
index
=
FieldIndex
.
not_analyzed
,
type
=
FieldType
.
Date
)
private
Date
lastModifiedDate
;
@Field
(
type
=
FieldType
.
Boolean
)
private
Boolean
template
;
/** The score here will boost result relevance */
private
Float
score
=
0.5f
;
public
Boolean
getTemplate
()
{
return
template
;
}
public
void
setTemplate
(
Boolean
template
)
{
this
.
template
=
template
;
}
public
Long
getId
()
{
return
this
.
id
;
}
...
...
src/main/java/org/genesys2/server/model/impl/Article.java
View file @
8b48d5ea
...
...
@@ -69,6 +69,17 @@ public class Article extends AuditedModel {
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
postDate
;
@Column
(
nullable
=
false
,
columnDefinition
=
"boolean default false"
)
private
boolean
template
;
public
boolean
isTemplate
()
{
return
template
;
}
public
void
setTemplate
(
boolean
template
)
{
this
.
template
=
template
;
}
public
String
getSlug
()
{
return
slug
;
}
...
...
src/main/java/org/genesys2/server/persistence/domain/ArticleRepository.java
View file @
8b48d5ea
...
...
@@ -24,6 +24,8 @@ import org.springframework.data.jpa.repository.JpaRepository;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.query.Param
;
import
java.util.List
;
public
interface
ArticleRepository
extends
JpaRepository
<
Article
,
Long
>
{
Article
findByClassPkAndTargetIdAndSlugAndLang
(
ClassPK
classPk
,
Long
id
,
String
slug
,
String
lang
);
...
...
@@ -37,4 +39,6 @@ public interface ArticleRepository extends JpaRepository<Article, Long> {
Article
findBySlugAndLangAndTargetIdAndClassPk
(
String
slug
,
String
lang
,
Long
targetId
,
ClassPK
classPK
);
@Query
(
"select a from Article a where a.template = :isTemplate"
)
List
<
Article
>
findAllByTemplate
(
@Param
(
"isTemplate"
)
Boolean
isTemplate
);
}
src/main/java/org/genesys2/server/service/ContentService.java
View file @
8b48d5ea
...
...
@@ -46,7 +46,6 @@ public interface ContentService {
* Load article with {@link ClassPK} of clazz with specified id and the
* "slug" for the locale
*
* @param target
* @param slug
* @param locale
* @return
...
...
@@ -95,11 +94,11 @@ public interface ContentService {
*/
ActivityPost
createActivityPost
(
String
title
,
String
body
);
Article
updateArticle
(
EntityId
entity
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
);
Article
updateArticle
(
EntityId
entity
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
,
Boolean
isTemplate
);
Article
updateArticle
(
Class
<?>
clazz
,
Long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
);
Article
updateArticle
(
Class
<?>
clazz
,
Long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
,
Boolean
isTemplate
);
Article
updateArticle
(
long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
);
Article
updateArticle
(
long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Boolean
isTemplate
);
Article
updateGlobalArticle
(
String
slug
,
Locale
locale
,
String
title
,
String
body
,
String
summary
);
...
...
src/main/java/org/genesys2/server/service/impl/ContentServiceImpl.java
View file @
8b48d5ea
...
...
@@ -165,16 +165,15 @@ public class ContentServiceImpl implements ContentService {
@Transactional
(
readOnly
=
false
)
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER')"
)
@CacheEvict
(
value
=
"contentcache"
,
allEntries
=
true
)
public
Article
updateArticle
(
long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
)
{
public
Article
updateArticle
(
long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Boolean
isTemplate
)
{
final
Article
article
=
articleRepository
.
findOne
(
id
);
article
.
setSlug
(
slug
);
article
.
setTitle
(
htmlSanitizer
.
sanitize
(
title
));
article
.
setSummary
(
htmlSanitizer
.
sanitize
(
summary
));
article
.
setTemplate
(
isTemplate
);
// FIXME TODO Find a better way to distinguish between Velocity
// templates and general articles
if
(
StringUtils
.
contains
(
body
,
"VELOCITY"
))
{
if
(
isTemplate
)
{
article
.
setBody
(
body
);
}
else
{
article
.
setBody
(
htmlSanitizer
.
sanitize
(
body
));
...
...
@@ -218,18 +217,18 @@ public class ContentServiceImpl implements ContentService {
@Transactional
(
readOnly
=
false
)
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER') or hasPermission(#entity, 'ADMINISTRATION')"
)
@CacheEvict
(
value
=
"contentcache"
,
allEntries
=
true
)
public
Article
updateArticle
(
EntityId
entity
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
)
{
public
Article
updateArticle
(
EntityId
entity
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
,
Boolean
isTemplate
)
{
// return
// articleRepository.findByClassPkAndTargetIdAndSlugAndLang(getClassPk(clazz),
// id, slug, locale.getLanguage());
return
updateArticle
(
entity
.
getClass
(),
entity
.
getId
(),
slug
,
title
,
body
,
summary
,
locale
);
return
updateArticle
(
entity
.
getClass
(),
entity
.
getId
(),
slug
,
title
,
body
,
summary
,
locale
,
isTemplate
);
}
@Override
@Transactional
(
readOnly
=
false
)
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER')"
)
@CacheEvict
(
value
=
"contentcache"
,
allEntries
=
true
)
public
Article
updateArticle
(
Class
<?>
clazz
,
Long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
)
{
public
Article
updateArticle
(
Class
<?>
clazz
,
Long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
,
Boolean
isTemplate
)
{
Article
article
=
getArticle
(
clazz
,
id
,
slug
,
locale
,
false
);
if
(
article
==
null
||
!
article
.
getLang
().
equals
(
locale
.
getLanguage
()))
{
article
=
new
Article
();
...
...
@@ -239,7 +238,11 @@ public class ContentServiceImpl implements ContentService {
article
.
setPostDate
(
Calendar
.
getInstance
());
article
.
setSlug
(
slug
);
}
article
.
setBody
(
htmlSanitizer
.
sanitize
(
body
));
if
(
isTemplate
)
{
article
.
setBody
(
body
);
}
else
{
article
.
setBody
(
htmlSanitizer
.
sanitize
(
body
));
}
article
.
setSummary
(
htmlSanitizer
.
sanitize
(
summary
));
article
.
setTitle
(
htmlSanitizer
.
sanitize
(
title
));
...
...
src/main/java/org/genesys2/server/service/impl/CropServiceImpl.java
View file @
8b48d5ea
...
...
@@ -113,7 +113,8 @@ public class CropServiceImpl implements CropService {
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER') or hasPermission(#crop, 'ADMINISTRATION')"
)
@Transactional
(
readOnly
=
false
)
public
void
updateBlurp
(
Crop
crop
,
String
textBody
,
String
summary
,
Locale
locale
)
{
contentService
.
updateArticle
(
crop
,
"blurp"
,
null
,
textBody
,
summary
,
locale
);
//isTemplate = false because it's crop
contentService
.
updateArticle
(
crop
,
"blurp"
,
null
,
textBody
,
summary
,
locale
,
false
);
}
@Override
...
...
src/main/java/org/genesys2/server/service/impl/EasySMTAMockConnector.java
View file @
8b48d5ea
...
...
@@ -24,7 +24,7 @@ import org.genesys2.server.service.EasySMTA;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.stereotype.Component
;
@Profile
({
"dev"
})
//
@Profile({ "dev" })
@Component
public
class
EasySMTAMockConnector
implements
EasySMTA
{
private
static
final
Log
LOG
=
LogFactory
.
getLog
(
EasySMTAMockConnector
.
class
);
...
...
src/main/java/org/genesys2/server/service/impl/FullTextSearchServiceImpl.java
View file @
8b48d5ea
...
...
@@ -66,6 +66,7 @@ public class FullTextSearchServiceImpl implements FullTextSearchService, Initial
private
static
final
String
ACCESSION_SECTION
=
"accession"
;
private
static
final
String
CLASSPK_SHORTNAME
=
"classPK.shortName"
;
private
static
final
Boolean
DEFAULT_ARTICLE_TEMPLATE
=
false
;
@Autowired
private
ElasticsearchTemplate
elasticsearchTemplate
;
...
...
@@ -141,12 +142,11 @@ public class FullTextSearchServiceImpl implements FullTextSearchService, Initial
SearchQuery
searchQuery
=
new
NativeSearchQueryBuilder
()
.
withIndices
(
IndexAliasConstants
.
INDEXALIAS_FULLTEXT_READ
)
.
withQuery
(
functionScoreQuery
(
boolQuery
().
must
(
matchQuery
(
CLASSPK_SHORTNAME
,
classPK
.
getShortName
())).
must
(
queryStringQuery
(
query
).
defaultOperator
(
QueryStringQueryBuilder
.
Operator
.
AND
))).
add
(
fieldValueFactorFunction
(
"score"
).
factor
(
1.0f
))).
withPageable
(
pageable
).
build
();
.
withQuery
(
functionScoreQuery
(
boolQuery
()
.
must
(
matchQuery
(
CLASSPK_SHORTNAME
,
classPK
.
getShortName
()))
.
must
(
queryStringQuery
(
query
).
defaultOperator
(
QueryStringQueryBuilder
.
Operator
.
AND
)))
.
add
(
fieldValueFactorFunction
(
"score"
).
factor
(
1.0f
)))
.
withPageable
(
pageable
).
build
();
try
{
FacetedPage
<
FullTextDocument
>
fulltextResults
=
this
.
elasticsearchTemplate
.
queryForPage
(
searchQuery
,
FullTextDocument
.
class
);
return
toEntities
(
fulltextResults
,
pageable
);
...
...
@@ -211,9 +211,7 @@ public class FullTextSearchServiceImpl implements FullTextSearchService, Initial
public
List
<
FullTextDocument
>
getFullTextDocuments
(
final
String
className
,
final
Collection
<
Long
>
ids
)
{
final
List
<
BasicModel
>
models
=
new
ArrayList
<>(
ids
.
size
());
// TODO Only include global articles, exclude "blurbs"
models
.
addAll
(
this
.
articleRepository
.
findAll
(
ids
));
models
.
addAll
(
this
.
articleRepository
.
findAllByTemplate
(
DEFAULT_ARTICLE_TEMPLATE
));
// Posts are only in "en"
models
.
addAll
(
this
.
postRepository
.
findAll
(
ids
));
models
.
addAll
(
this
.
countryRepository
.
findAll
(
ids
));
...
...
@@ -289,7 +287,7 @@ public class FullTextSearchServiceImpl implements FullTextSearchService, Initial
/**
* TODO FIXME
*
*
* @param model
* @return
*/
...
...
@@ -304,6 +302,7 @@ public class FullTextSearchServiceImpl implements FullTextSearchService, Initial
// countries
final
Article
article
=
(
Article
)
model
;
document
.
setBody
(
article
.
getBody
());
document
.
setTemplate
(
article
.
isTemplate
());
document
.
setSummary
(
article
.
getSummary
());
document
.
setLanguage
(
article
.
getLang
());
document
.
setCreatedDate
(
article
.
getCreatedDate
());
...
...
src/main/java/org/genesys2/server/service/impl/GeoServiceImpl.java
View file @
8b48d5ea
...
...
@@ -154,9 +154,7 @@ public class GeoServiceImpl implements GeoService {
/**
* Check if we have a country that has
*
* @param name
* in i18n
* @param countryString
* @param name in i18n
* @return
*/
private
Country
findCountryByName
(
String
name
)
{
...
...
@@ -363,7 +361,8 @@ public class GeoServiceImpl implements GeoService {
@Transactional
(
readOnly
=
false
)
public
void
updateBlurp
(
Country
country
,
String
blurp
,
Locale
locale
)
{
// TODO Should we provide summary?
contentService
.
updateArticle
(
country
,
"blurp"
,
null
,
blurp
,
null
,
locale
);
//isTemplate = false because it's country.
contentService
.
updateArticle
(
country
,
"blurp"
,
null
,
blurp
,
null
,
locale
,
false
);
}
@Override
...
...
src/main/java/org/genesys2/server/service/impl/InstituteServiceImpl.java
View file @
8b48d5ea
...
...
@@ -139,7 +139,8 @@ public class InstituteServiceImpl implements InstituteService {
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'ADMINISTRATION')"
)
@Transactional
(
readOnly
=
false
)
public
void
updateAbout
(
FaoInstitute
faoInstitute
,
String
body
,
String
summary
,
Locale
locale
)
{
contentService
.
updateArticle
(
faoInstitute
,
"blurp"
,
null
,
body
,
summary
,
locale
);
//isTemplate = false because it's institute.
contentService
.
updateArticle
(
faoInstitute
,
"blurp"
,
null
,
body
,
summary
,
locale
,
false
);
}
@Override
...
...
src/main/java/org/genesys2/server/service/impl/OrganizationServiceImpl.java
View file @
8b48d5ea
...
...
@@ -86,7 +86,8 @@ public class OrganizationServiceImpl implements OrganizationService {
@PreAuthorize
(
"hasRole('ADMINISTRATOR')"
)
@Transactional
(
readOnly
=
false
)
public
Article
updateAbout
(
Organization
organization
,
String
body
,
String
summary
,
Locale
locale
)
{
return
contentService
.
updateArticle
(
organization
,
"blurp"
,
null
,
body
,
summary
,
locale
);
//isTemplate = false because it's organization.
return
contentService
.
updateArticle
(
organization
,
"blurp"
,
null
,
body
,
summary
,
locale
,
false
);
}
@Override
...
...
src/main/java/org/genesys2/server/service/impl/ProjectServiceImpl.java
View file @
8b48d5ea
...
...
@@ -85,6 +85,7 @@ public class ProjectServiceImpl implements ProjectService {
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER') or hasPermission(#project, 'ADMINISTRATION')"
)
@Transactional
public
void
updateBlurp
(
Project
project
,
String
textBody
,
String
summary
,
Locale
locale
)
{
contentService
.
updateArticle
(
project
,
"blurp"
,
null
,
textBody
,
summary
,
locale
);
//isTemplate = false because it's project.
contentService
.
updateArticle
(
project
,
"blurp"
,
null
,
textBody
,
summary
,
locale
,
false
);
}
}
src/main/java/org/genesys2/server/servlet/controller/ArticleController.java
View file @
8b48d5ea
...
...
@@ -25,6 +25,7 @@ import java.util.Set;
import
java.util.TreeMap
;
import
javax.annotation.Resource
;
import
javax.naming.NoPermissionException
;
import
org.apache.commons.lang.StringUtils
;
import
org.genesys.blocks.model.ClassPK
;
...
...
@@ -40,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.security.access.AccessDeniedException
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
...
...
@@ -143,8 +145,6 @@ public class ArticleController extends BaseController {
* Fetch all from Transifex and store
*
* @param slug
* @param language
* @param model
* @return
* @throws Exception
*/
...
...
@@ -152,7 +152,7 @@ public class ArticleController extends BaseController {
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER')"
)
public
String
fetchAllFromTransifex
(
RedirectAttributes
redirectAttrs
,
@RequestParam
(
"slug"
)
String
slug
,
@RequestParam
(
value
=
"targetId"
,
required
=
false
)
Long
targetId
,
@RequestParam
(
value
=
"classPkShortName"
,
required
=
false
)
String
classPkShortName
)
throws
Exception
{
@RequestParam
(
value
=
"classPkShortName"
,
required
=
false
)
String
classPkShortName
,
@RequestParam
(
name
=
"template"
,
defaultValue
=
"false"
)
Boolean
template
)
throws
Exception
{
if
(
transifexService
==
null
)
{
throw
new
ResourceNotFoundException
(
"translationService not enabled"
);
...
...
@@ -211,7 +211,7 @@ public class ArticleController extends BaseController {
if
(
targetId
!=
null
&&
StringUtils
.
isNotBlank
(
classPkShortName
))
{
ClassPK
classPk
=
contentService
.
getClassPk
(
classPkShortName
);
contentService
.
updateArticle
(
Class
.
forName
(
classPk
.
getClassname
()),
targetId
,
slug
,
title
,
body
,
summary
,
new
Locale
(
lang
));
contentService
.
updateArticle
(
Class
.
forName
(
classPk
.
getClassname
()),
targetId
,
slug
,
title
,
body
,
summary
,
new
Locale
(
lang
)
,
template
);
responses
.
add
(
"article.translations-updated"
);
}
else
if
(
targetId
==
null
&&
StringUtils
.
isBlank
(
classPkShortName
))
{
contentService
.
updateGlobalArticle
(
slug
,
locale
,
title
,
body
,
summary
);
...
...
@@ -277,7 +277,7 @@ public class ArticleController extends BaseController {
}
@RequestMapping
(
"{slug:.+}"
)
public
String
view
(
ModelMap
model
,
@PathVariable
(
value
=
"slug"
)
String
slug
)
{
public
String
view
(
ModelMap
model
,
@PathVariable
(
value
=
"slug"
)
String
slug
)
throws
NoPermissionException
{
_logger
.
debug
(
"Viewing article "
+
slug
);
final
Article
article
=
contentService
.
getGlobalArticle
(
slug
,
getLocale
());
...
...
@@ -286,6 +286,10 @@ public class ArticleController extends BaseController {
return
"redirect:/content/edit/"
+
slug
+
"/"
+
LocaleContextHolder
.
getLocale
().
getLanguage
();
}
throw
new
ResourceNotFoundException
();
}
else
{
if
(
article
.
isTemplate
()
&&
!
hasRole
(
"ADMINISTRATOR"
)
&&
!
hasRole
(
"CONTENTMANAGER"
)){
throw
new
AccessDeniedException
(
"You do not have permission to access the resource"
);
}
}
model
.
addAttribute
(
"title"
,
article
.
getTitle
());
model
.
addAttribute
(
"article"
,
article
);
...
...
@@ -294,7 +298,7 @@ public class ArticleController extends BaseController {
}
@RequestMapping
(
"{menu}/{url:.+}"
)
public
String
viewWithMenu
(
ModelMap
model
,
@PathVariable
(
value
=
"menu"
)
String
menuKey
,
@PathVariable
(
value
=
"url"
)
String
slug
)
{
public
String
viewWithMenu
(
ModelMap
model
,
@PathVariable
(
value
=
"menu"
)
String
menuKey
,
@PathVariable
(
value
=
"url"
)
String
slug
)
throws
NoPermissionException
{
String
result
=
view
(
model
,
slug
);
if
(
StringUtils
.
isNotBlank
(
menuKey
))
{
_logger
.
debug
(
"Loading menu "
+
menuKey
);
...
...
@@ -346,7 +350,6 @@ public class ArticleController extends BaseController {
*
* @param model
* @param slug
* @param shortName
* @param targetId
* @param language
* @return
...
...
@@ -364,6 +367,7 @@ public class ArticleController extends BaseController {
article
.
setSlug
(
slug
);
article
.
setLang
(
language
);
article
.
setTargetId
(
targetId
);
article
.
setTemplate
(
article
.
isTemplate
());
article
.
setClassPk
(
contentService
.
getClassPk
(
classPkShortName
));
}
model
.
addAttribute
(
"article"
,
article
);
...
...
@@ -374,7 +378,8 @@ public class ArticleController extends BaseController {
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER')"
)
@RequestMapping
(
value
=
"/save-article/{language}"
,
method
=
{
RequestMethod
.
POST
})
public
String
createNewGlobalArticle
(
ModelMap
model
,
@RequestParam
(
"slug"
)
String
slug
,
@PathVariable
(
"language"
)
String
language
,
@RequestParam
(
"title"
)
String
title
,
@RequestParam
(
"body"
)
String
body
,
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
)
{
@RequestParam
(
"title"
)
String
title
,
@RequestParam
(
"body"
)
String
body
,
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
,
@RequestParam
(
name
=
"template"
,
defaultValue
=
"false"
)
Boolean
template
)
{
Article
article
=
contentService
.
updateGlobalArticle
(
slug
,
new
Locale
(
language
),
title
,
body
,
summary
);
return
redirectAfterSave
(
article
,
language
);
...
...
@@ -384,9 +389,9 @@ public class ArticleController extends BaseController {
@RequestMapping
(
value
=
"/save-article/{language}"
,
params
=
{
"id"
},
method
=
{
RequestMethod
.
POST
})
public
String
saveExistingGlobalArticle
(
ModelMap
model
,
@PathVariable
(
"language"
)
String
language
,
@RequestParam
(
"id"
)
long
id
,
@RequestParam
(
"slug"
)
String
slug
,
@RequestParam
(
"title"
)
String
title
,
@RequestParam
(
"body"
)
String
body
,
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
)
{
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
,
@RequestParam
(
name
=
"template"
,
defaultValue
=
"false"
)
Boolean
template
)
{
Article
article
=
contentService
.
updateArticle
(
id
,
slug
,
title
,
body
,
summary
);
Article
article
=
contentService
.
updateArticle
(
id
,
slug
,
title
,
body
,
summary
,
template
);
return
redirectAfterSave
(
article
,
language
);
}
...
...
@@ -394,10 +399,10 @@ public class ArticleController extends BaseController {
@RequestMapping
(
value
=
"/save-article/{language}"
,
params
=
{
"classPkShortName"
,
"targetId"
},
method
=
{
RequestMethod
.
POST
})
public
String
saveNewClassPkArticle
(
ModelMap
model
,
@PathVariable
(
"language"
)
String
language
,
@RequestParam
(
"classPkShortName"
)
String
classPkShortName
,
@RequestParam
(
"targetId"
)
long
entityId
,
@RequestParam
(
"slug"
)
String
slug
,
@RequestParam
(
"title"
)
String
title
,
@RequestParam
(
"body"
)
String
body
,
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
)
throws
ClassNotFoundException
{
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
,
@RequestParam
(
name
=
"template"
,
defaultValue
=
"false"
)
Boolean
template
)
throws
ClassNotFoundException
{
ClassPK
classPk
=
contentService
.
getClassPk
(
classPkShortName
);
Article
article
=
contentService
.
updateArticle
(
Class
.
forName
(
classPk
.
getClassname
()),
entityId
,
slug
,
title
,
body
,
summary
,
new
Locale
(
language
));
Article
article
=
contentService
.
updateArticle
(
Class
.
forName
(
classPk
.
getClassname
()),
entityId
,
slug
,
title
,
body
,
summary
,
new
Locale
(
language
)
,
template
);
return
redirectAfterSave
(
article
,
language
);
}
...
...
src/main/java/org/genesys2/server/servlet/controller/GeoRegionController.java
View file @
8b48d5ea
...
...
@@ -80,8 +80,8 @@ public class GeoRegionController extends BaseController {
if
(
region
==
null
)
{
throw
new
ResourceNotFoundException
();
}
contentService
.
updateArticle
(
region
,
"blurp"
,
null
,
body
,
summary
,
getLocale
());
//isTemplate = false because it's region.
contentService
.
updateArticle
(
region
,
"blurp"
,
null
,
body
,
summary
,
getLocale
()
,
false
);
return
"redirect:/geo/regions/"
+
code
;
}
...
...
src/main/resources/content/language.properties
View file @
8b48d5ea
...
...
@@ -882,3 +882,4 @@ welcome.search-genesys=Search Genesys
welcome.networks
=
Networks
geo.country
=
Country:
article.is.template
=
Is template:
src/main/resources/content/language_ar.properties
View file @
8b48d5ea
...
...
@@ -858,3 +858,4 @@ welcome.search-genesys=البحث في جينيسيس
welcome.networks
=
الشبكات
geo.country
=
الدولة:
article.is.template
=
هو القالب:
src/main/resources/content/language_de.properties
View file @
8b48d5ea
...
...
@@ -858,3 +858,4 @@ welcome.search-genesys=Genesys durchsuchen
welcome.networks
=
Netzwerke
geo.country
=
Land:
article.is.template
=
Ist Vorlage:
src/main/resources/content/language_es.properties
View file @
8b48d5ea
...
...
@@ -858,3 +858,4 @@ welcome.search-genesys=Buscar en Genesys
welcome.networks
=
Redes
geo.country
=
País:
article.is.template
=
Es plantilla:
src/main/resources/content/language_fa.properties
View file @
8b48d5ea
...
...
@@ -858,3 +858,4 @@ welcome.search-genesys=جستجو در Genesys
welcome.networks
=
شبکهها
geo.country
=
کشور:
article.is.template
=
الگو است:
src/main/resources/content/language_fr.properties
View file @
8b48d5ea
...
...
@@ -858,3 +858,4 @@ welcome.search-genesys=Recherche sur Genesys
welcome.networks
=
Réseaux
geo.country
=
Pays :
article.is.template
=
Est-ce que le modèle:
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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