001/*
002 * ModeShape (http://www.modeshape.org)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *       http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.modeshape.cmis;
018
019import javax.jcr.Repository;
020import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
021import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
022import org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryInfoImpl;
023import org.apache.chemistry.opencmis.jcr.JcrRepository;
024import org.apache.chemistry.opencmis.jcr.JcrTypeManager;
025import org.apache.chemistry.opencmis.jcr.PathManager;
026import org.apache.chemistry.opencmis.jcr.type.JcrTypeHandlerManager;
027
028/**
029 * ModeShape's extensions of OpenCMIS's {@link org.apache.chemistry.opencmis.jcr.JcrRepository}
030 * 
031 * @author Horia Chiorean (hchiorea@redhat.com)
032 */
033public class JcrMsRepository extends JcrRepository {
034    
035    public JcrMsRepository(Repository repository, PathManager pathManager,
036                           JcrTypeManager typeManager,
037                           JcrTypeHandlerManager typeHandlerManager) {
038        super(repository, pathManager, typeManager, typeHandlerManager);
039    }
040    
041    @Override
042    protected RepositoryInfo compileRepositoryInfo(String repositoryId) {
043        RepositoryInfo baseInfo = super.compileRepositoryInfo(repositoryId);
044        RepositoryInfoImpl actualInfo = new RepositoryInfoImpl(baseInfo);
045        // the default base class only advertises CMIS 1.0 as the supported version, while OpenChemistry supports 1.1 
046        actualInfo.setCmisVersionSupported(CmisVersion.CMIS_1_1.value());
047        return actualInfo;
048    }
049}