Package com.agiletec.aps.util

Examples of com.agiletec.aps.util.ApsProperties


   */
  private Widget createShowletFromRecord(String widgetcode, String config) throws ApsSystemException {
    Widget newShowlet = new Widget();
    WidgetType inheritedType = this.getWidgetTypeManager().getWidgetType(widgetcode);
    newShowlet.setType(inheritedType);
    ApsProperties properties = null;
    newShowlet.setConfig(properties);
    return newShowlet;
  }
View Full Code Here


   */
  public String addNewFreeText() {
    Choice choice = null;
    // fake XML common for every free text option record
    String xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?><properties><property key=\"ERROR\">YOU SHOULD _NOT_ SEE THIS</property></properties>";   
    ApsProperties prop = new ApsProperties();
    this.setStrutsAction(ApsAdminSystemConstants.ADD);
    try {
      if (null == this.getQuestionId() || null == this.getStrutsAction()) {
        this.addActionError(this.getText("message.surveyAction.cannotProceed"));
        return INPUT;
      }
      prop.loadFromXml(xml);
      if (this.getStrutsAction() == ApsAdminSystemConstants.EDIT) {
        this.addActionError(this.getText("message.choiceAction.unexpextedAction", new String[]{this.getText("_choice"), this.getText("freeText")}));
        return INPUT;
      }
      choice = new Choice();
View Full Code Here

          question = this.buildQuestionRecordFromResultSet(res, 1);
        }
        // get extra info: questions need the survey type
        int questionnaireValue = res.getInt(13);
        boolean questionnaire = questionnaireValue == 1 ? true:false;
        ApsProperties titles = new ApsProperties();
        titles.loadFromXml(res.getString(14));
        question.setExtraInfo(questionnaire, titles);
        Choice choice = this.buildChoiceRecordFromResultSet(res, 8);
        if (null == choice) continue;
        choice.setExtraInfo(question.getSurveyId(), question.isQuestionnaire(), question.getSurveyTitles(), question.getQuestions());
        if (null == question.getChoice(choice.getId())) {
View Full Code Here

    }
  }
 
  protected void addLabelGroups(String key, String defaultValue) throws ApsSystemException {
    try {
      ApsProperties properties = new ApsProperties();
      Lang defaultLang = super.getLangManager().getDefaultLang();
      properties.put(defaultLang.getCode(), defaultValue);
      this.getI18nManager().addLabelGroup(key, properties);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "addLabelGroups");
      throw new RuntimeException("Error adding label groups - key '" + key + "'", t);
    }
View Full Code Here

    _aggregatorManager.addItem(item);
    ApsAggregatorItem dummy = _aggregatorManager.getItem(item.getCode());
    dummy.setDelay(1000);
    dummy.setDescr("updated_descr");
    dummy.setLink("updated_link");
    ApsProperties categories = new ApsProperties();
    categories.put("code", "<categories />");
    _aggregatorManager.update(dummy);
    ApsAggregatorItem dummy2 = _aggregatorManager.getItem(item.getCode());
    assertNotNull(dummy2);
    assertEquals(dummy.getDelay(), dummy2.getDelay());
    assertEquals(dummy.getLink(), dummy2.getLink());
View Full Code Here

      int id = res.getInt(1);
      if (id > 0) {
        survey = new Survey();
        survey.setQuestions(new ArrayList<Question>());
        survey.setId(id);
        ApsProperties prop = new ApsProperties();
        prop.loadFromXml(res.getString(2));
        survey.setDescriptions(prop);
        survey.setGroupName(res.getString(3).trim());
        survey.setStartDate(res.getDate(4));
        survey.setEndDate(res.getDate(5));
        survey.setActive(res.getBoolean(6));
        survey.setPublicPartialResult(res.getBoolean(7));
        survey.setPublicResult(res.getBoolean(8));
        survey.setQuestionnaire(res.getBoolean(9));
        survey.setGatherUserInfo(res.getBoolean(10));
        prop = new ApsProperties();
        prop.loadFromXml(res.getString(11));
        survey.setTitles(prop);
        survey.setRestricted(res.getBoolean(12));
        survey.setCheckCookie(res.getBoolean(13));
        survey.setCheckIpAddress(res.getBoolean(14));
        survey.setCheckUsername(res.getBoolean(15));
        survey.setImageId(res.getString(16));
        prop = new ApsProperties();
        prop.loadFromXml(res.getString(17));
        survey.setImageDescriptions(prop);
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "buildSurveyRecordFromResultSet",
      "Error while building a 'survey' object from the result set");
View Full Code Here

      }
    }
  }

  private void setContentCategories(Content content, ApsAggregatorItem apsAggregatorItem) {
    ApsProperties categories = apsAggregatorItem.getCategories();
    if (null != categories && categories.size() > 0) {
      for (Enumeration e = categories.keys() ; e.hasMoreElements() ;) {
        String categoryCode = (String) e.nextElement();
        Category category = this.getCategoryManager().getCategory(categoryCode);
        if (null != category && !content.getCategories().contains(category)) {
          content.addCategory(category);
        }
View Full Code Here

      throw new ApsSystemException("Error detected parsing the XML", t);
    }
  }

  private ApsProperties buildProperties(Element propertiesElement) {
    ApsProperties prop = new ApsProperties();
    List<Element> propertyElements = propertiesElement.getChildren(TAB_PROPERTY);
    Iterator<Element> propertyElementsIter = propertyElements.iterator();
    while (propertyElementsIter.hasNext()) {
      Element property = (Element) propertyElementsIter.next();
      prop.put(property.getAttributeValue(ATTRIBUTE_KEY), property.getText().trim());
    }
    return prop;
  }
View Full Code Here

    Widget showlet = new Widget();
    String showletCode = defaultShowletElement.getAttributeValue(ATTRIBUTE_CODE);
    showlet.setType(showletTypeManager.getWidgetType(showletCode));
    Element propertiesElement = defaultShowletElement.getChild(TAB_PROPERTIES);
    if (null != propertiesElement) {
      ApsProperties prop = this.buildProperties(propertiesElement);
      showlet.setConfig(prop);
    } else {
      showlet.setConfig(new ApsProperties());
    }
    _defaultShowlet[pos] = showlet;
    return showlet;
  }
View Full Code Here

  }

  protected Widget getShowletVoid() {
    Widget voidShowlet = new Widget();
    voidShowlet.setType(this.getPageUserConfigManager().getVoidShowlet());
    voidShowlet.setConfig(new ApsProperties());
    return voidShowlet;
  }
View Full Code Here

TOP

Related Classes of com.agiletec.aps.util.ApsProperties

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.