1 package de.webman.generator; 2 3 8 public class ContentCall 9 { 10 11 14 private GeneratorContext context; 15 16 17 private SiteContent content; 18 19 20 private SiteDocument doc; 21 22 23 private SiteContentIntegration integration; 24 25 26 private SiteContentNode node; 27 28 29 private int primId; 30 31 32 private boolean perReference; 33 34 35 private boolean isStructureContents; 36 37 38 private boolean isPrimaryContents; 39 40 public ContentCall (GeneratorContext context, 41 SiteContent content, 42 SiteDocument doc, 43 SiteContentIntegration integration, 44 SiteContentNode node, 45 int primId, 46 boolean isPrim, 47 boolean isRef, 48 boolean isStructure) 49 { 50 51 this.context = context != null ? context : GeneratorContext.setup (); 52 this.content = content; 53 this.doc = doc; 54 this.integration = integration; 55 this.node = node; 56 this.primId = primId; 57 this.perReference = isRef; 58 this.isPrimaryContents = isPrim; 59 this.isStructureContents = isStructure; 60 } 61 62 public boolean isPrimaryContent() 63 { 64 return isPrimaryContents; 65 } 66 67 public void setPrimaryContent(boolean isPrimary) 68 { 69 isPrimaryContents = isPrimary; 70 } 71 72 public SiteContent getContent() 73 { 74 return content; 75 } 76 77 public boolean isPerReference() 78 { 79 return perReference; 80 } 81 82 public void setPerReference(boolean isRef) 83 { 84 perReference = isRef; 85 } 86 87 public boolean isStructureContent() 88 { 89 return isStructureContents; 90 } 91 92 public void setStructureContent(boolean isStructure) 93 { 94 isStructureContents = isStructure; 95 } 96 97 public int getPrimaryId() 98 { 99 return primId; 100 } 101 102 public SiteDocument getDocument() 103 { 104 return doc; 105 } 106 107 public String getInfo () 108 { 109 String info = isPrimaryContents ? "primary" : isStructureContents ? "struct" : "normal"; 110 if (perReference) return info + " / ref"; else return info; 111 } 112 113 public String docName () 114 { 115 SiteNode node = doc.getAnchor(); 116 if (node == null) return doc.getShortName(); 117 if ((primId < 0) || (node.getParent() == null)) return node.getPath() + doc.getShortName(); 118 String nodeName = content.getShortName() != null ? content.getShortName() : "id_" + primId; 119 return node.getParent().getPath() + nodeName + "/" + doc.getShortName(); 120 } 121 } 122 | Popular Tags |