diff --git a/source/java/org/alfresco/opencmis/mapping/DescriptionProperty.java b/source/java/org/alfresco/opencmis/mapping/DescriptionProperty.java new file mode 100644 index 0000000000..19b695fb66 --- /dev/null +++ b/source/java/org/alfresco/opencmis/mapping/DescriptionProperty.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2005-2014 Alfresco Software Limited. + * + * This file is part of Alfresco + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ +package org.alfresco.opencmis.mapping; + +import java.io.Serializable; + +import org.alfresco.model.ContentModel; +import org.alfresco.opencmis.CMISConnector; +import org.alfresco.opencmis.dictionary.CMISNodeInfo; +import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.namespace.QName; +import org.apache.chemistry.opencmis.commons.PropertyIds; + +/** + * Get the CMIS object description property. + * + * @author sergey.scherbovich + */ +public class DescriptionProperty extends AbstractProperty +{ + /** + * Construct + * + * @param serviceRegistry + * @param connector + */ + public DescriptionProperty(ServiceRegistry serviceRegistry, CMISConnector connector) + { + super(serviceRegistry, connector, PropertyIds.DESCRIPTION); + } + + @Override + public Serializable getValueInternal(CMISNodeInfo nodeInfo) + { + return getServiceRegistry().getNodeService().getProperty(nodeInfo.getNodeRef(), ContentModel.PROP_DESCRIPTION); + } + + @Override + public QName getMappedProperty() + { + return ContentModel.PROP_DESCRIPTION; + } +} diff --git a/source/java/org/alfresco/opencmis/mapping/RuntimePropertyAccessorMapping.java b/source/java/org/alfresco/opencmis/mapping/RuntimePropertyAccessorMapping.java index 1c16aad138..a7777893be 100644 --- a/source/java/org/alfresco/opencmis/mapping/RuntimePropertyAccessorMapping.java +++ b/source/java/org/alfresco/opencmis/mapping/RuntimePropertyAccessorMapping.java @@ -143,7 +143,8 @@ public class RuntimePropertyAccessorMapping implements PropertyAccessorMapping, registerPropertyAccessor(new TargetIdProperty(serviceRegistry, cmisConnector)); if(cmisMapping.getCmisVersion().equals(CmisVersion.CMIS_1_1)) { - registerPropertyAccessor(new SecondaryTypesProperty(serviceRegistry, cmisConnector, cmisMapping)); + registerPropertyAccessor(new DescriptionProperty(serviceRegistry, cmisConnector)); + registerPropertyAccessor(new SecondaryTypesProperty(serviceRegistry, cmisConnector, cmisMapping)); } //