Package org.exoplatform.services.jcr.impl.core

Examples of org.exoplatform.services.jcr.impl.core.NodeImpl.addNode()


   * @throws Exception
   */
  public void testAddAuditWithExistingNode() throws Exception {
    NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH);

    ExtendedNode node = (ExtendedNode) rootNode.addNode("test_add_audit_existing_node",
                                                        "nt:unstructured");
    node.addMixin("exo:auditable");
    service.createHistory(node);
    session.save();
    String auditHistoryUUID = node.getProperty("exo:auditHistory").getString();
View Full Code Here


  public void testSetPropertyAfterAddAudit() throws Exception {

    NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH).addNode("SetPropertyAfterAddAudit");
    session.save();

    Node folder = rootNode.addNode("folder", "nt:folder");

    Node subfile = folder.addNode("subfile", "nt:file");
    Node contentNodeOfSubFile = subfile.addNode("jcr:content", "nt:resource");
    contentNodeOfSubFile.setProperty("jcr:lastModified", Calendar.getInstance());
    contentNodeOfSubFile.setProperty("jcr:mimeType", "text/xml");
View Full Code Here

    // rootAdmin.removePermission(SystemIdentity.ANY);
    // rootAdmin.setPermission(SystemIdentity.ANY, new
    // String[]{PermissionType.READ}); // exo
    // rootAdmin.save();

    auditServiceTestRoot = (NodeImpl) rootAdmin.addNode(ROOT_PATH);
    auditServiceTestRoot.addMixin("exo:privilegeable");
    auditServiceTestRoot.setPermission(SystemIdentity.ANY, PermissionType.ALL);
    rootAdmin.save();

    auditServiceTestRoot = (NodeImpl) root.getNode(ROOT_PATH);
View Full Code Here

  public void testAddAuditHistoryAction() throws Exception {
    // Should not be autocreated

    NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH);

    ExtendedNode node = (ExtendedNode) rootNode.addNode("deep");
    // node.addMixin("exo:auditable");
    session.save();
    String auditHistoryUUID = node.getProperty("exo:auditHistory").getString();
    Node auditHistory = session.getNodeByUUID(auditHistoryUUID);
View Full Code Here

   */
  public void testAddAuditHistoryMixinAction() throws Exception {
    NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH);

    // Should not be autocreated
    ExtendedNode node = (ExtendedNode) rootNode.addNode("mixin", "nt:unstructured");
    node.addMixin("exo:auditable");

    String auditHistoryUUID = node.getProperty("exo:auditHistory").getString();
    Node auditHistory = session.getNodeByUUID(auditHistoryUUID);

View Full Code Here

  public void testChangeSingleValueProperty() throws Exception {

    NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH);

    // Should not be autocreated
    ExtendedNode node = (ExtendedNode) rootNode.addNode("deep", "nt:unstructured");
    node.setProperty("test", "testValue1");
    node.setProperty("test", "testValue2");
    session.save();

    AuditHistory history = service.getHistory(node);
View Full Code Here

  public void testChangeMultiValueProperty() throws Exception {

    NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH);

    // Should not be autocreated
    ExtendedNode node = (ExtendedNode) rootNode.addNode("deep", "nt:unstructured");
    node.setProperty("test", new String[] { "testValue11", "testValue12" });
    node.setProperty("test", new String[] { "testValue21", "testValue22", "testValue23" });
    session.save();

    AuditHistory history = service.getHistory(node);
View Full Code Here

  public void testChangeBLOBValueProperty() throws Exception {

    NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH);

    // Should not be autocreated
    ExtendedNode node = (ExtendedNode) rootNode.addNode("deep", "nt:unstructured");

    // create BLOB property
    node.setProperty("test", new StringBufferInputStream("testValue1"));
    node.setProperty("test", new StringBufferInputStream("testValue2"));
    session.save();
View Full Code Here

  public void testAuditHistory() throws Exception {
    NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH);

    // Should not be autocreated
    ExtendedNode node = (ExtendedNode) rootNode.addNode("deep", "nt:unstructured");
    // node.addMixin("exo:auditable");
    String auditHistoryUUID = node.getProperty("exo:auditHistory").getString();
    Node auditHistory = session.getNodeByUUID(auditHistoryUUID);

    // under audit
View Full Code Here

   * @throws Exception
   */
  public void testCheckPermissions() throws Exception {
    // user
    NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH);
    ExtendedNode node = (ExtendedNode) rootNode.addNode("testAuditHistory", "nt:unstructured");
    node.addMixin("exo:auditable");
    if (!service.hasHistory(node))
      service.createHistory(node);
    session.save();
    service.addRecord(null, node, Event.NODE_ADDED);
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.