/** * Creates a new mapping node.<p> * * @param document the document to modify * @param xpath the xpath to the field mapping, ie <code>opencms/search/fieldconfigurations/fieldconfiguration[name='...']/fields/field[@name="..."]/mappings/mapping[@type='...']</code> * @param mapping the field mapping */ protected void createFieldMapping(Document document, String xpath, CmsSearchFieldMapping mapping) { CmsSetupXmlHelper.setValue(document, xpath + "/@" + I_CmsXmlConfiguration.A_TYPE, mapping.getType().toString()); CmsSetupXmlHelper.setValue(document, xpath + "/@" + I_CmsXmlConfiguration.A_DEFAULT, mapping.getDefaultValue()); // add class attribute (if required) if (!mapping.getClass().equals(CmsSearchFieldMapping.class) || (mapping.getType() == CmsSearchFieldMappingType.DYNAMIC)) { CmsSetupXmlHelper.setValue( document, xpath + "/@" + I_CmsXmlConfiguration.A_CLASS, mapping.getClass().getName()); } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(mapping.getParam())) { CmsSetupXmlHelper.setValue(document, xpath, mapping.getParam()); } }
case 1: // property case 2: // property-search if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParam())) { boolean search = (getType() == CmsSearchFieldMappingType.PROPERTY_SEARCH); if (search) { content = CmsProperty.get(getParam(), propertiesSearched).getValue(); } else { content = CmsProperty.get(getParam(), properties).getValue(); if ((extractionResult != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParam())) { content = extractionResult.getContentItems().get(getParam());
/** * @see org.opencms.workplace.list.A_CmsListDialog#getListItems() */ @Override protected List<CmsListItem> getListItems() { List<CmsListItem> result = new ArrayList<CmsListItem>(); // get content List<I_CmsSearchFieldMapping> mappings = getMappings(); Iterator<I_CmsSearchFieldMapping> itMappings = mappings.iterator(); CmsSearchFieldMapping mapping; while (itMappings.hasNext()) { mapping = (CmsSearchFieldMapping)itMappings.next(); CmsListItem item = getList().newItem(mapping.getType().toString()); String defaultValue = mapping.getDefaultValue(); String param = mapping.getParam(); if (defaultValue == null) { defaultValue = "-"; } if (param == null) { param = "-"; } item.set(LIST_COLUMN_VALUE, param); item.set(LIST_COLUMN_TYPE, mapping.getType().toString()); item.set(LIST_COLUMN_DEFAULT, defaultValue); result.add(item); } return result; }
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParam())) { content = CmsProperty.get(getParam(), properties).getValue(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParam())) { content = CmsProperty.get(getParam(), propertiesSearched).getValue(); if ((extractionResult != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParam())) { String[] paramParts = getParam().split("\\|"); Map<String, String> localizedContentItems = null; String xpath = null; if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParam())) { I_CmsResource.CmsResourceAttribute attribute = null; try { attribute = I_CmsResource.CmsResourceAttribute.valueOf(getParam()); } catch (Exception e) {