mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
ML text index and search
Expose properties via DD Remove more old indexer code git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4592 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -316,6 +316,15 @@ import org.apache.commons.logging.LogFactory;
|
||||
{
|
||||
return aspects.values();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the compiled properties
|
||||
*/
|
||||
public Collection<PropertyDefinition> getProperties()
|
||||
{
|
||||
return properties.values();
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@@ -18,6 +18,8 @@ package org.alfresco.repo.dictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
@@ -285,5 +287,50 @@ public class DictionaryComponent implements DictionaryService
|
||||
{
|
||||
return dictionaryDAO.getAssociation(associationName);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.dictionary.DictionaryService#getAllProperties(org.alfresco.service.namespace.QName)
|
||||
*/
|
||||
public Collection<QName> getAllProperties(QName dataType)
|
||||
{
|
||||
Collection<QName> aspects = new HashSet<QName>(64);
|
||||
for (QName model : getAllModels())
|
||||
{
|
||||
aspects.addAll(getProperties(model, dataType));
|
||||
}
|
||||
return aspects;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.dictionary.DictionaryService#getAllProperties(org.alfresco.service.namespace.QName, org.alfresco.service.namespace.QName)
|
||||
*/
|
||||
public Collection<QName> getProperties(QName model, QName dataType)
|
||||
{
|
||||
Collection<PropertyDefinition> propDefs = dictionaryDAO.getProperties(model, dataType);
|
||||
HashSet<QName> props = new HashSet<QName>(propDefs.size());
|
||||
for(PropertyDefinition def : propDefs)
|
||||
{
|
||||
props.add(def.getName());
|
||||
}
|
||||
return props;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Collection<QName> getProperties(QName model)
|
||||
{
|
||||
Collection<PropertyDefinition> propDefs = dictionaryDAO.getProperties(model);
|
||||
HashSet<QName> props = new HashSet<QName>(propDefs.size());
|
||||
for(PropertyDefinition def : propDefs)
|
||||
{
|
||||
props.add(def.getName());
|
||||
}
|
||||
return props;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ import java.util.Collection;
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.ModelDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
@@ -61,6 +62,14 @@ public interface DictionaryDAO extends ModelQuery
|
||||
* @return the aspects of the model
|
||||
*/
|
||||
public Collection<AspectDefinition> getAspects(QName model);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param model the model for which to get properties
|
||||
* @return
|
||||
*/
|
||||
public Collection<PropertyDefinition> getProperties(QName model);
|
||||
|
||||
/**
|
||||
* Construct an anonymous type that combines a primary type definition and
|
||||
@@ -87,4 +96,14 @@ public interface DictionaryDAO extends ModelQuery
|
||||
*/
|
||||
public void removeModel(QName model);
|
||||
|
||||
/**
|
||||
* Get all properties for the model and that are of the given data type.
|
||||
* If dataType is null then the all properties will be returned.
|
||||
*
|
||||
* @param modelName
|
||||
* @param dataType
|
||||
* @return
|
||||
*/
|
||||
public Collection<PropertyDefinition> getProperties(QName modelName, QName dataType);
|
||||
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -441,5 +442,33 @@ public class DictionaryDAOImpl implements DictionaryDAO
|
||||
return new M2AnonymousTypeDefinition(typeDef, aspectDefs);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.repo.dictionary.DictionaryDAO#getProperties(org.alfresco.service.namespace.QName)
|
||||
*/
|
||||
public Collection<PropertyDefinition> getProperties(QName modelName)
|
||||
{
|
||||
CompiledModel model = getCompiledModel(modelName);
|
||||
return model.getProperties();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.repo.dictionary.DictionaryDAO#getProperties(org.alfresco.service.namespace.QName, org.alfresco.service.namespace.QName)
|
||||
*/
|
||||
public Collection<PropertyDefinition> getProperties(QName modelName, QName dataType)
|
||||
{
|
||||
HashSet<PropertyDefinition> properties = new HashSet<PropertyDefinition>();
|
||||
|
||||
Collection<PropertyDefinition> props = getProperties(modelName);
|
||||
for(PropertyDefinition prop : props)
|
||||
{
|
||||
if((dataType == null) || prop.getDataType().getName().equals(dataType))
|
||||
{
|
||||
properties.add(prop);
|
||||
}
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user