reduce dangers of creating the same xml content type by remove the possibility of multiple xml content types with the same name. sort content types alphabetically in the dropdown. refine reading of templating configuration.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3601 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2006-08-24 05:20:12 +00:00
parent 88a84e525a
commit 03476e862e
3 changed files with 34 additions and 25 deletions

View File

@@ -17,7 +17,7 @@
package org.alfresco.web.bean.content;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
@@ -165,14 +165,15 @@ public class CreateContentWizard extends BaseContentWizard
public List<SelectItem> getCreateTemplateTypes()
{
List<TemplateType> ttl = TemplatingService.getInstance().getTemplateTypes();
Collection<TemplateType> ttl = TemplatingService.getInstance().getTemplateTypes();
List<SelectItem> sil = new ArrayList<SelectItem>(ttl.size());
Iterator it = ttl.iterator();
while (it.hasNext())
for (TemplateType tt : ttl)
{
TemplateType tt = (TemplateType)it.next();
sil.add(new SelectItem(tt.getName(), tt.getName()));
}
QuickSort sorter = new QuickSort(sil, "label", true, IDataContainer.SORT_CASEINSENSITIVE);
sorter.sort();
return sil;
}