mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Part 1 of MOB-378 Support for sub-types (and properties).
Supported for read cases. Property rendering driven from type model. Fixed support for ID, XML, HTML and URI type properties. Fixed ContentStreamUri property name. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13607 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -11,7 +11,31 @@
|
|||||||
<namespaces>
|
<namespaces>
|
||||||
<namespace uri="http://www.alfresco.org/model/cmis/0.5" prefix="cmis" />
|
<namespace uri="http://www.alfresco.org/model/cmis/0.5" prefix="cmis" />
|
||||||
</namespaces>
|
</namespaces>
|
||||||
|
|
||||||
|
<data-types>
|
||||||
|
|
||||||
|
<data-type name="cmis:id">
|
||||||
|
<analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class>
|
||||||
|
<java-class>java.lang.String</java-class>
|
||||||
|
</data-type>
|
||||||
|
|
||||||
|
<data-type name="cmis:uri">
|
||||||
|
<analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class>
|
||||||
|
<java-class>java.lang.String</java-class>
|
||||||
|
</data-type>
|
||||||
|
|
||||||
|
<data-type name="cmis:xml">
|
||||||
|
<analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class>
|
||||||
|
<java-class>java.lang.String</java-class>
|
||||||
|
</data-type>
|
||||||
|
|
||||||
|
<data-type name="cmis:html">
|
||||||
|
<analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class>
|
||||||
|
<java-class>java.lang.String</java-class>
|
||||||
|
</data-type>
|
||||||
|
|
||||||
|
</data-types>
|
||||||
|
|
||||||
<constraints>
|
<constraints>
|
||||||
|
|
||||||
<constraint name="cmis:allowedValuesForContentStreamAllowed" type="LIST">
|
<constraint name="cmis:allowedValuesForContentStreamAllowed" type="LIST">
|
||||||
@@ -82,7 +106,7 @@
|
|||||||
<property name="cmis:VersionSeriesId">
|
<property name="cmis:VersionSeriesId">
|
||||||
<title>Version series id</title>
|
<title>Version series id</title>
|
||||||
<description>The version series id</description>
|
<description>The version series id</description>
|
||||||
<type>d:noderef</type>
|
<type>cmis:id</type>
|
||||||
<protected>true</protected>
|
<protected>true</protected>
|
||||||
<mandatory enforced="true">true</mandatory>
|
<mandatory enforced="true">true</mandatory>
|
||||||
<multiple>false</multiple>
|
<multiple>false</multiple>
|
||||||
@@ -111,7 +135,7 @@
|
|||||||
<property name="cmis:VersionSeriesCheckedOutId">
|
<property name="cmis:VersionSeriesCheckedOutId">
|
||||||
<title>Version Series Checked Out Id</title>
|
<title>Version Series Checked Out Id</title>
|
||||||
<description>The checked out version series id</description>
|
<description>The checked out version series id</description>
|
||||||
<type>d:noderef</type>
|
<type>cmis:id</type>
|
||||||
<protected>true</protected>
|
<protected>true</protected>
|
||||||
<mandatory enforced="false">false</mandatory>
|
<mandatory enforced="false">false</mandatory>
|
||||||
<multiple>false</multiple>
|
<multiple>false</multiple>
|
||||||
@@ -174,7 +198,7 @@
|
|||||||
<property name="cmis:ContentStreamUri">
|
<property name="cmis:ContentStreamUri">
|
||||||
<title>Content Stream URI</title>
|
<title>Content Stream URI</title>
|
||||||
<description>The content stream URI</description>
|
<description>The content stream URI</description>
|
||||||
<type>d:text</type>
|
<type>cmis:uri</type>
|
||||||
<protected>true</protected>
|
<protected>true</protected>
|
||||||
<mandatory enforced="false">false</mandatory>
|
<mandatory enforced="false">false</mandatory>
|
||||||
<multiple>false</multiple>
|
<multiple>false</multiple>
|
||||||
@@ -182,6 +206,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</properties>
|
</properties>
|
||||||
<mandatory-aspects>
|
<mandatory-aspects>
|
||||||
|
<aspect>cmis:Core</aspect>
|
||||||
<aspect>cmis:Named</aspect>
|
<aspect>cmis:Named</aspect>
|
||||||
</mandatory-aspects>
|
</mandatory-aspects>
|
||||||
</type>
|
</type>
|
||||||
@@ -193,7 +218,7 @@
|
|||||||
<property name="cmis:ParentId">
|
<property name="cmis:ParentId">
|
||||||
<title>Parent Id</title>
|
<title>Parent Id</title>
|
||||||
<description>The parent id of the folder</description>
|
<description>The parent id of the folder</description>
|
||||||
<type>d:noderef</type>
|
<type>cmis:id</type>
|
||||||
<protected>true</protected>
|
<protected>true</protected>
|
||||||
<mandatory enforced="true">true</mandatory>
|
<mandatory enforced="true">true</mandatory>
|
||||||
<multiple>false</multiple>
|
<multiple>false</multiple>
|
||||||
@@ -204,7 +229,7 @@
|
|||||||
<property name="cmis:AllowedChildObjectTypeIds">
|
<property name="cmis:AllowedChildObjectTypeIds">
|
||||||
<title>Allowed Child Object Types Ids</title>
|
<title>Allowed Child Object Types Ids</title>
|
||||||
<description>The allowed child object type ids</description>
|
<description>The allowed child object type ids</description>
|
||||||
<type>d:qname</type>
|
<type>cmis:id</type>
|
||||||
<protected>true</protected>
|
<protected>true</protected>
|
||||||
<mandatory enforced="false">false</mandatory>
|
<mandatory enforced="false">false</mandatory>
|
||||||
<multiple>true</multiple>
|
<multiple>true</multiple>
|
||||||
@@ -212,6 +237,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</properties>
|
</properties>
|
||||||
<mandatory-aspects>
|
<mandatory-aspects>
|
||||||
|
<aspect>cmis:Core</aspect>
|
||||||
<aspect>cmis:Named</aspect>
|
<aspect>cmis:Named</aspect>
|
||||||
</mandatory-aspects>
|
</mandatory-aspects>
|
||||||
</type>
|
</type>
|
||||||
@@ -223,7 +249,7 @@
|
|||||||
<property name="cmis:SourceId">
|
<property name="cmis:SourceId">
|
||||||
<title>Source Id</title>
|
<title>Source Id</title>
|
||||||
<description>The source id for the relationship</description>
|
<description>The source id for the relationship</description>
|
||||||
<type>d:noderef</type>
|
<type>cmis:id</type>
|
||||||
<protected>true</protected>
|
<protected>true</protected>
|
||||||
<mandatory enforced="true">true</mandatory>
|
<mandatory enforced="true">true</mandatory>
|
||||||
<multiple>false</multiple>
|
<multiple>false</multiple>
|
||||||
@@ -232,7 +258,7 @@
|
|||||||
<property name="cmis:TargetId">
|
<property name="cmis:TargetId">
|
||||||
<title>Target Id</title>
|
<title>Target Id</title>
|
||||||
<description>The target id for the relationship</description>
|
<description>The target id for the relationship</description>
|
||||||
<type>d:noderef</type>
|
<type>cmis:id</type>
|
||||||
<protected>true</protected>
|
<protected>true</protected>
|
||||||
<mandatory enforced="true">true</mandatory>
|
<mandatory enforced="true">true</mandatory>
|
||||||
<multiple>false</multiple>
|
<multiple>false</multiple>
|
||||||
@@ -288,7 +314,7 @@
|
|||||||
<property name="cmis:ObjectId">
|
<property name="cmis:ObjectId">
|
||||||
<title>Object Id</title>
|
<title>Object Id</title>
|
||||||
<description>The unique object id (a node ref)</description>
|
<description>The unique object id (a node ref)</description>
|
||||||
<type>d:noderef</type>
|
<type>cmis:id</type>
|
||||||
<protected>true</protected>
|
<protected>true</protected>
|
||||||
<mandatory enforced="true">true</mandatory>
|
<mandatory enforced="true">true</mandatory>
|
||||||
<multiple>false</multiple>
|
<multiple>false</multiple>
|
||||||
@@ -299,7 +325,7 @@
|
|||||||
<property name="cmis:Uri">
|
<property name="cmis:Uri">
|
||||||
<title>URI</title>
|
<title>URI</title>
|
||||||
<description>URI</description>
|
<description>URI</description>
|
||||||
<type>d:text</type>
|
<type>cmis:uri</type>
|
||||||
<protected>true</protected>
|
<protected>true</protected>
|
||||||
<mandatory enforced="false">false</mandatory>
|
<mandatory enforced="false">false</mandatory>
|
||||||
<multiple>false</multiple>
|
<multiple>false</multiple>
|
||||||
@@ -308,7 +334,7 @@
|
|||||||
<property name="cmis:ObjectTypeId">
|
<property name="cmis:ObjectTypeId">
|
||||||
<title>Object Type Id</title>
|
<title>Object Type Id</title>
|
||||||
<description>The object type id</description>
|
<description>The object type id</description>
|
||||||
<type>d:qname</type>
|
<type>cmis:id</type>
|
||||||
<protected>true</protected>
|
<protected>true</protected>
|
||||||
<mandatory enforced="true">true</mandatory>
|
<mandatory enforced="true">true</mandatory>
|
||||||
<multiple>false</multiple>
|
<multiple>false</multiple>
|
||||||
@@ -373,7 +399,6 @@
|
|||||||
</aspect>
|
</aspect>
|
||||||
|
|
||||||
<aspect name="cmis:Named">
|
<aspect name="cmis:Named">
|
||||||
<parent>cmis:Core</parent>
|
|
||||||
<properties>
|
<properties>
|
||||||
<property name="cmis:Name">
|
<property name="cmis:Name">
|
||||||
<title>Name</title>
|
<title>Name</title>
|
||||||
|
@@ -60,6 +60,14 @@ public class CMISMapping
|
|||||||
* The QName for the Alfresco CMIS Model.
|
* The QName for the Alfresco CMIS Model.
|
||||||
*/
|
*/
|
||||||
public static QName CMIS_MODEL_QNAME = QName.createQName(CMIS_MODEL_URI, CMIS_MODEL_NAME);
|
public static QName CMIS_MODEL_QNAME = QName.createQName(CMIS_MODEL_URI, CMIS_MODEL_NAME);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The QNames for CMIS Data Types.
|
||||||
|
*/
|
||||||
|
public static QName CMIS_DATATYPE_ID = QName.createQName(CMIS_MODEL_URI, "id");
|
||||||
|
public static QName CMIS_DATATYPE_URI = QName.createQName(CMIS_MODEL_URI, "uri");
|
||||||
|
public static QName CMIS_DATATYPE_XML = QName.createQName(CMIS_MODEL_URI, "xml");
|
||||||
|
public static QName CMIS_DATATYPE_HTML = QName.createQName(CMIS_MODEL_URI, "html");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type id for CMIS documents, from the spec.
|
* Type id for CMIS documents, from the spec.
|
||||||
@@ -179,7 +187,7 @@ public class CMISMapping
|
|||||||
|
|
||||||
private static HashMap<QName, QName> alfrescoToCmisTypes = new HashMap<QName, QName>();
|
private static HashMap<QName, QName> alfrescoToCmisTypes = new HashMap<QName, QName>();
|
||||||
|
|
||||||
private static HashMap<QName, CMISPropertyTypeEnum> alfrescoPropertyTypesToCimsPropertyTypes = new HashMap<QName, CMISPropertyTypeEnum>();
|
private static HashMap<QName, CMISPropertyTypeEnum> alfrescoPropertyTypesToCmisPropertyTypes = new HashMap<QName, CMISPropertyTypeEnum>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up mappings
|
* Set up mappings
|
||||||
@@ -199,24 +207,28 @@ public class CMISMapping
|
|||||||
alfrescoToCmisTypes.put(ContentModel.TYPE_CONTENT, DOCUMENT_QNAME);
|
alfrescoToCmisTypes.put(ContentModel.TYPE_CONTENT, DOCUMENT_QNAME);
|
||||||
alfrescoToCmisTypes.put(ContentModel.TYPE_FOLDER, FOLDER_QNAME);
|
alfrescoToCmisTypes.put(ContentModel.TYPE_FOLDER, FOLDER_QNAME);
|
||||||
|
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.ANY, null);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.ANY, null);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.ASSOC_REF, null);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.ASSOC_REF, null);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.BOOLEAN, CMISPropertyTypeEnum.BOOLEAN);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.BOOLEAN, CMISPropertyTypeEnum.BOOLEAN);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.CATEGORY, CMISPropertyTypeEnum.ID);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.CATEGORY, CMISPropertyTypeEnum.ID);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.CHILD_ASSOC_REF, null);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.CHILD_ASSOC_REF, null);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.CONTENT, null);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.CONTENT, null);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.DATE, CMISPropertyTypeEnum.DATETIME);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.DATE, CMISPropertyTypeEnum.DATETIME);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.DATETIME, CMISPropertyTypeEnum.DATETIME);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.DATETIME, CMISPropertyTypeEnum.DATETIME);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.DOUBLE, CMISPropertyTypeEnum.DECIMAL);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.DOUBLE, CMISPropertyTypeEnum.DECIMAL);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.FLOAT, CMISPropertyTypeEnum.DECIMAL);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.FLOAT, CMISPropertyTypeEnum.DECIMAL);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.INT, CMISPropertyTypeEnum.INTEGER);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.INT, CMISPropertyTypeEnum.INTEGER);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.LOCALE, null);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.LOCALE, null);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.LONG, CMISPropertyTypeEnum.INTEGER);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.LONG, CMISPropertyTypeEnum.INTEGER);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.MLTEXT, CMISPropertyTypeEnum.STRING);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.MLTEXT, CMISPropertyTypeEnum.STRING);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.NODE_REF, CMISPropertyTypeEnum.ID);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.NODE_REF, CMISPropertyTypeEnum.ID);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.PATH, null);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.PATH, null);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.QNAME, null);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.QNAME, null);
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.put(DataTypeDefinition.TEXT, CMISPropertyTypeEnum.STRING);
|
alfrescoPropertyTypesToCmisPropertyTypes.put(DataTypeDefinition.TEXT, CMISPropertyTypeEnum.STRING);
|
||||||
|
alfrescoPropertyTypesToCmisPropertyTypes.put(CMIS_DATATYPE_ID, CMISPropertyTypeEnum.ID);
|
||||||
|
alfrescoPropertyTypesToCmisPropertyTypes.put(CMIS_DATATYPE_URI, CMISPropertyTypeEnum.URI);
|
||||||
|
alfrescoPropertyTypesToCmisPropertyTypes.put(CMIS_DATATYPE_XML, CMISPropertyTypeEnum.XML);
|
||||||
|
alfrescoPropertyTypesToCmisPropertyTypes.put(CMIS_DATATYPE_HTML, CMISPropertyTypeEnum.HTML);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DictionaryService dictionaryService;
|
private DictionaryService dictionaryService;
|
||||||
@@ -624,18 +636,7 @@ public class CMISMapping
|
|||||||
}
|
}
|
||||||
|
|
||||||
QName dQName = dataTypeDefinition.getName();
|
QName dQName = dataTypeDefinition.getName();
|
||||||
if (propertyQName.getNamespaceURI().equals(CMIS_MODEL_URI))
|
return alfrescoPropertyTypesToCmisPropertyTypes.get(dQName);
|
||||||
{
|
|
||||||
if (dQName.equals(DataTypeDefinition.QNAME) || dQName.equals(DataTypeDefinition.NODE_REF))
|
|
||||||
{
|
|
||||||
return CMISPropertyTypeEnum.ID;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
alfrescoPropertyTypesToCimsPropertyTypes.get(dQName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return alfrescoPropertyTypesToCimsPropertyTypes.get(dQName);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -245,7 +245,7 @@ public class CMISPropertyServiceImpl implements CMISPropertyService, Initializin
|
|||||||
addNamedPropertyAccessor(getContentStreamLengthPropertyAccessor());
|
addNamedPropertyAccessor(getContentStreamLengthPropertyAccessor());
|
||||||
addNamedPropertyAccessor(getContentStreamMimetypePropertyAccessor());
|
addNamedPropertyAccessor(getContentStreamMimetypePropertyAccessor());
|
||||||
addNamedPropertyAccessor(getSimplePropertyAccessor(CMISMapping.PROP_CONTENT_STREAM_FILENAME, ContentModel.PROP_NAME, CMISScope.DOCUMENT));
|
addNamedPropertyAccessor(getSimplePropertyAccessor(CMISMapping.PROP_CONTENT_STREAM_FILENAME, ContentModel.PROP_NAME, CMISScope.DOCUMENT));
|
||||||
addNamedPropertyAccessor(getFixedValuePropertyAccessor(CMISMapping.PROP_CONTENT_STREAM_URI, null, CMISScope.DOCUMENT));
|
addNamedPropertyAccessor(getContentStreamUriPropertyAccessor());
|
||||||
|
|
||||||
// CMIS Folder
|
// CMIS Folder
|
||||||
addNamedPropertyAccessor(getParentPropertyAccessor());
|
addNamedPropertyAccessor(getParentPropertyAccessor());
|
||||||
@@ -393,6 +393,14 @@ public class CMISPropertyServiceImpl implements CMISPropertyService, Initializin
|
|||||||
return accessor;
|
return accessor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NamedPropertyAccessor getContentStreamUriPropertyAccessor()
|
||||||
|
{
|
||||||
|
ContentStreamUriPropertyAccessor accessor = new ContentStreamUriPropertyAccessor();
|
||||||
|
accessor.setServiceRegistry(serviceRegistry);
|
||||||
|
accessor.setCMISMapping(cmisMapping);
|
||||||
|
return accessor;
|
||||||
|
}
|
||||||
|
|
||||||
public NamedPropertyAccessor getParentPropertyAccessor()
|
public NamedPropertyAccessor getParentPropertyAccessor()
|
||||||
{
|
{
|
||||||
ParentPropertyAccessor accessor = new ParentPropertyAccessor();
|
ParentPropertyAccessor accessor = new ParentPropertyAccessor();
|
||||||
|
@@ -0,0 +1,180 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
* This program 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 General Public License for more details.
|
||||||
|
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
* As a special exception to the terms and conditions of version 2.0 of
|
||||||
|
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||||
|
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||||
|
* FLOSS exception. You should have recieved a copy of the text describing
|
||||||
|
* the FLOSS exception, and it is also available here:
|
||||||
|
* http://www.alfresco.com/legal/licensing"
|
||||||
|
*/
|
||||||
|
package org.alfresco.cmis.property;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import org.alfresco.cmis.dictionary.CMISMapping;
|
||||||
|
import org.alfresco.cmis.dictionary.CMISScope;
|
||||||
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.repo.search.impl.lucene.LuceneQueryParser;
|
||||||
|
import org.alfresco.repo.search.impl.lucene.ParseException;
|
||||||
|
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.apache.lucene.search.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accessor for CMIS content stream length property
|
||||||
|
*
|
||||||
|
* @author andyh
|
||||||
|
*/
|
||||||
|
public class ContentStreamUriPropertyAccessor extends AbstractNamedPropertyAccessor
|
||||||
|
{
|
||||||
|
|
||||||
|
public Serializable getProperty(NodeRef nodeRef)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("/api/node/");
|
||||||
|
sb.append(nodeRef.getStoreRef().getProtocol());
|
||||||
|
sb.append("/");
|
||||||
|
sb.append(nodeRef.getStoreRef().getIdentifier());
|
||||||
|
sb.append("/");
|
||||||
|
sb.append(nodeRef.getId());
|
||||||
|
sb.append("/content.");
|
||||||
|
sb.append(getServiceRegistry().getNodeService().getProperty(nodeRef, ContentModel.PROP_NAME));
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPropertyName()
|
||||||
|
{
|
||||||
|
return CMISMapping.PROP_CONTENT_STREAM_URI;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CMISScope getScope()
|
||||||
|
{
|
||||||
|
return CMISScope.DOCUMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.alfresco.cmis.property.NamedPropertyAccessor#buildLuceneEquality(org.alfresco.repo.search.impl.lucene.LuceneQueryParser,
|
||||||
|
* java.lang.String, java.io.Serializable, org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||||
|
*/
|
||||||
|
public Query buildLuceneEquality(LuceneQueryParser lqp, String propertyName, Serializable value, PredicateMode mode) throws ParseException
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.alfresco.cmis.property.NamedPropertyAccessor#buildLuceneExists(org.alfresco.repo.search.impl.lucene.LuceneQueryParser,
|
||||||
|
* java.lang.String, java.lang.Boolean)
|
||||||
|
*/
|
||||||
|
public Query buildLuceneExists(LuceneQueryParser lqp, String propertyName, Boolean not) throws ParseException
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.alfresco.cmis.property.NamedPropertyAccessor#buildLuceneGreaterThan(org.alfresco.repo.search.impl.lucene.LuceneQueryParser,
|
||||||
|
* java.lang.String, java.io.Serializable, org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||||
|
*/
|
||||||
|
public Query buildLuceneGreaterThan(LuceneQueryParser lqp, String propertyName, Serializable value, PredicateMode mode) throws ParseException
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.alfresco.cmis.property.NamedPropertyAccessor#buildLuceneGreaterThanOrEquals(org.alfresco.repo.search.impl.lucene.LuceneQueryParser,
|
||||||
|
* java.lang.String, java.io.Serializable, org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||||
|
*/
|
||||||
|
public Query buildLuceneGreaterThanOrEquals(LuceneQueryParser lqp, String propertyName, Serializable value, PredicateMode mode) throws ParseException
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.alfresco.cmis.property.NamedPropertyAccessor#buildLuceneIn(org.alfresco.repo.search.impl.lucene.LuceneQueryParser,
|
||||||
|
* java.lang.String, java.util.Collection, java.lang.Boolean,
|
||||||
|
* org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||||
|
*/
|
||||||
|
public Query buildLuceneIn(LuceneQueryParser lqp, String propertyName, Collection<Serializable> values, Boolean not, PredicateMode mode) throws ParseException
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.alfresco.cmis.property.NamedPropertyAccessor#buildLuceneInequality(org.alfresco.repo.search.impl.lucene.LuceneQueryParser,
|
||||||
|
* java.lang.String, java.io.Serializable, org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||||
|
*/
|
||||||
|
public Query buildLuceneInequality(LuceneQueryParser lqp, String propertyName, Serializable value, PredicateMode mode) throws ParseException
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.alfresco.cmis.property.NamedPropertyAccessor#buildLuceneLessThan(org.alfresco.repo.search.impl.lucene.LuceneQueryParser,
|
||||||
|
* java.lang.String, java.io.Serializable, org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||||
|
*/
|
||||||
|
public Query buildLuceneLessThan(LuceneQueryParser lqp, String propertyName, Serializable value, PredicateMode mode) throws ParseException
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.alfresco.cmis.property.NamedPropertyAccessor#buildLuceneLessThanOrEquals(org.alfresco.repo.search.impl.lucene.LuceneQueryParser,
|
||||||
|
* java.lang.String, java.io.Serializable, org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||||
|
*/
|
||||||
|
public Query buildLuceneLessThanOrEquals(LuceneQueryParser lqp, String propertyName, Serializable value, PredicateMode mode) throws ParseException
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.alfresco.cmis.property.NamedPropertyAccessor#buildLuceneLike(org.alfresco.repo.search.impl.lucene.LuceneQueryParser,
|
||||||
|
* java.lang.String, java.io.Serializable, java.lang.Boolean)
|
||||||
|
*/
|
||||||
|
public Query buildLuceneLike(LuceneQueryParser lqp, String propertyName, Serializable value, Boolean not) throws ParseException
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.alfresco.cmis.property.NamedPropertyAccessor#getLuceneSortField(java.lang.String)
|
||||||
|
*/
|
||||||
|
public String getLuceneSortField(String propertyName)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user