String desc,
String workspaceNamePattern,
String propertyName,
int propertyType ) throws RepositoryException {
// Create the index template ...
IndexDefinitionTemplate template = indexManager().createIndexDefinitionTemplate();
template.setName(indexName);
template.setKind(kind);
template.setNodeTypeName(indexedNodeType);
template.setProviderName(providerName);
template.setSynchronous(useSynchronousIndexes());
if (workspaceNamePattern != null) {
template.setWorkspaceNamePattern(workspaceNamePattern);
} else {
template.setAllWorkspaces();
}
if (desc != null) {
template.setDescription(desc);
}
// Set up the columns ...
IndexColumnDefinition colDefn = indexManager().createIndexColumnDefinitionTemplate().setPropertyName(propertyName)
.setColumnType(propertyType);
template.setColumnDefinitions(colDefn);
// Register the index ...
indexManager().registerIndex(template, false);
}