PackageDocumentBase.java 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package me.ag2s.epublib.epub;
  2. /**
  3. * Functionality shared by the PackageDocumentReader and the PackageDocumentWriter
  4. *
  5. * @author paul
  6. *
  7. */
  8. public class PackageDocumentBase {
  9. public static final String BOOK_ID_ID = "duokan-book-id";
  10. public static final String NAMESPACE_OPF = "http://www.idpf.org/2007/opf";
  11. public static final String NAMESPACE_DUBLIN_CORE = "http://purl.org/dc/elements/1.1/";
  12. public static final String PREFIX_DUBLIN_CORE = "dc";
  13. //public static final String PREFIX_OPF = "opf";
  14. //在EPUB3标准中,packge前面没有opf头,一些epub阅读器也不支持opf头。
  15. //Some Epub Reader not reconize op:packge,So just let it empty;
  16. public static final String PREFIX_OPF = "";
  17. //添加 version 变量来区分Epub文件的版本
  18. //Add the version field to distinguish the version of EPUB file
  19. public static final String version="version";
  20. public static final String dateFormat = "yyyy-MM-dd";
  21. protected interface DCTags {
  22. String title = "title";
  23. String creator = "creator";
  24. String subject = "subject";
  25. String description = "description";
  26. String publisher = "publisher";
  27. String contributor = "contributor";
  28. String date = "date";
  29. String type = "type";
  30. String format = "format";
  31. String identifier = "identifier";
  32. String source = "source";
  33. String language = "language";
  34. String relation = "relation";
  35. String coverage = "coverage";
  36. String rights = "rights";
  37. }
  38. protected interface DCAttributes {
  39. String scheme = "scheme";
  40. String id = "id";
  41. }
  42. protected interface OPFTags {
  43. String metadata = "metadata";
  44. String meta = "meta";
  45. String manifest = "manifest";
  46. String packageTag = "package";
  47. String itemref = "itemref";
  48. String spine = "spine";
  49. String reference = "reference";
  50. String guide = "guide";
  51. String item = "item";
  52. }
  53. protected interface OPFAttributes {
  54. String uniqueIdentifier = "unique-identifier";
  55. String idref = "idref";
  56. String name = "name";
  57. String content = "content";
  58. String type = "type";
  59. String href = "href";
  60. String linear = "linear";
  61. String event = "event";
  62. String role = "role";
  63. String file_as = "file-as";
  64. String id = "id";
  65. String media_type = "media-type";
  66. String title = "title";
  67. String toc = "toc";
  68. String version = "version";
  69. String scheme = "scheme";
  70. String property = "property";
  71. //add for epub3
  72. /**
  73. * add for epub3
  74. */
  75. String properties="properties";
  76. }
  77. protected interface OPFValues {
  78. String meta_cover = "cover";
  79. String reference_cover = "cover";
  80. String no = "no";
  81. String generator = "generator";
  82. String duokan = "duokan-body-font";
  83. }
  84. }