Examples of VelocityContext


Examples of org.apache.velocity.VelocityContext

    if (structureTemplate == null) {
      setContent(Messages.get("structureTemplate.not_selected"));
      return;
    }
    if (structureTemplate.isVelocity()) {
      VelocityContext context = getPageBusiness().createContext(
        getLanguageCode(), getPage());
      context.put("content", contentMap);
      context.put("page", this);
      setContent(getSystemService().render(structureTemplate.getContent(),
          context));
      if (StringUtils.isNotEmpty(structureTemplate.getHeadContent())) {
        String headContent = getSystemService().render(
            structureTemplate.getHeadContent(), context);
View Full Code Here

Examples of org.apache.velocity.VelocityContext

    }
  }
 
  private void prepareVelocityContent(Map<String, String> contentMap) {
    if (isVelocityProcessing()) {
      VelocityContext context = getPageBusiness().createContext(
        getLanguageCode(), getPage());
      context.put("page", getPage());
      for (String key : contentMap.keySet()) {
        contentMap.put(key, getSystemService().render(contentMap.get(key),
          context));
      }
    }
View Full Code Here

Examples of org.apache.velocity.VelocityContext

      setContent(msg);
      return;
    }
    String resultContent = contentEntity.getContent();
    if (isVelocityProcessing()) {
      VelocityContext context = getPageBusiness().createContext(
          getLanguageCode(), getPage());
      context.put("page", getPage());
      resultContent = getSystemService().render(resultContent, context);
    }
    if (isWikiProcessing()) {
      resultContent = getSystemService().renderWiki(resultContent,
          getPage());
View Full Code Here

Examples of org.apache.velocity.VelocityContext

   */
  private void initTransformer() {
    // build new transformer
    InputStream xslin = getClass().getResourceAsStream("/org/olat/ims/resources/xsl/" + XSLFILENAME);
    // translate xsl with velocity
    Context vcContext = new VelocityContext();
    vcContext.put("t", pT);
    vcContext.put("staticPath", StaticMediaDispatcher.createStaticURIFor(""));
    String xslAsString = "";
    try {
      xslAsString = slurp(xslin);
    } catch (IOException e) {
      log.error("Could not convert xsl to string!", e);
View Full Code Here

Examples of org.apache.velocity.VelocityContext

  @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(
View Full Code Here

Examples of org.apache.velocity.VelocityContext

    //to validate the input a special isValidValue is used.
    if (usageIdentifyer.equals(UserBulkChangeStep00.class.getCanonicalName())){
      tElem.setItemValidatorProvider(new ItemValidatorProvider(){
        public boolean isValidValue(String value, ValidationError validationError, Locale locale2) {
          UserBulkChangeManager ubcMan = UserBulkChangeManager.getInstance();
          Context vcContext = new VelocityContext();
          if (user==null){
            vcContext = ubcMan.getDemoContext(locale2, isAdministrativeUser);
          }
          //should be used if user-argument !=null --> move to right place
          else {
View Full Code Here

Examples of org.apache.velocity.VelocityContext

          Fieldlanguagesvalues labelid505 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(505), default_lang_id);
          //Fieldlanguagesvalues labelid570 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(570), default_lang_id);
          //Fieldlanguagesvalues labelid571 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(571), default_lang_id);
         
          /* lets make a Context and put data into it */
          VelocityContext context = new VelocityContext();
 
          context.put("user", user);
          context.put("message", message);
          context.put("invitation_link", invitation_link);
          context.put("invitation_link2", invitation_link);
         
          context.put("labelid500", labelid500.getValue());
          context.put("labelid501", labelid501.getValue());
          context.put("labelid502", labelid502.getValue());
          context.put("labelid503", labelid503.getValue());
          context.put("labelid504", labelid504.getValue());
          context.put("labelid505", labelid505.getValue());
 
          /* lets render a template */
          StringWriter w = new StringWriter();
            Velocity.mergeTemplate(tamplateName, "UTF-8", context, w );
           
View Full Code Here

Examples of org.apache.velocity.VelocityContext

          Fieldlanguagesvalues labelid625 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(625), default_lang_id);
          Fieldlanguagesvalues labelid626 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(626), default_lang_id);
          Fieldlanguagesvalues labelid627 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(627), default_lang_id);
         
          /* lets make a Context and put data into it */
          VelocityContext context = new VelocityContext();
 
          context.put("user", user);
          context.put("message", message);
          context.put("invitation_link", invitation_link);
          context.put("invitation_link2", invitation_link);
          context.put("labelid500", labelid622.getValue());
          context.put("labelid501", labelid623.getValue());
          context.put("labelid502", labelid624.getValue());
          context.put("labelid503", labelid625.getValue());
          context.put("labelid504", labelid626.getValue());
          context.put("labelid505", labelid627.getValue());
          
 
          /* lets render a template */
          StringWriter w = new StringWriter();
            Velocity.mergeTemplate(tamplateName, "UTF-8", context, w );
View Full Code Here

Examples of org.apache.velocity.VelocityContext

      String deny_link, String openmeetings_link){
        try {
         
          /* lets make a Context and put data into it */
 
          VelocityContext context = new VelocityContext();
 
          context.put("message", message);
          context.put("accept_link", accept_link);
          context.put("deny_link", deny_link);
        context.put("openmeetings_link", openmeetings_link);
 
          /* lets render a template */
 
          StringWriter w = new StringWriter();
            Velocity.mergeTemplate(tamplateName, "UTF-8", context, w );
View Full Code Here

Examples of org.apache.velocity.VelocityContext

          Fieldlanguagesvalues labelid514 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(514), default_lang_id);
          Fieldlanguagesvalues labelid515 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(515), default_lang_id);
          Fieldlanguagesvalues labelid516 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(516), default_lang_id);
         
          /* lets make a Context and put data into it */
          VelocityContext context = new VelocityContext();
          context.put("reset_link", reset_link);
          context.put("reset_link2", reset_link);
          context.put("labelid513", labelid513.getValue());
          context.put("labelid514", labelid514.getValue());
          context.put("labelid515", labelid515.getValue());
          context.put("labelid516", labelid516.getValue());
 
          /* lets render a template */
          StringWriter w = new StringWriter();
            Velocity.mergeTemplate(tamplateName, "UTF-8", context, w );
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.