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
4adc9fc4
Commit
4adc9fc4
authored
Aug 10, 2015
by
Matija Obreza
Browse files
Created Article#summary
parent
1d32e77c
Changes
24
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/listener/sample/CreateContentListener.java
View file @
4adc9fc4
...
...
@@ -85,7 +85,7 @@ public class CreateContentListener extends RunAsAdminListener {
// If nothing is found, parse the resource and create content
if
(
article
==
null
)
{
contentService
.
createGlobalArticle
(
slug
,
locale
,
entry
.
getValue
().
get
(
"title"
).
asText
(),
entry
.
getValue
().
get
(
"body"
).
asText
());
contentService
.
createGlobalArticle
(
slug
,
locale
,
entry
.
getValue
().
get
(
"title"
).
asText
(),
entry
.
getValue
().
get
(
"body"
).
asText
()
,
null
);
_logger
.
info
(
"Created article for slug: "
+
slug
+
" lang="
+
locale
.
getLanguage
());
}
}
...
...
src/main/java/org/genesys2/server/model/impl/Article.java
View file @
4adc9fc4
...
...
@@ -55,6 +55,10 @@ public class Article extends AuditedModel {
@Lob
@Type
(
type
=
"org.hibernate.type.TextType"
)
private
String
title
;
@Lob
@Type
(
type
=
"org.hibernate.type.TextType"
)
private
String
summary
;
@Lob
@Type
(
type
=
"org.hibernate.type.TextType"
)
...
...
@@ -79,6 +83,14 @@ public class Article extends AuditedModel {
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getSummary
()
{
return
summary
;
}
public
void
setSummary
(
String
summary
)
{
this
.
summary
=
summary
;
}
public
String
getBody
()
{
return
body
;
...
...
src/main/java/org/genesys2/server/service/ContentService.java
View file @
4adc9fc4
...
...
@@ -85,15 +85,15 @@ public interface ContentService {
*/
ActivityPost
createActivityPost
(
String
title
,
String
body
);
Article
updateArticle
(
EntityId
entity
,
String
slug
,
String
title
,
String
body
,
Locale
locale
);
Article
updateArticle
(
EntityId
entity
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
);
Article
updateArticle
(
Class
<?>
clazz
,
Long
id
,
String
slug
,
String
title
,
String
body
,
Locale
locale
);
Article
updateArticle
(
Class
<?>
clazz
,
Long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
);
Article
updateArticle
(
long
id
,
String
slug
,
String
title
,
String
body
);
Article
updateArticle
(
long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
);
Article
createGlobalArticle
(
String
slug
,
Locale
locale
,
String
title
,
String
body
);
Article
createGlobalArticle
(
String
slug
,
Locale
locale
,
String
title
,
String
body
,
String
summary
);
Article
updateGlobalArticle
(
String
slug
,
Locale
locale
,
String
title
,
String
body
);
Article
updateGlobalArticle
(
String
slug
,
Locale
locale
,
String
title
,
String
body
,
String
summary
);
ActivityPost
getActivityPost
(
long
id
);
...
...
src/main/java/org/genesys2/server/service/InstituteService.java
View file @
4adc9fc4
...
...
@@ -47,7 +47,7 @@ public interface InstituteService {
void
update
(
Collection
<
FaoInstitute
>
institutes
);
void
update
Blurp
(
FaoInstitute
faoInstitute
,
String
b
lurp
,
Locale
locale
);
void
update
About
(
FaoInstitute
faoInstitute
,
String
b
ody
,
String
summary
,
Locale
locale
);
void
updateCountryRefs
();
...
...
src/main/java/org/genesys2/server/service/OrganizationService.java
View file @
4adc9fc4
...
...
@@ -31,7 +31,7 @@ public interface OrganizationService {
Organization
getOrganization
(
String
slug
);
Article
update
Blurp
(
Organization
organization
,
String
b
lurp
,
Locale
locale
);
Article
update
About
(
Organization
organization
,
String
b
ody
,
String
summary
,
Locale
locale
);
Organization
update
(
long
id
,
String
newSlug
,
String
title
);
...
...
src/main/java/org/genesys2/server/service/impl/ContentServiceImpl.java
View file @
4adc9fc4
...
...
@@ -70,7 +70,8 @@ public class ContentServiceImpl implements ContentService {
@Override
public
Locale
getDefaultLocale
()
{
// TODO FIXME We should use a configurable default locale for content service
// TODO FIXME We should use a configurable default locale for content
// service
return
Locale
.
getDefault
();
}
...
...
@@ -86,14 +87,14 @@ public class ContentServiceImpl implements ContentService {
return
articleRepository
.
findAll
(
pageable
);
}
@Override
public
Page
<
Article
>
listArticlesByLang
(
String
lang
,
Pageable
pageable
)
{
return
articleRepository
.
getAllByLang
(
lang
,
pageable
);
}
@Override
public
Page
<
Article
>
listArticlesByLang
(
String
lang
,
Pageable
pageable
)
{
return
articleRepository
.
getAllByLang
(
lang
,
pageable
);
}
@Override
@Override
@Transactional
(
readOnly
=
false
)
//
@PreAuthorize("hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER')")
//
@PreAuthorize("hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER')")
@CacheEvict
(
value
=
"contentcache"
,
allEntries
=
true
)
public
void
save
(
Iterable
<
Article
>
articles
)
{
articleRepository
.
save
(
articles
);
...
...
@@ -120,12 +121,12 @@ public class ContentServiceImpl implements ContentService {
return
getArticle
(
entity
.
getClass
(),
entity
.
getId
(),
slug
,
locale
,
true
);
}
@Override
public
Article
getArticleBySlugAndLang
(
String
slug
,
String
lang
)
{
return
articleRepository
.
findBySlugAndLang
(
slug
,
lang
);
}
@Override
public
Article
getArticleBySlugAndLang
(
String
slug
,
String
lang
)
{
return
articleRepository
.
findBySlugAndLang
(
slug
,
lang
);
}
@Override
@Override
@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
());
...
...
@@ -139,11 +140,12 @@ 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
)
{
public
Article
updateArticle
(
long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
)
{
final
Article
article
=
articleRepository
.
findOne
(
id
);
article
.
setSlug
(
slug
);
article
.
setTitle
(
htmlSanitizer
.
sanitize
(
title
));
article
.
setSummary
(
htmlSanitizer
.
sanitize
(
summary
));
// FIXME TODO Find a better way to distinguish between Velocity
// templates and general articles
...
...
@@ -161,7 +163,7 @@ public class ContentServiceImpl implements ContentService {
@Transactional
(
readOnly
=
false
)
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER')"
)
@CacheEvict
(
value
=
"contentcache"
,
allEntries
=
true
)
public
Article
createGlobalArticle
(
String
slug
,
Locale
locale
,
String
title
,
String
body
)
{
public
Article
createGlobalArticle
(
String
slug
,
Locale
locale
,
String
title
,
String
body
,
String
summary
)
{
Article
article
=
getGlobalArticle
(
slug
,
locale
,
false
);
if
(
article
!=
null
)
{
throw
new
RuntimeException
(
"Article exists"
);
...
...
@@ -172,19 +174,19 @@ public class ContentServiceImpl implements ContentService {
article
.
setLang
(
locale
.
getLanguage
());
article
.
setSlug
(
slug
);
article
.
setTitle
(
htmlSanitizer
.
sanitize
(
title
));
article
.
setSummary
(
htmlSanitizer
.
sanitize
(
summary
));
article
.
setBody
(
htmlSanitizer
.
sanitize
(
body
));
article
.
setPostDate
(
Calendar
.
getInstance
());
articleRepository
.
save
(
article
);
return
article
;
}
@Override
@Transactional
(
readOnly
=
false
)
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER')"
)
@CacheEvict
(
value
=
"contentcache"
,
allEntries
=
true
)
public
Article
updateGlobalArticle
(
String
slug
,
Locale
locale
,
String
title
,
String
body
)
{
public
Article
updateGlobalArticle
(
String
slug
,
Locale
locale
,
String
title
,
String
body
,
String
summary
)
{
Article
article
=
getGlobalArticle
(
slug
,
locale
,
false
);
if
(
article
==
null
)
{
throw
new
RuntimeException
(
"Article does not exist"
);
...
...
@@ -194,6 +196,7 @@ public class ContentServiceImpl implements ContentService {
article
.
setLang
(
locale
.
getLanguage
());
article
.
setSlug
(
slug
);
article
.
setTitle
(
htmlSanitizer
.
sanitize
(
title
));
article
.
setSummary
(
htmlSanitizer
.
sanitize
(
summary
));
article
.
setBody
(
htmlSanitizer
.
sanitize
(
body
));
article
.
setPostDate
(
Calendar
.
getInstance
());
...
...
@@ -213,18 +216,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
,
Locale
locale
)
{
public
Article
updateArticle
(
EntityId
entity
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
)
{
// return
// articleRepository.findByClassPkAndTargetIdAndSlugAndLang(getClassPk(clazz),
// id, slug, locale.getLanguage());
return
updateArticle
(
entity
.
getClass
(),
entity
.
getId
(),
slug
,
title
,
body
,
locale
);
return
updateArticle
(
entity
.
getClass
(),
entity
.
getId
(),
slug
,
title
,
body
,
summary
,
locale
);
}
@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
,
Locale
locale
)
{
public
Article
updateArticle
(
Class
<?>
clazz
,
Long
id
,
String
slug
,
String
title
,
String
body
,
String
summary
,
Locale
locale
)
{
Article
article
=
getArticle
(
clazz
,
id
,
slug
,
locale
,
false
);
if
(
article
==
null
||
!
article
.
getLang
().
equals
(
locale
.
getLanguage
()))
{
article
=
new
Article
();
...
...
@@ -235,6 +238,7 @@ public class ContentServiceImpl implements ContentService {
article
.
setSlug
(
slug
);
}
article
.
setBody
(
htmlSanitizer
.
sanitize
(
body
));
article
.
setSummary
(
htmlSanitizer
.
sanitize
(
summary
));
article
.
setTitle
(
htmlSanitizer
.
sanitize
(
title
));
articleRepository
.
save
(
article
);
...
...
src/main/java/org/genesys2/server/service/impl/GeoServiceImpl.java
View file @
4adc9fc4
...
...
@@ -347,7 +347,8 @@ public class GeoServiceImpl implements GeoService {
@PreAuthorize
(
"hasRole('ADMINISTRATOR')"
)
@Transactional
(
readOnly
=
false
)
public
void
updateBlurp
(
Country
country
,
String
blurp
,
Locale
locale
)
{
contentService
.
updateArticle
(
country
,
"blurp"
,
null
,
blurp
,
locale
);
// TODO Should we provide summary?
contentService
.
updateArticle
(
country
,
"blurp"
,
null
,
blurp
,
null
,
locale
);
}
@Override
...
...
src/main/java/org/genesys2/server/service/impl/InstituteServiceImpl.java
View file @
4adc9fc4
...
...
@@ -139,8 +139,8 @@ public class InstituteServiceImpl implements InstituteService {
@Override
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'ADMINISTRATION')"
)
@Transactional
(
readOnly
=
false
)
public
void
update
Blurp
(
FaoInstitute
faoInstitute
,
String
b
lurp
,
Locale
locale
)
{
contentService
.
updateArticle
(
faoInstitute
,
"blurp"
,
null
,
b
lurp
,
locale
);
public
void
update
About
(
FaoInstitute
faoInstitute
,
String
b
ody
,
String
summary
,
Locale
locale
)
{
contentService
.
updateArticle
(
faoInstitute
,
"blurp"
,
null
,
b
ody
,
summary
,
locale
);
}
@Override
...
...
src/main/java/org/genesys2/server/service/impl/OrganizationServiceImpl.java
View file @
4adc9fc4
...
...
@@ -85,8 +85,8 @@ public class OrganizationServiceImpl implements OrganizationService {
@Override
@PreAuthorize
(
"hasRole('ADMINISTRATOR')"
)
@Transactional
(
readOnly
=
false
)
public
Article
update
Blurp
(
Organization
organization
,
String
b
lurp
,
Locale
locale
)
{
return
contentService
.
updateArticle
(
organization
,
"blurp"
,
null
,
b
lurp
,
locale
);
public
Article
update
About
(
Organization
organization
,
String
b
ody
,
String
summary
,
Locale
locale
)
{
return
contentService
.
updateArticle
(
organization
,
"blurp"
,
null
,
b
ody
,
summary
,
locale
);
}
@Override
...
...
src/main/java/org/genesys2/server/servlet/controller/ArticleController.java
View file @
4adc9fc4
...
...
@@ -231,9 +231,9 @@ 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
(
"title"
)
String
title
,
@RequestParam
(
"body"
)
String
body
,
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
)
{
contentService
.
createGlobalArticle
(
slug
,
new
Locale
(
language
),
title
,
body
);
contentService
.
createGlobalArticle
(
slug
,
new
Locale
(
language
),
title
,
body
,
summary
);
return
redirectAfterSave
(
slug
,
language
);
}
...
...
@@ -249,27 +249,27 @@ public class ArticleController extends BaseController {
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER')"
)
@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
(
"slug"
)
String
slug
,
@RequestParam
(
"title"
)
String
title
,
@RequestParam
(
"body"
)
String
body
,
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
)
{
Article
article
=
contentService
.
updateArticle
(
id
,
slug
,
title
,
body
);
Article
article
=
contentService
.
updateArticle
(
id
,
slug
,
title
,
body
,
summary
);
return
redirectAfterSave
(
slug
,
article
.
getLang
());
}
@RequestMapping
(
value
=
"/blurp/update-blurp"
,
method
=
{
RequestMethod
.
POST
})
public
String
updateBlurp
(
ModelMap
model
,
@RequestParam
(
"id"
)
long
id
,
@RequestParam
(
required
=
false
,
value
=
"title"
)
String
title
,
@RequestParam
(
"body"
)
String
body
)
{
@RequestParam
(
"body"
)
String
body
,
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
)
{
contentService
.
updateArticle
(
id
,
null
,
title
,
body
);
contentService
.
updateArticle
(
id
,
null
,
title
,
body
,
summary
);
return
"redirect:/"
;
}
@RequestMapping
(
value
=
"/blurp/create-blurp"
,
method
=
{
RequestMethod
.
POST
})
public
String
createBlurp
(
ModelMap
model
,
@RequestParam
(
"clazz"
)
String
clazz
,
@RequestParam
(
"entityId"
)
long
entityId
,
@RequestParam
(
required
=
false
,
value
=
"title"
)
String
title
,
@RequestParam
(
"body"
)
String
body
)
throws
ClassNotFoundException
{
@RequestParam
(
required
=
false
,
value
=
"title"
)
String
title
,
@RequestParam
(
"body"
)
String
body
,
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
)
throws
ClassNotFoundException
{
contentService
.
updateArticle
(
Class
.
forName
(
clazz
),
entityId
,
"blurp"
,
title
,
body
,
getLocale
());
contentService
.
updateArticle
(
Class
.
forName
(
clazz
),
entityId
,
"blurp"
,
title
,
body
,
summary
,
getLocale
());
return
"redirect:/"
;
}
}
src/main/java/org/genesys2/server/servlet/controller/OrganizationController.java
View file @
4adc9fc4
...
...
@@ -141,7 +141,7 @@ public class OrganizationController extends BaseController {
@PreAuthorize
(
"hasRole('ADMINISTRATOR')"
)
@RequestMapping
(
value
=
"/{slug}/update"
)
public
String
update
(
ModelMap
model
,
@PathVariable
(
value
=
"slug"
)
String
slug
,
@RequestParam
(
value
=
"slug"
)
String
newSlug
,
@RequestParam
(
"title"
)
String
title
,
@RequestParam
(
"blurp"
)
String
blurp
)
{
@RequestParam
(
"title"
)
String
title
,
@RequestParam
(
"blurp"
)
String
blurp
,
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
)
{
_logger
.
debug
(
"Updating organization "
+
slug
);
Organization
organization
=
organizationService
.
getOrganization
(
slug
);
...
...
@@ -152,7 +152,7 @@ public class OrganizationController extends BaseController {
organization
=
organizationService
.
update
(
organization
.
getId
(),
newSlug
,
title
);
}
organizationService
.
update
Blurp
(
organization
,
blurp
,
getLocale
());
organizationService
.
update
About
(
organization
,
blurp
,
summary
,
getLocale
());
return
"redirect:/org/"
+
organization
.
getSlug
();
}
...
...
src/main/java/org/genesys2/server/servlet/controller/WiewsController.java
View file @
4adc9fc4
...
...
@@ -195,17 +195,19 @@ public class WiewsController extends BaseController {
}
@RequestMapping
(
"/{wiewsCode}/update"
)
public
String
update
(
ModelMap
model
,
@PathVariable
(
value
=
"wiewsCode"
)
String
wiewsCode
,
@RequestParam
(
"blurp"
)
String
blurp
,
@RequestParam
(
"gaTracker"
)
String
gaTracker
,
@RequestParam
(
"mailto"
)
String
mailto
,
@RequestParam
(
"uniqueAcceNumbs"
)
boolean
uniqueAcceNumbs
,
public
String
update
(
ModelMap
model
,
@PathVariable
(
value
=
"wiewsCode"
)
String
wiewsCode
,
@RequestParam
(
"blurp"
)
String
aboutBody
,
@RequestParam
(
value
=
"summary"
,
required
=
false
)
String
summary
,
@RequestParam
(
"gaTracker"
)
String
gaTracker
,
@RequestParam
(
"mailto"
)
String
mailto
,
@RequestParam
(
"uniqueAcceNumbs"
)
boolean
uniqueAcceNumbs
,
@RequestParam
(
value
=
"allowMaterialRequests"
,
required
=
false
,
defaultValue
=
"false"
)
boolean
allowMaterialRequests
,
@RequestParam
(
"codeSVGS"
)
String
codeSVGS
)
{
_logger
.
debug
(
"Updating institite "
+
wiewsCode
);
final
FaoInstitute
faoInstitute
=
instituteService
.
getInstitute
(
wiewsCode
);
if
(
faoInstitute
==
null
)
{
throw
new
ResourceNotFoundException
();
}
instituteService
.
update
Blurp
(
faoInstitute
,
blurp
,
getLocale
());
instituteService
.
update
About
(
faoInstitute
,
aboutBody
,
summary
,
getLocale
());
final
Map
<
String
,
String
>
settings
=
new
HashMap
<
String
,
String
>();
settings
.
put
(
"googleAnalytics.tracker"
,
gaTracker
);
settings
.
put
(
"requests.mailto"
,
mailto
);
...
...
src/main/java/org/genesys2/server/servlet/controller/rest/OrganizationController.java
View file @
4adc9fc4
...
...
@@ -16,9 +16,17 @@
package
org.genesys2.server.servlet.controller.rest
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
java.io.IOException
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Set
;
import
javax.xml.bind.ValidationException
;
import
net.sf.oval.ConstraintViolation
;
import
net.sf.oval.Validator
;
import
org.genesys2.server.exception.AuthorizationException
;
import
org.genesys2.server.model.impl.Article
;
import
org.genesys2.server.model.impl.FaoInstitute
;
...
...
@@ -31,14 +39,14 @@ import org.springframework.data.domain.PageRequest;
import
org.springframework.http.MediaType
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.xml.bind.ValidationException
;
import
java.io.IOException
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Set
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
@Controller
(
"restOrganizationController"
)
@PreAuthorize
(
"isAuthenticated()"
)
...
...
@@ -124,7 +132,7 @@ public class OrganizationController extends RestController {
public
@ResponseBody
Article
updateBlurp
(
@PathVariable
(
"shortName"
)
String
shortName
,
@RequestBody
OrganizationBlurpJson
blurp
)
throws
AuthorizationException
{
Organization
org
=
organizationService
.
getOrganization
(
shortName
);
return
organizationService
.
update
Blurp
(
org
,
blurp
.
blurp
,
blurp
.
getLocale
());
return
organizationService
.
update
About
(
org
,
blurp
.
blurp
,
blurp
.
summary
,
blurp
.
getLocale
());
}
/**
...
...
@@ -196,6 +204,7 @@ public class OrganizationController extends RestController {
}
public
static
class
OrganizationBlurpJson
{
public
String
summary
;
public
String
blurp
;
public
String
locale
;
...
...
src/main/resources/content/language.properties
View file @
4adc9fc4
...
...
@@ -158,6 +158,7 @@ faoInstitute.code=WIEWS Code
faoInstitute.email
=
Contact email
faoInstitute.acronym
=
Acronym
faoInstitute.url
=
Web link
faoInstitute.summary
=
Summary (HTML metadata)
faoInstitute.member-of-organizations-and-networks
=
Organizations and Networks:
faoInstitute.uniqueAcceNumbs.true
=
Each accession number is unique within this institute.
faoInstitute.uniqueAcceNumbs.false
=
The same accession number may be used in separate collections in this institute.
...
...
@@ -403,6 +404,7 @@ organization.page.list.title=Organizations and Networks
organization.page.profile.title
=
{0}
organization.slug
=
Organization or Network acronym
organization.title
=
Full name
organization.summary
=
Summary (HTML metadata)
filter.institute.networks
=
Network
...
...
@@ -414,6 +416,7 @@ article.edit-article=Editing article
article.slug
=
Article slug (URL)
article.title
=
Article title
article.body
=
Article body
article.summary
=
Summary (HTML metadata)
article.post-to-transifex
=
Post to Transifex
article.remove-from-transifex
=
Remove from Transifex
article.transifex-resource-updated
=
The resource was successfully updated on Transifex.
...
...
src/main/resources/spring/spring.properties
View file @
4adc9fc4
...
...
@@ -29,7 +29,7 @@ db.driverClassName=com.mysql.jdbc.Driver
db.username
=
root
db.password
=
db.showSql
=
false
db.hbm2ddl
=
fals
e
db.hbm2ddl
=
tru
e
hibernate.dialect
=
org.hibernate.dialect.MySQL5InnoDBDialect
c3p0.acquireIncrement
=
1
...
...
src/main/webapp/WEB-INF/jsp/content/article-edit.jsp
View file @
4adc9fc4
...
...
@@ -66,7 +66,14 @@
<textarea
id=
"article-body"
name=
"body"
class=
"span9 required form-control html-editor"
><c:out
value=
"
${
article
.
body
}
"
escapeXml=
"false"
/></textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"article-summary"
class=
"control-label"
><spring:message
code=
"article.summary"
/></label>
<div
class=
"controls"
>
<textarea
id=
"article-summary"
name=
"summary"
class=
"span9 required form-control html-editor"
><c:out
value=
"
${
article
.
summary
}
"
escapeXml=
"false"
/></textarea>
</div>
</div>
<input
type=
"submit"
value=
"
<spring:message
code=
"save"
/>
"
class=
"btn btn-primary"
/>
...
...
src/main/webapp/WEB-INF/jsp/content/article.jsp
View file @
4adc9fc4
...
...
@@ -5,6 +5,7 @@
<html>
<head>
<title>
${title}
</title>
<meta
name=
"description"
content=
"
<c:out
value=
"
${
jspHelper
.
htmlToText
(
article
.
summary
)
}
"
/>
"
/>
</head>
<body>
<content
tag=
"header"
>
...
...
src/main/webapp/WEB-INF/jsp/organization/details.jsp
View file @
4adc9fc4
...
...
@@ -5,8 +5,9 @@
<html>
<head>
<title><spring:message
code=
"organization.page.profile.title"
arguments=
"
${
organization
.
slug
}
"
argumentSeparator=
"|"
/></title>
argumentSeparator=
"|"
/></title>
<meta
name=
"description"
content=
"
<c:out
value=
"
${
jspHelper
.
htmlToText
(
blurp
.
summary
)
}
"
/>
"
/>
<meta
name=
"keywords"
content=
"${organization.slug}, ${organization.title}"
/>
</head>
<body>
<h1>
...
...
src/main/webapp/WEB-INF/jsp/organization/edit.jsp
View file @
4adc9fc4
...
...
@@ -35,6 +35,15 @@
</textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"organization-summary"
class=
"control-label"
><spring:message
code=
"organization.summary"
/></label>
<div
class=
"controls"
>
<textarea
id=
"organization-summary"
name=
"summary"
class=
"span9 required html-editor"
>
<c:out
value=
"
${
blurp
.
summary
}
"
/>
</textarea>
</div>
</div>
<input
type=
"submit"
value=
"
<spring:message
code=
"blurp.update-blurp"
/>
"
class=
"btn btn-primary"
/>
<a
href=
"
<c:url
value=
"/org/${organization.slug}"
/>
"
class=
"btn btn-default"
>
<spring:message
code=
"cancel"
/>
...
...
src/main/webapp/WEB-INF/jsp/wiews/details.jsp
View file @
4adc9fc4
...
...
@@ -7,8 +7,8 @@
<title><c:out
value=
"
${
faoInstitute
.
fullName
}
"
/><c:if
test=
"
${
faoInstitute
.
acronym
!=
''
}
"
>
| ${faoInstitute.acronym}
</c:if>
|
<c:out
value=
"
${
faoInstitute
.
code
}
"
/></title>
<meta
name=
"description"
content=
"
<spring:message
code=
"faoInstitute.meta-description"
arguments=
"
${
faoInstitute
.
fullName
}
|${faoInstitute.acronym}"
argumentSeparator=
"|"
/>
"
/>
content=
"
<spring:message
code=
"faoInstitute.meta-description"
arguments=
"
${
faoInstitute
.
fullName
}
|${faoInstitute.acronym}"
argumentSeparator=
"|"
/>
<c:out
value=
"
${
jspHelper
.
htmlToText
(
blurp
.
summary
)
}
"
/>
"
/>
<meta
name=
"keywords"
content=
"${faoInstitute.acronym}, ${faoInstitute.fullName}, ${faoInstitute.code}"
/>
</head>
<body
typeof=
"schema:Organization"
>
...
...
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