001: package de.webman.generator;
002:
003: /**
004: * Zuordnung Content - Dokument
005: * @author $Author: alex $
006: * @version $Revision: 1.2 $
007: */
008: public class ContentCall {
009:
010: /**
011: Verweis zurück auf den aktuellen statischen Kontext des laufenden Threads
012: */
013: private GeneratorContext context;
014:
015: /** Content */
016: private SiteContent content;
017:
018: /** Aufrufendes Dokument */
019: private SiteDocument doc;
020:
021: /** Zeiger auf Präsentations-Komponente */
022: private SiteContentIntegration integration;
023:
024: /** Content-Node am dem der Content hängt */
025: private SiteContentNode node;
026:
027: /** Primary Content Id, falls der Content ein GruppenContent ist */
028: private int primId;
029:
030: /** call per Reference ? */
031: private boolean perReference;
032:
033: /** Struktur-Contents ? */
034: private boolean isStructureContents;
035:
036: /** Primary-Contents ? */
037: private boolean isPrimaryContents;
038:
039: public ContentCall(GeneratorContext context, SiteContent content,
040: SiteDocument doc, SiteContentIntegration integration,
041: SiteContentNode node, int primId, boolean isPrim,
042: boolean isRef, boolean isStructure) {
043:
044: this .context = context != null ? context : GeneratorContext
045: .setup();
046: this .content = content;
047: this .doc = doc;
048: this .integration = integration;
049: this .node = node;
050: this .primId = primId;
051: this .perReference = isRef;
052: this .isPrimaryContents = isPrim;
053: this .isStructureContents = isStructure;
054: }
055:
056: public boolean isPrimaryContent() {
057: return isPrimaryContents;
058: }
059:
060: public void setPrimaryContent(boolean isPrimary) {
061: isPrimaryContents = isPrimary;
062: }
063:
064: public SiteContent getContent() {
065: return content;
066: }
067:
068: public boolean isPerReference() {
069: return perReference;
070: }
071:
072: public void setPerReference(boolean isRef) {
073: perReference = isRef;
074: }
075:
076: public boolean isStructureContent() {
077: return isStructureContents;
078: }
079:
080: public void setStructureContent(boolean isStructure) {
081: isStructureContents = isStructure;
082: }
083:
084: public int getPrimaryId() {
085: return primId;
086: }
087:
088: public SiteDocument getDocument() {
089: return doc;
090: }
091:
092: public String getInfo() {
093: String info = isPrimaryContents ? "primary"
094: : isStructureContents ? "struct" : "normal";
095: if (perReference)
096: return info + " / ref";
097: else
098: return info;
099: }
100:
101: public String docName() {
102: SiteNode node = doc.getAnchor();
103: if (node == null)
104: return doc.getShortName();
105: if ((primId < 0) || (node.getParent() == null))
106: return node.getPath() + doc.getShortName();
107: String nodeName = content.getShortName() != null ? content
108: .getShortName() : "id_" + primId;
109: return node.getParent().getPath() + nodeName + "/"
110: + doc.getShortName();
111: }
112: }
|