}
}
getModificationInfo().setModificationNecessary(true);
} else {
QueryObjectModelFactory qomFactory = getModificationInfo()
.getQueryObjectModelFactory();
Set<String> newLanguageCodes = getNewLanguagesPerSelector().get(
selector.getSelectorName());
if (newLanguageCodes != null) {
Constraint langConstraint = null;
for (String newLanguageCode : newLanguageCodes) {
Constraint currentConstraint = NO_LOCALE
.equals(newLanguageCode) ? qomFactory.not(qomFactory
.propertyExistence(selector.getSelectorName(),
Constants.JCR_LANGUAGE))
: qomFactory
.comparison(
qomFactory.propertyValue(
selector.getSelectorName(),
Constants.JCR_LANGUAGE),
QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO,
qomFactory.literal(getValueFactory()
.createValue(newLanguageCode)));
langConstraint = langConstraint == null ? currentConstraint
: qomFactory.or(langConstraint, currentConstraint);
}
getModificationInfo().getNewConstraints().add(langConstraint);
if (languageCodes == null) {
languageCodes = new HashSet<String>();
getLanguagesPerSelector().put(selector.getSelectorName(),
languageCodes);
}
languageCodes.addAll(newLanguageCodes);
}
}
}
if (node instanceof Column) {
String columnName = ((Column) node).getColumnName();
if (StringUtils.startsWith(columnName, "rep:facet(")
&& !StringUtils.contains(columnName, "locale=")) {
ExtendedNodeType nodeType = NodeTypeRegistry.getInstance().getNodeType(
selector.getNodeTypeName());
ExtendedPropertyDefinition propDef = propertyName != null ? getPropertyDefinition(
nodeType, selector, propertyName) : null;
if (propDef != null && propDef.isInternationalized()) {
if (getModificationInfo().getMode() == CHECK_FOR_MODIFICATION_MODE) {
getModificationInfo().setModificationNecessary(true);
} else {
String facetOptions = columnName.substring("rep:facet("
.length());
if (languageCodes == null) {
languageCodes = getNewLanguagesPerSelector().get(
selector.getSelectorName());
}
String languageCode = null;
for (String currentLanguageCode : languageCodes) {
if (!NO_LOCALE.equals(currentLanguageCode)) {
languageCode = currentLanguageCode;
break;
}
}
if (!StringUtils.isEmpty(languageCode)) {
columnName = "rep:facet(locale=" + languageCode
+ (facetOptions.trim().length() > 1 ? "&" : "")
+ facetOptions;
QueryObjectModelFactory qomFactory = getModificationInfo()
.getQueryObjectModelFactory();
node = (AbstractQOMNode) qomFactory.column(
selector.getSelectorName(), propertyName,
columnName);
}
}
}