Package com.dotcms.repackage.org.jdom

Examples of com.dotcms.repackage.org.jdom.Element


      }
      Document document = getResponseAsDocument();
      if (document == null) {
        return responses;
      }
      Element root = document.getRootElement();
      List<Element> responseEls = RespUtils.getElements(root, "response");
      for (Element el : responseEls) {
        Response resp = new Response(serverDate, el);

        // Dont add if href is the requested url
View Full Code Here


        parentHref = href.substring(0, pos - 1);
      } else {
        parentHref = null;
      }

      Element el = elResponse.getChild("propstat", RespUtils.NS_DAV).getChild("prop", RespUtils.NS_DAV);
      if (href.contains("/")) {
        String[] arr = href.split("[/]");
        if (arr.length > 0) {
          name = arr[arr.length - 1];
        } else {
          name = "";
        }
      } else {
        name = href;
      }
      String dn = RespUtils.asString(el, "displayname");
      displayName = (dn == null) ? name : dn;
      createdDate = RespUtils.asString(el, "creationdate");
      modifiedDate = RespUtils.asString(el, "getlastmodified");

      contentType = RespUtils.asString(el, "getcontenttype");
      contentLength = RespUtils.asLong(el, "getcontentlength");
      quotaAvailableBytes = RespUtils.asLong(el, "quota-available-bytes");
      quotaUsedBytes = RespUtils.asLong(el, "quota-used-bytes");
      crc = RespUtils.asLong(el, "crc", NS_CLYDE);
      isCollection = RespUtils.hasChild(el, "collection");
     
      Element elLockDisc = el.getChild("lockdiscovery", RespUtils.NS_DAV);
      if (elLockDisc != null) {
        Element elActiveLock = elLockDisc.getChild("activelock", RespUtils.NS_DAV);
        if (elActiveLock != null) {         
          lockOwner = RespUtils.asString(elActiveLock, "owner");
          Element elToken = elActiveLock.getChild("locktoken", RespUtils.NS_DAV);
          if (elToken != null) {
            String t = RespUtils.asString(elToken, "href");
            if (t != null && t.contains(":")) {
              t = t.substring(t.indexOf(":"));
            }
View Full Code Here

    private static final Logger log = LoggerFactory.getLogger( RespUtils.class );
   
    public static Namespace NS_DAV = Namespace.getNamespace("D", "DAV:");
   
    public static String asString( Element el, String name ) {
        Element elChild = el.getChild( name, NS_DAV  );
        if( elChild == null ) {
            //log.debug("No child: " + name + " of " + el.getName());           
            return null;
        }
        return elChild.getText();
    }
View Full Code Here

//        System.out.println("asString: " + qname + " in: " + el.getName());
//        for( Object o : el.elements() ) {
//            Element e = (Element) o;
//            System.out.println(" - " + e.getQualifiedName());
//        }
        Element elChild = el.getChild( name, ns );
        if( elChild == null ) return null;
        return elChild.getText();
    }   
View Full Code Here

            Document document = getResponseAsDocument();
            if( document == null ) {
                throw new RuntimeException("Got empty response to LOCK request");
            }
            Element root = document.getRootElement();
            List<Element> lockTokenEls = RespUtils.getElements(root, "locktoken");
            for( Element el : lockTokenEls) {
        String token = RespUtils.asString( el, "href" );
        if( token == null ) {
          throw new RuntimeException("No href element in locktoken");
View Full Code Here

public class TestStxxAction extends Action {

  public ActionForward execute(ActionMapping mapping, ActionForm form,
      HttpServletRequest req, HttpServletResponse res) throws Exception {

    Document document = new Document(new Element("test"));

    Element usersEl = new Element("users");

    Iterator itr = CompanyLocalManagerUtil.getUsers(
        PortalUtil.getCompanyId(req)).iterator();

    while (itr.hasNext()) {
      User user = (User) itr.next();

      Element userEl = new Element("user");

      userEl.addContent(new Element("full-name").setText(user
          .getFullName()));

      userEl.addContent(new Element("email-address").setText(user
          .getEmailAddress()));

      usersEl.addContent(userEl);
    }
View Full Code Here

     */
    private final void treeWalk(Element e, Collection theElements )
    {
        for (Iterator i=e.getChildren().iterator(); i.hasNext(); )
        {
            Element child = (Element)i.next();
            theElements.add(child);
            treeWalk(child, theElements);
        }
    }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.jdom.Element

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.