Package org.jdom

Examples of org.jdom.Element.removeChildren()


            changesDoc = new Document(documentElement);
        }

        final Element releaseElement = findOrCreateReleaseElement(bodyElement, relVersion);
        releaseElement.removeChildren("action");

        if (!bodyElement.getChildren().contains(releaseElement)) {
            bodyElement.addContent(releaseElement);
        }
View Full Code Here


    else if (p.getProperty("info","").equals("dc"))
    {
      Element machine = new Element("object");
      transaction.addContent(machine);
      loadObject(machine,home+"users/"+credentials.getProperty("username")+"/device/"+object.getAttributeValue("resourceguid")+"/");
      machine.removeChildren("attribute");

      File list[] = new File(home+"users/"+credentials.getProperty("username")+"/dc/").listFiles();
      if (list != null)
      {
        for (int x=0; x<list.length; x++)
View Full Code Here

    Element object2 = new Element("object");
    loadObject(object2,home+"users/"+credentials.getProperty("username")+"/device/"+object.getAttributeValue("resourceguid")+"/");
    Properties attributes = new Properties();
    getExtendedAttributes(object2,attributes);

    object2.removeChildren("attribute");
    transaction.addContent(object2);
    if (type.equals("acquire"))
    {
      //p.getProperty("type").equals("write");
      //p.getProperty("duration");
View Full Code Here

    Element object3 = new Element("object");
    loadObject(object3,home+"users/"+credentials.getProperty("username")+"/device/"+object.getAttributeValue("resourceguid")+"/");
    Properties entittyname = new Properties();
    getExtendedAttributes(object3,entittyname);
    object3.removeChildren("attribute");
    object3.removeAttribute("resourceid");
    object3.removeAttribute("entitytype");
    transaction.addContent(object3);

    Common.recurseDelete(home+"users/"+credentials.getProperty("username")+"/device/"+object.getAttributeValue("resourceguid")+"/",false);
View Full Code Here

    out.write(fileData.getBytes());
    out.close();
    Element object3 = new Element("object");

    Properties raw = loadObject(object3,home+"users/"+credentials.getProperty("username")+"/dc/"+object.getAttributeValue("resourceguid")+"/");
    object3.removeChildren("attribute");
    object3.removeAttribute("resourceid");
    object3.removeAttribute("entitytype");
    transaction.addContent(object3);

    Properties info = (Properties)raw.get("info");
View Full Code Here

    in.readFully(b);
    in.close();
    fileData = new String(b);
    Element object3 = new Element("object");

    object3.removeChildren("attribute");
    object3.removeAttribute("resourceid");
    object3.removeAttribute("entitytype");
    transaction.addContent(object3);
    Element file2 = new Element("file");
    object3.addContent(file2);
View Full Code Here

      localAttributes.put("localversion",localVersion);
      common_code.writeXMLObject(home+"users/"+credentials.getProperty("username")+"/dc/"+object.getAttributeValue("resourceguid")+"/"+machineGuid+"/attributes.XML",localAttributes,"props");
    }

    loadObject(object2,home+"users/"+credentials.getProperty("username")+"/dc/"+guid+"/");
    object2.removeChildren("attribute");

    addSuccess(transaction);
  }

  public void processReset(Element t, Element response, Properties credentials, String locktoken) throws Exception
View Full Code Here

    common_code.writeXMLObject(home+"users/"+credentials.getProperty("username")+"/dc/"+guid+"/attributes.XML",attributes,"props");

    Element object2 = new Element("object");
    transaction.addContent(object2);
    loadObject(object2,home+"users/"+credentials.getProperty("username")+"/dc/"+guid+"/");
    object2.removeChildren("attribute");

    addSuccess(transaction);
  }

  public void makeObject(String path, String entityid, String entitytype, String entityname, String description, String guid) throws Exception
View Full Code Here

                            device));
        }

        Namespace namespace = tacElement.getNamespace();
        // remove all the existing TAC number elements
        tacElement.removeChildren(DeviceRepositorySchemaConstants.
                NUMBER_ELEMENT_NAME, namespace);

        // add the new TACs
        for (int i = tacs.length - 1; i >= 0; i--) {
            // create a tac number element
View Full Code Here

                            "identification-element-missing",
                            device));
        }
        Namespace namespace = patternElement.getNamespace();
        // remove all the existing userAgent elements
        patternElement.removeChildren(DeviceRepositorySchemaConstants.
                USER_AGENT_PATTERN_ELEMENT_NAME,
                namespace);

        // add the new user agent patterns ensuring that they are added
        // before any other child elements and in the right order
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.