01: /*
02: * JFolder, Copyright 2001-2006 Gary Steinmetz
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jfolder.workflow.model.dms;
09:
10: //base classes
11: import java.io.ByteArrayInputStream;
12: import java.io.InputStream;
13:
14: //project specific classes
15: import org.jfolder.common.UnexpectedSystemException;
16: import org.jfolder.workflow.model.WorkflowComponent;
17: import org.jfolder.workflow.model.WorkflowComponentApplyUpdatesContext;
18: import org.jfolder.workflow.model.WorkflowComponentIdentifyUpdatesContext;
19: import org.jfolder.workflow.model.WorkflowComponentUpdates;
20:
21: //other classes
22:
23: public class WorkflowDocumentInstance extends WorkflowComponent {
24:
25: // Document Group -> Documents
26: // Document -> Audits, including comments
27: //
28: // each group add, delete, and update (rename?)
29: // (add group access?)
30:
31: private String name = null;
32: private byte content[] = null;
33:
34: protected WorkflowDocumentInstance(String inName, byte inContent[]) {
35: this .name = inName;
36: this .content = inContent;
37: }
38:
39: public String getName() {
40: return this .name;
41: }
42:
43: public InputStream getContent() {
44: return new ByteArrayInputStream(content);
45: }
46:
47: public int getSize() {
48: return this .content.length;
49: }
50:
51: protected boolean isIdentical(WorkflowDocumentInstance inDi) {
52:
53: boolean outValue = false;
54:
55: if (this .name.equals(inDi.name)
56: && (this .content.length == inDi.content.length)) {
57:
58: outValue = true;
59:
60: for (int i = 0; i < this .content.length; i++) {
61:
62: if (!(this .content[i] == inDi.content[i])) {
63: outValue = false;
64: break;
65: }
66: }
67: }
68:
69: return outValue;
70: }
71:
72: public WorkflowComponentUpdates identifyUpdates(
73: WorkflowComponentIdentifyUpdatesContext inWciuc) {
74: throw UnexpectedSystemException.notImplemented();
75: }
76:
77: public void applyUpdates(
78: WorkflowComponentApplyUpdatesContext inWcauc) {
79: throw UnexpectedSystemException.notImplemented();
80: }
81: }
|