| 1 | |
package org.jtheque.films.utils; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
import org.jtheque.core.managers.Managers; |
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
public final class Constants { |
| 27 | |
public static final int MINIATURE_WIDTH = 100; |
| 28 | |
|
| 29 | |
public static final String IMAGE_BASE_NAME = "org/jtheque/films/images"; |
| 30 | |
|
| 31 | |
public static final String BORROWERS = "AbstractBorrower"; |
| 32 | |
public static final String YEAR = "Year"; |
| 33 | |
|
| 34 | |
public static final String FILM_ICON = "film"; |
| 35 | |
|
| 36 | |
public static final double A_QUARTER = 0.25; |
| 37 | |
public static final double AN_HALF = 0.25; |
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
private Constants() { |
| 43 | 0 | super(); |
| 44 | 0 | } |
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
|
| 51 | |
public interface Properties { |
| 52 | |
|
| 53 | |
|
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
interface Film { |
| 58 | |
String KIND = "film.kind"; |
| 59 | |
String TITLE = "film.title"; |
| 60 | |
String TYPE = "film.type"; |
| 61 | |
String REALIZER = "film.realizer"; |
| 62 | |
String YEAR = "film.year"; |
| 63 | |
String DURATION = "film.duration"; |
| 64 | |
String LANGUAGE = "film.language"; |
| 65 | |
String ACTORS = "film.actors"; |
| 66 | |
String RESUME = "film.resume"; |
| 67 | |
String COMMENT = "film.comment"; |
| 68 | |
String IMAGE = "film.image"; |
| 69 | |
String FILE_PATH = "film.filepath"; |
| 70 | |
String SAGA = "film.saga"; |
| 71 | |
String NOTE = "film.note"; |
| 72 | |
|
| 73 | |
int TITLE_MAX_LENGTH = 150; |
| 74 | |
int RESUME_MAX_LENGTH = 2000; |
| 75 | |
int COMMENT_MAX_LENGTH = 2000; |
| 76 | |
int YEAR_MAX_LENGTH = 4; |
| 77 | |
int DURATION_MAX_LENGTH = 4; |
| 78 | |
int IMAGE_MAX_LENGTH = 200; |
| 79 | |
int FILE_PATH_MAX_LENGTH = 200; |
| 80 | |
} |
| 81 | |
|
| 82 | |
|
| 83 | |
|
| 84 | |
|
| 85 | |
|
| 86 | |
|
| 87 | |
interface Kind { |
| 88 | |
String NAME = "kind.name"; |
| 89 | |
int NAME_MAX_LENGTH = 100; |
| 90 | |
} |
| 91 | |
|
| 92 | |
|
| 93 | |
|
| 94 | |
|
| 95 | |
|
| 96 | |
|
| 97 | |
interface Type { |
| 98 | |
String NAME = "type.name"; |
| 99 | |
int NAME_MAX_LENGTH = 100; |
| 100 | |
} |
| 101 | |
|
| 102 | |
|
| 103 | |
|
| 104 | |
|
| 105 | |
|
| 106 | |
|
| 107 | |
interface Saga { |
| 108 | |
String NAME = "saga.name"; |
| 109 | |
int NAME_MAX_LENGTH = 100; |
| 110 | |
} |
| 111 | |
|
| 112 | |
|
| 113 | |
|
| 114 | |
|
| 115 | |
|
| 116 | |
|
| 117 | |
interface Publication { |
| 118 | |
String HOST = "publication.host"; |
| 119 | |
String USER = "publication.user"; |
| 120 | |
String PASSWORD = "publication.password"; |
| 121 | |
String PATH = "publication.path"; |
| 122 | |
String PORT = "publication.port"; |
| 123 | |
|
| 124 | |
int HOST_MAX_LENGTH = 100; |
| 125 | |
int USER_MAX_LENGTH = 100; |
| 126 | |
int PASSWORD_MAX_LENGTH = 100; |
| 127 | |
int PATH_MAX_LENGTH = 200; |
| 128 | |
int PORT_MAX_LENGTH = 12; |
| 129 | |
} |
| 130 | |
|
| 131 | |
|
| 132 | |
|
| 133 | |
|
| 134 | |
|
| 135 | |
|
| 136 | |
interface Person { |
| 137 | |
String NAME = "person.name"; |
| 138 | |
String FIRST_NAME = "person.firstname"; |
| 139 | |
String COUNTRY = "person.country"; |
| 140 | |
String NOTE = "person.note"; |
| 141 | |
|
| 142 | |
int NAME_MAX_LENGTH = 100; |
| 143 | |
int FIRST_NAME_MAX_LENGTH = 100; |
| 144 | |
} |
| 145 | |
|
| 146 | |
|
| 147 | |
|
| 148 | |
|
| 149 | |
|
| 150 | |
|
| 151 | |
interface Form001 { |
| 152 | |
String TITLE = "reports.films.title"; |
| 153 | |
} |
| 154 | |
} |
| 155 | |
|
| 156 | |
|
| 157 | |
|
| 158 | |
|
| 159 | |
|
| 160 | |
|
| 161 | |
public interface Report { |
| 162 | |
String FORM001_TABLE = "org/jtheque/films/reports/Form001_Table.jrxml"; |
| 163 | |
String FORM001_TEXT = "org/jtheque/films/reports/Form001_Text.jrxml"; |
| 164 | |
String FORM001_PAGE = "org/jtheque/films/reports/Form001_Page.jrxml"; |
| 165 | |
String FORM001_WEB = "org/jtheque/films/reports/Form001_Web.jrxml"; |
| 166 | |
String FORM001_DATA = "org/jtheque/films/reports/Form001_Data.jrxml"; |
| 167 | |
|
| 168 | |
String FORM002_DVD_STANDARD = "Form002_DVD_Standard.jrxml"; |
| 169 | |
String FORM002_DVD_SLIM = "Form002_DVD_Slim.jrxml"; |
| 170 | |
String FORM002_CD_STANDARD = "Form002_CD_Standard.jrxml"; |
| 171 | |
String FORM002_CD_SLIM = "Form002_CD_Slim.jrxml"; |
| 172 | |
|
| 173 | |
|
| 174 | |
|
| 175 | |
|
| 176 | |
|
| 177 | |
|
| 178 | |
interface Form001_Parameters { |
| 179 | |
String TITLE = "REPORT_TITLE"; |
| 180 | |
String KIND = "REPORT_KIND"; |
| 181 | |
String FILM = "REPORT_FILM"; |
| 182 | |
String TYPE = "REPORT_TYPE"; |
| 183 | |
String REALIZER = "REPORT_REALIZER"; |
| 184 | |
String YEAR = "REPORT_YEAR"; |
| 185 | |
String DURATION = "REPORT_DURATION"; |
| 186 | |
String LANGUAGE = "REPORT_LANGUAGE"; |
| 187 | |
String ACTORS = "REPORT_ACTORS"; |
| 188 | |
} |
| 189 | |
} |
| 190 | |
|
| 191 | |
|
| 192 | |
|
| 193 | |
|
| 194 | |
|
| 195 | |
|
| 196 | |
public interface Files { |
| 197 | |
String MINIATURE_FOLDER = Managers.getCore().getFolders().getApplicationFolder() + "/miniatures/"; |
| 198 | |
|
| 199 | |
|
| 200 | |
|
| 201 | |
|
| 202 | |
|
| 203 | |
|
| 204 | 0 | enum FileType { |
| 205 | 0 | XML, |
| 206 | 0 | XLS, |
| 207 | 0 | PDF, |
| 208 | 0 | TXT, |
| 209 | 0 | HTML, |
| 210 | 0 | JTF, |
| 211 | 0 | CSV, |
| 212 | 0 | RTF, |
| 213 | 0 | JTFE; |
| 214 | |
|
| 215 | |
|
| 216 | |
|
| 217 | |
|
| 218 | |
|
| 219 | |
|
| 220 | |
|
| 221 | |
public static FileType fromString(String fileType) { |
| 222 | 0 | if ("xls".equalsIgnoreCase(fileType)) { |
| 223 | 0 | return XLS; |
| 224 | 0 | } else if ("xml".equalsIgnoreCase(fileType)) { |
| 225 | 0 | return XML; |
| 226 | 0 | } else if ("pdf".equalsIgnoreCase(fileType)) { |
| 227 | 0 | return PDF; |
| 228 | 0 | } else if ("txt".equalsIgnoreCase(fileType)) { |
| 229 | 0 | return TXT; |
| 230 | 0 | } else if ("html".equalsIgnoreCase(fileType)) { |
| 231 | 0 | return JTF; |
| 232 | 0 | } else if ("jtf".equalsIgnoreCase(fileType)) { |
| 233 | 0 | return JTF; |
| 234 | 0 | } else if ("csv".equalsIgnoreCase(fileType)) { |
| 235 | 0 | return CSV; |
| 236 | 0 | } else if ("rtf".equalsIgnoreCase(fileType)) { |
| 237 | 0 | return RTF; |
| 238 | 0 | } else if ("jtfe".equalsIgnoreCase(fileType)) { |
| 239 | 0 | return JTFE; |
| 240 | |
} |
| 241 | |
|
| 242 | 0 | return null; |
| 243 | |
} |
| 244 | |
} |
| 245 | |
|
| 246 | |
|
| 247 | |
|
| 248 | |
|
| 249 | |
|
| 250 | |
|
| 251 | |
interface Versions { |
| 252 | |
|
| 253 | |
|
| 254 | |
|
| 255 | |
|
| 256 | |
|
| 257 | |
interface XML { |
| 258 | |
int FIRST = 1; |
| 259 | |
int SECOND = 2; |
| 260 | |
int THIRD = 3; |
| 261 | |
} |
| 262 | |
|
| 263 | |
|
| 264 | |
|
| 265 | |
|
| 266 | |
|
| 267 | |
|
| 268 | |
interface JTF { |
| 269 | |
int FIRST = 1; |
| 270 | |
int SECOND = 1; |
| 271 | |
} |
| 272 | |
} |
| 273 | |
|
| 274 | |
|
| 275 | |
|
| 276 | |
|
| 277 | |
|
| 278 | |
|
| 279 | |
interface JT { |
| 280 | |
long JTCATEGORYSEPARATOR = -89569876428459544L; |
| 281 | |
long JTINTERNSEPARATOR = -95684111123647897L; |
| 282 | |
|
| 283 | |
int CONTENT = 5; |
| 284 | |
int NO_CONTENT = 10; |
| 285 | |
|
| 286 | |
String JTKEY = "1W@JTHEQUE@W1"; |
| 287 | |
} |
| 288 | |
} |
| 289 | |
|
| 290 | |
|
| 291 | |
|
| 292 | |
|
| 293 | |
|
| 294 | |
|
| 295 | 0 | public enum Site { |
| 296 | 0 | CINEMOVIES("Cinemovies"), |
| 297 | 0 | ALLOCINE("Allocine"), |
| 298 | 0 | MOVIESCOVERS("MoviesCovers"), |
| 299 | 0 | DVDFR("DVDFr"); |
| 300 | |
|
| 301 | |
private final String value; |
| 302 | |
|
| 303 | |
|
| 304 | |
|
| 305 | |
|
| 306 | |
|
| 307 | |
|
| 308 | 0 | Site(String value) { |
| 309 | 0 | this.value = value; |
| 310 | 0 | } |
| 311 | |
|
| 312 | |
|
| 313 | |
|
| 314 | |
|
| 315 | |
|
| 316 | |
|
| 317 | |
public String value() { |
| 318 | 0 | return value; |
| 319 | |
} |
| 320 | |
|
| 321 | |
@Override |
| 322 | |
public String toString() { |
| 323 | 0 | return value; |
| 324 | |
} |
| 325 | |
} |
| 326 | |
} |