Package org.dom4j

Examples of org.dom4j.Element.attributeValue()


            log.debug("binding plugin: " + descriptor.getKey());
            Plugin plugin = new Plugin(descriptor.getKey(), pluginKey);
            log.debug("plugin descriptor package path: " + plugin.getDescriptorPackagePath());
            registry.addPlugin(pluginKey, plugin);

            String pluginLabel = root.attributeValue("label");
            if (pluginLabel == null) pluginLabel = getMessage(plugin.getKey()+".label");
            plugin.setLabel(pluginLabel);

            bindPluginInfo(root, plugin);
            bindMacroPluginModules(registry, root, plugin);
View Full Code Here


    }

    private void bindMacroApplicableTo(Element descriptor, MacroPluginModule module) {
        Element applicableTo = descriptor.element("applicable-to");
        if (applicableTo != null) {
            boolean header = Boolean.parseBoolean(applicableTo.attributeValue("header"));
            boolean content = Boolean.parseBoolean(applicableTo.attributeValue("content"));
            boolean footer = Boolean.parseBoolean(applicableTo.attributeValue("footer"));
            List<MacroPluginModule.DocumentArea> applicableList = new ArrayList<MacroPluginModule.DocumentArea>();
            if (header) applicableList.add(MacroPluginModule.DocumentArea.HEADER);
            if (content) applicableList.add(MacroPluginModule.DocumentArea.CONTENT);
View Full Code Here

    private void bindMacroApplicableTo(Element descriptor, MacroPluginModule module) {
        Element applicableTo = descriptor.element("applicable-to");
        if (applicableTo != null) {
            boolean header = Boolean.parseBoolean(applicableTo.attributeValue("header"));
            boolean content = Boolean.parseBoolean(applicableTo.attributeValue("content"));
            boolean footer = Boolean.parseBoolean(applicableTo.attributeValue("footer"));
            List<MacroPluginModule.DocumentArea> applicableList = new ArrayList<MacroPluginModule.DocumentArea>();
            if (header) applicableList.add(MacroPluginModule.DocumentArea.HEADER);
            if (content) applicableList.add(MacroPluginModule.DocumentArea.CONTENT);
            if (footer) applicableList.add(MacroPluginModule.DocumentArea.FOOTER);
View Full Code Here

    private void bindMacroApplicableTo(Element descriptor, MacroPluginModule module) {
        Element applicableTo = descriptor.element("applicable-to");
        if (applicableTo != null) {
            boolean header = Boolean.parseBoolean(applicableTo.attributeValue("header"));
            boolean content = Boolean.parseBoolean(applicableTo.attributeValue("content"));
            boolean footer = Boolean.parseBoolean(applicableTo.attributeValue("footer"));
            List<MacroPluginModule.DocumentArea> applicableList = new ArrayList<MacroPluginModule.DocumentArea>();
            if (header) applicableList.add(MacroPluginModule.DocumentArea.HEADER);
            if (content) applicableList.add(MacroPluginModule.DocumentArea.CONTENT);
            if (footer) applicableList.add(MacroPluginModule.DocumentArea.FOOTER);
            MacroPluginModule.DocumentArea[] applicableArray = new MacroPluginModule.DocumentArea[applicableList.size()];
View Full Code Here

   
    List resourcesList = elResources.elements("resource");
    resources = new HashMap(resourcesList.size());
    for (Iterator iter = resourcesList.iterator(); iter.hasNext();) {
      Element elRes = (Element) iter.next();
      String identVal = elRes.attributeValue("identifier");
      String hrefVal = elRes.attributeValue("href");
      if (hrefVal != null) { // href is optional element for resource element
        try {
          hrefVal = URLDecoder.decode(hrefVal, "UTF-8");
        } catch (UnsupportedEncodingException e) {
View Full Code Here

    List resourcesList = elResources.elements("resource");
    resources = new HashMap(resourcesList.size());
    for (Iterator iter = resourcesList.iterator(); iter.hasNext();) {
      Element elRes = (Element) iter.next();
      String identVal = elRes.attributeValue("identifier");
      String hrefVal = elRes.attributeValue("href");
      if (hrefVal != null) { // href is optional element for resource element
        try {
          hrefVal = URLDecoder.decode(hrefVal, "UTF-8");
        } catch (UnsupportedEncodingException e) {
          // each JVM must implement UTF-8
View Full Code Here

    if (fulfilled) {
      vars = itc.getVariables();
      List setvars = el_respcond.selectNodes("setvar");
      for (Iterator iter = setvars.iterator(); iter.hasNext();) {
        Element element = (Element) iter.next();
        String action = element.attributeValue("action");
        String varName = element.attributeValue("varname");
        if (varName == null) varName = "SCORE";
        varName.trim();
        String varVal = element.getText();
        Variable var = vars.getVariable(varName);
View Full Code Here

      vars = itc.getVariables();
      List setvars = el_respcond.selectNodes("setvar");
      for (Iterator iter = setvars.iterator(); iter.hasNext();) {
        Element element = (Element) iter.next();
        String action = element.attributeValue("action");
        String varName = element.attributeValue("varname");
        if (varName == null) varName = "SCORE";
        varName.trim();
        String varVal = element.getText();
        Variable var = vars.getVariable(varName);
        if (var == null) throw new RuntimeException("var "+varName+" is in setvar, but was not declared ");
View Full Code Here

      //<!ATTLIST displayfeedback  feedbacktype  (Response | Solution | Hint )  'Response' %I_LinkRefId; >
      Output output = itc.getOutput();
      List fbs = el_respcond.selectNodes("displayfeedback");
      for (Iterator it_fbs = fbs.iterator(); it_fbs.hasNext();) {
        Element el_dispfb = (Element) it_fbs.next();
        String linkRefId = el_dispfb.attributeValue("linkrefid"); // must exist (dtd)
        String feedbacktype = el_dispfb.attributeValue("feedbacktype"); // must exist (dtd)
        Element el_resolved =
          (Element) itc.getEl_item().selectSingleNode(".//itemfeedback[@ident='" + linkRefId + "']");
        if (el_resolved == null) continue;
        if (feedbacktype.equals("Response")) {
View Full Code Here

      Output output = itc.getOutput();
      List fbs = el_respcond.selectNodes("displayfeedback");
      for (Iterator it_fbs = fbs.iterator(); it_fbs.hasNext();) {
        Element el_dispfb = (Element) it_fbs.next();
        String linkRefId = el_dispfb.attributeValue("linkrefid"); // must exist (dtd)
        String feedbacktype = el_dispfb.attributeValue("feedbacktype"); // must exist (dtd)
        Element el_resolved =
          (Element) itc.getEl_item().selectSingleNode(".//itemfeedback[@ident='" + linkRefId + "']");
        if (el_resolved == null) continue;
        if (feedbacktype.equals("Response")) {
          // additional (olat) rule:
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.