/** Returns the configured sort options, or the empty list if no such options are configured. * @return The configured sort options, or the empty list if no such options are configured. */ private List<I_CmsSearchConfigurationSortOption> getSortOptions() { final List<I_CmsSearchConfigurationSortOption> options = new ArrayList<I_CmsSearchConfigurationSortOption>(); final CmsXmlContentValueSequence sortOptions = m_xml.getValueSequence(XML_ELEMENT_SORTOPTIONS, m_locale); if (sortOptions == null) { return null; } else { for (int i = 0; i < sortOptions.getElementCount(); i++) { final I_CmsSearchConfigurationSortOption option = parseSortOption( sortOptions.getValue(i).getPath() + "/"); if (option != null) { options.add(option); } } return options; } }
/** * Initialize the key set for an xml bundle. */ private void initKeySetForXmlBundle() { // consider only available locales for (Locale l : m_locales) { if (m_xmlBundle.hasLocale(l)) { Set<Object> keys = new HashSet<Object>(); for (I_CmsXmlContentValue msg : m_xmlBundle.getValueSequence("Message", l).getValues()) { String msgpath = msg.getPath(); keys.add(m_xmlBundle.getStringValue(m_cms, msgpath + "/Key", l)); } m_keyset.updateKeySet(null, keys); } } }
/** * @see org.opencms.jsp.search.config.parser.I_CmsSearchConfigurationParser#parseFieldFacets() */ @Override public Map<String, I_CmsSearchConfigurationFacetField> parseFieldFacets() { final Map<String, I_CmsSearchConfigurationFacetField> facetConfigs = new LinkedHashMap<String, I_CmsSearchConfigurationFacetField>(); final CmsXmlContentValueSequence fieldFacets = m_xml.getValueSequence(XML_ELEMENT_FIELD_FACETS, m_locale); if (fieldFacets != null) { for (int i = 0; i < fieldFacets.getElementCount(); i++) { final I_CmsSearchConfigurationFacetField config = parseFieldFacet( fieldFacets.getValue(i).getPath() + "/"); if (config != null) { facetConfigs.put(config.getName(), config); } } } return facetConfigs; }
/** * @see org.opencms.jsp.search.config.parser.I_CmsSearchConfigurationParser#parseRangeFacets() */ public Map<String, I_CmsSearchConfigurationFacetRange> parseRangeFacets() { final Map<String, I_CmsSearchConfigurationFacetRange> facetConfigs = new LinkedHashMap<String, I_CmsSearchConfigurationFacetRange>(); final CmsXmlContentValueSequence rangeFacets = m_xml.getValueSequence(XML_ELEMENT_RANGE_FACETS, m_locale); if (rangeFacets != null) { for (int i = 0; i < rangeFacets.getElementCount(); i++) { final I_CmsSearchConfigurationFacetRange config = parseRangeFacet( rangeFacets.getValue(i).getPath() + "/"); if (config != null) { facetConfigs.put(config.getName(), config); } } } return facetConfigs; }
CmsXmlContentValueSequence elementSequence = m_content.getValueSequence(name, locale); int elementCount = elementSequence.getElementCount();
/** * Loads the localization for the current locale from a bundle of type xmlvfsbundle. * It assumes, the content has already been unmarshalled before. * @param locale the locale for which the localization should be loaded */ private void loadLocalizationFromXmlBundle(Locale locale) { CmsXmlContentValueSequence messages = m_xmlBundle.getValueSequence("Message", locale); SortedProperties props = new SortedProperties(); if (null != messages) { for (I_CmsXmlContentValue msg : messages.getValues()) { String msgpath = msg.getPath(); props.put( m_xmlBundle.getStringValue(m_cms, msgpath + "/Key", locale), m_xmlBundle.getStringValue(m_cms, msgpath + "/Value", locale)); } } m_localizations.put(locale, props); }
String rootPath = content.getFile().getRootPath(); List<String> optionValues = CmsAddFormatterWidget.getSelectOptionValues(cms, rootPath, false); CmsXmlContentValueSequence addSequence = content.getValueSequence(ADD_PATH_SINGLE_NODE, locale); List<I_CmsXmlContentValue> values = addSequence.getValues(); boolean removeMainAddNode = true;
CmsXmlContentValueSequence elementSequence = m_content.getValueSequence(name, getElementLocale()); int elementCount = elementSequence.getElementCount();
CmsXmlContentValueSequence elementSequence = m_content.getValueSequence( pathPrefix + type.getName(), getElementLocale());
CmsXmlContentValueSequence messages = m_descContent.getValueSequence( Descriptor.N_MESSAGE, Descriptor.LOCALE);
CmsXmlContentValueSequence messages = m_descContent.getValueSequence(Descriptor.N_MESSAGE, Descriptor.LOCALE); String descValue; boolean hasDescription = false;
/** * Creates the container for a bundle descriptor. * @return the container for a bundle descriptor. */ private IndexedContainer createContainerForDescriptorEditing() { IndexedContainer container = new IndexedContainer(); // create properties container.addContainerProperty(TableProperty.KEY, String.class, ""); container.addContainerProperty(TableProperty.DESCRIPTION, String.class, ""); container.addContainerProperty(TableProperty.DEFAULT, String.class, ""); // add entries CmsXmlContentValueSequence messages = m_descContent.getValueSequence( "/" + Descriptor.N_MESSAGE, Descriptor.LOCALE); for (int i = 0; i < messages.getElementCount(); i++) { String prefix = messages.getValue(i).getPath() + "/"; Object itemId = container.addItem(); Item item = container.getItem(itemId); String key = m_descContent.getValue(prefix + Descriptor.N_KEY, Descriptor.LOCALE).getStringValue(m_cms); item.getItemProperty(TableProperty.KEY).setValue(key); item.getItemProperty(TableProperty.DESCRIPTION).setValue( m_descContent.getValue(prefix + Descriptor.N_DESCRIPTION, Descriptor.LOCALE).getStringValue(m_cms)); item.getItemProperty(TableProperty.DEFAULT).setValue( m_descContent.getValue(prefix + Descriptor.N_DEFAULT, Descriptor.LOCALE).getStringValue(m_cms)); } return container; }