- Node paragraphNode = paragraph.getNode();
- Section section = paragraph.getSection();
- Session session = paragraphNode.getSession();
- paragraphNode.remove();
+ refresh(section);
+ layoutPage();
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot insert part " + node + " in section " + section.getNode(), e);
+ }
+ }
+
+ void deletePart(SectionPart sectionPart) {
+ try {
+ Node node = sectionPart.getNode();
+ Session session = node.getSession();
+ if (sectionPart instanceof Img) {
+ // FIXME make it more robust
+ node = node.getParent().getParent().getParent();
+ }
+ node.remove();