/** {@inheritDoc} */ public String[] getAvailableQueryOperators() throws RemoteException { return def.getAvailableQueryOperators(); }
private void processPropertyDefinition( Node nodeTypeNode, PropertyDefinition propertyDefinition ) throws RepositoryException { Node propertyDefinitionNode = nodeTypeNode.addNode(PROPERTY_DEFINITION, PROPERTY_DEFINITION); if (!RESIDUAL_ITEM_NAME.equals(propertyDefinition.getName())) { propertyDefinitionNode.setProperty(NAME, propertyDefinition.getName()); } propertyDefinitionNode.setProperty(AUTO_CREATED, propertyDefinition.isAutoCreated()); propertyDefinitionNode.setProperty(MANDATORY, propertyDefinition.isMandatory()); propertyDefinitionNode.setProperty(MULTIPLE, propertyDefinition.isMultiple()); propertyDefinitionNode.setProperty(PROTECTED, propertyDefinition.isProtected()); propertyDefinitionNode.setProperty(ON_PARENT_VERSION, OnParentVersionAction.nameFromValue(propertyDefinition.getOnParentVersion())); propertyDefinitionNode.setProperty(REQUIRED_TYPE, org.modeshape.jcr.api.PropertyType.nameFromValue(propertyDefinition.getRequiredType()) .toUpperCase()); String[] availableQueryOperators = propertyDefinition.getAvailableQueryOperators(); propertyDefinitionNode.setProperty(AVAILABLE_QUERY_OPERATORS, availableQueryOperators != null ? availableQueryOperators : new String[0]); Value[] defaultValues = propertyDefinition.getDefaultValues(); propertyDefinitionNode.setProperty(DEFAULT_VALUES, defaultValues != null ? defaultValues : new Value[0]); String[] valueConstraints = propertyDefinition.getValueConstraints(); propertyDefinitionNode.setProperty(VALUE_CONSTRAINTS, valueConstraints != null ? valueConstraints : new String[0]); propertyDefinitionNode.setProperty(IS_FULL_TEXT_SEARCHABLE, propertyDefinition.isFullTextSearchable()); propertyDefinitionNode.setProperty(IS_QUERY_ORDERABLE, propertyDefinition.isQueryOrderable()); }
private void processPropertyDefinition( Node nodeTypeNode, PropertyDefinition propertyDefinition ) throws RepositoryException { Node propertyDefinitionNode = nodeTypeNode.addNode(PROPERTY_DEFINITION, PROPERTY_DEFINITION); if (!RESIDUAL_ITEM_NAME.equals(propertyDefinition.getName())) { propertyDefinitionNode.setProperty(NAME, propertyDefinition.getName()); } propertyDefinitionNode.setProperty(AUTO_CREATED, propertyDefinition.isAutoCreated()); propertyDefinitionNode.setProperty(MANDATORY, propertyDefinition.isMandatory()); propertyDefinitionNode.setProperty(MULTIPLE, propertyDefinition.isMultiple()); propertyDefinitionNode.setProperty(PROTECTED, propertyDefinition.isProtected()); propertyDefinitionNode.setProperty(ON_PARENT_VERSION, OnParentVersionAction.nameFromValue(propertyDefinition.getOnParentVersion())); propertyDefinitionNode.setProperty(REQUIRED_TYPE, org.modeshape.jcr.api.PropertyType.nameFromValue(propertyDefinition.getRequiredType()) .toUpperCase()); String[] availableQueryOperators = propertyDefinition.getAvailableQueryOperators(); propertyDefinitionNode.setProperty(AVAILABLE_QUERY_OPERATORS, availableQueryOperators != null ? availableQueryOperators : new String[0]); Value[] defaultValues = propertyDefinition.getDefaultValues(); propertyDefinitionNode.setProperty(DEFAULT_VALUES, defaultValues != null ? defaultValues : new Value[0]); String[] valueConstraints = propertyDefinition.getValueConstraints(); propertyDefinitionNode.setProperty(VALUE_CONSTRAINTS, valueConstraints != null ? valueConstraints : new String[0]); propertyDefinitionNode.setProperty(IS_FULL_TEXT_SEARCHABLE, propertyDefinition.isFullTextSearchable()); propertyDefinitionNode.setProperty(IS_QUERY_ORDERABLE, propertyDefinition.isQueryOrderable()); }
out.write(Lexer.NOQUERYORDER[0]); String[] qops = pd.getAvailableQueryOperators(); if (qops != null && qops.length > 0) { List<String> opts = new ArrayList<String>(Arrays.asList(qops));
private PropertyDefinitionImpl(PropertyDefinition definition) { super(definition); type = definition.getRequiredType(); valueConstraints = definition.getValueConstraints(); defaultValues = definition.getDefaultValues(); isMultiple = definition.isMultiple(); availableQueryOperators = definition.getAvailableQueryOperators(); isFullTextSearchable = definition.isFullTextSearchable(); isQueryOrderable = definition.isQueryOrderable(); }
/** * Package private constructor * * @param def * @param resolver * @throws javax.jcr.nodetype.ConstraintViolationException */ PropertyDefinitionTemplateImpl(PropertyDefinition def, NamePathResolver resolver) throws ConstraintViolationException { super(def, resolver); type = def.getRequiredType(); defaultValues = def.getDefaultValues(); multiple = def.isMultiple(); fullTextSearchable = def.isFullTextSearchable(); queryOrderable = def.isQueryOrderable(); queryOperators = def.getAvailableQueryOperators(); setValueConstraints(def.getValueConstraints()); }
/** * Package private constructor * * @param def * @param resolver * @throws javax.jcr.nodetype.ConstraintViolationException */ PropertyDefinitionTemplateImpl(PropertyDefinition def, NamePathResolver resolver) throws ConstraintViolationException { super(def, resolver); type = def.getRequiredType(); defaultValues = def.getDefaultValues(); multiple = def.isMultiple(); fullTextSearchable = def.isFullTextSearchable(); queryOrderable = def.isQueryOrderable(); queryOperators = def.getAvailableQueryOperators(); setValueConstraints(def.getValueConstraints()); }
PropertyDefinitionTemplateImpl( NameMapper mapper, PropertyDefinition definition) throws ConstraintViolationException { super(mapper, definition); setRequiredType(definition.getRequiredType()); setMultiple(definition.isMultiple()); setFullTextSearchable(definition.isFullTextSearchable()); setQueryOrderable(definition.isQueryOrderable()); setAvailableQueryOperators(definition.getAvailableQueryOperators()); setValueConstraints(definition.getValueConstraints()); setDefaultValues(definition.getDefaultValues()); }
PropertyDefinitionTemplateImpl( NameMapper mapper, PropertyDefinition definition) throws ConstraintViolationException { super(mapper, definition); setRequiredType(definition.getRequiredType()); setMultiple(definition.isMultiple()); setFullTextSearchable(definition.isFullTextSearchable()); setQueryOrderable(definition.isQueryOrderable()); setAvailableQueryOperators(definition.getAvailableQueryOperators()); setValueConstraints(definition.getValueConstraints()); setDefaultValues(definition.getDefaultValues()); }
PropertyDefinitionTemplateImpl( NameMapper mapper, PropertyDefinition definition) throws ConstraintViolationException { super(mapper, definition); setRequiredType(definition.getRequiredType()); setMultiple(definition.isMultiple()); setFullTextSearchable(definition.isFullTextSearchable()); setQueryOrderable(definition.isQueryOrderable()); setAvailableQueryOperators(definition.getAvailableQueryOperators()); setValueConstraints(definition.getValueConstraints()); setDefaultValues(definition.getDefaultValues()); }
assertThat(defaultValues[0].getString(), is("default1")); assertThat(defaultValues[1].getString(), is("default2")); String[] queryOps = propDefn.getAvailableQueryOperators(); assertThat(queryOps[0], is("=")); assertThat(queryOps[1], is("<>"));
/** * Creates a new property definition based on <code>propDef</code>. * * @param propDef the JCR property definition. * @param resolver the name/path resolver of the session that provided * the property definition. * @param qValueFactory the QValue factory. * @throws RepositoryException if an error occurs while reading from * <code>propDef</code>. */ public QPropertyDefinitionImpl(PropertyDefinition propDef, NamePathResolver resolver, QValueFactory qValueFactory) throws RepositoryException { this(propDef.getName().equals(NameConstants.ANY_NAME.getLocalName()) ? NameConstants.ANY_NAME : resolver.getQName(propDef.getName()), resolver.getQName(propDef.getDeclaringNodeType().getName()), propDef.isAutoCreated(), propDef.isMandatory(), propDef.getOnParentVersion(), propDef.isProtected(), convertValues(propDef.getDefaultValues(), resolver, qValueFactory), propDef.isMultiple(), propDef.getRequiredType(), ValueConstraint.create(propDef.getRequiredType(), propDef.getValueConstraints(), resolver), propDef.getAvailableQueryOperators(), propDef.isFullTextSearchable(), propDef.isQueryOrderable()); }
/** * Creates a new property definition based on <code>propDef</code>. * * @param propDef the JCR property definition. * @param resolver the name/path resolver of the session that provided * the property definition. * @param qValueFactory the QValue factory. * @throws RepositoryException if an error occurs while reading from * <code>propDef</code>. */ public QPropertyDefinitionImpl(PropertyDefinition propDef, NamePathResolver resolver, QValueFactory qValueFactory) throws RepositoryException { this(propDef.getName().equals(NameConstants.ANY_NAME.getLocalName()) ? NameConstants.ANY_NAME : resolver.getQName(propDef.getName()), resolver.getQName(propDef.getDeclaringNodeType().getName()), propDef.isAutoCreated(), propDef.isMandatory(), propDef.getOnParentVersion(), propDef.isProtected(), convertValues(propDef.getDefaultValues(), resolver, qValueFactory), propDef.isMultiple(), propDef.getRequiredType(), ValueConstraint.create(propDef.getRequiredType(), propDef.getValueConstraints(), resolver), propDef.getAvailableQueryOperators(), propDef.isFullTextSearchable(), propDef.isQueryOrderable()); }
propDef.getRequiredType(), constraints, propDef.getAvailableQueryOperators(), propDef.isFullTextSearchable(), propDef.isQueryOrderable());
propDef.getRequiredType(), constraints, propDef.getAvailableQueryOperators(), propDef.isFullTextSearchable(), propDef.isQueryOrderable());
private JcrPropertyDefinition propertyDefinitionFrom( PropertyDefinition propDefn ) throws RepositoryException { Name propertyName = nameFactory.create(propDefn.getName()); int onParentVersionBehavior = propDefn.getOnParentVersion(); int requiredType = propDefn.getRequiredType(); boolean mandatory = propDefn.isMandatory(); boolean multiple = propDefn.isMultiple(); boolean autoCreated = propDefn.isAutoCreated(); boolean isProtected = propDefn.isProtected(); boolean fullTextSearchable = propDefn.isFullTextSearchable(); boolean queryOrderable = propDefn.isQueryOrderable(); Value[] defaultValues = propDefn.getDefaultValues(); JcrValue[] jcrDefaultValues = null; if (defaultValues != null) { jcrDefaultValues = new JcrValue[defaultValues.length]; for (int i = 0; i != defaultValues.length; ++i) { Value value = defaultValues[i]; jcrDefaultValues[i] = new JcrValue(this.context.getValueFactories(), value); } } String[] valueConstraints = propDefn.getValueConstraints(); String[] queryOperators = propDefn.getAvailableQueryOperators(); if (valueConstraints == null) valueConstraints = new String[0]; NodeKey prototypeKey = repository.repositoryCache().getSystemKey(); return new JcrPropertyDefinition(this.context, null, prototypeKey, propertyName, onParentVersionBehavior, autoCreated, mandatory, isProtected, jcrDefaultValues, requiredType, valueConstraints, multiple, fullTextSearchable, queryOrderable, queryOperators); }
assertEquals(pda[i].getName(), pda1[i].getName()); assertEquals(pda[i].getRequiredType(), pda1[i].getRequiredType()); assertTrue(Arrays.equals(pda[i].getAvailableQueryOperators(), pda1[i].getAvailableQueryOperators())); assertTrue(Arrays.equals(pda[i].getValueConstraints(), pda1[i].getValueConstraints())); assertEquals(pda[i].isFullTextSearchable(), pda1[i].isFullTextSearchable());
private JcrPropertyDefinition propertyDefinitionFrom( PropertyDefinition propDefn ) throws RepositoryException { Name propertyName = nameFactory.create(propDefn.getName()); int onParentVersionBehavior = propDefn.getOnParentVersion(); int requiredType = propDefn.getRequiredType(); boolean mandatory = propDefn.isMandatory(); boolean multiple = propDefn.isMultiple(); boolean autoCreated = propDefn.isAutoCreated(); boolean isProtected = propDefn.isProtected(); boolean fullTextSearchable = propDefn.isFullTextSearchable(); boolean queryOrderable = propDefn.isQueryOrderable(); Value[] defaultValues = propDefn.getDefaultValues(); JcrValue[] jcrDefaultValues = null; if (defaultValues != null) { jcrDefaultValues = new JcrValue[defaultValues.length]; for (int i = 0; i != defaultValues.length; ++i) { Value value = defaultValues[i]; jcrDefaultValues[i] = new JcrValue(this.context.getValueFactories(), value); } } String[] valueConstraints = propDefn.getValueConstraints(); String[] queryOperators = propDefn.getAvailableQueryOperators(); if (valueConstraints == null) valueConstraints = new String[0]; NodeKey prototypeKey = repository.repositoryCache().getSystemKey(); return new JcrPropertyDefinition(this.context, null, prototypeKey, propertyName, onParentVersionBehavior, autoCreated, mandatory, isProtected, jcrDefaultValues, requiredType, valueConstraints, multiple, fullTextSearchable, queryOrderable, queryOperators); }
pdt.setAvailableQueryOperators(propertyDefinition.getAvailableQueryOperators()); pdt.setDefaultValues(propertyDefinition.getDefaultValues()); pdt.setFullTextSearchable(propertyDefinition.isFullTextSearchable());
pdt.setAvailableQueryOperators(propertyDefinition.getAvailableQueryOperators()); pdt.setDefaultValues(propertyDefinition.getDefaultValues()); pdt.setFullTextSearchable(propertyDefinition.isFullTextSearchable());