Package org.jboss.seam.wiki.core.model

Examples of org.jboss.seam.wiki.core.model.WikiNode


     *
     * @return
     */
    public String getForumName()
    {
       WikiNode parent = getInstance().getParent();
       while (parent != null && !(parent instanceof WikiDirectory))
       {
          parent = parent.getParent();
       }
       return (parent != null && parent instanceof WikiDirectory) ? parent.getName() : "";
    }
View Full Code Here


       return sb.toString();
    }

    public String getForumName()
    {
       WikiNode parent = getInstance().getParent();
       while (parent != null && !(parent instanceof WikiDirectory))
       {
          parent = parent.getParent();
       }
       return (parent != null && parent instanceof WikiDirectory) ? parent.getName() : null;
    }   
View Full Code Here

          recursiveAddChildren(wikiNodeDAO, node, nodesToDelete);
       }
      
       while (!nodesToDelete.isEmpty())
       {
          WikiNode nodeToDelete = null;
                   
          main: for (WikiNode node : nodesToDelete)
          {
             // We need to find a node without children contained in the same set (which should contain any children if they exist)
             for (WikiNode n : nodesToDelete)
             {
                if (n.getParent().equals(node)) continue main;
             }
            
             nodeToDelete = node;
             break;
          }
         
          if (nodeToDelete == null)
          {
             throw new IllegalStateException("Error while deleting child nodes - no childless node found in set.");
          }
          else
          {
             if (nodeToDelete instanceof WikiComment)
             {
                WikiComment comment = (WikiComment) nodeToDelete;
               
                documentHome.setId(getCommentDocument(comment).getId());
                CommentHome commentHome = (CommentHome) Component.getInstance("commentHome");
               
                commentHome.setId(comment.getId());
                commentHome.remove(comment.getId());            
             }
             else if (nodeToDelete instanceof WikiDocument)
             {
                documentHome.setId(nodeToDelete.getId());
                documentHome.reallyRemove();
             }
             else
             {
                log.info("Unhandled node found, could not delete: " + nodeToDelete);
View Full Code Here

       nodeSet.add(parent);
    }
   
    private WikiDocument getCommentDocument(WikiComment comment)
    {
       WikiNode parent = comment.getParent();
       while (!(parent instanceof WikiDocument))
       {
          parent = parent.getParent();
       }
       return (WikiDocument) parent;
    }
View Full Code Here

                         .executeUpdate();
    }

    // Multi-row constraint validation
    public boolean isUniqueWikiname(Long areaNumber, WikiNode node) {
        WikiNode foundNode = findWikiNodeInArea(areaNumber, node.getWikiname(), entityManager);
        return foundNode == null || node.getId() != null && node.getId().equals(foundNode.getId());
    }
View Full Code Here

        WikiNode foundNode = findWikiNodeInArea(areaNumber, node.getWikiname(), entityManager);
        return foundNode == null || node.getId() != null && node.getId().equals(foundNode.getId());
    }

    public boolean isUniqueWikiname(Long areaNumber, String wikiname) {
        WikiNode foundNode = findWikiNodeInArea(areaNumber, wikiname, entityManager);
        return foundNode == null;
    }
View Full Code Here

    }

    @Override
    public String persist() {
        // TODO: This is not pretty but this has really not been designed for non-threaded comments
        WikiNode oldParent = getParentNode(); // Remember old parent
        setParentNode(documentHome.getInstance()); // Set the "real" parent, which is the document
        String outcome = super.persist();
        setParentNode(oldParent); // Reset old parent afterwards

        if (outcome != null) {
View Full Code Here

TOP

Related Classes of org.jboss.seam.wiki.core.model.WikiNode

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.