comparison software/mpdl-services/mpiwg-mpdl-cms/src/de/mpg/mpiwg/berlin/mpdl/cms/scheduler/CmsDocOperation.java @ 23:e845310098ba

diverse Korrekturen
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 27 Nov 2012 12:35:19 +0100
parents
children
comparison
equal deleted inserted replaced
22:6a45a982c333 23:e845310098ba
1 package de.mpg.mpiwg.berlin.mpdl.cms.scheduler;
2
3 import java.util.Date;
4
5 import de.mpg.mpiwg.berlin.mpdl.cms.document.MetadataRecord;
6
7 public class CmsDocOperation implements Comparable<CmsDocOperation> {
8 private int id;
9 private Date start;
10 private Date end;
11 private String name;
12 private String status;
13 private String errorMessage;
14 private String uploadFileName;
15 private String srcUrl;
16 private String docIdentifier;
17 private String mainLanguage;
18 private String[] elementNames; // element names which should be indexed (e.g. "s head, caption")
19 private String collectionNames; // collections to which this document belongs separated by blanks (e.g. "collection1 collection7")
20 private MetadataRecord mdRecord;
21
22 public CmsDocOperation(String name, String srcUrl, String uploadFileName, String docIdentifier) {
23 this.name = name;
24 this.srcUrl = srcUrl;
25 this.uploadFileName = uploadFileName;
26 this.docIdentifier = docIdentifier;
27 }
28
29 public int compareTo(CmsDocOperation op) {
30 Integer opOrderId = new Integer(op.id);
31 Integer thisOrderId = new Integer(id);
32 return thisOrderId.compareTo(opOrderId);
33 }
34
35 public boolean isFinished() {
36 if (status != null && status.equals("finished"))
37 return true;
38 else
39 return false;
40 }
41
42 public boolean isError() {
43 if (errorMessage != null && errorMessage.length() > 0)
44 return true;
45 else
46 return false;
47 }
48
49 public int getOrderId() {
50 return id;
51 }
52
53 public void setOrderId(int orderId) {
54 this.id = orderId;
55 }
56
57 public String getStatus() {
58 return status;
59 }
60
61 public void setStatus(String status) {
62 this.status = status;
63 }
64
65 public Date getStart() {
66 return start;
67 }
68
69 public void setStart(Date start) {
70 this.start = start;
71 }
72
73 public Date getEnd() {
74 return end;
75 }
76
77 public void setEnd(Date end) {
78 this.end = end;
79 }
80
81 public String getName() {
82 return name;
83 }
84
85 public void setName(String name) {
86 this.name = name;
87 }
88
89 public String getErrorMessage() {
90 return errorMessage;
91 }
92
93 public void setErrorMessage(String errorMessage) {
94 this.errorMessage = errorMessage;
95 }
96
97 public String getDocIdentifier() {
98 return docIdentifier;
99 }
100
101 public void setDocIdentifier(String docIdentifier) {
102 this.docIdentifier = docIdentifier;
103 }
104
105 public String getMainLanguage() {
106 return mainLanguage;
107 }
108
109 public void setMainLanguage(String mainLanguage) {
110 this.mainLanguage = mainLanguage;
111 }
112
113 public String[] getElementNames() {
114 return elementNames;
115 }
116
117 public void setElementNames(String[] elementNames) {
118 this.elementNames = elementNames;
119 }
120
121 public String getCollectionNames() {
122 return collectionNames;
123 }
124
125 public void setCollectionNames(String collectionNames) {
126 this.collectionNames = collectionNames;
127 }
128
129 public String getSrcUrl() {
130 return srcUrl;
131 }
132
133 public void setSrcUrl(String srcUrl) {
134 this.srcUrl = srcUrl;
135 }
136
137 public String getUploadFileName() {
138 return uploadFileName;
139 }
140
141 public void setUploadFileName(String uploadFileName) {
142 this.uploadFileName = uploadFileName;
143 }
144
145 public MetadataRecord getMdRecord() {
146 return mdRecord;
147 }
148
149 public void setMdRecord(MetadataRecord mdRecord) {
150 this.mdRecord = mdRecord;
151 }
152
153 public String toString() {
154 if (name.equals("delete"))
155 return name + "(" + id + ", " + docIdentifier + ")";
156 else
157 return name + "(" + id + ", " + uploadFileName + ", " + docIdentifier + ")";
158 }
159
160 }