This project has retired. For details please refer to its
Attic page.
JcrUnversionedDocument xref
1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing,13 * software distributed under the License is distributed on an14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15 * KIND, either express or implied. See the License for the16 * specific language governing permissions and limitations17 * under the License.18 */1920package org.apache.chemistry.opencmis.jcr;
2122import org.apache.chemistry.opencmis.commons.enums.Action;
23import org.apache.chemistry.opencmis.jcr.impl.DefaultUnversionedDocumentTypeHandler;
24import org.apache.chemistry.opencmis.jcr.type.JcrTypeHandlerManager;
2526import javax.jcr.Node;
27import javax.jcr.RepositoryException;
28import java.util.Set;
2930/**31 * Instances of this class represent a non versionable cmis:document backed by an underlying JCR <code>Node</code>. 32 */33publicclassJcrUnversionedDocumentextendsJcrDocument {
3435publicJcrUnversionedDocument(Node node, JcrTypeManager typeManager, PathManager pathManager, JcrTypeHandlerManager typeHandlerManager) {
36super(node, typeManager, pathManager, typeHandlerManager);
37 }
3839//------------------------------------------< protected >--- 4041 @Override
42protected Node getContextNode() throws RepositoryException {
43return getNode().getNode(Node.JCR_CONTENT);
44 }
4546 @Override
47protected Set<Action> compileAllowableActions(Set<Action> aas) {
48 Set<Action> result = super.compileAllowableActions(aas);
49 setAction(result, Action.CAN_GET_ALL_VERSIONS, false);
50 setAction(result, Action.CAN_CHECK_OUT, false);
51 setAction(result, Action.CAN_CANCEL_CHECK_OUT, false);
52 setAction(result, Action.CAN_CHECK_IN, false);
53return result;
54 }
5556 @Override
57protected String getTypeIdInternal() {
58return DefaultUnversionedDocumentTypeHandler.DOCUMENT_UNVERSIONED_TYPE_ID;
59 }
6061 @Override
62protectedboolean isLatestVersion() {
63returntrue;
64 }
6566 @Override
67protectedboolean isMajorVersion() {
68returntrue;
69 }
7071 @Override
72protectedboolean isLatestMajorVersion() {
73returntrue;
74 }
7576 @Override
77protected String getVersionLabel() {
78return"0.0";
79 }
8081 @Override
82protectedboolean isCheckedOut() {
83return false;
84 }
8586 @Override
87protected String getCheckedOutId() {
88returnnull;
89 }
9091 @Override
92protected String getCheckedOutBy() throws RepositoryException {
93returnnull;
94 }
9596 @Override
97protected String getCheckInComment() {
98return"";
99 }
100101102 }