Package org.openmeetings.app.persistence.beans.lang

Examples of org.openmeetings.app.persistence.beans.lang.Fieldlanguagesvalues


  final public void testAddFieldvalues() throws Exception {

    EntityTransaction tx = getEntityManager().getTransaction();
    tx.begin();
    Fieldlanguagesvalues flv = new Fieldlanguagesvalues();
    flv.setStarttime(new Date());
    flv.setValue("test");
    flv.setLanguage_id(33L);
    flv.setDeleted("false");
    try {
      flv = getEntityManager().merge(flv);
      tx.commit();
    } catch (Exception e) {
      tx.rollback();
View Full Code Here


                       
                        if (hash == null) {
                                //No hash
                                Long default_lang_id = Long.valueOf(Configurationmanagement.getInstance().
                                        getConfKey(3,"default_lang_id").getConf_value()).longValue();
                                Fieldlanguagesvalues labelid669 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(669), default_lang_id);
                                Fieldlanguagesvalues labelid672 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(672), default_lang_id);
                               
                                ctx.put("message", labelid669.getValue());
                                ctx.put("link", "<a href='"+loginURL+"'>"+ labelid672.getValue() + "</a>");
                                return getVelocityEngine().getTemplate("activation_template.vm");
                        }
                        //
                        Users user = Usermanagement.getInstance().getUserByActivationHash(hash);
                       
                        if (user == null) {
                                //No User Found with this Hash
                                Long default_lang_id = Long.valueOf(Configurationmanagement.getInstance().
                                        getConfKey(3,"default_lang_id").getConf_value()).longValue();
                               
                                Fieldlanguagesvalues labelid669 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(669), default_lang_id);
                                Fieldlanguagesvalues labelid672 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(672), default_lang_id);
                               
                               
                                ctx.put("message", labelid669.getValue());
                                ctx.put("link", "<a href='"+loginURL+"'>"+ labelid672.getValue() + "</a>");
                                return getVelocityEngine().getTemplate("activation_template.vm");
                               
                        } else if (user.getStatus() == 1) {
                                //already activated
                                Long default_lang_id = Long.valueOf(Configurationmanagement.getInstance().
                                        getConfKey(3,"default_lang_id").getConf_value()).longValue();
                               
                                Fieldlanguagesvalues labelid670 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(670), default_lang_id);
                                Fieldlanguagesvalues labelid672 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(672), default_lang_id);
                               
                                ctx.put("message", labelid670.getValue());
                                ctx.put("link", "<a href='"+loginURL+"'>"+ labelid672.getValue() + "</a>");
                                return getVelocityEngine().getTemplate("activation_template.vm");
                               
                        } else if (user.getStatus() == 0) {
                                //activate
                                user.setStatus(1);
                                user.setUpdatetime(new Date());

                                Usermanagement.getInstance().updateUser(user);
                               
                                Long default_lang_id = Long.valueOf(Configurationmanagement.getInstance().
                                        getConfKey(3,"default_lang_id").getConf_value()).longValue();
                               
                                Fieldlanguagesvalues labelid671 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(671), default_lang_id);
                                Fieldlanguagesvalues labelid672 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(672), default_lang_id);
                               
                                ctx.put("message", labelid671.getValue());
                                ctx.put("link", "<a href='"+loginURL+"'>"+ labelid672.getValue() + "</a>");
                                return getVelocityEngine().getTemplate("activation_template.vm");
                               
                        } else {
                                //unkown Status
                                Long default_lang_id = Long.valueOf(Configurationmanagement.getInstance().
                                        getConfKey(3,"default_lang_id").getConf_value()).longValue();
                               
                                Fieldlanguagesvalues labelid672 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(672), default_lang_id);
                               
                                ctx.put("message", "Unkown Status");
                                ctx.put("link", "<a href='"+loginURL+"'>"+ labelid672.getValue() + "</a>");
                                return getVelocityEngine().getTemplate("activation_template.vm");
                               
                        }
                       
                } catch (Exception err) {
View Full Code Here

      Element value = eTemp.addElement("value");
      if (fv.getFieldlanguagesvalue()!=null) {
        value.addText(fv.getFieldlanguagesvalue().getValue());
      } else {
        //Add english default text
        Fieldlanguagesvalues flv = Fieldmanagment.getInstance().getFieldByIdAndLanguage(fv.getFieldvalues_id(), 1L);
        if (flv != null) {
          value.addText(flv.getValue());
        } else {
          value.addText("");
        }
      }
    }
