Package javax.jcr

Examples of javax.jcr.Session.importXML()


                        {
                           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);
                           return null;
                        }
                     });
                  }
                  catch (PrivilegedActionException pae)
View Full Code Here


        }

        // and import again underneath /a3
        InputStream in = new FileInputStream(tmpFile);
        try {
            session.importXML(a3.getPath(), in, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
            session.save();
        } finally {
            try { in.close(); } catch (IOException ignore) {}
        }
View Full Code Here

        }

        // and import again underneath /a3
        InputStream in = new FileInputStream(tmpFile);
        try {
            session.importXML(a3.getPath(), in, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
            session.save();
        } finally {
            try { in.close(); } catch (IOException ignore) {}
        }
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

         // delete existing entry...
            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);
         } catch (PathNotFoundException e) {
            createEntry(sessionProvider, groupPath, entry);
         }
         // 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);
                        return null;
                     }
                  });
               }
               catch (PrivilegedActionException pae)
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

         // delete existing entry...
            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);
         } catch (PathNotFoundException e) {
            createEntry(sessionProvider, groupPath, entry);
         }
         // 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);
                        return null;
                     }
                  });
               }
               catch (PrivilegedActionException pae)
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

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.