Examples of importXML()


Examples of javax.jcr.Workspace.importXML()

    public void testWorkspaceImportXML() throws Exception {
        Workspace wsp = testSession.getWorkspace();
        String parentPath = childNode.getPath();

        try {
            wsp.importXML(parentPath, getXmlForImport(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
            fail("Missing write privilege.");
        } catch (AccessDeniedException e) {
            // success
        }
View Full Code Here

Examples of javax.jcr.Workspace.importXML()

        }

        // with simple write privilege moving a node is not allowed.
        modify(parentPath, Privilege.JCR_WRITE, true);
        try {
            wsp.importXML(parentPath, getXmlForImport(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
            fail("Missing privilege jcr:nodeTypeManagement.");
        } catch (AccessDeniedException e) {
            // success
        }
View Full Code Here

Examples of javax.jcr.Workspace.importXML()

            // success
        }

        // adding jcr:nodeTypeManagement privilege will grant permission to move.
        modify(parentPath, REP_WRITE, true);
        wsp.importXML(parentPath, getXmlForImport(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
    }

    /**
     * Simple XML for testing permissions upon import.
     */
 
View Full Code Here

Examples of javax.jcr.Workspace.importXML()

        Workspace wsp = getTestSession().getWorkspace();
        String parentPath = childNode.getPath();

        checkReadOnly(parentPath);
        try {
            wsp.importXML(parentPath, getXmlForImport(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
            fail("Missing write privilege.");
        } catch (AccessDeniedException e) {
            // success
        }
View Full Code Here

Examples of javax.jcr.Workspace.importXML()

        }

        // with simple write privilege moving a node is not allowed.
        modifyPrivileges(parentPath, Privilege.JCR_WRITE, true);
        try {
            wsp.importXML(parentPath, getXmlForImport(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
            fail("Missing privilege jcr:nodeTypeManagement.");
        } catch (AccessDeniedException e) {
            // success
        }
View Full Code Here

Examples of javax.jcr.Workspace.importXML()

            // success
        }

        // adding jcr:nodeTypeManagement privilege will grant permission to move.
        modifyPrivileges(parentPath, PrivilegeRegistry.REP_WRITE, true);
        wsp.importXML(parentPath, getXmlForImport(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
    }

    /**
     * Simple XML for testing permissions upon import.
     *
 
View Full Code Here

Examples of javax.jcr.Workspace.importXML()

        testRootNode.getSession().save();

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

Examples of javax.jcr.Workspace.importXML()

        }

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

        // verify there's another element in the shared set
View Full Code Here

Examples of org.brixcms.jcr.api.JcrSession.importXML()

                            JcrSession session = brix.getCurrentSession(id);

                            if (session.itemExists(brix.getRootPath())) {
                                session.getItem(brix.getRootPath()).remove();
                            }
                            session.importXML("/", s,
                                    ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
                            session.save();

                            brix.initWorkspace(ManageSnapshotsPanel.this.getModelObject(), session);
View Full Code Here

Examples of org.exoplatform.services.jcr.core.ExtendedSession.importXML()

      ExtendedWorkspace extendedWorkspace = (ExtendedWorkspace)extendedSession.getWorkspace();
      if (isImportedByStream)
      {
         if (saveType == XmlSaveType.SESSION)
         {
            extendedSession.importXML(importRoot.getPath(), is, uuidBehavior);
         }
         else if (saveType == XmlSaveType.WORKSPACE)
         {
            extendedWorkspace.importXML(importRoot.getPath(), is, uuidBehavior);
         }
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.