use of javax.annotation.PostConstruct in project ddd-cqrs-sample by BottegaIT.
the class AddSampleProductsOnStartup method addSampleProductsToRepo.
@PostConstruct
public void addSampleProductsToRepo() {
TransactionStatus tx = transactionManager.getTransaction(new DefaultTransactionDefinition());
for (int i = 1; i < 21; i++) {
em.persist(product(String.format("Electronic Gizmo %02d", i), 0.99));
em.persist(product(String.format("Cell Phone with 32GB flash memory %02d", i), 299.99));
em.persist(food(String.format("Software Engineering Audiobook %02d", i), 17.50));
em.persist(drug(String.format("PC Game including Zombies Part %02d", i), 39.89));
em.persist(product(String.format("Tablet with Keyboard %02d", i), 459.99));
}
em.persist(new Client());
transactionManager.commit(tx);
}
use of javax.annotation.PostConstruct in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ContainerImpl method initModel.
@PostConstruct
private void initModel() {
FormStructureHelper formStructureHelper = formStructureHelperFactory.getFormStructureHelper(resource);
request.setAttribute(FormsHelper.REQ_ATTR_FORM_STRUCTURE_HELPER, formStructureHelper);
this.action = currentPage.getPath() + ".html";
if (StringUtils.isBlank(id)) {
id = FormsHelper.getFormId(request);
}
this.name = id;
this.dropAreaResourceType += "/new";
if (redirect != null) {
String contextPath = request.getContextPath();
if (StringUtils.isNotBlank(contextPath) && redirect.startsWith("/")) {
redirect = contextPath + redirect;
}
}
if (!StringUtils.equals(request.getRequestPathInfo().getExtension(), Constants.EXPORTER_EXTENSION)) {
runActionTypeInit(formStructureHelper);
}
}
use of javax.annotation.PostConstruct in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class PageImpl method initModel.
@PostConstruct
private void initModel() {
title = currentPage.getTitle();
if (StringUtils.isBlank(title)) {
title = currentPage.getName();
}
Tag[] tags = currentPage.getTags();
keywords = new String[tags.length];
int index = 0;
for (Tag tag : tags) {
keywords[index++] = tag.getTitle(currentPage.getLanguage(false));
}
if (currentDesign != null) {
String designPath = currentDesign.getPath();
if (!Designer.DEFAULT_DESIGN_PATH.equals(designPath)) {
this.designPath = designPath;
if (resolver.getResource(designPath + "/static.css") != null) {
staticDesignPath = designPath + "/static.css";
}
loadFavicons(designPath);
}
}
populateClientLibCategories();
templateName = extractTemplateName();
}
use of javax.annotation.PostConstruct in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class SocialMediaHelperImpl method initModel.
//*************** IMPLEMENTATION *******************
@PostConstruct
private void initModel() throws Exception {
ValueMap pageProperties = currentPage.getProperties();
String[] socialMedia = pageProperties.get(PN_SOCIAL_MEDIA, String[].class);
facebookEnabled = ArrayUtils.contains(socialMedia, PV_FACEBOOK);
pinterestEnabled = ArrayUtils.contains(socialMedia, PV_PINTEREST);
socialMediaEnabled = facebookEnabled || pinterestEnabled;
variantPath = pageProperties.get(PN_VARIANT_PATH, String.class);
}
use of javax.annotation.PostConstruct in project OpenClinica by OpenClinica.
the class LdapUserService method init.
// Eclipse warning here is an Eclipse bug, not an issue with the code
@PostConstruct
public void init() {
ldapTemplate = new SpringSecurityLdapTemplate(contextSource);
ldapTemplate.setIgnorePartialResultException(true);
}
Aggregations