Once you set primary type, you can set properties based on mapping table. Example:
https://github.com/okulikov/modeshape/blob/master/modeshape-jcr/src/main/java/org/modeshape/connector/filesystem/FileSystemConnector.java#L436

Map properties by mapping table: cmis:folder -> nt:folder, cmis:document -> nt:folder
Use direct mapping for sub-types