This project has retired. For details please refer to its
Attic page.
DefaultDocumentIdentifierMap 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 */19package org.apache.chemistry.opencmis.jcr.impl;
2021import org.apache.chemistry.opencmis.commons.PropertyIds;
2223/**24 * Provides mappings to standard jcr properties for documents.25 */26publicclassDefaultDocumentIdentifierMapextendsDefaultIdentifierMapBase {
2728privatefinalboolean isVersionable;
2930publicDefaultDocumentIdentifierMap(boolean isVersionable) {
31super("nt:file");
32this.isVersionable = isVersionable;
33 cmis2Jcr.put(PropertyIds.CREATED_BY, "jcr:content/@jcr:createdBy");
34 cmis2Jcr.put(PropertyIds.CREATION_DATE, "jcr:content/@jcr:created");
35 cmis2Jcr.put(PropertyIds.LAST_MODIFIED_BY, "jcr:content/@jcr:lastModifiedBy");
36 cmis2Jcr.put(PropertyIds.LAST_MODIFICATION_DATE, "jcr:content/@jcr:lastModified");
37 cmis2Jcr.put(PropertyIds.CONTENT_STREAM_MIME_TYPE, "jcr:content/@jcr:mimeType");
38 cmis2Jcr.put(PropertyIds.CONTENT_STREAM_FILE_NAME, "fn:name()");
39// xxx not supported: IS_IMMUTABLE, IS_LATEST_VERSION, IS_MAJOR_VERSION, IS_LATEST_MAJOR_VERSION,40// VERSION_LABEL, VERSION_SERIES_ID, IS_VERSION_SERIES_CHECKED_OUT, VERSION_SERIES_CHECKED_OUT_ID41// VERSION_SERIES_CHECKED_OUT_BY, CHECKIN_COMMENT, CONTENT_STREAM_ID, CONTENT_STREAM_LENGTH42 }
4344 @Override
45public String jcrTypeCondition() {
46return (isVersionable ? "" : "not") +
47"(@jcr:mixinTypes = 'mix:simpleVersionable')";
48 }
49 }