use of javax.jcr.nodetype.PropertyDefinitionTemplate in project jackrabbit by apache.
the class NodeTypeDefinitionFactory method create.
/**
* Create a new JCR property definition from the given <code>QPropertyDefinition</code>.
*
* @param qPd A SPI property definition.
* @return the corresponding JCR property definition.
* @throws RepositoryException if an error occurs.
*/
public PropertyDefinition create(QPropertyDefinition qPd) throws RepositoryException {
PropertyDefinitionTemplate pt = ntMgr.createPropertyDefinitionTemplate();
pt.setName(getJCRName(qPd.getName()));
pt.setAutoCreated(qPd.isAutoCreated());
pt.setMandatory(qPd.isMandatory());
pt.setOnParentVersion(qPd.getOnParentVersion());
pt.setProtected(qPd.isProtected());
pt.setRequiredType(qPd.getRequiredType());
pt.setMultiple(qPd.isMultiple());
pt.setFullTextSearchable(qPd.isFullTextSearchable());
pt.setValueConstraints(createValueConstraints(qPd.getRequiredType(), qPd.getValueConstraints()));
pt.setAvailableQueryOperators(qPd.getAvailableQueryOperators());
pt.setQueryOrderable(qPd.isQueryOrderable());
pt.setDefaultValues(createValues(qPd.getDefaultValues()));
return pt;
}
use of javax.jcr.nodetype.PropertyDefinitionTemplate in project pentaho-platform by pentaho.
the class FileNtdProvider method getLastModifiedProperty.
private PropertyDefinitionTemplate getLastModifiedProperty(final NodeTypeManager ntMgr, final ValueFactory vFac) throws RepositoryException {
PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
// $NON-NLS-1$
t.setName(PHO + "lastModified");
t.setRequiredType(PropertyType.DATE);
t.setMandatory(true);
t.setOnParentVersion(OnParentVersionAction.IGNORE);
t.setMultiple(false);
return t;
}
use of javax.jcr.nodetype.PropertyDefinitionTemplate in project pentaho-platform by pentaho.
the class FileNtdProvider method getFileSizeProperty.
private PropertyDefinitionTemplate getFileSizeProperty(final NodeTypeManager ntMgr, final ValueFactory vFac) throws RepositoryException {
PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
// $NON-NLS-1$
t.setName(PHO + "fileSize");
t.setRequiredType(PropertyType.LONG);
t.setOnParentVersion(OnParentVersionAction.COPY);
t.setMultiple(false);
return t;
}
use of javax.jcr.nodetype.PropertyDefinitionTemplate in project pentaho-platform by pentaho.
the class FileNtdProvider method getContentTypeProperty.
private PropertyDefinitionTemplate getContentTypeProperty(final NodeTypeManager ntMgr, final ValueFactory vFac) throws RepositoryException {
PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
// $NON-NLS-1$
t.setName(PHO + "contentType");
t.setRequiredType(PropertyType.STRING);
t.setMandatory(true);
t.setOnParentVersion(OnParentVersionAction.COPY);
t.setMultiple(false);
return t;
}
use of javax.jcr.nodetype.PropertyDefinitionTemplate in project pentaho-platform by pentaho.
the class InternalFolderNtdProvider method getWildcardMultipleProperty.
private PropertyDefinitionTemplate getWildcardMultipleProperty(final NodeTypeManager ntMgr, final ValueFactory vFac) throws RepositoryException {
PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
// $NON-NLS-1$
t.setName("*");
t.setRequiredType(PropertyType.UNDEFINED);
t.setOnParentVersion(OnParentVersionAction.IGNORE);
t.setMultiple(false);
return t;
}
Aggregations