1 28 29 package com.opencms.defaults.master; 30 31 import org.opencms.db.CmsDbUtil; 32 import org.opencms.util.CmsUUID; 33 34 44 public class CmsMasterMedia { 45 46 47 private int m_id; 48 49 50 private CmsUUID m_masterId; 51 52 53 private int m_position; 54 55 56 private int m_width; 57 58 59 private int m_height; 60 61 62 private int m_size; 63 64 65 private String m_mimetype; 66 67 68 private int m_type; 69 70 71 private String m_title; 72 73 74 private String m_name; 75 76 77 private String m_description; 78 79 80 private byte[] m_media; 81 82 83 public static final int C_MEDIA_TYPE_IMAGE = 0; 84 85 86 public static final int C_MEDIA_TYPE_FILE = 1; 87 88 89 public static final String C_DEFAULT_MIMETYPE = "application/octet-stream"; 90 91 95 public CmsMasterMedia() { 96 m_id = CmsDbUtil.UNKNOWN_ID; 97 m_masterId = CmsUUID.getNullUUID(); 98 m_position = CmsDbUtil.UNKNOWN_ID; 99 m_width = CmsDbUtil.UNKNOWN_ID; 100 m_height = CmsDbUtil.UNKNOWN_ID; 101 m_size = CmsDbUtil.UNKNOWN_ID; 102 m_mimetype = C_DEFAULT_MIMETYPE; 103 m_type = CmsDbUtil.UNKNOWN_ID; 104 m_title = ""; 105 m_name = ""; 106 m_description =""; 107 m_media = new byte[0]; 108 } 109 110 113 public CmsMasterMedia(int position, int width, int height, int size, 114 String mimetype, int type, String title, String name, 115 String description, byte[] media) { 116 this(); 117 m_position = position; 118 m_width = width; 119 m_height = height; 120 m_size = size; 121 m_mimetype = mimetype; 122 m_type = type; 123 m_title = title; 124 m_name = name; 125 m_description = description; 126 m_media = media; 127 } 128 129 132 public CmsMasterMedia(int id, CmsUUID masterId, int position, int width, 133 int height, int size, String mimetype, int type, 134 String title, String name, String description, 135 byte[] media) { 136 this(position, width, height, size, mimetype, type, title, name, 137 description, media); 138 m_id = id; 139 m_masterId = masterId; 140 } 141 142 144 public int getId() { 145 return m_id; 146 } 147 148 public CmsUUID getMasterId() { 149 return m_masterId; 150 } 151 152 public int getPosition() { 153 return m_position; 154 } 155 156 public int getWidth() { 157 return m_width; 158 } 159 160 public int getHeight() { 161 return m_height; 162 } 163 164 public int getSize() { 165 return m_size; 166 } 167 168 public String getMimetype() { 169 return m_mimetype; 170 } 171 172 public int getType() { 173 return m_type; 174 } 175 176 public String getTitle() { 177 return m_title; 178 } 179 180 public String getName() { 181 return m_name; 182 } 183 184 public String getDescription() { 185 return m_description; 186 } 187 188 public byte[] getMedia() { 189 return m_media; 190 } 191 192 196 public void setId(int id) { 197 m_id = id; 198 } 199 200 204 public void setMasterId(CmsUUID masterId) { 205 m_masterId = masterId; 206 } 207 208 public void setPosition(int pos) { 209 m_position = pos; 210 } 211 212 public void setWidth(int width) { 213 m_width = width; 214 } 215 216 public void setHeight(int height) { 217 m_height = height; 218 } 219 220 public void setSize(int size) { 221 m_size = size; 222 } 223 224 public void setMimetype(String mimetype) { 225 m_mimetype = mimetype; 226 } 227 228 public void setType(int type) { 229 m_type = type; 230 } 231 232 public void setTitle(String title) { 233 m_title = title; 234 } 235 236 public void setName(String name) { 237 m_name = name; 238 } 239 240 public void setDescription(String desc) { 241 m_description = desc; 242 } 243 244 public void setMedia(byte[] media) { 245 m_media = media; 246 setSize(m_media.length); 248 } 249 250 254 public String toString() { 255 StringBuffer retValue = new StringBuffer (); 256 retValue 257 .append(getClass().getName() + "{") 258 .append("m_id:"+m_id+",") 259 .append("m_masterId:"+m_masterId+",") 260 .append("m_position:"+m_position+",") 261 .append("m_width:"+m_width+",") 262 .append("m_height:"+m_height+",") 263 .append("m_size:"+m_size+",") 264 .append("m_mimetype:"+m_mimetype+",") 265 .append("m_type:"+m_type+",") 266 .append("m_title:"+m_title+",") 267 .append("m_name:"+m_name+",") 268 .append("m_id:"+m_id+",") 269 .append("m_description:"+m_description+"}"); 270 return retValue.toString(); 271 } 272 }
| Popular Tags
|