Package javax.jcr.nodetype

Examples of javax.jcr.nodetype.PropertyDefinitionTemplate


    return t;
  }

  private PropertyDefinitionTemplate getWildcardMultipleProperty( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
    t.setName( "*" ); //$NON-NLS-1$
    t.setRequiredType( PropertyType.UNDEFINED );
    t.setOnParentVersion( OnParentVersionAction.IGNORE );
    t.setMultiple( false );
    return t;
  }
View Full Code Here


    return t;
  }

  private PropertyDefinitionTemplate getAuthorProperty( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
    t.setName( PHO + "versionAuthor" ); //$NON-NLS-1$
    t.setRequiredType( PropertyType.STRING );
    t.setOnParentVersion( OnParentVersionAction.COPY );
    t.setMultiple( false );
    return t;
  }
View Full Code Here

    return t;
  }

  private PropertyDefinitionTemplate getMessageProperty( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
    t.setName( PHO + "versionMessage" ); //$NON-NLS-1$
    t.setRequiredType( PropertyType.STRING );
    t.setOnParentVersion( OnParentVersionAction.COPY );
    t.setMultiple( false );
    return t;
  }
View Full Code Here

    return t;
  }

  private PropertyDefinitionTemplate getAclOnlyChangeProperty( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
    t.setName( PHO + "aclOnlyChange" ); //$NON-NLS-1$
    t.setRequiredType( PropertyType.BOOLEAN );
    t.setOnParentVersion( OnParentVersionAction.COPY );
    t.setMultiple( false );
    return t;
  }
View Full Code Here

    return t;
  }

  private PropertyDefinitionTemplate getLastModifiedProperty( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
    t.setName( PHO + "lastModified" ); //$NON-NLS-1$
    t.setRequiredType( PropertyType.DATE );
    t.setMandatory( true );
    t.setOnParentVersion( OnParentVersionAction.IGNORE );
    t.setMultiple( false );
    return t;
  }
View Full Code Here

    return t;
  }

  private PropertyDefinitionTemplate getContentTypeProperty( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
    t.setName( PHO + "contentType" ); //$NON-NLS-1$
    t.setRequiredType( PropertyType.STRING );
    t.setMandatory( true );
    t.setOnParentVersion( OnParentVersionAction.COPY );
    t.setMultiple( false );
    return t;
  }
View Full Code Here

    return t;
  }

  private PropertyDefinitionTemplate getFileSizeProperty( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    PropertyDefinitionTemplate t = ntMgr.createPropertyDefinitionTemplate();
    t.setName( PHO + "fileSize" ); //$NON-NLS-1$
    t.setRequiredType( PropertyType.LONG );
    t.setOnParentVersion( OnParentVersionAction.COPY );
    t.setMultiple( false );
    return t;
  }
View Full Code Here

        assertNull(ntt.getPrimaryItemName());

        ntt.setPrimaryItemName(jcrPrimaryType);
        assertEquals(jcrPrimaryType, ntt.getPrimaryItemName());

        PropertyDefinitionTemplate pdTemplate = createBooleanPropTemplate();

        List pdefs = ntt.getPropertyDefinitionTemplates();
        pdefs.add(pdTemplate);

        assertNotNull(ntt.getDeclaredPropertyDefinitions());
View Full Code Here

        assertEquals(1, ndefs.size());
        assertEquals(ndTemplate, ndefs.get(0));
    }

    public void testEmptyPropertyDefinitionTemplate() throws Exception {
        PropertyDefinitionTemplate pdt = ntm.createPropertyDefinitionTemplate();

        assertNull(pdt.getName());
        assertFalse(pdt.isAutoCreated());
        assertFalse(pdt.isMandatory());
        assertFalse(pdt.isProtected());
        assertEquals(OnParentVersionAction.COPY, pdt.getOnParentVersion());
        assertNull(pdt.getDeclaringNodeType());

        assertEquals(PropertyType.STRING, pdt.getRequiredType());
        assertFalse(pdt.isMultiple());
        assertNull(pdt.getValueConstraints());
        assertNull(pdt.getDefaultValues());

        // TODO: add tests for default values of (missing definition in API)
        // getAvailableQueryOperators
        // isFullTextSearchable
        // isQueryOrderable
View Full Code Here

        // isQueryOrderable

    }

    public void testPropertyDefinitionTemplate() throws Exception {
        PropertyDefinitionTemplate pdt = createBooleanPropTemplate();

        assertEquals(jcrPropName, pdt.getName());
        try {
            pdt.setName(null);
            fail("null isn't a valid JCR name");
        } catch (ConstraintViolationException e) {
            // success
        }


        assertEquals(false, pdt.isAutoCreated());
        assertEquals(false, pdt.isMandatory());
        assertEquals(OnParentVersionAction.IGNORE, pdt.getOnParentVersion());
        assertEquals(false, pdt.isProtected());
        assertEquals(PropertyType.BOOLEAN, pdt.getRequiredType());
        assertEquals(null, pdt.getValueConstraints());
        assertEquals(null, pdt.getDefaultValues());
        assertEquals(false, pdt.isMultiple());
        String[] qo = pdt.getAvailableQueryOperators();
        assertEquals(1, qo.length);
        assertEquals(QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, qo[0]);
        assertEquals(false, pdt.isFullTextSearchable());
        assertEquals(false, pdt.isQueryOrderable());
    }
View Full Code Here

TOP

Related Classes of javax.jcr.nodetype.PropertyDefinitionTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.