+ /*
+ * WRITE
+ */
+ public Node openForEdit(ProvidedSession contentSession, String jcrWorkspace, String jcrPath) {
+ try {
+ if (contentSession.isEditing()) {
+ JcrSessionAdapter sessionAdapter = getJcrSessionAdapter(contentSession);
+ return sessionAdapter.openForEdit(jcrWorkspace, jcrPath);
+ } else {
+ return getJcrSession(contentSession, jcrWorkspace).getNode(jcrPath);
+ }
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot open for edit " + jcrPath + " in workspace " + jcrWorkspace, e);
+ }
+ }
+
+ @Override
+ public void persist(ProvidedSession contentSession) {
+ try {
+ JcrSessionAdapter sessionAdapter = getJcrSessionAdapter(contentSession);
+ sessionAdapter.persist();
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot persist " + contentSession, e);
+ }
+ }
+