Package org.vosao.entity

Examples of org.vosao.entity.ConfigEntity


    }
  }

  @Override
  public ServiceResponse restoreCommentsTemplate() throws IOException {
    ConfigEntity config = getDao().getConfigDao().getConfig();
    config.setCommentsTemplate(StreamUtil.getTextResource(
      SetupBeanImpl.COMMENTS_TEMPLATE_FILE));
    getDao().getConfigDao().save(config);     
    return ServiceResponse.createSuccessResponse(
        Messages.get("successfull_save", "Comments template"));
  }
View Full Code Here


    return new SiteStatVO();
  }

  @Override
  public ServiceResponse saveAttribute(String name, String value) {
    ConfigEntity config = getDao().getConfigDao().getConfig();
    config.setAttribute(name, value);
    getDao().getConfigDao().save(config);
    return ServiceResponse.createSuccessResponse(
        Messages.get("success"));
  }
View Full Code Here

        Messages.get("success"));
  }

  @Override
  public ServiceResponse removeAttributes(List<String> names) {
    ConfigEntity config = getDao().getConfigDao().getConfig();
    config.removeAttributes(names);
    getDao().getConfigDao().save(config);
    return ServiceResponse.createSuccessResponse(
        Messages.get("success"));
  }
View Full Code Here

public class PageAttributesFieldTest extends AbstractDaoTest {

  @Override
  public void setUp() throws Exception {
    super.setUp();
    VosaoContext.getInstance().setConfig(new ConfigEntity());
    VosaoContext.getInstance().getConfig().setDefaultLanguage("en");
  }
View Full Code Here

  @Override
  public ServiceResponse addComment(String name, String comment,
      String pageUrl, String challenge, String response,
      HttpServletRequest request) {
   
    ConfigEntity config = getBusiness().getConfigBusiness().getConfig();
    boolean valid = true;
    ReCaptchaResponse recaptchaResponse = null;
    if (config.isEnableRecaptcha()) {
      recaptchaResponse = RecaptchaUtil.check(
          config.getRecaptchaPublicKey(),
          config.getRecaptchaPrivateKey(),
          challenge, response, request);
      valid = recaptchaResponse.isValid();
    }
    if (valid) {
          try {
View Full Code Here

      return new ServiceResponse("error", Messages.get("form_not_found",
          name));
    }
    String msgBody = createLetter(params);
    String subject = form.getLetterSubject();
    ConfigEntity config = getBusiness().getConfigBusiness().getConfig();
    String fromAddress = config.getSiteEmail();
    String fromText = config.getSiteDomain() + " admin";
    String toAddress = form.getEmail();
    String error = EmailUtil.sendEmail(msgBody, subject, fromAddress, fromText,
          toAddress);
    if (error == null) {
      return new ServiceResponse("success", Messages.get(
View Full Code Here

  @Override
  public ServiceResponse send(String name, Map<String, String> params,
      String challenge, String response, HttpServletRequest request) {

    ConfigEntity config = getBusiness().getConfigBusiness().getConfig();
    ReCaptchaResponse recaptchaResponse = RecaptchaUtil.check(
        config.getRecaptchaPublicKey(),
        config.getRecaptchaPrivateKey(),
        challenge, response, request);
    ServiceResponse result = new ServiceResponse();
        if (recaptchaResponse.isValid()) {
            return send(name, params);
        }
View Full Code Here

        FilterChain chain) throws IOException, ServletException {
      HttpServletRequest httpRequest = (HttpServletRequest)request;
        HttpServletResponse httpResponse = (HttpServletResponse)response;
        String url = httpRequest.getServletPath();
        if (url.equals(SETUP_URL)) {
            ConfigEntity config = getDao().getConfigDao().getConfig();
            if (config == null || config.getVersion() == null) {
              SetupBean setupBean = getBusiness().getSetupBean();
              setupBean.clear();
              setupBean.setup();
              logger.info("Setup was successfully completed.");
              setupBean.loadDefaultSite();
View Full Code Here

  }

  @Override
  public String sendEmail(FormDataEntity formData) {
    FormEntity form = getFormDao().getById(formData.getFormId());
    ConfigEntity config = VosaoContext.getInstance().getConfig();
    FormConfigEntity formConfig = getDao().getFormConfigDao().getConfig();
    VelocityContext context = new VelocityContext();
    List<FieldEntity> fields = getDao().getFieldDao().getByForm(form);
    context.put("form", form);
    context.put("fields", fields);
    context.put("values", formData.getValues());
    context.put("config", config);
    String letter = getSystemService().render(
        formConfig.getLetterTemplate(), context);
    List<String> emails = StrUtil.fromCSV(form.getEmail());
    for (String email : emails) {
      String error = EmailUtil.sendEmail(
          letter,
          form.getLetterSubject(),
          config.getSiteEmail(),
          "Site admin",
          StringUtils.strip(email),
          getFileItems(formData));
      if (error != null) {
        return error;
View Full Code Here

    return VosaoContext.getInstance().getConfig();
  }

  @Override
  public boolean isTextFileExt(String ext) {
    ConfigEntity config = getConfig();
    String[] exts = config.getEditExt().split(",");
    for (String textExt : exts) {
      if (ext.equals(textExt)) {
        return true;
      }
    }
View Full Code Here

TOP

Related Classes of org.vosao.entity.ConfigEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.