Package com.agiletec.aps.util

Examples of com.agiletec.aps.util.ApsProperties.loadFromXml()


    Choice choice2 = this.getFakeChoice();
    List<Choice> choiceList = new ArrayList<Choice>();
    try {
      choiceList.add(choice1);
      choiceList.add(choice2);
      prop.loadFromXml(xml);
      question.setQuestions(prop);
      question.setId(2); // this will be changed when saving...
      question.setMaxResponseNumber(2677);
      question.setMinResponseNumber(1977);
      question.setPos(0);
View Full Code Here


  protected Choice getFakeChoice() throws Throwable {
    Choice choice = new Choice();
    String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><properties><property key=\"test\">me</property><property key=\"test2\">me too</property></properties>";
    ApsProperties prop = new ApsProperties();
    try {
      prop.loadFromXml(xml);
      choice.setChoices(prop);
      choice.setFreeText(true);
      choice.setPos(96);
      choice.setQuestionId(2);
    } catch (Throwable t) {
View Full Code Here

      item.setLastUpdate(lastUpdate);
      item.setContentType(res.getString("contenttype"));
      String cat = res.getString("categories");
      if (null != cat && cat.trim().length() > 0) {
        ApsProperties categories = new ApsProperties();
        categories.loadFromXml(cat);
        item.setCategories(categories);
      }
    }
    return item;
  }
View Full Code Here

      Date lastUpdate = new Date(res.getTimestamp("lastupdate").getTime());
      item.setLastUpdate(lastUpdate);
      String cat = res.getString("categories");
      if (null != cat && cat.trim().length() > 0) {
        ApsProperties categories = new ApsProperties();
        categories.loadFromXml(cat);
        item.setCategories(categories);
      }
      items.add(item);
    }
    return items;
View Full Code Here

        question = new Question();
        question.setChoices(new ArrayList<Choice>());
        question.setId(id);
        question.setSurveyId(res.getInt(shift + 2));
        ApsProperties prop = new ApsProperties();
        prop.loadFromXml(res.getString(shift + 3));
        question.setQuestions(prop);
        question.setPos(res.getInt(shift + 4));
        question.setSingleChoice(res.getBoolean(shift + 5));
        question.setMinResponseNumber(res.getInt(shift + 6));
        question.setMaxResponseNumber(res.getInt(shift + 7));
View Full Code Here

      if (id > 0) {
        choice = new Choice();
        choice.setId(id);
        choice.setQuestionId(res.getInt(shift + 2));
        ApsProperties prop = new ApsProperties();
        prop.loadFromXml(res.getString(shift + 3));
        choice.setChoices(prop);
        choice.setPos(res.getInt(shift + 4));
        choice.setFreeText(res.getBoolean(shift + 5));
      }
    } catch (Throwable t) {
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.