Examples of ConfigurationNode


Examples of org.apache.manifoldcf.core.interfaces.ConfigurationNode

   *@param os is the current output specification for this job.
   *@return null if all is well, or a string error message if there is an error that should prevent saving of the job (and cause a redirection to an error page).
   */
  @Override
  public String processSpecificationPost(IPostParameters variableContext, Locale locale, OutputSpecification os) throws ManifoldCFException {
    ConfigurationNode specNode = getSpecNode(os);
    boolean bAdd = (specNode == null);
    if (bAdd) {
      specNode = new SpecificationNode(ParameterEnum.rootpath.name());
    }
    HDFSOutputSpecs.contextToSpecNode(variableContext, specNode);
View Full Code Here

Examples of org.apache.manifoldcf.core.interfaces.ConfigurationNode

      {
        StringBuilder zookeeperString = new StringBuilder();
        // Pull together the zookeeper string describing the zookeeper nodes
        for (int i = 0; i < params.getChildCount(); i++)
        {
          ConfigurationNode cn = params.getChild(i);
          if (cn.getType().equals(SolrConfig.NODE_ZOOKEEPER))
          {
            if (zookeeperString.length() > 0)
              zookeeperString.append(",");
            zookeeperString.append(cn.getAttributeValue(SolrConfig.ATTR_HOST)).append(":").append(cn.getAttributeValue(SolrConfig.ATTR_PORT));
          }
        }
       
        String znodePath = params.getParameter(SolrConfig.PARAM_ZOOKEEPER_ZNODE_PATH);
        if (znodePath == null)
View Full Code Here

Examples of org.apache.manifoldcf.core.interfaces.ConfigurationNode

      // Loop through the existing zookeeper nodes
      int k = 0;
      for (int i = 0; i < parameters.getChildCount(); i++)
      {
        ConfigurationNode cn = parameters.getChild(i);
        if (cn.getType().equals(SolrConfig.NODE_ZOOKEEPER))
        {
          String host = cn.getAttributeValue(SolrConfig.ATTR_HOST);
          String zkport = cn.getAttributeValue(SolrConfig.ATTR_PORT);
          String postfix = "zookeeper_"+k;
          out.print(
"        <tr class=\""+(((k % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
"          <td class=\"formcolumncell\">\n"+
"            <a name=\""+postfix+"\">\n"+
"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"SolrConnector.Delete") + "\" alt=\""+Messages.getAttributeString(locale,"SolrConnector.DeleteZookeeperHost")+Integer.toString(k+1)+"\" onclick='javascript:deleteZookeeperHost("+Integer.toString(k)+");'/>\n"+
"              <input type=\"hidden\" name=\""+"op_"+postfix+"\" value=\"Continue\"/>\n"+
"              <input type=\"hidden\" name=\""+"host_"+postfix+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(host)+"\"/>\n"+
"              <input type=\"hidden\" name=\""+"port_"+postfix+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(zkport)+"\"/>\n"+
"            </a>\n"+
"          </td>\n"+
"          <td class=\"formcolumncell\">\n"+
"            <nobr>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(host)+"</nobr>\n"+
"          </td>\n"+
"          <td class=\"formcolumncell\">\n"+
"            <nobr>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(zkport)+"</nobr>\n"+
"          </td>\n"+
"        </tr>\n"
          );
          k++;
        }
      }
      // If this looks like the first time through for this connection, add a default zookeeper setup.
      // Only works because after the first post, parameters always will have children.
      if (parameters.getChildCount() == 0)
      {
        String postfix = "zookeeper_"+k;
        out.print(
"        <tr class=\""+(((k % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
"          <td class=\"formcolumncell\">\n"+
"            <a name=\""+postfix+"\">\n"+
"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"SolrConnector.Delete") + "\" alt=\""+Messages.getAttributeString(locale,"SolrConnector.DeleteZookeeperHost")+Integer.toString(k+1)+"\" onclick='javascript:deleteZookeeperHost("+Integer.toString(k)+");'/>\n"+
"              <input type=\"hidden\" name=\""+"op_"+postfix+"\" value=\"Continue\"/>\n"+
"              <input type=\"hidden\" name=\""+"host_"+postfix+"\" value=\"localhost\"/>\n"+
"              <input type=\"hidden\" name=\""+"port_"+postfix+"\" value=\"2181\"/>\n"+
"            </a>\n"+
"          </td>\n"+
"          <td class=\"formcolumncell\">\n"+
"            <nobr>localhost</nobr>\n"+
"          </td>\n"+
"          <td class=\"formcolumncell\">\n"+
"            <nobr>2181</nobr>\n"+
"          </td>\n"+
"        </tr>\n"
        );
        k++;
      }
      if (k == 0)
      {
        out.print(
"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"3\">"+Messages.getBodyString(locale,"SolrConnector.NoZookeeperHostsSpecified")+"</td></tr>\n"
        );
      }
      out.print(
"        <tr class=\"formrow\"><td class=\"formseparator\" colspan=\"3\"><hr/></td></tr>\n"+
"        <tr class=\"formrow\">\n"+
"          <td class=\"formcolumncell\">\n"+
"            <a name=\"zookeeper\">\n"+
"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"SolrConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"SolrConnector.AddZookeeperHost") + "\" onclick=\"javascript:addZookeeperHost();\"/>\n"+
"            </a>\n"+
"            <input type=\"hidden\" name=\"count_zookeeper\" value=\""+k+"\"/>\n"+
"            <input type=\"hidden\" name=\"op_zookeeper\" value=\"Continue\"/>\n"+
"          </td>\n"+
"          <td class=\"formcolumncell\">\n"+
"            <nobr><input type=\"text\" size=\"30\" name=\"host_zookeeper\" value=\"\"/></nobr>\n"+
"          </td>\n"+
"          <td class=\"formcolumncell\">\n"+
"            <nobr><input type=\"text\" size=\"5\" name=\"port_zookeeper\" value=\"\"/></nobr>\n"+
"          </td>\n"+
"        </tr>\n"+
"      </table>\n"+
"    </td>\n"+
"  </tr>\n"+
"  <tr><td colspan=\"2\" class=\"separator\"><hr/></td></tr>\n"+
"  <tr>\n"+
"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"SolrConnector.ZnodePath") + "</nobr></td>\n"+
"    <td class=\"value\">\n"+
"      <input name=\"znodepath\" type=\"text\" size=\"16\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(znodePath)+"\"/>\n"+
"    </td>\n"+
"  </tr>\n"+
"  <tr><td colspan=\"2\" class=\"separator\"><hr/></td></tr>\n"+
"  <tr>\n"+
"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"SolrConnector.CollectionName") + "</nobr></td>\n"+
"    <td class=\"value\">\n"+
"      <input name=\"collection\" type=\"text\" size=\"16\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(collection)+"\"/>\n"+
"    </td>\n"+
"  </tr>\n"+
"  <tr><td colspan=\"2\" class=\"separator\"><hr/></td></tr>\n"+
"  <tr>\n"+
"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"SolrConnector.ZookeeperClientTimeout") + "</nobr></td>\n"+
"    <td class=\"value\">\n"+
"      <input name=\"zkclienttimeout\" type=\"text\" size=\"5\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(zkClientTimeout)+"\"/>\n"+
"    </td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"SolrConnector.ZookeeperConnectTimeout") + "</nobr></td>\n"+
"    <td class=\"value\">\n"+
"      <input name=\"zkconnecttimeout\" type=\"text\" size=\"5\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(zkConnectTimeout)+"\"/>\n"+
"    </td>\n"+
"  </tr>\n"+
"</table>\n"
      );
    }
    else
    {
      // Hiddens for Zookeeper tab
      int k = 0;
      for (int i = 0; i < parameters.getChildCount(); i++)
      {
        ConfigurationNode cn = parameters.getChild(i);
        if (cn.getType().equals(SolrConfig.NODE_ZOOKEEPER))
        {
          String host = cn.getAttributeValue(SolrConfig.ATTR_HOST);
          String zkport = cn.getAttributeValue(SolrConfig.ATTR_PORT);
          String postfix = "zookeeper_"+k;
          out.print(
"<input type=\"hidden\" name=\"host_"+postfix+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(host)+"\"/>\n"+
"<input type=\"hidden\" name=\"port_"+postfix+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(zkport)+"\"/>\n"
          );
View Full Code Here

Examples of org.apache.manifoldcf.core.interfaces.ConfigurationNode

        String[] folders = getChildFolderNames(parentFolder);
        int i = 0;
        while (i < folders.length)
        {
          String folder = folders[i++];
          ConfigurationNode node = new ConfigurationNode("folder");
          node.setValue(folder);
          output.addChild(output.getChildCount(),node);
        }
      }
      catch (ManifoldCFException e)
      {
        ManifoldCF.createErrorNode(output,e);
      }
    }
    else if (command.startsWith("folder/"))
    {
      String folder = command.substring("folder/".length());
      try
      {
        String canonicalFolder = validateFolderName(folder);
        if (canonicalFolder != null)
        {
          ConfigurationNode node = new ConfigurationNode("folder");
          node.setValue(canonicalFolder);
          output.addChild(output.getChildCount(),node);
        }
      }
      catch (ManifoldCFException e)
      {
View Full Code Here

Examples of org.bukkit.util.config.ConfigurationNode

          @SuppressWarnings("rawtypes")
          Entry<?, ?> e = (Entry) o;
          if (e.getKey() instanceof String) {
            try {
              String world = (String) e.getKey();
              ConfigurationNode waypoints = (ConfigurationNode) e.getValue();
              for (String name:waypoints.getKeys()) {
                Map<String, Object> locations = waypoints.getNode(name).getAll();
                int x, y = 64, z;
                x = (Integer) locations.get("x");
                if (locations.containsKey("y")) {
                  y = (Integer) locations.get("y");
                }
View Full Code Here

Examples of org.dynmap.ConfigurationNode

   
    public static FilePermissions create() {
        File f = new File("dynmap/permissions.yml");
        if(!f.exists())
            return null;
        ConfigurationNode cfg = new ConfigurationNode(f);
        cfg.load();
       
        Log.info("Using permissions.yml for access control");
       
        return new FilePermissions(cfg);
    }
View Full Code Here

Examples of org.sf.bee.commons.xml.configuration.impl.ConfigurationNode

        //-- loop on node's children --//
        for (final IConfigNode child : node) {
            // is child another configuration node?
            if (child instanceof ConfigurationNode) {
                //-- child is a configuration NODE --//
                final ConfigurationNode cn = (ConfigurationNode) child;
                if (cn.size() > 0) {
                    //-- add node --//
                    final String parentUid = this.concat(parentId, node);
                    final String uid = this.concat(parentUid, cn);
                    // RECURSIVELY add chlidren properties or nodes
                    this.addAll(uid, cn);
View Full Code Here

Examples of org.spout.cereal.config.ConfigurationNode

    try {
      config.load();
    } catch (ConfigurationException ex) {
      Spout.getLogger().warning("Unable to load recipes.yml: " + ex.getMessage());
    }
    ConfigurationNode recipesNode = config.getChild("recipes");
    for (String key : recipesNode.getKeys(false)) {
      ConfigurationNode recipe = recipesNode.getNode(key);
      RecipeBuilder builder = new RecipeBuilder();
      builder.setIncludeData(recipe.getNode("includedata") != null && recipe.getNode("includedata").getBoolean());
      String[] resultString = recipe.getNode("result").getString().split(",");
      Material matched = MaterialRegistry.get(resultString[0]);
      if (matched == null) {
        Spout.getLogger().log(Level.WARNING, "Unknown material result for {1}: {0}", new Object[] {resultString[0], key});
        continue;
      }
      int amount;
      try {
        amount = Integer.parseInt(resultString[1]);
      } catch (NumberFormatException numberFormatException) {
        Spout.getLogger().log(Level.WARNING, "Unknown number for {1}: {0}", new Object[] {resultString[1], key});
        amount = 1;
      } catch (IndexOutOfBoundsException ex) {
        Spout.getLogger().log(Level.WARNING, "Wrong number of parts for {1}: {0} should have a \",<amount>\" at the end of it.", new Object[] {recipe.getNode("result").getString(), key});
        amount = 1;
      }
      builder.setResult(matched, amount);
      if (recipe.getNode("type").getString().equalsIgnoreCase("Shaped")) {
        for (String inKey : recipe.getNode("ingredients").getKeys(false)) {
          Material ingredient = MaterialRegistry.get(recipe.getNode("ingredients").getNode(inKey).getString());
          if (ingredient == null) {
            Spout.getLogger().log(Level.WARNING, "Unknown material ingredient for {1}: {0}", new Object[] {recipe.getNode("ingredients").getNode(inKey).getString(), key});
            continue;
          }
          builder.setIngredient(inKey.charAt(0), ingredient);
        }
        for (Iterator<String> it = recipe.getNode("rows").getStringList().iterator(); it.hasNext(); ) {
          String row = it.next();
          List<Character> rowChars = new ArrayList<Character>();
          for (char c : row.toCharArray()) {
            rowChars.add(c);
          }
          builder.addRow(rowChars);
        }
        try {
          recipes.put(key, builder.buildShapedRecipe());
        } catch (IllegalStateException ex) {
          Spout.getLogger().log(Level.WARNING, "Error when adding recipe {0} because: {1}", new Object[] {key, ex.getMessage()});
        }
      } else if (recipe.getNode("type").getString().equalsIgnoreCase("Shapeless")) {
        for (String rowString : recipe.getNode("ingredients").getStringList(new ArrayList<String>())) {
          Material ingredient = MaterialRegistry.get(rowString);
          if (ingredient == null) {
            Spout.getLogger().log(Level.WARNING, "Unknown material ingredient for {1}: {0}", new Object[] {rowString, key});
            continue;
          }
          builder.addIngredient(ingredient);
        }
        try {
          recipes.put(key, builder.buildShapelessRecipe());
        } catch (IllegalStateException ex) {
          Spout.getLogger().log(Level.WARNING, "Error when adding recipe {0} because: {1}", new Object[] {key, ex.getMessage()});
        }
      } else if (recipe.getNode("type").getString().equalsIgnoreCase("Smelted")) {
        for (String rowString : recipe.getNode("ingredients").getStringList(new ArrayList<String>())) {
          Material ingredient = MaterialRegistry.get(rowString);
          if (ingredient == null) {
            Spout.getLogger().log(Level.WARNING, "Unknown material ingredient for {1}: {0}", new Object[] {recipe.getNode("ingredients").getNode(rowString).getString(), key});
            continue;
          }
          builder.addIngredient(ingredient);
        }
        try {
          recipes.put(key, builder.buildSmeltedRecipe());
        } catch (IllegalStateException ex) {
          Spout.getLogger().log(Level.WARNING, "Error when adding recipe {0} because: {1}", new Object[] {key, ex.getMessage()});
        }
      } else {
        Spout.getLogger().log(Level.INFO, "Unknown type " + recipe.getNode("type") + " when loading recipe from recipes.yml");
      }
    }
    recipes.remove(null);
    return new RecipeYaml(recipes);
  }
View Full Code Here

Examples of wecui.config.ConfigurationNode

        if (controller.configuration.ignoreUpdates()) {
            return;
        }

        InputStream is = null;
        ConfigurationNode node = new ConfigurationNode(new HashMap<String, Object>());

        try {
            URL url = new URL(controller.getConfiguration().getUpdateFile());
            url.openConnection();
            is = url.openStream();

            Yaml yaml = new Yaml();
            Object out = yaml.load(new UnicodeReader(is));

            try {
                if (null != out) {
                    node.setRoot((Map<String, Object>) out);
                }
            } catch (ClassCastException e) {
                throw new ConfigurationException("Root document must be an key-value structure");
            }

            String currentVersion = node.getString("updaterVersion" + this.updaterVersion + ".current");
            List<String> supportedVersions = node.getStringList("updaterVersion" + this.updaterVersion + ".supported", new ArrayList<String>());

            if (currentVersion != null && !currentVersion.equals(WorldEditCUI.VERSION) && !(currentVersion + "beta").equals(WorldEditCUI.VERSION)) {
                if (supportedVersions != null && !supportedVersions.contains(WorldEditCUI.VERSION)) {
                    controller.getObfuscation().showChatMessage(ChatColor.RED + "Your WorldEditCUI version is out of date! ");
                    controller.getObfuscation().showChatMessage(ChatColor.RED + "The latest version is " + currentVersion + ". http://bit.ly/wecui");
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.