Package javax.jcr

Examples of javax.jcr.Session.exportSystemView()


        tmpFile.deleteOnExit();

        // export system view of /a1/b1
        OutputStream out = new FileOutputStream(tmpFile);
        try {
            session.exportSystemView(b1.getPath(), out, false, false);
        } finally {
            out.close();
        }

        // and import again underneath /a3
View Full Code Here


        tmpFile.deleteOnExit();

        // export system view of /a1/b1
        OutputStream out = new FileOutputStream(tmpFile);
        try {
            session.exportSystemView(b1.getPath(), out, false, false);
        } finally {
            out.close();
        }

        // and import again underneath /a3
View Full Code Here

        Node node = session.getRootNode().addNode("node");
        node.addMixin("mix:referenceable");
        session.save();
        String uuid = node.getIdentifier();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        session.exportSystemView("/node", out, true, false);
        node.remove();
        session.save();
        session.importXML("/", new ByteArrayInputStream(out.toByteArray()),
                ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        session.save();
View Full Code Here

    byte[] repository_backup;

    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    Session session = getRepo().getSession();
    session.refresh( false );
        session.exportSystemView( "/" + "drools:repository", bout, false, false );
    repository_backup = bout.toByteArray();
    repo.importRulesRepositoryFromStream(new ByteArrayInputStream(
        repository_backup));
  }
View Full Code Here

         Session session = sp.getSession(workspaceName(repoPath), repo);

         bos = new ByteArrayOutputStream();
         if (viewType != null && (viewType.equalsIgnoreCase("system") || viewType.equalsIgnoreCase("sys")))
            session.exportSystemView(path(repoPath), bos, false, false);
         else
            session.exportDocumentView(path(repoPath), bos, false, false);

      }
      catch (LoginException e)
View Full Code Here

        byte[] repository_backup;

        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        Session session = getRepo().getSession();
        session.refresh( false );
        session.exportSystemView( "/" + "drools:repository", bout, false, false );
        repository_backup = bout.toByteArray();
        repo.importRulesRepositoryFromStream(new ByteArrayInputStream(
                repository_backup));
    }
View Full Code Here

         Session session = sp.getSession(workspaceName(repoPath), repo);

         bos = new ByteArrayOutputStream();
         if (viewType != null && (viewType.equalsIgnoreCase("system") || viewType.equalsIgnoreCase("sys")))
            session.exportSystemView(path(repoPath), bos, false, false);
         else
            session.exportDocumentView(path(repoPath), bos, false, false);

      }
      catch (LoginException e)
View Full Code Here

         defSession.save();

         File content = File.createTempFile("data", ".xml");
         content.deleteOnExit();
         OutputStream os = new BufferedOutputStream(new FileOutputStream(content));
         defSession.exportSystemView(node1.getPath(), os, false, false);
         os.close();
         defSession.logout();

         try
         {
View Full Code Here

      File exportFile = isSystemViewExport ? File.createTempFile("sys-export", ".xml") : File.createTempFile("doc-export", ".xml");
      exportFile.deleteOnExit();
     
      if (isSystemViewExport)
      {
         session1.exportSystemView(subRoot1.getPath(), new FileOutputStream(exportFile), false, false);
      }
      else
      {
         session1.exportDocumentView(subRoot1.getPath(), new FileOutputStream(exportFile), false, false);
      }
View Full Code Here

        byte[] repository_backup;

        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        Session session = getRepo().getSession();
        session.refresh( false );
        session.exportSystemView( "/" + "drools:repository", bout, false, false );
        repository_backup = bout.toByteArray();
        repo.importRulesRepositoryFromStream(new ByteArrayInputStream(
                repository_backup));
    }
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.