* @param options the option list
* @param values the value list
*/
private void addCurrentTemplate(String currentTemplate, List<ListItem> options) {
CmsMessages messages = Messages.get().getBundle(getLocale());
// template was not found in regular template folders, add current template value
if (CmsStringUtil.isEmpty(currentTemplate)) {
// current template not available, add "please select" value
String name = "--- " + messages.key(org.opencms.workplace.editors.Messages.GUI_PLEASE_SELECT_0) + " ---";
options.add(0, new ListItem(name, name, true));
} else {
// current template was set to some value, add this value to the selection
String name = null;
try {
// read the title of the current template
name = getCms().readPropertyObject(currentTemplate, CmsPropertyDefinition.PROPERTY_TITLE, false).getValue();
} catch (CmsException e) {
// ignore this exception - the title for this template was not readable
if (LOG.isInfoEnabled()) {
LOG.info(messages.key(org.opencms.workplace.editors.Messages.LOG_READ_TITLE_PROP_FAILED_1, currentTemplate), e);
}
}
if (name == null) {
name = currentTemplate;
}