. Added support for folder-type restrictions in Advanced Search config

- Added forums folder type to list by default
 - Added folder-type drop-down to Advanced Search UI

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2878 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-05-12 16:06:00 +00:00
parent fbe26a49f2
commit 0cdf8e216f
9 changed files with 206 additions and 13 deletions

View File

@@ -34,6 +34,7 @@ import org.dom4j.Element;
public class AdvancedSearchElementReader implements ConfigElementReader
{
public static final String ELEMENT_CONTENTTYPES = "content-types";
public static final String ELEMENT_FOLDERTYPES = "folder-types";
public static final String ELEMENT_TYPE = "type";
public static final String ELEMENT_CUSTOMPROPS = "custom-properties";
public static final String ELEMENT_METADATA = "meta-data";
@@ -81,6 +82,24 @@ public class AdvancedSearchElementReader implements ConfigElementReader
configElement.setContentTypes(types);
}
// get the list of folder types
Element folderTypes = element.element(ELEMENT_FOLDERTYPES);
if (folderTypes != null)
{
Iterator<Element> typesItr = folderTypes.elementIterator(ELEMENT_TYPE);
List<String> types = new ArrayList<String>(5);
while (typesItr.hasNext())
{
Element folderType = typesItr.next();
String type = folderType.attributeValue(ATTRIBUTE_NAME);
if (type != null)
{
types.add(type);
}
}
configElement.setFolderTypes(types);
}
// get the list of custom properties to display
Element customProps = element.element(ELEMENT_CUSTOMPROPS);
if (customProps != null)