Search in sources :

Example 1 with ContactForm

use of com.salesmanager.shop.model.shop.ContactForm in project shopizer by shopizer-ecommerce.

the class ContactController method display.

@RequestMapping("/shop/store/contactus.html")
public String display(Model model, HttpServletRequest request, HttpServletResponse response, Locale locale) throws Exception {
    MerchantStore store = (MerchantStore) request.getAttribute(Constants.MERCHANT_STORE);
    model.addAttribute("googleMapsKey", googleMapsKey);
    request.setAttribute(Constants.LINK_CODE, CONTACT_LINK);
    Language language = (Language) request.getAttribute("LANGUAGE");
    ContactForm contact = new ContactForm();
    model.addAttribute("contact", contact);
    model.addAttribute("recapatcha_public_key", siteKeyKey);
    Content content = contentService.getByCode(Constants.CONTENT_CONTACT_US, store, language);
    ContentDescription contentDescription = null;
    if (content != null && content.isVisible()) {
        contentDescription = content.getDescription();
    }
    if (contentDescription != null) {
        // meta information
        PageInformation pageInformation = new PageInformation();
        pageInformation.setPageDescription(contentDescription.getMetatagDescription());
        pageInformation.setPageKeywords(contentDescription.getMetatagKeywords());
        pageInformation.setPageTitle(contentDescription.getTitle());
        pageInformation.setPageUrl(contentDescription.getName());
        request.setAttribute(Constants.REQUEST_PAGE_INFORMATION, pageInformation);
        model.addAttribute("content", contentDescription);
    }
    /**
     * template *
     */
    StringBuilder template = new StringBuilder().append(ControllerConstants.Tiles.Content.contactus).append(".").append(store.getStoreTemplate());
    return template.toString();
}
Also used : Language(com.salesmanager.core.model.reference.language.Language) PageInformation(com.salesmanager.shop.model.shop.PageInformation) Content(com.salesmanager.core.model.content.Content) ContactForm(com.salesmanager.shop.model.shop.ContactForm) ContentDescription(com.salesmanager.core.model.content.ContentDescription) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Content (com.salesmanager.core.model.content.Content)1 ContentDescription (com.salesmanager.core.model.content.ContentDescription)1 MerchantStore (com.salesmanager.core.model.merchant.MerchantStore)1 Language (com.salesmanager.core.model.reference.language.Language)1 ContactForm (com.salesmanager.shop.model.shop.ContactForm)1 PageInformation (com.salesmanager.shop.model.shop.PageInformation)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1