code: @Deprecated
      @Programmatic
      public Document createDocumentAndAttachPaperclips(
              final Object domainObject,
              final DocumentTemplate template) {
  
          final Document createdDocument = template.create(domainObject);
  
          final List<AttachmentAdvisor.PaperclipSpec> paperclipSpecs = template.newAttachmentAdvice(createdDocument, domainObject);
  
          for (AttachmentAdvisor.PaperclipSpec paperclipSpec : paperclipSpecs) {
              final String roleName = paperclipSpec.getRoleName();
              final Object attachTo = paperclipSpec.getAttachTo();
              final Document paperclipSpecCreatedDocument = paperclipSpec.getCreatedDocument();
              if(paperclipRepository.canAttach(attachTo)) {
                  paperclipRepository.attach(paperclipSpecCreatedDocument, roleName, attachTo);
              }
          }
  
          return createdDocument;
      }
docs: Replaced by {@link org.incode.module.document.dom.api.DocumentService#createDocumentAndAttachPaperclips(Object, DocumentTemplate)} as formal API.
  
  @param domainObject
  @param template
  @return