Example #1
0
 @Override
 public PublishedDocument publish(DocumentModel doc, PublicationNode targetNode) {
   SimpleCorePublishedDocument publishedDocument =
       (SimpleCorePublishedDocument) super.publish(doc, targetNode);
   PublicationRelationHelper.addPublicationRelation(publishedDocument.getProxy(), this);
   return publishedDocument;
 }
Example #2
0
 public void unpublish(PublishedDocument publishedDocument) {
   if (!accept(publishedDocument)) {
     return;
   }
   DocumentModel proxy = ((SimpleCorePublishedDocument) publishedDocument).getProxy();
   PublicationRelationHelper.removePublicationRelation(proxy);
   getCoreSession().removeDocument(proxy.getRef());
   getCoreSession().save();
 }