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

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


    // 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(IdentityConstants.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

    session.save();

    // user
    NodeImpl rootNode1 = (NodeImpl) exo1Session.getRootNode().getNode(ROOT_PATH);
    // Should not be autocreated
    ExtendedNode node1 = (ExtendedNode) rootNode1.addNode("testAuditHistory", "nt:unstructured");
    node1.addMixin("exo:auditable");
    if (!service.hasHistory(node1))
      service.createHistory(node1);
    exo1Session.save();
    service.addRecord(null, node1, Event.NODE_ADDED);
View Full Code Here

   *
   * @throws Exception
   */
  public void testReadHistory() throws Exception {
    NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH);
    ExtendedNode node = (ExtendedNode) rootNode.addNode("testReadHistory", "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.