Search in sources :

Example 46 with PostConstruct

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);
}
Also used : DefaultTransactionDefinition(org.springframework.transaction.support.DefaultTransactionDefinition) TransactionStatus(org.springframework.transaction.TransactionStatus) Client(pl.com.bottega.erp.sales.domain.Client) PostConstruct(javax.annotation.PostConstruct)

Example 47 with PostConstruct

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);
    }
}
Also used : FormStructureHelper(com.day.cq.wcm.foundation.forms.FormStructureHelper) PostConstruct(javax.annotation.PostConstruct)

Example 48 with PostConstruct

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();
}
Also used : Tag(com.day.cq.tagging.Tag) PostConstruct(javax.annotation.PostConstruct)

Example 49 with PostConstruct

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);
}
Also used : ValueMap(org.apache.sling.api.resource.ValueMap) PostConstruct(javax.annotation.PostConstruct)

Example 50 with PostConstruct

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);
}
Also used : SpringSecurityLdapTemplate(org.springframework.security.ldap.SpringSecurityLdapTemplate) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PostConstruct (javax.annotation.PostConstruct)248 IOException (java.io.IOException)28 File (java.io.File)18 SamlRegisteredService (org.apereo.cas.support.saml.services.SamlRegisteredService)17 Map (java.util.Map)15 ArrayList (java.util.ArrayList)12 ExternalResource (com.vaadin.server.ExternalResource)11 HashMap (java.util.HashMap)10 InitialContext (javax.naming.InitialContext)9 Label (com.vaadin.ui.Label)8 VerticalLayout (com.vaadin.ui.VerticalLayout)8 Request (com.nabalive.framework.web.Request)7 Response (com.nabalive.framework.web.Response)7 Route (com.nabalive.framework.web.Route)7 Link (com.vaadin.ui.Link)7 Properties (java.util.Properties)7 Method (java.lang.reflect.Method)5 InputStream (java.io.InputStream)4 URISyntaxException (java.net.URISyntaxException)4 Path (java.nio.file.Path)4