View Full Code Here

        //template = "screencast_odsp_sharertemplate.vm";
        ctx.put("PORT", ServerSocketMinaProcess.port);
       
        log.debug("language_id :: "+language_id);
       
        Fieldlanguagesvalues fValue728 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(728L, language_id);
        Fieldlanguagesvalues fValue729 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(729L, language_id);
        Fieldlanguagesvalues fValue730 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(730L, language_id);
        Fieldlanguagesvalues fValue731 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(731L, language_id);
        Fieldlanguagesvalues fValue732 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(732L, language_id);
        Fieldlanguagesvalues fValue733 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(733L, language_id);
        Fieldlanguagesvalues fValue734 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(734L, language_id);
        Fieldlanguagesvalues fValue735 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(735L, language_id);
        Fieldlanguagesvalues fValue736 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(736L, language_id);
        Fieldlanguagesvalues fValue737 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(737L, language_id);
        Fieldlanguagesvalues fValue738 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(738L, language_id);
        Fieldlanguagesvalues fValue739 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(739L, language_id);
        Fieldlanguagesvalues fValue740 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(740L, language_id);
        Fieldlanguagesvalues fValue741 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(741L, language_id);
        Fieldlanguagesvalues fValue742 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(742L, language_id);
        Fieldlanguagesvalues fValue844 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(844L, language_id);
       
        Fieldlanguagesvalues fValue869 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(869L, language_id);
        Fieldlanguagesvalues fValue870 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(870L, language_id);
        Fieldlanguagesvalues fValue871 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(871L, language_id);
        Fieldlanguagesvalues fValue872 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(872L, language_id);
        Fieldlanguagesvalues fValue878 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(878L, language_id);
       
        Fieldlanguagesvalues fValue1089 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(1089L, language_id);
        Fieldlanguagesvalues fValue1090 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(1090L, language_id);
        Fieldlanguagesvalues fValue1091 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(1091L, language_id);
        Fieldlanguagesvalues fValue1092 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(1092L, language_id);
        Fieldlanguagesvalues fValue1093 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(1093L, language_id);
       
        String label_viewer = "Viewer";
        String label_sharer = "Sharer";
       
        try{
         label_viewer = fValue728.getValue()+";"+
                    fValue729.getValue()+";"+
                    fValue736.getValue()+";"+
                    fValue742.getValue();
       
         label_sharer = fValue730.getValue()+";"+ //0
                    fValue731.getValue()+";"+ //1
                    fValue732.getValue()+";"+ //2
                    fValue733.getValue()+";"+ //3
                    fValue734.getValue()+";"+ //4
                    fValue735.getValue()+";"+ //5
                    fValue737.getValue()+";"+ //6
                    fValue738.getValue()+";"+ //7
                    fValue739.getValue()+";"+ //8
                    fValue740.getValue()+";"+ //9
                    fValue741.getValue()+";"+ //10
                    fValue742.getValue()+";"+ //11
                    fValue844.getValue()+";"+ //12
                    fValue869.getValue()+";"+ //13
                    fValue870.getValue()+";"+ //14
                    fValue871.getValue()+";"+ //15
                    fValue872.getValue()+";"//16
                    fValue878.getValue()+";"//17
                    fValue1089.getValue()+";"//18
                    fValue1090.getValue()+";"//19
                    fValue1091.getValue()+";"//20
                    fValue1092.getValue()+";"//21
                    fValue1093.getValue()+";"  //22
                    ;
       
        }catch(Exception e){
          log.error("Error resolving Language labels : " , e);
        }
