001
014
015 package com.liferay.portal.repository.cmis;
016
017 import java.util.HashSet;
018 import java.util.Set;
019
020 import org.apache.chemistry.opencmis.client.api.OperationContext;
021 import org.apache.chemistry.opencmis.client.api.SessionFactory;
022 import org.apache.chemistry.opencmis.client.runtime.OperationContextImpl;
023 import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
024 import org.apache.chemistry.opencmis.commons.PropertyIds;
025 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
026
027
030 public class CMISRepositoryUtil {
031
032 public static OperationContext getOperationContext() {
033 return _operationContext;
034 }
035
036 public static SessionFactory getSessionFactory() {
037 return _sessionFactory;
038 }
039
040 private static final OperationContext _operationContext;
041 private static final SessionFactory _sessionFactory =
042 SessionFactoryImpl.newInstance();
043
044 static {
045 Set<String> defaultFilterSet = new HashSet<>();
046
047
048
049 defaultFilterSet.add(PropertyIds.BASE_TYPE_ID);
050 defaultFilterSet.add(PropertyIds.CREATED_BY);
051 defaultFilterSet.add(PropertyIds.CREATION_DATE);
052 defaultFilterSet.add(PropertyIds.LAST_MODIFIED_BY);
053 defaultFilterSet.add(PropertyIds.LAST_MODIFICATION_DATE);
054 defaultFilterSet.add(PropertyIds.NAME);
055 defaultFilterSet.add(PropertyIds.OBJECT_ID);
056 defaultFilterSet.add(PropertyIds.OBJECT_TYPE_ID);
057
058
059
060 defaultFilterSet.add(PropertyIds.CONTENT_STREAM_LENGTH);
061 defaultFilterSet.add(PropertyIds.CONTENT_STREAM_MIME_TYPE);
062 defaultFilterSet.add(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT);
063 defaultFilterSet.add(PropertyIds.VERSION_LABEL);
064 defaultFilterSet.add(PropertyIds.VERSION_SERIES_CHECKED_OUT_BY);
065 defaultFilterSet.add(PropertyIds.VERSION_SERIES_CHECKED_OUT_ID);
066 defaultFilterSet.add(PropertyIds.VERSION_SERIES_ID);
067
068
069
070 defaultFilterSet.add(PropertyIds.PARENT_ID);
071 defaultFilterSet.add(PropertyIds.PATH);
072
073
074
075 _operationContext = new OperationContextImpl(
076 defaultFilterSet, false, true, false, IncludeRelationships.NONE,
077 null, false, "cmis:name ASC", true, 1000);
078 }
079
080 }