private boolean addType ( TypeDefinition type ) { if ( type == null ) { return false ; } if ( type . getBaseTypeId ( ) == null ) { return false ; } // find base type TypeDefinition baseType = null ; if ( type . getBaseTypeId ( ) == BaseTypeId . CMIS_DOCUMENT ) { baseType = copyTypeDefintion ( m_types . get ( DOCUMENT_TYPE_ID ) . getTypeDefinition ( ) ) ; } else if ( type . getBaseTypeId ( ) == BaseTypeId . CMIS_FOLDER ) { baseType = copyTypeDefintion ( m_types . get ( FOLDER_TYPE_ID ) . getTypeDefinition ( ) ) ; } else if ( type . getBaseTypeId ( ) == BaseTypeId . CMIS_RELATIONSHIP ) { baseType = copyTypeDefintion ( m_types . get ( RELATIONSHIP_TYPE_ID ) . getTypeDefinition ( ) ) ; } else if ( type . getBaseTypeId ( ) == BaseTypeId . CMIS_POLICY ) { baseType = copyTypeDefintion ( m_types . get ( POLICY_TYPE_ID ) . getTypeDefinition ( ) ) ; } else { return false ; } AbstractTypeDefinition newType = ( AbstractTypeDefinition ) copyTypeDefintion ( type ) ; // copy property definition for ( PropertyDefinition < ? > propDef : baseType . getPropertyDefinitions ( ) . values ( ) ) { ( ( AbstractPropertyDefinition < ? > ) propDef ) . setIsInherited ( Boolean . TRUE ) ; newType . addPropertyDefinition ( propDef ) ; } // add it addTypeInternal ( newType ) ; return true ; }
Adds a type to collection with inheriting base type properties .