BCcampus / pressbooks-openstax-import

[UNMAINTAINED] Pressbooks Plugin for OpenStax Textbook Import
GNU General Public License v3.0
5 stars 0 forks source link

getCollectionXml function #10

Closed bdolor closed 7 years ago

bdolor commented 7 years ago

similar to https://github.com/pressbooks/pressbooks/blob/dev/inc/modules/import/epub/class-epub201.php#L216 this returns a SimpleXML object if collection.xml exists. Could also check for the existence of cnx attribute(s)

bdolor commented 7 years ago

complete via https://github.com/BCcampus/pressbooks-openstax-import/commit/c1d72361ec4a3f57186b87d3db7d738fe8b31d60 see https://github.com/BCcampus/pressbooks-openstax-import/blob/dev/inc/modules/import/openstax/class-cnx.php#L113

bdolor commented 7 years ago

After testing a few books an edge case has been discovered and as a result this needs to account for both a nesting pattern two levels deep (current support for this) and three levels deep (for instance Anatomy, Biology textbooks). Some CNX textbooks have Units->Chapters->Chapter Parts instead of just Chapters->Chapter Parts.

When you pull in a book that has 'Units', no content can be imported:

image

In books with three levels, Pressbooks Parts and Chapters will need to be mapped to CNX Chapters, Chapter Parts. There is no content in Units so it will need to be be discarded (no where to represent it in PB)

bdolor commented 7 years ago

complete via https://github.com/BCcampus/pressbooks-openstax-import/commit/945773b2b1baca3ed50315add4c246c55d0a7739