Examples of createComment()


Examples of org.olat.core.commons.services.commentAndRating.UserCommentsManager.createComment()

    // add comments
    UserCommentsManager ucm = service.getUserCommentsManager();
    UserCommentsManager ucm2 = serviceWithSubPath.getUserCommentsManager();
   
    UserComment comment1 = ucm.createComment(ident1, "Hello World");
    UserComment comment2 = ucm2.createComment(ident1, "Hello World with subpath");
    // count must be 1 now. count without subpath should not include the results with subpath
    assertEquals(Long.valueOf(1), service.getUserCommentsManager().countComments());
    assertEquals(Long.valueOf(1), serviceWithSubPath.getUserCommentsManager().countComments());
    //
    UserComment comment3 = ucm.createComment(ident2, "Hello World");
View Full Code Here

Examples of org.olat.core.commons.services.commentAndRating.UserCommentsManager.createComment()

    // count must be 1 now. count without subpath should not include the results with subpath
    assertEquals(Long.valueOf(1), service.getUserCommentsManager().countComments());
    assertEquals(Long.valueOf(1), serviceWithSubPath.getUserCommentsManager().countComments());
    //
    UserComment comment3 = ucm.createComment(ident2, "Hello World");
    UserComment comment4 = ucm2.createComment(ident2, "Hello World with subpath");
    assertEquals(Long.valueOf(2), service.getUserCommentsManager().countComments());
    assertEquals(Long.valueOf(2), serviceWithSubPath.getUserCommentsManager().countComments());
    // Same with get method
    List<UserComment> commentList = ucm.getComments();
    assertEquals(2, commentList.size());
View Full Code Here

Examples of org.olat.core.commons.services.commentAndRating.UserCommentsManager.createComment()

    // Create reply to a comment that does not exis anymore -> should not create anything
    assertNull(ucm.replyTo(comment1, ident2, "Reply 1"));
    assertNull(ucm.replyTo(comment2, ident2, "Reply 1 with subpath"));
    // Recreate first comment
    comment1 = ucm.createComment(ident1, "Hello World");
    comment2 = ucm2.createComment(ident1, "Hello World with subpath");
    // Recreate a reply to the first comments
    ucm.replyTo(comment1, ident2, "Reply 1");
    ucm.replyTo(comment2, ident2, "Reply 1 with subpath");
    assertEquals(Long.valueOf(3), service.getUserCommentsManager().countComments());
    assertEquals(Long.valueOf(3), serviceWithSubPath.getUserCommentsManager().countComments());
View Full Code Here

Examples of org.w3c.dom.Document.createComment()

        throws Exception
    {
        final Document document = createDocument();
        final String name = "meep";
        final Element element = document.createElement( name );
        final Comment comment = document.createComment( "comment" );
        element.appendChild( comment );
        final Configuration configuration = ConfigurationUtil.toConfiguration( element );

        assertEquals( "configuration.getName()", name, configuration.getName() );
        assertEquals( "configuration.getPath()",
View Full Code Here

Examples of org.w3c.dom.Document.createComment()

        else
          entity.appendChild(resultDocument.createTextNode(""));
        currentElement.appendChild(entity);
        break;
      case ParserInstruction.AddComment:
        Comment comment = resultDocument.createComment(domArgument);
        currentElement.appendChild(comment);
        break;
      case ParserInstruction.SetTitle:
        Element titleNode = createElementNS(resultDocument, currentNamespaceURI, "title");
        titleNode.appendChild(resultDocument.createTextNode(fixText(domArgument)));
View Full Code Here

Examples of org.w3c.dom.Document.createComment()

      // build the XML in memory using DOM
      DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
      Document doc = builder.newDocument();

      // Add a comment
      Comment comment = doc.createComment(" automatically produced by XMLAttributePersistenceManager ");
      doc.appendChild(comment);
     
      // Insert root element
      Element root = doc.createElement(AL_ROOT_ELEMENT);
      root.setAttribute(AL_ID_ATTRIBUTE, origId);
View Full Code Here

Examples of org.w3c.dom.Document.createComment()

                  // append the attribute to the attribute-list
                  root.appendChild(element);
               }
               else {
                  // could not serialize the object - write and log a warning
                  root.appendChild(doc.createComment(
                        " WARN <attribute name=\"" + name + "\" type=\"" + type +
                        "\"/> could not be serialized "));
                 
                  log.warn("Could not serialize attribute '" + name +
                           "' of type '" + type + "' and value: " + value);
View Full Code Here

Examples of org.w3c.dom.Document.createComment()

                           "' of type '" + type + "' and value: " + value);
               }
          }
          else {
             // (e) could not find a way to persist - record and log a warning
             root.appendChild(doc.createComment(
                   " WARN <attribute name=\"" + name + "\" type=\"" + type +
                     "\"/> could not be persisted "));
            
             log.warn("Could not find a way to persist attribute '" + name +
                      "' of type '" + type + "' and value: " + value);
View Full Code Here

Examples of org.w3c.dom.Document.createComment()

      // Sorted set with bundle archives, same bsn, different versions
      for (Iterator itV = bsnSet.iterator(); itV.hasNext();) {
        final BundleArchive ba = (BundleArchive) itV.next();

        dependencies.appendChild(doc.createTextNode("\n\n" +prefix2));
        dependencies.appendChild(doc.createComment(ba.relPath));
        dependencies.appendChild(doc.createTextNode("\n" +prefix2));

        final Element dependency = doc.createElement("dependency");
        dependencies.appendChild(dependency);
View Full Code Here

Examples of org.w3c.dom.Document.createComment()

      for (Iterator itV = bsnSet.iterator(); itV.hasNext();) {
        final BundleArchive ba = (BundleArchive) itV.next();
        final String targetName = ba.bsn + "-" + ba.version;
        targetNames.append(",").append(targetName);

        final Comment comment = doc.createComment(ba.relPath);
        final Element target = doc.createElement("target");
        target.setAttribute("name", targetName);

        final Element mvnDeployBundle = doc.createElement("mvn_deploy_bundle");
        target.appendChild(doc.createTextNode("\n"+prefix2));
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.