Commit 913f6817 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza

Article slugs without dot

parent a1871820
/**
* Copyright 2014 Global Crop Diversity Trust
/*
* Copyright 2017 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
*/
package org.genesys2.server.service;
......@@ -32,6 +32,35 @@ import org.springframework.data.domain.Pageable;
public interface ContentService {
public final String ABOUT = "about";
public final String WELCOME = "welcome";
public final String COOKIES = "cookies";
public final String SIDE_BLURP = "sideBlurp";
public final String DISCLAIMER = "disclaimer";
public final String REGISTRATION = "registration";
public final String REQUEST_INTRO = "request-intro";
public final String ITPGRFA_ABOUT = "itpgrfa-about";
public final String ACCOUNT_CREATED = "account-created";
public final String DOWNLOAD_AUTHENTICATED = "download-authenticated";
public final String DOWNLOAD_ANONYMOUS = "download-anonymous";
public final String WELCOME_ORGANIZATIONS = "welcome-organizations";
public final String REQUEST_PERSONAL = "request-personal";
public final String REQUEST_RECEIVED = "request-received";
public final String REQUEST_VALIDATE = "request-validate";
public final String REQUEST_VALIDATED = "request-validated";
public final String REQUEST_CONFIRMED = "request-confirmed";
public final String REQUEST_VALIDATE_NO_PID = "request-validate-no-pid";
public final String REQUEST_CONFIRM_RECEIPT = "request-confirm-receipt";
public final String SMTP_EMAIL_NEW_PASSWORD = "smtp-email-new-password";
public final String SMTP_EMAIL_PASSWORD = "smtp-email-password";
public final String SMTP_EMAIL_VERIFICATION = "smtp-email-verification";
public final String SMTP_MATERIAL_REQUEST = "smtp-material-request";
public final String SMTP_MATERIAL_CONFIRM = "smtp-material-confirm";
public final String SMTP_MATERIAL_CONFIRM_NO_PID = "smtp-material-confirm-no-pid";
public final String USER_PASSWORD_RESET = "user-password-reset";
public final String USER_PASSWORD_RESET_EMAIL_SENT = "user-password-reset-email-sent";
public final String USER_RESET_PASSWORD_INSTRUCTIONS = "user-reset-password-instructions";
List<ActivityPost> lastNews();
Page<ActivityPost> allNews(int page);
......@@ -82,7 +111,7 @@ public interface ContentService {
Page<Article> listArticlesByLang(String lang, Pageable pageable);
// void save(Iterable<Article> articles);
// void save(Iterable<Article> articles);
/**
* Create new activity post
......@@ -100,7 +129,7 @@ public interface ContentService {
Article updateArticle(long id, String slug, String title, String body, String summary);
Article createGlobalArticle(String slug, Locale locale, String title, String body, String summary, boolean isTemplate) throws CRMException;
Article updateGlobalArticle(String slug, Locale locale, String title, String body, String summary) throws CRMException;
ActivityPost getActivityPost(long id);
......
......@@ -63,7 +63,7 @@ public class EMailVerificationServiceImpl implements EMailVerificationService {
public void sendVerificationEmail(User user) {
// Generate new token
final VerificationToken verificationToken = tokenVerificationService.generateToken("email-verification", user.getUuid());
final Article article = contentService.getGlobalArticle("smtp.email-verification", Locale.ENGLISH);
final Article article = contentService.getGlobalArticle(ContentService.SMTP_EMAIL_VERIFICATION, Locale.ENGLISH);
if (article != null) {
final String mailSubject = article.getTitle();
......@@ -80,7 +80,7 @@ public class EMailVerificationServiceImpl implements EMailVerificationService {
public void sendPasswordResetEmail(User user) {
// Generate new token
final VerificationToken verificationToken = tokenVerificationService.generateToken("email-password", user.getUuid());
final Article article = contentService.getGlobalArticle("smtp.email-password", Locale.ENGLISH);
final Article article = contentService.getGlobalArticle(ContentService.SMTP_EMAIL_PASSWORD, Locale.ENGLISH);
final String mailSubject = article.getTitle();
final String mailBody = MessageFormat.format(article.getBody(), baseUrl, verificationToken.getUuid(), user.getEmail(), verificationToken.getKey());
......
......@@ -139,9 +139,9 @@ public class RequestServiceImpl implements RequestService {
Article article;
if (StringUtils.isBlank(materialRequest.getPid())) {
LOG.warn("No such user in ITPGRFA system");
article = contentService.getGlobalArticle("smtp.material-confirm-no-pid", Locale.ENGLISH);
article = contentService.getGlobalArticle(ContentService.SMTP_MATERIAL_CONFIRM_NO_PID, Locale.ENGLISH);
} else {
article = contentService.getGlobalArticle("smtp.material-confirm", Locale.ENGLISH);
article = contentService.getGlobalArticle(ContentService.SMTP_MATERIAL_CONFIRM, Locale.ENGLISH);
}
// Generate verification token+key
......@@ -373,7 +373,7 @@ public class RequestServiceImpl implements RequestService {
materialSubRequest.setInstEmail(recipient);
subRequestRepository.save(materialSubRequest);
final Article article = contentService.getGlobalArticle("smtp.material-request", recipientLocale);
final Article article = contentService.getGlobalArticle(ContentService.SMTP_MATERIAL_REQUEST, recipientLocale);
RequestBody rb;
try {
......
......@@ -27,10 +27,10 @@ public class DownloadController extends BaseController {
if (principal instanceof UsernamePasswordAuthenticationToken) {
LOG.info("Showing download screen for authenticated users");
model.addAttribute("info", contentService.getGlobalArticle("download-authenticated", locale));
model.addAttribute("info", contentService.getGlobalArticle(ContentService.DOWNLOAD_AUTHENTICATED, locale));
} else {
LOG.info("Showing download screen for anonymous users");
model.addAttribute("info", contentService.getGlobalArticle("download-anonymous", locale));
model.addAttribute("info", contentService.getGlobalArticle(ContentService.DOWNLOAD_ANONYMOUS, locale));
}
model.addAttribute("path", request.getServletPath().substring("/download".length()));
query.remove("_csrf");
......
......@@ -79,9 +79,9 @@ public class HtmlController extends BaseController {
public String welcome(ModelMap model) {
model.addAttribute("cropList", cropService.list(getLocale()));
model.addAttribute("lastNews", contentService.lastNews());
model.addAttribute("welcomeBlurp", contentService.getGlobalArticle("welcome", getLocale()));
model.addAttribute("sideBlurp", contentService.getGlobalArticle("sideBlurp", getLocale()));
model.addAttribute("organizationsBlurb", contentService.getGlobalArticle("welcome-organizations", getLocale()));
model.addAttribute("welcomeBlurp", contentService.getGlobalArticle(ContentService.WELCOME, getLocale()));
model.addAttribute("sideBlurp", contentService.getGlobalArticle(ContentService.SIDE_BLURP, getLocale()));
model.addAttribute("organizationsBlurb", contentService.getGlobalArticle(ContentService.WELCOME_ORGANIZATIONS, getLocale()));
model.addAttribute("numberOfCountries", statisticsService.numberOfCountries());
model.addAttribute("numberOfInstitutes", statisticsService.numberOfInstitutes());
......
......@@ -50,7 +50,7 @@ public class ITPGRFAController extends BaseController {
@RequestMapping
public String view(ModelMap model, @RequestParam(value = "page", required = false, defaultValue = "1") int page) {
model.addAttribute("blurp", contentService.getGlobalArticle("itpgrfa-about", getLocale()));
model.addAttribute("blurp", contentService.getGlobalArticle(ContentService.ITPGRFA_ABOUT, getLocale()));
model.addAttribute("countries", geoService.listITPGRFA(getLocale()));
return "/itpgrfa/countries";
}
......
......@@ -46,7 +46,7 @@ public class LookAndFeelController extends BaseController {
public String index(ModelMap model) {
model.addAttribute("cropList", cropService.list(getLocale()));
model.addAttribute("lastNews", contentService.lastNews());
model.addAttribute("welcomeBlurp", contentService.getGlobalArticle("about", getLocale()));
model.addAttribute("welcomeBlurp", contentService.getGlobalArticle(ContentService.ABOUT, getLocale()));
model.addAttribute("captchaSiteKey", captchaSiteKey);
return "/lookandfeel";
......
......@@ -82,7 +82,7 @@ public class RequestController extends BaseController {
*/
@RequestMapping
public String view(ModelMap model, @RequestParam(value = "page", required = false, defaultValue = "1") int page) {
model.addAttribute("blurp", contentService.getGlobalArticle("request-intro", getLocale()));
model.addAttribute("blurp", contentService.getGlobalArticle(ContentService.REQUEST_INTRO, getLocale()));
model.addAttribute("totalCount", selectionBean.size());
model.addAttribute("availableCount", genesysService.countAvailableForDistribution(selectionBean.copy()));
......@@ -94,7 +94,7 @@ public class RequestController extends BaseController {
@RequestMapping(method = RequestMethod.POST, value = "/start")
public String start(ModelMap model) {
final User currentUser = SecurityContextUtil.getCurrentUser();
model.addAttribute("blurp", contentService.getGlobalArticle("request-personal", getLocale()));
model.addAttribute("blurp", contentService.getGlobalArticle(ContentService.REQUEST_PERSONAL, getLocale()));
model.addAttribute("captchaSiteKey", captchaSiteKey);
if (!model.containsAttribute("requestEmail") && currentUser != null) {
......@@ -153,7 +153,7 @@ public class RequestController extends BaseController {
}
// Whatever the response is, we render the same message
model.addAttribute("blurp", contentService.getGlobalArticle("request-received", getLocale()));
model.addAttribute("blurp", contentService.getGlobalArticle(ContentService.REQUEST_RECEIVED, getLocale()));
return "/request/received";
}
......@@ -161,7 +161,7 @@ public class RequestController extends BaseController {
public String validateClientRequest(ModelMap model, @PathVariable("tokenUuid") String tokenUuid,
@RequestParam(value = "key", required = false) String key) {
if (!model.containsAttribute("blurp")) {
model.addAttribute("blurp", contentService.getGlobalArticle("request-validate", getLocale()));
model.addAttribute("blurp", contentService.getGlobalArticle(ContentService.REQUEST_VALIDATE, getLocale()));
}
model.addAttribute("tokenUuid", tokenUuid);
model.addAttribute("key", key);
......@@ -177,7 +177,7 @@ public class RequestController extends BaseController {
} catch (final RequestService.NoPidException e) {
LOG.error(e.getMessage());
model.addAttribute("blurp", contentService.getGlobalArticle("request-validate-no-pid", getLocale()));
model.addAttribute("blurp", contentService.getGlobalArticle(ContentService.REQUEST_VALIDATE_NO_PID, getLocale()));
return validateClientRequest(model, tokenUuid, key);
} catch (final RequestException e) {
......@@ -196,7 +196,7 @@ public class RequestController extends BaseController {
return validateClientRequest(model, tokenUuid, null);
}
return "redirect:/content/request-validated";
return "redirect:/content/" + ContentService.REQUEST_VALIDATED;
}
/**
......@@ -209,7 +209,7 @@ public class RequestController extends BaseController {
@RequestMapping(value = "/{tokenUuid:.+}/confirm", method = RequestMethod.GET)
public String confirmReceipt(ModelMap model, @PathVariable("tokenUuid") String tokenUuid, @RequestParam(value = "key", required = false) String key) {
if (!model.containsAttribute("blurp")) {
model.addAttribute("blurp", contentService.getGlobalArticle("request-confirm-receipt", getLocale()));
model.addAttribute("blurp", contentService.getGlobalArticle(ContentService.REQUEST_CONFIRM_RECEIPT, getLocale()));
}
model.addAttribute("tokenUuid", tokenUuid);
......@@ -234,6 +234,6 @@ public class RequestController extends BaseController {
return confirmReceipt(model, tokenUuid, null);
}
return "redirect:/content/request-confirmed";
return "redirect:/content/" + ContentService.REQUEST_CONFIRMED;
}
}
......@@ -181,7 +181,7 @@ public class UserProfileController extends BaseController {
@RequestMapping(value = "/forgot-password")
public String forgotPassword(ModelMap model) {
model.addAttribute("captchaSiteKey", captchaSiteKey);
model.addAttribute("blurp", contentService.getGlobalArticle("user.reset-password-instructions", getLocale()));
model.addAttribute("blurp", contentService.getGlobalArticle(ContentService.USER_RESET_PASSWORD_INSTRUCTIONS, getLocale()));
return "/user/email";
}
......@@ -209,7 +209,7 @@ public class UserProfileController extends BaseController {
emailVerificationService.sendPasswordResetEmail(user);
}
return "redirect:/content/user.password-reset-email-sent";
return "redirect:/content/" + ContentService.USER_PASSWORD_RESET_EMAIL_SENT;
} catch (UsernameNotFoundException e) {
redirectAttributes.addFlashAttribute("error", "errors.no-such-user");
return "redirect:/profile/forgot-password";
......@@ -236,7 +236,7 @@ public class UserProfileController extends BaseController {
try {
emailVerificationService.changePassword(tokenUuid, key, password);
return "redirect:/content/user.password-reset";
return "redirect:/content/" + ContentService.USER_PASSWORD_RESET;
} catch (final NoSuchVerificationTokenException e) {
model.addAttribute("key", key);
model.addAttribute("error", "verification.invalid-key");
......
......@@ -68,7 +68,7 @@ public class UserRegistrationController extends BaseController {
@RequestMapping(value = "/registration", method = RequestMethod.GET)
public String registration(ModelMap model) {
model.addAttribute("captchaSiteKey", captchaSiteKey);
model.addAttribute("blurp", contentService.getGlobalArticle("registration", getLocale()));
model.addAttribute("blurp", contentService.getGlobalArticle(ContentService.REGISTRATION, getLocale()));
model.addAttribute("user", new User());
return "/registration";
......@@ -125,7 +125,7 @@ public class UserRegistrationController extends BaseController {
model.addAttribute("user", user);
model.addAttribute("captchaSiteKey", captchaSiteKey);
model.addAttribute("blurp", contentService.getGlobalArticle("registration", getLocale()));
model.addAttribute("blurp", contentService.getGlobalArticle(ContentService.REGISTRATION, getLocale()));
return "/registration";
}
......
......@@ -24,6 +24,7 @@ import org.genesys.blocks.security.UserException;
import org.genesys.blocks.security.service.PasswordPolicy.PasswordPolicyException;
import org.genesys2.server.model.UserRole;
import org.genesys2.server.model.impl.User;
import org.genesys2.server.service.ContentService;
import org.genesys2.server.service.EMailVerificationService;
import org.genesys2.server.service.TeamService;
import org.genesys2.server.service.TokenVerificationService.NoSuchVerificationTokenException;
......@@ -134,7 +135,7 @@ public class UserProfileController extends BaseController {
emailVerificationService.sendPasswordResetEmail(user);
}
return "redirect:/content/user.password-reset-email-sent";
return "redirect:/content/" + ContentService.USER_PASSWORD_RESET_EMAIL_SENT;
}
@RequestMapping(value = "/{tokenUuid:.+}/pwdreset", method = RequestMethod.GET)
......@@ -149,7 +150,7 @@ public class UserProfileController extends BaseController {
try {
emailVerificationService.changePassword(tokenUuid, key, password);
return "redirect:/content/user.password-reset";
return "redirect:/content/" + ContentService.USER_PASSWORD_RESET;
} catch (final NoSuchVerificationTokenException | TokenExpiredException e) {
// Not valid
model.addAttribute("tokenUuid", tokenUuid);
......
......@@ -825,3 +825,36 @@ databaseChangeLog:
onUpdate: NO ACTION
referencedColumnNames: id
referencedTableName: classpk
- changeSet:
id: 1508316829948-1
author: m.borodenko
changes:
- sql:
comment: if article#slug=='smtp.email-new-password' update to article#slug='smtp-email-new-password'
sql: update article set slug = 'smtp-email-new-password' where slug = 'smtp.email-new-password';
- sql:
comment: if article#slug=='smtp.email-password' update to article#slug='smtp-email-password'
sql: update article set slug = 'smtp-email-password' where slug = 'smtp.email-password';
- sql:
comment: if article#slug=='smtp.email-verification' update to article#slug='smtp-email-verification'
sql: update article set slug = 'smtp-email-verification' where slug = 'smtp.email-verification';
- sql:
comment: if article#slug=='smtp.material-request' update to article#slug='smtp-material-request'
sql: update article set slug = 'smtp-material-request' where slug = 'smtp.material-request';
- sql:
comment: if article#slug=='smtp.material-confirm-no-pid' update to article#slug='smtp-material-confirm-no-pid'
sql: update article set slug = 'smtp-material-confirm-no-pid' where slug = 'smtp.material-confirm-no-pid';
- sql:
comment: if article#slug=='smtp.material-confirm' update to article#slug='smtp-material-confirm'
sql: update article set slug = 'smtp-material-confirm' where slug = 'smtp.material-confirm';
- sql:
comment: if article#slug=='user.password-reset' update to article#slug='user-password-reset'
sql: update article set slug = 'user-password-reset' where slug = 'user.password-reset';
- sql:
comment: if article#slug=='user.password-reset-email-sent' update to article#slug='user-password-reset-email-sent'
sql: update article set slug = 'user-password-reset-email-sent' where slug = 'user.password-reset-email-sent';
- sql:
comment: if article#slug=='user.reset-password-instructions' update to article#slug='user-reset-password-instructions'
sql: update article set slug = 'user-reset-password-instructions' where slug = 'user.reset-password-instructions';
......@@ -18,6 +18,7 @@ import org.genesys2.server.model.genesys.MaterialRequest;
import org.genesys2.server.model.genesys.MaterialSubRequest;
import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.service.CRMException;
import org.genesys2.server.service.ContentService;
import org.genesys2.server.service.RequestService;
import org.genesys2.server.service.impl.EasySMTAException;
import org.genesys2.server.service.impl.RequestServiceImpl;
......@@ -57,9 +58,9 @@ public class RequestsControllerTest extends AbstractRestTest {
public void setUp() throws UserException, JsonProcessingException, EasySMTAException, CRMException {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
contentService.createGlobalArticle("smtp.material-confirm-no-pid", contentService.getDefaultLocale(), "Missing PID", "Body", null, true);
contentService.createGlobalArticle(ContentService.SMTP_MATERIAL_CONFIRM_NO_PID, contentService.getDefaultLocale(), "Missing PID", "Body", null, true);
contentService.createGlobalArticle("smtp.material-request", contentService.getDefaultLocale(), "Material request", "Body", null, true);
contentService.createGlobalArticle(ContentService.SMTP_MATERIAL_REQUEST, contentService.getDefaultLocale(), "Material request", "Body", null, true);
ObjectMapper objectMapper = new ObjectMapper();
......
......@@ -24,6 +24,7 @@ import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.model.impl.Team;
import org.genesys2.server.model.impl.User;
import org.genesys2.server.service.CRMException;
import org.genesys2.server.service.ContentService;
import org.genesys2.server.servlet.controller.rest.model.UserChangedDataJson;
import org.junit.After;
import org.junit.Before;
......@@ -62,7 +63,7 @@ public class UsersControllerTest extends AbstractRestTest {
public void setUp() throws UserException, PasswordPolicyException, CRMException {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
contentService.createGlobalArticle("smtp.email-verification", contentService.getDefaultLocale(), "Verify email", "<h1>Tho BOdy of oneArticle</h1", null, true);
contentService.createGlobalArticle(ContentService.SMTP_EMAIL_VERIFICATION, contentService.getDefaultLocale(), "Verify email", "<h1>Tho BOdy of oneArticle</h1", null, true);
faoInstitute = new FaoInstitute();
faoInstitute.setFullName("This is name of institute");
......
......@@ -52,7 +52,7 @@ public class ContentServiceTest extends AbstractServicesTest {
contentService.createActivityPost("title of activity post", "body of activity post");
// create article for test
testArticle = contentService.createGlobalArticle("smtp.email-verification", contentService.getDefaultLocale(), "title of article", "<h3>body of article</h3>", null, false);
testArticle = contentService.createGlobalArticle(ContentService.SMTP_EMAIL_VERIFICATION, contentService.getDefaultLocale(), "title of article", "<h3>body of article</h3>", null, false);
}
@After
......@@ -114,7 +114,7 @@ public class ContentServiceTest extends AbstractServicesTest {
public void getGlobalArticleTets() {
LOG.info("Start test-method getGlobalArticleTets");
assertNotNull(contentService.getGlobalArticle("smtp.email-verification", Locale.ENGLISH));
assertNotNull(contentService.getGlobalArticle(ContentService.SMTP_EMAIL_VERIFICATION, Locale.ENGLISH));
LOG.info("Test getGlobalArticleTets is passed!");
}
......@@ -135,8 +135,7 @@ public class ContentServiceTest extends AbstractServicesTest {
@Test
public void getArticleBySlugAndLangTest() {
LOG.info("Start test-method getArticleBySlugAndLangTest");
Article article = contentService.getArticleBySlugAndLang("smtp.email-verification", "en");
Article article = contentService.getArticleBySlugAndLang(ContentService.SMTP_EMAIL_VERIFICATION, "en");
assertNotNull(article);
LOG.info("Test getArticleBySlugAndLangTest is passed!");
......@@ -183,8 +182,7 @@ public class ContentServiceTest extends AbstractServicesTest {
String title = "Update Global Article Title";
String body = "<h1>Update Global Article Body</h1>";
String slug = "smtp.email-verification";
Article globalArticle = contentService.createGlobalArticle(slug, locale, title, body, null, false);
Article globalArticle = contentService.createGlobalArticle(ContentService.SMTP_EMAIL_VERIFICATION, locale, title, body, null, false);
assertThat("Articles list size mismatch", contentService.listArticles(new PageRequest(0, 6)).getContent().size(), is(1));
assertThat("Article body not updated", globalArticle.getBody(), equalTo("<h1>Update Global Article Body</h1>"));
......@@ -193,7 +191,7 @@ public class ContentServiceTest extends AbstractServicesTest {
title="The title";
body = "<h1>Updated body</h1>";
String summary="Summary";
Article updatedArticle = contentService.updateGlobalArticle(slug, locale, title, body, summary);
Article updatedArticle = contentService.updateGlobalArticle(ContentService.SMTP_EMAIL_VERIFICATION, locale, title, body, summary);
assertThat(updatedArticle.getId(), is(globalArticle.getId()));
assertThat(updatedArticle.getTitle(), is(title));
assertThat(updatedArticle.getBody(), is(body));
......@@ -280,7 +278,7 @@ public class ContentServiceTest extends AbstractServicesTest {
String articleBody = "<script></script><h2><small>Genesys account</small><br />Verify your email address</h2><p>You can already use your Genesys account. We need to confirm your email account before granting you access to all Genesys features.</p><p><a href=\"{0}/profile/{1}/validate\" rel=\"nofollow\">Verify {2}</a></p><h2>Validation key: {3}</h2><p>If you didn&#39;t make this request, <a href=\"{0}/profile/{1}/cancel\" rel=\"nofollow\">click here to cancel</a>.</p><p>Thanks,<br />Genesys team</p>";
String expectedBody = "<h2><small>Genesys account</small><br />Verify your email address</h2><p>You can already use your Genesys account. We need to confirm your email account before granting you access to all Genesys features.</p><p><a href=\"{0}/profile/{1}/validate\" rel=\"nofollow\">Verify {2}</a></p><h2>Validation key: {3}</h2><p>If you didn&#39;t make this request, <a href=\"{0}/profile/{1}/cancel\" rel=\"nofollow\">click here to cancel</a>.</p><p>Thanks,<br />Genesys team</p>";
Article article = contentService.createGlobalArticle("smtp.email-verification", Locale.ENGLISH, "Test title", articleBody, null, false);
Article article = contentService.createGlobalArticle(ContentService.SMTP_EMAIL_VERIFICATION, Locale.ENGLISH, "Test title", articleBody, null, false);
assertTrue(!article.getBody().equals(articleBody));
assertTrue(article.getBody().equals(expectedBody));
......
......@@ -67,9 +67,9 @@ public class EmailVerificationServiceTest extends AbstractServicesTest {
try {
userService.createUser("salexandrbasov@gmail.com", "Name 1", "password of u1!ser", AccountType.LOCAL);
contentService.createGlobalArticle("smtp.email-verification", contentService.getDefaultLocale(), "title for oneArticle", "<h1>Tho BOdy of oneArticle</h1>", null, true);
contentService.createGlobalArticle(ContentService.SMTP_EMAIL_VERIFICATION, contentService.getDefaultLocale(), "title for oneArticle", "<h1>Tho BOdy of oneArticle</h1>", null, true);
contentService.createGlobalArticle("smtp.email-password", contentService.getDefaultLocale(), "title for twoArticle", "<h1>Tho BOdy of twoArticle</h1", null, true);
contentService.createGlobalArticle(ContentService.SMTP_EMAIL_PASSWORD, contentService.getDefaultLocale(), "title for twoArticle", "<h1>Tho BOdy of twoArticle</h1", null, true);
} catch (UserException e) {
e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment