Package org.brixcms.jcr.api

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


            if (!sp.siteExists(wn, defaultState)) {
                Workspace w = sp.createSite(wn, defaultState);
                JcrSession session = brix.getCurrentSession(w.getId());

                session.importXML("/", getClass().getResourceAsStream("workspace.xml"),
                        ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);

                brix.initWorkspace(w, session);

                session.save();
View Full Code Here

        }

        if (uuidBehavior != ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW) {
            // simpler alternative - if we replace node or throw error on UUID
            // clash
            session.importXML(parentNode.getPath(), stream, uuidBehavior);
            return session.getNodeByIdentifier(uuid);
        } else {
            // more complicated alternative - on uuid clash node gets new uuid
            // and all
            // cloned references should use the new one
View Full Code Here

            // and all
            // cloned references should use the new one

            boolean exists = existing != null;

            session.importXML(parentNode.getPath(), stream, uuidBehavior);
            if (exists == false) {
                // if there was no node with such uuid in target workspace
                return session.getNodeByIdentifier(uuid);
            } else {
                // otherwise get the latest child with such name
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.