01: /*
02: * Copyright 2007 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.outerj.daisy.query.model;
17:
18: import org.outerj.daisy.repository.Document;
19: import org.outerj.daisy.repository.Version;
20: import org.outerj.daisy.repository.VersionedData;
21: import org.outerj.daisy.repository.acl.AclResultInfo;
22:
23: public class ExprDocData {
24: public final Document document;
25: public final Version version;
26: public final VersionedData versionedData;
27: public final AclResultInfo aclResultInfo;
28:
29: /**
30: * See {@link #ExprDocData(Document, Version, AclResultInfo)}.
31: */
32: public ExprDocData(Document document, Version version) {
33: this (document, version, null);
34: }
35:
36: /**
37: * Constructor. Document is required, version is optional. In case the version
38: * is missing, the data will be retrieved from the document instead. Expression
39: * implementatins should not rely on document.getLast/LiveVersion(), since it might
40: * be the supplied Document object is not yet saved and hence has no versions yet.
41: *
42: * @param aclResultInfo the ACL evaluation result for the document for the current user.
43: * Optional, but if not present might disable certain functions.
44: */
45: public ExprDocData(Document document, Version version,
46: AclResultInfo aclResultInfo) {
47: if (document == null)
48: throw new IllegalArgumentException(
49: "Null argument: document");
50: this.document = document;
51: this.version = version;
52: this.versionedData = version != null ? version : document;
53: this.aclResultInfo = aclResultInfo;
54: }
55: }
|