Package javax.jcr

Examples of javax.jcr.Session.importXML()


   public void testPermissionAfterImport() throws Exception
   {
      Session session1 = repository.login(new CredentialsImpl("root", "exo".toCharArray()));
      InputStream importStream = BaseStandaloneTest.class.getResourceAsStream("/import-export/testPermdocview.xml");
      session1.importXML("/", importStream, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
      session1.save();
      // After import
      ExtendedNode testNode = (ExtendedNode)session1.getItem("/a");
      List<AccessControlEntry> permsList = testNode.getACL().getPermissionEntries();
      int permsListTotal = 0;
View Full Code Here


         node.remove();

         // create same entry,
         // [PN] no check we need here, as we have deleted this node before
         // checkGroup(sessionProvider, fullParentPath);
         session.importXML(parentFullPath, entry.getAsInputStream(), IMPORT_UUID_CREATE_NEW);

         // save recreated changes
         session.save();
         // }
      }
View Full Code Here

               {
                  DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                  ByteArrayInputStream stream = new ByteArrayInputStream(xml.getBytes());
                  Document document = builder.parse(stream);
                  RegistryEntry entry = new RegistryEntry(document);
                  sysSession.importXML(fullPath, entry.getAsInputStream(), IMPORT_UUID_CREATE_NEW);
               }
               catch (ParserConfigurationException e)
               {
                  e.printStackTrace();
               }
View Full Code Here

        String uuid = node.getIdentifier();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        session.exportSystemView("/node", out, true, false);
        node.remove();
        session.save();
        session.importXML("/", new ByteArrayInputStream(out.toByteArray()),
                IMPORT_UUID_CREATE_NEW);
        session.save();
        node = session.getNode("/node");
        assertFalse(uuid.equals(node.getIdentifier()));
    }
View Full Code Here

   public void testPermissionAfterImport() throws Exception
   {
      Session session1 = repository.login(new CredentialsImpl("root", "exo".toCharArray()));
      InputStream importStream = BaseStandaloneTest.class.getResourceAsStream("/import-export/testPermdocview.xml");
      session1.importXML("/", importStream, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
      session1.save();
      // After import
      ExtendedNode testNode = (ExtendedNode)session1.getItem("/a");
      List<AccessControlEntry> permsList = testNode.getACL().getPermissionEntries();
      int permsListTotal = 0;
View Full Code Here

    */
   public void testPermissionAfterImport() throws Exception
   {
      Session session1 = repository.login(new CredentialsImpl("root", "exo".toCharArray()));
      InputStream importStream = BaseStandaloneTest.class.getResourceAsStream("/import-export/testPermdocview.xml");
      session1.importXML("/", importStream, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
      session1.save();
      // After import
      ExtendedNode testNode = (ExtendedNode)session1.getItem("/a");
      List<AccessControlEntry> permsList = testNode.getACL().getPermissionEntries();
      int permsListTotal = 0;
View Full Code Here

                // Create an unstructured node under which to import the XML
                Node node = root.addNode("importxml", "nt:unstructured");
                // Import the file "test.xml" under the created node
                FileInputStream xml = new FileInputStream(TESTATA_PATH + "jcr-import-test.xml");
                try {
                    session.importXML(node.getPath(), xml, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
                } finally {
                    xml.close();
                }
                // Save the changes to the repository
                session.save();
View Full Code Here

        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();
        node = session.getNode("/node");
        assertFalse(uuid.equals(node.getIdentifier()));
    }
View Full Code Here

         node.remove();

         // create same entry,
         // [PN] no check we need here, as we have deleted this node before
         // checkGroup(sessionProvider, fullParentPath);
         session.importXML(parentFullPath, entry.getAsInputStream(), IMPORT_UUID_CREATE_NEW);

         // save recreated changes
         session.save();
         // }
      }
View Full Code Here

               {
                  DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                  ByteArrayInputStream stream = new ByteArrayInputStream(xml.getBytes());
                  Document document = builder.parse(stream);
                  RegistryEntry entry = new RegistryEntry(document);
                  sysSession.importXML(fullPath, entry.getAsInputStream(), IMPORT_UUID_CREATE_NEW);
               }
               catch (ParserConfigurationException e)
               {
                  e.printStackTrace();
               }
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.