[daisy] [JIRA] Commented: (DSY-538) Use publishing requests in Book Publication

Bob Lannoy (JIRA) issues at cocoondev.org
Tue Aug 28 09:10:21 CDT 2007


    [ http://issues.cocoondev.org//browse/DSY-538?page=comments#action_13334 ] 

Bob Lannoy commented on DSY-538:
--------------------------------

As suggested by Bruno I tried to change the BookDataRetrievalProcess.java in the 2.0.1 branch since we're using that one.

Unfortunately I didn't find a way to access the book Metadata inside the code. So I had to change the number of parameters in the BookDataRetrievalProcess method so the bookMetaData is passed from BookPublishTask to the BookDataRetrievalProcess.


Index: RELEASE_2_0_1/daisy/applications/daisywiki/frontend/src/java/org/outerj/daisy/books/publisher/impl/BookPublishTask.java
===================================================================
--- RELEASE_2_0_1/daisy/applications/daisywiki/frontend/src/java/org/outerj/daisy/books/publisher/impl/BookPublishTask.java	(revision 4356)
+++ RELEASE_2_0_1/daisy/applications/daisywiki/frontend/src/java/org/outerj/daisy/books/publisher/impl/BookPublishTask.java	(working copy)
@@ -104,7 +104,7 @@
             }
 
             state = new String[] {"bookstate.retrieving-data"};
-            BookDataRetrievalProcess bookDataRetrievalProcess = new BookDataRetrievalProcess(repository, dataBranchId, dataLanguageId, locale, dataVersion, book, bookInstance, new AggregatedPartDecider(publicationTypes), publicationLog);
+            BookDataRetrievalProcess bookDataRetrievalProcess = new BookDataRetrievalProcess(repository, dataBranchId, dataLanguageId, locale, dataVersion, book, bookInstance, bookMetaData, new AggregatedPartDecider(publicationTypes), publicationLog);
             bookDataRetrievalProcess.run();
 
             // Save a copy of the publication specs
Index: RELEASE_2_0_1/daisy/applications/daisywiki/frontend/src/java/org/outerj/daisy/books/publisher/impl/dataretrieval/BookDataRetrievalProcess.java
===================================================================
--- RELEASE_2_0_1/daisy/applications/daisywiki/frontend/src/java/org/outerj/daisy/books/publisher/impl/dataretrieval/BookDataRetrievalProcess.java	(revision 4356)
+++ RELEASE_2_0_1/daisy/applications/daisywiki/frontend/src/java/org/outerj/daisy/books/publisher/impl/dataretrieval/BookDataRetrievalProcess.java	(working copy)
@@ -31,6 +31,7 @@
 
 import java.io.OutputStream;
 import java.util.Locale;
+import java.util.Map;
 
 /**
  * The process that retrieves all the data needed for the book (documents & images).
@@ -47,9 +48,10 @@
     private PartDecider partDecider;
     private BookDependencies bookDependencies = new BookDependencies();
     private PublicationLog publicationLog;
+    private Map bookMetaData;
 
     public BookDataRetrievalProcess(Repository repository, long dataBranchId, long dataLanguageId, Locale locale,
-            String dataVersion, Book book, BookInstance bookInstance, PartDecider partDecider,
+            String dataVersion, Book book, BookInstance bookInstance, Map bookMetaData, PartDecider partDecider,
             PublicationLog publicationLog) {
         this.repository = repository;
         this.publisher = (Publisher)repository.getExtension("Publisher");
@@ -61,6 +63,7 @@
         this.globalDataVersion = dataVersion;
         this.publicationLog = publicationLog;
         this.partDecider = partDecider;
+        this.bookMetaData = bookMetaData;
     }
 
     public void run() throws Exception {
@@ -111,6 +114,11 @@
                 documentRequestXml.setVersion(version);
                 PreparedDocumentsDocument.PreparedDocuments preparedDocsRequestXml = documentRequestXml.addNewPreparedDocuments();
                 PreparedDocumentsDocument.PreparedDocuments.Context preparedDocsContextXml = preparedDocsRequestXml.addNewContext();
+                if (bookMetaData.containsKey("publisherRequestSet")){
+                	  publicationLog.info("Using publisherRequestSet "+(String)bookMetaData.get("publisherRequestSet"));
+                    preparedDocsRequestXml.setPublisherRequestSet((String)bookMetaData.get("publisherRequestSet"));
+                  }
+                
                 preparedDocsContextXml.setBranch(String.valueOf(dataBranchId));
                 preparedDocsContextXml.setLanguage(String.valueOf(dataLanguageId));
 



> Use publishing requests in Book Publication
> -------------------------------------------
>
>          Key: DSY-538
>          URL: http://issues.cocoondev.org//browse/DSY-538
>      Project: Daisy
>         Type: New Feature
>   Components: Daisy Books
>     Versions: 2.0.1
>     Reporter: Bob Lannoy
>     Priority: Minor

>
> I've setup a Daisy site with several publicationtypes and I also use
> publishing requests to group some information into one page. 
> This works without a problem for the wiki. 
> Now I'm trying to create a book, but it seems like the pubreq I
> defined for the wiki isn't used. 
>  
> In the xml in the bookstore/<book>/data/documents directory I don't  see a p:group tag in the xml-documents. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



More information about the daisy mailing list