Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 shop2020 1
/**
2
 * 
3
 */
4
package in.shop2020.metamodel.core;
5
 
199 naveen 6
import java.util.ArrayList;
7
import java.util.List;
8
 
10 shop2020 9
import in.shop2020.metamodel.util.MetaModelComponent;
10
 
11
/**
45 naveen 12
 * Represents un-structured data about Slide, Feature and Bullet. It is used
13
 * judiciously by content developers to store multi-media content in support
14
 * component they are attached to.
10 shop2020 15
 * 
16
 * @author naveen
17
 *
18
 */
19
public class FreeformContent extends MetaModelComponent {
20
 
21
	/**
22
	 * 
23
	 */
24
	private static final long serialVersionUID = 1L;
25
 
199 naveen 26
	// Un-structured text only
27
	private List<String> freeformTexts;
10 shop2020 28
 
199 naveen 29
	private List<String> imageURLs;
10 shop2020 30
 
199 naveen 31
	private List<String> youtubeURLs;
32
 
10 shop2020 33
    /**
34
     * 
35
     */
199 naveen 36
    public FreeformContent() {
10 shop2020 37
    }
38
 
39
    /**
40
     * 
199 naveen 41
     * @param freeformText
10 shop2020 42
     */
199 naveen 43
    public FreeformContent(String freeformText) {
44
    	this.addFreeformText(freeformText);
10 shop2020 45
    }
46
 
199 naveen 47
	/**
48
	 * @param freeformTexts the freeformTexts to set
49
	 */
50
	public void setFreeformTexts(List<String> freeformTexts) {
51
		this.freeformTexts = freeformTexts;
52
	}
53
 
54
	/**
55
	 * 
56
	 * @param fft
57
	 */
58
	public void addFreeformText(String fft) {
59
		if(this.freeformTexts == null) {
60
			this.freeformTexts = new ArrayList<String>();
61
		}
62
 
63
		this.freeformTexts.add(fft);
64
	}
65
 
66
	/**
67
	 * @return the freeformTexts
68
	 */
69
	public List<String> getFreeformTexts() {
70
		return freeformTexts;
71
	}
72
 
73
 
74
	/**
75
	 * Return first free-form text
76
	 * 
77
	 * @return the freeformTexts
78
	 */
79
	public String getFreeformText() {
80
		if(this.freeformTexts != null && this.freeformTexts.size() > 0) {
81
			return this.freeformTexts.get(0);
82
		}
83
 
84
		return null;
85
	}
86
 
87
	/**
88
	 * @param imageURLs the imageURLs to set
89
	 */
90
	public void setImageURLs(List<String> imageURLs) {
91
		this.imageURLs = imageURLs;
92
	}
93
 
94
	/**
95
	 * Convenience method to add new image URL
96
	 * 
97
	 * @param imgURL
98
	 */
99
	public void addImageURL(String imgURL) {
100
		if(this.imageURLs == null) {
101
			this.imageURLs = new ArrayList<String>();
102
		}
103
 
104
		this.imageURLs.add(imgURL);
105
	}
106
 
107
	/**
108
	 * @return the imageURLs
109
	 */
110
	public List<String> getImageURLs() {
111
		return imageURLs;
112
	}
113
 
114
	/**
115
	 * @param youtubeURLs the youtubeURLs to set
116
	 */
117
	public void setYoutubeURLs(List<String> youtubeURLs) {
118
		this.youtubeURLs = youtubeURLs;
119
	}
120
 
121
	public void addYoutubeURL(String ytURL) {
122
		if(this.youtubeURLs == null) {
123
			this.youtubeURLs = new ArrayList<String>();
124
		}
125
 
126
		this.youtubeURLs.add(ytURL);
127
	}
128
 
129
	/**
130
	 * @return the youtubeURLs
131
	 */
132
	public List<String> getYoutubeURLs() {
133
		return youtubeURLs;
134
	}
135
 
34 naveen 136
	/* (non-Javadoc)
137
	 * @see java.lang.Object#toString()
138
	 */
139
	@Override
140
	public String toString() {
199 naveen 141
		return "FreeformContent [freeformTexts=" + freeformTexts
142
				+ ", imageURLs=" + imageURLs + ", youtubeURLs=" + youtubeURLs
143
				+ "]";
34 naveen 144
	}
145
 
10 shop2020 146
}