Package javax.jcr.nodetype

Examples of javax.jcr.nodetype.NodeTypeTemplate


  void createFiles() throws RepositoryException {

    NodeTypeManager manager =
        session.getWorkspace().getNodeTypeManager();
    NodeTypeTemplate ntt = manager.createNodeTypeTemplate();
    ntt.setName("nt:saikufiles");
    String[] str = new String[] { "nt:file" };
    ntt.setDeclaredSuperTypeNames(str);
    ntt.setMixin(true);
    PropertyDefinitionTemplate pdt = manager.createPropertyDefinitionTemplate();
    pdt.setName("owner");
    pdt.setRequiredType(PropertyType.STRING);


    PropertyDefinitionTemplate pdt2 = manager.createPropertyDefinitionTemplate();
    pdt2.setName("type");
    pdt2.setRequiredType(PropertyType.STRING);

    PropertyDefinitionTemplate pdt4 = manager.createPropertyDefinitionTemplate();
    pdt4.setName("roles");
    pdt4.setRequiredType(PropertyType.STRING);

    PropertyDefinitionTemplate pdt5 = manager.createPropertyDefinitionTemplate();
    pdt5.setName("users");
    pdt5.setRequiredType(PropertyType.STRING);


    PropertyDefinitionTemplate pdt3 = manager.createPropertyDefinitionTemplate();
    pdt3.setName("jcr:data");
    pdt3.setRequiredType(PropertyType.STRING);

    ntt.getPropertyDefinitionTemplates().add(pdt);
    ntt.getPropertyDefinitionTemplates().add(pdt2);
    ntt.getPropertyDefinitionTemplates().add(pdt3);
    ntt.getPropertyDefinitionTemplates().add(pdt4);
    ntt.getPropertyDefinitionTemplates().add(pdt5);

    try {
      manager.registerNodeType(ntt, false);
    } catch (NodeTypeExistsException e) {
      LOG.error("Node Exists", e);
View Full Code Here


  public void createFileMixin(String type) throws RepositoryException {

    NodeTypeManager manager =
        session.getWorkspace().getNodeTypeManager();
    NodeTypeTemplate ntt = manager.createNodeTypeTemplate();
    ntt.setName(type);
    String[] str = new String[] { "nt:file" };
    ntt.setDeclaredSuperTypeNames(str);
    ntt.setMixin(true);
    PropertyDefinitionTemplate pdt = manager.createPropertyDefinitionTemplate();
    pdt.setName("owner");
    pdt.setRequiredType(PropertyType.STRING);


    PropertyDefinitionTemplate pdt2 = manager.createPropertyDefinitionTemplate();
    pdt2.setName("type");
    pdt2.setRequiredType(PropertyType.STRING);

    PropertyDefinitionTemplate pdt4 = manager.createPropertyDefinitionTemplate();
    pdt4.setName("roles");
    pdt4.setRequiredType(PropertyType.STRING);

    PropertyDefinitionTemplate pdt5 = manager.createPropertyDefinitionTemplate();
    pdt5.setName("users");
    pdt5.setRequiredType(PropertyType.STRING);


    PropertyDefinitionTemplate pdt3 = manager.createPropertyDefinitionTemplate();
    pdt3.setName("jcr:data");
    pdt3.setRequiredType(PropertyType.STRING);

    ntt.getPropertyDefinitionTemplates().add(pdt);
    ntt.getPropertyDefinitionTemplates().add(pdt2);
    ntt.getPropertyDefinitionTemplates().add(pdt3);
    ntt.getPropertyDefinitionTemplates().add(pdt4);
    ntt.getPropertyDefinitionTemplates().add(pdt5);

    try {
      manager.registerNodeType(ntt, false);
    } catch (NodeTypeExistsException e) {
      LOG.error("Node Exists", e);
View Full Code Here

  @SuppressWarnings( "unchecked" )
  @Override
  public NodeTypeDefinition getNodeTypeDefinition( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    NodeTypeTemplate t = ntMgr.createNodeTypeTemplate();
    t.setName( PHO_NT + "locale" ); //$NON-NLS-1$

    // create node definition for default locale
    t.getNodeDefinitionTemplates().add( getLocaleNode( ntMgr, "default" ) );

    // create node definitions for each available locale
    for ( Locale locale : Locale.getAvailableLocales() ) {
      t.getNodeDefinitionTemplates().add( getLocaleNode( ntMgr, locale.toString() ) );
    }

    return t;
  }
View Full Code Here

  @SuppressWarnings( "unchecked" )
  @Override
  public NodeTypeDefinition getNodeTypeDefinition( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    NodeTypeTemplate t = ntMgr.createNodeTypeTemplate();
    t.setName( PHO_NT + "pentahoHierarchyNode" ); //$NON-NLS-1$
    t.setDeclaredSuperTypeNames( new String[] { NT + "hierarchyNode", MIX + "referenceable" } ); //$NON-NLS-1$//$NON-NLS-2$
    t.getNodeDefinitionTemplates().add( getTitleNode( ntMgr ) );
    t.getNodeDefinitionTemplates().add( getDescriptionNode( ntMgr ) );
    t.getNodeDefinitionTemplates().add( getMetadataNode( ntMgr ) );
    t.getNodeDefinitionTemplates().add( getLocaleNode( ntMgr ) );
    t.getPropertyDefinitionTemplates().add( getHiddenProperty( ntMgr, vFac ) );
    return t;
  }
View Full Code Here

  @SuppressWarnings( "unchecked" )
  @Override
  public NodeTypeDefinition getNodeTypeDefinition( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    NodeTypeTemplate t = ntMgr.createNodeTypeTemplate();
    t.setName( PHO_NT + "localizedString" ); //$NON-NLS-1$
    t.getPropertyDefinitionTemplates().add( getRootLocaleProperty( ntMgr, vFac ) );
    t.getPropertyDefinitionTemplates().add( getWildcardStringProperty( ntMgr, vFac ) );
    return t;
  }
View Full Code Here

  @SuppressWarnings( "unchecked" )
  @Override
  public NodeTypeDefinition getNodeTypeDefinition( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    NodeTypeTemplate t = ntMgr.createNodeTypeTemplate();
    t.setName( PHO_NT + "pentahoLockTokenStorage" ); //$NON-NLS-1$
    t.getPropertyDefinitionTemplates().add( getLockedNodeRefProperty( ntMgr, vFac ) );
    t.getPropertyDefinitionTemplates().add( getLockTokenProperty( ntMgr, vFac ) );
    return t;
  }
View Full Code Here

  @SuppressWarnings( "unchecked" )
  @Override
  public NodeTypeDefinition getNodeTypeDefinition( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    NodeTypeTemplate t = ntMgr.createNodeTypeTemplate();
    t.setName( PHO_NT + "pentahoInternalFolder" ); //$NON-NLS-1$
    t.setOrderableChildNodes( true );
    t.getPropertyDefinitionTemplates().add( getWildcardMultipleProperty( ntMgr, vFac ) );
    t.getPropertyDefinitionTemplates().add( getWildcardProperty( ntMgr, vFac ) );
    t.getNodeDefinitionTemplates().add( getWildcardNode( ntMgr, vFac ) );
    return t;
  }
View Full Code Here

  @SuppressWarnings( "unchecked" )
  @Override
  public NodeTypeDefinition getNodeTypeDefinition( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    NodeTypeTemplate t = ntMgr.createNodeTypeTemplate();
    t.setName( PHO_MIX + "pentahoVersionable" ); //$NON-NLS-1$
    t.setMixin( true );
    t.setDeclaredSuperTypeNames( new String[] { MIX + "simpleVersionable" } ); //$NON-NLS-1$
    t.getPropertyDefinitionTemplates().add( getAuthorProperty( ntMgr, vFac ) );
    t.getPropertyDefinitionTemplates().add( getMessageProperty( ntMgr, vFac ) );
    t.getPropertyDefinitionTemplates().add( getAclOnlyChangeProperty( ntMgr, vFac ) );
    return t;
  }
View Full Code Here

  @SuppressWarnings( "unchecked" )
  @Override
  public NodeTypeDefinition getNodeTypeDefinition( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    NodeTypeTemplate t = ntMgr.createNodeTypeTemplate();
    t.setName( PHO_NT + "pentahoFile" ); //$NON-NLS-1$
    t.setDeclaredSuperTypeNames( new String[] { NT + "file", PHO_NT + "pentahoHierarchyNode" } ); //$NON-NLS-1$ //$NON-NLS-2$
    t.getPropertyDefinitionTemplates().add( getLastModifiedProperty( ntMgr, vFac ) );
    t.getPropertyDefinitionTemplates().add( getContentTypeProperty( ntMgr, vFac ) );
    t.getPropertyDefinitionTemplates().add( getFileSizeProperty( ntMgr, vFac ) );
    return t;
  }
View Full Code Here

  @SuppressWarnings( "unchecked" )
  @Override
  public NodeTypeDefinition getNodeTypeDefinition( final NodeTypeManager ntMgr, final ValueFactory vFac )
    throws RepositoryException {
    NodeTypeTemplate t = ntMgr.createNodeTypeTemplate();
    t.setName( PHO_NT + "pentahoFolder" ); //$NON-NLS-1$
    t.setDeclaredSuperTypeNames( new String[] { NT + "folder", PHO_NT + "pentahoHierarchyNode" } ); //$NON-NLS-1$ //$NON-NLS-2$
    t.getNodeDefinitionTemplates().add( getInternalFolderNode( ntMgr, vFac ) );
    return t;
  }
View Full Code Here

TOP

Related Classes of javax.jcr.nodetype.NodeTypeTemplate

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.