Package org.dom4j

Examples of org.dom4j.Element.element()


          .append("\"/>\n");
      }
    }
    result.setPageHeader(header.toString());
    if (root.element("config") != null) {
      result.setConfigStructure(root.element("config").asXML());
    }
    return result;
  }

  public void uninstall(PluginEntity plugin) {
View Full Code Here


    String title = root.elementText("title");
    if (!StringUtils.isEmpty(title)) {
      folder.setTitle(title);
      getDaoTaskAdapter().folderSave(folder);
    }
    readFolderPermissions(root.element("permissions"), folder);
  }

  private void readFolderPermissions(Element element, FolderEntity folder) {
    for (Element permElement : (List<Element>)element.elements("permission")) {
      GroupEntity group = getDao().getGroupDao().getByName(
View Full Code Here

              }
              else {
                group.setName(name);
              }
              getDaoTaskAdapter().groupSave(group);
              for (Iterator<Element> j = element.element("users").elementIterator();
                j.hasNext(); ) {
                    Element userElement = j.next();
                    UserEntity user = getDao().getUserDao().getByEmail(
                        userElement.getText());
                    if (user != null) {
View Full Code Here

              if (structure == null) {
                structure = new StructureEntity(title, content);
              }
              structure.setContent(content);
              getDaoTaskAdapter().structureSave(structure);
              readTemplates(element.element("templates"), structure);
            }
    }   
  }

  private void readTemplates(Element templatesElement,
View Full Code Here

         * This is a bugfix (see OLAT-4194). According to the qti specification,
         * the presentation element can either have the elements material and
         * response_lid as children or they may be children of the flow element
         * which itself is a child of presentation.
         */
        material = flow.element("material");
      }
      Material matQuestion = (Material) parserManager.parse(material);
      if (matQuestion != null) instance.setQuestion(matQuestion);

      Element response_lid = presentationXML.element("response_lid");
View Full Code Here

      if (response_lid == null && flow != null) {
        response_lid = flow.element("response_lid");
      }
      String identQuestion = response_lid.attribute("ident").getText();
      instance.setIdent(identQuestion);
      String shuffle = response_lid.element("render_choice").attributeValue("shuffle");
      if (shuffle == null) shuffle = "Yes";
      instance.setShuffle(shuffle.equals("Yes"));

      // Set first flow_label class that is found for entire question. This
      // editor uses the same flow_label on every response
View Full Code Here

   */
  public static FIBQuestion getInstance(Element item) {
    FIBQuestion instance = new FIBQuestion();

    Element presentationXML = item.element("presentation");
    List elementsXML =  presentationXML.element("flow").elements();
    List responses = instance.getResponses();
    Element el_resprocessing = item.element("resprocessing");
 
    for(Iterator i = elementsXML.iterator(); i.hasNext();) {
      Element content = (Element)i.next()
View Full Code Here

    List feedbacks = new ArrayList();
    item.setItemfeedbacks(feedbacks);
    Question question = item.getQuestion();
    for (Iterator i = feedbacksXML.iterator(); i.hasNext();) {
      Element el_feedback = (Element)i.next();
      if (el_feedback.element("solution") != null) { // fetch solution
        Element el_solution = el_feedback.element("solution");
        question.setSolutionText(getMaterialAsString(el_solution));
      } else if (el_feedback.element("hint") != null) { // fetch hint
        Element el_hint = el_feedback.element("hint");
        question.setHintText(getMaterialAsString(el_hint));
View Full Code Here

                us.setLastname(unformatString(itemUsers.element("lastname").getText()));
                us.setLogin(unformatString(itemUsers.element("login").getText()));
                us.setPassword(unformatString(itemUsers.element("pass").getText()));
                us.setDeleted(itemUsers.element("deleted").getText());
               
                if (itemUsers.element("activatehash") != null) {
                  us.setActivatehash(unformatString(itemUsers.element("activatehash").getText()));
                } else {
                  us.setActivatehash("");
                }
                if (itemUsers.element("externalUserType") != null) {
View Full Code Here

                us.setLogin(unformatString(itemUsers.element("login").getText()));
                us.setPassword(unformatString(itemUsers.element("pass").getText()));
                us.setDeleted(itemUsers.element("deleted").getText());
               
                if (itemUsers.element("activatehash") != null) {
                  us.setActivatehash(unformatString(itemUsers.element("activatehash").getText()));
                } else {
                  us.setActivatehash("");
                }
                if (itemUsers.element("externalUserType") != null) {
                  us.setExternalUserType(unformatString(itemUsers.element("externalUserType").getText()));
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.