Mercurial > hg > mpdl-group
diff software/eXist/mpdl-modules/src/de/mpg/mpiwg/berlin/mpdl/schedule/MpdlDocOperation.java @ 0:408254cf2f1d
Erstellung
author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 24 Nov 2010 17:24:23 +0100 |
parents | |
children | 5df60f24e997 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/software/eXist/mpdl-modules/src/de/mpg/mpiwg/berlin/mpdl/schedule/MpdlDocOperation.java Wed Nov 24 17:24:23 2010 +0100 @@ -0,0 +1,195 @@ +package de.mpg.mpiwg.berlin.mpdl.schedule; + +import java.util.Date; + +import org.w3c.dom.Node; + +import de.mpg.mpiwg.berlin.mpdl.escidoc.MetadataRecord; + +public class MpdlDocOperation implements Comparable<MpdlDocOperation> { + private int id; + private Date start; + private Date end; + private String name; + private String status; + private String errorMessage; + private String uploadFileName; + private String srcUrl; + private String docBase; + private String language; + private String fileName; + private String eSciDocDestUrl; + private String eSciDocCookieId; + private MetadataRecord mdRecord; + private Node docNode; + private boolean includePdf = false; // default + + public MpdlDocOperation(String name, String srcUrl, String uploadFileName, String docBase, String language, String fileName) { + this.name = name; + this.srcUrl = srcUrl; + this.uploadFileName = uploadFileName; + this.docBase = docBase; + this.language = language; + this.fileName = fileName; + } + + public int compareTo(MpdlDocOperation op) { + Integer opOrderId = new Integer(op.id); + Integer thisOrderId = new Integer(id); + return thisOrderId.compareTo(opOrderId); + } + + public boolean isFinished() { + if (status != null && status.equals("finished")) + return true; + else + return false; + } + + public boolean isError() { + if (errorMessage != null && errorMessage.length() > 0) + return true; + else + return false; + } + + public int getOrderId() { + return id; + } + + public void setOrderId(int orderId) { + this.id = orderId; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Date getStart() { + return start; + } + + public void setStart(Date start) { + this.start = start; + } + + public Date getEnd() { + return end; + } + + public void setEnd(Date end) { + this.end = end; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public String getDestUrl() { + return "/" + docBase + "/" + language + "/" + fileName; + } + + public String getSrcUrl() { + return srcUrl; + } + + public void setSrcUrl(String srcUrl) { + this.srcUrl = srcUrl; + } + + public String getUploadFileName() { + return uploadFileName; + } + + public void setUploadFileName(String uploadFileName) { + this.uploadFileName = uploadFileName; + } + + public String getDocBase() { + return docBase; + } + + public void setDocBase(String docBase) { + this.docBase = docBase; + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String getESciDocDestUrl() { + return eSciDocDestUrl; + } + + public void setESciDocDestUrl(String sciDocDestUrl) { + eSciDocDestUrl = sciDocDestUrl; + } + + public String getESciDocCookieId() { + return eSciDocCookieId; + } + + public void setESciDocCookieId(String sciDocCookieId) { + eSciDocCookieId = sciDocCookieId; + } + + public MetadataRecord getMdRecord() { + return mdRecord; + } + + public void setMdRecord(MetadataRecord mdRecord) { + this.mdRecord = mdRecord; + } + + public Node getDocNode() { + return docNode; + } + + public void setDocNode(Node docNode) { + this.docNode = docNode; + } + + public boolean includePdf() { + return includePdf; + } + + public void setIncludePdf (boolean includePdf) { + this.includePdf = includePdf; + } + + public String toString() { + if (name.equals("delete")) + return name + "(" + id + ", " + "/" + docBase + "/" + language + "/" + fileName + ")"; + else + return name + "(" + id + ", " + uploadFileName + ", " + "/" + docBase + "/" + language + "/" + fileName + ")"; + } + +}