1 16 package org.outerj.daisy.books.publisher.impl.bookmodel; 17 18 import org.outerx.daisy.x10Bookdef.SectionDocument; 19 20 public class Section implements SectionContainer { 21 private long documentId = -1; 22 private long branchId = -1; 23 private long languageId = -1; 24 private String version; 25 private String type; 26 private String bookStorePath; 27 private String title; 28 private SectionContainerHelper sectionContainerHelper = new SectionContainerHelper(); 29 30 public long getDocumentId() { 31 return documentId; 32 } 33 34 public void setDocumentId(long documentId) { 35 this.documentId = documentId; 36 } 37 38 public long getBranchId() { 39 return branchId; 40 } 41 42 public void setBranchId(long branchId) { 43 this.branchId = branchId; 44 } 45 46 public long getLanguageId() { 47 return languageId; 48 } 49 50 public void setLanguageId(long languageId) { 51 this.languageId = languageId; 52 } 53 54 public String getVersion() { 55 return version; 56 } 57 58 public void setVersion(String version) { 59 this.version = version; 60 } 61 62 public String getType() { 63 return type; 64 } 65 66 public void setType(String type) { 67 this.type = type; 68 } 69 70 public String getBookStorePath() { 71 return bookStorePath; 72 } 73 74 public void setBookStorePath(String bookStorePath) { 75 this.bookStorePath = bookStorePath; 76 } 77 78 public String getTitle() { 79 return title; 80 } 81 82 public void setTitle(String title) { 83 this.title = title; 84 } 85 86 public void addSection(Section section) { 87 sectionContainerHelper.addSection(section); 88 } 89 90 public Section[] getSections() { 91 return sectionContainerHelper.getSections(); 92 } 93 94 public SectionDocument.Section getXml() { 95 SectionDocument.Section sectionXml = SectionDocument.Section.Factory.newInstance(); 96 97 if (documentId != -1) 98 sectionXml.setDocumentId(documentId); 99 if (branchId != -1) 100 sectionXml.setBranch(String.valueOf(branchId)); 101 if (languageId != -1) 102 sectionXml.setLanguage(String.valueOf(languageId)); 103 if (version != null) 104 sectionXml.setVersion(version); 105 if (type != null) 106 sectionXml.setType(type); 107 if (bookStorePath != null) 108 sectionXml.setBookStorePath(bookStorePath); 109 if (title != null) 110 sectionXml.setTitle(title); 111 112 sectionContainerHelper.addXml(sectionXml); 113 114 return sectionXml; 115 } 116 } 117 | Popular Tags |