Search in sources :

Example 31 with PropertyDefinitionTemplate

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;
}
Also used : PropertyDefinitionTemplate(javax.jcr.nodetype.PropertyDefinitionTemplate)

Example 32 with PropertyDefinitionTemplate

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;
}
Also used : PropertyDefinitionTemplate(javax.jcr.nodetype.PropertyDefinitionTemplate)

Example 33 with PropertyDefinitionTemplate

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;
}
Also used : PropertyDefinitionTemplate(javax.jcr.nodetype.PropertyDefinitionTemplate)

Example 34 with PropertyDefinitionTemplate

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;
}
Also used : PropertyDefinitionTemplate(javax.jcr.nodetype.PropertyDefinitionTemplate)

Example 35 with PropertyDefinitionTemplate

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;
}
Also used : PropertyDefinitionTemplate(javax.jcr.nodetype.PropertyDefinitionTemplate)

Aggregations

PropertyDefinitionTemplate (javax.jcr.nodetype.PropertyDefinitionTemplate)38 NodeTypeTemplate (javax.jcr.nodetype.NodeTypeTemplate)16 NodeTypeManager (javax.jcr.nodetype.NodeTypeManager)9 Node (javax.jcr.Node)8 Session (javax.jcr.Session)8 List (java.util.List)7 Value (javax.jcr.Value)5 ByteArrayInputStream (java.io.ByteArrayInputStream)4 ConstraintViolationException (javax.jcr.nodetype.ConstraintViolationException)4 NodeDefinitionTemplate (javax.jcr.nodetype.NodeDefinitionTemplate)4 Test (org.junit.Test)4 RepositoryException (javax.jcr.RepositoryException)3 NodeType (javax.jcr.nodetype.NodeType)3 NodeTypeDefinition (javax.jcr.nodetype.NodeTypeDefinition)3 KyloVersion (com.thinkbiganalytics.KyloVersion)2 JcrMetadataAccess (com.thinkbiganalytics.metadata.modeshape.JcrMetadataAccess)2 JcrUtil (com.thinkbiganalytics.metadata.modeshape.support.JcrUtil)2 JcrVersionUtil (com.thinkbiganalytics.metadata.modeshape.support.JcrVersionUtil)2 KyloUpgrader (com.thinkbiganalytics.server.upgrade.KyloUpgrader)2 UpgradeException (com.thinkbiganalytics.server.upgrade.UpgradeException)2