View Full Code Here

      if (sendEmailWithVerficationCode) {
       
        String verification_url = link;
       
        String template = RegisterUserTemplate.getInstance().getRegisterUserWithVerificationTemplate(Username,Userpass,EMail,default_lang_id, verification_url);
        Fieldlanguagesvalues label = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(512), default_lang_id);
     
        succ = MailHandler.sendMail(EMail, label.getValue(), template);
       
      } else {
       
        String template = RegisterUserTemplate.getInstance().getRegisterUserTemplate(Username,Userpass,EMail,default_lang_id);
        Fieldlanguagesvalues label = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(512), default_lang_id);
     
        succ = MailHandler.sendMail(EMail, label.getValue(), template);
      }
     
     
     
      return succ;
View Full Code Here

   
    if (fv==null) {
      Fieldmanagment.getInstance().addFieldById(fieldName, fieldvalues_id);
    }
   
    Fieldlanguagesvalues flv = Fieldmanagment.getInstance().getFieldByIdAndLanguage(fieldvalues_id, language_id);
   
    if (flv==null) {
      Fieldmanagment.getInstance().addFieldValueByFieldAndLanguage(fieldvalues_id, language_id, value);
    } else {
      flv.setValue(value);
      flv.setUpdatetime(new java.util.Date());
      Fieldmanagment.getInstance();
      Fieldmanagment.getInstance().updateFieldValueByFieldAndLanguage(flv);
    }
  }
View Full Code Here

      Integer default_lang_id = Integer.valueOf(Configurationmanagement.getInstance().
              getConfKey(3,"default_lang_id").getConf_value()).intValue();
       
      String template = FeedbackTemplate.getInstance().getFeedBackTemplate(username, email, message, default_lang_id);
   
      Fieldlanguagesvalues fValue = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(499), new Long(default_lang_id));
      return MailHandler.sendMail("openmeetings-user@googlegroups.com", fValue.getValue(), template);

    } catch (Exception err){
      log.error("sendInvitationLink",err);
    }
    return null;
View Full Code Here

      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery("select f from Fieldlanguagesvalues f WHERE f.language_id = :language_id AND f.fieldvalues_id = :fieldvalues_id");
      query.setParameter("fieldvalues_id", fieldvalues_id);
      query.setParameter("language_id", language_id);
      Fieldlanguagesvalues flv = null;
      try {
        flv = (Fieldlanguagesvalues) query.getSingleResult();
          } catch (NoResultException ex) {
          }
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      FieldLanguage fieldLanguage = FieldLanguageDaoImpl.getInstance().getFieldLanguageById(language_id);
     
      log.debug("Getting FieldById for Language " + fieldLanguage.getName());
     
      //Check for Right To Left Languages
      if (fieldLanguage.getRtl()) {
       
        log.debug("Language requieres RTL");
       
        Fieldlanguagesvalues remote = flv;
        Fieldlanguagesvalues toAdd = new Fieldlanguagesvalues();
        toAdd.setFieldlanguagesvalues_id(remote.getFieldlanguagesvalues_id());
        toAdd.setFieldvalues_id(remote.getFieldvalues_id());
        toAdd.setLanguage_id(remote.getLanguage_id());

        String[] splitted = remote.getValue().split(" ");
        String reverseOrder = "";
        for (int i=splitted.length-1;i>=0;i--) {
          reverseOrder += splitted[i];
          if (splitted.length != 1) {
            reverseOrder += " ";
          }
        }
        toAdd.setValue(reverseOrder);
       
        return toAdd;
      } else {
        log.debug("Language doesnt requiere RTL");
       
View Full Code Here

     
      String hql = "select f from Fieldlanguagesvalues as f " +
              "WHERE f.language_id = :language_id " +
              "AND f.fieldvalues_id = :fieldvalues_id";
     
      Fieldlanguagesvalues flv = null;
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
View Full Code Here

    return null;
  }
 
  public Long deleteFieldlanguagesvaluesById(Long fieldlanguagesvalues_id) {
    try {
      Fieldlanguagesvalues flv = this.getFieldlanguagesvaluesById(fieldlanguagesvalues_id);
      if (flv == null) {
        return new Long(-27);
      }
     
      Object idf = PersistenceSessionUtil.createSession();
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.lang.Fieldlanguagesvalues

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.